From 2d6c7d20d1d7f789a7fb4f189bfa6d9698c7cb39 Mon Sep 17 00:00:00 2001 From: daybrush Date: Wed, 6 May 2020 22:25:06 +0900 Subject: [PATCH] chore: release 3.6.3-rc --- .gitignore | 1 + dist/infinitegrid.esm.js | 5563 --------------- dist/infinitegrid.esm.js.map | 1 - dist/infinitegrid.framelayout.js | 5067 -------------- dist/infinitegrid.framelayout.js.map | 1 - dist/infinitegrid.framelayout.min.js | 10 - dist/infinitegrid.framelayout.min.js.map | 1 - dist/infinitegrid.gridlayout.js | 4949 ------------- dist/infinitegrid.gridlayout.js.map | 1 - dist/infinitegrid.gridlayout.min.js | 10 - dist/infinitegrid.gridlayout.min.js.map | 1 - dist/infinitegrid.js | 5583 --------------- dist/infinitegrid.js.map | 1 - dist/infinitegrid.justifiedlayout.js | 5184 -------------- dist/infinitegrid.justifiedlayout.js.map | 1 - dist/infinitegrid.justifiedlayout.min.js | 10 - dist/infinitegrid.justifiedlayout.min.js.map | 1 - dist/infinitegrid.min.js | 10 - dist/infinitegrid.min.js.map | 1 - dist/infinitegrid.packinglayout.js | 5031 -------------- dist/infinitegrid.packinglayout.js.map | 1 - dist/infinitegrid.packinglayout.min.js | 10 - dist/infinitegrid.packinglayout.min.js.map | 1 - dist/infinitegrid.pkgd.js | 6541 ------------------ dist/infinitegrid.pkgd.js.map | 1 - dist/infinitegrid.pkgd.min.js | 10 - dist/infinitegrid.pkgd.min.js.map | 1 - dist/infinitegrid.squarelayout.js | 5264 -------------- dist/infinitegrid.squarelayout.js.map | 1 - dist/infinitegrid.squarelayout.min.js | 10 - dist/infinitegrid.squarelayout.min.js.map | 1 - dist/parallax.d.ts | 28 - dist/parallax.js | 450 -- dist/parallax.js.map | 1 - dist/parallax.min.js | 10 - dist/parallax.min.js.map | 1 - dist/types.d.ts | 256 - package.json | 2 +- 38 files changed, 2 insertions(+), 44014 deletions(-) delete mode 100644 dist/infinitegrid.esm.js delete mode 100644 dist/infinitegrid.esm.js.map delete mode 100644 dist/infinitegrid.framelayout.js delete mode 100644 dist/infinitegrid.framelayout.js.map delete mode 100644 dist/infinitegrid.framelayout.min.js delete mode 100644 dist/infinitegrid.framelayout.min.js.map delete mode 100644 dist/infinitegrid.gridlayout.js delete mode 100644 dist/infinitegrid.gridlayout.js.map delete mode 100644 dist/infinitegrid.gridlayout.min.js delete mode 100644 dist/infinitegrid.gridlayout.min.js.map delete mode 100644 dist/infinitegrid.js delete mode 100644 dist/infinitegrid.js.map delete mode 100644 dist/infinitegrid.justifiedlayout.js delete mode 100644 dist/infinitegrid.justifiedlayout.js.map delete mode 100644 dist/infinitegrid.justifiedlayout.min.js delete mode 100644 dist/infinitegrid.justifiedlayout.min.js.map delete mode 100644 dist/infinitegrid.min.js delete mode 100644 dist/infinitegrid.min.js.map delete mode 100644 dist/infinitegrid.packinglayout.js delete mode 100644 dist/infinitegrid.packinglayout.js.map delete mode 100644 dist/infinitegrid.packinglayout.min.js delete mode 100644 dist/infinitegrid.packinglayout.min.js.map delete mode 100644 dist/infinitegrid.pkgd.js delete mode 100644 dist/infinitegrid.pkgd.js.map delete mode 100644 dist/infinitegrid.pkgd.min.js delete mode 100644 dist/infinitegrid.pkgd.min.js.map delete mode 100644 dist/infinitegrid.squarelayout.js delete mode 100644 dist/infinitegrid.squarelayout.js.map delete mode 100644 dist/infinitegrid.squarelayout.min.js delete mode 100644 dist/infinitegrid.squarelayout.min.js.map delete mode 100644 dist/parallax.d.ts delete mode 100644 dist/parallax.js delete mode 100644 dist/parallax.js.map delete mode 100644 dist/parallax.min.js delete mode 100644 dist/parallax.min.js.map delete mode 100644 dist/types.d.ts diff --git a/.gitignore b/.gitignore index a9c7a276d..c6cb6bd2d 100644 --- a/.gitignore +++ b/.gitignore @@ -214,3 +214,4 @@ CHANGELOG.md build/ packages/*/dist declaration/ +dist/ diff --git a/dist/infinitegrid.esm.js b/dist/infinitegrid.esm.js deleted file mode 100644 index be1f06e82..000000000 --- a/dist/infinitegrid.esm.js +++ /dev/null @@ -1,5563 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -import Component from '@egjs/component'; -import { diff } from '@egjs/list-differ'; -import { check, removeAutoSizer } from '@egjs/lazyloaded'; - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/* global Reflect, Promise */ -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); -}; - -function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); -}; - -var win; - -if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; -} else { - win = window; -} -var document = win.document; - -var _a; -var ua = win.navigator.userAgent; -var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); -var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document); -var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; -}(); -var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); -var IS_IOS = /iPhone|iPad/.test(ua); -var IS_ANDROID2 = /Android 2\./.test(ua); -var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; -var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; -var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; -var VERTICAL = "vertical"; -var HORIZONTAL = "horizontal"; -var DUMMY_POSITION = -100000; -var GROUPKEY_ATT = "data-groupkey"; -var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false -}; -var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 -}; -var agent = ua.toLowerCase(); -var isMobile = /mobi|ios|android/.test(agent); -var ALIGN = { - START: "start", - CENTER: "center", - END: "end", - JUSTIFY: "justify" -}; -var IDLE = 0; -var LOADING_APPEND = 1; -var LOADING_PREPEND = 2; -var PROCESSING = 4; -var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); -var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; -var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; -var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; -var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; -}(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; -var INFINITEGRID_EVENTS = ["append", "prepend", "imageError", "change", "layoutComplete"]; // It's for making mistakes. -// Whenever you add a public method, you must add the corresponding method name to an array or object. -// An additional error may occur if not added. - -var INFINITEGRID_METHODS = { - getLoadingBar: true, - getItem: true, - getItems: true, - layout: true, - getGroupKeys: true, - getStatus: true, - setStatus: true, - isProcessing: true, - startLoading: true, - endLoading: true, - isLoading: true, - updateItem: true, - updateItems: true, - moveTo: true -}; - -function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; -} -function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); -} -function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; -} -function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } -} -function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } -} -function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); -} -function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document.body[prop] || document.documentElement[prop]; - } else { - return el[prop]; - } -} -function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } -} -function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } -} -function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; -} - -function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } -} - -function innerWidth(el) { - return _getSize(el, "Width", false); -} -function innerHeight(el) { - return _getSize(el, "Height", false); -} -function outerWidth(el) { - return _getSize(el, "Width", true); -} -function outerHeight(el) { - return _getSize(el, "Height", true); -} -function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; -} -var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } -}; -function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; -} -function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; -} -function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); -} -function toZeroArray(outline) { - if (!outline || !outline.length) { - return [0]; - } - - return outline; -} -function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); -} -function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; -} -function isWindow(el) { - return el === win; -} -function isDocument(el) { - return el.nodeType === 9; -} -function fill(arr, value) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - arr[i] = value; - } - - return arr; -} -function isUndefined(target) { - return typeof target === "undefined"; -} -function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; -} -function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; -} -function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; -} -function resetSize(item) { - item.orgSize = null; - item.size = null; -} -function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; -} -/** - * Decorator that makes the method of infinitegrid available in the framework. - * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터. - * @memberof eg.InfiniteGrid - * @private - * @example - * ```js - * import NativeInfiniteGrid, { withInfiniteGridMethods } from "@egjs/infinitegrid"; - * - * class InfiniteGrid extends React.Component> { - * @withInfiniteGridMethods - * private infinitegrid: NativeInfiniteGrid; - * } - * ``` - */ - -function withInfiniteGridMethods(prototype, infinitegridName) { - Object.keys(INFINITEGRID_METHODS).forEach(function (name) { - if (prototype[name]) { - return; - } - - prototype[name] = function () { - var args = []; - - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - - var _a; - - var result = (_a = this[infinitegridName])[name].apply(_a, args); // fix `this` type to return your own `infinitegrid` instance to the instance using the decorator. - - - if (result === this[infinitegridName]) { - return this; - } else { - return result; - } - }; - }); -} -function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); -} -function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } -} - -var ItemManager = -/*#__PURE__*/ -function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; -}(); - -function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; -} - -function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; -} - -function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; -} - -function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); -} - -var DOMRenderer = -/*#__PURE__*/ -function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; -}(); - -function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; -} - -var Infinite = -/*#__PURE__*/ -function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; -}(); - -function hasTarget(target, value) { - return ~target.indexOf(value); -} - -var RenderManager = -/*#__PURE__*/ -function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - removeAutoSizer(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; -}(); - -var Watcher = -/*#__PURE__*/ -function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; -}(); - -// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - -/* eslint-disable */ -// if (typeof Object.create !== "function") { -// // tslint:disable -// Object.create = (o: any, properties: any) => { -// if (typeof o !== "object" && typeof o !== "function") { -// throw new TypeError("Object prototype may only be an Object: " + o); -// } else if (o === null) { -// throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); -// } -// function F() { } -// F.prototype = o; -// return new F(); -// }; -// // tslint:enable -// } - -/* eslint-enable */ - -/** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example -``` - - -``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - -var InfiniteGrid = -/*#__PURE__*/ -function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; -}(Component); - -var START = ALIGN.START, - CENTER = ALIGN.CENTER, - END = ALIGN.END, - JUSTIFY = ALIGN.JUSTIFY; -/** - * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card. - * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다. - * @class eg.InfiniteGrid.GridLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @example -``` - -``` - **/ - -var GridLayout = -/*#__PURE__*/ -function () { - function GridLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - align: START, - itemSize: 0 - }, options); - this._size = 0; - this._columnSize = 0; - this._columnLength = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - var __proto = GridLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.GridLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - var _this = this; - - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var firstItem = groups.length && groups[0].items.length && groups[0].items[0]; - this.checkColumn(firstItem); // if outlines' length and columns' length are now same, re-caculate outlines. - - var startOutline; - - if (outline.length !== this._columnLength) { - var pos = outline.length === 0 ? 0 : Math.min.apply(Math, outline); // re-layout items. - - startOutline = fill(new Array(this._columnLength), pos); - } else { - startOutline = outline.slice(); - } - - groups.forEach(function (group) { - var items = group.items; - - var result = _this._layout(items, startOutline, true); - - group.outlines = result; - startOutline = result.end; - }); - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.GridLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto.checkColumn = function (item) { - var _a = this.options, - itemSize = _a.itemSize, - margin = _a.margin, - horizontal = _a.horizontal; - var sizeName = horizontal ? "height" : "width"; - var columnSize = Math.floor(itemSize || item && item.size[sizeName] || 0) || 0; - this._columnSize = columnSize; - - if (!columnSize) { - this._columnLength = 1; - return; - } - - this._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1); - }; - - __proto._layout = function (items, outline, isAppend) { - var _a; - - var length = items.length; - var margin = this.options.margin; - var align = this.options.align; - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - var columnSize = this._columnSize; - var columnLength = this._columnLength; - var size = this._size; - var viewDist = size - (columnSize + margin) * columnLength + margin; - var pointCaculateName = isAppend ? "min" : "max"; - var indexCaculateName = isAppend ? "indexOf" : "lastIndexOf"; - var startOutline = outline.slice(); - var endOutline = outline.slice(); - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline) || 0; - var index = endOutline[indexCaculateName](point); - var item = items[isAppend ? i : length - 1 - i]; - var itemSize = item.size; - - if (!itemSize) { - continue; - } - - var size1 = itemSize[size1Name]; - var size2 = itemSize[size2Name]; - var pos1 = isAppend ? point : point - margin - size1; - var endPos1 = pos1 + size1 + margin; - - if (index === -1) { - index = 0; - } - - var pos2 = (columnSize + margin) * index; // ALIGN - - if (align === CENTER) { - pos2 += viewDist / 2; - } else if (align === END) { - pos2 += viewDist + columnSize - size2; - } else if (align === JUSTIFY) { - if (columnLength <= 1) { - pos2 += viewDist / 2; - } else { - pos2 = (size - columnSize) / (columnLength - 1) * index; - } - } // tetris - - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a); - item.column = index; - endOutline[index] = isAppend ? endPos1 : pos1; - } - - if (!isAppend) { - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } // if append items, startOutline is low, endOutline is high - // if prepend items, startOutline is high, endOutline is low - - - return { - start: isAppend ? startOutline : endOutline, - end: isAppend ? endOutline : startOutline - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } - - var clone = cache ? items : cloneItems(items); - var startOutline = outline; - - if (!this._columnLength) { - this.checkColumn(items[0]); - } - - if (outline.length !== this._columnLength) { - startOutline = fill(new Array(this._columnLength), outline.length ? Math[isAppend ? "min" : "max"].apply(Math, outline) || 0 : 0); - } - - var result = this._layout(clone, startOutline, isAppend); - - return { - items: clone, - outlines: result - }; - }; - - return GridLayout; -}(); - -/* -Frame -[ -[1, 1, 1, 1, 1], -[0, 0, 2, 2, 2], -[0, 0, 2, 2, 2], -[3, 4, 5, 5, 5], -] -*/ - -function disableFrame(frame, type, top, left, width, height) { - for (var i = top; i < top + height; ++i) { - for (var j = left; j < left + width; ++j) { - if (type !== frame[i][j]) { - continue; - } - - frame[i][j] = 0; - } - } -} - -function searchShapeInFrame(frame, type, top, left, width, height) { - var size = { - left: left, - top: top, - type: type, - width: 1, - height: 1 - }; - - for (var i = left; i < width; ++i) { - if (frame[top][i] === type) { - size.width = i - left + 1; - continue; - } - - break; - } - - for (var i = top; i < height; ++i) { - if (frame[i][left] === type) { - size.height = i - top + 1; - continue; - } - - break; - } // After finding the shape, it will not find again. - - - disableFrame(frame, type, top, left, size.width, size.height); - return size; -} - -function getShapes(frame) { - var height = frame.length; - var width = height ? frame[0].length : 0; - var shapes = []; - - for (var i = 0; i < height; ++i) { - for (var j = 0; j < width; ++j) { - var type = frame[i][j]; - - if (!type) { - continue; - } // Separate shapes with other numbers. - - - shapes.push(searchShapeInFrame(frame, type, i, j, width, height)); - } - } - - shapes.sort(function (a, b) { - return a.type < b.type ? -1 : 1; - }); - return { - shapes: shapes, - width: width, - height: height - }; -} -/** - * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm. - * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다. - * @class eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. - * @example -``` - -``` - **/ - - -var FrameLayout = -/*#__PURE__*/ -function () { - function FrameLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - itemSize: 0, - frame: [], - frameFill: true - }, options); - var frame = this.options.frame.map(function (row) { - return row.slice(); - }); - this._itemSize = this.options.itemSize || 0; // divide frame into shapes. - - this._shapes = getShapes(frame); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - var __proto = FrameLayout.prototype; - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.FrameLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - - __proto._getItemSize = function () { - this._checkItemSize(); - - return this._itemSize; - }; - - __proto._checkItemSize = function () { - if (this.options.itemSize) { - this._itemSize = this.options.itemSize; - return; - } - - var style = this._style; - var size = style.size2; - var margin = this.options.margin; // if itemSize is not in options, caculate itemSize from size. - - this._itemSize = (this._size + margin) / this._shapes[size] - margin; - }; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var length = items.length; - var style = this._style; - var _b = this.options, - margin = _b.margin, - frameFill = _b.frameFill; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - var itemSize = this._getItemSize(); - - var isItemObject = typeof itemSize === "object"; - var itemSize2 = isItemObject ? itemSize[size2Name] : itemSize; - var itemSize1 = isItemObject ? itemSize[size1Name] : itemSize; - var shapesSize = this._shapes[size2Name]; - var shapes = this._shapes.shapes; - var shapesLength = shapes.length; - var startOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var endOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var dist = 0; - var end = 0; - - if (!shapesLength) { - return { - start: outline, - end: outline - }; - } - - for (var i = 0; i < length; i += shapesLength) { - for (var j = 0; j < shapesLength && i + j < length; ++j) { - var item = items[i + j]; - var shape = shapes[j]; - var shapePos1 = shape[pos1Name]; - var shapePos2 = shape[pos2Name]; - var shapeSize1 = shape[size1Name]; - var shapeSize2 = shape[size2Name]; - var pos1 = end - dist + shapePos1 * (itemSize1 + margin); - var pos2 = shapePos2 * (itemSize2 + margin); - var size1 = shapeSize1 * (itemSize1 + margin) - margin; - var size2 = shapeSize2 * (itemSize2 + margin) - margin; - - for (var k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) { - if (startOutline[k] === DUMMY_POSITION) { - startOutline[k] = pos1; - } - - startOutline[k] = Math.min(startOutline[k], pos1); - endOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin); - } - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - end = Math.max.apply(Math, endOutline); // check dist once - - if (i !== 0) { - continue; - } // find & fill empty block - - - if (!frameFill) { - dist = 0; - continue; - } - - dist = end; - - for (var j = 0; j < shapesSize; ++j) { - if (startOutline[j] === DUMMY_POSITION) { - continue; - } // the dist between frame's end outline and next frame's start outline - // expect that next frame's start outline is startOutline[j] + end - - - dist = Math.min(startOutline[j] + end - endOutline[j], dist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] !== DUMMY_POSITION) { - continue; - } - - startOutline[i] = Math.max.apply(Math, startOutline); - endOutline[i] = startOutline[i]; - } // The target outline is start outline when type is appending - - - var targetOutline = isAppend ? startOutline : endOutline; - var prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? "max" : "min"].apply(Math, outline); - var prevOutlineDist = isAppend ? 0 : end; - - if (frameFill && outline.length === shapesSize) { - prevOutlineDist = -DUMMY_POSITION; - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] === endOutline[i]) { - continue; - } // if appending type is prepend(false), subtract dist from appending group's height. - - - prevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - startOutline[i] += prevOutlineEnd - prevOutlineDist; - endOutline[i] += prevOutlineEnd - prevOutlineDist; - } - - items.forEach(function (item) { - item.rect[pos1Name] += prevOutlineEnd - prevOutlineDist; - }); - return { - start: startOutline.map(function (point) { - return parseInt(point, 10); - }), - end: endOutline.map(function (point) { - return parseInt(point, 10); - }) - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return FrameLayout; -}(); - -function makeShapeOutline(outline, itemSize, columnLength, isAppend) { - var point = Math[isAppend ? "min" : "max"].apply(Math, outline) || 0; - - if (outline.length !== columnLength) { - return fill(new Array(columnLength), 0); - } - - return outline.map(function (l) { - return Math.floor((l - point) / itemSize); - }); -} - -function getColumn(item) { - if (item.column) { - return item.column; - } - - var column = 1; - - if (item.el) { - column = parseInt(item.el.getAttribute("data-column"), 10) || 1; - } - - item.column = column; - return column; -} -/** - * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card. - * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다. - * @class eg.InfiniteGrid.SquareLayout - * @extends eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @example -``` - -``` - **/ - - -var SquareLayout = -/*#__PURE__*/ -function (_super) { - __extends(SquareLayout, _super); - - function SquareLayout(options) { - if (options === void 0) { - options = {}; - } - - return _super.call(this, options) || this; - } - - var __proto = SquareLayout.prototype; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - if (isAppend === void 0) { - isAppend = false; - } - - var _a, _b; - - var itemSize = this._getSquareSize(items[0]); - - var margin = this.options.margin; - var columnLength = this.options.column || Math.floor((this._size + margin) / (itemSize + margin)) || 1; - var length = items.length; - var endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend); - var pointCaculateName = isAppend ? "min" : "max"; - var shapes = []; - var sign = isAppend ? 1 : -1; - var style = this._style; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline); - var index = endOutline[isAppend ? "indexOf" : "lastIndexOf"](point); - var item = items[i]; - var columnWidth = item.columnWidth; - var column = columnWidth && columnWidth[0] === columnLength && columnWidth[1] || getColumn(item); - var columnCount = 1; - - if (column > 1) { - for (var j = 1; j < column && (isAppend && index + j < columnLength || !isAppend && index - j >= 0); ++j) { - if (isAppend && endOutline[index + sign * j] <= point || !isAppend && endOutline[index + sign * j] >= point) { - ++columnCount; - continue; - } - - break; - } - - if (!isAppend) { - index -= columnCount - 1; - } - } - - item.columnWidth = [columnLength, columnCount]; - shapes.push((_a = { - width: columnCount, - height: columnCount - }, _a[pos1Name] = point - (!isAppend ? columnCount : 0), _a[pos2Name] = index, _a.type = i + 1, _a.index = i, _a)); - - for (var j = 0; j < columnCount; ++j) { - endOutline[index + j] = point + sign * columnCount; - } - } - - this._shapes = (_b = { - shapes: shapes - }, _b[style.size2] = columnLength, _b); - - var result = _super.prototype._layout.call(this, items, outline, isAppend); - - if (!isAppend) { - shapes.sort(function (shape1, shape2) { - var item1pos1 = shape1[pos1Name]; - var item1pos2 = shape1[pos2Name]; - var item2pos1 = shape2[pos1Name]; - var item2pos2 = shape2[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } - - return result; - }; - - __proto._getSquareSize = function (item) { - var _a = this.options, - column = _a.column, - margin = _a.margin, - itemSize = _a.itemSize; - - if (column) { - // if column is in options, caculate itemSize from column. - this._itemSize = (this._size + margin) / column - margin; - } else if (itemSize) { - this._itemSize = this.options.itemSize; - } else { - var sizeName = this._style.size2; // if frameSize is 0, caculate frameSize from item.size. - - var frameSize = this._shapes[sizeName] || Math.floor((this._size + margin) / (item.size[sizeName] + margin) / getColumn(item)); - this._itemSize = (this._size + margin) / frameSize - margin; - } - - return this._itemSize; - }; - - return SquareLayout; -}(FrameLayout); - -var BoxModel = -/*#__PURE__*/ -function () { - function BoxModel(options) { - assign(this, { - originWidth: 0, - originHeight: 0, - width: 0, - height: 0, - left: 0, - top: 0, - items: [] - }, options); - } - - var __proto = BoxModel.prototype; - - __proto.scaleTo = function (width, height) { - var scaleX = this.width ? width / this.width : 0; - var scaleY = this.height ? height / this.height : 0; - this.items.forEach(function (v) { - if (scaleX !== 0) { - v.left *= scaleX; - v.width *= scaleX; - } - - if (scaleY !== 0) { - v.top *= scaleY; - v.height *= scaleY; - } - }); - this.width = width; - this.height = height; - }; - - __proto.push = function (item) { - this.items.push(item); - }; - - __proto.getOriginSize = function () { - return this.originWidth * this.originHeight; - }; - - __proto.getSize = function () { - return this.width * this.height; - }; - - __proto.getOriginRatio = function () { - return this.originHeight === 0 ? 0 : this.originWidth / this.originHeight; - }; - - __proto.getRatio = function () { - return this.height === 0 ? 0 : this.width / this.height; - }; - - return BoxModel; -}(); - -function getCost(originLength, length) { - var cost = originLength / length; - - if (cost < 1) { - cost = 1 / cost; - } - - return cost - 1; -} - -function fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical) { - item.height = itemFitSize.height; - item.width = itemFitSize.width; - bestFitArea.height = containerFitSize.height; - bestFitArea.width = containerFitSize.width; - - if (layoutVertical) { - item.top = bestFitArea.top + bestFitArea.height; - item.left = bestFitArea.left; - } else { - item.left = bestFitArea.left + bestFitArea.width; - item.top = bestFitArea.top; - } -} -/** - * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion. - * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다. - * @class eg.InfiniteGrid.PackingLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 - * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 - * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 - * @example -``` - -``` - **/ - - -var PackingLayout = -/*#__PURE__*/ -function () { - function PackingLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - aspectRatio: 1, - sizeWeight: 1, - ratioWeight: 1 - }, options); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - var __proto = PackingLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.PackingLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto._findBestFitArea = function (container, item) { - if (container.getRatio() === 0) { - // 아이템 최초 삽입시 전체영역 지정 - container.originWidth = item.width; - container.originHeight = item.height; - container.width = item.width; - container.height = item.height; - return; - } - - var bestFitArea; - var minCost = 10000000; - var layoutVertical = false; - var itemFitSize = { - width: 0, - height: 0 - }; - var containerFitSize = { - width: 0, - height: 0 - }; - var _a = this.options, - sizeWeight = _a.sizeWeight, - ratioWeight = _a.ratioWeight; - container.items.forEach(function (v) { - var containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight; - var containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight; - var width = v.width; - var height = v.height; - var cost; - - for (var i = 0; i < 2; ++i) { - var itemWidth = void 0; - var itemHeight = void 0; - var containerWidth = void 0; - var containerHeight = void 0; - - if (i === 0) { - // 상하에 아이템 추가 - itemWidth = width; - itemHeight = height * (item.height / (v.originHeight + item.height)); - containerWidth = width; - containerHeight = height - itemHeight; - } else { - // 좌우에 아이템 추가 - itemHeight = height; - itemWidth = width * (item.width / (v.originWidth + item.width)); - containerHeight = height; - containerWidth = width - itemWidth; - } - - var itemSize = itemWidth * itemHeight; - var itemRatio = itemWidth / itemHeight; - var containerSize = containerWidth * containerHeight; - var containerRatio = containerHeight / containerHeight; - cost = getCost(item.getSize(), itemSize) * sizeWeight; - cost += getCost(item.getRatio(), itemRatio) * ratioWeight; - cost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost; - cost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost; - - if (cost === Math.min(cost, minCost)) { - minCost = cost; - bestFitArea = v; - layoutVertical = i === 0; - itemFitSize.width = itemWidth; - itemFitSize.height = itemHeight; - containerFitSize.width = containerWidth; - containerFitSize.height = containerHeight; - } - } - }); - fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical); - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - if (outline === void 0) { - outline = []; - } - - var style = this._style; - var _a = this.options, - horizontal = _a.horizontal, - aspectRatio = _a.aspectRatio, - margin = _a.margin; - var pos1Name = style.startPos1; - var containerWidth = this._size * (horizontal ? aspectRatio : 1); - var containerHeight = this._size / (horizontal ? 1 : aspectRatio); - var containerSize1 = horizontal ? containerWidth : containerHeight; - var prevOutline = toZeroArray(outline); - var start = isAppend ? Math.max.apply(Math, prevOutline) : Math.min.apply(Math, prevOutline) - containerSize1 - margin; - var end = start + containerSize1 + margin; - var container = new BoxModel({}); - items.forEach(function (item) { - var _a = item.orgSize, - width = _a.width, - height = _a.height; - var model = new BoxModel({ - width: width, - height: height, - originWidth: width, - originHeight: height - }); - - _this._findBestFitArea(container, model); - - container.push(model); - container.scaleTo(containerWidth + margin, containerHeight + margin); - }); - items.forEach(function (item, i) { - var boxItem = container.items[i]; - var width = boxItem.width; - var height = boxItem.height; - var top = boxItem.top; - var left = boxItem.left; - item.rect = { - top: top, - left: left, - width: width - margin, - height: height - margin - }; - item.rect[pos1Name] += start; - }); - return { - start: [start], - end: [end] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return PackingLayout; -}(); - -/* eslint-disable */ - -/****************************************************************************** - * Created 2008-08-19. - * - * Dijkstra path-finding functions. Adapted from the Dijkstar Python project. - * - * Copyright (C) 2008 - * Wyatt Baldwin - * All rights reserved - * - * Licensed under the MIT license. - * - * http://www.opensource.org/licenses/mit-license.php - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - *****************************************************************************/ -function single_source_shortest_paths(graph, s, d) { - // Predecessor map for each node that has been encountered. - // node ID => predecessor node ID - var predecessors = {}; // Costs of shortest paths from s to all nodes encountered. - // node ID => cost - - var costs = {}; - costs[s] = 0; // Costs of shortest paths from s to all nodes encountered; differs from - // `costs` in that it provides easy access to the node that currently has - // the known shortest path from s. - // XXX: Do we actually need both `costs` and `open`? - - var open = new BinaryHeap(function (x) { - return x.cost; - }); - open.push({ - value: s, - cost: 0 - }); - var closest; - var u; - var cost_of_s_to_u; - var adjacent_nodes; - var cost_of_e; - var cost_of_s_to_u_plus_cost_of_e; - var cost_of_s_to_v; - var first_visit; - - while (open.size()) { - // In the nodes remaining in graph that have a known cost from s, - // find the node, u, that currently has the shortest path from s. - closest = open.pop(); - u = closest.value; - cost_of_s_to_u = closest.cost; // Get nodes adjacent to u... - - adjacent_nodes = graph(u) || {}; // ...and explore the edges that connect u to those nodes, updating - // the cost of the shortest paths to any or all of those nodes as - // necessary. v is the node across the current edge from u. - - for (var v in adjacent_nodes) { - // Get the cost of the edge running from u to v. - cost_of_e = adjacent_nodes[v]; // Cost of s to u plus the cost of u to v across e--this is *a* - // cost from s to v that may or may not be less than the current - // known cost to v. - - cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; // If we haven't visited v yet OR if the current known cost from s to - // v is greater than the new cost we just found (cost of s to u plus - // cost of u to v across e), update v's cost in the cost list and - // update v's predecessor in the predecessor list (it's now u). - - cost_of_s_to_v = costs[v]; - first_visit = typeof costs[v] === "undefined"; - - if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { - costs[v] = cost_of_s_to_u_plus_cost_of_e; - open.push({ - value: v, - cost: cost_of_s_to_u_plus_cost_of_e - }); - predecessors[v] = u; - } - } - } - - if (typeof costs[d] === "undefined") { - var msg = ["Could not find a path from ", s, " to ", d, "."].join(""); - throw new Error(msg); - } - - return predecessors; -} - -function extract_shortest_path_from_predecessor_list(predecessors, d) { - var nodes = []; - var u = d; - - while (u) { - nodes.push(u); - u = predecessors[u]; - } - - nodes.reverse(); - return nodes; -} - -function find_path(graph, s, d) { - var predecessors = single_source_shortest_paths(graph, s, d); - return extract_shortest_path_from_predecessor_list(predecessors, d); -} - -var BinaryHeap = -/*#__PURE__*/ -function () { - function BinaryHeap(scoreFunction) { - this.content = []; - this.scoreFunction = scoreFunction; - } - - var __proto = BinaryHeap.prototype; - - __proto.push = function (element) { - // Add the new element to the end of the array. - this.content.push(element); // Allow it to bubble up. - - this.bubbleUp(this.content.length - 1); - }; - - __proto.pop = function () { - // Store the first element so we can return it later. - var result = this.content[0]; // Get the element at the end of the array. - - var end = this.content.pop(); // If there are any elements left, put the end element at the - // start, and let it sink down. - - if (this.content.length > 0) { - this.content[0] = end; - this.sinkDown(0); - } - - return result; - }; - - __proto.size = function () { - return this.content.length; - }; - - __proto.bubbleUp = function (_n) { - var n = _n; // Fetch the element that has to be moved. - - var element = this.content[n]; // When at 0, an element can not go up any further. - - while (n > 0) { - // Compute the parent element's index, and fetch it. - var parentN = Math.floor((n + 1) / 2) - 1; - var parent = this.content[parentN]; // Swap the elements if the parent is greater. - - if (this.scoreFunction(element) < this.scoreFunction(parent)) { - this.content[parentN] = element; - this.content[n] = parent; // Update 'n' to continue at the new position. - - n = parentN; - } else { - // Found a parent that is less, no need to move it further. - break; - } - } - }; - - __proto.sinkDown = function (n) { - // Look up the target element and its score. - var length = this.content.length; - var element = this.content[n]; - var elemScore = this.scoreFunction(element); - var child1Score; - - while (true) { - // Compute the indices of the child elements. - var child2N = (n + 1) * 2; - var child1N = child2N - 1; // This is used to store the new position of the element, - // if any. - - var swap = null; // If the first child exists (is inside the array)... - - if (child1N < length) { - // Look it up and compute its score. - var child1 = this.content[child1N]; - child1Score = this.scoreFunction(child1); // If the score is less than our element's, we need to swap. - - if (child1Score < elemScore) { - swap = child1N; - } - } // Do the same checks for the other child. - - - if (child2N < length) { - var child2 = this.content[child2N]; - var child2Score = this.scoreFunction(child2); - - if (child2Score < (swap == null ? elemScore : child1Score)) { - swap = child2N; - } - } // If the element needs to be moved, swap it, and continue. - - - if (swap !== null) { - this.content[n] = this.content[swap]; - this.content[swap] = element; - n = swap; - } else { - // Otherwise, we are done. - break; - } - } - }; - - return BinaryHeap; -}(); - -/** - * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size. - * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다. - * @class eg.InfiniteGrid.JustifiedLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 - * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 - * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 - * @example -``` - -``` - **/ - -var JustifiedLayout = -/*#__PURE__*/ -function () { - function JustifiedLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - minSize: 0, - maxSize: 0, - column: [1, 8] - }, options); - this._style = getStyleNames(this.options.horizontal); - this._size = 0; - } - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.JustifiedLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - var __proto = JustifiedLayout.prototype; - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var startIndex = 0; - var endIndex = items.length; - var column = this.options.column; - var columns = typeof column === "object" ? column : [column, column]; - - var graph = function (_start) { - var results = {}; - var start = +_start.replace(/[^0-9]/g, ""); - var length = endIndex + 1; - - for (var i = Math.min(start + columns[0], length - 1); i < length; ++i) { - if (i - start > columns[1]) { - break; - } - - var cost = _this._getCost(items, start, i, size1Name, size2Name); - - if (cost === null) { - continue; - } - - if (cost < 0 && i === length - 1) { - cost = 0; - } - - results["" + i] = Math.pow(cost, 2); - } - - return results; - }; // shortest path for items' total height. - - - var path = find_path(graph, "" + startIndex, "" + endIndex); - return this._setStyle(items, path, outline, isAppend); - }; - - __proto._getSize = function (items, size1Name, size2Name) { - var margin = this.options.margin; - var size = items.reduce(function (sum, item) { - return sum + item.orgSize[size2Name] / item.orgSize[size1Name]; - }, 0); - return (this._size - margin * (items.length - 1)) / size; - }; - - __proto._getCost = function (items, i, j, size1Name, size2Name) { - var size = this._getSize(items.slice(i, j), size1Name, size2Name); - - var min = this.options.minSize || 0; - var max = this.options.maxSize || Infinity; - - if (isFinite(max)) { - // if this size is not in range, the cost increases sharply. - if (size < min) { - return Math.pow(size - min, 2) + Math.pow(max, 2); - } else if (size > max) { - return Math.pow(size - max, 2) + Math.pow(max, 2); - } else { - // if this size in range, the cost is negative or low. - return Math.min(size - max, min - size); - } - } // if max is infinite type, caculate cost only with "min". - - - if (size < min) { - return Math.max(Math.pow(min, 2), Math.pow(size, 2)); - } - - return size - min; - }; - - __proto._setStyle = function (items, path, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var style = this._style; // if direction is vertical - // startPos1 : top, endPos1 : bottom - // size1 : height - // startPos2 : left, endPos2 : right - // size2 : width - // if direction is horizontal - // startPos1 : left, endPos1 : right - // size1 : width - // startPos2 : top, endPos2 : bottom - // size2 : height - - var pos1Name = style.startPos1; - var size1Name = style.size1; - var pos2Name = style.startPos2; - var size2Name = style.size2; - var length = path.length; - var margin = this.options.margin; - var startPoint = outline[0] || 0; - var endPoint = startPoint; - var height = 0; - - for (var i = 0; i < length - 1; ++i) { - var path1 = parseInt(path[i], 10); - var path2 = parseInt(path[i + 1], 10); // pathItems(path1 to path2) are in 1 line. - - var pathItems = items.slice(path1, path2); - var pathItemsLength = pathItems.length; - - var size1 = this._getSize(pathItems, size1Name, size2Name); - - var pos1 = endPoint; - - for (var j = 0; j < pathItemsLength; ++j) { - var item = pathItems[j]; - var size2 = item.orgSize[size2Name] / item.orgSize[size1Name] * size1; // item has margin bottom and right. - // first item has not margin. - - var prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect; - var pos2 = prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name] + margin : 0; - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - height += margin + size1; - endPoint = startPoint + height; - } - - var itemsLength = items.length; - - if (isAppend) { - // previous group's end outline is current group's start outline - return { - start: [startPoint], - end: [endPoint] - }; - } // for prepend, only substract height from position. - // always start is lower than end. - - - for (var i = 0; i < itemsLength; ++i) { - var item = items[i]; // move items as long as height for prepend - - item.rect[pos1Name] -= height; - } - - return { - start: [startPoint - height], - end: [startPoint] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return JustifiedLayout; -}(); - -/** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - -export default InfiniteGrid; -export { GridLayout, FrameLayout, SquareLayout, PackingLayout, JustifiedLayout, Infinite, DOMRenderer, ItemManager, CONTAINER_CLASSNAME, IGNORE_CLASSNAME, DEFAULT_OPTIONS, INFINITEGRID_METHODS, INFINITEGRID_EVENTS, categorize, withInfiniteGridMethods }; -//# sourceMappingURL=infinitegrid.esm.js.map diff --git a/dist/infinitegrid.esm.js.map b/dist/infinitegrid.esm.js.map deleted file mode 100644 index 63b526690..000000000 --- a/dist/infinitegrid.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.esm.js","sources":["../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/GridLayout.ts","../src/layouts/FrameLayout.ts","../src/layouts/SquareLayout.ts","../src/layouts/lib/BoxModel.ts","../src/layouts/PackingLayout.ts","../src/layouts/lib/dijkstra.ts","../src/layouts/JustifiedLayout.ts","../src/index.ts"],"sourcesContent":["let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\nimport FrameLayout from \"./layouts/FrameLayout\";\nimport SquareLayout from \"./layouts/SquareLayout\";\nimport PackingLayout from \"./layouts/PackingLayout\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport ItemManager from \"./ItemManager\";\nimport Infinite from \"./Infinite\";\nexport {\n\tCONTAINER_CLASSNAME, IGNORE_CLASSNAME,\n\tDEFAULT_OPTIONS, INFINITEGRID_METHODS,\n\tINFINITEGRID_EVENTS,\n} from \"./consts\";\nexport { categorize, withInfiniteGridMethods } from \"./utils\";\n\nexport * from \"./types\";\nexport {\n\tGridLayout,\n\tFrameLayout,\n\tSquareLayout,\n\tPackingLayout,\n\tJustifiedLayout,\n\tInfinite,\n\tDOMRenderer,\n\tItemManager,\n\tInfiniteGrid as default,\n};\n"],"names":["win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","Object","defineProperty","addEventListener","get","e","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","ALIGN","START","CENTER","END","JUSTIFY","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","INFINITEGRID_EVENTS","INFINITEGRID_METHODS","getLoadingBar","getItem","getItems","layout","getGroupKeys","getStatus","setStatus","isProcessing","startLoading","endLoading","isLoading","updateItem","updateItems","moveTo","nodes","array","length","i","push","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","Array","isArray","map","v","undefined","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","options","attachEvent","removeEventListener","detachEvent","callback","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","name","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","indexOf","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","forEach","source","key","defaultOptions","assign","outline","items","item","jQuery","constructor","prototype","jquery","arr","value","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","infinitegridName","keys","args","result","_a","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","concat","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","isUndefined","sliceGroups","pluck","index","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","splice","insert","categorize","diff","removed","added","maintained","removedIndex","nextGroups","fromIndex","addedIndex","reverse","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","filter","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","_b","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","_infinite","_renderer","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","prefix","check","on","_complete","_error","_end","infinite","prevGroup","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","trigger","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","setTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","syncElements","watcher","processingStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","_getLoadingStatus","userStyle","display","_process","next","_setContainerSize","_getEdgeValue","_fitItems","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","Component","_setCursor","layoutItems","scroller","pop","shift","_d","_e","viewSize","isScroll","InfiniteGrid","assignOptions","align","itemSize","_columnSize","_columnLength","_style","getStyleNames","firstItem","checkColumn","startOutline","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","frame","j","disableFrame","shapes","searchShapeInFrame","frameFill","row","_itemSize","_shapes","getShapes","_checkItemSize","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","k","targetOutline","prevOutlineEnd","prevOutlineDist","l","_getSquareSize","makeShapeOutline","sign","columnWidth","getColumn","columnCount","shape1","shape2","frameSize","FrameLayout","originWidth","originHeight","scaleX","scaleY","originLength","cost","bestFitArea","itemFitSize","containerFitSize","layoutVertical","aspectRatio","sizeWeight","ratioWeight","getRatio","minCost","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemRatio","containerSize","containerRatio","fitArea","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","graph","s","d","predecessors","costs","open","BinaryHeap","closest","u","cost_of_s_to_u","adjacent_nodes","cost_of_e","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","first_visit","msg","Error","single_source_shortest_paths","extract_shortest_path_from_predecessor_list","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","parent","elemScore","child1Score","child2N","child1N","swap","child1","child2","child2Score","minSize","maxSize","columns","_start","results","_getCost","pow","path","find_path","_setStyle","sum","isFinite","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAIA,GAAJ;;AAEA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;;EAElCD,GAAG,GAAG;IACLE,QAAQ,EAAE,EADL;IAELC,SAAS,EAAE;MACVC,SAAS,EAAE;;GAHb;CAFD,MAQO;EACNJ,GAAG,GAAGC,MAAN;;AAIM,IAAMC,QAAQ,GAAGF,GAAG,CAACE,QAArB;;;ACZP,IAAMG,EAAE,GAAGJ,GAAM,CAACE,SAAP,CAAiBC,SAA5B;AAEA,AAAO,IAAME,qBAAqB,GAAG,CAAC,EAAE,sBAAsBL,GAAxB,CAA/B;AACP,AAAO,IAAMM,wBAAwB,GAAG,CAAC,EA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X1E,GAAC8U,UAAD,GAAalX,KAHF,EAIXoC,GAAC+U,UAAD,GAAahX,KAJF,IAAZ;;;MAODT,MAAM,IAAI7G,MAAM,GAAGmH,KAAnB;MACA+f,QAAQ,GAAGD,UAAU,GAAGpgB,MAAxB;;;QAEK2gB,WAAW,GAAGvf,KAAK,CAACzF,MAA1B;;QAEI0N,QAAJ,EAAc;;aAEN;QACN5E,KAAK,EAAE,CAAC2b,UAAD,CADD;QAEN1b,GAAG,EAAE,CAAC2b,QAAD;OAFN;;;;;SAQI,IAAIzkB,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG+kB,WAApB,EAAiC,EAAE/kB,CAAnC,EAAsC;UAC/ByF,IAAI,GAAGD,KAAK,CAACxF,CAAD,CAAlB,CADqC;;MAIrCyF,IAAI,CAACgB,IAAL,CAAUqV,QAAV,KAAuB1X,MAAvB;;;WAEM;MACNyE,KAAK,EAAE,CAAC2b,UAAU,GAAGpgB,MAAd,CADD;MAEN0E,GAAG,EAAE,CAAC0b,UAAD;KAFN;GAzEO;;iBA8EA,GAAR,UAAgBhf,KAAhB,EAAiDD,OAAjD,EAAyEkI,QAAzE,EAA6FmD,KAA7F;wBAAgB,EAAA;MAAApL,UAAA;;;0BAAiC,EAAA;MAAAD,YAAA;;;;QAE1CuX,KAAK,GAAGlM,KAAK,GAAGpL,KAAH,GAAWuX,UAAU,CAACvX,KAAD,CAAxC;WAEO;MACNA,KAAK,EAAEsX,KADD;MAENlU,QAAQ,EAAE,KAAKwI,OAAL,CAAa0L,KAAb,EAAoBvX,OAApB,EAA6BkI,QAA7B;KAFX;GAJO;;wBAST;GAlPA;;ACxCA;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.framelayout.js b/dist/infinitegrid.framelayout.js deleted file mode 100644 index fe54c6a2a..000000000 --- a/dist/infinitegrid.framelayout.js +++ /dev/null @@ -1,5067 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory()); -}(this, (function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/component project is licensed under the MIT license - - @egjs/component JavaScript library - https://naver.github.io/egjs-component - - @version 2.1.2 - */ - - /** - * Copyright (c) 2015 NAVER Corp. - * egjs projects are licensed under the MIT license - */ - function isUndefined(value) { - return typeof value === "undefined"; - } - /** - * A class used to manage events in a component - * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스 - * @alias eg.Component - */ - - - var Component = - /*#__PURE__*/ - function () { - var Component = - /*#__PURE__*/ - function () { - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.Component.VERSION; // ex) 2.0.0 - * @memberof eg.Component - */ - - /** - * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - */ - function Component() { - this._eventHandler = {}; - this.options = {}; - } - /** - * Triggers a custom event. - * @ko 커스텀 이벤트를 발생시킨다 - * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름 - * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터 - * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고 - * @example - class Some extends eg.Component { - some(){ - if(this.trigger("beforeHi")){ // When event call to stop return false. - this.trigger("hi");// fire hi event. - } - } - } - const some = new Some(); - some.on("beforeHi", (e) => { - if(condition){ - e.stop(); // When event call to stop, `hi` event not call. - } - }); - some.on("hi", (e) => { - // `currentTarget` is component instance. - console.log(some === e.currentTarget); // true - }); - // If you want to more know event design. You can see article. - // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F - */ - - - var _proto = Component.prototype; - - _proto.trigger = function trigger(eventName, customEvent) { - if (customEvent === void 0) { - customEvent = {}; - } - - var handlerList = this._eventHandler[eventName] || []; - var hasHandlerList = handlerList.length > 0; - - if (!hasHandlerList) { - return true; - } // If detach method call in handler in first time then handler list calls. - - - handlerList = handlerList.concat(); - customEvent.eventType = eventName; - var isCanceled = false; - var arg = [customEvent]; - var i = 0; - - customEvent.stop = function () { - isCanceled = true; - }; - - customEvent.currentTarget = this; - - for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - restParam[_key - 2] = arguments[_key]; - } - - if (restParam.length >= 1) { - arg = arg.concat(restParam); - } - - for (i = 0; handlerList[i]; i++) { - handlerList[i].apply(this, arg); - } - - return !isCanceled; - }; - /** - * Executed event just one time. - * @ko 이벤트가 한번만 실행된다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - alert("hi"); - } - thing() { - this.once("hi", this.hi); - } - } - var some = new Some(); - some.thing(); - some.trigger("hi"); - // fire alert("hi"); - some.trigger("hi"); - // Nothing happens - */ - - - _proto.once = function once(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var i; - - for (i in eventHash) { - this.once(i, eventHash[i]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var self = this; - this.on(eventName, function listener() { - for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - arg[_key2] = arguments[_key2]; - } - - handlerToAttach.apply(self, arg); - self.off(eventName, listener); - }); - } - - return this; - }; - /** - * Checks whether an event has been attached to a component. - * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다. - * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름 - * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부 - * @example - class Some extends eg.Component { - some() { - this.hasOn("hi");// check hi event. - } - } - */ - - - _proto.hasOn = function hasOn(eventName) { - return !!this._eventHandler[eventName]; - }; - /** - * Attaches an event to a component. - * @ko 컴포넌트에 이벤트를 등록한다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.on("hi",this.hi); //attach event - } - } - */ - - - _proto.on = function on(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.on(name, eventHash[name]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var handlerList = this._eventHandler[eventName]; - - if (isUndefined(handlerList)) { - this._eventHandler[eventName] = []; - handlerList = this._eventHandler[eventName]; - } - - handlerList.push(handlerToAttach); - } - - return this; - }; - /** - * Detaches an event from the component. - * @ko 컴포넌트에 등록된 이벤트를 해제한다 - * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름 - * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.off("hi",this.hi); //detach event - } - } - */ - - - _proto.off = function off(eventName, handlerToDetach) { - // All event detach. - if (isUndefined(eventName)) { - this._eventHandler = {}; - return this; - } // All handler of specific event detach. - - - if (isUndefined(handlerToDetach)) { - if (typeof eventName === "string") { - this._eventHandler[eventName] = undefined; - return this; - } else { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.off(name, eventHash[name]); - } - - return this; - } - } // The handler of specific event detach. - - - var handlerList = this._eventHandler[eventName]; - - if (handlerList) { - var k; - var handlerFunction; - - for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) { - if (handlerFunction === handlerToDetach) { - handlerList = handlerList.splice(k, 1); - break; - } - } - } - - return this; - }; - - return Component; - }(); - - Component.VERSION = "2.1.2"; - return Component; - }(); - - /* - Copyright (c) 2019-present NAVER Corp. - name: @egjs/list-differ - license: MIT - author: NAVER Corp. - repository: https://github.com/naver/egjs-list-differ - version: 1.0.0 - */ - - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - var PolyMap = - /*#__PURE__*/ - function () { - function PolyMap() { - this.keys = []; - this.values = []; - } - - var __proto = PolyMap.prototype; - - __proto.get = function (key) { - return this.values[this.keys.indexOf(key)]; - }; - - __proto.set = function (key, value) { - var keys = this.keys; - var values = this.values; - var prevIndex = keys.indexOf(key); - var index = prevIndex === -1 ? keys.length : prevIndex; - keys[index] = key; - values[index] = value; - }; - - return PolyMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var HashMap = - /*#__PURE__*/ - function () { - function HashMap() { - this.object = {}; - } - - var __proto = HashMap.prototype; - - __proto.get = function (key) { - return this.object[key]; - }; - - __proto.set = function (key, value) { - this.object[key] = value; - }; - - return HashMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var SUPPORT_MAP = typeof Map === "function"; - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - var Link = - /*#__PURE__*/ - function () { - function Link() {} - - var __proto = Link.prototype; - - __proto.connect = function (prevLink, nextLink) { - this.prev = prevLink; - this.next = nextLink; - prevLink && (prevLink.next = this); - nextLink && (nextLink.prev = this); - }; - - __proto.disconnect = function () { - // In double linked list, diconnect the interconnected relationship. - var prevLink = this.prev; - var nextLink = this.next; - prevLink && (prevLink.next = nextLink); - nextLink && (nextLink.prev = prevLink); - }; - - __proto.getIndex = function () { - var link = this; - var index = -1; - - while (link) { - link = link.prev; - ++index; - } - - return index; - }; - - return Link; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - function orderChanged(changed, fixed) { - // It is roughly in the order of these examples. - // 4, 6, 0, 2, 1, 3, 5, 7 - var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 - - var toLinks = []; - changed.forEach(function (_a) { - var from = _a[0], - to = _a[1]; - var link = new Link(); - fromLinks[from] = link; - toLinks[to] = link; - }); // `fromLinks` are connected to each other by double linked list. - - fromLinks.forEach(function (link, i) { - link.connect(fromLinks[i - 1]); - }); - return changed.filter(function (_, i) { - return !fixed[i]; - }).map(function (_a, i) { - var from = _a[0], - to = _a[1]; - - if (from === to) { - return [0, 0]; - } - - var fromLink = fromLinks[from]; - var toLink = toLinks[to - 1]; - var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. - - fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. - - if (!toLink) { - fromLink.connect(undefined, fromLinks[0]); - } else { - fromLink.connect(toLink, toLink.next); - } - - var toIndex = fromLink.getIndex(); - return [fromIndex, toIndex]; - }); - } - - var Result = - /*#__PURE__*/ - function () { - function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { - this.prevList = prevList; - this.list = list; - this.added = added; - this.removed = removed; - this.changed = changed; - this.maintained = maintained; - this.changedBeforeAdded = changedBeforeAdded; - this.fixed = fixed; - } - - var __proto = Result.prototype; - Object.defineProperty(__proto, "ordered", { - get: function () { - if (!this.cacheOrdered) { - this.caculateOrdered(); - } - - return this.cacheOrdered; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(__proto, "pureChanged", { - get: function () { - if (!this.cachePureChanged) { - this.caculateOrdered(); - } - - return this.cachePureChanged; - }, - enumerable: true, - configurable: true - }); - - __proto.caculateOrdered = function () { - var ordered = orderChanged(this.changedBeforeAdded, this.fixed); - var changed = this.changed; - var pureChanged = []; - this.cacheOrdered = ordered.filter(function (_a, i) { - var from = _a[0], - to = _a[1]; - var _b = changed[i], - fromBefore = _b[0], - toBefore = _b[1]; - - if (from !== to) { - pureChanged.push([fromBefore, toBefore]); - return true; - } - }); - this.cachePureChanged = pureChanged; - }; - - return Result; - }(); - /** - * - * @memberof eg.ListDiffer - * @static - * @function - * @param - Previous List 이전 목록 - * @param - List to Update 업데이트 할 목록 - * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. - * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. - * @example - * import { diff } from "@egjs/list-differ"; - * // script => eg.ListDiffer.diff - * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); - * // List before update - * // [1, 2, 3, 4, 5] - * console.log(result.prevList); - * // Updated list - * // [4, 3, 6, 2, 1] - * console.log(result.list); - * // Index array of values added to `list` - * // [0, 1, 5] - * console.log(result.added); - * // Index array of values removed in `prevList` - * // [5] - * console.log(result.removed); - * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.changed); - * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) - * // [[4, 3], [3, 4], [2, 6]] - * console.log(result.pureChanged); - * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) - * // [[4, 1], [4, 2], [4, 3]] - * console.log(result.ordered); - * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.maintained); - */ - - - function diff(prevList, list, findKeyCallback) { - var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; - - var callback = findKeyCallback || function (e) { - return e; - }; - - var added = []; - var removed = []; - var maintained = []; - var prevKeys = prevList.map(callback); - var keys = list.map(callback); - var prevKeyMap = new mapClass(); - var keyMap = new mapClass(); - var changedBeforeAdded = []; - var fixed = []; - var removedMap = {}; - var changed = []; - var addedCount = 0; - var removedCount = 0; // Add prevKeys and keys to the hashmap. - - prevKeys.forEach(function (key, prevListIndex) { - prevKeyMap.set(key, prevListIndex); - }); - keys.forEach(function (key, listIndex) { - keyMap.set(key, listIndex); - }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. - - prevKeys.forEach(function (key, prevListIndex) { - var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. - - if (typeof listIndex === "undefined") { - ++removedCount; - removed.push(prevListIndex); - } else { - removedMap[listIndex] = removedCount; - } - }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. - - keys.forEach(function (key, listIndex) { - var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. - - if (typeof prevListIndex === "undefined") { - added.push(listIndex); - ++addedCount; - } else { - maintained.push([prevListIndex, listIndex]); - removedCount = removedMap[listIndex] || 0; - changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); - fixed.push(listIndex === prevListIndex); - - if (prevListIndex !== listIndex) { - changed.push([prevListIndex, listIndex]); - } - } - }); // Sort by ascending order of 'to(list's index). - - removed.reverse(); - return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); - } - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document$1.body[prop] || document$1.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document$1.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function fill(arr, value) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - arr[i] = value; - } - - return arr; - } - function isUndefined$1(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined$1(start) ? this._groups : this.sliceGroups(start, (isUndefined$1(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document$1.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document$1.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/lazyloaded JavaScript library - @egjs/lazyloaded project is licensed under the MIT license - - - @version 0.0.2 - */ - var isWindow$1 = typeof window !== "undefined"; - var ua$1 = isWindow$1 ? window.navigator.userAgent : ""; - var SUPPORT_COMPUTEDSTYLE$1 = isWindow$1 ? !!("getComputedStyle" in window) : false; - var IS_IE$1 = /MSIE|Trident|Windows Phone|Edge/.test(ua$1); - var SUPPORT_ADDEVENTLISTENER$1 = isWindow$1 ? !!("addEventListener" in document) : false; - var WIDTH = "width"; - var HEIGHT = "height"; - - function getAttribute(el, name) { - return el.getAttribute(name) || ""; - } - - function toArray$1(arr) { - return [].slice.call(arr); - } - - function isDataAttribute(target, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - return !!target.getAttribute(prefix + "width"); - } - - function addEvent$1(element, type, handler) { - if (SUPPORT_ADDEVENTLISTENER$1) { - element.addEventListener(type, handler, false); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - - function removeEvent$1(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - - function innerWidth$1(el) { - return getSize$1(el, "Width"); - } - - function innerHeight$1(el) { - return getSize$1(el, "Height"); - } - - function getStyles$1(el) { - return (SUPPORT_COMPUTEDSTYLE$1 ? window.getComputedStyle(el) : el.currentStyle) || {}; - } - - function getSize$1(el, name) { - var size = el["client" + name] || el["offset" + name]; - return parseFloat(size || getStyles$1(el)[name.toLowerCase()]) || 0; - } - - var elements = []; - - function add(element, prefix) { - !elements.length && addEvent$1(window, "resize", resizeAll); - element.__PREFIX__ = prefix; - elements.push(element); - resize(element); - } - - function remove(element, prefix) { - var index = elements.indexOf(element); - - if (index < 0) { - return; - } - - var fixed = getAttribute(element, prefix + "fixed"); - delete element.__PREFIX__; - element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = ""; - elements.splice(index, 1); - !elements.length && removeEvent$1(window, "resize", resizeAll); - } - - function resize(element, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var elementPrefix = element.__PREFIX__; - - if (typeof elementPrefix !== "string") { - elementPrefix = prefix; - } - - var dataWidth = parseInt(getAttribute(element, "" + elementPrefix + WIDTH), 10) || 0; - var dataHeight = parseInt(getAttribute(element, "" + elementPrefix + HEIGHT), 10) || 0; - var fixed = getAttribute(element, elementPrefix + "fixed"); - - if (fixed === HEIGHT) { - var size = innerHeight$1(element) || dataHeight; - element.style[WIDTH] = dataWidth / dataHeight * size + "px"; - } else { - var size = innerWidth$1(element) || dataWidth; - element.style[HEIGHT] = dataHeight / dataWidth * size + "px"; - } - } - - function resizeAll() { - elements.forEach(function (element) { - resize(element); - }); - } - /** - * @namespace eg.LazyLoaded - */ - - /** - * This module is used to wait for images or videos to load. - * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다. - * @memberof eg.LazyLoaded - * @param - - * @example - * ## HTML - * ```html - *
- * - * - * - * - * - * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * finish: () => console.log("finish"), - * error: e => console.log("error", e), - * }); - * ``` - */ - - - function check(elements, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var component = new Component(); - var finishCount = 0; - var readyCount = 0; - - function checkReady() { - if (--readyCount !== 0) { - return; - } - /** - * An event occurs when the size of all images is available. - * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#ready - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * }); - * ``` - */ - - - component.trigger("ready"); - } - - function checkFinish() { - if (--finishCount !== 0) { - return; - } - /** - * An event occurs when all images have been completed loading. - * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#finish - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * finish: () => console.log("finish"), - * }); - * ``` - */ - - - component.trigger("finish"); - } - - elements.forEach(function (el, i) { - var tagName = el.tagName; - - if (isDataAttribute(el, prefix) && tagName !== "IMG") { - add(el, prefix); - ++finishCount; - setTimeout(function () { - check(toArray$1(el.querySelectorAll("img")), prefix).on("finish", function () { - remove(el, prefix); - checkFinish(); - }); - }); - return; - } - - var images = tagName === "IMG" ? [el] : toArray$1(el.querySelectorAll("img")); - - if (!images.length) { - return; - } - - images.forEach(function (img, j) { - if (img.complete && (!IS_IE$1 || IS_IE$1 && img.naturalWidth)) { - if (!img.naturalWidth) { - setTimeout(function () { - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - }); - } - - return; - } - - if (isDataAttribute(img, prefix)) { - add(img, prefix); - } else { - ++readyCount; - } - - ++finishCount; - - function onError() { - /** - * An event occurs if the image fails to load. - * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다. - * @event eg.LazyLoaded#error - * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트 - * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스 - * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트 - * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스 - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * error: e => { - * //
...
, 0, , 2 - * console.log(e.itemTarget, e.itemIndex, e.target, e.index), - * }, - * }); - * ``` - */ - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - } - - function onCheck(e) { - var target = e.target || e.srcElement; - removeEvent$1(target, "error", onCheck); - removeEvent$1(target, "load", onCheck); - - if (isDataAttribute(target, prefix)) { - remove(target, prefix); - } else { - checkReady(); - } - - if (e.type === "error") { - onError(); - } - - checkFinish(); - } - - addEvent$1(img, "load", onCheck); - addEvent$1(img, "error", onCheck); - IS_IE$1 && img.setAttribute("src", img.getAttribute("src")); - }); - }); - !readyCount && setTimeout(function () { - component.trigger("ready"); - }); - !finishCount && setTimeout(function () { - component.trigger("finish"); - }); - return component; - } - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove$$1 = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - remove(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove$$1, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - /* - Frame - [ - [1, 1, 1, 1, 1], - [0, 0, 2, 2, 2], - [0, 0, 2, 2, 2], - [3, 4, 5, 5, 5], - ] - */ - - function disableFrame(frame, type, top, left, width, height) { - for (var i = top; i < top + height; ++i) { - for (var j = left; j < left + width; ++j) { - if (type !== frame[i][j]) { - continue; - } - - frame[i][j] = 0; - } - } - } - - function searchShapeInFrame(frame, type, top, left, width, height) { - var size = { - left: left, - top: top, - type: type, - width: 1, - height: 1 - }; - - for (var i = left; i < width; ++i) { - if (frame[top][i] === type) { - size.width = i - left + 1; - continue; - } - - break; - } - - for (var i = top; i < height; ++i) { - if (frame[i][left] === type) { - size.height = i - top + 1; - continue; - } - - break; - } // After finding the shape, it will not find again. - - - disableFrame(frame, type, top, left, size.width, size.height); - return size; - } - - function getShapes(frame) { - var height = frame.length; - var width = height ? frame[0].length : 0; - var shapes = []; - - for (var i = 0; i < height; ++i) { - for (var j = 0; j < width; ++j) { - var type = frame[i][j]; - - if (!type) { - continue; - } // Separate shapes with other numbers. - - - shapes.push(searchShapeInFrame(frame, type, i, j, width, height)); - } - } - - shapes.sort(function (a, b) { - return a.type < b.type ? -1 : 1; - }); - return { - shapes: shapes, - width: width, - height: height - }; - } - /** - * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm. - * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다. - * @class eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. - * @example - ``` - - ``` - **/ - - - var FrameLayout = - /*#__PURE__*/ - function () { - function FrameLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - itemSize: 0, - frame: [], - frameFill: true - }, options); - var frame = this.options.frame.map(function (row) { - return row.slice(); - }); - this._itemSize = this.options.itemSize || 0; // divide frame into shapes. - - this._shapes = getShapes(frame); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - var __proto = FrameLayout.prototype; - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.FrameLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - - __proto._getItemSize = function () { - this._checkItemSize(); - - return this._itemSize; - }; - - __proto._checkItemSize = function () { - if (this.options.itemSize) { - this._itemSize = this.options.itemSize; - return; - } - - var style = this._style; - var size = style.size2; - var margin = this.options.margin; // if itemSize is not in options, caculate itemSize from size. - - this._itemSize = (this._size + margin) / this._shapes[size] - margin; - }; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var length = items.length; - var style = this._style; - var _b = this.options, - margin = _b.margin, - frameFill = _b.frameFill; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - var itemSize = this._getItemSize(); - - var isItemObject = typeof itemSize === "object"; - var itemSize2 = isItemObject ? itemSize[size2Name] : itemSize; - var itemSize1 = isItemObject ? itemSize[size1Name] : itemSize; - var shapesSize = this._shapes[size2Name]; - var shapes = this._shapes.shapes; - var shapesLength = shapes.length; - var startOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var endOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var dist = 0; - var end = 0; - - if (!shapesLength) { - return { - start: outline, - end: outline - }; - } - - for (var i = 0; i < length; i += shapesLength) { - for (var j = 0; j < shapesLength && i + j < length; ++j) { - var item = items[i + j]; - var shape = shapes[j]; - var shapePos1 = shape[pos1Name]; - var shapePos2 = shape[pos2Name]; - var shapeSize1 = shape[size1Name]; - var shapeSize2 = shape[size2Name]; - var pos1 = end - dist + shapePos1 * (itemSize1 + margin); - var pos2 = shapePos2 * (itemSize2 + margin); - var size1 = shapeSize1 * (itemSize1 + margin) - margin; - var size2 = shapeSize2 * (itemSize2 + margin) - margin; - - for (var k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) { - if (startOutline[k] === DUMMY_POSITION) { - startOutline[k] = pos1; - } - - startOutline[k] = Math.min(startOutline[k], pos1); - endOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin); - } - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - end = Math.max.apply(Math, endOutline); // check dist once - - if (i !== 0) { - continue; - } // find & fill empty block - - - if (!frameFill) { - dist = 0; - continue; - } - - dist = end; - - for (var j = 0; j < shapesSize; ++j) { - if (startOutline[j] === DUMMY_POSITION) { - continue; - } // the dist between frame's end outline and next frame's start outline - // expect that next frame's start outline is startOutline[j] + end - - - dist = Math.min(startOutline[j] + end - endOutline[j], dist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] !== DUMMY_POSITION) { - continue; - } - - startOutline[i] = Math.max.apply(Math, startOutline); - endOutline[i] = startOutline[i]; - } // The target outline is start outline when type is appending - - - var targetOutline = isAppend ? startOutline : endOutline; - var prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? "max" : "min"].apply(Math, outline); - var prevOutlineDist = isAppend ? 0 : end; - - if (frameFill && outline.length === shapesSize) { - prevOutlineDist = -DUMMY_POSITION; - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] === endOutline[i]) { - continue; - } // if appending type is prepend(false), subtract dist from appending group's height. - - - prevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - startOutline[i] += prevOutlineEnd - prevOutlineDist; - endOutline[i] += prevOutlineEnd - prevOutlineDist; - } - - items.forEach(function (item) { - item.rect[pos1Name] += prevOutlineEnd - prevOutlineDist; - }); - return { - start: startOutline.map(function (point) { - return parseInt(point, 10); - }), - end: endOutline.map(function (point) { - return parseInt(point, 10); - }) - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return FrameLayout; - }(); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - InfiniteGrid.FrameLayout = FrameLayout; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.framelayout.js.map diff --git a/dist/infinitegrid.framelayout.js.map b/dist/infinitegrid.framelayout.js.map deleted file mode 100644 index 68b542bbd..000000000 --- a/dist/infinitegrid.framelayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.framelayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/lazyloaded/dist/lazyloaded.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/FrameLayout.ts","../src/index.framelayout.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n this._eventHandler = {};\n this.options = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport FrameLayout from \"./layouts/FrameLayout\";\n\n(InfiniteGrid as any).FrameLayout = FrameLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","v","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","items","item","jQuery","constructor","jquery","arr","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","categorize","result","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","WIDTH","HEIGHT","isDataAttribute","prefix","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkReady","checkFinish","tagName","setTimeout","images","img","j","complete","naturalWidth","itemTarget","onError","onCheck","srcElement","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","scroller","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","frame","disableFrame","shapes","searchShapeInFrame","sort","a","b","assignOptions","itemSize","frameFill","row","_itemSize","_shapes","getShapes","_style","getStyleNames","point","_checkItemSize","size1Name","size2Name","pos1Name","pos2Name","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","startOutline","fill","endOutline","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","clone","cloneItems","FrameLayout"],"mappings":";;;;;;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CAACqc,KAAD,EAAQ,EAAR,CAAR;IAAmB,OAA7C,CADD;IAENnU,MAAAA,GAAG,EAAEiV,UAAU,CAACviB,GAAX,CAAe,UAAAyhB,KAAA;IAAS,eAAArc,QAAQ,CAACqc,KAAD,EAAQ,EAAR,CAAR;IAAmB,OAA3C;IAFC,KAAP;IAIA,GAzGS;;IA0GF,iBAAA,GAAR,UAAgBjX,KAAhB,EAAiD8M,OAAjD,EAAyE/F,QAAzE,EAA6FkD,KAA7F;IAAgB,wBAAA,EAAA;IAAAjK,MAAAA,UAAA;;;IAAiC,0BAAA,EAAA;IAAA8M,MAAAA,YAAA;;;;IAEhD,QAAM2L,KAAK,GAAGxO,KAAK,GAAGjK,KAAH,GAAW0Y,UAAU,CAAC1Y,KAAD,CAAxC;IAEA,WAAO;IACNA,MAAAA,KAAK,EAAEyY,KADD;IAEN7V,MAAAA,QAAQ,EAAE,KAAKwJ,OAAL,CAAaqM,KAAb,EAAoB3L,OAApB,EAA6B/F,QAA7B;IAFJ,KAAP;IAIA,GARO;;IAST,oBAAA;IAAC,GA7ND;;ICrJA;;;;AAIA,IAGCiP,YAAoB,CAAC2C,WAArB,GAAmCA,WAAnC;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.framelayout.min.js b/dist/infinitegrid.framelayout.min.js deleted file mode 100644 index 760e6b14d..000000000 --- a/dist/infinitegrid.framelayout.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function k(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return $(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return k(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?k(t.toArray(),!0):k(t.get(0),!1),i;if(R(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?K(i):i&&i[0]}function q(t,e,i,n){if(s){var r=n||!1;"object"==typeof n&&(r=!!o&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function B(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function j(t){return(i?u.getComputedStyle(t):t.currentStyle)||{}}function F(t,e,i){if($(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=j(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function H(t){return F(t,"Width",!1)}function N(t){return F(t,"Height",!1)}function D(t){return F(t,"Width",!0)}function W(t){return F(t,"Height",!0)}function X(t){return{width:D(t),height:W(t)}}var Y={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function Q(i){for(var t=[],e=1;e발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport FrameLayout from \"./layouts/FrameLayout\";\n\n(InfiniteGrid as any).FrameLayout = FrameLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","this","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","win","Result","prevList","list","added","removed","changed","maintained","changedBeforeAdded","fixed","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","orderChanged","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","isWindow","jQuery","constructor","jquery","toArray","isJQuery","isArray","v","$","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","target","_i","sources","source","arr","ItemManager","elements","groupKey","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","items","item","item2","data2","assign","status","clear","group","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","insert","groupKeys","newGroups","newItems","categorize","result","removedIndex","nextGroups","addedIndex","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","scrollPos","isForward","endScrollPos","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","IS_IE","WIDTH","HEIGHT","isDataAttribute","prefix","add","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkFinish","tagName","setTimeout","images","img","j","onCheck","srcElement","itemTarget","complete","naturalWidth","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","frame","disableFrame","defaultOptions","assignOptions","itemSize","frameFill","row","_itemSize","_shapes","shapes","searchShapeInFrame","sort","a","b","getShapes","_style","isHorizontal","getStyleNames","point","_checkItemSize","size1Name","size2Name","pos1Name","pos2Name","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","startOutline","fill","endOutline","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","clone","cloneItems","FrameLayout"],"mappings":";;;;;;;;slBAaA,SAASA,EAAYC,eACK,IAAVA,EAShB,IAAIC,EAEJ,eACMA,sBAiBOA,SACFC,cAAgB,QAChBC,QAAU,OA+BbC,EAASH,EAAUI,iBAEvBD,EAAOE,QAAU,SAAiBC,EAAWC,QACvB,IAAhBA,IACFA,EAAc,QAGZC,EAAcC,KAAKR,cAAcK,IAAc,QACT,EAArBE,EAAYE,eAGxB,EAITF,EAAcA,EAAYG,SAC1BJ,EAAYK,UAAYN,MACpBO,GAAa,EACbC,EAAM,CAACP,GACPQ,EAAI,EAERR,EAAYS,KAAO,WACjBH,GAAa,GAGfN,EAAYU,cAAgBR,SAEvB,IAAIS,EAAOC,UAAUT,OAAQU,EAAY,IAAIC,MAAa,EAAPH,EAAWA,EAAO,EAAI,GAAII,EAAO,EAAGA,EAAOJ,EAAMI,IACvGF,EAAUE,EAAO,GAAKH,UAAUG,OAGV,GAApBF,EAAUV,SACZI,EAAMA,EAAIH,OAAOS,IAGdL,EAAI,EAAGP,EAAYO,GAAIA,IAC1BP,EAAYO,GAAGQ,MAAMd,KAAMK,UAGrBD,GA0BVV,EAAOqB,KAAO,SAAclB,EAAWmB,MACZ,iBAAdnB,GAA0BR,EAAY2B,GAAkB,KAE7DV,EADAW,EAAYpB,MAGXS,KAAKW,OACHF,KAAKT,EAAGW,EAAUX,WAGlBN,KACF,GAAyB,iBAAdH,GAAqD,mBAApBmB,EAAgC,KAC7EE,EAAOlB,UACNmB,GAAGtB,EAAW,SAASuB,QACrB,IAAI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ulB,EAAavlB,IAAMimB,EAAiBC,EACpCT,EAAWzlB,IAAMimB,EAAiBC,SAEnCxX,EAAMpK,QAAQ,SAAAqK,GACbA,EAAKf,KAAKmX,IAAakB,EAAiBC,IAElC,CACN3W,MAAOgW,EAAa3gB,IAAI,SAAA+f,UAASjc,SAASic,EAAO,MACjDnV,IAAKiW,EAAW7gB,IAAI,SAAA+f,UAASjc,SAASic,EAAO,kBAG/C,SAAgBjW,EAAiCmL,EAAwBjG,EAAoBoD,gBAA7EtI,mBAAiCmL,UAE1CsM,EAAQnP,EAAQtI,WR9FqCA,UACrDA,EAAM9J,IAAI,SAAA+J,UAAQG,EAAO,GAAIH,KQ6FLyX,CAAW1X,SAElC,CACNA,MAAOyX,EACP7W,SAAU5P,KAAKyZ,QAAQgN,EAAOtM,EAASjG,iBCxWzC4P,GAAqB6C,YAAcA"} \ No newline at end of file diff --git a/dist/infinitegrid.gridlayout.js b/dist/infinitegrid.gridlayout.js deleted file mode 100644 index 8873e6d4c..000000000 --- a/dist/infinitegrid.gridlayout.js +++ /dev/null @@ -1,4949 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory()); -}(this, (function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/component project is licensed under the MIT license - - @egjs/component JavaScript library - https://naver.github.io/egjs-component - - @version 2.1.2 - */ - - /** - * Copyright (c) 2015 NAVER Corp. - * egjs projects are licensed under the MIT license - */ - function isUndefined(value) { - return typeof value === "undefined"; - } - /** - * A class used to manage events in a component - * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스 - * @alias eg.Component - */ - - - var Component = - /*#__PURE__*/ - function () { - var Component = - /*#__PURE__*/ - function () { - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.Component.VERSION; // ex) 2.0.0 - * @memberof eg.Component - */ - - /** - * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - */ - function Component() { - this._eventHandler = {}; - this.options = {}; - } - /** - * Triggers a custom event. - * @ko 커스텀 이벤트를 발생시킨다 - * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름 - * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터 - * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고 - * @example - class Some extends eg.Component { - some(){ - if(this.trigger("beforeHi")){ // When event call to stop return false. - this.trigger("hi");// fire hi event. - } - } - } - const some = new Some(); - some.on("beforeHi", (e) => { - if(condition){ - e.stop(); // When event call to stop, `hi` event not call. - } - }); - some.on("hi", (e) => { - // `currentTarget` is component instance. - console.log(some === e.currentTarget); // true - }); - // If you want to more know event design. You can see article. - // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F - */ - - - var _proto = Component.prototype; - - _proto.trigger = function trigger(eventName, customEvent) { - if (customEvent === void 0) { - customEvent = {}; - } - - var handlerList = this._eventHandler[eventName] || []; - var hasHandlerList = handlerList.length > 0; - - if (!hasHandlerList) { - return true; - } // If detach method call in handler in first time then handler list calls. - - - handlerList = handlerList.concat(); - customEvent.eventType = eventName; - var isCanceled = false; - var arg = [customEvent]; - var i = 0; - - customEvent.stop = function () { - isCanceled = true; - }; - - customEvent.currentTarget = this; - - for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - restParam[_key - 2] = arguments[_key]; - } - - if (restParam.length >= 1) { - arg = arg.concat(restParam); - } - - for (i = 0; handlerList[i]; i++) { - handlerList[i].apply(this, arg); - } - - return !isCanceled; - }; - /** - * Executed event just one time. - * @ko 이벤트가 한번만 실행된다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - alert("hi"); - } - thing() { - this.once("hi", this.hi); - } - } - var some = new Some(); - some.thing(); - some.trigger("hi"); - // fire alert("hi"); - some.trigger("hi"); - // Nothing happens - */ - - - _proto.once = function once(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var i; - - for (i in eventHash) { - this.once(i, eventHash[i]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var self = this; - this.on(eventName, function listener() { - for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - arg[_key2] = arguments[_key2]; - } - - handlerToAttach.apply(self, arg); - self.off(eventName, listener); - }); - } - - return this; - }; - /** - * Checks whether an event has been attached to a component. - * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다. - * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름 - * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부 - * @example - class Some extends eg.Component { - some() { - this.hasOn("hi");// check hi event. - } - } - */ - - - _proto.hasOn = function hasOn(eventName) { - return !!this._eventHandler[eventName]; - }; - /** - * Attaches an event to a component. - * @ko 컴포넌트에 이벤트를 등록한다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.on("hi",this.hi); //attach event - } - } - */ - - - _proto.on = function on(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.on(name, eventHash[name]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var handlerList = this._eventHandler[eventName]; - - if (isUndefined(handlerList)) { - this._eventHandler[eventName] = []; - handlerList = this._eventHandler[eventName]; - } - - handlerList.push(handlerToAttach); - } - - return this; - }; - /** - * Detaches an event from the component. - * @ko 컴포넌트에 등록된 이벤트를 해제한다 - * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름 - * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.off("hi",this.hi); //detach event - } - } - */ - - - _proto.off = function off(eventName, handlerToDetach) { - // All event detach. - if (isUndefined(eventName)) { - this._eventHandler = {}; - return this; - } // All handler of specific event detach. - - - if (isUndefined(handlerToDetach)) { - if (typeof eventName === "string") { - this._eventHandler[eventName] = undefined; - return this; - } else { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.off(name, eventHash[name]); - } - - return this; - } - } // The handler of specific event detach. - - - var handlerList = this._eventHandler[eventName]; - - if (handlerList) { - var k; - var handlerFunction; - - for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) { - if (handlerFunction === handlerToDetach) { - handlerList = handlerList.splice(k, 1); - break; - } - } - } - - return this; - }; - - return Component; - }(); - - Component.VERSION = "2.1.2"; - return Component; - }(); - - /* - Copyright (c) 2019-present NAVER Corp. - name: @egjs/list-differ - license: MIT - author: NAVER Corp. - repository: https://github.com/naver/egjs-list-differ - version: 1.0.0 - */ - - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - var PolyMap = - /*#__PURE__*/ - function () { - function PolyMap() { - this.keys = []; - this.values = []; - } - - var __proto = PolyMap.prototype; - - __proto.get = function (key) { - return this.values[this.keys.indexOf(key)]; - }; - - __proto.set = function (key, value) { - var keys = this.keys; - var values = this.values; - var prevIndex = keys.indexOf(key); - var index = prevIndex === -1 ? keys.length : prevIndex; - keys[index] = key; - values[index] = value; - }; - - return PolyMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var HashMap = - /*#__PURE__*/ - function () { - function HashMap() { - this.object = {}; - } - - var __proto = HashMap.prototype; - - __proto.get = function (key) { - return this.object[key]; - }; - - __proto.set = function (key, value) { - this.object[key] = value; - }; - - return HashMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var SUPPORT_MAP = typeof Map === "function"; - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - var Link = - /*#__PURE__*/ - function () { - function Link() {} - - var __proto = Link.prototype; - - __proto.connect = function (prevLink, nextLink) { - this.prev = prevLink; - this.next = nextLink; - prevLink && (prevLink.next = this); - nextLink && (nextLink.prev = this); - }; - - __proto.disconnect = function () { - // In double linked list, diconnect the interconnected relationship. - var prevLink = this.prev; - var nextLink = this.next; - prevLink && (prevLink.next = nextLink); - nextLink && (nextLink.prev = prevLink); - }; - - __proto.getIndex = function () { - var link = this; - var index = -1; - - while (link) { - link = link.prev; - ++index; - } - - return index; - }; - - return Link; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - function orderChanged(changed, fixed) { - // It is roughly in the order of these examples. - // 4, 6, 0, 2, 1, 3, 5, 7 - var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 - - var toLinks = []; - changed.forEach(function (_a) { - var from = _a[0], - to = _a[1]; - var link = new Link(); - fromLinks[from] = link; - toLinks[to] = link; - }); // `fromLinks` are connected to each other by double linked list. - - fromLinks.forEach(function (link, i) { - link.connect(fromLinks[i - 1]); - }); - return changed.filter(function (_, i) { - return !fixed[i]; - }).map(function (_a, i) { - var from = _a[0], - to = _a[1]; - - if (from === to) { - return [0, 0]; - } - - var fromLink = fromLinks[from]; - var toLink = toLinks[to - 1]; - var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. - - fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. - - if (!toLink) { - fromLink.connect(undefined, fromLinks[0]); - } else { - fromLink.connect(toLink, toLink.next); - } - - var toIndex = fromLink.getIndex(); - return [fromIndex, toIndex]; - }); - } - - var Result = - /*#__PURE__*/ - function () { - function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { - this.prevList = prevList; - this.list = list; - this.added = added; - this.removed = removed; - this.changed = changed; - this.maintained = maintained; - this.changedBeforeAdded = changedBeforeAdded; - this.fixed = fixed; - } - - var __proto = Result.prototype; - Object.defineProperty(__proto, "ordered", { - get: function () { - if (!this.cacheOrdered) { - this.caculateOrdered(); - } - - return this.cacheOrdered; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(__proto, "pureChanged", { - get: function () { - if (!this.cachePureChanged) { - this.caculateOrdered(); - } - - return this.cachePureChanged; - }, - enumerable: true, - configurable: true - }); - - __proto.caculateOrdered = function () { - var ordered = orderChanged(this.changedBeforeAdded, this.fixed); - var changed = this.changed; - var pureChanged = []; - this.cacheOrdered = ordered.filter(function (_a, i) { - var from = _a[0], - to = _a[1]; - var _b = changed[i], - fromBefore = _b[0], - toBefore = _b[1]; - - if (from !== to) { - pureChanged.push([fromBefore, toBefore]); - return true; - } - }); - this.cachePureChanged = pureChanged; - }; - - return Result; - }(); - /** - * - * @memberof eg.ListDiffer - * @static - * @function - * @param - Previous List 이전 목록 - * @param - List to Update 업데이트 할 목록 - * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. - * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. - * @example - * import { diff } from "@egjs/list-differ"; - * // script => eg.ListDiffer.diff - * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); - * // List before update - * // [1, 2, 3, 4, 5] - * console.log(result.prevList); - * // Updated list - * // [4, 3, 6, 2, 1] - * console.log(result.list); - * // Index array of values added to `list` - * // [0, 1, 5] - * console.log(result.added); - * // Index array of values removed in `prevList` - * // [5] - * console.log(result.removed); - * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.changed); - * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) - * // [[4, 3], [3, 4], [2, 6]] - * console.log(result.pureChanged); - * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) - * // [[4, 1], [4, 2], [4, 3]] - * console.log(result.ordered); - * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.maintained); - */ - - - function diff(prevList, list, findKeyCallback) { - var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; - - var callback = findKeyCallback || function (e) { - return e; - }; - - var added = []; - var removed = []; - var maintained = []; - var prevKeys = prevList.map(callback); - var keys = list.map(callback); - var prevKeyMap = new mapClass(); - var keyMap = new mapClass(); - var changedBeforeAdded = []; - var fixed = []; - var removedMap = {}; - var changed = []; - var addedCount = 0; - var removedCount = 0; // Add prevKeys and keys to the hashmap. - - prevKeys.forEach(function (key, prevListIndex) { - prevKeyMap.set(key, prevListIndex); - }); - keys.forEach(function (key, listIndex) { - keyMap.set(key, listIndex); - }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. - - prevKeys.forEach(function (key, prevListIndex) { - var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. - - if (typeof listIndex === "undefined") { - ++removedCount; - removed.push(prevListIndex); - } else { - removedMap[listIndex] = removedCount; - } - }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. - - keys.forEach(function (key, listIndex) { - var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. - - if (typeof prevListIndex === "undefined") { - added.push(listIndex); - ++addedCount; - } else { - maintained.push([prevListIndex, listIndex]); - removedCount = removedMap[listIndex] || 0; - changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); - fixed.push(listIndex === prevListIndex); - - if (prevListIndex !== listIndex) { - changed.push([prevListIndex, listIndex]); - } - } - }); // Sort by ascending order of 'to(list's index). - - removed.reverse(); - return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); - } - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var ALIGN = { - START: "start", - CENTER: "center", - END: "end", - JUSTIFY: "justify" - }; - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document$1.body[prop] || document$1.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document$1.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function fill(arr, value) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - arr[i] = value; - } - - return arr; - } - function isUndefined$1(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined$1(start) ? this._groups : this.sliceGroups(start, (isUndefined$1(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document$1.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document$1.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/lazyloaded JavaScript library - @egjs/lazyloaded project is licensed under the MIT license - - - @version 0.0.2 - */ - var isWindow$1 = typeof window !== "undefined"; - var ua$1 = isWindow$1 ? window.navigator.userAgent : ""; - var SUPPORT_COMPUTEDSTYLE$1 = isWindow$1 ? !!("getComputedStyle" in window) : false; - var IS_IE$1 = /MSIE|Trident|Windows Phone|Edge/.test(ua$1); - var SUPPORT_ADDEVENTLISTENER$1 = isWindow$1 ? !!("addEventListener" in document) : false; - var WIDTH = "width"; - var HEIGHT = "height"; - - function getAttribute(el, name) { - return el.getAttribute(name) || ""; - } - - function toArray$1(arr) { - return [].slice.call(arr); - } - - function isDataAttribute(target, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - return !!target.getAttribute(prefix + "width"); - } - - function addEvent$1(element, type, handler) { - if (SUPPORT_ADDEVENTLISTENER$1) { - element.addEventListener(type, handler, false); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - - function removeEvent$1(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - - function innerWidth$1(el) { - return getSize$1(el, "Width"); - } - - function innerHeight$1(el) { - return getSize$1(el, "Height"); - } - - function getStyles$1(el) { - return (SUPPORT_COMPUTEDSTYLE$1 ? window.getComputedStyle(el) : el.currentStyle) || {}; - } - - function getSize$1(el, name) { - var size = el["client" + name] || el["offset" + name]; - return parseFloat(size || getStyles$1(el)[name.toLowerCase()]) || 0; - } - - var elements = []; - - function add(element, prefix) { - !elements.length && addEvent$1(window, "resize", resizeAll); - element.__PREFIX__ = prefix; - elements.push(element); - resize(element); - } - - function remove(element, prefix) { - var index = elements.indexOf(element); - - if (index < 0) { - return; - } - - var fixed = getAttribute(element, prefix + "fixed"); - delete element.__PREFIX__; - element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = ""; - elements.splice(index, 1); - !elements.length && removeEvent$1(window, "resize", resizeAll); - } - - function resize(element, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var elementPrefix = element.__PREFIX__; - - if (typeof elementPrefix !== "string") { - elementPrefix = prefix; - } - - var dataWidth = parseInt(getAttribute(element, "" + elementPrefix + WIDTH), 10) || 0; - var dataHeight = parseInt(getAttribute(element, "" + elementPrefix + HEIGHT), 10) || 0; - var fixed = getAttribute(element, elementPrefix + "fixed"); - - if (fixed === HEIGHT) { - var size = innerHeight$1(element) || dataHeight; - element.style[WIDTH] = dataWidth / dataHeight * size + "px"; - } else { - var size = innerWidth$1(element) || dataWidth; - element.style[HEIGHT] = dataHeight / dataWidth * size + "px"; - } - } - - function resizeAll() { - elements.forEach(function (element) { - resize(element); - }); - } - /** - * @namespace eg.LazyLoaded - */ - - /** - * This module is used to wait for images or videos to load. - * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다. - * @memberof eg.LazyLoaded - * @param - - * @example - * ## HTML - * ```html - *
- * - * - * - * - * - * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * finish: () => console.log("finish"), - * error: e => console.log("error", e), - * }); - * ``` - */ - - - function check(elements, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var component = new Component(); - var finishCount = 0; - var readyCount = 0; - - function checkReady() { - if (--readyCount !== 0) { - return; - } - /** - * An event occurs when the size of all images is available. - * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#ready - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * }); - * ``` - */ - - - component.trigger("ready"); - } - - function checkFinish() { - if (--finishCount !== 0) { - return; - } - /** - * An event occurs when all images have been completed loading. - * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#finish - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * finish: () => console.log("finish"), - * }); - * ``` - */ - - - component.trigger("finish"); - } - - elements.forEach(function (el, i) { - var tagName = el.tagName; - - if (isDataAttribute(el, prefix) && tagName !== "IMG") { - add(el, prefix); - ++finishCount; - setTimeout(function () { - check(toArray$1(el.querySelectorAll("img")), prefix).on("finish", function () { - remove(el, prefix); - checkFinish(); - }); - }); - return; - } - - var images = tagName === "IMG" ? [el] : toArray$1(el.querySelectorAll("img")); - - if (!images.length) { - return; - } - - images.forEach(function (img, j) { - if (img.complete && (!IS_IE$1 || IS_IE$1 && img.naturalWidth)) { - if (!img.naturalWidth) { - setTimeout(function () { - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - }); - } - - return; - } - - if (isDataAttribute(img, prefix)) { - add(img, prefix); - } else { - ++readyCount; - } - - ++finishCount; - - function onError() { - /** - * An event occurs if the image fails to load. - * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다. - * @event eg.LazyLoaded#error - * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트 - * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스 - * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트 - * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스 - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * error: e => { - * //
...
, 0, , 2 - * console.log(e.itemTarget, e.itemIndex, e.target, e.index), - * }, - * }); - * ``` - */ - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - } - - function onCheck(e) { - var target = e.target || e.srcElement; - removeEvent$1(target, "error", onCheck); - removeEvent$1(target, "load", onCheck); - - if (isDataAttribute(target, prefix)) { - remove(target, prefix); - } else { - checkReady(); - } - - if (e.type === "error") { - onError(); - } - - checkFinish(); - } - - addEvent$1(img, "load", onCheck); - addEvent$1(img, "error", onCheck); - IS_IE$1 && img.setAttribute("src", img.getAttribute("src")); - }); - }); - !readyCount && setTimeout(function () { - component.trigger("ready"); - }); - !finishCount && setTimeout(function () { - component.trigger("finish"); - }); - return component; - } - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove$$1 = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - remove(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove$$1, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - var START = ALIGN.START, - CENTER = ALIGN.CENTER, - END = ALIGN.END, - JUSTIFY = ALIGN.JUSTIFY; - /** - * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card. - * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다. - * @class eg.InfiniteGrid.GridLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @example - ``` - - ``` - **/ - - var GridLayout = - /*#__PURE__*/ - function () { - function GridLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - align: START, - itemSize: 0 - }, options); - this._size = 0; - this._columnSize = 0; - this._columnLength = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - var __proto = GridLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.GridLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - var _this = this; - - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var firstItem = groups.length && groups[0].items.length && groups[0].items[0]; - this.checkColumn(firstItem); // if outlines' length and columns' length are now same, re-caculate outlines. - - var startOutline; - - if (outline.length !== this._columnLength) { - var pos = outline.length === 0 ? 0 : Math.min.apply(Math, outline); // re-layout items. - - startOutline = fill(new Array(this._columnLength), pos); - } else { - startOutline = outline.slice(); - } - - groups.forEach(function (group) { - var items = group.items; - - var result = _this._layout(items, startOutline, true); - - group.outlines = result; - startOutline = result.end; - }); - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.GridLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto.checkColumn = function (item) { - var _a = this.options, - itemSize = _a.itemSize, - margin = _a.margin, - horizontal = _a.horizontal; - var sizeName = horizontal ? "height" : "width"; - var columnSize = Math.floor(itemSize || item && item.size[sizeName] || 0) || 0; - this._columnSize = columnSize; - - if (!columnSize) { - this._columnLength = 1; - return; - } - - this._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1); - }; - - __proto._layout = function (items, outline, isAppend) { - var _a; - - var length = items.length; - var margin = this.options.margin; - var align = this.options.align; - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - var columnSize = this._columnSize; - var columnLength = this._columnLength; - var size = this._size; - var viewDist = size - (columnSize + margin) * columnLength + margin; - var pointCaculateName = isAppend ? "min" : "max"; - var indexCaculateName = isAppend ? "indexOf" : "lastIndexOf"; - var startOutline = outline.slice(); - var endOutline = outline.slice(); - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline) || 0; - var index = endOutline[indexCaculateName](point); - var item = items[isAppend ? i : length - 1 - i]; - var itemSize = item.size; - - if (!itemSize) { - continue; - } - - var size1 = itemSize[size1Name]; - var size2 = itemSize[size2Name]; - var pos1 = isAppend ? point : point - margin - size1; - var endPos1 = pos1 + size1 + margin; - - if (index === -1) { - index = 0; - } - - var pos2 = (columnSize + margin) * index; // ALIGN - - if (align === CENTER) { - pos2 += viewDist / 2; - } else if (align === END) { - pos2 += viewDist + columnSize - size2; - } else if (align === JUSTIFY) { - if (columnLength <= 1) { - pos2 += viewDist / 2; - } else { - pos2 = (size - columnSize) / (columnLength - 1) * index; - } - } // tetris - - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a); - item.column = index; - endOutline[index] = isAppend ? endPos1 : pos1; - } - - if (!isAppend) { - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } // if append items, startOutline is low, endOutline is high - // if prepend items, startOutline is high, endOutline is low - - - return { - start: isAppend ? startOutline : endOutline, - end: isAppend ? endOutline : startOutline - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } - - var clone = cache ? items : cloneItems(items); - var startOutline = outline; - - if (!this._columnLength) { - this.checkColumn(items[0]); - } - - if (outline.length !== this._columnLength) { - startOutline = fill(new Array(this._columnLength), outline.length ? Math[isAppend ? "min" : "max"].apply(Math, outline) || 0 : 0); - } - - var result = this._layout(clone, startOutline, isAppend); - - return { - items: clone, - outlines: result - }; - }; - - return GridLayout; - }(); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - InfiniteGrid.GridLayout = GridLayout; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.gridlayout.js.map diff --git a/dist/infinitegrid.gridlayout.js.map b/dist/infinitegrid.gridlayout.js.map deleted file mode 100644 index 677482648..000000000 --- a/dist/infinitegrid.gridlayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.gridlayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/lazyloaded/dist/lazyloaded.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/GridLayout.ts","../src/index.gridlayout.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n this._eventHandler = {};\n this.options = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\n\n(InfiniteGrid as any).GridLayout = GridLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","ALIGN","START","CENTER","END","JUSTIFY","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","v","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","items","item","jQuery","constructor","jquery","arr","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","categorize","result","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","WIDTH","HEIGHT","isDataAttribute","prefix","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkReady","checkFinish","tagName","setTimeout","images","img","j","complete","naturalWidth","itemTarget","onError","onCheck","srcElement","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","scroller","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","assignOptions","align","itemSize","_columnSize","_columnLength","_style","getStyleNames","firstItem","checkColumn","startOutline","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","GridLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;IASA;;;;IAIA,SAASA,WAAT,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,aAAV,EAAyB;IACxB,WAAKI,WAAL,CAAiBzW,KAAK,CAAC,CAAD,CAAtB;IACA;;IACD,QAAI8M,OAAO,CAAC7b,MAAR,KAAmB,KAAKolB,aAA5B,EAA2C;IAC1CK,MAAAA,YAAY,GAAGC,IAAI,CAAC,IAAI/kB,KAAJ,CAAU,KAAKykB,aAAf,CAAD,EAAgCvJ,OAAO,CAAC7b,MAAR,GAAkB+M,IAAI,CAAC+I,QAAQ,GAAG,KAAH,GAAW,KAApB,CAAJ,MAAA,CAAA/I,IAAA,EAAkC8O,OAAlC,KAA8C,CAAhE,GAAqE,CAArG,CAAnB;IACA;;IAED,QAAM9I,MAAM,GAAG,KAAKoI,OAAL,CAAa6L,KAAb,EAAoBvB,YAApB,EAAkC3P,QAAlC,CAAf;;IAEA,WAAO;IACN/G,MAAAA,KAAK,EAAEiY,KADD;IAENrV,MAAAA,QAAQ,EAAEoB;IAFJ,KAAP;IAIA,GAvBO;;IAwBT,mBAAA;IAAC,GAtND;;ICzCA;;;;AAIA,IAGCgS,YAAoB,CAACmC,UAArB,GAAkCA,UAAlC;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.gridlayout.min.js b/dist/infinitegrid.gridlayout.min.js deleted file mode 100644 index 2569a3a6a..000000000 --- a/dist/infinitegrid.gridlayout.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var f=function(){return(f=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function H(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return tt(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return H(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?H(t.toArray(),!0):H(t.get(0),!1),i;if(j(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?V(i):i&&i[0]}function F(t,e,i,n){if(s){var r=n||!1;"object"==typeof n&&(r=!!o&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function N(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function D(t){return(i?u.getComputedStyle(t):t.currentStyle)||{}}function W(t,e,i){if(tt(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=D(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function X(t){return W(t,"Width",!1)}function Y(t){return W(t,"Height",!1)}function Q(t){return W(t,"Width",!0)}function $(t){return W(t,"Height",!0)}function J(t){return{width:Q(t),height:$(t)}}var U={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function Z(i){for(var t=[],e=1;e발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\n\n(InfiniteGrid as any).GridLayout = GridLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","this","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","win","Result","prevList","list","added","removed","changed","maintained","changedBeforeAdded","fixed","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","orderChanged","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","ALIGN","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","isWindow","jQuery","constructor","jquery","toArray","isJQuery","isArray","v","$","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","target","_i","sources","source","arr","ItemManager","elements","groupKey","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","items","item","item2","data2","assign","status","clear","group","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","insert","groupKeys","newGroups","newItems","categorize","result","removedIndex","nextGroups","addedIndex","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","scrollPos","isForward","endScrollPos","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","IS_IE","WIDTH","HEIGHT","isDataAttribute","prefix","add","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkFinish","tagName","setTimeout","images","img","j","onCheck","srcElement","itemTarget","complete","naturalWidth","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","START","CENTER","END","JUSTIFY","defaultOptions","assignOptions","align","itemSize","_columnSize","_columnLength","_style","isHorizontal","getStyleNames","startOutline","firstItem","checkColumn","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","GridLayout"],"mappings":";;;;;;;;slBAaA,SAASA,EAAYC,eACK,IAAVA,EAShB,IAAIC,EAEJ,eACMA,sBAiBOA,SACFC,cAAgB,QAChBC,QAAU,OA+BbC,EAASH,EAAUI,iBAEvBD,EAAOE,QAAU,SAAiBC,EAAWC,QACvB,IAAhBA,IACFA,EAAc,QAGZC,EAAcC,KAAKR,cAAcK,IAAc,QACT,EAArBE,EAAYE,eAGxB,EAITF,EAAcA,EAAYG,SAC1BJ,EAAYK,UAAYN,MACpBO,GAAa,EACbC,EAAM,CAACP,GACPQ,EAAI,EAERR,EAAYS,KAAO,WACjBH,GAAa,GAGfN,EAAYU,cAAgBR,SAEvB,IAAIS,EAAOC,UAAUT,OAAQU,EAAY,IAAIC,MAAa,EAAPH,EAAWA,EAAO,EAAI,GAAII,EAAO,EAAGA,EAAOJ,EAAMI,IACvGF,EAAUE,EAAO,GAAKH,UAAUG,OAGV,GAApBF,EAAUV,SACZI,EAAMA,EAAIH,OAAOS,IAGdL,EAAI,EAAGP,EAAY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AmL,UAIMkM,EAAQ/O,EAAQtI,WRgCqCA,UACrDA,EAAM/J,IAAI,SAAAgK,UAAQG,EAAO,GAAIH,KQjCLqX,CAAWtX,GAErC4V,EAAezK,SAEdpa,KAAKykB,oBACJM,YAAY9V,EAAM,IAEpBmL,EAAQna,SAAWD,KAAKykB,gBAC3BI,EAAeG,GAAK,IAAIpkB,MAAMZ,KAAKykB,eAAgBrK,EAAQna,QAAU8L,KAAKoI,EAAW,MAAQ,aAAxBpI,KAAkCqO,IAAiB,IAKlH,CACNnL,MAAOqX,EACPzW,SAJc7P,KAAK0Z,QAAQ4M,EAAOzB,EAAc1Q,iBCjPlD4P,GAAqByC,WAAaA"} \ No newline at end of file diff --git a/dist/infinitegrid.js b/dist/infinitegrid.js deleted file mode 100644 index cc0852bb2..000000000 --- a/dist/infinitegrid.js +++ /dev/null @@ -1,5583 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/list-differ'), require('@egjs/lazyloaded')) : - typeof define === 'function' && define.amd ? define(['@egjs/component', '@egjs/list-differ', '@egjs/lazyloaded'], factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory(global.eg.Component,global.eg.ListDiffer,global.eg.LazyLoaded)); -}(this, (function (Component,listDiffer,lazyloaded) { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var ALIGN = { - START: "start", - CENTER: "center", - END: "end", - JUSTIFY: "justify" - }; - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - var INFINITEGRID_EVENTS = ["append", "prepend", "imageError", "change", "layoutComplete"]; // It's for making mistakes. - // Whenever you add a public method, you must add the corresponding method name to an array or object. - // An additional error may occur if not added. - - var INFINITEGRID_METHODS = { - getLoadingBar: true, - getItem: true, - getItems: true, - layout: true, - getGroupKeys: true, - getStatus: true, - setStatus: true, - isProcessing: true, - startLoading: true, - endLoading: true, - isLoading: true, - updateItem: true, - updateItems: true, - moveTo: true - }; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document.body[prop] || document.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function toZeroArray(outline) { - if (!outline || !outline.length) { - return [0]; - } - - return outline; - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function fill(arr, value) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - arr[i] = value; - } - - return arr; - } - function isUndefined(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - /** - * Decorator that makes the method of infinitegrid available in the framework. - * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터. - * @memberof eg.InfiniteGrid - * @private - * @example - * ```js - * import NativeInfiniteGrid, { withInfiniteGridMethods } from "@egjs/infinitegrid"; - * - * class InfiniteGrid extends React.Component> { - * @withInfiniteGridMethods - * private infinitegrid: NativeInfiniteGrid; - * } - * ``` - */ - - function withInfiniteGridMethods(prototype, infinitegridName) { - Object.keys(INFINITEGRID_METHODS).forEach(function (name) { - if (prototype[name]) { - return; - } - - prototype[name] = function () { - var args = []; - - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - - var _a; - - var result = (_a = this[infinitegridName])[name].apply(_a, args); // fix `this` type to return your own `infinitegrid` instance to the instance using the decorator. - - - if (result === this[infinitegridName]) { - return this; - } else { - return result; - } - }; - }); - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = listDiffer.diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = listDiffer.diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = listDiffer.diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - lazyloaded.check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - lazyloaded.removeAutoSizer(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - lazyloaded.check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - var START = ALIGN.START, - CENTER = ALIGN.CENTER, - END = ALIGN.END, - JUSTIFY = ALIGN.JUSTIFY; - /** - * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card. - * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다. - * @class eg.InfiniteGrid.GridLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @example - ``` - - ``` - **/ - - var GridLayout = - /*#__PURE__*/ - function () { - function GridLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - align: START, - itemSize: 0 - }, options); - this._size = 0; - this._columnSize = 0; - this._columnLength = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - var __proto = GridLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.GridLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - var _this = this; - - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var firstItem = groups.length && groups[0].items.length && groups[0].items[0]; - this.checkColumn(firstItem); // if outlines' length and columns' length are now same, re-caculate outlines. - - var startOutline; - - if (outline.length !== this._columnLength) { - var pos = outline.length === 0 ? 0 : Math.min.apply(Math, outline); // re-layout items. - - startOutline = fill(new Array(this._columnLength), pos); - } else { - startOutline = outline.slice(); - } - - groups.forEach(function (group) { - var items = group.items; - - var result = _this._layout(items, startOutline, true); - - group.outlines = result; - startOutline = result.end; - }); - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.GridLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto.checkColumn = function (item) { - var _a = this.options, - itemSize = _a.itemSize, - margin = _a.margin, - horizontal = _a.horizontal; - var sizeName = horizontal ? "height" : "width"; - var columnSize = Math.floor(itemSize || item && item.size[sizeName] || 0) || 0; - this._columnSize = columnSize; - - if (!columnSize) { - this._columnLength = 1; - return; - } - - this._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1); - }; - - __proto._layout = function (items, outline, isAppend) { - var _a; - - var length = items.length; - var margin = this.options.margin; - var align = this.options.align; - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - var columnSize = this._columnSize; - var columnLength = this._columnLength; - var size = this._size; - var viewDist = size - (columnSize + margin) * columnLength + margin; - var pointCaculateName = isAppend ? "min" : "max"; - var indexCaculateName = isAppend ? "indexOf" : "lastIndexOf"; - var startOutline = outline.slice(); - var endOutline = outline.slice(); - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline) || 0; - var index = endOutline[indexCaculateName](point); - var item = items[isAppend ? i : length - 1 - i]; - var itemSize = item.size; - - if (!itemSize) { - continue; - } - - var size1 = itemSize[size1Name]; - var size2 = itemSize[size2Name]; - var pos1 = isAppend ? point : point - margin - size1; - var endPos1 = pos1 + size1 + margin; - - if (index === -1) { - index = 0; - } - - var pos2 = (columnSize + margin) * index; // ALIGN - - if (align === CENTER) { - pos2 += viewDist / 2; - } else if (align === END) { - pos2 += viewDist + columnSize - size2; - } else if (align === JUSTIFY) { - if (columnLength <= 1) { - pos2 += viewDist / 2; - } else { - pos2 = (size - columnSize) / (columnLength - 1) * index; - } - } // tetris - - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a); - item.column = index; - endOutline[index] = isAppend ? endPos1 : pos1; - } - - if (!isAppend) { - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } // if append items, startOutline is low, endOutline is high - // if prepend items, startOutline is high, endOutline is low - - - return { - start: isAppend ? startOutline : endOutline, - end: isAppend ? endOutline : startOutline - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } - - var clone = cache ? items : cloneItems(items); - var startOutline = outline; - - if (!this._columnLength) { - this.checkColumn(items[0]); - } - - if (outline.length !== this._columnLength) { - startOutline = fill(new Array(this._columnLength), outline.length ? Math[isAppend ? "min" : "max"].apply(Math, outline) || 0 : 0); - } - - var result = this._layout(clone, startOutline, isAppend); - - return { - items: clone, - outlines: result - }; - }; - - return GridLayout; - }(); - - /* - Frame - [ - [1, 1, 1, 1, 1], - [0, 0, 2, 2, 2], - [0, 0, 2, 2, 2], - [3, 4, 5, 5, 5], - ] - */ - - function disableFrame(frame, type, top, left, width, height) { - for (var i = top; i < top + height; ++i) { - for (var j = left; j < left + width; ++j) { - if (type !== frame[i][j]) { - continue; - } - - frame[i][j] = 0; - } - } - } - - function searchShapeInFrame(frame, type, top, left, width, height) { - var size = { - left: left, - top: top, - type: type, - width: 1, - height: 1 - }; - - for (var i = left; i < width; ++i) { - if (frame[top][i] === type) { - size.width = i - left + 1; - continue; - } - - break; - } - - for (var i = top; i < height; ++i) { - if (frame[i][left] === type) { - size.height = i - top + 1; - continue; - } - - break; - } // After finding the shape, it will not find again. - - - disableFrame(frame, type, top, left, size.width, size.height); - return size; - } - - function getShapes(frame) { - var height = frame.length; - var width = height ? frame[0].length : 0; - var shapes = []; - - for (var i = 0; i < height; ++i) { - for (var j = 0; j < width; ++j) { - var type = frame[i][j]; - - if (!type) { - continue; - } // Separate shapes with other numbers. - - - shapes.push(searchShapeInFrame(frame, type, i, j, width, height)); - } - } - - shapes.sort(function (a, b) { - return a.type < b.type ? -1 : 1; - }); - return { - shapes: shapes, - width: width, - height: height - }; - } - /** - * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm. - * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다. - * @class eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. - * @example - ``` - - ``` - **/ - - - var FrameLayout = - /*#__PURE__*/ - function () { - function FrameLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - itemSize: 0, - frame: [], - frameFill: true - }, options); - var frame = this.options.frame.map(function (row) { - return row.slice(); - }); - this._itemSize = this.options.itemSize || 0; // divide frame into shapes. - - this._shapes = getShapes(frame); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - var __proto = FrameLayout.prototype; - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.FrameLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - - __proto._getItemSize = function () { - this._checkItemSize(); - - return this._itemSize; - }; - - __proto._checkItemSize = function () { - if (this.options.itemSize) { - this._itemSize = this.options.itemSize; - return; - } - - var style = this._style; - var size = style.size2; - var margin = this.options.margin; // if itemSize is not in options, caculate itemSize from size. - - this._itemSize = (this._size + margin) / this._shapes[size] - margin; - }; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var length = items.length; - var style = this._style; - var _b = this.options, - margin = _b.margin, - frameFill = _b.frameFill; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - var itemSize = this._getItemSize(); - - var isItemObject = typeof itemSize === "object"; - var itemSize2 = isItemObject ? itemSize[size2Name] : itemSize; - var itemSize1 = isItemObject ? itemSize[size1Name] : itemSize; - var shapesSize = this._shapes[size2Name]; - var shapes = this._shapes.shapes; - var shapesLength = shapes.length; - var startOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var endOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var dist = 0; - var end = 0; - - if (!shapesLength) { - return { - start: outline, - end: outline - }; - } - - for (var i = 0; i < length; i += shapesLength) { - for (var j = 0; j < shapesLength && i + j < length; ++j) { - var item = items[i + j]; - var shape = shapes[j]; - var shapePos1 = shape[pos1Name]; - var shapePos2 = shape[pos2Name]; - var shapeSize1 = shape[size1Name]; - var shapeSize2 = shape[size2Name]; - var pos1 = end - dist + shapePos1 * (itemSize1 + margin); - var pos2 = shapePos2 * (itemSize2 + margin); - var size1 = shapeSize1 * (itemSize1 + margin) - margin; - var size2 = shapeSize2 * (itemSize2 + margin) - margin; - - for (var k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) { - if (startOutline[k] === DUMMY_POSITION) { - startOutline[k] = pos1; - } - - startOutline[k] = Math.min(startOutline[k], pos1); - endOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin); - } - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - end = Math.max.apply(Math, endOutline); // check dist once - - if (i !== 0) { - continue; - } // find & fill empty block - - - if (!frameFill) { - dist = 0; - continue; - } - - dist = end; - - for (var j = 0; j < shapesSize; ++j) { - if (startOutline[j] === DUMMY_POSITION) { - continue; - } // the dist between frame's end outline and next frame's start outline - // expect that next frame's start outline is startOutline[j] + end - - - dist = Math.min(startOutline[j] + end - endOutline[j], dist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] !== DUMMY_POSITION) { - continue; - } - - startOutline[i] = Math.max.apply(Math, startOutline); - endOutline[i] = startOutline[i]; - } // The target outline is start outline when type is appending - - - var targetOutline = isAppend ? startOutline : endOutline; - var prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? "max" : "min"].apply(Math, outline); - var prevOutlineDist = isAppend ? 0 : end; - - if (frameFill && outline.length === shapesSize) { - prevOutlineDist = -DUMMY_POSITION; - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] === endOutline[i]) { - continue; - } // if appending type is prepend(false), subtract dist from appending group's height. - - - prevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - startOutline[i] += prevOutlineEnd - prevOutlineDist; - endOutline[i] += prevOutlineEnd - prevOutlineDist; - } - - items.forEach(function (item) { - item.rect[pos1Name] += prevOutlineEnd - prevOutlineDist; - }); - return { - start: startOutline.map(function (point) { - return parseInt(point, 10); - }), - end: endOutline.map(function (point) { - return parseInt(point, 10); - }) - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return FrameLayout; - }(); - - function makeShapeOutline(outline, itemSize, columnLength, isAppend) { - var point = Math[isAppend ? "min" : "max"].apply(Math, outline) || 0; - - if (outline.length !== columnLength) { - return fill(new Array(columnLength), 0); - } - - return outline.map(function (l) { - return Math.floor((l - point) / itemSize); - }); - } - - function getColumn(item) { - if (item.column) { - return item.column; - } - - var column = 1; - - if (item.el) { - column = parseInt(item.el.getAttribute("data-column"), 10) || 1; - } - - item.column = column; - return column; - } - /** - * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card. - * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다. - * @class eg.InfiniteGrid.SquareLayout - * @extends eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @example - ``` - - ``` - **/ - - - var SquareLayout = - /*#__PURE__*/ - function (_super) { - __extends(SquareLayout, _super); - - function SquareLayout(options) { - if (options === void 0) { - options = {}; - } - - return _super.call(this, options) || this; - } - - var __proto = SquareLayout.prototype; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - if (isAppend === void 0) { - isAppend = false; - } - - var _a, _b; - - var itemSize = this._getSquareSize(items[0]); - - var margin = this.options.margin; - var columnLength = this.options.column || Math.floor((this._size + margin) / (itemSize + margin)) || 1; - var length = items.length; - var endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend); - var pointCaculateName = isAppend ? "min" : "max"; - var shapes = []; - var sign = isAppend ? 1 : -1; - var style = this._style; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline); - var index = endOutline[isAppend ? "indexOf" : "lastIndexOf"](point); - var item = items[i]; - var columnWidth = item.columnWidth; - var column = columnWidth && columnWidth[0] === columnLength && columnWidth[1] || getColumn(item); - var columnCount = 1; - - if (column > 1) { - for (var j = 1; j < column && (isAppend && index + j < columnLength || !isAppend && index - j >= 0); ++j) { - if (isAppend && endOutline[index + sign * j] <= point || !isAppend && endOutline[index + sign * j] >= point) { - ++columnCount; - continue; - } - - break; - } - - if (!isAppend) { - index -= columnCount - 1; - } - } - - item.columnWidth = [columnLength, columnCount]; - shapes.push((_a = { - width: columnCount, - height: columnCount - }, _a[pos1Name] = point - (!isAppend ? columnCount : 0), _a[pos2Name] = index, _a.type = i + 1, _a.index = i, _a)); - - for (var j = 0; j < columnCount; ++j) { - endOutline[index + j] = point + sign * columnCount; - } - } - - this._shapes = (_b = { - shapes: shapes - }, _b[style.size2] = columnLength, _b); - - var result = _super.prototype._layout.call(this, items, outline, isAppend); - - if (!isAppend) { - shapes.sort(function (shape1, shape2) { - var item1pos1 = shape1[pos1Name]; - var item1pos2 = shape1[pos2Name]; - var item2pos1 = shape2[pos1Name]; - var item2pos2 = shape2[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } - - return result; - }; - - __proto._getSquareSize = function (item) { - var _a = this.options, - column = _a.column, - margin = _a.margin, - itemSize = _a.itemSize; - - if (column) { - // if column is in options, caculate itemSize from column. - this._itemSize = (this._size + margin) / column - margin; - } else if (itemSize) { - this._itemSize = this.options.itemSize; - } else { - var sizeName = this._style.size2; // if frameSize is 0, caculate frameSize from item.size. - - var frameSize = this._shapes[sizeName] || Math.floor((this._size + margin) / (item.size[sizeName] + margin) / getColumn(item)); - this._itemSize = (this._size + margin) / frameSize - margin; - } - - return this._itemSize; - }; - - return SquareLayout; - }(FrameLayout); - - var BoxModel = - /*#__PURE__*/ - function () { - function BoxModel(options) { - assign(this, { - originWidth: 0, - originHeight: 0, - width: 0, - height: 0, - left: 0, - top: 0, - items: [] - }, options); - } - - var __proto = BoxModel.prototype; - - __proto.scaleTo = function (width, height) { - var scaleX = this.width ? width / this.width : 0; - var scaleY = this.height ? height / this.height : 0; - this.items.forEach(function (v) { - if (scaleX !== 0) { - v.left *= scaleX; - v.width *= scaleX; - } - - if (scaleY !== 0) { - v.top *= scaleY; - v.height *= scaleY; - } - }); - this.width = width; - this.height = height; - }; - - __proto.push = function (item) { - this.items.push(item); - }; - - __proto.getOriginSize = function () { - return this.originWidth * this.originHeight; - }; - - __proto.getSize = function () { - return this.width * this.height; - }; - - __proto.getOriginRatio = function () { - return this.originHeight === 0 ? 0 : this.originWidth / this.originHeight; - }; - - __proto.getRatio = function () { - return this.height === 0 ? 0 : this.width / this.height; - }; - - return BoxModel; - }(); - - function getCost(originLength, length) { - var cost = originLength / length; - - if (cost < 1) { - cost = 1 / cost; - } - - return cost - 1; - } - - function fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical) { - item.height = itemFitSize.height; - item.width = itemFitSize.width; - bestFitArea.height = containerFitSize.height; - bestFitArea.width = containerFitSize.width; - - if (layoutVertical) { - item.top = bestFitArea.top + bestFitArea.height; - item.left = bestFitArea.left; - } else { - item.left = bestFitArea.left + bestFitArea.width; - item.top = bestFitArea.top; - } - } - /** - * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion. - * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다. - * @class eg.InfiniteGrid.PackingLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 - * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 - * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 - * @example - ``` - - ``` - **/ - - - var PackingLayout = - /*#__PURE__*/ - function () { - function PackingLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - aspectRatio: 1, - sizeWeight: 1, - ratioWeight: 1 - }, options); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - var __proto = PackingLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.PackingLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto._findBestFitArea = function (container, item) { - if (container.getRatio() === 0) { - // 아이템 최초 삽입시 전체영역 지정 - container.originWidth = item.width; - container.originHeight = item.height; - container.width = item.width; - container.height = item.height; - return; - } - - var bestFitArea; - var minCost = 10000000; - var layoutVertical = false; - var itemFitSize = { - width: 0, - height: 0 - }; - var containerFitSize = { - width: 0, - height: 0 - }; - var _a = this.options, - sizeWeight = _a.sizeWeight, - ratioWeight = _a.ratioWeight; - container.items.forEach(function (v) { - var containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight; - var containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight; - var width = v.width; - var height = v.height; - var cost; - - for (var i = 0; i < 2; ++i) { - var itemWidth = void 0; - var itemHeight = void 0; - var containerWidth = void 0; - var containerHeight = void 0; - - if (i === 0) { - // 상하에 아이템 추가 - itemWidth = width; - itemHeight = height * (item.height / (v.originHeight + item.height)); - containerWidth = width; - containerHeight = height - itemHeight; - } else { - // 좌우에 아이템 추가 - itemHeight = height; - itemWidth = width * (item.width / (v.originWidth + item.width)); - containerHeight = height; - containerWidth = width - itemWidth; - } - - var itemSize = itemWidth * itemHeight; - var itemRatio = itemWidth / itemHeight; - var containerSize = containerWidth * containerHeight; - var containerRatio = containerHeight / containerHeight; - cost = getCost(item.getSize(), itemSize) * sizeWeight; - cost += getCost(item.getRatio(), itemRatio) * ratioWeight; - cost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost; - cost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost; - - if (cost === Math.min(cost, minCost)) { - minCost = cost; - bestFitArea = v; - layoutVertical = i === 0; - itemFitSize.width = itemWidth; - itemFitSize.height = itemHeight; - containerFitSize.width = containerWidth; - containerFitSize.height = containerHeight; - } - } - }); - fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical); - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - if (outline === void 0) { - outline = []; - } - - var style = this._style; - var _a = this.options, - horizontal = _a.horizontal, - aspectRatio = _a.aspectRatio, - margin = _a.margin; - var pos1Name = style.startPos1; - var containerWidth = this._size * (horizontal ? aspectRatio : 1); - var containerHeight = this._size / (horizontal ? 1 : aspectRatio); - var containerSize1 = horizontal ? containerWidth : containerHeight; - var prevOutline = toZeroArray(outline); - var start = isAppend ? Math.max.apply(Math, prevOutline) : Math.min.apply(Math, prevOutline) - containerSize1 - margin; - var end = start + containerSize1 + margin; - var container = new BoxModel({}); - items.forEach(function (item) { - var _a = item.orgSize, - width = _a.width, - height = _a.height; - var model = new BoxModel({ - width: width, - height: height, - originWidth: width, - originHeight: height - }); - - _this._findBestFitArea(container, model); - - container.push(model); - container.scaleTo(containerWidth + margin, containerHeight + margin); - }); - items.forEach(function (item, i) { - var boxItem = container.items[i]; - var width = boxItem.width; - var height = boxItem.height; - var top = boxItem.top; - var left = boxItem.left; - item.rect = { - top: top, - left: left, - width: width - margin, - height: height - margin - }; - item.rect[pos1Name] += start; - }); - return { - start: [start], - end: [end] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return PackingLayout; - }(); - - /* eslint-disable */ - - /****************************************************************************** - * Created 2008-08-19. - * - * Dijkstra path-finding functions. Adapted from the Dijkstar Python project. - * - * Copyright (C) 2008 - * Wyatt Baldwin - * All rights reserved - * - * Licensed under the MIT license. - * - * http://www.opensource.org/licenses/mit-license.php - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - *****************************************************************************/ - function single_source_shortest_paths(graph, s, d) { - // Predecessor map for each node that has been encountered. - // node ID => predecessor node ID - var predecessors = {}; // Costs of shortest paths from s to all nodes encountered. - // node ID => cost - - var costs = {}; - costs[s] = 0; // Costs of shortest paths from s to all nodes encountered; differs from - // `costs` in that it provides easy access to the node that currently has - // the known shortest path from s. - // XXX: Do we actually need both `costs` and `open`? - - var open = new BinaryHeap(function (x) { - return x.cost; - }); - open.push({ - value: s, - cost: 0 - }); - var closest; - var u; - var cost_of_s_to_u; - var adjacent_nodes; - var cost_of_e; - var cost_of_s_to_u_plus_cost_of_e; - var cost_of_s_to_v; - var first_visit; - - while (open.size()) { - // In the nodes remaining in graph that have a known cost from s, - // find the node, u, that currently has the shortest path from s. - closest = open.pop(); - u = closest.value; - cost_of_s_to_u = closest.cost; // Get nodes adjacent to u... - - adjacent_nodes = graph(u) || {}; // ...and explore the edges that connect u to those nodes, updating - // the cost of the shortest paths to any or all of those nodes as - // necessary. v is the node across the current edge from u. - - for (var v in adjacent_nodes) { - // Get the cost of the edge running from u to v. - cost_of_e = adjacent_nodes[v]; // Cost of s to u plus the cost of u to v across e--this is *a* - // cost from s to v that may or may not be less than the current - // known cost to v. - - cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; // If we haven't visited v yet OR if the current known cost from s to - // v is greater than the new cost we just found (cost of s to u plus - // cost of u to v across e), update v's cost in the cost list and - // update v's predecessor in the predecessor list (it's now u). - - cost_of_s_to_v = costs[v]; - first_visit = typeof costs[v] === "undefined"; - - if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { - costs[v] = cost_of_s_to_u_plus_cost_of_e; - open.push({ - value: v, - cost: cost_of_s_to_u_plus_cost_of_e - }); - predecessors[v] = u; - } - } - } - - if (typeof costs[d] === "undefined") { - var msg = ["Could not find a path from ", s, " to ", d, "."].join(""); - throw new Error(msg); - } - - return predecessors; - } - - function extract_shortest_path_from_predecessor_list(predecessors, d) { - var nodes = []; - var u = d; - - while (u) { - nodes.push(u); - u = predecessors[u]; - } - - nodes.reverse(); - return nodes; - } - - function find_path(graph, s, d) { - var predecessors = single_source_shortest_paths(graph, s, d); - return extract_shortest_path_from_predecessor_list(predecessors, d); - } - - var BinaryHeap = - /*#__PURE__*/ - function () { - function BinaryHeap(scoreFunction) { - this.content = []; - this.scoreFunction = scoreFunction; - } - - var __proto = BinaryHeap.prototype; - - __proto.push = function (element) { - // Add the new element to the end of the array. - this.content.push(element); // Allow it to bubble up. - - this.bubbleUp(this.content.length - 1); - }; - - __proto.pop = function () { - // Store the first element so we can return it later. - var result = this.content[0]; // Get the element at the end of the array. - - var end = this.content.pop(); // If there are any elements left, put the end element at the - // start, and let it sink down. - - if (this.content.length > 0) { - this.content[0] = end; - this.sinkDown(0); - } - - return result; - }; - - __proto.size = function () { - return this.content.length; - }; - - __proto.bubbleUp = function (_n) { - var n = _n; // Fetch the element that has to be moved. - - var element = this.content[n]; // When at 0, an element can not go up any further. - - while (n > 0) { - // Compute the parent element's index, and fetch it. - var parentN = Math.floor((n + 1) / 2) - 1; - var parent = this.content[parentN]; // Swap the elements if the parent is greater. - - if (this.scoreFunction(element) < this.scoreFunction(parent)) { - this.content[parentN] = element; - this.content[n] = parent; // Update 'n' to continue at the new position. - - n = parentN; - } else { - // Found a parent that is less, no need to move it further. - break; - } - } - }; - - __proto.sinkDown = function (n) { - // Look up the target element and its score. - var length = this.content.length; - var element = this.content[n]; - var elemScore = this.scoreFunction(element); - var child1Score; - - while (true) { - // Compute the indices of the child elements. - var child2N = (n + 1) * 2; - var child1N = child2N - 1; // This is used to store the new position of the element, - // if any. - - var swap = null; // If the first child exists (is inside the array)... - - if (child1N < length) { - // Look it up and compute its score. - var child1 = this.content[child1N]; - child1Score = this.scoreFunction(child1); // If the score is less than our element's, we need to swap. - - if (child1Score < elemScore) { - swap = child1N; - } - } // Do the same checks for the other child. - - - if (child2N < length) { - var child2 = this.content[child2N]; - var child2Score = this.scoreFunction(child2); - - if (child2Score < (swap == null ? elemScore : child1Score)) { - swap = child2N; - } - } // If the element needs to be moved, swap it, and continue. - - - if (swap !== null) { - this.content[n] = this.content[swap]; - this.content[swap] = element; - n = swap; - } else { - // Otherwise, we are done. - break; - } - } - }; - - return BinaryHeap; - }(); - - /** - * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size. - * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다. - * @class eg.InfiniteGrid.JustifiedLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 - * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 - * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 - * @example - ``` - - ``` - **/ - - var JustifiedLayout = - /*#__PURE__*/ - function () { - function JustifiedLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - minSize: 0, - maxSize: 0, - column: [1, 8] - }, options); - this._style = getStyleNames(this.options.horizontal); - this._size = 0; - } - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.JustifiedLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - var __proto = JustifiedLayout.prototype; - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var startIndex = 0; - var endIndex = items.length; - var column = this.options.column; - var columns = typeof column === "object" ? column : [column, column]; - - var graph = function (_start) { - var results = {}; - var start = +_start.replace(/[^0-9]/g, ""); - var length = endIndex + 1; - - for (var i = Math.min(start + columns[0], length - 1); i < length; ++i) { - if (i - start > columns[1]) { - break; - } - - var cost = _this._getCost(items, start, i, size1Name, size2Name); - - if (cost === null) { - continue; - } - - if (cost < 0 && i === length - 1) { - cost = 0; - } - - results["" + i] = Math.pow(cost, 2); - } - - return results; - }; // shortest path for items' total height. - - - var path = find_path(graph, "" + startIndex, "" + endIndex); - return this._setStyle(items, path, outline, isAppend); - }; - - __proto._getSize = function (items, size1Name, size2Name) { - var margin = this.options.margin; - var size = items.reduce(function (sum, item) { - return sum + item.orgSize[size2Name] / item.orgSize[size1Name]; - }, 0); - return (this._size - margin * (items.length - 1)) / size; - }; - - __proto._getCost = function (items, i, j, size1Name, size2Name) { - var size = this._getSize(items.slice(i, j), size1Name, size2Name); - - var min = this.options.minSize || 0; - var max = this.options.maxSize || Infinity; - - if (isFinite(max)) { - // if this size is not in range, the cost increases sharply. - if (size < min) { - return Math.pow(size - min, 2) + Math.pow(max, 2); - } else if (size > max) { - return Math.pow(size - max, 2) + Math.pow(max, 2); - } else { - // if this size in range, the cost is negative or low. - return Math.min(size - max, min - size); - } - } // if max is infinite type, caculate cost only with "min". - - - if (size < min) { - return Math.max(Math.pow(min, 2), Math.pow(size, 2)); - } - - return size - min; - }; - - __proto._setStyle = function (items, path, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var style = this._style; // if direction is vertical - // startPos1 : top, endPos1 : bottom - // size1 : height - // startPos2 : left, endPos2 : right - // size2 : width - // if direction is horizontal - // startPos1 : left, endPos1 : right - // size1 : width - // startPos2 : top, endPos2 : bottom - // size2 : height - - var pos1Name = style.startPos1; - var size1Name = style.size1; - var pos2Name = style.startPos2; - var size2Name = style.size2; - var length = path.length; - var margin = this.options.margin; - var startPoint = outline[0] || 0; - var endPoint = startPoint; - var height = 0; - - for (var i = 0; i < length - 1; ++i) { - var path1 = parseInt(path[i], 10); - var path2 = parseInt(path[i + 1], 10); // pathItems(path1 to path2) are in 1 line. - - var pathItems = items.slice(path1, path2); - var pathItemsLength = pathItems.length; - - var size1 = this._getSize(pathItems, size1Name, size2Name); - - var pos1 = endPoint; - - for (var j = 0; j < pathItemsLength; ++j) { - var item = pathItems[j]; - var size2 = item.orgSize[size2Name] / item.orgSize[size1Name] * size1; // item has margin bottom and right. - // first item has not margin. - - var prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect; - var pos2 = prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name] + margin : 0; - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - height += margin + size1; - endPoint = startPoint + height; - } - - var itemsLength = items.length; - - if (isAppend) { - // previous group's end outline is current group's start outline - return { - start: [startPoint], - end: [endPoint] - }; - } // for prepend, only substract height from position. - // always start is lower than end. - - - for (var i = 0; i < itemsLength; ++i) { - var item = items[i]; // move items as long as height for prepend - - item.rect[pos1Name] -= height; - } - - return { - start: [startPoint - height], - end: [startPoint] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return JustifiedLayout; - }(); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - - InfiniteGrid.categorize = categorize; - InfiniteGrid.INFINITEGRID_METHODS = INFINITEGRID_METHODS; - InfiniteGrid.INFINITEGRID_EVENTS = INFINITEGRID_EVENTS; - InfiniteGrid.withInfiniteGridMethods = withInfiniteGridMethods; - InfiniteGrid.CONTAINER_CLASSNAME = CONTAINER_CLASSNAME; - InfiniteGrid.IGNORE_CLASSNAME = IGNORE_CLASSNAME; - InfiniteGrid.DEFAULT_OPTIONS = DEFAULT_OPTIONS; - InfiniteGrid.GridLayout = GridLayout; - InfiniteGrid.FrameLayout = FrameLayout; - InfiniteGrid.SquareLayout = SquareLayout; - InfiniteGrid.PackingLayout = PackingLayout; - InfiniteGrid.JustifiedLayout = JustifiedLayout; - InfiniteGrid.ItemManager = ItemManager; - InfiniteGrid.Infinite = Infinite; - InfiniteGrid.DOMRenderer = DOMRenderer; - InfiniteGrid.default = InfiniteGrid; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.js.map diff --git a/dist/infinitegrid.js.map b/dist/infinitegrid.js.map deleted file mode 100644 index 810cf36b0..000000000 --- a/dist/infinitegrid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.js","sources":["../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/GridLayout.ts","../src/layouts/FrameLayout.ts","../src/layouts/SquareLayout.ts","../src/layouts/lib/BoxModel.ts","../src/layouts/PackingLayout.ts","../src/layouts/lib/dijkstra.ts","../src/layouts/JustifiedLayout.ts","../src/index.umd.ts"],"sourcesContent":["let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions
(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\nimport FrameLayout from \"./layouts/FrameLayout\";\nimport SquareLayout from \"./layouts/SquareLayout\";\nimport PackingLayout from \"./layouts/PackingLayout\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport ItemManager from \"./ItemManager\";\nimport Infinite from \"./Infinite\";\nimport {\n\tCONTAINER_CLASSNAME, IGNORE_CLASSNAME,\n\tDEFAULT_OPTIONS, INFINITEGRID_METHODS,\n\tINFINITEGRID_EVENTS,\n} from \"./consts\";\nimport { categorize, withInfiniteGridMethods } from \"./utils\";\n\n// fix for IE8\n(InfiniteGrid as any).categorize = categorize;\n(InfiniteGrid as any).INFINITEGRID_METHODS = INFINITEGRID_METHODS;\n(InfiniteGrid as any).INFINITEGRID_EVENTS = INFINITEGRID_EVENTS;\n(InfiniteGrid as any).withInfiniteGridMethods = withInfiniteGridMethods;\n(InfiniteGrid as any).CONTAINER_CLASSNAME = CONTAINER_CLASSNAME;\n(InfiniteGrid as any).IGNORE_CLASSNAME = IGNORE_CLASSNAME;\n(InfiniteGrid as any).DEFAULT_OPTIONS = DEFAULT_OPTIONS;\n(InfiniteGrid as any).GridLayout = GridLayout;\n(InfiniteGrid as any).FrameLayout = FrameLayout;\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n(InfiniteGrid as any).PackingLayout = PackingLayout;\n(InfiniteGrid as any).JustifiedLayout = JustifiedLayout;\n(InfiniteGrid as any).ItemManager = ItemManager;\n(InfiniteGrid as any).Infinite = Infinite;\n(InfiniteGrid as any).DOMRenderer = DOMRenderer;\n(InfiniteGrid as any).default = InfiniteGrid;\n\nexport default InfiniteGrid;\n"],"names":["win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","Object","defineProperty","addEventListener","get","e","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","ALIGN","START","CENTER","END","JUSTIFY","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","INFINITEGRID_EVENTS","INFINITEGRID_METHODS","getLoadingBar","getItem","getItems","layout","getGroupKeys","getStatus","setStatus","isProcessing","startLoading","endLoading","isLoading","updateItem","updateItems","moveTo","nodes","array","length","i","push","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","Array","isArray","map","v","undefined","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","options","attachEvent","removeEventListener","detachEvent","callback","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","name","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","indexOf","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","forEach","source","key","defaultOptions","assign","outline","items","item","jQuery","constructor","prototype","jquery","arr","value","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","infinitegridName","keys","args","result","_a","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","concat","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","isUndefined","sliceGroups","pluck","index","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","splice","insert","categorize","diff","removed","added","maintained","removedIndex","nextGroups","fromIndex","addedIndex","reverse","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","filter","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","_b","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","_infinite","_renderer","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","prefix","check","on","_complete","_error","_end","infinite","prevGroup","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","trigger","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","setTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","syncElements","watcher","processingStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","_getLoadingStatus","userStyle","display","_process","next","_setContainerSize","_getEdgeValue","_fitItems","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","Component","_setCursor","layoutItems","scroller","pop","shift","_d","_e","viewSize","isScroll","InfiniteGrid","assignOptions","align","itemSize","_columnSize","_columnLength","_style","getStyleNames","firstItem","checkColumn","startOutline","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","frame","j","disableFrame","shapes","searchShapeInFrame","frameFill","row","_itemSize","_shapes","getShapes","_checkItemSize","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","k","targetOutline","prevOutlineEnd","prevOutlineDist","l","_getSquareSize","makeShapeOutline","sign","columnWidth","getColumn","columnCount","shape1","shape2","frameSize","FrameLayout","originWidth","originHeight","scaleX","scaleY","originLength","cost","bestFitArea","itemFitSize","containerFitSize","layoutVertical","aspectRatio","sizeWeight","ratioWeight","getRatio","minCost","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemRatio","containerSize","containerRatio","fitArea","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","graph","s","d","predecessors","costs","open","BinaryHeap","closest","u","cost_of_s_to_u","adjacent_nodes","cost_of_e","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","first_visit","msg","Error","single_source_shortest_paths","extract_shortest_path_from_predecessor_list","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","parent","elemScore","child1Score","child2N","child1N","swap","child1","child2","child2Score","minSize","maxSize","columns","_start","results","_getCost","pow","path","find_path","_setStyle","sum","isFinite","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength","withInfiniteGridMethods","GridLayout","SquareLayout","PackingLayout","JustifiedLayout","default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,IAAIA,GAAJ;;IAEA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IAClC;IACAD,EAAAA,GAAG,GAAG;IACLE,IAAAA,QAAQ,EAAE,EADL;IAELC,IAAAA,SAAS,EAAE;IACVC,MAAAA,SAAS,EAAE;IADD;IAFN,GAAN;IAMA,CARD,MAQO;IACNJ,EAAAA,GAAG,GAAGC,MAAN;IACA;IAGM,IAAMC,QAAQ,GAAGF,GAAG,CAACE,QAArB;;;ICZP,IAAMG,EAAE,GAAGJ,GAAM,CAACE,SAAP,CAAiBC,SAA5B;AAEA,IAAO,IAAME,qBAAqB,GAAG,CAAC,EAAE,sBAAsBL,GAAxB,CAA/B;AACP,IAAO,IAAMM,wBAAwB,GAAG,CAAC,EAAE,sBAAsBL,QAAxB,CAAlC;AACP,IAAO,IAAMM,eAAe,GAAI;IAC/B,MAAIC,qBAAqB,GAAG,KAA5B;;IAEA,MAAI;IACH,QAAIF,wBAAwB,IAAIG,MAAM,CAACC,cAAvC,EAAuD;IACtD;IACAT,MAAAA,QAAQ,CAACU,gBAAT,CAA0B,MAA1B,EAAkC,cAAlC,EAA6CF,MAAM,CAACC,cAAP,CAAsB,EAAtB,EAC5C,SAD4C,EACjC;IACXE,QAAAA,GAAG;IACFJ,UAAAA,qBAAqB,GAAG,IAAxB;IACA;IAHU,OADiC,CAA7C;IAMA;IACD,GAVD,CAUE,OAAOK,CAAP,EAAU;IAEX;;IACD,SAAOL,qBAAP;IACA,CAjB8B,EAAxB;AAmBP,IAAO,IAAMM,KAAK,GAAG,kCAAkCC,IAAlC,CAAuCX,EAAvC,CAAd;AACP,IAAO,IAAMY,MA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AA+BxK,YAA/B;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.justifiedlayout.js b/dist/infinitegrid.justifiedlayout.js deleted file mode 100644 index 1e6b8cf25..000000000 --- a/dist/infinitegrid.justifiedlayout.js +++ /dev/null @@ -1,5184 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory()); -}(this, (function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/component project is licensed under the MIT license - - @egjs/component JavaScript library - https://naver.github.io/egjs-component - - @version 2.1.2 - */ - - /** - * Copyright (c) 2015 NAVER Corp. - * egjs projects are licensed under the MIT license - */ - function isUndefined(value) { - return typeof value === "undefined"; - } - /** - * A class used to manage events in a component - * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스 - * @alias eg.Component - */ - - - var Component = - /*#__PURE__*/ - function () { - var Component = - /*#__PURE__*/ - function () { - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.Component.VERSION; // ex) 2.0.0 - * @memberof eg.Component - */ - - /** - * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - */ - function Component() { - this._eventHandler = {}; - this.options = {}; - } - /** - * Triggers a custom event. - * @ko 커스텀 이벤트를 발생시킨다 - * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름 - * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터 - * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고 - * @example - class Some extends eg.Component { - some(){ - if(this.trigger("beforeHi")){ // When event call to stop return false. - this.trigger("hi");// fire hi event. - } - } - } - const some = new Some(); - some.on("beforeHi", (e) => { - if(condition){ - e.stop(); // When event call to stop, `hi` event not call. - } - }); - some.on("hi", (e) => { - // `currentTarget` is component instance. - console.log(some === e.currentTarget); // true - }); - // If you want to more know event design. You can see article. - // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F - */ - - - var _proto = Component.prototype; - - _proto.trigger = function trigger(eventName, customEvent) { - if (customEvent === void 0) { - customEvent = {}; - } - - var handlerList = this._eventHandler[eventName] || []; - var hasHandlerList = handlerList.length > 0; - - if (!hasHandlerList) { - return true; - } // If detach method call in handler in first time then handler list calls. - - - handlerList = handlerList.concat(); - customEvent.eventType = eventName; - var isCanceled = false; - var arg = [customEvent]; - var i = 0; - - customEvent.stop = function () { - isCanceled = true; - }; - - customEvent.currentTarget = this; - - for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - restParam[_key - 2] = arguments[_key]; - } - - if (restParam.length >= 1) { - arg = arg.concat(restParam); - } - - for (i = 0; handlerList[i]; i++) { - handlerList[i].apply(this, arg); - } - - return !isCanceled; - }; - /** - * Executed event just one time. - * @ko 이벤트가 한번만 실행된다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - alert("hi"); - } - thing() { - this.once("hi", this.hi); - } - } - var some = new Some(); - some.thing(); - some.trigger("hi"); - // fire alert("hi"); - some.trigger("hi"); - // Nothing happens - */ - - - _proto.once = function once(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var i; - - for (i in eventHash) { - this.once(i, eventHash[i]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var self = this; - this.on(eventName, function listener() { - for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - arg[_key2] = arguments[_key2]; - } - - handlerToAttach.apply(self, arg); - self.off(eventName, listener); - }); - } - - return this; - }; - /** - * Checks whether an event has been attached to a component. - * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다. - * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름 - * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부 - * @example - class Some extends eg.Component { - some() { - this.hasOn("hi");// check hi event. - } - } - */ - - - _proto.hasOn = function hasOn(eventName) { - return !!this._eventHandler[eventName]; - }; - /** - * Attaches an event to a component. - * @ko 컴포넌트에 이벤트를 등록한다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.on("hi",this.hi); //attach event - } - } - */ - - - _proto.on = function on(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.on(name, eventHash[name]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var handlerList = this._eventHandler[eventName]; - - if (isUndefined(handlerList)) { - this._eventHandler[eventName] = []; - handlerList = this._eventHandler[eventName]; - } - - handlerList.push(handlerToAttach); - } - - return this; - }; - /** - * Detaches an event from the component. - * @ko 컴포넌트에 등록된 이벤트를 해제한다 - * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름 - * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.off("hi",this.hi); //detach event - } - } - */ - - - _proto.off = function off(eventName, handlerToDetach) { - // All event detach. - if (isUndefined(eventName)) { - this._eventHandler = {}; - return this; - } // All handler of specific event detach. - - - if (isUndefined(handlerToDetach)) { - if (typeof eventName === "string") { - this._eventHandler[eventName] = undefined; - return this; - } else { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.off(name, eventHash[name]); - } - - return this; - } - } // The handler of specific event detach. - - - var handlerList = this._eventHandler[eventName]; - - if (handlerList) { - var k; - var handlerFunction; - - for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) { - if (handlerFunction === handlerToDetach) { - handlerList = handlerList.splice(k, 1); - break; - } - } - } - - return this; - }; - - return Component; - }(); - - Component.VERSION = "2.1.2"; - return Component; - }(); - - /* - Copyright (c) 2019-present NAVER Corp. - name: @egjs/list-differ - license: MIT - author: NAVER Corp. - repository: https://github.com/naver/egjs-list-differ - version: 1.0.0 - */ - - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - var PolyMap = - /*#__PURE__*/ - function () { - function PolyMap() { - this.keys = []; - this.values = []; - } - - var __proto = PolyMap.prototype; - - __proto.get = function (key) { - return this.values[this.keys.indexOf(key)]; - }; - - __proto.set = function (key, value) { - var keys = this.keys; - var values = this.values; - var prevIndex = keys.indexOf(key); - var index = prevIndex === -1 ? keys.length : prevIndex; - keys[index] = key; - values[index] = value; - }; - - return PolyMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var HashMap = - /*#__PURE__*/ - function () { - function HashMap() { - this.object = {}; - } - - var __proto = HashMap.prototype; - - __proto.get = function (key) { - return this.object[key]; - }; - - __proto.set = function (key, value) { - this.object[key] = value; - }; - - return HashMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var SUPPORT_MAP = typeof Map === "function"; - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - var Link = - /*#__PURE__*/ - function () { - function Link() {} - - var __proto = Link.prototype; - - __proto.connect = function (prevLink, nextLink) { - this.prev = prevLink; - this.next = nextLink; - prevLink && (prevLink.next = this); - nextLink && (nextLink.prev = this); - }; - - __proto.disconnect = function () { - // In double linked list, diconnect the interconnected relationship. - var prevLink = this.prev; - var nextLink = this.next; - prevLink && (prevLink.next = nextLink); - nextLink && (nextLink.prev = prevLink); - }; - - __proto.getIndex = function () { - var link = this; - var index = -1; - - while (link) { - link = link.prev; - ++index; - } - - return index; - }; - - return Link; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - function orderChanged(changed, fixed) { - // It is roughly in the order of these examples. - // 4, 6, 0, 2, 1, 3, 5, 7 - var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 - - var toLinks = []; - changed.forEach(function (_a) { - var from = _a[0], - to = _a[1]; - var link = new Link(); - fromLinks[from] = link; - toLinks[to] = link; - }); // `fromLinks` are connected to each other by double linked list. - - fromLinks.forEach(function (link, i) { - link.connect(fromLinks[i - 1]); - }); - return changed.filter(function (_, i) { - return !fixed[i]; - }).map(function (_a, i) { - var from = _a[0], - to = _a[1]; - - if (from === to) { - return [0, 0]; - } - - var fromLink = fromLinks[from]; - var toLink = toLinks[to - 1]; - var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. - - fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. - - if (!toLink) { - fromLink.connect(undefined, fromLinks[0]); - } else { - fromLink.connect(toLink, toLink.next); - } - - var toIndex = fromLink.getIndex(); - return [fromIndex, toIndex]; - }); - } - - var Result = - /*#__PURE__*/ - function () { - function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { - this.prevList = prevList; - this.list = list; - this.added = added; - this.removed = removed; - this.changed = changed; - this.maintained = maintained; - this.changedBeforeAdded = changedBeforeAdded; - this.fixed = fixed; - } - - var __proto = Result.prototype; - Object.defineProperty(__proto, "ordered", { - get: function () { - if (!this.cacheOrdered) { - this.caculateOrdered(); - } - - return this.cacheOrdered; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(__proto, "pureChanged", { - get: function () { - if (!this.cachePureChanged) { - this.caculateOrdered(); - } - - return this.cachePureChanged; - }, - enumerable: true, - configurable: true - }); - - __proto.caculateOrdered = function () { - var ordered = orderChanged(this.changedBeforeAdded, this.fixed); - var changed = this.changed; - var pureChanged = []; - this.cacheOrdered = ordered.filter(function (_a, i) { - var from = _a[0], - to = _a[1]; - var _b = changed[i], - fromBefore = _b[0], - toBefore = _b[1]; - - if (from !== to) { - pureChanged.push([fromBefore, toBefore]); - return true; - } - }); - this.cachePureChanged = pureChanged; - }; - - return Result; - }(); - /** - * - * @memberof eg.ListDiffer - * @static - * @function - * @param - Previous List 이전 목록 - * @param - List to Update 업데이트 할 목록 - * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. - * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. - * @example - * import { diff } from "@egjs/list-differ"; - * // script => eg.ListDiffer.diff - * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); - * // List before update - * // [1, 2, 3, 4, 5] - * console.log(result.prevList); - * // Updated list - * // [4, 3, 6, 2, 1] - * console.log(result.list); - * // Index array of values added to `list` - * // [0, 1, 5] - * console.log(result.added); - * // Index array of values removed in `prevList` - * // [5] - * console.log(result.removed); - * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.changed); - * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) - * // [[4, 3], [3, 4], [2, 6]] - * console.log(result.pureChanged); - * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) - * // [[4, 1], [4, 2], [4, 3]] - * console.log(result.ordered); - * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.maintained); - */ - - - function diff(prevList, list, findKeyCallback) { - var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; - - var callback = findKeyCallback || function (e) { - return e; - }; - - var added = []; - var removed = []; - var maintained = []; - var prevKeys = prevList.map(callback); - var keys = list.map(callback); - var prevKeyMap = new mapClass(); - var keyMap = new mapClass(); - var changedBeforeAdded = []; - var fixed = []; - var removedMap = {}; - var changed = []; - var addedCount = 0; - var removedCount = 0; // Add prevKeys and keys to the hashmap. - - prevKeys.forEach(function (key, prevListIndex) { - prevKeyMap.set(key, prevListIndex); - }); - keys.forEach(function (key, listIndex) { - keyMap.set(key, listIndex); - }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. - - prevKeys.forEach(function (key, prevListIndex) { - var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. - - if (typeof listIndex === "undefined") { - ++removedCount; - removed.push(prevListIndex); - } else { - removedMap[listIndex] = removedCount; - } - }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. - - keys.forEach(function (key, listIndex) { - var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. - - if (typeof prevListIndex === "undefined") { - added.push(listIndex); - ++addedCount; - } else { - maintained.push([prevListIndex, listIndex]); - removedCount = removedMap[listIndex] || 0; - changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); - fixed.push(listIndex === prevListIndex); - - if (prevListIndex !== listIndex) { - changed.push([prevListIndex, listIndex]); - } - } - }); // Sort by ascending order of 'to(list's index). - - removed.reverse(); - return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); - } - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document$1.body[prop] || document$1.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document$1.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function isUndefined$1(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined$1(start) ? this._groups : this.sliceGroups(start, (isUndefined$1(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document$1.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document$1.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/lazyloaded JavaScript library - @egjs/lazyloaded project is licensed under the MIT license - - - @version 0.0.2 - */ - var isWindow$1 = typeof window !== "undefined"; - var ua$1 = isWindow$1 ? window.navigator.userAgent : ""; - var SUPPORT_COMPUTEDSTYLE$1 = isWindow$1 ? !!("getComputedStyle" in window) : false; - var IS_IE$1 = /MSIE|Trident|Windows Phone|Edge/.test(ua$1); - var SUPPORT_ADDEVENTLISTENER$1 = isWindow$1 ? !!("addEventListener" in document) : false; - var WIDTH = "width"; - var HEIGHT = "height"; - - function getAttribute(el, name) { - return el.getAttribute(name) || ""; - } - - function toArray$1(arr) { - return [].slice.call(arr); - } - - function isDataAttribute(target, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - return !!target.getAttribute(prefix + "width"); - } - - function addEvent$1(element, type, handler) { - if (SUPPORT_ADDEVENTLISTENER$1) { - element.addEventListener(type, handler, false); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - - function removeEvent$1(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - - function innerWidth$1(el) { - return getSize$1(el, "Width"); - } - - function innerHeight$1(el) { - return getSize$1(el, "Height"); - } - - function getStyles$1(el) { - return (SUPPORT_COMPUTEDSTYLE$1 ? window.getComputedStyle(el) : el.currentStyle) || {}; - } - - function getSize$1(el, name) { - var size = el["client" + name] || el["offset" + name]; - return parseFloat(size || getStyles$1(el)[name.toLowerCase()]) || 0; - } - - var elements = []; - - function add(element, prefix) { - !elements.length && addEvent$1(window, "resize", resizeAll); - element.__PREFIX__ = prefix; - elements.push(element); - resize(element); - } - - function remove(element, prefix) { - var index = elements.indexOf(element); - - if (index < 0) { - return; - } - - var fixed = getAttribute(element, prefix + "fixed"); - delete element.__PREFIX__; - element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = ""; - elements.splice(index, 1); - !elements.length && removeEvent$1(window, "resize", resizeAll); - } - - function resize(element, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var elementPrefix = element.__PREFIX__; - - if (typeof elementPrefix !== "string") { - elementPrefix = prefix; - } - - var dataWidth = parseInt(getAttribute(element, "" + elementPrefix + WIDTH), 10) || 0; - var dataHeight = parseInt(getAttribute(element, "" + elementPrefix + HEIGHT), 10) || 0; - var fixed = getAttribute(element, elementPrefix + "fixed"); - - if (fixed === HEIGHT) { - var size = innerHeight$1(element) || dataHeight; - element.style[WIDTH] = dataWidth / dataHeight * size + "px"; - } else { - var size = innerWidth$1(element) || dataWidth; - element.style[HEIGHT] = dataHeight / dataWidth * size + "px"; - } - } - - function resizeAll() { - elements.forEach(function (element) { - resize(element); - }); - } - /** - * @namespace eg.LazyLoaded - */ - - /** - * This module is used to wait for images or videos to load. - * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다. - * @memberof eg.LazyLoaded - * @param - - * @example - * ## HTML - * ```html - *
- * - * - * - * - * - * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * finish: () => console.log("finish"), - * error: e => console.log("error", e), - * }); - * ``` - */ - - - function check(elements, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var component = new Component(); - var finishCount = 0; - var readyCount = 0; - - function checkReady() { - if (--readyCount !== 0) { - return; - } - /** - * An event occurs when the size of all images is available. - * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#ready - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * }); - * ``` - */ - - - component.trigger("ready"); - } - - function checkFinish() { - if (--finishCount !== 0) { - return; - } - /** - * An event occurs when all images have been completed loading. - * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#finish - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * finish: () => console.log("finish"), - * }); - * ``` - */ - - - component.trigger("finish"); - } - - elements.forEach(function (el, i) { - var tagName = el.tagName; - - if (isDataAttribute(el, prefix) && tagName !== "IMG") { - add(el, prefix); - ++finishCount; - setTimeout(function () { - check(toArray$1(el.querySelectorAll("img")), prefix).on("finish", function () { - remove(el, prefix); - checkFinish(); - }); - }); - return; - } - - var images = tagName === "IMG" ? [el] : toArray$1(el.querySelectorAll("img")); - - if (!images.length) { - return; - } - - images.forEach(function (img, j) { - if (img.complete && (!IS_IE$1 || IS_IE$1 && img.naturalWidth)) { - if (!img.naturalWidth) { - setTimeout(function () { - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - }); - } - - return; - } - - if (isDataAttribute(img, prefix)) { - add(img, prefix); - } else { - ++readyCount; - } - - ++finishCount; - - function onError() { - /** - * An event occurs if the image fails to load. - * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다. - * @event eg.LazyLoaded#error - * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트 - * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스 - * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트 - * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스 - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * error: e => { - * //
...
, 0, , 2 - * console.log(e.itemTarget, e.itemIndex, e.target, e.index), - * }, - * }); - * ``` - */ - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - } - - function onCheck(e) { - var target = e.target || e.srcElement; - removeEvent$1(target, "error", onCheck); - removeEvent$1(target, "load", onCheck); - - if (isDataAttribute(target, prefix)) { - remove(target, prefix); - } else { - checkReady(); - } - - if (e.type === "error") { - onError(); - } - - checkFinish(); - } - - addEvent$1(img, "load", onCheck); - addEvent$1(img, "error", onCheck); - IS_IE$1 && img.setAttribute("src", img.getAttribute("src")); - }); - }); - !readyCount && setTimeout(function () { - component.trigger("ready"); - }); - !finishCount && setTimeout(function () { - component.trigger("finish"); - }); - return component; - } - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove$$1 = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - remove(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove$$1, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - /* eslint-disable */ - - /****************************************************************************** - * Created 2008-08-19. - * - * Dijkstra path-finding functions. Adapted from the Dijkstar Python project. - * - * Copyright (C) 2008 - * Wyatt Baldwin - * All rights reserved - * - * Licensed under the MIT license. - * - * http://www.opensource.org/licenses/mit-license.php - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - *****************************************************************************/ - function single_source_shortest_paths(graph, s, d) { - // Predecessor map for each node that has been encountered. - // node ID => predecessor node ID - var predecessors = {}; // Costs of shortest paths from s to all nodes encountered. - // node ID => cost - - var costs = {}; - costs[s] = 0; // Costs of shortest paths from s to all nodes encountered; differs from - // `costs` in that it provides easy access to the node that currently has - // the known shortest path from s. - // XXX: Do we actually need both `costs` and `open`? - - var open = new BinaryHeap(function (x) { - return x.cost; - }); - open.push({ - value: s, - cost: 0 - }); - var closest; - var u; - var cost_of_s_to_u; - var adjacent_nodes; - var cost_of_e; - var cost_of_s_to_u_plus_cost_of_e; - var cost_of_s_to_v; - var first_visit; - - while (open.size()) { - // In the nodes remaining in graph that have a known cost from s, - // find the node, u, that currently has the shortest path from s. - closest = open.pop(); - u = closest.value; - cost_of_s_to_u = closest.cost; // Get nodes adjacent to u... - - adjacent_nodes = graph(u) || {}; // ...and explore the edges that connect u to those nodes, updating - // the cost of the shortest paths to any or all of those nodes as - // necessary. v is the node across the current edge from u. - - for (var v in adjacent_nodes) { - // Get the cost of the edge running from u to v. - cost_of_e = adjacent_nodes[v]; // Cost of s to u plus the cost of u to v across e--this is *a* - // cost from s to v that may or may not be less than the current - // known cost to v. - - cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; // If we haven't visited v yet OR if the current known cost from s to - // v is greater than the new cost we just found (cost of s to u plus - // cost of u to v across e), update v's cost in the cost list and - // update v's predecessor in the predecessor list (it's now u). - - cost_of_s_to_v = costs[v]; - first_visit = typeof costs[v] === "undefined"; - - if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { - costs[v] = cost_of_s_to_u_plus_cost_of_e; - open.push({ - value: v, - cost: cost_of_s_to_u_plus_cost_of_e - }); - predecessors[v] = u; - } - } - } - - if (typeof costs[d] === "undefined") { - var msg = ["Could not find a path from ", s, " to ", d, "."].join(""); - throw new Error(msg); - } - - return predecessors; - } - - function extract_shortest_path_from_predecessor_list(predecessors, d) { - var nodes = []; - var u = d; - - while (u) { - nodes.push(u); - u = predecessors[u]; - } - - nodes.reverse(); - return nodes; - } - - function find_path(graph, s, d) { - var predecessors = single_source_shortest_paths(graph, s, d); - return extract_shortest_path_from_predecessor_list(predecessors, d); - } - - var BinaryHeap = - /*#__PURE__*/ - function () { - function BinaryHeap(scoreFunction) { - this.content = []; - this.scoreFunction = scoreFunction; - } - - var __proto = BinaryHeap.prototype; - - __proto.push = function (element) { - // Add the new element to the end of the array. - this.content.push(element); // Allow it to bubble up. - - this.bubbleUp(this.content.length - 1); - }; - - __proto.pop = function () { - // Store the first element so we can return it later. - var result = this.content[0]; // Get the element at the end of the array. - - var end = this.content.pop(); // If there are any elements left, put the end element at the - // start, and let it sink down. - - if (this.content.length > 0) { - this.content[0] = end; - this.sinkDown(0); - } - - return result; - }; - - __proto.size = function () { - return this.content.length; - }; - - __proto.bubbleUp = function (_n) { - var n = _n; // Fetch the element that has to be moved. - - var element = this.content[n]; // When at 0, an element can not go up any further. - - while (n > 0) { - // Compute the parent element's index, and fetch it. - var parentN = Math.floor((n + 1) / 2) - 1; - var parent = this.content[parentN]; // Swap the elements if the parent is greater. - - if (this.scoreFunction(element) < this.scoreFunction(parent)) { - this.content[parentN] = element; - this.content[n] = parent; // Update 'n' to continue at the new position. - - n = parentN; - } else { - // Found a parent that is less, no need to move it further. - break; - } - } - }; - - __proto.sinkDown = function (n) { - // Look up the target element and its score. - var length = this.content.length; - var element = this.content[n]; - var elemScore = this.scoreFunction(element); - var child1Score; - - while (true) { - // Compute the indices of the child elements. - var child2N = (n + 1) * 2; - var child1N = child2N - 1; // This is used to store the new position of the element, - // if any. - - var swap = null; // If the first child exists (is inside the array)... - - if (child1N < length) { - // Look it up and compute its score. - var child1 = this.content[child1N]; - child1Score = this.scoreFunction(child1); // If the score is less than our element's, we need to swap. - - if (child1Score < elemScore) { - swap = child1N; - } - } // Do the same checks for the other child. - - - if (child2N < length) { - var child2 = this.content[child2N]; - var child2Score = this.scoreFunction(child2); - - if (child2Score < (swap == null ? elemScore : child1Score)) { - swap = child2N; - } - } // If the element needs to be moved, swap it, and continue. - - - if (swap !== null) { - this.content[n] = this.content[swap]; - this.content[swap] = element; - n = swap; - } else { - // Otherwise, we are done. - break; - } - } - }; - - return BinaryHeap; - }(); - - /** - * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size. - * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다. - * @class eg.InfiniteGrid.JustifiedLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 - * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 - * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 - * @example - ``` - - ``` - **/ - - var JustifiedLayout = - /*#__PURE__*/ - function () { - function JustifiedLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - minSize: 0, - maxSize: 0, - column: [1, 8] - }, options); - this._style = getStyleNames(this.options.horizontal); - this._size = 0; - } - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.JustifiedLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - var __proto = JustifiedLayout.prototype; - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var startIndex = 0; - var endIndex = items.length; - var column = this.options.column; - var columns = typeof column === "object" ? column : [column, column]; - - var graph = function (_start) { - var results = {}; - var start = +_start.replace(/[^0-9]/g, ""); - var length = endIndex + 1; - - for (var i = Math.min(start + columns[0], length - 1); i < length; ++i) { - if (i - start > columns[1]) { - break; - } - - var cost = _this._getCost(items, start, i, size1Name, size2Name); - - if (cost === null) { - continue; - } - - if (cost < 0 && i === length - 1) { - cost = 0; - } - - results["" + i] = Math.pow(cost, 2); - } - - return results; - }; // shortest path for items' total height. - - - var path = find_path(graph, "" + startIndex, "" + endIndex); - return this._setStyle(items, path, outline, isAppend); - }; - - __proto._getSize = function (items, size1Name, size2Name) { - var margin = this.options.margin; - var size = items.reduce(function (sum, item) { - return sum + item.orgSize[size2Name] / item.orgSize[size1Name]; - }, 0); - return (this._size - margin * (items.length - 1)) / size; - }; - - __proto._getCost = function (items, i, j, size1Name, size2Name) { - var size = this._getSize(items.slice(i, j), size1Name, size2Name); - - var min = this.options.minSize || 0; - var max = this.options.maxSize || Infinity; - - if (isFinite(max)) { - // if this size is not in range, the cost increases sharply. - if (size < min) { - return Math.pow(size - min, 2) + Math.pow(max, 2); - } else if (size > max) { - return Math.pow(size - max, 2) + Math.pow(max, 2); - } else { - // if this size in range, the cost is negative or low. - return Math.min(size - max, min - size); - } - } // if max is infinite type, caculate cost only with "min". - - - if (size < min) { - return Math.max(Math.pow(min, 2), Math.pow(size, 2)); - } - - return size - min; - }; - - __proto._setStyle = function (items, path, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var style = this._style; // if direction is vertical - // startPos1 : top, endPos1 : bottom - // size1 : height - // startPos2 : left, endPos2 : right - // size2 : width - // if direction is horizontal - // startPos1 : left, endPos1 : right - // size1 : width - // startPos2 : top, endPos2 : bottom - // size2 : height - - var pos1Name = style.startPos1; - var size1Name = style.size1; - var pos2Name = style.startPos2; - var size2Name = style.size2; - var length = path.length; - var margin = this.options.margin; - var startPoint = outline[0] || 0; - var endPoint = startPoint; - var height = 0; - - for (var i = 0; i < length - 1; ++i) { - var path1 = parseInt(path[i], 10); - var path2 = parseInt(path[i + 1], 10); // pathItems(path1 to path2) are in 1 line. - - var pathItems = items.slice(path1, path2); - var pathItemsLength = pathItems.length; - - var size1 = this._getSize(pathItems, size1Name, size2Name); - - var pos1 = endPoint; - - for (var j = 0; j < pathItemsLength; ++j) { - var item = pathItems[j]; - var size2 = item.orgSize[size2Name] / item.orgSize[size1Name] * size1; // item has margin bottom and right. - // first item has not margin. - - var prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect; - var pos2 = prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name] + margin : 0; - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - height += margin + size1; - endPoint = startPoint + height; - } - - var itemsLength = items.length; - - if (isAppend) { - // previous group's end outline is current group's start outline - return { - start: [startPoint], - end: [endPoint] - }; - } // for prepend, only substract height from position. - // always start is lower than end. - - - for (var i = 0; i < itemsLength; ++i) { - var item = items[i]; // move items as long as height for prepend - - item.rect[pos1Name] -= height; - } - - return { - start: [startPoint - height], - end: [startPoint] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return JustifiedLayout; - }(); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - InfiniteGrid.JustifiedLayout = JustifiedLayout; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.justifiedlayout.js.map diff --git a/dist/infinitegrid.justifiedlayout.js.map b/dist/infinitegrid.justifiedlayout.js.map deleted file mode 100644 index daaca6dd4..000000000 --- a/dist/infinitegrid.justifiedlayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.justifiedlayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/lazyloaded/dist/lazyloaded.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/lib/dijkstra.ts","../src/layouts/JustifiedLayout.ts","../src/index.justifiedlayout.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n this._eventHandler = {};\n this.options = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\n\n(InfiniteGrid as any).JustifiedLayout = JustifiedLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","v","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","items","item","jQuery","constructor","jquery","arr","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","categorize","result","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","WIDTH","HEIGHT","isDataAttribute","prefix","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkReady","checkFinish","tagName","setTimeout","images","img","j","complete","naturalWidth","itemTarget","onError","onCheck","srcElement","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","scroller","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","graph","s","d","predecessors","costs","open","BinaryHeap","cost","closest","u","cost_of_s_to_u","adjacent_nodes","cost_of_e","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","first_visit","msg","Error","single_source_shortest_paths","extract_shortest_path_from_predecessor_list","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","floor","parent","elemScore","child1Score","child2N","child1N","swap","child1","child2","child2Score","assignOptions","minSize","maxSize","column","_style","getStyleNames","point","size1Name","size2Name","columns","_start","results","_getCost","pow","path","find_path","_setStyle","sum","isFinite","pos1Name","pos2Name","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength","clone","cloneItems","JustifiedLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;IASA;;;;IAIA,SAASA,WAAT,CAAqBC,KAArB,EAA4B;IAC1B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;IACD;IACD;;;;;;;IAOA,IAAIC,SAAS;IACb;IACA,YAAY;IACV,MAAIA,SAAS;IACb;IACA,cAAY;IACV;;;;;;;;;;;IAWA;;;IAGA,aAASA,SAAT,GAAqB;IACnB,WAAKC,aAAL,GAAqB,EAArB;IACA,WAAKC,OAAL,GAAe,EAAf;IACD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BA,QAAIC,MAAM,GAAGH,SAAS,CAACI,SAAvB;;IAEAD,IAAAA,MAAM,CAACE,OAAP,GAAiB,SAASA,OAAT,CAAiBC,SAAjB,EAA4BC,WAA5B,EAAyC;IACxD,UAAIA,WAAW,KAAK,KAAK,CAAzB,EAA4B;IAC1BA,QAAAA,WAAW,GAAG,EAAd;IACD;;IAED,UAAIC,WAAW,GAAG,KAAKP,aAAL,CAAmBK,SAAnB,KAAiC,EAAnD;IACA,UAAIG,cAAc,GAAGD,WAAW,CAACE,MAAZ,GAAqB,CAA1C;;IAEA,UAAI,CAACD,cAAL,EAAqB;IACnB,eAAO,IAAP;IACD,OAVuD;;;IAaxDD,MAAAA,WAAW,GAAGA,WAAW,CAACG,MAAZ,EAAd;IACAJ,MAAAA,WA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hD,QAAMoN,KAAK,GAAGjQ,KAAK,GAAGjK,KAAH,GAAWma,UAAU,CAACna,KAAD,CAAxC;IAEA,WAAO;IACNA,MAAAA,KAAK,EAAEka,KADD;IAENtX,MAAAA,QAAQ,EAAE,KAAKwJ,OAAL,CAAa8N,KAAb,EAAoBpN,OAApB,EAA6B/F,QAA7B;IAFJ,KAAP;IAIA,GARO;;IAST,wBAAA;IAAC,GAlPD;;ICxCA;;;;AAIA,IAGCiP,YAAoB,CAACoE,eAArB,GAAuCA,eAAvC;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.justifiedlayout.min.js b/dist/infinitegrid.justifiedlayout.min.js deleted file mode 100644 index 689c5ea44..000000000 --- a/dist/infinitegrid.justifiedlayout.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function q(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return U(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return q(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?q(t.toArray(),!0):q(t.get(0),!1),i;if(R(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?k(i):i&&i[0]}function B(t,e,i,n){if(s){var r=n||!1;"object"==typeof n&&(r=!!o&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function V(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function F(t){return(i?u.getComputedStyle(t):t.currentStyle)||{}}function j(t,e,i){if(U(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=F(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function H(t){return j(t,"Width",!1)}function N(t){return j(t,"Height",!1)}function D(t){return j(t,"Width",!0)}function W(t){return j(t,"Height",!0)}function X(t){return{width:D(t),height:W(t)}}var Y={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function Q(i){for(var t=[],e=1;ef[1]);++r){var s=a._getCost(o,i,r,u,h);null!==s&&(s<0&&r===n-1&&(s=0),e[""+r]=Math.pow(s,2))}return e},"0",""+c);return this._setStyle(o,r,t,e)},e._getSize=function(t,i,n){var e=this.options.margin,r=t.reduce(function(t,e){return t+e.orgSize[n]/e.orgSize[i]},0);return(this._size-e*(t.length-1))/r},e._getCost=function(t,e,i,n,r){var s=this._getSize(t.slice(e,i),n,r),o=this.options.minSize||0,a=this.options.maxSize||1/0;return isFinite(a)?s발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\n\n(InfiniteGrid as any).JustifiedLayout = JustifiedLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","this","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","win","Result","prevList","list","added","removed","changed","maintained","changedBeforeAdded","fixed","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","orderChanged","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","isWindow","jQuery","constructor","jquery","toArray","isJQuery","isArray","v","$","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","target","_i","sources","source","ItemManager","elements","groupKey","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","items","item","item2","data2","assign","status","clear","group","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","insert","groupKeys","newGroups","newItems","categorize","result","removedIndex","nextGroups","addedIndex","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","arr","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","scrollPos","isForward","endScrollPos","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","IS_IE","WIDTH","HEIGHT","isDataAttribute","prefix","add","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkFinish","tagName","setTimeout","images","img","j","onCheck","srcElement","itemTarget","complete","naturalWidth","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","graph","s","d","predecessors","u","extract_shortest_path_from_predecessor_list","costs","closest","cost_of_s_to_u","adjacent_nodes","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","open","BinaryHeap","cost","msg","Error","single_source_shortest_paths","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","floor","parent","child1Score","elemScore","child2N","child1N","swap","child1","child2","defaultOptions","assignOptions","minSize","maxSize","column","_style","isHorizontal","getStyleNames","point","size1Name","size2Name","columns","path","find_path","_start","results","_getCost","pow","_setStyle","sum","isFinite","pos1Name","pos2Name","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength","clone","cloneItems","JustifiedLayout"],"mappings":";;;;;;;;slBAaA,SAASA,EAAYC,eACK,IAAVA,EAShB,IAAIC,EAEJ,eACMA,sBAiBOA,SACFC,cAAgB,QAChBC,QAAU,OA+BbC,EAASH,EAAUI,iBAEvBD,EAAOE,QAAU,SAAiBC,EAAWC,QACvB,IAAhBA,IACFA,EAAc,QAGZC,EAAcC,KAAKR,cAAcK,IAAc,QACT,EAArBE,EAAYE,eAGxB,EAITF,EAAcA,EAAYG,SAC1BJ,EAAYK,UAAYN,MACpBO,GAAa,EACbC,EAAM,CAACP,GACPQ,EAAI,EAERR,EAAYS,KAAO,WACjBH,GAAa,GAGfN,EAAYU,cAAgBR,SAEvB,IAAIS,EAAOC,UAAUT,OAAQU,EAAY,IAAIC,MAAa,EAAPH,EAAWA,EAAO,EAAI,GAAII,EAAO,EA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AAA,EAAOD,EAAMzO,IAGd2N,KAAKoZ,IAAaxa,QAEjB,CACN+C,MAAO,CAAC2X,EAAa1a,GACrBgD,IAAK,CAAC0X,eAGR,SAAgBxY,EAAiCoL,EAAwBlG,EAAoBqD,gBAA7EvI,mBAAiCoL,UAE1C4N,EAAQzQ,EAAQvI,WTNqCA,UACrDA,EAAM7J,IAAI,SAAA8J,UAAQG,EAAO,GAAIH,KSKLgZ,CAAWjZ,SAElC,CACNA,MAAOgZ,EACPpY,SAAU3P,KAAKyZ,QAAQsO,EAAO5N,EAASlG,iBChRzC6P,GAAqBmE,gBAAkBA"} \ No newline at end of file diff --git a/dist/infinitegrid.min.js b/dist/infinitegrid.min.js deleted file mode 100644 index ed78b0ad0..000000000 --- a/dist/infinitegrid.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/component"),require("@egjs/list-differ"),require("@egjs/lazyloaded")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/list-differ","@egjs/lazyloaded"],e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e(t.eg.Component,t.eg.ListDiffer,t.eg.LazyLoaded))}(this,function(g,d,f){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var u,t,p=function(){return(p=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function q(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return tt(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return q(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?q(t.toArray(),!0):q(t.get(0),!1),i;if(k(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?R(i):i&&i[0]}function F(t,e,i,n){if(s){var r=n||!1;"object"==typeof n&&(r=!!o&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function N(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function V(t){return(r?u.getComputedStyle(t):t.currentStyle)||{}}function j(t,e,i){if(tt(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=V(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function H(t){return j(t,"Width",!1)}function D(t){return j(t,"Height",!1)}function W(t){return j(t,"Width",!0)}function X(t){return j(t,"Height",!0)}function Y(t){return{width:W(t),height:X(t)}}var U={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function Q(t){return U[t?m:l]}function $(i){for(var t=[],e=1;e=v);++M)++w;i||(m-=w-1)}y.columnWidth=[a,w],l.push(((n={width:w,height:w})[g]=v-(i?0:w),n[d]=m,n.type=_+1,n.index=_,n));for(M=0;Ml[1]);++r){var s=a._getCost(o,i,r,u,h);null!==s&&(s<0&&r===n-1&&(s=0),e[""+r]=Math.pow(s,2))}return e},"0",""+c);return this._setStyle(o,r,t,e)},e._getSize=function(t,i,n){var e=this.options.margin,r=t.reduce(function(t,e){return t+e.orgSize[n]/e.orgSize[i]},0);return(this._size-e*(t.length-1))/r},e._getCost=function(t,e,i,n,r){var s=this._getSize(t.slice(e,i),n,r),o=this.options.minSize||0,a=this.options.maxSize||1/0;return isFinite(a)?s {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions
(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\nimport FrameLayout from \"./layouts/FrameLayout\";\nimport SquareLayout from \"./layouts/SquareLayout\";\nimport PackingLayout from \"./layouts/PackingLayout\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport ItemManager from \"./ItemManager\";\nimport Infinite from \"./Infinite\";\nimport {\n\tCONTAINER_CLASSNAME, IGNORE_CLASSNAME,\n\tDEFAULT_OPTIONS, INFINITEGRID_METHODS,\n\tINFINITEGRID_EVENTS,\n} from \"./consts\";\nimport { categorize, withInfiniteGridMethods } from \"./utils\";\n\n// fix for IE8\n(InfiniteGrid as any).categorize = categorize;\n(InfiniteGrid as any).INFINITEGRID_METHODS = INFINITEGRID_METHODS;\n(InfiniteGrid as any).INFINITEGRID_EVENTS = INFINITEGRID_EVENTS;\n(InfiniteGrid as any).withInfiniteGridMethods = withInfiniteGridMethods;\n(InfiniteGrid as any).CONTAINER_CLASSNAME = CONTAINER_CLASSNAME;\n(InfiniteGrid as any).IGNORE_CLASSNAME = IGNORE_CLASSNAME;\n(InfiniteGrid as any).DEFAULT_OPTIONS = DEFAULT_OPTIONS;\n(InfiniteGrid as any).GridLayout = GridLayout;\n(InfiniteGrid as any).FrameLayout = FrameLayout;\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n(InfiniteGrid as any).PackingLayout = PackingLayout;\n(InfiniteGrid as any).JustifiedLayout = JustifiedLayout;\n(InfiniteGrid as any).ItemManager = ItemManager;\n(InfiniteGrid as any).Infinite = Infinite;\n(InfiniteGrid as any).DOMRenderer = DOMRenderer;\n(InfiniteGrid as any).default = InfiniteGrid;\n\nexport default InfiniteGrid;\n"],"names":["win","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","Object","defineProperty","addEventListener","get","e","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","ALIGN","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","INFINITEGRID_METHODS","getLoadingBar","getItem","getItems","layout","getGroupKeys","getStatus","setStatus","isProcessing","startLoading","endLoading","isLoading","updateItem","updateItems","moveTo","nodes","array","length","i","push","html","match","param","multi","el","isWindow","jQuery","constructor","prototype","jquery","toArray","isJQuery","Array","isArray","map","v","$","undefined","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","options","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","name","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","indexOf","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","forEach","source","key","defaultOptions","assign","items","item","arr","value","newItems","newGroups","groupKeys","groupKey","group","ItemManager","elements","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","concat","_groups","_groupKeys","startKey","endKey","datas","this","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","isUndefined","sliceGroups","pluck","index","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","splice","insert","categorize","result","diff","removed","added","maintained","removedIndex","nextGroups","_a","fromIndex","addedIndex","reverse","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","callback","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","filter","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","nextVisibleItems","scrollPos","isForward","endScrollPos","_b","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","_infinite","_renderer","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","prefix","check","on","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","trigger","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","setTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","syncElements","watcher","processingStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","add","_renderLoading","_getLoadingStatus","userStyle","display","_process","next","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","Component","_setCursor","layoutItems","pop","shift","_d","_e","viewSize","isScroll","InfiniteGrid","START","CENTER","END","JUSTIFY","assignOptions","align","itemSize","_columnSize","_columnLength","_style","getStyleNames","startOutline","firstItem","checkColumn","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","frame","j","disableFrame","frameFill","row","_itemSize","_shapes","shapes","searchShapeInFrame","getShapes","_checkItemSize","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","k","targetOutline","prevOutlineEnd","prevOutlineDist","_getSquareSize","l","makeShapeOutline","sign","columnWidth","getColumn","columnCount","shape1","shape2","frameSize","FrameLayout","originWidth","originHeight","scaleX","scaleY","originLength","cost","aspectRatio","sizeWeight","ratioWeight","getRatio","bestFitArea","minCost","layoutVertical","itemFitSize","containerFitSize","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemRatio","containerSize","containerRatio","fitArea","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","graph","s","d","predecessors","u","extract_shortest_path_from_predecessor_list","costs","closest","cost_of_s_to_u","adjacent_nodes","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","open","BinaryHeap","msg","Error","single_source_shortest_paths","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","parent","child1Score","elemScore","child2N","child1N","swap","child1","child2","minSize","maxSize","columns","path","find_path","_start","results","_getCost","pow","_setStyle","sum","isFinite","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength","INFINITEGRID_EVENTS","withInfiniteGridMethods","infinitegridName","keys","args","GridLayout","SquareLayout","PackingLayout","JustifiedLayout","default"],"mappings":";;;;;;;;qsBAAIA,mNAeSC,GAXZD,EAFqB,oBAAXE,OAEJ,CACLD,SAAU,GACVE,UAAW,CACVC,UAAW,KAIPF,QAIqBD,SCZtBI,EAAKH,EAAOC,UAAUC,UAEfE,KAA2B,qBAAsBJ,GACjDK,KAA8B,qBAAsBN,GACpDO,EAAmB,eAC3BC,GAAwB,MAGvBF,GAA4BG,OAAOC,gBAEtCV,EAASW,iBAAiB,OAAQ,aAAWF,OAAOC,eAAe,GAClE,UAAW,CACXE,eACCJ,GAAwB,MAI1B,MAAOK,WAGFL,EAhBwB,GAoBnBM,GADQ,kCAAkCC,KAAKX,GACtC,cAAcW,KAAKX,IAC5BY,EAAc,cAAcD,KAAKX,GACjCa,EAAsB,8BACtBC,EAAmB,2BACnBC,EAAkB,2BAElBC,EAAW,WACXC,EAAa,aAEbC,GAAkB,IAClBC,EAAe,gBAEfC,EAAkB,CAC9BC,aAAc,IACdC,kBAAkB,EAClBC,UAAW,IACXC,aAAa,EACbC,gBAAgB,EAChBC,YAAY,EACZC,YAAY,EACZC,mBAAoB,EACpBC,QAAQ,EACRC,gBAAiB,QACj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7F,EAASmG,OAGdugB,EAAc1f,EAAMlF,UAEtBuM,QAEI,CACN9E,MAAO,CAAC4c,GACR3c,IAAK,CAAC4c,QAMCrkB,EAAI,EAAGA,EAAI2kB,IAAe3kB,EAAG,KAC/BkF,GAAAA,EAAOD,EAAMjF,IAGd+F,KAAK8V,IAAa/X,QAEjB,CACN0D,MAAO,CAAC4c,EAAatgB,GACrB2D,IAAK,CAAC2c,eAGR,SAAgBnf,EAAiCgM,EAAwB3E,EAAoBsD,gBAA7E3K,mBAAiCgM,UAE1C4L,EAAQjN,EAAQ3K,EAAQ6X,EAAW7X,SAElC,CACNA,MAAO4X,EACPtV,SAAUZ,KAAKyJ,QAAQyM,EAAO5L,EAAS3E,iBClQzCkO,GAAqB3R,WAAaA,GAClC2R,GAAqB1b,qBAAuBA,EAC5C0b,GAAqBoK,oBfmFa,CAAC,SAAU,UAAW,aAAc,SAAU,kBelFhFpK,GAAqBqK,iCd6VkBnkB,EAAgBokB,GACvDzoB,OAAO0oB,KAAKjmB,GAAsB8F,QAAQ,SAACpC,GACtC9B,EAAU8B,KAGd9B,EAAU8B,GAAQ,8BAASkC,mBAAAA,IAAAsgB,sBACpBlc,GAASO,EAAA1C,KAAKme,IAAkBtiB,WAASwiB,UAG3Clc,IAAWnC,KAAKme,GACZne,KAEAmC,OcxWV0R,GAAqB3d,oBAAsBA,EAC3C2d,GAAqB1d,iBAAmBA,EACxC0d,GAAqBpd,gBAAkBA,EACvCod,GAAqByK,WAAaA,GAClCzK,GAAqB4E,YAAcA,GACnC5E,GAAqB0K,aAAeA,GACpC1K,GAAqB2K,cAAgBA,GACrC3K,GAAqB4K,gBAAkBA,GACvC5K,GAAqB9U,YAAcA,GACnC8U,GAAqBlG,SAAWA,GAChCkG,GAAqB7P,YAAcA,GACnC6P,GAAqB6K,QAAU7K"} \ No newline at end of file diff --git a/dist/infinitegrid.packinglayout.js b/dist/infinitegrid.packinglayout.js deleted file mode 100644 index f5d233931..000000000 --- a/dist/infinitegrid.packinglayout.js +++ /dev/null @@ -1,5031 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory()); -}(this, (function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/component project is licensed under the MIT license - - @egjs/component JavaScript library - https://naver.github.io/egjs-component - - @version 2.1.2 - */ - - /** - * Copyright (c) 2015 NAVER Corp. - * egjs projects are licensed under the MIT license - */ - function isUndefined(value) { - return typeof value === "undefined"; - } - /** - * A class used to manage events in a component - * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스 - * @alias eg.Component - */ - - - var Component = - /*#__PURE__*/ - function () { - var Component = - /*#__PURE__*/ - function () { - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.Component.VERSION; // ex) 2.0.0 - * @memberof eg.Component - */ - - /** - * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - */ - function Component() { - this._eventHandler = {}; - this.options = {}; - } - /** - * Triggers a custom event. - * @ko 커스텀 이벤트를 발생시킨다 - * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름 - * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터 - * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고 - * @example - class Some extends eg.Component { - some(){ - if(this.trigger("beforeHi")){ // When event call to stop return false. - this.trigger("hi");// fire hi event. - } - } - } - const some = new Some(); - some.on("beforeHi", (e) => { - if(condition){ - e.stop(); // When event call to stop, `hi` event not call. - } - }); - some.on("hi", (e) => { - // `currentTarget` is component instance. - console.log(some === e.currentTarget); // true - }); - // If you want to more know event design. You can see article. - // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F - */ - - - var _proto = Component.prototype; - - _proto.trigger = function trigger(eventName, customEvent) { - if (customEvent === void 0) { - customEvent = {}; - } - - var handlerList = this._eventHandler[eventName] || []; - var hasHandlerList = handlerList.length > 0; - - if (!hasHandlerList) { - return true; - } // If detach method call in handler in first time then handler list calls. - - - handlerList = handlerList.concat(); - customEvent.eventType = eventName; - var isCanceled = false; - var arg = [customEvent]; - var i = 0; - - customEvent.stop = function () { - isCanceled = true; - }; - - customEvent.currentTarget = this; - - for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - restParam[_key - 2] = arguments[_key]; - } - - if (restParam.length >= 1) { - arg = arg.concat(restParam); - } - - for (i = 0; handlerList[i]; i++) { - handlerList[i].apply(this, arg); - } - - return !isCanceled; - }; - /** - * Executed event just one time. - * @ko 이벤트가 한번만 실행된다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - alert("hi"); - } - thing() { - this.once("hi", this.hi); - } - } - var some = new Some(); - some.thing(); - some.trigger("hi"); - // fire alert("hi"); - some.trigger("hi"); - // Nothing happens - */ - - - _proto.once = function once(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var i; - - for (i in eventHash) { - this.once(i, eventHash[i]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var self = this; - this.on(eventName, function listener() { - for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - arg[_key2] = arguments[_key2]; - } - - handlerToAttach.apply(self, arg); - self.off(eventName, listener); - }); - } - - return this; - }; - /** - * Checks whether an event has been attached to a component. - * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다. - * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름 - * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부 - * @example - class Some extends eg.Component { - some() { - this.hasOn("hi");// check hi event. - } - } - */ - - - _proto.hasOn = function hasOn(eventName) { - return !!this._eventHandler[eventName]; - }; - /** - * Attaches an event to a component. - * @ko 컴포넌트에 이벤트를 등록한다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.on("hi",this.hi); //attach event - } - } - */ - - - _proto.on = function on(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.on(name, eventHash[name]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var handlerList = this._eventHandler[eventName]; - - if (isUndefined(handlerList)) { - this._eventHandler[eventName] = []; - handlerList = this._eventHandler[eventName]; - } - - handlerList.push(handlerToAttach); - } - - return this; - }; - /** - * Detaches an event from the component. - * @ko 컴포넌트에 등록된 이벤트를 해제한다 - * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름 - * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.off("hi",this.hi); //detach event - } - } - */ - - - _proto.off = function off(eventName, handlerToDetach) { - // All event detach. - if (isUndefined(eventName)) { - this._eventHandler = {}; - return this; - } // All handler of specific event detach. - - - if (isUndefined(handlerToDetach)) { - if (typeof eventName === "string") { - this._eventHandler[eventName] = undefined; - return this; - } else { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.off(name, eventHash[name]); - } - - return this; - } - } // The handler of specific event detach. - - - var handlerList = this._eventHandler[eventName]; - - if (handlerList) { - var k; - var handlerFunction; - - for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) { - if (handlerFunction === handlerToDetach) { - handlerList = handlerList.splice(k, 1); - break; - } - } - } - - return this; - }; - - return Component; - }(); - - Component.VERSION = "2.1.2"; - return Component; - }(); - - /* - Copyright (c) 2019-present NAVER Corp. - name: @egjs/list-differ - license: MIT - author: NAVER Corp. - repository: https://github.com/naver/egjs-list-differ - version: 1.0.0 - */ - - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - var PolyMap = - /*#__PURE__*/ - function () { - function PolyMap() { - this.keys = []; - this.values = []; - } - - var __proto = PolyMap.prototype; - - __proto.get = function (key) { - return this.values[this.keys.indexOf(key)]; - }; - - __proto.set = function (key, value) { - var keys = this.keys; - var values = this.values; - var prevIndex = keys.indexOf(key); - var index = prevIndex === -1 ? keys.length : prevIndex; - keys[index] = key; - values[index] = value; - }; - - return PolyMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var HashMap = - /*#__PURE__*/ - function () { - function HashMap() { - this.object = {}; - } - - var __proto = HashMap.prototype; - - __proto.get = function (key) { - return this.object[key]; - }; - - __proto.set = function (key, value) { - this.object[key] = value; - }; - - return HashMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var SUPPORT_MAP = typeof Map === "function"; - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - var Link = - /*#__PURE__*/ - function () { - function Link() {} - - var __proto = Link.prototype; - - __proto.connect = function (prevLink, nextLink) { - this.prev = prevLink; - this.next = nextLink; - prevLink && (prevLink.next = this); - nextLink && (nextLink.prev = this); - }; - - __proto.disconnect = function () { - // In double linked list, diconnect the interconnected relationship. - var prevLink = this.prev; - var nextLink = this.next; - prevLink && (prevLink.next = nextLink); - nextLink && (nextLink.prev = prevLink); - }; - - __proto.getIndex = function () { - var link = this; - var index = -1; - - while (link) { - link = link.prev; - ++index; - } - - return index; - }; - - return Link; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - function orderChanged(changed, fixed) { - // It is roughly in the order of these examples. - // 4, 6, 0, 2, 1, 3, 5, 7 - var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 - - var toLinks = []; - changed.forEach(function (_a) { - var from = _a[0], - to = _a[1]; - var link = new Link(); - fromLinks[from] = link; - toLinks[to] = link; - }); // `fromLinks` are connected to each other by double linked list. - - fromLinks.forEach(function (link, i) { - link.connect(fromLinks[i - 1]); - }); - return changed.filter(function (_, i) { - return !fixed[i]; - }).map(function (_a, i) { - var from = _a[0], - to = _a[1]; - - if (from === to) { - return [0, 0]; - } - - var fromLink = fromLinks[from]; - var toLink = toLinks[to - 1]; - var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. - - fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. - - if (!toLink) { - fromLink.connect(undefined, fromLinks[0]); - } else { - fromLink.connect(toLink, toLink.next); - } - - var toIndex = fromLink.getIndex(); - return [fromIndex, toIndex]; - }); - } - - var Result = - /*#__PURE__*/ - function () { - function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { - this.prevList = prevList; - this.list = list; - this.added = added; - this.removed = removed; - this.changed = changed; - this.maintained = maintained; - this.changedBeforeAdded = changedBeforeAdded; - this.fixed = fixed; - } - - var __proto = Result.prototype; - Object.defineProperty(__proto, "ordered", { - get: function () { - if (!this.cacheOrdered) { - this.caculateOrdered(); - } - - return this.cacheOrdered; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(__proto, "pureChanged", { - get: function () { - if (!this.cachePureChanged) { - this.caculateOrdered(); - } - - return this.cachePureChanged; - }, - enumerable: true, - configurable: true - }); - - __proto.caculateOrdered = function () { - var ordered = orderChanged(this.changedBeforeAdded, this.fixed); - var changed = this.changed; - var pureChanged = []; - this.cacheOrdered = ordered.filter(function (_a, i) { - var from = _a[0], - to = _a[1]; - var _b = changed[i], - fromBefore = _b[0], - toBefore = _b[1]; - - if (from !== to) { - pureChanged.push([fromBefore, toBefore]); - return true; - } - }); - this.cachePureChanged = pureChanged; - }; - - return Result; - }(); - /** - * - * @memberof eg.ListDiffer - * @static - * @function - * @param - Previous List 이전 목록 - * @param - List to Update 업데이트 할 목록 - * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. - * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. - * @example - * import { diff } from "@egjs/list-differ"; - * // script => eg.ListDiffer.diff - * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); - * // List before update - * // [1, 2, 3, 4, 5] - * console.log(result.prevList); - * // Updated list - * // [4, 3, 6, 2, 1] - * console.log(result.list); - * // Index array of values added to `list` - * // [0, 1, 5] - * console.log(result.added); - * // Index array of values removed in `prevList` - * // [5] - * console.log(result.removed); - * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.changed); - * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) - * // [[4, 3], [3, 4], [2, 6]] - * console.log(result.pureChanged); - * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) - * // [[4, 1], [4, 2], [4, 3]] - * console.log(result.ordered); - * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.maintained); - */ - - - function diff(prevList, list, findKeyCallback) { - var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; - - var callback = findKeyCallback || function (e) { - return e; - }; - - var added = []; - var removed = []; - var maintained = []; - var prevKeys = prevList.map(callback); - var keys = list.map(callback); - var prevKeyMap = new mapClass(); - var keyMap = new mapClass(); - var changedBeforeAdded = []; - var fixed = []; - var removedMap = {}; - var changed = []; - var addedCount = 0; - var removedCount = 0; // Add prevKeys and keys to the hashmap. - - prevKeys.forEach(function (key, prevListIndex) { - prevKeyMap.set(key, prevListIndex); - }); - keys.forEach(function (key, listIndex) { - keyMap.set(key, listIndex); - }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. - - prevKeys.forEach(function (key, prevListIndex) { - var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. - - if (typeof listIndex === "undefined") { - ++removedCount; - removed.push(prevListIndex); - } else { - removedMap[listIndex] = removedCount; - } - }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. - - keys.forEach(function (key, listIndex) { - var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. - - if (typeof prevListIndex === "undefined") { - added.push(listIndex); - ++addedCount; - } else { - maintained.push([prevListIndex, listIndex]); - removedCount = removedMap[listIndex] || 0; - changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); - fixed.push(listIndex === prevListIndex); - - if (prevListIndex !== listIndex) { - changed.push([prevListIndex, listIndex]); - } - } - }); // Sort by ascending order of 'to(list's index). - - removed.reverse(); - return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); - } - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document$1.body[prop] || document$1.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document$1.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function toZeroArray(outline) { - if (!outline || !outline.length) { - return [0]; - } - - return outline; - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function isUndefined$1(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined$1(start) ? this._groups : this.sliceGroups(start, (isUndefined$1(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document$1.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document$1.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/lazyloaded JavaScript library - @egjs/lazyloaded project is licensed under the MIT license - - - @version 0.0.2 - */ - var isWindow$1 = typeof window !== "undefined"; - var ua$1 = isWindow$1 ? window.navigator.userAgent : ""; - var SUPPORT_COMPUTEDSTYLE$1 = isWindow$1 ? !!("getComputedStyle" in window) : false; - var IS_IE$1 = /MSIE|Trident|Windows Phone|Edge/.test(ua$1); - var SUPPORT_ADDEVENTLISTENER$1 = isWindow$1 ? !!("addEventListener" in document) : false; - var WIDTH = "width"; - var HEIGHT = "height"; - - function getAttribute(el, name) { - return el.getAttribute(name) || ""; - } - - function toArray$1(arr) { - return [].slice.call(arr); - } - - function isDataAttribute(target, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - return !!target.getAttribute(prefix + "width"); - } - - function addEvent$1(element, type, handler) { - if (SUPPORT_ADDEVENTLISTENER$1) { - element.addEventListener(type, handler, false); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - - function removeEvent$1(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - - function innerWidth$1(el) { - return getSize$1(el, "Width"); - } - - function innerHeight$1(el) { - return getSize$1(el, "Height"); - } - - function getStyles$1(el) { - return (SUPPORT_COMPUTEDSTYLE$1 ? window.getComputedStyle(el) : el.currentStyle) || {}; - } - - function getSize$1(el, name) { - var size = el["client" + name] || el["offset" + name]; - return parseFloat(size || getStyles$1(el)[name.toLowerCase()]) || 0; - } - - var elements = []; - - function add(element, prefix) { - !elements.length && addEvent$1(window, "resize", resizeAll); - element.__PREFIX__ = prefix; - elements.push(element); - resize(element); - } - - function remove(element, prefix) { - var index = elements.indexOf(element); - - if (index < 0) { - return; - } - - var fixed = getAttribute(element, prefix + "fixed"); - delete element.__PREFIX__; - element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = ""; - elements.splice(index, 1); - !elements.length && removeEvent$1(window, "resize", resizeAll); - } - - function resize(element, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var elementPrefix = element.__PREFIX__; - - if (typeof elementPrefix !== "string") { - elementPrefix = prefix; - } - - var dataWidth = parseInt(getAttribute(element, "" + elementPrefix + WIDTH), 10) || 0; - var dataHeight = parseInt(getAttribute(element, "" + elementPrefix + HEIGHT), 10) || 0; - var fixed = getAttribute(element, elementPrefix + "fixed"); - - if (fixed === HEIGHT) { - var size = innerHeight$1(element) || dataHeight; - element.style[WIDTH] = dataWidth / dataHeight * size + "px"; - } else { - var size = innerWidth$1(element) || dataWidth; - element.style[HEIGHT] = dataHeight / dataWidth * size + "px"; - } - } - - function resizeAll() { - elements.forEach(function (element) { - resize(element); - }); - } - /** - * @namespace eg.LazyLoaded - */ - - /** - * This module is used to wait for images or videos to load. - * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다. - * @memberof eg.LazyLoaded - * @param - - * @example - * ## HTML - * ```html - *
- * - * - * - * - * - * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * finish: () => console.log("finish"), - * error: e => console.log("error", e), - * }); - * ``` - */ - - - function check(elements, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var component = new Component(); - var finishCount = 0; - var readyCount = 0; - - function checkReady() { - if (--readyCount !== 0) { - return; - } - /** - * An event occurs when the size of all images is available. - * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#ready - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * }); - * ``` - */ - - - component.trigger("ready"); - } - - function checkFinish() { - if (--finishCount !== 0) { - return; - } - /** - * An event occurs when all images have been completed loading. - * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#finish - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * finish: () => console.log("finish"), - * }); - * ``` - */ - - - component.trigger("finish"); - } - - elements.forEach(function (el, i) { - var tagName = el.tagName; - - if (isDataAttribute(el, prefix) && tagName !== "IMG") { - add(el, prefix); - ++finishCount; - setTimeout(function () { - check(toArray$1(el.querySelectorAll("img")), prefix).on("finish", function () { - remove(el, prefix); - checkFinish(); - }); - }); - return; - } - - var images = tagName === "IMG" ? [el] : toArray$1(el.querySelectorAll("img")); - - if (!images.length) { - return; - } - - images.forEach(function (img, j) { - if (img.complete && (!IS_IE$1 || IS_IE$1 && img.naturalWidth)) { - if (!img.naturalWidth) { - setTimeout(function () { - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - }); - } - - return; - } - - if (isDataAttribute(img, prefix)) { - add(img, prefix); - } else { - ++readyCount; - } - - ++finishCount; - - function onError() { - /** - * An event occurs if the image fails to load. - * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다. - * @event eg.LazyLoaded#error - * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트 - * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스 - * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트 - * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스 - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * error: e => { - * //
...
, 0, , 2 - * console.log(e.itemTarget, e.itemIndex, e.target, e.index), - * }, - * }); - * ``` - */ - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - } - - function onCheck(e) { - var target = e.target || e.srcElement; - removeEvent$1(target, "error", onCheck); - removeEvent$1(target, "load", onCheck); - - if (isDataAttribute(target, prefix)) { - remove(target, prefix); - } else { - checkReady(); - } - - if (e.type === "error") { - onError(); - } - - checkFinish(); - } - - addEvent$1(img, "load", onCheck); - addEvent$1(img, "error", onCheck); - IS_IE$1 && img.setAttribute("src", img.getAttribute("src")); - }); - }); - !readyCount && setTimeout(function () { - component.trigger("ready"); - }); - !finishCount && setTimeout(function () { - component.trigger("finish"); - }); - return component; - } - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove$$1 = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - remove(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove$$1, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - var BoxModel = - /*#__PURE__*/ - function () { - function BoxModel(options) { - assign(this, { - originWidth: 0, - originHeight: 0, - width: 0, - height: 0, - left: 0, - top: 0, - items: [] - }, options); - } - - var __proto = BoxModel.prototype; - - __proto.scaleTo = function (width, height) { - var scaleX = this.width ? width / this.width : 0; - var scaleY = this.height ? height / this.height : 0; - this.items.forEach(function (v) { - if (scaleX !== 0) { - v.left *= scaleX; - v.width *= scaleX; - } - - if (scaleY !== 0) { - v.top *= scaleY; - v.height *= scaleY; - } - }); - this.width = width; - this.height = height; - }; - - __proto.push = function (item) { - this.items.push(item); - }; - - __proto.getOriginSize = function () { - return this.originWidth * this.originHeight; - }; - - __proto.getSize = function () { - return this.width * this.height; - }; - - __proto.getOriginRatio = function () { - return this.originHeight === 0 ? 0 : this.originWidth / this.originHeight; - }; - - __proto.getRatio = function () { - return this.height === 0 ? 0 : this.width / this.height; - }; - - return BoxModel; - }(); - - function getCost(originLength, length) { - var cost = originLength / length; - - if (cost < 1) { - cost = 1 / cost; - } - - return cost - 1; - } - - function fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical) { - item.height = itemFitSize.height; - item.width = itemFitSize.width; - bestFitArea.height = containerFitSize.height; - bestFitArea.width = containerFitSize.width; - - if (layoutVertical) { - item.top = bestFitArea.top + bestFitArea.height; - item.left = bestFitArea.left; - } else { - item.left = bestFitArea.left + bestFitArea.width; - item.top = bestFitArea.top; - } - } - /** - * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion. - * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다. - * @class eg.InfiniteGrid.PackingLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 - * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 - * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 - * @example - ``` - - ``` - **/ - - - var PackingLayout = - /*#__PURE__*/ - function () { - function PackingLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - aspectRatio: 1, - sizeWeight: 1, - ratioWeight: 1 - }, options); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - var __proto = PackingLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.PackingLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto._findBestFitArea = function (container, item) { - if (container.getRatio() === 0) { - // 아이템 최초 삽입시 전체영역 지정 - container.originWidth = item.width; - container.originHeight = item.height; - container.width = item.width; - container.height = item.height; - return; - } - - var bestFitArea; - var minCost = 10000000; - var layoutVertical = false; - var itemFitSize = { - width: 0, - height: 0 - }; - var containerFitSize = { - width: 0, - height: 0 - }; - var _a = this.options, - sizeWeight = _a.sizeWeight, - ratioWeight = _a.ratioWeight; - container.items.forEach(function (v) { - var containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight; - var containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight; - var width = v.width; - var height = v.height; - var cost; - - for (var i = 0; i < 2; ++i) { - var itemWidth = void 0; - var itemHeight = void 0; - var containerWidth = void 0; - var containerHeight = void 0; - - if (i === 0) { - // 상하에 아이템 추가 - itemWidth = width; - itemHeight = height * (item.height / (v.originHeight + item.height)); - containerWidth = width; - containerHeight = height - itemHeight; - } else { - // 좌우에 아이템 추가 - itemHeight = height; - itemWidth = width * (item.width / (v.originWidth + item.width)); - containerHeight = height; - containerWidth = width - itemWidth; - } - - var itemSize = itemWidth * itemHeight; - var itemRatio = itemWidth / itemHeight; - var containerSize = containerWidth * containerHeight; - var containerRatio = containerHeight / containerHeight; - cost = getCost(item.getSize(), itemSize) * sizeWeight; - cost += getCost(item.getRatio(), itemRatio) * ratioWeight; - cost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost; - cost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost; - - if (cost === Math.min(cost, minCost)) { - minCost = cost; - bestFitArea = v; - layoutVertical = i === 0; - itemFitSize.width = itemWidth; - itemFitSize.height = itemHeight; - containerFitSize.width = containerWidth; - containerFitSize.height = containerHeight; - } - } - }); - fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical); - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - if (outline === void 0) { - outline = []; - } - - var style = this._style; - var _a = this.options, - horizontal = _a.horizontal, - aspectRatio = _a.aspectRatio, - margin = _a.margin; - var pos1Name = style.startPos1; - var containerWidth = this._size * (horizontal ? aspectRatio : 1); - var containerHeight = this._size / (horizontal ? 1 : aspectRatio); - var containerSize1 = horizontal ? containerWidth : containerHeight; - var prevOutline = toZeroArray(outline); - var start = isAppend ? Math.max.apply(Math, prevOutline) : Math.min.apply(Math, prevOutline) - containerSize1 - margin; - var end = start + containerSize1 + margin; - var container = new BoxModel({}); - items.forEach(function (item) { - var _a = item.orgSize, - width = _a.width, - height = _a.height; - var model = new BoxModel({ - width: width, - height: height, - originWidth: width, - originHeight: height - }); - - _this._findBestFitArea(container, model); - - container.push(model); - container.scaleTo(containerWidth + margin, containerHeight + margin); - }); - items.forEach(function (item, i) { - var boxItem = container.items[i]; - var width = boxItem.width; - var height = boxItem.height; - var top = boxItem.top; - var left = boxItem.left; - item.rect = { - top: top, - left: left, - width: width - margin, - height: height - margin - }; - item.rect[pos1Name] += start; - }); - return { - start: [start], - end: [end] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return PackingLayout; - }(); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - InfiniteGrid.PackingLayout = PackingLayout; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.packinglayout.js.map diff --git a/dist/infinitegrid.packinglayout.js.map b/dist/infinitegrid.packinglayout.js.map deleted file mode 100644 index e9d25df1a..000000000 --- a/dist/infinitegrid.packinglayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.packinglayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/lazyloaded/dist/lazyloaded.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/lib/BoxModel.ts","../src/layouts/PackingLayout.ts","../src/index.packinglayout.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n this._eventHandler = {};\n this.options = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport PackingLayout from \"./layouts/PackingLayout\";\n\n(InfiniteGrid as any).PackingLayout = PackingLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","v","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","outline","items","item","jQuery","constructor","jquery","arr","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","categorize","result","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","WIDTH","HEIGHT","isDataAttribute","prefix","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkReady","checkFinish","tagName","setTimeout","images","img","j","complete","naturalWidth","itemTarget","onError","onCheck","srcElement","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","scroller","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","originWidth","originHeight","scaleX","scaleY","originLength","cost","bestFitArea","itemFitSize","containerFitSize","layoutVertical","assignOptions","aspectRatio","sizeWeight","ratioWeight","_style","getStyleNames","point","getRatio","minCost","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemSize","itemRatio","containerSize","containerRatio","fitArea","pos1Name","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","clone","cloneItems","PackingLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;IASA;;;;IAIA,SAASA,WAAT,CAAqBC,KAArB,EAA4B;IAC1B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;IACD;IACD;;;;;;;IAOA,IAAIC,SAAS;IACb;IACA,YAAY;IACV,MAAIA,SAAS;IACb;IACA,cAAY;IACV;;;;;;;;;;;IAWA;;;IAGA,aAASA,SAAT,GAAqB;IACnB,WAAKC,aAAL,GAAqB,EAArB;IACA,WAAKC,OAAL,GAAe,EAAf;IACD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BA,QAAIC,MAAM,GAAGH,SAAS,CAACI,SAAvB;;IAEAD,IAAAA,MAAM,CAACE,OAAP,GAAiB,SAASA,OAAT,CAAiBC,SAAjB,EAA4BC,WAA5B,EAAyC;IACxD,UAAIA,WAAW,KAAK,KAAK,CAAzB,EAA4B;IAC1BA,QAAAA,WAAW,GAAG,EAAd;IACD;;IAED,UAAIC,WAAW,GAAG,KAAKP,aAAL,CAAmBK,SAAnB,KAAiC,EAAnD;IACA,UAAIG,cAAc,GAAGD,WAAW,CAACE,MAAZ,GAAqB,CAA1C;;IAEA,UAAI,CAACD,cAAL,EAAqB;IACnB,eAAO,IAAP;IACD,OAVuD;;;IAaxDD,MAAAA,WAAW,GAAGA,WAAW,CAACG,MAAZ,EAA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initegrid.packinglayout.min.js deleted file mode 100644 index bcbbafa52..000000000 --- a/dist/infinitegrid.packinglayout.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var l=function(){return(l=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function B(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return $(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return B(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?B(t.toArray(),!0):B(t.get(0),!1),i;if(k(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?R(i):i&&i[0]}function q(t,e,i,n){if(s){var r=n||!1;"object"==typeof n&&(r=!!o&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function H(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function V(t){return(i?u.getComputedStyle(t):t.currentStyle)||{}}function j(t,e,i){if($(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=V(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function F(t){return j(t,"Width",!1)}function N(t){return j(t,"Height",!1)}function W(t){return j(t,"Width",!0)}function D(t){return j(t,"Height",!0)}function X(t){return{width:W(t),height:D(t)}}var Y={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function Q(i){for(var t=[],e=1;e발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport PackingLayout from \"./layouts/PackingLayout\";\n\n(InfiniteGrid as any).PackingLayout = PackingLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","this","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","win","Result","prevList","list","added","removed","changed","maintained","changedBeforeAdded","fixed","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","orderChanged","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","isWindow","jQuery","constructor","jquery","toArray","isJQuery","isArray","v","$","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","target","_i","sources","source","ItemManager","elements","groupKey","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","items","item","item2","data2","assign","status","clear","group","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","insert","groupKeys","newGroups","newItems","categorize","result","removedIndex","nextGroups","addedIndex","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","arr","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","scrollPos","isForward","endScrollPos","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","IS_IE","WIDTH","HEIGHT","isDataAttribute","prefix","add","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkFinish","tagName","setTimeout","images","img","j","onCheck","srcElement","itemTarget","complete","naturalWidth","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","originWidth","originHeight","scaleX","scaleY","originLength","cost","defaultOptions","assignOptions","aspectRatio","sizeWeight","ratioWeight","_style","isHorizontal","getStyleNames","point","getRatio","bestFitArea","minCost","layoutVertical","itemFitSize","containerFitSize","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemSize","itemRatio","containerSize","containerRatio","fitArea","pos1Name","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","clone","cloneItems","PackingLayout"],"mappings":";;;;;;;;slBAaA,SAASA,EAAYC,eACK,IAAVA,EAShB,IAAIC,EAEJ,eACMA,sBAiBOA,SACFC,cAAgB,QAChBC,QAAU,OA+BbC,EAASH,EAAUI,iBAEvBD,EAAOE,QAAU,SAAiBC,EAAWC,QACvB,IAAhBA,IACFA,EAAc,QAGZC,EAAcC,KAAKR,cAAcK,IAAc,QACT,EAArBE,EAAYE,eAGxB,EAITF,EAAcA,EAAYG,SAC1BJ,EAAYK,UAAYN,MACpBO,GAAa,EACbC,EAAM,CAACP,GACPQ,EAAI,EAERR,EAAYS,KAAO,WACjBH,GAAa,GAGfN,EAAYU,cAAgBR,SAEvB,IAAIS,EAAOC,UAAUT,OAAQU,EAAY,IAAIC,MAAa,EAAPH,EAAWA,EAAO,EAAI,GAAII,EAAO,EAAGA,EAAOJ,EAAMI,IACvGF,EAAUE,EAAO,GAAKH,UAAUG,OAGV,GAApBF,EAAUV,SACZI,EAAMA,EAAIH,OAAOS,IAGdL,EAAI,EAAGP,EAAYO,GAAIA,IAC1BP,EAAYO,GAAGQ,MAAMd,KAAMK,UAGrBD,GA0BVV,EAAOqB,KAAO,SAAclB,EAAWmB,MACZ,iBAAdnB,GAA0BR,EAAY2B,GAAkB,KAE7DV,EADAW,EAAYpB,MAGXS,KAAKW,OACHF,KAAKT,EAAGW,EAAUX,WAGlBN,KACF,GAAyB,iBAAdH,GAAqD,mBAApBmB,EAAgC,KAC7EE,EAAOlB,UACNmB,GAAGtB,EAAW,SAASuB,QACrB,IAAIC,EAAQX,UAAUT,OAAQI,EAAM,IAAIO,MAAMS,GAAQC,EAAQ,EAAGA,EAAQD,EAAOC,IACnFjB,EAAIiB,GAASZ,UAAUY,GAGzBN,E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AQkN,EAAOxM,EAASlG,iBC5QzC6P,GAAqB+C,cAAgBA"} \ No newline at end of file diff --git a/dist/infinitegrid.pkgd.js b/dist/infinitegrid.pkgd.js deleted file mode 100644 index e3cff2061..000000000 --- a/dist/infinitegrid.pkgd.js +++ /dev/null @@ -1,6541 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory()); -}(this, (function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/component project is licensed under the MIT license - - @egjs/component JavaScript library - https://naver.github.io/egjs-component - - @version 2.1.2 - */ - - /** - * Copyright (c) 2015 NAVER Corp. - * egjs projects are licensed under the MIT license - */ - function isUndefined(value) { - return typeof value === "undefined"; - } - /** - * A class used to manage events in a component - * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스 - * @alias eg.Component - */ - - - var Component = - /*#__PURE__*/ - function () { - var Component = - /*#__PURE__*/ - function () { - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.Component.VERSION; // ex) 2.0.0 - * @memberof eg.Component - */ - - /** - * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - */ - function Component() { - this._eventHandler = {}; - this.options = {}; - } - /** - * Triggers a custom event. - * @ko 커스텀 이벤트를 발생시킨다 - * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름 - * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터 - * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고 - * @example - class Some extends eg.Component { - some(){ - if(this.trigger("beforeHi")){ // When event call to stop return false. - this.trigger("hi");// fire hi event. - } - } - } - const some = new Some(); - some.on("beforeHi", (e) => { - if(condition){ - e.stop(); // When event call to stop, `hi` event not call. - } - }); - some.on("hi", (e) => { - // `currentTarget` is component instance. - console.log(some === e.currentTarget); // true - }); - // If you want to more know event design. You can see article. - // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F - */ - - - var _proto = Component.prototype; - - _proto.trigger = function trigger(eventName, customEvent) { - if (customEvent === void 0) { - customEvent = {}; - } - - var handlerList = this._eventHandler[eventName] || []; - var hasHandlerList = handlerList.length > 0; - - if (!hasHandlerList) { - return true; - } // If detach method call in handler in first time then handler list calls. - - - handlerList = handlerList.concat(); - customEvent.eventType = eventName; - var isCanceled = false; - var arg = [customEvent]; - var i = 0; - - customEvent.stop = function () { - isCanceled = true; - }; - - customEvent.currentTarget = this; - - for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - restParam[_key - 2] = arguments[_key]; - } - - if (restParam.length >= 1) { - arg = arg.concat(restParam); - } - - for (i = 0; handlerList[i]; i++) { - handlerList[i].apply(this, arg); - } - - return !isCanceled; - }; - /** - * Executed event just one time. - * @ko 이벤트가 한번만 실행된다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - alert("hi"); - } - thing() { - this.once("hi", this.hi); - } - } - var some = new Some(); - some.thing(); - some.trigger("hi"); - // fire alert("hi"); - some.trigger("hi"); - // Nothing happens - */ - - - _proto.once = function once(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var i; - - for (i in eventHash) { - this.once(i, eventHash[i]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var self = this; - this.on(eventName, function listener() { - for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - arg[_key2] = arguments[_key2]; - } - - handlerToAttach.apply(self, arg); - self.off(eventName, listener); - }); - } - - return this; - }; - /** - * Checks whether an event has been attached to a component. - * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다. - * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름 - * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부 - * @example - class Some extends eg.Component { - some() { - this.hasOn("hi");// check hi event. - } - } - */ - - - _proto.hasOn = function hasOn(eventName) { - return !!this._eventHandler[eventName]; - }; - /** - * Attaches an event to a component. - * @ko 컴포넌트에 이벤트를 등록한다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.on("hi",this.hi); //attach event - } - } - */ - - - _proto.on = function on(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.on(name, eventHash[name]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var handlerList = this._eventHandler[eventName]; - - if (isUndefined(handlerList)) { - this._eventHandler[eventName] = []; - handlerList = this._eventHandler[eventName]; - } - - handlerList.push(handlerToAttach); - } - - return this; - }; - /** - * Detaches an event from the component. - * @ko 컴포넌트에 등록된 이벤트를 해제한다 - * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름 - * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.off("hi",this.hi); //detach event - } - } - */ - - - _proto.off = function off(eventName, handlerToDetach) { - // All event detach. - if (isUndefined(eventName)) { - this._eventHandler = {}; - return this; - } // All handler of specific event detach. - - - if (isUndefined(handlerToDetach)) { - if (typeof eventName === "string") { - this._eventHandler[eventName] = undefined; - return this; - } else { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.off(name, eventHash[name]); - } - - return this; - } - } // The handler of specific event detach. - - - var handlerList = this._eventHandler[eventName]; - - if (handlerList) { - var k; - var handlerFunction; - - for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) { - if (handlerFunction === handlerToDetach) { - handlerList = handlerList.splice(k, 1); - break; - } - } - } - - return this; - }; - - return Component; - }(); - - Component.VERSION = "2.1.2"; - return Component; - }(); - - /* - Copyright (c) 2019-present NAVER Corp. - name: @egjs/list-differ - license: MIT - author: NAVER Corp. - repository: https://github.com/naver/egjs-list-differ - version: 1.0.0 - */ - - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - var PolyMap = - /*#__PURE__*/ - function () { - function PolyMap() { - this.keys = []; - this.values = []; - } - - var __proto = PolyMap.prototype; - - __proto.get = function (key) { - return this.values[this.keys.indexOf(key)]; - }; - - __proto.set = function (key, value) { - var keys = this.keys; - var values = this.values; - var prevIndex = keys.indexOf(key); - var index = prevIndex === -1 ? keys.length : prevIndex; - keys[index] = key; - values[index] = value; - }; - - return PolyMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var HashMap = - /*#__PURE__*/ - function () { - function HashMap() { - this.object = {}; - } - - var __proto = HashMap.prototype; - - __proto.get = function (key) { - return this.object[key]; - }; - - __proto.set = function (key, value) { - this.object[key] = value; - }; - - return HashMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var SUPPORT_MAP = typeof Map === "function"; - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - var Link = - /*#__PURE__*/ - function () { - function Link() {} - - var __proto = Link.prototype; - - __proto.connect = function (prevLink, nextLink) { - this.prev = prevLink; - this.next = nextLink; - prevLink && (prevLink.next = this); - nextLink && (nextLink.prev = this); - }; - - __proto.disconnect = function () { - // In double linked list, diconnect the interconnected relationship. - var prevLink = this.prev; - var nextLink = this.next; - prevLink && (prevLink.next = nextLink); - nextLink && (nextLink.prev = prevLink); - }; - - __proto.getIndex = function () { - var link = this; - var index = -1; - - while (link) { - link = link.prev; - ++index; - } - - return index; - }; - - return Link; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - function orderChanged(changed, fixed) { - // It is roughly in the order of these examples. - // 4, 6, 0, 2, 1, 3, 5, 7 - var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 - - var toLinks = []; - changed.forEach(function (_a) { - var from = _a[0], - to = _a[1]; - var link = new Link(); - fromLinks[from] = link; - toLinks[to] = link; - }); // `fromLinks` are connected to each other by double linked list. - - fromLinks.forEach(function (link, i) { - link.connect(fromLinks[i - 1]); - }); - return changed.filter(function (_, i) { - return !fixed[i]; - }).map(function (_a, i) { - var from = _a[0], - to = _a[1]; - - if (from === to) { - return [0, 0]; - } - - var fromLink = fromLinks[from]; - var toLink = toLinks[to - 1]; - var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. - - fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. - - if (!toLink) { - fromLink.connect(undefined, fromLinks[0]); - } else { - fromLink.connect(toLink, toLink.next); - } - - var toIndex = fromLink.getIndex(); - return [fromIndex, toIndex]; - }); - } - - var Result = - /*#__PURE__*/ - function () { - function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { - this.prevList = prevList; - this.list = list; - this.added = added; - this.removed = removed; - this.changed = changed; - this.maintained = maintained; - this.changedBeforeAdded = changedBeforeAdded; - this.fixed = fixed; - } - - var __proto = Result.prototype; - Object.defineProperty(__proto, "ordered", { - get: function () { - if (!this.cacheOrdered) { - this.caculateOrdered(); - } - - return this.cacheOrdered; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(__proto, "pureChanged", { - get: function () { - if (!this.cachePureChanged) { - this.caculateOrdered(); - } - - return this.cachePureChanged; - }, - enumerable: true, - configurable: true - }); - - __proto.caculateOrdered = function () { - var ordered = orderChanged(this.changedBeforeAdded, this.fixed); - var changed = this.changed; - var pureChanged = []; - this.cacheOrdered = ordered.filter(function (_a, i) { - var from = _a[0], - to = _a[1]; - var _b = changed[i], - fromBefore = _b[0], - toBefore = _b[1]; - - if (from !== to) { - pureChanged.push([fromBefore, toBefore]); - return true; - } - }); - this.cachePureChanged = pureChanged; - }; - - return Result; - }(); - /** - * - * @memberof eg.ListDiffer - * @static - * @function - * @param - Previous List 이전 목록 - * @param - List to Update 업데이트 할 목록 - * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. - * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. - * @example - * import { diff } from "@egjs/list-differ"; - * // script => eg.ListDiffer.diff - * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); - * // List before update - * // [1, 2, 3, 4, 5] - * console.log(result.prevList); - * // Updated list - * // [4, 3, 6, 2, 1] - * console.log(result.list); - * // Index array of values added to `list` - * // [0, 1, 5] - * console.log(result.added); - * // Index array of values removed in `prevList` - * // [5] - * console.log(result.removed); - * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.changed); - * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) - * // [[4, 3], [3, 4], [2, 6]] - * console.log(result.pureChanged); - * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) - * // [[4, 1], [4, 2], [4, 3]] - * console.log(result.ordered); - * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.maintained); - */ - - - function diff(prevList, list, findKeyCallback) { - var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; - - var callback = findKeyCallback || function (e) { - return e; - }; - - var added = []; - var removed = []; - var maintained = []; - var prevKeys = prevList.map(callback); - var keys = list.map(callback); - var prevKeyMap = new mapClass(); - var keyMap = new mapClass(); - var changedBeforeAdded = []; - var fixed = []; - var removedMap = {}; - var changed = []; - var addedCount = 0; - var removedCount = 0; // Add prevKeys and keys to the hashmap. - - prevKeys.forEach(function (key, prevListIndex) { - prevKeyMap.set(key, prevListIndex); - }); - keys.forEach(function (key, listIndex) { - keyMap.set(key, listIndex); - }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. - - prevKeys.forEach(function (key, prevListIndex) { - var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. - - if (typeof listIndex === "undefined") { - ++removedCount; - removed.push(prevListIndex); - } else { - removedMap[listIndex] = removedCount; - } - }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. - - keys.forEach(function (key, listIndex) { - var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. - - if (typeof prevListIndex === "undefined") { - added.push(listIndex); - ++addedCount; - } else { - maintained.push([prevListIndex, listIndex]); - removedCount = removedMap[listIndex] || 0; - changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); - fixed.push(listIndex === prevListIndex); - - if (prevListIndex !== listIndex) { - changed.push([prevListIndex, listIndex]); - } - } - }); // Sort by ascending order of 'to(list's index). - - removed.reverse(); - return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); - } - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var ALIGN = { - START: "start", - CENTER: "center", - END: "end", - JUSTIFY: "justify" - }; - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - var INFINITEGRID_EVENTS = ["append", "prepend", "imageError", "change", "layoutComplete"]; // It's for making mistakes. - // Whenever you add a public method, you must add the corresponding method name to an array or object. - // An additional error may occur if not added. - - var INFINITEGRID_METHODS = { - getLoadingBar: true, - getItem: true, - getItems: true, - layout: true, - getGroupKeys: true, - getStatus: true, - setStatus: true, - isProcessing: true, - startLoading: true, - endLoading: true, - isLoading: true, - updateItem: true, - updateItems: true, - moveTo: true - }; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document$1.body[prop] || document$1.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document$1.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function toZeroArray(outline) { - if (!outline || !outline.length) { - return [0]; - } - - return outline; - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function fill(arr, value) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - arr[i] = value; - } - - return arr; - } - function isUndefined$1(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - /** - * Decorator that makes the method of infinitegrid available in the framework. - * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터. - * @memberof eg.InfiniteGrid - * @private - * @example - * ```js - * import NativeInfiniteGrid, { withInfiniteGridMethods } from "@egjs/infinitegrid"; - * - * class InfiniteGrid extends React.Component> { - * @withInfiniteGridMethods - * private infinitegrid: NativeInfiniteGrid; - * } - * ``` - */ - - function withInfiniteGridMethods(prototype, infinitegridName) { - Object.keys(INFINITEGRID_METHODS).forEach(function (name) { - if (prototype[name]) { - return; - } - - prototype[name] = function () { - var args = []; - - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - - var _a; - - var result = (_a = this[infinitegridName])[name].apply(_a, args); // fix `this` type to return your own `infinitegrid` instance to the instance using the decorator. - - - if (result === this[infinitegridName]) { - return this; - } else { - return result; - } - }; - }); - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined$1(start) ? this._groups : this.sliceGroups(start, (isUndefined$1(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document$1.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document$1.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/lazyloaded JavaScript library - @egjs/lazyloaded project is licensed under the MIT license - - - @version 0.0.2 - */ - var isWindow$1 = typeof window !== "undefined"; - var ua$1 = isWindow$1 ? window.navigator.userAgent : ""; - var SUPPORT_COMPUTEDSTYLE$1 = isWindow$1 ? !!("getComputedStyle" in window) : false; - var IS_IE$1 = /MSIE|Trident|Windows Phone|Edge/.test(ua$1); - var SUPPORT_ADDEVENTLISTENER$1 = isWindow$1 ? !!("addEventListener" in document) : false; - var WIDTH = "width"; - var HEIGHT = "height"; - - function getAttribute(el, name) { - return el.getAttribute(name) || ""; - } - - function toArray$1(arr) { - return [].slice.call(arr); - } - - function isDataAttribute(target, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - return !!target.getAttribute(prefix + "width"); - } - - function addEvent$1(element, type, handler) { - if (SUPPORT_ADDEVENTLISTENER$1) { - element.addEventListener(type, handler, false); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - - function removeEvent$1(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - - function innerWidth$1(el) { - return getSize$1(el, "Width"); - } - - function innerHeight$1(el) { - return getSize$1(el, "Height"); - } - - function getStyles$1(el) { - return (SUPPORT_COMPUTEDSTYLE$1 ? window.getComputedStyle(el) : el.currentStyle) || {}; - } - - function getSize$1(el, name) { - var size = el["client" + name] || el["offset" + name]; - return parseFloat(size || getStyles$1(el)[name.toLowerCase()]) || 0; - } - - var elements = []; - - function add(element, prefix) { - !elements.length && addEvent$1(window, "resize", resizeAll); - element.__PREFIX__ = prefix; - elements.push(element); - resize(element); - } - - function remove(element, prefix) { - var index = elements.indexOf(element); - - if (index < 0) { - return; - } - - var fixed = getAttribute(element, prefix + "fixed"); - delete element.__PREFIX__; - element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = ""; - elements.splice(index, 1); - !elements.length && removeEvent$1(window, "resize", resizeAll); - } - - function resize(element, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var elementPrefix = element.__PREFIX__; - - if (typeof elementPrefix !== "string") { - elementPrefix = prefix; - } - - var dataWidth = parseInt(getAttribute(element, "" + elementPrefix + WIDTH), 10) || 0; - var dataHeight = parseInt(getAttribute(element, "" + elementPrefix + HEIGHT), 10) || 0; - var fixed = getAttribute(element, elementPrefix + "fixed"); - - if (fixed === HEIGHT) { - var size = innerHeight$1(element) || dataHeight; - element.style[WIDTH] = dataWidth / dataHeight * size + "px"; - } else { - var size = innerWidth$1(element) || dataWidth; - element.style[HEIGHT] = dataHeight / dataWidth * size + "px"; - } - } - - function resizeAll() { - elements.forEach(function (element) { - resize(element); - }); - } - /** - * @namespace eg.LazyLoaded - */ - - /** - * This module is used to wait for images or videos to load. - * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다. - * @memberof eg.LazyLoaded - * @param - - * @example - * ## HTML - * ```html - *
- * - * - * - * - * - * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * finish: () => console.log("finish"), - * error: e => console.log("error", e), - * }); - * ``` - */ - - - function check(elements, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var component = new Component(); - var finishCount = 0; - var readyCount = 0; - - function checkReady() { - if (--readyCount !== 0) { - return; - } - /** - * An event occurs when the size of all images is available. - * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#ready - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * }); - * ``` - */ - - - component.trigger("ready"); - } - - function checkFinish() { - if (--finishCount !== 0) { - return; - } - /** - * An event occurs when all images have been completed loading. - * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#finish - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * finish: () => console.log("finish"), - * }); - * ``` - */ - - - component.trigger("finish"); - } - - elements.forEach(function (el, i) { - var tagName = el.tagName; - - if (isDataAttribute(el, prefix) && tagName !== "IMG") { - add(el, prefix); - ++finishCount; - setTimeout(function () { - check(toArray$1(el.querySelectorAll("img")), prefix).on("finish", function () { - remove(el, prefix); - checkFinish(); - }); - }); - return; - } - - var images = tagName === "IMG" ? [el] : toArray$1(el.querySelectorAll("img")); - - if (!images.length) { - return; - } - - images.forEach(function (img, j) { - if (img.complete && (!IS_IE$1 || IS_IE$1 && img.naturalWidth)) { - if (!img.naturalWidth) { - setTimeout(function () { - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - }); - } - - return; - } - - if (isDataAttribute(img, prefix)) { - add(img, prefix); - } else { - ++readyCount; - } - - ++finishCount; - - function onError() { - /** - * An event occurs if the image fails to load. - * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다. - * @event eg.LazyLoaded#error - * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트 - * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스 - * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트 - * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스 - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * error: e => { - * //
...
, 0, , 2 - * console.log(e.itemTarget, e.itemIndex, e.target, e.index), - * }, - * }); - * ``` - */ - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - } - - function onCheck(e) { - var target = e.target || e.srcElement; - removeEvent$1(target, "error", onCheck); - removeEvent$1(target, "load", onCheck); - - if (isDataAttribute(target, prefix)) { - remove(target, prefix); - } else { - checkReady(); - } - - if (e.type === "error") { - onError(); - } - - checkFinish(); - } - - addEvent$1(img, "load", onCheck); - addEvent$1(img, "error", onCheck); - IS_IE$1 && img.setAttribute("src", img.getAttribute("src")); - }); - }); - !readyCount && setTimeout(function () { - component.trigger("ready"); - }); - !finishCount && setTimeout(function () { - component.trigger("finish"); - }); - return component; - } - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove$$1 = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - remove(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove$$1, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - var START = ALIGN.START, - CENTER = ALIGN.CENTER, - END = ALIGN.END, - JUSTIFY = ALIGN.JUSTIFY; - /** - * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card. - * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다. - * @class eg.InfiniteGrid.GridLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @example - ``` - - ``` - **/ - - var GridLayout = - /*#__PURE__*/ - function () { - function GridLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - align: START, - itemSize: 0 - }, options); - this._size = 0; - this._columnSize = 0; - this._columnLength = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - var __proto = GridLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.GridLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100, 200, 300, 400]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.GridLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - var _this = this; - - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var firstItem = groups.length && groups[0].items.length && groups[0].items[0]; - this.checkColumn(firstItem); // if outlines' length and columns' length are now same, re-caculate outlines. - - var startOutline; - - if (outline.length !== this._columnLength) { - var pos = outline.length === 0 ? 0 : Math.min.apply(Math, outline); // re-layout items. - - startOutline = fill(new Array(this._columnLength), pos); - } else { - startOutline = outline.slice(); - } - - groups.forEach(function (group) { - var items = group.items; - - var result = _this._layout(items, startOutline, true); - - group.outlines = result; - startOutline = result.end; - }); - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.GridLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto.checkColumn = function (item) { - var _a = this.options, - itemSize = _a.itemSize, - margin = _a.margin, - horizontal = _a.horizontal; - var sizeName = horizontal ? "height" : "width"; - var columnSize = Math.floor(itemSize || item && item.size[sizeName] || 0) || 0; - this._columnSize = columnSize; - - if (!columnSize) { - this._columnLength = 1; - return; - } - - this._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1); - }; - - __proto._layout = function (items, outline, isAppend) { - var _a; - - var length = items.length; - var margin = this.options.margin; - var align = this.options.align; - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - var columnSize = this._columnSize; - var columnLength = this._columnLength; - var size = this._size; - var viewDist = size - (columnSize + margin) * columnLength + margin; - var pointCaculateName = isAppend ? "min" : "max"; - var indexCaculateName = isAppend ? "indexOf" : "lastIndexOf"; - var startOutline = outline.slice(); - var endOutline = outline.slice(); - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline) || 0; - var index = endOutline[indexCaculateName](point); - var item = items[isAppend ? i : length - 1 - i]; - var itemSize = item.size; - - if (!itemSize) { - continue; - } - - var size1 = itemSize[size1Name]; - var size2 = itemSize[size2Name]; - var pos1 = isAppend ? point : point - margin - size1; - var endPos1 = pos1 + size1 + margin; - - if (index === -1) { - index = 0; - } - - var pos2 = (columnSize + margin) * index; // ALIGN - - if (align === CENTER) { - pos2 += viewDist / 2; - } else if (align === END) { - pos2 += viewDist + columnSize - size2; - } else if (align === JUSTIFY) { - if (columnLength <= 1) { - pos2 += viewDist / 2; - } else { - pos2 = (size - columnSize) / (columnLength - 1) * index; - } - } // tetris - - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a); - item.column = index; - endOutline[index] = isAppend ? endPos1 : pos1; - } - - if (!isAppend) { - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } // if append items, startOutline is low, endOutline is high - // if prepend items, startOutline is high, endOutline is low - - - return { - start: isAppend ? startOutline : endOutline, - end: isAppend ? endOutline : startOutline - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } - - var clone = cache ? items : cloneItems(items); - var startOutline = outline; - - if (!this._columnLength) { - this.checkColumn(items[0]); - } - - if (outline.length !== this._columnLength) { - startOutline = fill(new Array(this._columnLength), outline.length ? Math[isAppend ? "min" : "max"].apply(Math, outline) || 0 : 0); - } - - var result = this._layout(clone, startOutline, isAppend); - - return { - items: clone, - outlines: result - }; - }; - - return GridLayout; - }(); - - /* - Frame - [ - [1, 1, 1, 1, 1], - [0, 0, 2, 2, 2], - [0, 0, 2, 2, 2], - [3, 4, 5, 5, 5], - ] - */ - - function disableFrame(frame, type, top, left, width, height) { - for (var i = top; i < top + height; ++i) { - for (var j = left; j < left + width; ++j) { - if (type !== frame[i][j]) { - continue; - } - - frame[i][j] = 0; - } - } - } - - function searchShapeInFrame(frame, type, top, left, width, height) { - var size = { - left: left, - top: top, - type: type, - width: 1, - height: 1 - }; - - for (var i = left; i < width; ++i) { - if (frame[top][i] === type) { - size.width = i - left + 1; - continue; - } - - break; - } - - for (var i = top; i < height; ++i) { - if (frame[i][left] === type) { - size.height = i - top + 1; - continue; - } - - break; - } // After finding the shape, it will not find again. - - - disableFrame(frame, type, top, left, size.width, size.height); - return size; - } - - function getShapes(frame) { - var height = frame.length; - var width = height ? frame[0].length : 0; - var shapes = []; - - for (var i = 0; i < height; ++i) { - for (var j = 0; j < width; ++j) { - var type = frame[i][j]; - - if (!type) { - continue; - } // Separate shapes with other numbers. - - - shapes.push(searchShapeInFrame(frame, type, i, j, width, height)); - } - } - - shapes.sort(function (a, b) { - return a.type < b.type ? -1 : 1; - }); - return { - shapes: shapes, - width: width, - height: height - }; - } - /** - * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm. - * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다. - * @class eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. - * @example - ``` - - ``` - **/ - - - var FrameLayout = - /*#__PURE__*/ - function () { - function FrameLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - itemSize: 0, - frame: [], - frameFill: true - }, options); - var frame = this.options.frame.map(function (row) { - return row.slice(); - }); - this._itemSize = this.options.itemSize || 0; // divide frame into shapes. - - this._shapes = getShapes(frame); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - var __proto = FrameLayout.prototype; - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.FrameLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - - __proto._getItemSize = function () { - this._checkItemSize(); - - return this._itemSize; - }; - - __proto._checkItemSize = function () { - if (this.options.itemSize) { - this._itemSize = this.options.itemSize; - return; - } - - var style = this._style; - var size = style.size2; - var margin = this.options.margin; // if itemSize is not in options, caculate itemSize from size. - - this._itemSize = (this._size + margin) / this._shapes[size] - margin; - }; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var length = items.length; - var style = this._style; - var _b = this.options, - margin = _b.margin, - frameFill = _b.frameFill; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - var itemSize = this._getItemSize(); - - var isItemObject = typeof itemSize === "object"; - var itemSize2 = isItemObject ? itemSize[size2Name] : itemSize; - var itemSize1 = isItemObject ? itemSize[size1Name] : itemSize; - var shapesSize = this._shapes[size2Name]; - var shapes = this._shapes.shapes; - var shapesLength = shapes.length; - var startOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var endOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var dist = 0; - var end = 0; - - if (!shapesLength) { - return { - start: outline, - end: outline - }; - } - - for (var i = 0; i < length; i += shapesLength) { - for (var j = 0; j < shapesLength && i + j < length; ++j) { - var item = items[i + j]; - var shape = shapes[j]; - var shapePos1 = shape[pos1Name]; - var shapePos2 = shape[pos2Name]; - var shapeSize1 = shape[size1Name]; - var shapeSize2 = shape[size2Name]; - var pos1 = end - dist + shapePos1 * (itemSize1 + margin); - var pos2 = shapePos2 * (itemSize2 + margin); - var size1 = shapeSize1 * (itemSize1 + margin) - margin; - var size2 = shapeSize2 * (itemSize2 + margin) - margin; - - for (var k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) { - if (startOutline[k] === DUMMY_POSITION) { - startOutline[k] = pos1; - } - - startOutline[k] = Math.min(startOutline[k], pos1); - endOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin); - } - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - end = Math.max.apply(Math, endOutline); // check dist once - - if (i !== 0) { - continue; - } // find & fill empty block - - - if (!frameFill) { - dist = 0; - continue; - } - - dist = end; - - for (var j = 0; j < shapesSize; ++j) { - if (startOutline[j] === DUMMY_POSITION) { - continue; - } // the dist between frame's end outline and next frame's start outline - // expect that next frame's start outline is startOutline[j] + end - - - dist = Math.min(startOutline[j] + end - endOutline[j], dist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] !== DUMMY_POSITION) { - continue; - } - - startOutline[i] = Math.max.apply(Math, startOutline); - endOutline[i] = startOutline[i]; - } // The target outline is start outline when type is appending - - - var targetOutline = isAppend ? startOutline : endOutline; - var prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? "max" : "min"].apply(Math, outline); - var prevOutlineDist = isAppend ? 0 : end; - - if (frameFill && outline.length === shapesSize) { - prevOutlineDist = -DUMMY_POSITION; - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] === endOutline[i]) { - continue; - } // if appending type is prepend(false), subtract dist from appending group's height. - - - prevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - startOutline[i] += prevOutlineEnd - prevOutlineDist; - endOutline[i] += prevOutlineEnd - prevOutlineDist; - } - - items.forEach(function (item) { - item.rect[pos1Name] += prevOutlineEnd - prevOutlineDist; - }); - return { - start: startOutline.map(function (point) { - return parseInt(point, 10); - }), - end: endOutline.map(function (point) { - return parseInt(point, 10); - }) - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return FrameLayout; - }(); - - function makeShapeOutline(outline, itemSize, columnLength, isAppend) { - var point = Math[isAppend ? "min" : "max"].apply(Math, outline) || 0; - - if (outline.length !== columnLength) { - return fill(new Array(columnLength), 0); - } - - return outline.map(function (l) { - return Math.floor((l - point) / itemSize); - }); - } - - function getColumn(item) { - if (item.column) { - return item.column; - } - - var column = 1; - - if (item.el) { - column = parseInt(item.el.getAttribute("data-column"), 10) || 1; - } - - item.column = column; - return column; - } - /** - * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card. - * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다. - * @class eg.InfiniteGrid.SquareLayout - * @extends eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @example - ``` - - ``` - **/ - - - var SquareLayout = - /*#__PURE__*/ - function (_super) { - __extends(SquareLayout, _super); - - function SquareLayout(options) { - if (options === void 0) { - options = {}; - } - - return _super.call(this, options) || this; - } - - var __proto = SquareLayout.prototype; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - if (isAppend === void 0) { - isAppend = false; - } - - var _a, _b; - - var itemSize = this._getSquareSize(items[0]); - - var margin = this.options.margin; - var columnLength = this.options.column || Math.floor((this._size + margin) / (itemSize + margin)) || 1; - var length = items.length; - var endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend); - var pointCaculateName = isAppend ? "min" : "max"; - var shapes = []; - var sign = isAppend ? 1 : -1; - var style = this._style; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline); - var index = endOutline[isAppend ? "indexOf" : "lastIndexOf"](point); - var item = items[i]; - var columnWidth = item.columnWidth; - var column = columnWidth && columnWidth[0] === columnLength && columnWidth[1] || getColumn(item); - var columnCount = 1; - - if (column > 1) { - for (var j = 1; j < column && (isAppend && index + j < columnLength || !isAppend && index - j >= 0); ++j) { - if (isAppend && endOutline[index + sign * j] <= point || !isAppend && endOutline[index + sign * j] >= point) { - ++columnCount; - continue; - } - - break; - } - - if (!isAppend) { - index -= columnCount - 1; - } - } - - item.columnWidth = [columnLength, columnCount]; - shapes.push((_a = { - width: columnCount, - height: columnCount - }, _a[pos1Name] = point - (!isAppend ? columnCount : 0), _a[pos2Name] = index, _a.type = i + 1, _a.index = i, _a)); - - for (var j = 0; j < columnCount; ++j) { - endOutline[index + j] = point + sign * columnCount; - } - } - - this._shapes = (_b = { - shapes: shapes - }, _b[style.size2] = columnLength, _b); - - var result = _super.prototype._layout.call(this, items, outline, isAppend); - - if (!isAppend) { - shapes.sort(function (shape1, shape2) { - var item1pos1 = shape1[pos1Name]; - var item1pos2 = shape1[pos2Name]; - var item2pos1 = shape2[pos1Name]; - var item2pos2 = shape2[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } - - return result; - }; - - __proto._getSquareSize = function (item) { - var _a = this.options, - column = _a.column, - margin = _a.margin, - itemSize = _a.itemSize; - - if (column) { - // if column is in options, caculate itemSize from column. - this._itemSize = (this._size + margin) / column - margin; - } else if (itemSize) { - this._itemSize = this.options.itemSize; - } else { - var sizeName = this._style.size2; // if frameSize is 0, caculate frameSize from item.size. - - var frameSize = this._shapes[sizeName] || Math.floor((this._size + margin) / (item.size[sizeName] + margin) / getColumn(item)); - this._itemSize = (this._size + margin) / frameSize - margin; - } - - return this._itemSize; - }; - - return SquareLayout; - }(FrameLayout); - - var BoxModel = - /*#__PURE__*/ - function () { - function BoxModel(options) { - assign(this, { - originWidth: 0, - originHeight: 0, - width: 0, - height: 0, - left: 0, - top: 0, - items: [] - }, options); - } - - var __proto = BoxModel.prototype; - - __proto.scaleTo = function (width, height) { - var scaleX = this.width ? width / this.width : 0; - var scaleY = this.height ? height / this.height : 0; - this.items.forEach(function (v) { - if (scaleX !== 0) { - v.left *= scaleX; - v.width *= scaleX; - } - - if (scaleY !== 0) { - v.top *= scaleY; - v.height *= scaleY; - } - }); - this.width = width; - this.height = height; - }; - - __proto.push = function (item) { - this.items.push(item); - }; - - __proto.getOriginSize = function () { - return this.originWidth * this.originHeight; - }; - - __proto.getSize = function () { - return this.width * this.height; - }; - - __proto.getOriginRatio = function () { - return this.originHeight === 0 ? 0 : this.originWidth / this.originHeight; - }; - - __proto.getRatio = function () { - return this.height === 0 ? 0 : this.width / this.height; - }; - - return BoxModel; - }(); - - function getCost(originLength, length) { - var cost = originLength / length; - - if (cost < 1) { - cost = 1 / cost; - } - - return cost - 1; - } - - function fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical) { - item.height = itemFitSize.height; - item.width = itemFitSize.width; - bestFitArea.height = containerFitSize.height; - bestFitArea.width = containerFitSize.width; - - if (layoutVertical) { - item.top = bestFitArea.top + bestFitArea.height; - item.left = bestFitArea.left; - } else { - item.left = bestFitArea.left + bestFitArea.width; - item.top = bestFitArea.top; - } - } - /** - * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion. - * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다. - * @class eg.InfiniteGrid.PackingLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 - * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 - * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 - * @example - ``` - - ``` - **/ - - - var PackingLayout = - /*#__PURE__*/ - function () { - function PackingLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - aspectRatio: 1, - sizeWeight: 1, - ratioWeight: 1 - }, options); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - var __proto = PackingLayout.prototype; - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.PackingLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.PackingLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - - __proto._findBestFitArea = function (container, item) { - if (container.getRatio() === 0) { - // 아이템 최초 삽입시 전체영역 지정 - container.originWidth = item.width; - container.originHeight = item.height; - container.width = item.width; - container.height = item.height; - return; - } - - var bestFitArea; - var minCost = 10000000; - var layoutVertical = false; - var itemFitSize = { - width: 0, - height: 0 - }; - var containerFitSize = { - width: 0, - height: 0 - }; - var _a = this.options, - sizeWeight = _a.sizeWeight, - ratioWeight = _a.ratioWeight; - container.items.forEach(function (v) { - var containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight; - var containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight; - var width = v.width; - var height = v.height; - var cost; - - for (var i = 0; i < 2; ++i) { - var itemWidth = void 0; - var itemHeight = void 0; - var containerWidth = void 0; - var containerHeight = void 0; - - if (i === 0) { - // 상하에 아이템 추가 - itemWidth = width; - itemHeight = height * (item.height / (v.originHeight + item.height)); - containerWidth = width; - containerHeight = height - itemHeight; - } else { - // 좌우에 아이템 추가 - itemHeight = height; - itemWidth = width * (item.width / (v.originWidth + item.width)); - containerHeight = height; - containerWidth = width - itemWidth; - } - - var itemSize = itemWidth * itemHeight; - var itemRatio = itemWidth / itemHeight; - var containerSize = containerWidth * containerHeight; - var containerRatio = containerHeight / containerHeight; - cost = getCost(item.getSize(), itemSize) * sizeWeight; - cost += getCost(item.getRatio(), itemRatio) * ratioWeight; - cost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost; - cost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost; - - if (cost === Math.min(cost, minCost)) { - minCost = cost; - bestFitArea = v; - layoutVertical = i === 0; - itemFitSize.width = itemWidth; - itemFitSize.height = itemHeight; - containerFitSize.width = containerWidth; - containerFitSize.height = containerHeight; - } - } - }); - fitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical); - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - if (outline === void 0) { - outline = []; - } - - var style = this._style; - var _a = this.options, - horizontal = _a.horizontal, - aspectRatio = _a.aspectRatio, - margin = _a.margin; - var pos1Name = style.startPos1; - var containerWidth = this._size * (horizontal ? aspectRatio : 1); - var containerHeight = this._size / (horizontal ? 1 : aspectRatio); - var containerSize1 = horizontal ? containerWidth : containerHeight; - var prevOutline = toZeroArray(outline); - var start = isAppend ? Math.max.apply(Math, prevOutline) : Math.min.apply(Math, prevOutline) - containerSize1 - margin; - var end = start + containerSize1 + margin; - var container = new BoxModel({}); - items.forEach(function (item) { - var _a = item.orgSize, - width = _a.width, - height = _a.height; - var model = new BoxModel({ - width: width, - height: height, - originWidth: width, - originHeight: height - }); - - _this._findBestFitArea(container, model); - - container.push(model); - container.scaleTo(containerWidth + margin, containerHeight + margin); - }); - items.forEach(function (item, i) { - var boxItem = container.items[i]; - var width = boxItem.width; - var height = boxItem.height; - var top = boxItem.top; - var left = boxItem.left; - item.rect = { - top: top, - left: left, - width: width - margin, - height: height - margin - }; - item.rect[pos1Name] += start; - }); - return { - start: [start], - end: [end] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return PackingLayout; - }(); - - /* eslint-disable */ - - /****************************************************************************** - * Created 2008-08-19. - * - * Dijkstra path-finding functions. Adapted from the Dijkstar Python project. - * - * Copyright (C) 2008 - * Wyatt Baldwin - * All rights reserved - * - * Licensed under the MIT license. - * - * http://www.opensource.org/licenses/mit-license.php - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - *****************************************************************************/ - function single_source_shortest_paths(graph, s, d) { - // Predecessor map for each node that has been encountered. - // node ID => predecessor node ID - var predecessors = {}; // Costs of shortest paths from s to all nodes encountered. - // node ID => cost - - var costs = {}; - costs[s] = 0; // Costs of shortest paths from s to all nodes encountered; differs from - // `costs` in that it provides easy access to the node that currently has - // the known shortest path from s. - // XXX: Do we actually need both `costs` and `open`? - - var open = new BinaryHeap(function (x) { - return x.cost; - }); - open.push({ - value: s, - cost: 0 - }); - var closest; - var u; - var cost_of_s_to_u; - var adjacent_nodes; - var cost_of_e; - var cost_of_s_to_u_plus_cost_of_e; - var cost_of_s_to_v; - var first_visit; - - while (open.size()) { - // In the nodes remaining in graph that have a known cost from s, - // find the node, u, that currently has the shortest path from s. - closest = open.pop(); - u = closest.value; - cost_of_s_to_u = closest.cost; // Get nodes adjacent to u... - - adjacent_nodes = graph(u) || {}; // ...and explore the edges that connect u to those nodes, updating - // the cost of the shortest paths to any or all of those nodes as - // necessary. v is the node across the current edge from u. - - for (var v in adjacent_nodes) { - // Get the cost of the edge running from u to v. - cost_of_e = adjacent_nodes[v]; // Cost of s to u plus the cost of u to v across e--this is *a* - // cost from s to v that may or may not be less than the current - // known cost to v. - - cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; // If we haven't visited v yet OR if the current known cost from s to - // v is greater than the new cost we just found (cost of s to u plus - // cost of u to v across e), update v's cost in the cost list and - // update v's predecessor in the predecessor list (it's now u). - - cost_of_s_to_v = costs[v]; - first_visit = typeof costs[v] === "undefined"; - - if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { - costs[v] = cost_of_s_to_u_plus_cost_of_e; - open.push({ - value: v, - cost: cost_of_s_to_u_plus_cost_of_e - }); - predecessors[v] = u; - } - } - } - - if (typeof costs[d] === "undefined") { - var msg = ["Could not find a path from ", s, " to ", d, "."].join(""); - throw new Error(msg); - } - - return predecessors; - } - - function extract_shortest_path_from_predecessor_list(predecessors, d) { - var nodes = []; - var u = d; - - while (u) { - nodes.push(u); - u = predecessors[u]; - } - - nodes.reverse(); - return nodes; - } - - function find_path(graph, s, d) { - var predecessors = single_source_shortest_paths(graph, s, d); - return extract_shortest_path_from_predecessor_list(predecessors, d); - } - - var BinaryHeap = - /*#__PURE__*/ - function () { - function BinaryHeap(scoreFunction) { - this.content = []; - this.scoreFunction = scoreFunction; - } - - var __proto = BinaryHeap.prototype; - - __proto.push = function (element) { - // Add the new element to the end of the array. - this.content.push(element); // Allow it to bubble up. - - this.bubbleUp(this.content.length - 1); - }; - - __proto.pop = function () { - // Store the first element so we can return it later. - var result = this.content[0]; // Get the element at the end of the array. - - var end = this.content.pop(); // If there are any elements left, put the end element at the - // start, and let it sink down. - - if (this.content.length > 0) { - this.content[0] = end; - this.sinkDown(0); - } - - return result; - }; - - __proto.size = function () { - return this.content.length; - }; - - __proto.bubbleUp = function (_n) { - var n = _n; // Fetch the element that has to be moved. - - var element = this.content[n]; // When at 0, an element can not go up any further. - - while (n > 0) { - // Compute the parent element's index, and fetch it. - var parentN = Math.floor((n + 1) / 2) - 1; - var parent = this.content[parentN]; // Swap the elements if the parent is greater. - - if (this.scoreFunction(element) < this.scoreFunction(parent)) { - this.content[parentN] = element; - this.content[n] = parent; // Update 'n' to continue at the new position. - - n = parentN; - } else { - // Found a parent that is less, no need to move it further. - break; - } - } - }; - - __proto.sinkDown = function (n) { - // Look up the target element and its score. - var length = this.content.length; - var element = this.content[n]; - var elemScore = this.scoreFunction(element); - var child1Score; - - while (true) { - // Compute the indices of the child elements. - var child2N = (n + 1) * 2; - var child1N = child2N - 1; // This is used to store the new position of the element, - // if any. - - var swap = null; // If the first child exists (is inside the array)... - - if (child1N < length) { - // Look it up and compute its score. - var child1 = this.content[child1N]; - child1Score = this.scoreFunction(child1); // If the score is less than our element's, we need to swap. - - if (child1Score < elemScore) { - swap = child1N; - } - } // Do the same checks for the other child. - - - if (child2N < length) { - var child2 = this.content[child2N]; - var child2Score = this.scoreFunction(child2); - - if (child2Score < (swap == null ? elemScore : child1Score)) { - swap = child2N; - } - } // If the element needs to be moved, swap it, and continue. - - - if (swap !== null) { - this.content[n] = this.content[swap]; - this.content[swap] = element; - n = swap; - } else { - // Otherwise, we are done. - break; - } - } - }; - - return BinaryHeap; - }(); - - /** - * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size. - * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다. - * @class eg.InfiniteGrid.JustifiedLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 - * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 - * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 - * @example - ``` - - ``` - **/ - - var JustifiedLayout = - /*#__PURE__*/ - function () { - function JustifiedLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - minSize: 0, - maxSize: 0, - column: [1, 8] - }, options); - this._style = getStyleNames(this.options.horizontal); - this._size = 0; - } - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.JustifiedLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - var __proto = JustifiedLayout.prototype; - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.JustifiedLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100]); - */ - - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - - __proto._layout = function (items, outline, isAppend) { - var _this = this; - - var style = this._style; - var size1Name = style.size1; - var size2Name = style.size2; - var startIndex = 0; - var endIndex = items.length; - var column = this.options.column; - var columns = typeof column === "object" ? column : [column, column]; - - var graph = function (_start) { - var results = {}; - var start = +_start.replace(/[^0-9]/g, ""); - var length = endIndex + 1; - - for (var i = Math.min(start + columns[0], length - 1); i < length; ++i) { - if (i - start > columns[1]) { - break; - } - - var cost = _this._getCost(items, start, i, size1Name, size2Name); - - if (cost === null) { - continue; - } - - if (cost < 0 && i === length - 1) { - cost = 0; - } - - results["" + i] = Math.pow(cost, 2); - } - - return results; - }; // shortest path for items' total height. - - - var path = find_path(graph, "" + startIndex, "" + endIndex); - return this._setStyle(items, path, outline, isAppend); - }; - - __proto._getSize = function (items, size1Name, size2Name) { - var margin = this.options.margin; - var size = items.reduce(function (sum, item) { - return sum + item.orgSize[size2Name] / item.orgSize[size1Name]; - }, 0); - return (this._size - margin * (items.length - 1)) / size; - }; - - __proto._getCost = function (items, i, j, size1Name, size2Name) { - var size = this._getSize(items.slice(i, j), size1Name, size2Name); - - var min = this.options.minSize || 0; - var max = this.options.maxSize || Infinity; - - if (isFinite(max)) { - // if this size is not in range, the cost increases sharply. - if (size < min) { - return Math.pow(size - min, 2) + Math.pow(max, 2); - } else if (size > max) { - return Math.pow(size - max, 2) + Math.pow(max, 2); - } else { - // if this size in range, the cost is negative or low. - return Math.min(size - max, min - size); - } - } // if max is infinite type, caculate cost only with "min". - - - if (size < min) { - return Math.max(Math.pow(min, 2), Math.pow(size, 2)); - } - - return size - min; - }; - - __proto._setStyle = function (items, path, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var style = this._style; // if direction is vertical - // startPos1 : top, endPos1 : bottom - // size1 : height - // startPos2 : left, endPos2 : right - // size2 : width - // if direction is horizontal - // startPos1 : left, endPos1 : right - // size1 : width - // startPos2 : top, endPos2 : bottom - // size2 : height - - var pos1Name = style.startPos1; - var size1Name = style.size1; - var pos2Name = style.startPos2; - var size2Name = style.size2; - var length = path.length; - var margin = this.options.margin; - var startPoint = outline[0] || 0; - var endPoint = startPoint; - var height = 0; - - for (var i = 0; i < length - 1; ++i) { - var path1 = parseInt(path[i], 10); - var path2 = parseInt(path[i + 1], 10); // pathItems(path1 to path2) are in 1 line. - - var pathItems = items.slice(path1, path2); - var pathItemsLength = pathItems.length; - - var size1 = this._getSize(pathItems, size1Name, size2Name); - - var pos1 = endPoint; - - for (var j = 0; j < pathItemsLength; ++j) { - var item = pathItems[j]; - var size2 = item.orgSize[size2Name] / item.orgSize[size1Name] * size1; // item has margin bottom and right. - // first item has not margin. - - var prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect; - var pos2 = prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name] + margin : 0; - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - height += margin + size1; - endPoint = startPoint + height; - } - - var itemsLength = items.length; - - if (isAppend) { - // previous group's end outline is current group's start outline - return { - start: [startPoint], - end: [endPoint] - }; - } // for prepend, only substract height from position. - // always start is lower than end. - - - for (var i = 0; i < itemsLength; ++i) { - var item = items[i]; // move items as long as height for prepend - - item.rect[pos1Name] -= height; - } - - return { - start: [startPoint - height], - end: [startPoint] - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return JustifiedLayout; - }(); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - - InfiniteGrid.categorize = categorize; - InfiniteGrid.INFINITEGRID_METHODS = INFINITEGRID_METHODS; - InfiniteGrid.INFINITEGRID_EVENTS = INFINITEGRID_EVENTS; - InfiniteGrid.withInfiniteGridMethods = withInfiniteGridMethods; - InfiniteGrid.CONTAINER_CLASSNAME = CONTAINER_CLASSNAME; - InfiniteGrid.IGNORE_CLASSNAME = IGNORE_CLASSNAME; - InfiniteGrid.DEFAULT_OPTIONS = DEFAULT_OPTIONS; - InfiniteGrid.GridLayout = GridLayout; - InfiniteGrid.FrameLayout = FrameLayout; - InfiniteGrid.SquareLayout = SquareLayout; - InfiniteGrid.PackingLayout = PackingLayout; - InfiniteGrid.JustifiedLayout = JustifiedLayout; - InfiniteGrid.ItemManager = ItemManager; - InfiniteGrid.Infinite = Infinite; - InfiniteGrid.DOMRenderer = DOMRenderer; - InfiniteGrid.default = InfiniteGrid; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.pkgd.js.map diff --git a/dist/infinitegrid.pkgd.js.map b/dist/infinitegrid.pkgd.js.map deleted file mode 100644 index 0eda446bf..000000000 --- a/dist/infinitegrid.pkgd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.pkgd.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/lazyloaded/dist/lazyloaded.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/GridLayout.ts","../src/layouts/FrameLayout.ts","../src/layouts/SquareLayout.ts","../src/layouts/lib/BoxModel.ts","../src/layouts/PackingLayout.ts","../src/layouts/lib/dijkstra.ts","../src/layouts/JustifiedLayout.ts","../src/index.umd.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n this._eventHandler = {};\n this.options = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\nimport FrameLayout from \"./layouts/FrameLayout\";\nimport SquareLayout from \"./layouts/SquareLayout\";\nimport PackingLayout from \"./layouts/PackingLayout\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport ItemManager from \"./ItemManager\";\nimport Infinite from \"./Infinite\";\nimport {\n\tCONTAINER_CLASSNAME, IGNORE_CLASSNAME,\n\tDEFAULT_OPTIONS, INFINITEGRID_METHODS,\n\tINFINITEGRID_EVENTS,\n} from \"./consts\";\nimport { categorize, withInfiniteGridMethods } from \"./utils\";\n\n// fix for IE8\n(InfiniteGrid as any).categorize = categorize;\n(InfiniteGrid as any).INFINITEGRID_METHODS = INFINITEGRID_METHODS;\n(InfiniteGrid as any).INFINITEGRID_EVENTS = INFINITEGRID_EVENTS;\n(InfiniteGrid as any).withInfiniteGridMethods = withInfiniteGridMethods;\n(InfiniteGrid as any).CONTAINER_CLASSNAME = CONTAINER_CLASSNAME;\n(InfiniteGrid as any).IGNORE_CLASSNAME = IGNORE_CLASSNAME;\n(InfiniteGrid as any).DEFAULT_OPTIONS = DEFAULT_OPTIONS;\n(InfiniteGrid as any).GridLayout = GridLayout;\n(InfiniteGrid as any).FrameLayout = FrameLayout;\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n(InfiniteGrid as any).PackingLayout = PackingLayout;\n(InfiniteGrid as any).JustifiedLayout = JustifiedLayout;\n(InfiniteGrid as any).ItemManager = ItemManager;\n(InfiniteGrid as any).Infinite = Infinite;\n(InfiniteGrid as any).DOMRenderer = DOMRenderer;\n(InfiniteGrid as any).default = InfiniteGrid;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","ALIGN","START","CENTER","END","JUSTIFY","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","INFINITEGRID_EVENTS","INFINITEGRID_METHODS","getLoadingBar","getItem","getItems","layout","getGroupKeys","getStatus","setStatus","isProcessing","startLoading","endLoading","isLoading","updateItem","updateItems","moveTo","nodes","array","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","v","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","outline","items","item","jQuery","constructor","jquery","arr","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","infinitegridName","args","result","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","categorize","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","WIDTH","HEIGHT","isDataAttribute","prefix","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkReady","checkFinish","tagName","setTimeout","images","img","j","complete","naturalWidth","itemTarget","onError","onCheck","srcElement","_infinite","_renderer","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","syncElements","watcher","processingStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","scroller","pop","shift","_d","_e","viewSize","isScroll","InfiniteGrid","assignOptions","align","itemSize","_columnSize","_columnLength","_style","getStyleNames","firstItem","checkColumn","startOutline","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","frame","disableFrame","shapes","searchShapeInFrame","frameFill","row","_itemSize","_shapes","getShapes","_checkItemSize","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","l","_getSquareSize","makeShapeOutline","sign","columnWidth","getColumn","columnCount","shape1","shape2","frameSize","FrameLayout","originWidth","originHeight","scaleX","scaleY","originLength","cost","bestFitArea","itemFitSize","containerFitSize","layoutVertical","aspectRatio","sizeWeight","ratioWeight","getRatio","minCost","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemRatio","containerSize","containerRatio","fitArea","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","graph","s","d","predecessors","costs","open","BinaryHeap","closest","u","cost_of_s_to_u","adjacent_nodes","cost_of_e","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","first_visit","msg","Error","single_source_shortest_paths","extract_shortest_path_from_predecessor_list","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","parent","elemScore","child1Score","child2N","child1N","swap","child1","child2","child2Score","minSize","maxSize","columns","_start","results","_getCost","pow","path","find_path","_setStyle","sum","isFinite","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength","withInfiniteGridMethods","GridLayout","SquareLayout","PackingLayout","JustifiedLayout","default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;IASA;;;;IAIA,SAASA,WAAT,CAAqBC,KAArB,EAA4B;IAC1B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;IACD;IACD;;;;;;;IAOA,IAAIC,SAAS;IACb;IACA,YAAY;IACV,MAAIA,SAAS;IACb;IACA,cAAY;IACV;;;;;;;;;;;IAWA;;;IAGA,aAASA,SAAT,GAAqB;IACnB,WAAKC,aAAL,GAAqB,EAArB;IACA,WAAKC,OAAL,GAAe,EAAf;IACD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BA,QAAIC,MAAM,GAAGH,SAAS,CAACI,SAAvB;;IAEAD,IAAAA,MAAM,CAACE,OAAP,GAAiB,SAASA,OAAT,CAAiBC,SAAjB,EAA4BC,WAA5B,EAAyC;IACxD,UAAIA,WAAW,KAAK,KAAK,CAAzB,EAA4B;IAC1BA,QAAAA,WAAW,GAAG,EAAd;IACD;;IAED,UAAIC,WAAW,GAAG,KAAKP,aAAL,CAAmBK,SAAnB,KAAiC,EAAnD;IACA,UAAIG,cAAc,GAAGD,WAAW,CAACE,MAAZ,GAAqB,CAA1C;;IAEA,UAAI,CAACD,cAAL,EAAqB;IACnB,e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A,QAAhC;IACA2F,YAAoB,CAACvP,WAArB,GAAmCA,WAAnC;IACAuP,YAAoB,CAACsK,OAArB,GAA+BtK,YAA/B;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.pkgd.min.js b/dist/infinitegrid.pkgd.min.js deleted file mode 100644 index a067064c2..000000000 --- a/dist/infinitegrid.pkgd.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var l=function(){return(l=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function j(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return st(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return j(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?j(t.toArray(),!0):j(t.get(0),!1),i;if(V(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?H(i):i&&i[0]}function W(t,e,i,n){if(o){var r=n||!1;"object"==typeof n&&(r=!!c&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function D(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function X(t){return(s?u.getComputedStyle(t):t.currentStyle)||{}}function Y(t,e,i){if(st(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=X(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function U(t){return Y(t,"Width",!1)}function Q(t){return Y(t,"Height",!1)}function $(t){return Y(t,"Width",!0)}function J(t){return Y(t,"Height",!0)}function Z(t){return{width:$(t),height:J(t)}}var tt={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function et(t){return tt[t?C:M]}function it(i){for(var t=[],e=1;e=_);++M)++w;i||(m-=w-1)}y.columnWidth=[a,w],f.push(((n={width:w,height:w})[d]=_-(i?0:w),n[g]=m,n.type=v+1,n.index=v,n));for(M=0;Mf[1]);++r){var s=a._getCost(o,i,r,u,h);null!==s&&(s<0&&r===n-1&&(s=0),e[""+r]=Math.pow(s,2))}return e},"0",""+c);return this._setStyle(o,r,t,e)},e._getSize=function(t,i,n){var e=this.options.margin,r=t.reduce(function(t,e){return t+e.orgSize[n]/e.orgSize[i]},0);return(this._size-e*(t.length-1))/r},e._getCost=function(t,e,i,n,r){var s=this._getSize(t.slice(e,i),n,r),o=this.options.minSize||0,a=this.options.maxSize||1/0;return isFinite(a)?s발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { ALIGN } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IAlign, IRectlProperties, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n// ALIGN\nconst { START, CENTER, END, JUSTIFY } = ALIGN;\n\n/**\n * @classdesc The GridLayout is a layout that stacks cards with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new card.\n * @ko GridLayout는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 카드를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 카드 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @class eg.InfiniteGrid.GridLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.GridLayout module eg.InfiniteGrid.GridLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.align=START] Align of the position of the items (START, CENTER, END, JUSTIFY) 아이템들의 위치의 정렬 (START, CENTER, END, JUSTIFY)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @example\n```\n\n```\n **/\nclass GridLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\talign: IAlign[keyof IAlign],\n\t\titemSize: number,\n\t};\n\tprivate _size: number;\n\tprivate _columnSize: number;\n\tprivate _columnLength: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\talign: START,\n\t\t\titemSize: 0,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._columnSize = 0;\n\t\tthis._columnLength = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100, 200, 300, 400]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.GridLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst firstItem = (groups.length && groups[0].items.length && groups[0].items[0]) as IInfiniteGridItem;\n\n\t\tthis.checkColumn(firstItem);\n\n\t\t// if outlines' length and columns' length are now same, re-caculate outlines.\n\t\tlet startOutline: number[];\n\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tconst pos = outline.length === 0 ? 0 : Math.min(...outline);\n\n\t\t\t// re-layout items.\n\t\t\tstartOutline = fill(new Array(this._columnLength), pos);\n\t\t} else {\n\t\t\tstartOutline = outline.slice();\n\t\t}\n\t\tgroups.forEach(group => {\n\t\t\tconst items = group.items;\n\t\t\tconst result = this._layout(items, startOutline, true);\n\n\t\t\tgroup.outlines = result;\n\t\t\tstartOutline = result.end;\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.GridLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.GridLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate checkColumn(item: IInfiniteGridItem) {\n\t\tconst { itemSize, margin, horizontal } = this.options;\n\t\tconst sizeName = horizontal ? \"height\" : \"width\";\n\t\tconst columnSize = Math.floor(itemSize || (item && item.size![sizeName]) || 0) || 0;\n\n\t\tthis._columnSize = columnSize;\n\t\tif (!columnSize) {\n\t\t\tthis._columnLength = 1;\n\t\t\treturn;\n\t\t}\n\t\tthis._columnLength = Math.max(Math.floor((this._size + margin) / (columnSize + margin)), 1);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst margin = this.options.margin;\n\t\tconst align = this.options.align;\n\t\tconst style = this._style;\n\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst columnSize = this._columnSize;\n\t\tconst columnLength = this._columnLength;\n\n\t\tconst size = this._size;\n\t\tconst viewDist = (size - (columnSize + margin) * columnLength + margin);\n\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst indexCaculateName = isAppend ? \"indexOf\" : \"lastIndexOf\";\n\t\tconst startOutline = outline.slice();\n\t\tconst endOutline = outline.slice();\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline) || 0;\n\t\t\tlet index = endOutline[indexCaculateName](point);\n\t\t\tconst item = items[isAppend ? i : length - 1 - i];\n\t\t\tconst itemSize = item.size;\n\n\t\t\tif (!itemSize) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size1 = itemSize[size1Name];\n\t\t\tconst size2 = itemSize[size2Name];\n\t\t\tconst pos1 = isAppend ? point : point - margin - size1;\n\t\t\tconst endPos1 = pos1 + size1 + margin;\n\n\t\t\tif (index === -1) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tlet pos2 = (columnSize + margin) * index;\n\n\t\t\t// ALIGN\n\t\t\tif (align === CENTER) {\n\t\t\t\tpos2 += viewDist / 2;\n\t\t\t} else if (align === END) {\n\t\t\t\tpos2 += viewDist + columnSize - size2;\n\t\t\t} else if (align === JUSTIFY) {\n\t\t\t\tif (columnLength <= 1) {\n\t\t\t\t\tpos2 += viewDist / 2;\n\t\t\t\t} else {\n\t\t\t\t\tpos2 = (size - columnSize) / (columnLength - 1) * index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// tetris\n\t\t\titem.rect = {\n\t\t\t\t[pos1Name as \"top\"]: pos1,\n\t\t\t\t[pos2Name as \"left\"]: pos2,\n\t\t\t};\n\t\t\titem.column = index;\n\t\t\tendOutline[index] = isAppend ? endPos1 : pos1;\n\t\t}\n\t\tif (!isAppend) {\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\t// if append items, startOutline is low, endOutline is high\n\t\t// if prepend items, startOutline is high, endOutline is low\n\t\treturn {\n\t\t\tstart: isAppend ? startOutline : endOutline,\n\t\t\tend: isAppend ? endOutline : startOutline,\n\t\t};\n\t}\n\tprivate _insert(\n\t\titems: IInfiniteGridItem[] = [],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t\tcache?: boolean,\n\t) {\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\tlet startOutline = outline;\n\n\t\tif (!this._columnLength) {\n\t\t\tthis.checkColumn(items[0]);\n\t\t}\n\t\tif (outline.length !== this._columnLength) {\n\t\t\tstartOutline = fill(new Array(this._columnLength), outline.length ? (Math[isAppend ? \"min\" : \"max\"](...outline) || 0) : 0);\n\t\t}\n\n\t\tconst result = this._layout(clone, startOutline, isAppend);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: result,\n\t\t};\n\t}\n}\n\nexport default GridLayout;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","import { assign } from \"../../utils\";\n\nexport interface IBoxModel {\n\toriginWidth: number;\n\toriginHeight: number;\n\twidth: number;\n\theight: number;\n\tleft: number;\n\ttop: number;\n\titems: BoxModel[];\n}\n\nexport default class BoxModel implements IBoxModel {\n\tpublic originWidth: number;\n\tpublic originHeight: number;\n\tpublic width: number;\n\tpublic height: number;\n\tpublic left: number;\n\tpublic top: number;\n\tpublic items: BoxModel[];\n\tconstructor(options: Partial) {\n\t\tassign(this, {\n\t\t\toriginWidth: 0,\n\t\t\toriginHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tleft: 0,\n\t\t\ttop: 0,\n\t\t\titems: [],\n\t\t}, options);\n\t}\n\tpublic scaleTo(width: number, height: number) {\n\t\tconst scaleX = this.width ? width / this.width : 0;\n\t\tconst scaleY = this.height ? height / this.height : 0;\n\n\t\tthis.items.forEach(v => {\n\t\t\tif (scaleX !== 0) {\n\t\t\t\tv.left *= scaleX;\n\t\t\t\tv.width *= scaleX;\n\t\t\t}\n\t\t\tif (scaleY !== 0) {\n\t\t\t\tv.top *= scaleY;\n\t\t\t\tv.height *= scaleY;\n\t\t\t}\n\t\t});\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\tpublic push(item: BoxModel) {\n\t\tthis.items.push(item);\n\t}\n\tpublic getOriginSize() {\n\t\treturn this.originWidth * this.originHeight;\n\t}\n\tpublic getSize() {\n\t\treturn this.width * this.height;\n\t}\n\tpublic getOriginRatio() {\n\t\treturn (this.originHeight === 0) ? 0 : this.originWidth / this.originHeight;\n\t}\n\tpublic getRatio() {\n\t\treturn (this.height === 0) ? 0 : this.width / this.height;\n\t}\n}\n","import BoxModel from \"./lib/BoxModel\";\nimport { getStyleNames, assignOptions, toZeroArray, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\nfunction getCost(originLength: number, length: number) {\n\tlet cost = originLength / length;\n\n\tif (cost < 1) {\n\t\tcost = 1 / cost;\n\t}\n\n\treturn cost - 1;\n}\nfunction fitArea(\n\titem: BoxModel,\n\tbestFitArea: BoxModel,\n\titemFitSize: ISize,\n\tcontainerFitSize: ISize,\n\tlayoutVertical: boolean,\n) {\n\titem.height = itemFitSize.height;\n\titem.width = itemFitSize.width;\n\tbestFitArea.height = containerFitSize.height;\n\tbestFitArea.width = containerFitSize.width;\n\n\tif (layoutVertical) {\n\t\titem.top = bestFitArea.top + bestFitArea.height;\n\t\titem.left = bestFitArea.left;\n\t} else {\n\t\titem.left = bestFitArea.left + bestFitArea.width;\n\t\titem.top = bestFitArea.top;\n\t}\n}\n\n/**\n * @classdesc The PackingLayout is a layout that shows the important cards bigger without sacrificing the weight of the cards. Rows and columns are separated so that cards are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * @ko PackingLayout은 카드의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다. 행과 열이 구분돼 이미지를 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 카드를 배치한다.\n * @class eg.InfiniteGrid.PackingLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.PackingLayout module eg.InfiniteGrid.PackingLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.aspectRatio=1] The aspect ratio of the group 그룹의 가로 세로 비 \n * @param {Boolean} [options.sizeWeight=1] The size weight when placing an image 이미지를 배치할 때 사이즈 가중치 \n * @param {Boolean} [options.ratioWeight=1] The ratio weight when placing an image 이미지를 배치할 때 비율 가중치 \n * @example\n```\n\n```\n **/\nclass PackingLayout implements ILayout {\n\tpublic options: {\n\t\thorizontal: boolean,\n\t\tmargin: number,\n\t\taspectRatio: number,\n\t\tsizeWeight: number,\n\t\tratioWeight: number,\n\t};\n\tprivate _size: number;\n\tprivate _style: IRectlProperties;\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\taspectRatio: 1,\n\t\t\tsizeWeight: 1,\n\t\t\tratioWeight: 1,\n\t\t}, options);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.PackingLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.PackingLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.PackingLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\tprivate _findBestFitArea(container: BoxModel, item: BoxModel) {\n\t\tif (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n\t\t\tcontainer.originWidth = item.width;\n\t\t\tcontainer.originHeight = item.height;\n\t\t\tcontainer.width = item.width;\n\t\t\tcontainer.height = item.height;\n\t\t\treturn;\n\t\t}\n\n\t\tlet bestFitArea!: BoxModel;\n\t\tlet minCost = 10000000;\n\t\tlet layoutVertical = false;\n\t\tconst itemFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst containerFitSize: ISize = {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t};\n\t\tconst { sizeWeight, ratioWeight } = this.options;\n\n\t\tcontainer.items.forEach(v => {\n\t\t\tconst containerSizeCost = getCost(v.getOriginSize(), v.getSize()) * sizeWeight;\n\t\t\tconst containerRatioCost = getCost(v.getOriginRatio(), v.getRatio()) * ratioWeight;\n\t\t\tconst width = v.width;\n\t\t\tconst height = v.height;\n\t\t\tlet cost;\n\n\t\t\tfor (let i = 0; i < 2; ++i) {\n\t\t\t\tlet itemWidth;\n\t\t\t\tlet itemHeight;\n\t\t\t\tlet containerWidth;\n\t\t\t\tlet containerHeight;\n\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// 상하에 아이템 추가\n\t\t\t\t\titemWidth = width;\n\t\t\t\t\titemHeight = height * (item.height / (v.originHeight + item.height));\n\t\t\t\t\tcontainerWidth = width;\n\t\t\t\t\tcontainerHeight = height - itemHeight;\n\t\t\t\t} else {\n\t\t\t\t\t// 좌우에 아이템 추가\n\t\t\t\t\titemHeight = height;\n\t\t\t\t\titemWidth = width * (item.width / (v.originWidth + item.width));\n\t\t\t\t\tcontainerHeight = height;\n\t\t\t\t\tcontainerWidth = width - itemWidth;\n\t\t\t\t}\n\n\t\t\t\tconst itemSize = itemWidth * itemHeight;\n\t\t\t\tconst itemRatio = itemWidth / itemHeight;\n\t\t\t\tconst containerSize = containerWidth * containerHeight;\n\t\t\t\tconst containerRatio = containerHeight / containerHeight;\n\n\t\t\t\tcost = getCost(item.getSize(), itemSize) * sizeWeight;\n\t\t\t\tcost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n\t\t\t\tcost += getCost(v.getOriginSize(), containerSize) * sizeWeight - containerSizeCost;\n\t\t\t\tcost += getCost(v.getOriginRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n\t\t\t\tif (cost === Math.min(cost, minCost)) {\n\t\t\t\t\tminCost = cost;\n\t\t\t\t\tbestFitArea = v;\n\t\t\t\t\tlayoutVertical = (i === 0);\n\t\t\t\t\titemFitSize.width = itemWidth;\n\t\t\t\t\titemFitSize.height = itemHeight;\n\t\t\t\t\tcontainerFitSize.width = containerWidth;\n\t\t\t\t\tcontainerFitSize.height = containerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfitArea(item, bestFitArea, itemFitSize, containerFitSize, layoutVertical);\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst { horizontal, aspectRatio, margin } = this.options;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst containerWidth = this._size * (horizontal ? aspectRatio : 1);\n\t\tconst containerHeight = this._size / (horizontal ? 1 : aspectRatio);\n\t\tconst containerSize1 = horizontal ? containerWidth : containerHeight;\n\t\tconst prevOutline = toZeroArray(outline);\n\t\tconst start = isAppend ? Math.max(...prevOutline) :\n\t\t\tMath.min(...prevOutline) - containerSize1 - margin;\n\t\tconst end = start + containerSize1 + margin;\n\t\tconst container = new BoxModel({});\n\n\t\titems.forEach(item => {\n\t\t\tconst { width, height } = item.orgSize!;\n\t\t\tconst model = new BoxModel({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\toriginWidth: width,\n\t\t\t\toriginHeight: height,\n\t\t\t});\n\n\t\t\tthis._findBestFitArea(container, model);\n\t\t\tcontainer.push(model);\n\t\t\tcontainer.scaleTo(containerWidth + margin, containerHeight + margin);\n\t\t});\n\t\titems.forEach((item, i) => {\n\t\t\tconst boxItem = container.items[i];\n\t\t\tconst width = boxItem.width;\n\t\t\tconst height = boxItem.height;\n\t\t\tconst top = boxItem.top;\n\t\t\tconst left = boxItem.left;\n\n\t\t\titem.rect = { top, left, width: width - margin, height: height - margin };\n\t\t\titem.rect[pos1Name] += start;\n\t\t});\n\n\t\treturn {\n\t\t\tstart: [start],\n\t\t\tend: [end],\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default PackingLayout;\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","import { find_path } from \"./lib/dijkstra\";\nimport { getStyleNames, assignOptions, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, SizeType, IInfiniteGridItem, IInfiniteGridGroup } from \"../types\";\n\n/**\n * @classdesc 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedLayout is a layout that the card is filled up on the basis of a line given a size.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. 용어의 의미대로 너비가 주어진 사이즈를 기준으로 카드가 가득 차도록 배치하는 레이아웃이다.\n * @class eg.InfiniteGrid.JustifiedLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.JustifiedLayout module eg.InfiniteGrid.JustifiedLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Number} [options.minSize=0] Minimum size of item to be resized 아이템이 조정되는 최소 크기 \n * @param {Number} [options.maxSize=0] Maximum size of item to be resized 아이템이 조정되는 최대 크기 \n * @param {Array|Number} [options.column=[1, 8]] The number of items in a line 한 줄에 들어가는 아이템의 개수 \n * @example\n```\n\n```\n **/\nclass JustifiedLayout implements ILayout {\n\tpublic options: {\n\t\tmargin: number;\n\t\tminSize: number;\n\t\tmaxSize: number;\n\t\tcolumn: number | number[];\n\t\thorizontal: boolean;\n\t};\n\tprivate _style: IRectlProperties;\n\tprivate _size: number;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\tminSize: 0,\n\t\t\tmaxSize: 0,\n\t\t\tcolumn: [1, 8],\n\t\t}, options);\n\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t\tthis._size = 0;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.JustifiedLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.JustifiedLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\tprivate _layout(items: IInfiniteGridItem[], outline: number[], isAppend?: boolean) {\n\t\tconst style = this._style;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst startIndex = 0;\n\t\tconst endIndex = items.length;\n\t\tconst column = this.options.column;\n\t\tconst columns: number[] = (typeof column === \"object\") ? column : [column, column];\n\n\t\tconst graph = (_start: string) => {\n\t\t\tconst results: { [key: string]: number } = {};\n\t\t\tconst start = +_start.replace(/[^0-9]/g, \"\");\n\t\t\tconst length = endIndex + 1;\n\n\t\t\tfor (let i = Math.min(start + columns[0], length - 1); i < length; ++i) {\n\t\t\t\tif (i - start > columns[1]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlet cost = this._getCost(items, start, i, size1Name, size2Name);\n\n\t\t\t\tif (cost === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (cost < 0 && i === length - 1) {\n\t\t\t\t\tcost = 0;\n\t\t\t\t}\n\t\t\t\tresults[`${i}`] = Math.pow(cost, 2);\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\t\t// shortest path for items' total height.\n\t\tconst path = find_path(graph, `${startIndex}`, `${endIndex}`);\n\n\t\treturn this._setStyle(items, path, outline, isAppend);\n\t}\n\tprivate _getSize(items: IInfiniteGridItem[], size1Name: SizeType, size2Name: SizeType) {\n\t\tconst margin = this.options.margin;\n\t\tconst size = items.reduce((sum, item) => sum +\n\t\t\t(item.orgSize![size2Name]) / item.orgSize![size1Name], 0);\n\n\t\treturn (this._size - margin * (items.length - 1)) / size;\n\t}\n\tprivate _getCost(\n\t\titems: IInfiniteGridItem[],\n\t\ti: number,\n\t\tj: number,\n\t\tsize1Name: SizeType,\n\t\tsize2Name: SizeType,\n\t) {\n\t\tconst size = this._getSize(items.slice(i, j), size1Name, size2Name);\n\t\tconst min = this.options.minSize || 0;\n\t\tconst max = this.options.maxSize || Infinity;\n\n\t\tif (isFinite(max)) {\n\t\t\t// if this size is not in range, the cost increases sharply.\n\t\t\tif (size < min) {\n\t\t\t\treturn Math.pow(size - min, 2) + Math.pow(max, 2);\n\t\t\t} else if (size > max) {\n\t\t\t\treturn Math.pow(size - max, 2) + Math.pow(max, 2);\n\t\t\t} else {\n\t\t\t\t// if this size in range, the cost is negative or low.\n\t\t\t\treturn Math.min(size - max, min - size);\n\t\t\t}\n\t\t}\n\t\t// if max is infinite type, caculate cost only with \"min\".\n\t\tif (size < min) {\n\t\t\treturn Math.max(Math.pow(min, 2), Math.pow(size, 2));\n\t\t}\n\t\treturn size - min;\n\t}\n\tprivate _setStyle(\n\t\titems: IInfiniteGridItem[],\n\t\tpath: string[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst style = this._style;\n\t\t// if direction is vertical\n\t\t// startPos1 : top, endPos1 : bottom\n\t\t// size1 : height\n\t\t// startPos2 : left, endPos2 : right\n\t\t// size2 : width\n\n\t\t// if direction is horizontal\n\t\t// startPos1 : left, endPos1 : right\n\t\t// size1 : width\n\t\t// startPos2 : top, endPos2 : bottom\n\t\t// size2 : height\n\t\tconst pos1Name = style.startPos1;\n\t\tconst size1Name = style.size1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst size2Name = style.size2;\n\t\tconst length = path.length;\n\t\tconst margin = this.options.margin;\n\t\tconst startPoint = outline[0] || 0;\n\t\tlet endPoint = startPoint;\n\t\tlet height = 0;\n\n\t\tfor (let i = 0; i < length - 1; ++i) {\n\t\t\tconst path1 = parseInt(path[i], 10);\n\t\t\tconst path2 = parseInt(path[i + 1], 10);\n\t\t\t// pathItems(path1 to path2) are in 1 line.\n\t\t\tconst pathItems = items.slice(path1, path2);\n\t\t\tconst pathItemsLength = pathItems.length;\n\t\t\tconst size1 = this._getSize(pathItems, size1Name, size2Name);\n\t\t\tconst pos1 = endPoint;\n\n\t\t\tfor (let j = 0; j < pathItemsLength; ++j) {\n\t\t\t\tconst item = pathItems[j];\n\t\t\t\tconst size2 = item.orgSize![size2Name] / item.orgSize![size1Name] * size1;\n\t\t\t\t// item has margin bottom and right.\n\t\t\t\t// first item has not margin.\n\t\t\t\tconst prevItemRect = j === 0 ? 0 : pathItems[j - 1].rect;\n\t\t\t\tconst pos2 = (prevItemRect ? prevItemRect[pos2Name] + prevItemRect[size2Name]! + margin : 0);\n\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\theight += margin + size1;\n\t\t\tendPoint = startPoint + height;\n\t\t}\n\t\tconst itemsLength = items.length;\n\n\t\tif (isAppend) {\n\t\t\t// previous group's end outline is current group's start outline\n\t\t\treturn {\n\t\t\t\tstart: [startPoint],\n\t\t\t\tend: [endPoint],\n\t\t\t};\n\t\t}\n\t\t// for prepend, only substract height from position.\n\t\t// always start is lower than end.\n\n\t\tfor (let i = 0; i < itemsLength; ++i) {\n\t\t\tconst item = items[i];\n\n\t\t\t// move items as long as height for prepend\n\t\t\titem.rect[pos1Name] -= height;\n\t\t}\n\t\treturn {\n\t\t\tstart: [startPoint - height],\n\t\t\tend: [startPoint], // endPoint - height = startPoint\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default JustifiedLayout;\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport GridLayout from \"./layouts/GridLayout\";\nimport FrameLayout from \"./layouts/FrameLayout\";\nimport SquareLayout from \"./layouts/SquareLayout\";\nimport PackingLayout from \"./layouts/PackingLayout\";\nimport JustifiedLayout from \"./layouts/JustifiedLayout\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport ItemManager from \"./ItemManager\";\nimport Infinite from \"./Infinite\";\nimport {\n\tCONTAINER_CLASSNAME, IGNORE_CLASSNAME,\n\tDEFAULT_OPTIONS, INFINITEGRID_METHODS,\n\tINFINITEGRID_EVENTS,\n} from \"./consts\";\nimport { categorize, withInfiniteGridMethods } from \"./utils\";\n\n// fix for IE8\n(InfiniteGrid as any).categorize = categorize;\n(InfiniteGrid as any).INFINITEGRID_METHODS = INFINITEGRID_METHODS;\n(InfiniteGrid as any).INFINITEGRID_EVENTS = INFINITEGRID_EVENTS;\n(InfiniteGrid as any).withInfiniteGridMethods = withInfiniteGridMethods;\n(InfiniteGrid as any).CONTAINER_CLASSNAME = CONTAINER_CLASSNAME;\n(InfiniteGrid as any).IGNORE_CLASSNAME = IGNORE_CLASSNAME;\n(InfiniteGrid as any).DEFAULT_OPTIONS = DEFAULT_OPTIONS;\n(InfiniteGrid as any).GridLayout = GridLayout;\n(InfiniteGrid as any).FrameLayout = FrameLayout;\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n(InfiniteGrid as any).PackingLayout = PackingLayout;\n(InfiniteGrid as any).JustifiedLayout = JustifiedLayout;\n(InfiniteGrid as any).ItemManager = ItemManager;\n(InfiniteGrid as any).Infinite = Infinite;\n(InfiniteGrid as any).DOMRenderer = DOMRenderer;\n(InfiniteGrid as any).default = InfiniteGrid;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","this","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","win","Result","prevList","list","added","removed","changed","maintained","changedBeforeAdded","fixed","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","orderChanged","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","ALIGN","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","INFINITEGRID_METHODS","getLoadingBar","getItem","getItems","layout","getGroupKeys","getStatus","setStatus","isProcessing","startLoading","endLoading","isLoading","updateItem","updateItems","moveTo","nodes","array","html","match","param","multi","el","isWindow","jQuery","constructor","jquery","toArray","isJQuery","isArray","v","$","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","items","item","arr","newItems","newGroups","groupKeys","groupKey","group","ItemManager","elements","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","insert","categorize","result","removedIndex","nextGroups","addedIndex","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","scrollPos","isForward","endScrollPos","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","IS_IE","WIDTH","HEIGHT","isDataAttribute","prefix","add","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkFinish","tagName","setTimeout","images","img","j","onCheck","srcElement","itemTarget","complete","naturalWidth","_infinite","_renderer","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","syncElements","watcher","processingStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","_renderLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","pop","shift","_d","_e","viewSize","isScroll","InfiniteGrid","START","CENTER","END","JUSTIFY","assignOptions","align","itemSize","_columnSize","_columnLength","_style","getStyleNames","startOutline","firstItem","checkColumn","fill","sizeName","columnSize","floor","size1Name","size2Name","pos1Name","pos2Name","columnLength","viewDist","pointCaculateName","indexCaculateName","endOutline","point","column","sort","a","b","item1pos1","item1pos2","item2pos1","item2pos2","clone","cloneItems","frame","disableFrame","frameFill","row","_itemSize","_shapes","shapes","searchShapeInFrame","getShapes","_checkItemSize","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","_getSquareSize","l","makeShapeOutline","sign","columnWidth","getColumn","columnCount","shape1","shape2","frameSize","FrameLayout","originWidth","originHeight","scaleX","scaleY","originLength","cost","aspectRatio","sizeWeight","ratioWeight","getRatio","bestFitArea","minCost","layoutVertical","itemFitSize","containerFitSize","containerSizeCost","getCost","getOriginSize","containerRatioCost","getOriginRatio","itemWidth","itemHeight","containerWidth","containerHeight","itemRatio","containerSize","containerRatio","fitArea","containerSize1","prevOutline","toZeroArray","BoxModel","model","_findBestFitArea","scaleTo","boxItem","graph","s","d","predecessors","u","extract_shortest_path_from_predecessor_list","costs","closest","cost_of_s_to_u","adjacent_nodes","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","open","BinaryHeap","msg","Error","single_source_shortest_paths","scoreFunction","bubbleUp","sinkDown","_n","n","parentN","parent","child1Score","elemScore","child2N","child1N","swap","child1","child2","minSize","maxSize","columns","path","find_path","_start","results","_getCost","pow","_setStyle","sum","isFinite","startPoint","endPoint","path1","path2","pathItems","pathItemsLength","prevItemRect","itemsLength","INFINITEGRID_EVENTS","withInfiniteGridMethods","infinitegridName","args","GridLayout","SquareLayout","PackingLayout","JustifiedLayout","default"],"mappings":";;;;;;;;mtBAaA,SAASA,EAAYC,eACK,IAAVA,EAShB,IAAIC,EAEJ,eACMA,sBAiBOA,SACFC,cAAgB,QAChBC,QAAU,OA+BbC,EAASH,EAAUI,iBAEvBD,EAAOE,QAAU,SAAiBC,EAAWC,QACvB,IAAhBA,IACFA,EAAc,QAGZC,EAAcC,KAAKR,cAAcK,IAAc,QACT,EAArBE,EAAYE,eAGxB,EAITF,EAAcA,EAAYG,SAC1BJ,EAAYK,UAAYN,MACpBO,GAAa,EACbC,EAAM,CAACP,GACPQ,EAAI,EAERR,EAAYS,KAAO,WACjBH,GAAa,GAGfN,EAAYU,cAAgBR,SAEvB,IAAIS,EAAOC,UAAUT,OAAQU,EAAY,IAAIC,MAAa,EAAPH,EAAWA,EAAO,EAAI,GAAII,EAAO,EAAGA,EAAOJ,EAAMI,IACvGF,EAAUE,EAAO,GAAKH,UAAUG,OAGV,GAApBF,EAAUV,SACZI,EAAMA,EAAIH,OAAOS,IAGdL,EAAI,EAAGP,EAAYO,GAAIA,IAC1BP,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IAAAkgB,sBACpBtc,GAASxN,EAAA7E,KAAK0uB,IAAkBjtB,WAASktB,UAG3Ctc,IAAWrS,KAAK0uB,GACZ1uB,KAEAqS,OexWViS,GAAqBhd,oBAAsBA,EAC3Cgd,GAAqB/c,iBAAmBA,EACxC+c,GAAqBzc,gBAAkBA,EACvCyc,GAAqBsK,WAAaA,GAClCtK,GAAqB0E,YAAcA,GACnC1E,GAAqBuK,aAAeA,GACpCvK,GAAqBwK,cAAgBA,GACrCxK,GAAqByK,gBAAkBA,GACvCzK,GAAqBhV,YAAcA,GACnCgV,GAAqB/F,SAAWA,GAChC+F,GAAqB3Q,YAAcA,GACnC2Q,GAAqB0K,QAAU1K"} \ No newline at end of file diff --git a/dist/infinitegrid.squarelayout.js b/dist/infinitegrid.squarelayout.js deleted file mode 100644 index cab13a8bc..000000000 --- a/dist/infinitegrid.squarelayout.js +++ /dev/null @@ -1,5264 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.InfiniteGrid = factory()); -}(this, (function () { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - - /* global Reflect, Promise */ - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - - return t; - }; - - return __assign.apply(this, arguments); - }; - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/component project is licensed under the MIT license - - @egjs/component JavaScript library - https://naver.github.io/egjs-component - - @version 2.1.2 - */ - - /** - * Copyright (c) 2015 NAVER Corp. - * egjs projects are licensed under the MIT license - */ - function isUndefined(value) { - return typeof value === "undefined"; - } - /** - * A class used to manage events in a component - * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스 - * @alias eg.Component - */ - - - var Component = - /*#__PURE__*/ - function () { - var Component = - /*#__PURE__*/ - function () { - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.Component.VERSION; // ex) 2.0.0 - * @memberof eg.Component - */ - - /** - * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - */ - function Component() { - this._eventHandler = {}; - this.options = {}; - } - /** - * Triggers a custom event. - * @ko 커스텀 이벤트를 발생시킨다 - * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름 - * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터 - * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고 - * @example - class Some extends eg.Component { - some(){ - if(this.trigger("beforeHi")){ // When event call to stop return false. - this.trigger("hi");// fire hi event. - } - } - } - const some = new Some(); - some.on("beforeHi", (e) => { - if(condition){ - e.stop(); // When event call to stop, `hi` event not call. - } - }); - some.on("hi", (e) => { - // `currentTarget` is component instance. - console.log(some === e.currentTarget); // true - }); - // If you want to more know event design. You can see article. - // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F - */ - - - var _proto = Component.prototype; - - _proto.trigger = function trigger(eventName, customEvent) { - if (customEvent === void 0) { - customEvent = {}; - } - - var handlerList = this._eventHandler[eventName] || []; - var hasHandlerList = handlerList.length > 0; - - if (!hasHandlerList) { - return true; - } // If detach method call in handler in first time then handler list calls. - - - handlerList = handlerList.concat(); - customEvent.eventType = eventName; - var isCanceled = false; - var arg = [customEvent]; - var i = 0; - - customEvent.stop = function () { - isCanceled = true; - }; - - customEvent.currentTarget = this; - - for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - restParam[_key - 2] = arguments[_key]; - } - - if (restParam.length >= 1) { - arg = arg.concat(restParam); - } - - for (i = 0; handlerList[i]; i++) { - handlerList[i].apply(this, arg); - } - - return !isCanceled; - }; - /** - * Executed event just one time. - * @ko 이벤트가 한번만 실행된다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - alert("hi"); - } - thing() { - this.once("hi", this.hi); - } - } - var some = new Some(); - some.thing(); - some.trigger("hi"); - // fire alert("hi"); - some.trigger("hi"); - // Nothing happens - */ - - - _proto.once = function once(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var i; - - for (i in eventHash) { - this.once(i, eventHash[i]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var self = this; - this.on(eventName, function listener() { - for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - arg[_key2] = arguments[_key2]; - } - - handlerToAttach.apply(self, arg); - self.off(eventName, listener); - }); - } - - return this; - }; - /** - * Checks whether an event has been attached to a component. - * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다. - * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름 - * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부 - * @example - class Some extends eg.Component { - some() { - this.hasOn("hi");// check hi event. - } - } - */ - - - _proto.hasOn = function hasOn(eventName) { - return !!this._eventHandler[eventName]; - }; - /** - * Attaches an event to a component. - * @ko 컴포넌트에 이벤트를 등록한다. - * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름 - * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.on("hi",this.hi); //attach event - } - } - */ - - - _proto.on = function on(eventName, handlerToAttach) { - if (typeof eventName === "object" && isUndefined(handlerToAttach)) { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.on(name, eventHash[name]); - } - - return this; - } else if (typeof eventName === "string" && typeof handlerToAttach === "function") { - var handlerList = this._eventHandler[eventName]; - - if (isUndefined(handlerList)) { - this._eventHandler[eventName] = []; - handlerList = this._eventHandler[eventName]; - } - - handlerList.push(handlerToAttach); - } - - return this; - }; - /** - * Detaches an event from the component. - * @ko 컴포넌트에 등록된 이벤트를 해제한다 - * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름 - * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수 - * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스 - * @example - class Some extends eg.Component { - hi() { - console.log("hi"); - } - some() { - this.off("hi",this.hi); //detach event - } - } - */ - - - _proto.off = function off(eventName, handlerToDetach) { - // All event detach. - if (isUndefined(eventName)) { - this._eventHandler = {}; - return this; - } // All handler of specific event detach. - - - if (isUndefined(handlerToDetach)) { - if (typeof eventName === "string") { - this._eventHandler[eventName] = undefined; - return this; - } else { - var eventHash = eventName; - var name; - - for (name in eventHash) { - this.off(name, eventHash[name]); - } - - return this; - } - } // The handler of specific event detach. - - - var handlerList = this._eventHandler[eventName]; - - if (handlerList) { - var k; - var handlerFunction; - - for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) { - if (handlerFunction === handlerToDetach) { - handlerList = handlerList.splice(k, 1); - break; - } - } - } - - return this; - }; - - return Component; - }(); - - Component.VERSION = "2.1.2"; - return Component; - }(); - - /* - Copyright (c) 2019-present NAVER Corp. - name: @egjs/list-differ - license: MIT - author: NAVER Corp. - repository: https://github.com/naver/egjs-list-differ - version: 1.0.0 - */ - - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - var PolyMap = - /*#__PURE__*/ - function () { - function PolyMap() { - this.keys = []; - this.values = []; - } - - var __proto = PolyMap.prototype; - - __proto.get = function (key) { - return this.values[this.keys.indexOf(key)]; - }; - - __proto.set = function (key, value) { - var keys = this.keys; - var values = this.values; - var prevIndex = keys.indexOf(key); - var index = prevIndex === -1 ? keys.length : prevIndex; - keys[index] = key; - values[index] = value; - }; - - return PolyMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var HashMap = - /*#__PURE__*/ - function () { - function HashMap() { - this.object = {}; - } - - var __proto = HashMap.prototype; - - __proto.get = function (key) { - return this.object[key]; - }; - - __proto.set = function (key, value) { - this.object[key] = value; - }; - - return HashMap; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - var SUPPORT_MAP = typeof Map === "function"; - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - var Link = - /*#__PURE__*/ - function () { - function Link() {} - - var __proto = Link.prototype; - - __proto.connect = function (prevLink, nextLink) { - this.prev = prevLink; - this.next = nextLink; - prevLink && (prevLink.next = this); - nextLink && (nextLink.prev = this); - }; - - __proto.disconnect = function () { - // In double linked list, diconnect the interconnected relationship. - var prevLink = this.prev; - var nextLink = this.next; - prevLink && (prevLink.next = nextLink); - nextLink && (nextLink.prev = prevLink); - }; - - __proto.getIndex = function () { - var link = this; - var index = -1; - - while (link) { - link = link.prev; - ++index; - } - - return index; - }; - - return Link; - }(); - /* - egjs-list-differ - Copyright (c) 2019-present NAVER Corp. - MIT license - */ - - - function orderChanged(changed, fixed) { - // It is roughly in the order of these examples. - // 4, 6, 0, 2, 1, 3, 5, 7 - var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7 - - var toLinks = []; - changed.forEach(function (_a) { - var from = _a[0], - to = _a[1]; - var link = new Link(); - fromLinks[from] = link; - toLinks[to] = link; - }); // `fromLinks` are connected to each other by double linked list. - - fromLinks.forEach(function (link, i) { - link.connect(fromLinks[i - 1]); - }); - return changed.filter(function (_, i) { - return !fixed[i]; - }).map(function (_a, i) { - var from = _a[0], - to = _a[1]; - - if (from === to) { - return [0, 0]; - } - - var fromLink = fromLinks[from]; - var toLink = toLinks[to - 1]; - var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`. - - fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`. - - if (!toLink) { - fromLink.connect(undefined, fromLinks[0]); - } else { - fromLink.connect(toLink, toLink.next); - } - - var toIndex = fromLink.getIndex(); - return [fromIndex, toIndex]; - }); - } - - var Result = - /*#__PURE__*/ - function () { - function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) { - this.prevList = prevList; - this.list = list; - this.added = added; - this.removed = removed; - this.changed = changed; - this.maintained = maintained; - this.changedBeforeAdded = changedBeforeAdded; - this.fixed = fixed; - } - - var __proto = Result.prototype; - Object.defineProperty(__proto, "ordered", { - get: function () { - if (!this.cacheOrdered) { - this.caculateOrdered(); - } - - return this.cacheOrdered; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(__proto, "pureChanged", { - get: function () { - if (!this.cachePureChanged) { - this.caculateOrdered(); - } - - return this.cachePureChanged; - }, - enumerable: true, - configurable: true - }); - - __proto.caculateOrdered = function () { - var ordered = orderChanged(this.changedBeforeAdded, this.fixed); - var changed = this.changed; - var pureChanged = []; - this.cacheOrdered = ordered.filter(function (_a, i) { - var from = _a[0], - to = _a[1]; - var _b = changed[i], - fromBefore = _b[0], - toBefore = _b[1]; - - if (from !== to) { - pureChanged.push([fromBefore, toBefore]); - return true; - } - }); - this.cachePureChanged = pureChanged; - }; - - return Result; - }(); - /** - * - * @memberof eg.ListDiffer - * @static - * @function - * @param - Previous List 이전 목록 - * @param - List to Update 업데이트 할 목록 - * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다. - * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다. - * @example - * import { diff } from "@egjs/list-differ"; - * // script => eg.ListDiffer.diff - * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e); - * // List before update - * // [1, 2, 3, 4, 5] - * console.log(result.prevList); - * // Updated list - * // [4, 3, 6, 2, 1] - * console.log(result.list); - * // Index array of values added to `list` - * // [0, 1, 5] - * console.log(result.added); - * // Index array of values removed in `prevList` - * // [5] - * console.log(result.removed); - * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list` - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.changed); - * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>) - * // [[4, 3], [3, 4], [2, 6]] - * console.log(result.pureChanged); - * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>) - * // [[4, 1], [4, 2], [4, 3]] - * console.log(result.ordered); - * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved - * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]] - * console.log(result.maintained); - */ - - - function diff(prevList, list, findKeyCallback) { - var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap; - - var callback = findKeyCallback || function (e) { - return e; - }; - - var added = []; - var removed = []; - var maintained = []; - var prevKeys = prevList.map(callback); - var keys = list.map(callback); - var prevKeyMap = new mapClass(); - var keyMap = new mapClass(); - var changedBeforeAdded = []; - var fixed = []; - var removedMap = {}; - var changed = []; - var addedCount = 0; - var removedCount = 0; // Add prevKeys and keys to the hashmap. - - prevKeys.forEach(function (key, prevListIndex) { - prevKeyMap.set(key, prevListIndex); - }); - keys.forEach(function (key, listIndex) { - keyMap.set(key, listIndex); - }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`. - - prevKeys.forEach(function (key, prevListIndex) { - var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed. - - if (typeof listIndex === "undefined") { - ++removedCount; - removed.push(prevListIndex); - } else { - removedMap[listIndex] = removedCount; - } - }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`. - - keys.forEach(function (key, listIndex) { - var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added. - - if (typeof prevListIndex === "undefined") { - added.push(listIndex); - ++addedCount; - } else { - maintained.push([prevListIndex, listIndex]); - removedCount = removedMap[listIndex] || 0; - changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]); - fixed.push(listIndex === prevListIndex); - - if (prevListIndex !== listIndex) { - changed.push([prevListIndex, listIndex]); - } - } - }); // Sort by ascending order of 'to(list's index). - - removed.reverse(); - return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed); - } - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_COMPUTEDSTYLE = !!("getComputedStyle" in win); - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var CONTAINER_CLASSNAME = "_eg-infinitegrid-container_"; - var IGNORE_CLASSNAME = "_eg-infinitegrid-ignore_"; - var TRANSITION_NAME = "_INFINITEGRID_TRANSITION"; - var VERTICAL = "vertical"; - var HORIZONTAL = "horizontal"; - var DUMMY_POSITION = -100000; - var GROUPKEY_ATT = "data-groupkey"; - var DEFAULT_OPTIONS = { - itemSelector: "*", - isOverflowScroll: false, - threshold: 100, - isEqualSize: false, - isConstantSize: false, - useRecycle: true, - horizontal: false, - transitionDuration: 0, - useFit: true, - attributePrefix: "data-", - renderExternal: false - }; - var DEFAULT_LAYOUT_OPTIONS = { - horizontal: false, - margin: 0 - }; - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var IDLE = 0; - var LOADING_APPEND = 1; - var LOADING_PREPEND = 2; - var PROCESSING = 4; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var DEFENSE_BROWSER = WEBKIT_VERSION && WEBKIT_VERSION < 537; - var ITEM_KEYS = ["content", "groupKey", "itemKey", "orgSize", "mounted", "prevRect", "rect", "size"]; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function addEvent(element, type, handler, eventListenerOptions) { - if (SUPPORT_ADDEVENTLISTENER) { - var options = eventListenerOptions || false; - - if (typeof eventListenerOptions === "object") { - options = SUPPORT_PASSIVE ? eventListenerOptions : false; - } - - element.addEventListener(type, handler, options); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - function addOnceEvent(element, type, handler, eventListenerOptions) { - var callback = function (e) { - removeEvent(element, type, callback); - handler(e); - }; - - addEvent(element, type, callback, eventListenerOptions); - } - function scroll(el, horizontal) { - if (horizontal === void 0) { - horizontal = false; - } - - var prop = "scroll" + (horizontal ? "Left" : "Top"); - - if (isWindow(el)) { - return win[horizontal ? "pageXOffset" : "pageYOffset"] || document$1.body[prop] || document$1.documentElement[prop]; - } else { - return el[prop]; - } - } - function scrollTo(el, x, y) { - if (isWindow(el)) { - el.scroll(x, y); - } else { - el.scrollLeft = x; - el.scrollTop = y; - } - } - function scrollBy(el, x, y) { - if (isWindow(el)) { - el.scrollBy(x, y); - } else { - el.scrollLeft += x; - el.scrollTop += y; - } - } - function getStyles(el) { - return (SUPPORT_COMPUTEDSTYLE ? win.getComputedStyle(el) : el.currentStyle) || {}; - } - - function _getSize(el, name, isOffset) { - if (isWindow(el)) { - // WINDOW - return win["inner" + name] || document$1.body["client" + name]; - } else if (isDocument(el)) { - // DOCUMENT_NODE - var doc = el.documentElement; - var body = el.body; - return Math.max(body["scroll" + name], doc["scroll" + name], body["offset" + name], doc["offset" + name], doc["client" + name]); - } else { - // NODE - var size = 0; - - if (isOffset) { - var clientRect = el.getBoundingClientRect(); - size = name === "Width" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top; - } else { - size = el["client" + name] || el["offset" + name]; - } - - if (size) { - return size; - } - - var cssSize = getStyles(el)[name.toLowerCase()]; - return ~cssSize.indexOf("px") && parseFloat(cssSize) || 0; - } - } - - function innerWidth(el) { - return _getSize(el, "Width", false); - } - function innerHeight(el) { - return _getSize(el, "Height", false); - } - function outerWidth(el) { - return _getSize(el, "Width", true); - } - function outerHeight(el) { - return _getSize(el, "Height", true); - } - function getSize(el) { - return { - width: outerWidth(el), - height: outerHeight(el) - }; - } - var STYLE = { - vertical: { - startPos1: "top", - endPos1: "bottom", - size1: "height", - startPos2: "left", - endPos2: "right", - size2: "width" - }, - horizontal: { - startPos1: "left", - endPos1: "right", - size1: "width", - startPos2: "top", - endPos2: "bottom", - size2: "height" - } - }; - function getStyleNames(isHorizontal) { - return STYLE[isHorizontal ? HORIZONTAL : VERTICAL]; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function assignOptions(defaultOptions, options) { - return assign({}, DEFAULT_LAYOUT_OPTIONS, defaultOptions, options); - } - function cloneItems(items) { - return items.map(function (item) { - return assign({}, item); - }); - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - function isDocument(el) { - return el.nodeType === 9; - } - function fill(arr, value) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - arr[i] = value; - } - - return arr; - } - function isUndefined$1(target) { - return typeof target === "undefined"; - } - function find(arr, callback) { - var length = arr.length; - - for (var i = 0; i < length; ++i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function findLast(arr, callback) { - var length = arr.length; - - for (var i = length - 1; i >= 0; --i) { - if (callback(arr[i])) { - return arr[i]; - } - } - - return null; - } - function categorize(newItems) { - var newGroups = []; - var groupKeys = {}; - newItems.forEach(function (item) { - var groupKey = item.groupKey; - var group = groupKeys[groupKey]; - - if (!group) { - group = { - groupKey: groupKey, - items: [] - }; - groupKeys[groupKey] = group; - newGroups.push(group); - } - - group.items.push(item); - }); - return newGroups; - } - function resetSize(item) { - item.orgSize = null; - item.size = null; - } - function makeItem(groupKey, el) { - return { - el: el, - groupKey: groupKey, - mounted: false, - content: el ? el.outerHTML : "", - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }; - } - function hasClass(element, className) { - if (element.classList) { - return element.classList.contains(className); - } - - return !!element.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)")); - } - function addClass(element, className) { - if (element.classList) { - element.classList.add(className); - } else { - element.className += " " + className; - } - } - - var ItemManager = - /*#__PURE__*/ - function () { - function ItemManager() { - // groups - this._groups = []; // group keys - - this._groupKeys = {}; - } - - var __proto = ItemManager.prototype; - - ItemManager.toItems = function (elements, groupKey) { - return elements.map(function (el) { - return makeItem(groupKey, el); - }); - }; - - ItemManager.pluck = function (data, property) { - return data.reduce(function (acc, v) { - return acc.concat(v[property]); - }, []); - }; - - __proto.clear = function () { - this._groups = []; - this._groupKeys = {}; - }; - - __proto.getStatus = function (startKey, endKey) { - var datas = this._groups; - var startIndex = Math.max(this.indexOf(startKey), 0); - var endIndex = this.indexOf(endKey) + 1 || datas.length; - return { - _data: datas.slice(startIndex, endIndex).map(function (data) { - var items = data.items.map(function (item) { - var item2 = {}; - ITEM_KEYS.forEach(function (key) { - if (key in item) { - item2[key] = item[key]; - } - }); - return item2; - }); - var data2 = assign({}, data); - data2.items = items; - return data2; - }) - }; - }; - - __proto.setStatus = function (status) { - var _this = this; - - var data = status._data; - this.clear(); - data.forEach(function (group, i) { - _this.insertGroup(group, i); - }); - }; - - __proto.size = function () { - return this._groups.length; - }; - - __proto.fit = function (base, horizontal) { - var groups = this._groups; - - if (!groups.length) { - return; - } - - var property = horizontal ? "left" : "top"; - - if (base !== 0) { - groups.forEach(function (group) { - var items = group.items, - outlines = group.outlines; - items.forEach(function (item) { - item.rect[property] -= base; - }); - outlines.start = outlines.start.map(function (start) { - return start - base; - }); - outlines.end = outlines.end.map(function (end) { - return end - base; - }); - }); - } - }; - - __proto.pluck = function (property, start, end) { - var data = isUndefined$1(start) ? this._groups : this.sliceGroups(start, (isUndefined$1(end) ? start : end) + 1); - return ItemManager.pluck(data, property); - }; - - __proto.getOutline = function (index, property) { - var data = this._groups[index]; - return data ? data.outlines[property] : []; - }; - - __proto.getEdgeIndex = function (cursor, start, end) { - var prop = cursor === "start" ? "min" : "max"; - var index = -1; - var targetValue = cursor === "start" ? Infinity : -Infinity; - - for (var i = start; i <= end; i++) { - var value = Math[prop].apply(Math, this.getOutline(i, cursor)); - - if (cursor === "start" && targetValue > value || cursor === "end" && targetValue < value) { - targetValue = value; - index = i; - } - } - - return index; - }; - - __proto.getEdgeValue = function (cursor, start, end) { - var group = this.getGroup(this.getEdgeIndex(cursor, start, end)); - - if (group) { - var outlines = group.outlines[cursor]; - - if (outlines.length) { - return Math[cursor === "start" ? "min" : "max"].apply(Math, outlines); - } - } - - return 0; - }; - - __proto.clearOutlines = function (startCursor, endCursor) { - if (startCursor === void 0) { - startCursor = -1; - } - - if (endCursor === void 0) { - endCursor = -1; - } - - var datas = this.getGroups(); - datas.forEach(function (group, cursor) { - if (startCursor <= cursor && cursor <= endCursor) { - return; - } - - group.items.forEach(function (item) { - item.rect.top = DUMMY_POSITION; - item.rect.left = DUMMY_POSITION; - }); - group.outlines.start = []; - group.outlines.end = []; - }); - }; - - __proto.getMaxEdgeValue = function () { - var groups = this._groups; - var length = groups.length; - - for (var i = length - 1; i >= 0; --i) { - var end = groups[i].outlines.end; - - if (end.length) { - var pos = Math.max.apply(Math, end); - return pos; - } - } - - return 0; - }; - - __proto.prependGroup = function (group) { - return this.insertGroup(group, 0); - }; - - __proto.appendGroup = function (group) { - return this.insertGroup(group, this._groups.length); - }; - - __proto.insertGroup = function (group, groupIndex) { - var _this = this; - - if (groupIndex < 0) { - return null; - } - - var prevItems = group.items || []; - - var newGroup = __assign({ - outlines: { - start: [], - end: [] - } - }, group, { - items: [] - }); - - this._groups.splice(groupIndex, 0, newGroup); - - this._groupKeys[newGroup.groupKey] = newGroup; - prevItems.forEach(function (item, i) { - _this.insert(item, groupIndex, i); - }); - return newGroup; - }; - - __proto.sync = function (items) { - var _this = this; - - var groups = this._groups; - var groupKeys = this._groupKeys; - var newGroups = categorize(items); - var result = diff(groups, newGroups, function (group) { - return group.groupKey; - }); - var removed = result.removed, - added = result.added, - maintained = result.maintained; - removed.forEach(function (removedIndex) { - var group = groups[removedIndex]; - - if (!group) { - return; - } - - delete groupKeys[group.groupKey]; - }); - var nextGroups = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0]; - nextGroups.push(groups[fromIndex]); - }); - this._groups = nextGroups; - added.forEach(function (addedIndex) { - _this.insertGroup(newGroups[addedIndex], addedIndex); - }); - maintained.reverse().forEach(function (_a) { - var toIndex = _a[1]; - - _this.syncItems(toIndex, newGroups[toIndex].items); - }); - return result; - }; - - __proto.insert = function (newItem, groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = -1; - } - - if (itemIndex === void 0) { - itemIndex = -1; - } - - var groupKey = newItem.groupKey; - var groups = this._groups; - var groupKeys = this._groupKeys; - var group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey]) || this.insertGroup({ - groupKey: groupKey - }, groupIndex); - - if (!group) { - return null; - } - - var groupItem = __assign({ - content: "", - mounted: false, - rect: { - top: DUMMY_POSITION, - left: DUMMY_POSITION - } - }, newItem); - - var groupItems = group.items; - - if (itemIndex === -1) { - groupItems.push(groupItem); - } else { - groupItems.splice(itemIndex, 0, groupItem); - } - - return groupItem; - }; - - __proto.removeGroup = function (groupIndex) { - var group = this._groups.splice(groupIndex, 1)[0]; - - if (!group) { - return null; - } - - delete this._groupKeys[group.groupKey]; - return group; - }; - - __proto.remove = function (groupIndex, itemIndex) { - var data = this.getGroup(groupIndex); - var group = null; - var items = []; - - if (!data) { - return { - items: items, - group: group - }; - } // remove item information - - - items = data.items.splice(itemIndex, 1); - - if (!data.items.length) { - group = this.removeGroup(groupIndex); - } - - return { - items: items, - group: group - }; - }; - - __proto.indexOf = function (data) { - if (typeof data === "undefined") { - return -1; - } - - var groupKey = "" + (typeof data === "object" ? data.groupKey : data); - var datas = this._groups; - var length = datas.length; - - for (var i = 0; i < length; ++i) { - if (groupKey === "" + datas[i].groupKey) { - return i; - } - } - - return -1; - }; - - __proto.indexesOfElement = function (element) { - var groupKey = element.getAttribute(GROUPKEY_ATT); - var groupIndex = this.indexOf({ - groupKey: groupKey - }); - var itemIndex = -1; - - if (groupIndex > -1) { - var data = this.getGroup(groupIndex); - var length = data.items.length; - - for (var i = 0; i < length; i++) { - if (data.items[i].el === element) { - itemIndex = i; - break; - } - } - } - - return { - groupIndex: groupIndex, - itemIndex: itemIndex - }; - }; - - __proto.sliceGroups = function (start, end) { - return this._groups.slice(start, end); - }; - - __proto.getGroups = function () { - return this._groups; - }; - - __proto.getGroupByKey = function (key) { - return this._groupKeys[key]; - }; - - __proto.getGroup = function (index) { - return this._groups[index]; - }; - - __proto.syncItems = function (groupIndex, newItems) { - var _this = this; - - if (!newItems.length) { - this.removeGroup(groupIndex); - return; - } - - var items = this.getGroup(groupIndex).items; - - var _a = diff(items, newItems, function (item) { - return item.itemKey; - }), - added = _a.added, - maintained = _a.maintained; - - var group = this._groups[groupIndex]; - var nextItems = []; - maintained.forEach(function (_a) { - var fromIndex = _a[0], - nextIndex = _a[1]; - var item = items[fromIndex]; - var newItem = newItems[nextIndex]; - assign(item, newItem); - nextItems.push(item); - }); - group.items = nextItems; - added.forEach(function (addedIndex) { - _this.insert(newItems[addedIndex], groupIndex, addedIndex); - }); - }; - - return ItemManager; - }(); - - function removeTransition(styles) { - styles[TRANSITION + "-property"] = ""; - styles[TRANSITION + "-duration"] = ""; - styles[TRANSFORM] = ""; - } - - function setTransition(styles, transitionDuration, pos1, pos2) { - if (!transitionDuration) { - removeTransition(styles); - return false; - } - - if (pos1.left === pos2.left && pos1.top === pos2.top) { - return false; - } - - styles[TRANSITION + "-property"] = TRANSFORM + ",width,height"; - styles[TRANSITION + "-duration"] = transitionDuration + "s"; - styles[TRANSFORM] = "translate(" + (pos1.left - pos2.left) + "px," + (pos1.top - pos2.top) + "px)"; - return true; - } - - function createContainer(element) { - var selectContainer = element.querySelector("." + CONTAINER_CLASSNAME); - - if (selectContainer) { - selectContainer.style.position = "relative"; - selectContainer.style.height = "100%"; - return selectContainer; - } - - var container = document$1.createElement("div"); - container.className = CONTAINER_CLASSNAME; - container.style.position = "relative"; - container.style.height = "100%"; - var children = element.children; - var length = children.length; // for IE8 - - for (var i = 0; i < length; i++) { - container.appendChild(children[0]); - } - - element.appendChild(container); - return container; - } - - function render(properties, rect, styles) { - properties.forEach(function (p) { - p in rect && (styles[p] = rect[p] + "px"); - }); - } - - var DOMRenderer = - /*#__PURE__*/ - function () { - function DOMRenderer(element, options) { - this.options = { - isEqualSize: false, - isConstantSize: false, - horizontal: false, - container: false - }; - this._size = { - container: -1, - view: -1, - viewport: -1, - item: null - }; - this._orgStyle = {}; - assign(this.options, options); - - this._init(element); - - this.resize(); - } - - var __proto = DOMRenderer.prototype; - - DOMRenderer.renderItem = function (item, rect, transitionDuration) { - if (!item.el) { - return; - } - - var el = item.el, - prevRect = item.prevRect; - var styles = el.style; // for debugging - - el.setAttribute(GROUPKEY_ATT, "" + item.groupKey); - styles.position = "absolute"; - render(["width", "height"], rect, styles); - - if (transitionDuration && TRANSITION && prevRect) { - setTransition(styles, transitionDuration, rect, prevRect); - - if (el[TRANSITION_NAME]) { - return; - } - - el[TRANSITION_NAME] = true; - addOnceEvent(el, TRANSITION_END, function () { - var itemRect = item.rect; - removeTransition(styles); - render(["left", "top"], itemRect, styles); - item.prevRect = itemRect; - el[TRANSITION_NAME] = false; - }); - } else { - render(["left", "top"], rect, styles); - item.prevRect = rect; - } - }; - - DOMRenderer.renderItems = function (items, transitionDuration) { - items.forEach(function (item) { - DOMRenderer.renderItem(item, item.rect, transitionDuration); - }); - }; - - DOMRenderer.removeItems = function (items) { - items.forEach(function (item) { - if (item.el) { - DOMRenderer.removeElement(item.el); - item.el = null; - } - }); - }; - - DOMRenderer.removeElement = function (element) { - var parentNode = element && element.parentNode; - - if (!parentNode) { - return; - } - - parentNode.removeChild(element); - }; - - DOMRenderer.createElements = function (items) { - if (!items.length) { - return; - } - - var noElementItems = items.filter(function (item) { - return !item.el; - }); - - if (!noElementItems.length) { - return; - } - - var elements = $(noElementItems.map(function (_a) { - var content = _a.content; - return content.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""); - }).join(""), true); - noElementItems.forEach(function (item, index) { - item.el = elements[index]; - }); - }; - - __proto.getStatus = function () { - return { - cssText: this.container.style.cssText, - _size: assign({}, this._size) - }; - }; - - __proto.setStatus = function (status) { - this.container.style.cssText = status.cssText; - assign(this._size, status._size); - }; - - __proto.updateSize = function (items) { - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var size = this._size; - return items.map(function (item) { - if (!item.el) { - return item; - } - - if (isEqualSize && !size.item) { - size.item = getSize(item.el); - } - - item.size = isEqualSize && assign({}, size.item) || isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize) || getSize(item.el); - - if (!item.orgSize || !item.orgSize.width || !item.orgSize.height) { - item.orgSize = assign({}, item.size); - } - - return item; - }); - }; - - __proto.createAndInsert = function (items, isAppend) { - DOMRenderer.createElements(items); - DOMRenderer.renderItems(items); - - this._insert(items, isAppend); - }; - - __proto.getViewSize = function () { - return this._size.view; - }; - - __proto.getViewportSize = function () { - return this._size.viewport; - }; - - __proto.getContainerSize = function () { - return this._size.container; - }; - - __proto.setContainerSize = function (size) { - this._size.container = size; - this.container.style[this.options.horizontal ? "width" : "height"] = size + "px"; - }; - - __proto.resize = function () { - var horizontal = this.options.horizontal; - var view = this.view; - - var size = this._calcSize(); - - if (size === 0) { - return; - } - - var isResize = size !== this._size.viewport; - - if (isResize) { - this._size = { - view: -1, - container: -1, - viewport: size, - item: null - }; - } - - this._size.view = horizontal ? innerWidth(view) : innerHeight(view); - return isResize; - }; - - __proto.isNeededResize = function () { - return this._calcSize() !== this._size.viewport; - }; - - __proto.clear = function () { - this.container.innerHTML = ""; - this.container.style[this.options.horizontal ? "width" : "height"] = ""; - this._size = { - item: null, - viewport: -1, - container: -1, - view: -1 - }; - }; - - __proto.destroy = function () { - this.clear(); - var container = this.options.container; - var property; - - for (property in this._orgStyle) { - this[container ? "view" : "container"].style[property] = this._orgStyle[property]; - } - - container && this.container.parentNode.removeChild(this.container); - }; - - __proto._init = function (el) { - var element = $(el); - var style = getStyles(element); - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - - if (style.position === "static") { - this._orgStyle.position = element.style.position; - element.style.position = "relative"; - } - - if (container) { - var target = horizontal ? ["X", "Y"] : ["Y", "X"]; - this._orgStyle.overflowX = element.style.overflowX; - this._orgStyle.overflowY = element.style.overflowY; - element.style["overflow" + target[0]] = "scroll"; - element.style["overflow" + target[1]] = "hidden"; - this.view = element; - this.container = container === true ? createContainer(this.view) : container; - } else { - this.view = win; - this.container = element; - } - }; - - __proto._insert = function (items, isAppend, styles) { - var container = this.container; - var df = document$1.createDocumentFragment(); - items.forEach(function (item) { - styles && DOMRenderer.renderItem(item, styles); - isAppend ? df.appendChild(item.el) : df.insertBefore(item.el, df.firstChild); - }); - isAppend ? container.appendChild(df) : container.insertBefore(df, container.firstChild); - }; - - __proto._calcSize = function () { - return this.options.horizontal ? innerHeight(this.container) : innerWidth(this.container); - }; - - return DOMRenderer; - }(); - - function isVisible(group, threshold, scrollPos, endScrollPos) { - var items = group.items, - outlines = group.outlines; - var start = outlines.start; - var end = outlines.end; - - if (start.length === 0 || end.length === 0 || !items.length || !items[0].el) { - return 2; - } - - var min = Math.min.apply(Math, start); - var max = Math.max.apply(Math, end); - - if (endScrollPos + threshold < min) { - return +1; - } else if (scrollPos - threshold > max) { - return -1; - } - - return 0; - } - - var Infinite = - /*#__PURE__*/ - function () { - function Infinite(itemManger, options) { - this.options = assign({ - useRecycle: true, - threshold: 100, - append: function () { - return void 0; - }, - prepend: function () { - return void 0; - }, - recycle: function () { - return void 0; - } - }, options); - this._itemManager = itemManger; - this.clear(); - } - - var __proto = Infinite.prototype; - - __proto.setSize = function (size) { - this._status.size = size; - }; - - __proto.sync = function (items) { - var status = this._status; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var itemManager = this._itemManager; - var prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1); - var prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, "items"); - var result = itemManager.sync(items); - var startGroup = find(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var endGroup = findLast(prevVisisbleGroups, function (_a) { - var groupKey = _a.groupKey; - return itemManager.getGroupByKey(groupKey); - }); - var nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1; - var nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1; - - if (nextStartCursor > -1 && nextEndCursor > -1) { - // This is when the arrangement is inverted. - // prevVisisbleGroups is [0, 1, 2, 3] - // but currentGroups is [3, 2, 1, 0] - // so, nextStartCursor is 3, and nextEndCursor is 0 - var minCursor = Math.min(nextStartCursor, nextEndCursor); - var maxCursor = Math.max(nextStartCursor, nextEndCursor); - nextStartCursor = minCursor; - nextEndCursor = maxCursor; - } else if (nextEndCursor > -1) { - nextStartCursor = nextEndCursor; - } else if (nextStartCursor > -1) { - nextEndCursor = nextStartCursor; - } - - status.startCursor = nextStartCursor; - status.endCursor = nextEndCursor; - - if (result.removed.length > 0) { - return "relayout"; - } else { - var nextVisibleItems = itemManager.pluck("items", startCursor, endCursor); - var visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, function (_a) { - var itemKey = _a.itemKey; - return itemKey; - }); - - if (visibleDiffResult.removed.length > 0) { - return "layout"; - } else { - return ""; - } - } - }; - - __proto.recycle = function (scrollPos, isForward) { - if (!this.options.useRecycle || typeof scrollPos !== "number") { - return; - } - - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - - if (startCursor === -1 || endCursor === -1) { - return; - } - - var endScrollPos = scrollPos + size; - var _b = this.options, - threshold = _b.threshold, - recycle = _b.recycle; - - var visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1).map(function (group) { - return isVisible(group, threshold, scrollPos, endScrollPos); - }); - - var length = visibles.length; - var start = isForward ? 0 : visibles.lastIndexOf(0); - var end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1; - - if (!isForward && start !== -1) { - start += 1; - } - - if (start < 0 || end < 0 || start > end || end - start + 1 >= length) { - return; - } - - start = startCursor + start; - end = startCursor + end; - - if (isForward) { - this.setCursor("start", end + 1); - } else { - this.setCursor("end", start - 1); - } - - recycle({ - start: start, - end: end - }); - }; - - __proto.scroll = function (scrollPos) { - var _a = this.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var items = this._itemManager; - - if (typeof scrollPos !== "number" || startCursor === -1 || endCursor === -1 || !items.size()) { - return; - } - - var size = this._status.size; - var _b = this.options, - threshold = _b.threshold, - append = _b.append, - prepend = _b.prepend; - var datas = items.getGroups(); - var endScrollPos = scrollPos + size; - var startEdgePos = Math.max.apply(Math, datas[startCursor].outlines.start); - var endEdgePos = Math.min.apply(Math, datas[endCursor].outlines.end); - var visibles = datas.map(function (group, i) { - var _a = group.outlines, - start = _a.start, - end = _a.end; - - if (!start.length || !end.length) { - return false; - } - - var startPos = Math.min.apply(Math, start); - var endPos = Math.max.apply(Math, end); - - if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) { - return true; - } - - return false; - }); - var startIndex = visibles.indexOf(true); - var endIndex = visibles.lastIndexOf(true); - - if (~startIndex && startIndex < startCursor) { - prepend({ - cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) - }); - } else if (endCursor < endIndex) { - append({ - cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) - }); - } else { - // if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it. - var cachedAppendData = datas.slice(endCursor + 1, endCursor + 2); - var cachedPrependData = datas.slice(startCursor - 1, startCursor); - var isPrepend = scrollPos <= startEdgePos + threshold; - - if (endScrollPos >= endEdgePos - threshold && (!isPrepend || cachedAppendData.length || !cachedPrependData.length)) { - append({ - cache: cachedAppendData - }); - } else if (isPrepend) { - prepend({ - cache: cachedPrependData - }); - } - } - }; - - __proto.setCursor = function (cursor, index) { - var status = this._status; - var items = this._itemManager; - var size = items.size(); - - if (!this.options.useRecycle) { - status.startCursor = 0; - - if (items.getOutline(size - 1, "end").length) { - status.endCursor = size - 1; - return; - } - - if (cursor !== "end") { - return; - } - } - - if (cursor === "start") { - status.startCursor = index; - } else { - status.endCursor = Math.min(size - 1, index); - } - - status.startCursor = Math.max(0, status.startCursor); - }; - - __proto.setStatus = function (status) { - this._status = assign(this._status, status); - }; - - __proto.getStatus = function (startKey, endKey) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor, - size = _a.size; - var startIndex = Math.max(this._itemManager.indexOf(startKey), 0); - var endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1; - var start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1); - var end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start); - return { - startCursor: start, - endCursor: end, - size: size - }; - }; - - __proto.getEdgeOutline = function (cursor) { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - - if (startCursor === -1 || endCursor === -1) { - return []; - } - - return this._itemManager.getOutline(cursor === "start" ? startCursor : endCursor, cursor); - }; - - __proto.getEdgeValue = function (cursor) { - var outlines = this.getEdgeOutline(cursor); - return outlines.length ? Math[cursor === "start" ? "min" : "max"].apply(Math, outlines) : 0; - }; - - __proto.getVisibleItems = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.pluck("items", startCursor, endCursor); - }; - - __proto.getCursors = function () { - var status = this._status; - return [status.startCursor, status.endCursor]; - }; - - __proto.getCursor = function (cursor) { - return this._status[cursor === "start" ? "startCursor" : "endCursor"]; - }; - - __proto.getVisibleData = function () { - var _a = this._status, - startCursor = _a.startCursor, - endCursor = _a.endCursor; - return this._itemManager.sliceGroups(startCursor, endCursor + 1); - }; - - __proto.remove = function (groupIndex, itemIndex) { - var status = this._status; - var items = this._itemManager; - var startCursor = status.startCursor, - endCursor = status.endCursor; - var result = items.remove(groupIndex, itemIndex); - - if (result.group) { - if (groupIndex < startCursor) { - this.setCursor("start", startCursor - 1); - } - - if (groupIndex <= endCursor) { - this.setCursor("end", endCursor - 1); - } - } - - if (!items.size()) { - status.startCursor = -1; - status.endCursor = -1; - } - - return result; - }; - - __proto.clear = function () { - this._status = { - startCursor: -1, - endCursor: -1, - size: -1 - }; - }; - - return Infinite; - }(); - - /* - Copyright (c) 2017 NAVER Corp. - @egjs/lazyloaded JavaScript library - @egjs/lazyloaded project is licensed under the MIT license - - - @version 0.0.2 - */ - var isWindow$1 = typeof window !== "undefined"; - var ua$1 = isWindow$1 ? window.navigator.userAgent : ""; - var SUPPORT_COMPUTEDSTYLE$1 = isWindow$1 ? !!("getComputedStyle" in window) : false; - var IS_IE$1 = /MSIE|Trident|Windows Phone|Edge/.test(ua$1); - var SUPPORT_ADDEVENTLISTENER$1 = isWindow$1 ? !!("addEventListener" in document) : false; - var WIDTH = "width"; - var HEIGHT = "height"; - - function getAttribute(el, name) { - return el.getAttribute(name) || ""; - } - - function toArray$1(arr) { - return [].slice.call(arr); - } - - function isDataAttribute(target, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - return !!target.getAttribute(prefix + "width"); - } - - function addEvent$1(element, type, handler) { - if (SUPPORT_ADDEVENTLISTENER$1) { - element.addEventListener(type, handler, false); - } else if (element.attachEvent) { - element.attachEvent("on" + type, handler); - } else { - element["on" + type] = handler; - } - } - - function removeEvent$1(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else if (element.detachEvent) { - element.detachEvent("on" + type, handler); - } else { - element["on" + type] = null; - } - } - - function innerWidth$1(el) { - return getSize$1(el, "Width"); - } - - function innerHeight$1(el) { - return getSize$1(el, "Height"); - } - - function getStyles$1(el) { - return (SUPPORT_COMPUTEDSTYLE$1 ? window.getComputedStyle(el) : el.currentStyle) || {}; - } - - function getSize$1(el, name) { - var size = el["client" + name] || el["offset" + name]; - return parseFloat(size || getStyles$1(el)[name.toLowerCase()]) || 0; - } - - var elements = []; - - function add(element, prefix) { - !elements.length && addEvent$1(window, "resize", resizeAll); - element.__PREFIX__ = prefix; - elements.push(element); - resize(element); - } - - function remove(element, prefix) { - var index = elements.indexOf(element); - - if (index < 0) { - return; - } - - var fixed = getAttribute(element, prefix + "fixed"); - delete element.__PREFIX__; - element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = ""; - elements.splice(index, 1); - !elements.length && removeEvent$1(window, "resize", resizeAll); - } - - function resize(element, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var elementPrefix = element.__PREFIX__; - - if (typeof elementPrefix !== "string") { - elementPrefix = prefix; - } - - var dataWidth = parseInt(getAttribute(element, "" + elementPrefix + WIDTH), 10) || 0; - var dataHeight = parseInt(getAttribute(element, "" + elementPrefix + HEIGHT), 10) || 0; - var fixed = getAttribute(element, elementPrefix + "fixed"); - - if (fixed === HEIGHT) { - var size = innerHeight$1(element) || dataHeight; - element.style[WIDTH] = dataWidth / dataHeight * size + "px"; - } else { - var size = innerWidth$1(element) || dataWidth; - element.style[HEIGHT] = dataHeight / dataWidth * size + "px"; - } - } - - function resizeAll() { - elements.forEach(function (element) { - resize(element); - }); - } - /** - * @namespace eg.LazyLoaded - */ - - /** - * This module is used to wait for images or videos to load. - * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다. - * @memberof eg.LazyLoaded - * @param - - * @example - * ## HTML - * ```html - *
- * - * - * - * - * - * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * finish: () => console.log("finish"), - * error: e => console.log("error", e), - * }); - * ``` - */ - - - function check(elements, prefix) { - if (prefix === void 0) { - prefix = "data-"; - } - - var component = new Component(); - var finishCount = 0; - var readyCount = 0; - - function checkReady() { - if (--readyCount !== 0) { - return; - } - /** - * An event occurs when the size of all images is available. - * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#ready - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * ready: () => console.log("ready"), - * }); - * ``` - */ - - - component.trigger("ready"); - } - - function checkFinish() { - if (--finishCount !== 0) { - return; - } - /** - * An event occurs when all images have been completed loading. - * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다. - * @event eg.LazyLoaded#finish - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * finish: () => console.log("finish"), - * }); - * ``` - */ - - - component.trigger("finish"); - } - - elements.forEach(function (el, i) { - var tagName = el.tagName; - - if (isDataAttribute(el, prefix) && tagName !== "IMG") { - add(el, prefix); - ++finishCount; - setTimeout(function () { - check(toArray$1(el.querySelectorAll("img")), prefix).on("finish", function () { - remove(el, prefix); - checkFinish(); - }); - }); - return; - } - - var images = tagName === "IMG" ? [el] : toArray$1(el.querySelectorAll("img")); - - if (!images.length) { - return; - } - - images.forEach(function (img, j) { - if (img.complete && (!IS_IE$1 || IS_IE$1 && img.naturalWidth)) { - if (!img.naturalWidth) { - setTimeout(function () { - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - }); - } - - return; - } - - if (isDataAttribute(img, prefix)) { - add(img, prefix); - } else { - ++readyCount; - } - - ++finishCount; - - function onError() { - /** - * An event occurs if the image fails to load. - * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다. - * @event eg.LazyLoaded#error - * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트 - * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스 - * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트 - * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스 - * @example - * ```html - *
- * - * - * - *
- * ``` - * ## Javascript - * ```js - * import {check} from "@egjs/lazyloaded"; - * - * eg.LazyLoaded.check([document.querySelector("div")]).on({ - * error: e => { - * //
...
, 0, , 2 - * console.log(e.itemTarget, e.itemIndex, e.target, e.index), - * }, - * }); - * ``` - */ - component.trigger("error", { - itemTarget: el, - itemIndex: i, - target: img, - index: j - }); - } - - function onCheck(e) { - var target = e.target || e.srcElement; - removeEvent$1(target, "error", onCheck); - removeEvent$1(target, "load", onCheck); - - if (isDataAttribute(target, prefix)) { - remove(target, prefix); - } else { - checkReady(); - } - - if (e.type === "error") { - onError(); - } - - checkFinish(); - } - - addEvent$1(img, "load", onCheck); - addEvent$1(img, "error", onCheck); - IS_IE$1 && img.setAttribute("src", img.getAttribute("src")); - }); - }); - !readyCount && setTimeout(function () { - component.trigger("ready"); - }); - !finishCount && setTimeout(function () { - component.trigger("finish"); - }); - return component; - } - - function hasTarget(target, value) { - return ~target.indexOf(value); - } - - var RenderManager = - /*#__PURE__*/ - function () { - function RenderManager(_infinite, _itemManager, _renderer, options) { - this._infinite = _infinite; - this._itemManager = _itemManager; - this._renderer = _renderer; - this.options = options; - } - - var __proto = RenderManager.prototype; - - __proto.setLayout = function (layout) { - this._layout = layout; - }; - - __proto.render = function (callbackComponent, groups, items, isAppend) { - var _this = this; - - if (items === void 0) { - items = ItemManager.pluck(groups, "items"); - } - - var checkGroups = isAppend ? groups : groups.reverse(); - var replaceTarget = []; - var removeTarget = []; - var elements = items.map(function (item) { - return item.el; - }); - var prefix = this.options.attributePrefix; - check(elements, prefix).on("ready", function () { - if (!_this._itemManager) { - return; - } - - _this._complete(callbackComponent, checkGroups, items, isAppend); - }).on("error", function (_a) { - var target = _a.target, - itemIndex = _a.itemIndex; - - if (!_this._itemManager) { - return; - } - - _this._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex); - }).on("finish", function () { - if (!_this._itemManager) { - return; - } - - _this._end(callbackComponent, removeTarget, replaceTarget, items); - }); - return callbackComponent; - }; - - __proto._complete = function (callbackComponent, groups, items, isAppend) { - var infinite = this._infinite; - var layout = this._layout; - var itemManager = this._itemManager; - var cursor = isAppend ? "end" : "start"; - var groupIndex = itemManager.indexOf(groups[0]); - var prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1)); - var outline = prevGroup ? prevGroup.outlines[cursor] : [0]; - - this._renderer.updateSize(items); - - groups.forEach(function (group) { - var groupOutline = group.outlines[isAppend ? "start" : "end"]; - var isRelayout = !outline.length || (outline.length === groupOutline.length ? !outline.every(function (v, index) { - return v === groupOutline[index]; - }) : true); - - if (!isRelayout) { - outline = group.outlines[isAppend ? "end" : "start"]; - DOMRenderer.renderItems(group.items); - return; - } - - var groupItems = group.items; - var groupInfo = layout[isAppend ? "append" : "prepend"](groupItems, outline, true); - assign(group, groupInfo); - DOMRenderer.renderItems(groupInfo.items); - outline = groupInfo.outlines[isAppend ? "end" : "start"]; - }); - var startCursor = Math.max(infinite.getCursor("start"), 0); - var endCursor = Math.max(infinite.getCursor("end"), 0); - var requestStartCursor = itemManager.indexOf(groups[0].groupKey); - var requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey); - var isInCursor = true; - - if (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) { - isInCursor = false; - } - - if (isInCursor) { - if (isAppend) { - requestStartCursor = startCursor; - requestEndCursor = Math.max(endCursor, requestEndCursor); - } else { - requestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0); - requestEndCursor = endCursor; - } - } - - if (requestStartCursor > requestEndCursor) { - var tempCursor = requestStartCursor; - requestStartCursor = requestEndCursor; - requestEndCursor = tempCursor; - } - - callbackComponent.trigger("renderComplete", { - start: requestStartCursor, - end: requestEndCursor - }); - callbackComponent.trigger("layoutComplete", { - items: ItemManager.pluck(groups, "items"), - isAppend: isAppend - }); - }; - - __proto._error = function (callbackComponent, removeTarget, replaceTarget, target, items, errorIndex) { - var itemManager = this._itemManager; - var item = items[errorIndex]; - var element = item.el; - var prefix = this.options.attributePrefix; // remove item - - var removeItem = function () { - if (hasTarget(removeTarget, element)) { - return; - } - - removeTarget.push(element); - var index = replaceTarget.indexOf(errorIndex); - index !== -1 && replaceTarget.splice(index, 1); - }; // remove image - - - var remove$$1 = function () { - if (target === element) { - removeItem(); - return; - } - - if (hasTarget(removeTarget, element)) { - return; - } - - target.parentNode.removeChild(target); - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace image - - - var replace = function (src) { - if (hasTarget(removeTarget, element)) { - return; - } - - if (src) { - if (matchHTML(src) || typeof src === "object") { - var parentNode = target.parentNode; - parentNode.insertBefore($(src), target); - parentNode.removeChild(target); - item.content = element.outerHTML; - } else { - target.src = src; - - if (target.getAttribute(prefix + "width")) { - remove(target, prefix); - target.removeAttribute(prefix + "width"); - target.removeAttribute(prefix + "height"); - } - } - } - - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; // replace item - - - var replaceItem = function (content) { - if (hasTarget(removeTarget, element)) { - return; - } - - element.innerHTML = content; - item.content = element.outerHTML; - - if (hasTarget(replaceTarget, errorIndex)) { - return; - } - - replaceTarget.push(errorIndex); - }; - - var totalIndex = itemManager.pluck("items").indexOf(item); - callbackComponent.trigger("imageError", { - target: target, - element: element, - items: items, - item: item, - itemIndex: errorIndex, - replace: replace, - replaceItem: replaceItem, - remove: remove$$1, - removeItem: removeItem, - totalIndex: totalIndex - }); - }; - - __proto._end = function (callbackComponent, removeTarget, replaceTarget, items) { - var _this = this; - - var attributePrefix = this.options.attributePrefix; - var removeTargetLength = removeTarget.length; - var replaceTargetLength = replaceTarget.length; - - if (!removeTargetLength && !replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: [] - }); - return; - } - - var layoutedItems = replaceTarget.map(function (itemIndex) { - return items[itemIndex]; - }); - - if (!replaceTargetLength) { - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - return; - } // wait layoutComplete beacause of error event. - - - check(layoutedItems.map(function (v) { - return v.el; - }), attributePrefix).on("ready", function () { - _this._renderer.updateSize(layoutedItems); - - callbackComponent.trigger("finish", { - remove: removeTarget, - layout: true - }); - }); - }; - - return RenderManager; - }(); - - var Watcher = - /*#__PURE__*/ - function () { - function Watcher(view, options) { - if (options === void 0) { - options = {}; - } - - var _this = this; - - this._containerOffset = 0; - this._isScrollIssue = IS_IOS; // When InfiniteGrid is initialized. - // The initial value is null to block the scroll event when returning from browser behavior. - - this._prevPos = null; - - this._onCheck = function () { - var prevPos = _this.getScrollPos(); - - var orgScrollPos = _this.getOrgScrollPos(); - - _this.setScrollPos(orgScrollPos); - - var scrollPos = _this.getScrollPos(); - - if (prevPos === null || _this._isScrollIssue && orgScrollPos === 0 || prevPos === scrollPos) { - orgScrollPos && (_this._isScrollIssue = false); - return; - } - - _this._isScrollIssue = false; - - _this.options.check({ - isForward: prevPos < scrollPos, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos, - horizontal: _this.options.horizontal - }); - }; - - this._onResize = function () { - if (_this._timer.resize) { - clearTimeout(_this._timer.resize); - } - - _this._timer.resize = setTimeout(function () { - _this.resize(); - - _this.options.resize(); - - _this._timer.resize = null; - }, 100); - }; - - assign(this.options = { - container: view, - resize: function () { - return void 0; - }, - check: function () { - return void 0; - }, - isOverflowScroll: false, - horizontal: false - }, options); - this._timer = { - resize: null - }; - this._view = view; - this.attachEvent(); - this.resize(); - this.setScrollPos(); - } - - var __proto = Watcher.prototype; - - __proto.getStatus = function () { - return { - _prevPos: this._prevPos, - scrollPos: this.getOrgScrollPos() - }; - }; - - __proto.setStatus = function (status, applyScrollPos) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - this._prevPos = status._prevPos; - applyScrollPos && this.scrollTo(status.scrollPos); - }; - - __proto.scrollBy = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollBy(this._view, arrPos[0], arrPos[1]); - this.setScrollPos(); - }; - - __proto.scrollTo = function (pos) { - var arrPos = this.options.horizontal ? [pos, 0] : [0, pos]; - scrollTo(this._view, arrPos[0], arrPos[1]); - }; - - __proto.getScrollPos = function () { - return this._prevPos; - }; - - __proto.setScrollPos = function (pos) { - if (pos === void 0) { - pos = this.getOrgScrollPos(); - } - - this._prevPos = pos - this.getContainerOffset(); - }; - - __proto.attachEvent = function () { - addEvent(this._view, "scroll", this._onCheck); - addEvent(win, "resize", this._onResize); - }; - - __proto.getOrgScrollPos = function () { - return scroll(this._view, this.options.horizontal); - }; - - __proto.reset = function () { - this._prevPos = null; - }; - - __proto.getContainerOffset = function () { - return this._containerOffset; - }; - - __proto.resize = function () { - this._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset(); - }; - - __proto.detachEvent = function () { - removeEvent(this._view, "scroll", this._onCheck); - removeEvent(win, "resize", this._onResize); - }; - - __proto.destroy = function () { - this.detachEvent(); - this.reset(); - }; - - __proto._getOffset = function () { - var _a = this.options, - container = _a.container, - horizontal = _a.horizontal; - var rect = container.getBoundingClientRect(); - return rect[horizontal ? "left" : "top"] + this.getOrgScrollPos(); - }; - - return Watcher; - }(); - - // https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create - - /* eslint-disable */ - // if (typeof Object.create !== "function") { - // // tslint:disable - // Object.create = (o: any, properties: any) => { - // if (typeof o !== "object" && typeof o !== "function") { - // throw new TypeError("Object prototype may only be an Object: " + o); - // } else if (o === null) { - // throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument."); - // } - // function F() { } - // F.prototype = o; - // return new F(); - // }; - // // tslint:enable - // } - - /* eslint-enable */ - - /** - * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance - * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다 - * @alias eg.InfiniteGrid - * @extends eg.Component - * - * @example - ``` -
    -
  • -
    test1
    -
  • -
  • -
    test2
    -
  • -
  • -
    test3
    -
  • -
  • -
    test4
    -
  • -
  • -
    test5
    -
  • -
  • -
    test6
    -
  • -
- - ``` - * - * @support {"ie": "8+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"} - **/ - - var InfiniteGrid = - /*#__PURE__*/ - function (_super) { - __extends(InfiniteGrid, _super); - /** - * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트 - * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체 - * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector) - * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다. - * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다. - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향) - * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다. - * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to "true", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다 - * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다. - * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기. - * @param {String} [options.attributePrefix="data-"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사. - * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다. - */ - - - function InfiniteGrid(element, options) { - var _this = _super.call(this) || this; - - _this._loadingBar = {}; - _this._requestGroups = []; - assign(_this.options = __assign({}, DEFAULT_OPTIONS), options); - DEFENSE_BROWSER && (_this.options.useFit = false); - IS_ANDROID2 && (_this.options.isOverflowScroll = false); - - _this._reset(); - - var _a = _this.options, - isOverflowScroll = _a.isOverflowScroll, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - horizontal = _a.horizontal, - threshold = _a.threshold, - useRecycle = _a.useRecycle, - attributePrefix = _a.attributePrefix; - _this._itemManager = new ItemManager(); - _this._renderer = new DOMRenderer(element, { - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal, - container: isOverflowScroll - }); - _this._watcher = new Watcher(_this._renderer.view, { - isOverflowScroll: isOverflowScroll, - horizontal: horizontal, - container: _this._renderer.container, - resize: function () { - return _this._onResize(); - }, - check: function (param) { - return _this._onCheck(param); - } - }); - _this._infinite = new Infinite(_this._itemManager, { - useRecycle: useRecycle, - threshold: threshold, - append: function (param) { - return _this._requestAppend(param); - }, - prepend: function (param) { - return _this._requestPrepend(param); - }, - recycle: function (param) { - return _this._recycle([param]); - } - }); - _this._renderManager = new RenderManager(_this._infinite, _this._itemManager, _this._renderer, { - attributePrefix: attributePrefix, - isEqualSize: isEqualSize, - isConstantSize: isConstantSize, - horizontal: horizontal - }); - return _this; - } - /** - * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다. - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.append("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.append(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.append([HTMLElement1, HTMLElement2]); - * infinitegrid.append(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - var __proto = InfiniteGrid.prototype; - - __proto.append = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: true, - groupKey: groupKey - }); - return this; - }; - /** - * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false. - * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다 - * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열 - * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default. - * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.prepend("<div class='item'>test1</div><div class='item'>test2</div>"); - * infinitegrid.prepend(["<div class='item'>test1</div>", "<div class='item'>test2</div>"]); - * infinitegrid.prepend([HTMLElement1, HTMLElement2]); - * infinitegrid.prepend(jQuery(["<div class='item'>test1</div>", "<div class='item'>test2</div>"])); - */ - - - __proto.prepend = function (elements, groupKey) { - this._layout && this._insert({ - elements: elements, - isAppend: false, - groupKey: groupKey - }); - return this; - }; - /** - * Specifies the Layout class to use. - * @ko 사용할 Layout 클래스를 지정한다. - * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스 - * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, { - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, { - * margin: 10, - * minSize: 100, - * maxSize: 200 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, { - * margin: 10, - * column: 2 - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, { - * margin: 10, - * frame: [ - * [1, 2], - * [4, 3], - * ] - * }); - * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, { - * margin: 10, - * aspectRatio: 1.5 - * }); - * var layout = new eg.InfiniteGrid.GridLayout({ - * margin: 10, - * align: "start" - * }); - * infinitegrid.setLayout(layout); - */ - - - __proto.setLayout = function (LayoutKlass, options) { - if (options === void 0) { - options = {}; - } - - var horizontal = this.options.horizontal; - - if (typeof LayoutKlass === "function") { - this._layout = new LayoutKlass(assign(options, { - horizontal: horizontal - })); - } else { - LayoutKlass.options.horizontal = horizontal; - this._layout = LayoutKlass; - } - - this._renderManager.setLayout(this._layout); - - this._renderer.resize(); - - this._setSize(this._renderer.getViewportSize()); - - return this; - }; - /** - * Returns the layouted items. - * @ko 레이아웃된 아이템들을 반환한다. - * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다. - * @returns List of items 아이템의 목록 - */ - - - __proto.getItems = function (includeCached) { - if (includeCached === void 0) { - includeCached = false; - } - - return includeCached ? this._itemManager.pluck("items") : this._infinite.getVisibleItems(); - }; - /** - * @param - Get items to render on screen. - * @ko 화면에 렌더될 아이템들 가져온다. - * @private - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - * @return - The items to be rendered on screen. 화면레 렌더될 아이템들. - */ - - - __proto.getRenderingItems = function () { - var items = this.getItems(); - var itemKeys = {}; - items.forEach(function (item) { - itemKeys[item.itemKey] = true; - }); - var nextVisisbleItems = ItemManager.pluck(this._requestGroups, "items").filter(function (item) { - if (itemKeys[item.itemKey]) { - return false; - } - - itemKeys[item.itemKey] = true; - return true; - }); - return items.concat(nextVisisbleItems); - }; - /** - * Synchronize info of items with info given by external rendering. - * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다. - * @private - * @param - all item infos to synchronize 동기화할 전체 아이템 정보들. - */ - - - __proto.beforeSync = function (items) { - return this._infinite.sync(items); - }; - /** - * Synchronize info of items with DOM info given by external rendering. - * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다. - * @private - * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들. - * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들. - */ - - - __proto.sync = function (elements) { - var itemManager = this._itemManager; - var infinite = this._infinite; - var items = this.getRenderingItems(); - items.forEach(function (item, i) { - var isChange = item.el !== elements[i]; - item.el = elements[i]; - - if (isChange) { - DOMRenderer.renderItem(item, item.rect); - } - }); - - if (this._isProcessing()) { - return; - } - - var newItems = items.filter(function (item) { - return !item.orgSize || !item.orgSize.width; - }); - - if (newItems.length) { - this._postLayout({ - fromCache: false, - groups: infinite.getVisibleData(), - newItems: newItems, - isAppend: true, - isTrusted: false - }); - } else { - var size = itemManager.size(); - - if (!size) { - this._requestAppend({}); - } else if (infinite.getCursor("start") < 0) { - var firstGroup = itemManager.getGroup(0); - - this._postLayout({ - groups: [firstGroup], - hasChildren: false, - fromCache: false, - isAppend: true - }); - } else { - this._infinite.scroll(this._watcher.getScrollPos()); - } - } - }; - /** - * Rearranges a layout. - * @ko 레이아웃을 다시 배치한다. - * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.layout = function (isRelayout) { - if (isRelayout === void 0) { - isRelayout = true; - } - - if (!this._layout) { - return this; - } - - var renderer = this._renderer; - var itemManager = this._itemManager; - var infinite = this._infinite; - var isResize = renderer.resize(); - var items = this.getItems(); - var _a = this.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize, - transitionDuration = _a.transitionDuration; - var isLayoutAll = isRelayout && (isEqualSize || isConstantSize); - var size = itemManager.size(); - - this._watcher.resize(); - - if (isRelayout) { - if (isResize) { - this._setSize(renderer.getViewportSize()); - } - } // check childElement - - - if (!items.length) { - var children_1 = toArray(renderer.container.children).filter(function (el) { - return el.className.indexOf(IGNORE_CLASSNAME) === -1; - }); - var hasChildren = children_1.length > 0; - - if (size) { - var firstGroup = itemManager.getGroup(0); - - if (hasChildren) { - firstGroup.items.forEach(function (item, i) { - item.el = children_1[i]; - }); - } // has items, no visible items - - - this._postLayout({ - groups: [firstGroup], - hasChildren: hasChildren, - fromCache: false, - isAppend: true - }); - } else { - // no items, no visible items - if (hasChildren) { - var groupKey = children_1[0].getAttribute("data-groupkey"); - - if (typeof groupKey !== "string") { - groupKey = undefined; - } - - this._insert({ - elements: children_1, - isAppend: true, - hasChildren: true, - groupKey: groupKey - }); - } else { - if (renderer.getContainerSize()) { - renderer.setContainerSize(0); - } - - this._requestAppend({}); - } - } - - return this; - } // layout datas - - - var _b = infinite.getCursors(), - startCursor = _b[0], - endCursor = _b[1]; - - var data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() : itemManager.sliceGroups(startCursor, endCursor + 1); // LayoutManger interface - - this._relayout(isRelayout, data, isResize ? items : []); - - if (isLayoutAll) { - this._fit(); - } else if (isRelayout && isResize) { - itemManager.clearOutlines(startCursor, endCursor); - } - - DOMRenderer.renderItems(items, transitionDuration); - isRelayout && this._watcher.setScrollPos(); - - this._onLayoutComplete({ - items: items, - isAppend: true, - fromCache: true, - isTrusted: false, - useRecycle: false, - isLayout: true - }); - - return this; - }; - /** - * Removes a item corresponding to an index on a grid layout. - * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다. - * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스 - * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.removeByIndex = function (groupIndex, itemIndex, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._infinite.remove(groupIndex, itemIndex), - items = _a.items, - group = _a.group; - - items.forEach(function (item) { - DOMRenderer.removeElement(item.el); - }); - - if (items.length) { - isLayout && this.layout(!!group); - return items; - } - - return []; - }; - /** - * Removes a item element on a grid layout. - * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다. - * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트 - * @return {Object} Removed items information 삭제된 아이템들 정보 - */ - - - __proto.remove = function (element, isLayout) { - if (isLayout === void 0) { - isLayout = true; - } - - var _a = this._itemManager.indexesOfElement(element), - groupIndex = _a.groupIndex, - itemIndex = _a.itemIndex; - - return this.removeByIndex(groupIndex, itemIndex, isLayout); - }; - /** - * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated. - * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다. - * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다. - * @return {Array} List of group keys 그룹 키의 목록 - */ - - - __proto.getGroupKeys = function (includeCached) { - var data = includeCached ? this._itemManager.getGroups() : this._infinite.getVisibleData(); - return data.map(function (v) { - return v.groupKey; - }); - }; - /** - * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method. - * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다 - * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체 - */ - - - __proto.getStatus = function (startKey, endKey) { - return { - _status: assign({}, this._status), - _itemManager: this._itemManager.getStatus(startKey, endKey), - _renderer: this._renderer.getStatus(), - _watcher: this._watcher.getStatus(), - _infinite: this._infinite.getStatus(startKey, endKey) - }; - }; - /** - * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method. - * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다. - * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체 - * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setStatus = function (status, applyScrollPos, syncElements) { - if (applyScrollPos === void 0) { - applyScrollPos = true; - } - - if (!status) { - return this; - } - - var _status = status._status, - _renderer = status._renderer, - _itemManager = status._itemManager, - _watcher = status._watcher, - _infinite = status._infinite; - - if (!_status || !_renderer || !_itemManager || !_watcher || !_infinite) { - return this; - } - - var renderExternal = this.options.renderExternal; - var items = this._itemManager; - var renderer = this._renderer; - var watcher = this._watcher; - var infinite = this._infinite; - watcher.detachEvent(); - assign(this._status, _status); - this._status.processingStatus = IDLE; - items.setStatus(_itemManager); - renderer.setStatus(_renderer); - infinite.setStatus(_infinite); - var visibleItems = this.getItems(); - var length = visibleItems.length; - - if (renderExternal) { - visibleItems.forEach(function (item, i) { - item.el = syncElements[i]; - }); - DOMRenderer.renderItems(visibleItems); - } else { - renderer.createAndInsert(visibleItems, true); - } - - var isReLayout = renderer.isNeededResize(); - watcher.setStatus(_watcher, applyScrollPos); - watcher.attachEvent(); - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize; - - if (!length) { - this._requestAppend({ - cache: [] - }); - } else if (isReLayout) { - renderer.resize(); - - this._setSize(renderer.getViewportSize()); - - if (isConstantSize) { - this.layout(true); - } else { - this._itemManager.clearOutlines(); - - this._postLayout({ - fromCache: true, - groups: isEqualSize ? items.getGroups() : infinite.getVisibleData(), - items: visibleItems, - newItems: visibleItems, - isAppend: true, - isTrusted: false - }); - } - } else { - this.layout(false); - } - - return this; - }; - /** - * Clears added card elements and data. - * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.clear = function () { - this._itemManager.clear(); - - this._renderer.clear(); - - this._infinite.clear(); - - this._reset(); - - this._appendLoadingBar(); - - return this; - }; - /** - * Specifies the Loading Bar to use for append or prepend items. - * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다. - * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.setLoadingBar = function (userLoadingBar) { - if (userLoadingBar === void 0) { - userLoadingBar = {}; - } - - var loadingBarObj = typeof userLoadingBar === "object" ? userLoadingBar : { - append: userLoadingBar, - prepend: userLoadingBar - }; - this._status.loadingSize = 0; - this._status.loadingStyle = {}; - var loadingBar = this._loadingBar; - var isChangeLoadingBar = false; - - for (var type in loadingBarObj) { - var loadingElement = $(loadingBarObj[type]); - - if (loadingBar[type] !== loadingElement) { - loadingBar[type] = loadingElement; - isChangeLoadingBar = true; - } - - if (!hasClass(loadingElement, IGNORE_CLASSNAME)) { - addClass(loadingElement, IGNORE_CLASSNAME); - } - } - - if (isChangeLoadingBar) { - this._renderLoading(); - } - - this._appendLoadingBar(); - - return this; - }; - /** - * Checks whether a card element or data is being added. - * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다 - * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부 - */ - - - __proto.isProcessing = function () { - return this._isProcessing() || this.isLoading(); - }; - /** - * Checks whether data is loading. - * @ko 데이터 로딩 중인지 확인한다 - * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부 - */ - - - __proto.isLoading = function () { - return this._getLoadingStatus() > 0; - }; - /** - * Returns the element of loading bar. - * @ko 로딩 바의 element를 반환한다. - * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @return {Element} The element of loading bar. 로딩 바의 element - */ - - - __proto.getLoadingBar = function (isAppend) { - if (isAppend === void 0) { - isAppend = this._getLoadingStatus() !== LOADING_PREPEND; - } - - return this._loadingBar[isAppend ? "append" : "prepend"]; - }; - /** - * Start loading for append/prepend during loading data. - * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다. - * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다. - * @param {Object} [userStyle = {display: "block"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.startLoading = function (isAppend, userStyle) { - var _this = this; - - if (userStyle === void 0) { - userStyle = { - display: "block" - }; - } - - if (this.isLoading()) { - return this; - } - - var type = isAppend ? "append" : "prepend"; - - this._process(isAppend ? LOADING_APPEND : LOADING_PREPEND); - - if (!this._loadingBar[type]) { - return this; - } - - var next = function () { - _this._renderLoading(userStyle); - - _this._status.loadingStyle = userStyle; - - if (!isAppend) { - _this._fit(); - } else { - _this._setContainerSize(_this._getEdgeValue("end") + _this._status.loadingSize); - } - }; - - if (this.options.renderExternal) { - this.trigger("render", { - next: next - }); - } else { - next(); - } - - return this; - }; - /** - * End loading after startLoading() for append/prepend - * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다. - * @param {Object} [userStyle = {display: "none"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.endLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = { - display: "none" - }; - } - - var _a; - - if (!this.isLoading()) { - return this; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var type = isAppend ? "append" : "prepend"; - var el = this._loadingBar[type]; - var status = this._status; - var size = status.loadingSize; - - this._process(LOADING_APPEND | LOADING_PREPEND, false); - - status.loadingSize = 0; - status.loadingStyle = {}; - - if (el) { - var style = assign((_a = {}, _a[this.options.horizontal ? "left" : "top"] = -size + "px", _a), userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - if (!isAppend) { - this._fitItems(size); - } else { - this._setContainerSize(this._getEdgeValue("end")); - } - - if (this.options.renderExternal) { - this.trigger("render", { - next: function () {} - }); - } - } - - if (this.options.useRecycle && !this.isProcessing()) { - this._infinite.recycle(this._watcher.getScrollPos(), isAppend); - } - - return this; - }; - /** - * Retrieves the item via index or the element. - * @ko index 또는 element를 통해 아이템을 가져온다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보 - * @example - ig.getItem(0, 0); - ig.getItem(element); - { - el: HTMLElement, - content: "
...
", - size: {width: ..., height: ...}, - rect: {top: ..., left: ..., width: ..., height: ...}, - } - */ - - - __proto.getItem = function (groupIndex, itemIndex) { - if (groupIndex === void 0) { - groupIndex = 0; - } - - if (typeof groupIndex === "object") { - if (!groupIndex) { - return; - } - - var items = this.getItems(); - var length = items.length; - - for (var i = 0; i < length; ++i) { - if (items[i].el === groupIndex) { - return items[i]; - } - } - - return undefined; - } else { - var group = this._itemManager.getGroup(groupIndex); - - return group && group.items[itemIndex || 0]; - } - }; - /** - * Updates the item via index or the element. - * @ko index 또는 element를 통해 아이템을 업데이트한다. - * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index - * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - ig.updateItem(element); - ig.updateItem(0, 0); - */ - - - __proto.updateItem = function (groupIndex, itemIndex) { - var item = this.getItem(groupIndex, itemIndex); - this._updateItem(item) && this.layout(false); - return this; - }; - /** - * Update the currently displayed items. - * @ko 현재보여주는 아이템들을 업데이트한다. - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - * @example - element.innerHTML = "2"; - element.style.height = "400px"; - element2.innerHTML = "2"; - element2.style.height = "400px"; - ig.updateItems(); - */ - - - __proto.updateItems = function () { - var _this = this; - - this.getItems().forEach(function (item) { - _this._updateItem(item); - }); - this.layout(false); - return this; - }; - /** - * Move to some group or item position. - * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다. - * @param {Number} [index] group's index 그룹의 index - * @param {Number} [itemIndex=-1] item's index 그룹의 index - * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스 - */ - - - __proto.moveTo = function (index, itemIndex) { - var _this = this; - - if (itemIndex === void 0) { - itemIndex = 0; - } - - if (this.isProcessing()) { - return this; - } - - var data = this._itemManager.getGroup(index); - - if (!data) { - return this; - } - - var infinite = this._infinite; - var outlines = data.outlines; - var items = data.items; - var item = items[itemIndex]; - var isResize = outlines.start && outlines.start.length === 0; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - var isInCursor = startCursor <= index && index <= endCursor; - var _b = this.options, - useRecycle = _b.useRecycle, - horizontal = _b.horizontal; - - if (isInCursor || !useRecycle || !isResize) { - var pos = item ? item.rect[horizontal ? "left" : "top"] : Math.max.apply(Math, outlines.start); - var fit = Math.min.apply(Math, outlines.start); - - if (fit < 0) { - // base < 0 - this._fitItems(fit, 0); - - pos -= fit; - } - - var isAppend = index > startCursor; - - if (isInCursor || isAppend) { - this._scrollTo(pos); - - return this; - } - - this._postLayout({ - fromCache: true, - groups: [data], - items: items, - newItems: [], - isAppend: isAppend, - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var scrollPos = items[itemIndex].rect[horizontal ? "left" : "top"]; - - if (!isInCursor) { - itemManager.clearOutlines(start, end); - } - - _this._scrollTo(scrollPos); - - _this._setScrollPos(scrollPos); - }); - - return this; - } else { - var isAppend = index > endCursor || index < startCursor - 1; - - this._postCache({ - isAppend: isAppend, - cache: [data], - isTrusted: false - }).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - var itemManager = _this._itemManager; - - if (!itemManager) { - return; - } - - var pos = items[itemIndex].rect[horizontal ? "left" : "top"]; - itemManager.clearOutlines(start, end); - - _this._scrollTo(pos); - - _this._setScrollPos(pos); - }); - } - - return this; - }; - /** - * Destroys elements, properties, and events used on a grid layout. - * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다 - */ - - - __proto.destroy = function () { - this._infinite.clear(); - - this._watcher.destroy(); - - this._reset(); - - this._itemManager.clear(); - - this._renderer.destroy(); - }; - - __proto._relayout = function (isRelayout, groups, items) { - var renderer = this._renderer; - var _a = renderer.options, - isEqualSize = _a.isEqualSize, - isConstantSize = _a.isConstantSize; - var layoutGroups = groups.filter(function (group) { - var item = group.items[0]; - return item.orgSize && item.rect.top > DUMMY_POSITION / 10; - }); - - if (!layoutGroups.length) { - return []; - } - - var outline = layoutGroups[0].outlines.start; - - if (isRelayout) { - outline = [outline.length ? Math.min.apply(Math, outline) : 0]; - - if (!isConstantSize && items.length) { - renderer.updateSize(items); // update invisible items' size - - if (isEqualSize && items[0].size) { - ItemManager.pluck(layoutGroups, "items").forEach(function (item) { - item.size = assign({}, items[0].size); - }); - } - } - } - - this._layout.layout(layoutGroups, outline); - }; - - __proto._setContainerSize = function (size) { - this._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size)); - }; - - __proto._appendLoadingBar = function () { - if (!this.options.renderExternal) { - var loadingBar = this._loadingBar; - var container = this._renderer.container; - - for (var type in loadingBar) { - container.appendChild(loadingBar[type]); - } - } - }; - - __proto._setSize = function (size) { - this._infinite.setSize(this._renderer.getViewSize()); - - this._layout.setSize(size); - }; - - __proto._fitItems = function (base, margin) { - if (margin === void 0) { - margin = 0; - } - - base > 0 && this._watcher.scrollBy(-base); - - this._itemManager.fit(base, this.options.horizontal); - - DOMRenderer.renderItems(this.getItems()); - - this._setContainerSize(this._getEdgeValue("end") || margin); - - base < 0 && this._watcher.scrollBy(-base); - }; // called by visible - - - __proto._fit = function (useFit) { - if (useFit === void 0) { - useFit = this.options.useFit; - } - - var base = this._getEdgeValue("start"); - - var margin = this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize || 0; - var _a = this.options, - isConstantSize = _a.isConstantSize, - isEqualSize = _a.isEqualSize, - useRecycle = _a.useRecycle; - - if (!useRecycle || !useFit || isConstantSize || isEqualSize) { - if (base < margin) { - this._fitItems(base - margin, margin); - } - - base = 0; - } else if (base !== 0 || margin) { - this._fitItems(base - margin, margin); - } else { - return 0; - } - - this.isLoading() && this._renderLoading(); - return base; - }; - - __proto._getEdgeValue = function (cursor) { - return this._infinite.getEdgeValue(cursor); - }; - - __proto._isProcessing = function () { - return (this._status.processingStatus & PROCESSING) > 0; - }; - - __proto._getLoadingStatus = function () { - return this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND); - }; - - __proto._process = function (status, isAdd) { - if (isAdd === void 0) { - isAdd = true; - } - - if (isAdd) { - this._status.processingStatus |= status; - } else { - this._status.processingStatus -= this._status.processingStatus & status; - } - }; - - __proto._insert = function (_a) { - var elements = _a.elements, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (this._isProcessing() || elements.length === 0) { - return; - } - - var items = ItemManager.toItems($(elements, true), groupKey); - - this._insertItems({ - items: items, - isAppend: isAppend, - hasChildren: hasChildren, - groupKey: groupKey - }); - }; - - __proto._insertItems = function (_a) { - var items = _a.items, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - _b = _a.groupKey, - groupKey = _b === void 0 ? new Date().getTime() + Math.floor(Math.random() * 1000) : _b; - - if (!items.length) { - return; - } - - var group = this._itemManager[isAppend ? "appendGroup" : "prependGroup"]({ - groupKey: groupKey, - items: items - }); - - if (!isAppend) { - var infinite = this._infinite; - - var _c = infinite.getCursors(), - startCursor = _c[0], - endCursor = _c[1]; - - infinite.setCursor("start", startCursor + 1); - infinite.setCursor("end", endCursor + 1); - } - - this._postLayout({ - fromCache: false, - groups: [group], - items: group.items, - newItems: group.items, - isAppend: isAppend, - hasChildren: hasChildren, - isTrusted: false - }); - }; // add items, and remove items for recycling - - - __proto._recycle = function (ranges) { - var _this = this; - - var _a = this.options, - useRecycle = _a.useRecycle, - renderExternal = _a.renderExternal; - - if (!useRecycle) { - return false; - } - - var isRecycle = false; - ranges.forEach(function (_a) { - var start = _a.start, - end = _a.end; - - if (start === -1 || end === -1 || end < start) { - return; - } - - var items = _this._itemManager.pluck("items", start, end); - - isRecycle = isRecycle || items.some(function (item) { - return item.mounted; - }); - items.forEach(function (item) { - item.mounted = false; - }); - - if (!renderExternal) { - DOMRenderer.removeItems(items); - } - }); - - if (isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - - return isRecycle; - }; - - __proto._renderLoading = function (userStyle) { - if (userStyle === void 0) { - userStyle = this._status.loadingStyle; - } - - if (!this.isLoading()) { - return; - } - - var isAppend = this._getLoadingStatus() === LOADING_APPEND; - var el = this._loadingBar[isAppend ? "append" : "prepend"]; - - if (!el) { - return; - } - - var style = assign({ - position: "absolute" - }, userStyle); - - for (var property in style) { - el.style[property] = style[property]; - } - - this._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el); - var posName = this.options.horizontal ? "left" : "top"; - - if (!(posName in style)) { - var pos = isAppend ? this._getEdgeValue("end") : this._getEdgeValue("start") - this._status.loadingSize; - el.style[posName] = pos + "px"; - } - }; - - __proto._updateItem = function (item) { - if (item && item.el) { - item.content = item.el.outerHTML; - !this.options.isEqualSize && resetSize(item); - - this._renderer.updateSize([item]); - - return true; - } - - return false; - }; - - __proto._setScrollPos = function (pos) { - this._watcher.setScrollPos(this._watcher.getContainerOffset() + pos); - }; - - __proto._scrollTo = function (pos) { - this._watcher.scrollTo(this._watcher.getContainerOffset() + pos); - }; - - __proto._postCache = function (_a) { - var cache = _a.cache, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? true : _b; - var isConstantSize = this.options.isConstantSize; - var items = ItemManager.pluck(cache, "items"); - var fromCache = true; - var newItems = items.filter(function (item) { - if (!item.orgSize || !item.orgSize.width) { - fromCache = false; - return true; - } - - return !isConstantSize && item.rect.top < DUMMY_POSITION / 10; - }); - return this._postLayout({ - fromCache: fromCache, - groups: cache, - items: items, - newItems: newItems, - isAppend: isAppend, - isTrusted: isTrusted - }); - }; - - __proto._postLayout = function (_a) { - var _this = this; - - var fromCache = _a.fromCache, - groups = _a.groups, - _b = _a.items, - items = _b === void 0 ? ItemManager.pluck(groups, "items") : _b, - newItems = _a.newItems, - isAppend = _a.isAppend, - hasChildren = _a.hasChildren, - isTrusted = _a.isTrusted; - - this._process(PROCESSING); - - if (!groups.length) { - return; - } - - var renderExternal = this.options.renderExternal; - var renderer = this._renderer; - var callbackComponent = new Component(); - - var next = function () { - items.forEach(function (item) { - item.mounted = true; - }); - - _this._renderManager.render(callbackComponent, groups, newItems, isAppend).on("renderComplete", function (_a) { - var start = _a.start, - end = _a.end; - - _this._setCursor(start, end); - }).on("imageError", function (e) { - /** - * This event is fired when an error occurs in the image. - * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트. - * @event eg.InfiniteGrid#imageError - * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @example - ig.on("imageError", e => { - e.remove(); - e.removeItem(); - e.replace("http://...jpg"); - e.replace(imageElement); - e.replaceItem("item html"); - }); - */ - _this.trigger("imageError", assign(e, { - element: e.item.el - })); - }).on("layoutComplete", function (_a) { - var layoutItems = _a.items; - - _this._process(PROCESSING, false); - - _this._onLayoutComplete({ - items: layoutItems, - isAppend: isAppend, - fromCache: fromCache, - isTrusted: isTrusted, - useRecycle: false - }); - }).on("finish", function (_a) { - var remove = _a.remove, - layout = _a.layout; - remove.forEach(function (el) { - return _this.remove(el, false); - }); - - if (layout) { - _this.layout(false); - } else if (!_this.isProcessing() && _this.options.useRecycle) { - var scroller = _this._watcher; - var scrollPos = scroller.getScrollPos(); - - _this._infinite.recycle(scrollPos, isAppend); - } - }); - }; - - if (!hasChildren) { - if (renderExternal) { - if (items.every(function (item) { - return item.mounted; - })) { - next(); - } else { - this._requestGroups = groups; - this.trigger("render", { - next: function () { - !hasChildren && DOMRenderer.renderItems(items); - next(); - } - }); - } - - return callbackComponent; - } else { - // If container has children, it does not render first. - renderer.createAndInsert(items, isAppend); - } - } - - next(); - return callbackComponent; - }; // called by visible - - - __proto._requestAppend = function (_a) { - var _this = this; - - var cache = _a.cache; - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: true - }); - } else { - /** - * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right. - * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다 - * @event eg.InfiniteGrid#append - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("append", { - isTrusted: true, - groupKey: this.getGroupKeys().pop() || "", - startLoading: function (userStyle) { - _this.startLoading(true, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; // called by visible - - - __proto._requestPrepend = function (_a) { - var _this = this; - - var cache = _a.cache; - - this._fit(this.options.useFit || !cache || !cache.length); - - if (this._isProcessing()) { - return; - } - - if (cache && cache.length) { - this._postCache({ - cache: cache, - isAppend: false - }); - } else { - /** - * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left. - * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다. - * @event eg.InfiniteGrid#prepend - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. - * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - this.trigger("prepend", { - isTrusted: true, - groupKey: this.getGroupKeys().shift(), - startLoading: function (userStyle) { - _this.startLoading(false, userStyle); - }, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - } - }; - - __proto._onResize = function () { - this.layout(true); - }; - - __proto._setCursor = function (start, end) { - var infinite = this._infinite; - - var _a = infinite.getCursors(), - startCursor = _a[0], - endCursor = _a[1]; - - infinite.setCursor("start", start); - infinite.setCursor("end", end); - - var isRecycle = this._recycle([{ - start: startCursor, - end: start - 1 - }, { - start: end + 1, - end: endCursor - }]); - - if (!isRecycle) { - this._requestGroups = []; - this.trigger("render", { - next: function () {} - }); - } - }; - - __proto._onCheck = function (_a) { - var isForward = _a.isForward, - scrollPos = _a.scrollPos, - horizontal = _a.horizontal, - orgScrollPos = _a.orgScrollPos; - /** - * This event is fired when the user scrolls. - * @ko 사용자가 스크롤 할 경우 발생하는 이벤트. - * @event eg.InfiniteGrid#change - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향 - */ - - this.trigger("change", { - isForward: isForward, - horizontal: horizontal, - scrollPos: scrollPos, - orgScrollPos: orgScrollPos - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._onLayoutComplete = function (_a) { - var _this = this; - - var items = _a.items, - isAppend = _a.isAppend, - _b = _a.isTrusted, - isTrusted = _b === void 0 ? false : _b, - _c = _a.useRecycle, - useRecycle = _c === void 0 ? this.options.useRecycle : _c, - _d = _a.fromCache, - fromCache = _d === void 0 ? false : _d, - _e = _a.isLayout, - isLayout = _e === void 0 ? false : _e; - - var viewSize = this._renderer.getViewSize(); - - if (!isAppend) { - this._fit(); - } else { - this.isLoading() && this._renderLoading(); - } - - var watcher = this._watcher; - var scrollPos = watcher.getScrollPos(); // recycle after _fit beacause prepend and append are occured simultaneously by scroll. - - if (!isLayout && useRecycle && !this.isLoading()) { - this._infinite.recycle(scrollPos, isAppend); - } - - var size = this._getEdgeValue("end"); - - if (isAppend) { - this._setContainerSize(size + this._status.loadingSize || 0); - - if (typeof scrollPos === "number" && scrollPos > 0) { - !IS_IOS && this._scrollTo(scrollPos); - } - } - /** - * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method. - * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다 - * @event eg.InfiniteGrid#layoutComplete - * - * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체 - * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들 - * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다. - * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다. - * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다. - * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다. - * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값 - * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값 - * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기 - * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다. - * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다. - * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 - */ - - - this.trigger("layoutComplete", { - target: items.concat(), - isAppend: !!isAppend, - isTrusted: isTrusted, - fromCache: fromCache, - isLayout: isLayout, - isScroll: viewSize < watcher.getContainerOffset() + size, - scrollPos: scrollPos, - orgScrollPos: watcher.getOrgScrollPos(), - size: size, - endLoading: function (userStyle) { - _this.endLoading(userStyle); - } - }); - - this._infinite.scroll(scrollPos); - }; - - __proto._reset = function () { - this._status = { - processingStatus: IDLE, - loadingSize: 0, - loadingStyle: {} - }; - }; - /** - * Version info string - * @ko 버전정보 문자열 - * @name VERSION - * @static - * @type {String} - * @example - * eg.InfiniteGrid.VERSION; // ex) 3.3.3 - * @memberof eg.InfiniteGrid - */ - - - InfiniteGrid.VERSION = "3.6.3"; - return InfiniteGrid; - }(Component); - - /* - Frame - [ - [1, 1, 1, 1, 1], - [0, 0, 2, 2, 2], - [0, 0, 2, 2, 2], - [3, 4, 5, 5, 5], - ] - */ - - function disableFrame(frame, type, top, left, width, height) { - for (var i = top; i < top + height; ++i) { - for (var j = left; j < left + width; ++j) { - if (type !== frame[i][j]) { - continue; - } - - frame[i][j] = 0; - } - } - } - - function searchShapeInFrame(frame, type, top, left, width, height) { - var size = { - left: left, - top: top, - type: type, - width: 1, - height: 1 - }; - - for (var i = left; i < width; ++i) { - if (frame[top][i] === type) { - size.width = i - left + 1; - continue; - } - - break; - } - - for (var i = top; i < height; ++i) { - if (frame[i][left] === type) { - size.height = i - top + 1; - continue; - } - - break; - } // After finding the shape, it will not find again. - - - disableFrame(frame, type, top, left, size.width, size.height); - return size; - } - - function getShapes(frame) { - var height = frame.length; - var width = height ? frame[0].length : 0; - var shapes = []; - - for (var i = 0; i < height; ++i) { - for (var j = 0; j < width; ++j) { - var type = frame[i][j]; - - if (!type) { - continue; - } // Separate shapes with other numbers. - - - shapes.push(searchShapeInFrame(frame, type, i, j, width, height)); - } - } - - shapes.sort(function (a, b) { - return a.type < b.type ? -1 : 1; - }); - return { - shapes: shapes, - width: width, - height: height - }; - } - /** - * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm. - * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다. - * @class eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. - * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. - * @example - ``` - - ``` - **/ - - - var FrameLayout = - /*#__PURE__*/ - function () { - function FrameLayout(options) { - if (options === void 0) { - options = {}; - } - - this.options = assignOptions({ - margin: 0, - horizontal: false, - itemSize: 0, - frame: [], - frameFill: true - }, options); - var frame = this.options.frame.map(function (row) { - return row.slice(); - }); - this._itemSize = this.options.itemSize || 0; // divide frame into shapes. - - this._shapes = getShapes(frame); - this._size = 0; - this._style = getStyleNames(this.options.horizontal); - } - /** - * Adds items of groups at the bottom of a outline. - * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#layout - * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열 - * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.layout(groups, [100, 200, 300, 400]); - */ - - - var __proto = FrameLayout.prototype; - - __proto.layout = function (groups, outline) { - if (groups === void 0) { - groups = []; - } - - if (outline === void 0) { - outline = []; - } - - var length = groups.length; - var point = outline; - - for (var i = 0; i < length; ++i) { - var group = groups[i]; - - var outlines = this._layout(group.items, point, true); - - group.outlines = outlines; - point = outlines.end; - } - - return this; - }; - /** - * Set the viewport size of the layout. - * @ko 레이아웃의 가시 사이즈를 설정한다. - * @method eg.InfiniteGrid.FrameLayout#setSize - * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈 - * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스 - * @example - * layout.setSize(800); - */ - - - __proto.setSize = function (size) { - this._size = size; - return this; - }; - /** - * Adds items at the bottom of a outline. - * @ko 아이템들을 아웃라인 아래에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#append - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.append = function (items, outline, cache) { - return this._insert(items, outline, true, cache); - }; - /** - * Adds items at the top of a outline. - * @ko 아이템을 아웃라인 위에 추가한다. - * @method eg.InfiniteGrid.FrameLayout#prepend - * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열 - * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열 - * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보 - * @example - * layout.prepend(items, [100]); - */ - - - __proto.prepend = function (items, outline, cache) { - return this._insert(items, outline, false, cache); - }; - - __proto._getItemSize = function () { - this._checkItemSize(); - - return this._itemSize; - }; - - __proto._checkItemSize = function () { - if (this.options.itemSize) { - this._itemSize = this.options.itemSize; - return; - } - - var style = this._style; - var size = style.size2; - var margin = this.options.margin; // if itemSize is not in options, caculate itemSize from size. - - this._itemSize = (this._size + margin) / this._shapes[size] - margin; - }; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - var _a; - - var length = items.length; - var style = this._style; - var _b = this.options, - margin = _b.margin, - frameFill = _b.frameFill; - var size1Name = style.size1; - var size2Name = style.size2; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - var itemSize = this._getItemSize(); - - var isItemObject = typeof itemSize === "object"; - var itemSize2 = isItemObject ? itemSize[size2Name] : itemSize; - var itemSize1 = isItemObject ? itemSize[size1Name] : itemSize; - var shapesSize = this._shapes[size2Name]; - var shapes = this._shapes.shapes; - var shapesLength = shapes.length; - var startOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var endOutline = fill(new Array(shapesSize), DUMMY_POSITION); - var dist = 0; - var end = 0; - - if (!shapesLength) { - return { - start: outline, - end: outline - }; - } - - for (var i = 0; i < length; i += shapesLength) { - for (var j = 0; j < shapesLength && i + j < length; ++j) { - var item = items[i + j]; - var shape = shapes[j]; - var shapePos1 = shape[pos1Name]; - var shapePos2 = shape[pos2Name]; - var shapeSize1 = shape[size1Name]; - var shapeSize2 = shape[size2Name]; - var pos1 = end - dist + shapePos1 * (itemSize1 + margin); - var pos2 = shapePos2 * (itemSize2 + margin); - var size1 = shapeSize1 * (itemSize1 + margin) - margin; - var size2 = shapeSize2 * (itemSize2 + margin) - margin; - - for (var k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) { - if (startOutline[k] === DUMMY_POSITION) { - startOutline[k] = pos1; - } - - startOutline[k] = Math.min(startOutline[k], pos1); - endOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin); - } - - item.rect = (_a = {}, _a[pos1Name] = pos1, _a[pos2Name] = pos2, _a[size1Name] = size1, _a[size2Name] = size2, _a); - } - - end = Math.max.apply(Math, endOutline); // check dist once - - if (i !== 0) { - continue; - } // find & fill empty block - - - if (!frameFill) { - dist = 0; - continue; - } - - dist = end; - - for (var j = 0; j < shapesSize; ++j) { - if (startOutline[j] === DUMMY_POSITION) { - continue; - } // the dist between frame's end outline and next frame's start outline - // expect that next frame's start outline is startOutline[j] + end - - - dist = Math.min(startOutline[j] + end - endOutline[j], dist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] !== DUMMY_POSITION) { - continue; - } - - startOutline[i] = Math.max.apply(Math, startOutline); - endOutline[i] = startOutline[i]; - } // The target outline is start outline when type is appending - - - var targetOutline = isAppend ? startOutline : endOutline; - var prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? "max" : "min"].apply(Math, outline); - var prevOutlineDist = isAppend ? 0 : end; - - if (frameFill && outline.length === shapesSize) { - prevOutlineDist = -DUMMY_POSITION; - - for (var i = 0; i < shapesSize; ++i) { - if (startOutline[i] === endOutline[i]) { - continue; - } // if appending type is prepend(false), subtract dist from appending group's height. - - - prevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist); - } - } - - for (var i = 0; i < shapesSize; ++i) { - startOutline[i] += prevOutlineEnd - prevOutlineDist; - endOutline[i] += prevOutlineEnd - prevOutlineDist; - } - - items.forEach(function (item) { - item.rect[pos1Name] += prevOutlineEnd - prevOutlineDist; - }); - return { - start: startOutline.map(function (point) { - return parseInt(point, 10); - }), - end: endOutline.map(function (point) { - return parseInt(point, 10); - }) - }; - }; - - __proto._insert = function (items, outline, isAppend, cache) { - if (items === void 0) { - items = []; - } - - if (outline === void 0) { - outline = []; - } // this only needs the size of the item. - - - var clone = cache ? items : cloneItems(items); - return { - items: clone, - outlines: this._layout(clone, outline, isAppend) - }; - }; - - return FrameLayout; - }(); - - function makeShapeOutline(outline, itemSize, columnLength, isAppend) { - var point = Math[isAppend ? "min" : "max"].apply(Math, outline) || 0; - - if (outline.length !== columnLength) { - return fill(new Array(columnLength), 0); - } - - return outline.map(function (l) { - return Math.floor((l - point) / itemSize); - }); - } - - function getColumn(item) { - if (item.column) { - return item.column; - } - - var column = 1; - - if (item.el) { - column = parseInt(item.el.getAttribute("data-column"), 10) || 1; - } - - item.column = column; - return column; - } - /** - * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card. - * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다. - * @class eg.InfiniteGrid.SquareLayout - * @extends eg.InfiniteGrid.FrameLayout - * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체 - * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) - * @example - ``` - - ``` - **/ - - - var SquareLayout = - /*#__PURE__*/ - function (_super) { - __extends(SquareLayout, _super); - - function SquareLayout(options) { - if (options === void 0) { - options = {}; - } - - return _super.call(this, options) || this; - } - - var __proto = SquareLayout.prototype; - - __proto._layout = function (items, outline, isAppend) { - if (outline === void 0) { - outline = []; - } - - if (isAppend === void 0) { - isAppend = false; - } - - var _a, _b; - - var itemSize = this._getSquareSize(items[0]); - - var margin = this.options.margin; - var columnLength = this.options.column || Math.floor((this._size + margin) / (itemSize + margin)) || 1; - var length = items.length; - var endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend); - var pointCaculateName = isAppend ? "min" : "max"; - var shapes = []; - var sign = isAppend ? 1 : -1; - var style = this._style; - var pos1Name = style.startPos1; - var pos2Name = style.startPos2; - - for (var i = 0; i < length; ++i) { - var point = Math[pointCaculateName].apply(Math, endOutline); - var index = endOutline[isAppend ? "indexOf" : "lastIndexOf"](point); - var item = items[i]; - var columnWidth = item.columnWidth; - var column = columnWidth && columnWidth[0] === columnLength && columnWidth[1] || getColumn(item); - var columnCount = 1; - - if (column > 1) { - for (var j = 1; j < column && (isAppend && index + j < columnLength || !isAppend && index - j >= 0); ++j) { - if (isAppend && endOutline[index + sign * j] <= point || !isAppend && endOutline[index + sign * j] >= point) { - ++columnCount; - continue; - } - - break; - } - - if (!isAppend) { - index -= columnCount - 1; - } - } - - item.columnWidth = [columnLength, columnCount]; - shapes.push((_a = { - width: columnCount, - height: columnCount - }, _a[pos1Name] = point - (!isAppend ? columnCount : 0), _a[pos2Name] = index, _a.type = i + 1, _a.index = i, _a)); - - for (var j = 0; j < columnCount; ++j) { - endOutline[index + j] = point + sign * columnCount; - } - } - - this._shapes = (_b = { - shapes: shapes - }, _b[style.size2] = columnLength, _b); - - var result = _super.prototype._layout.call(this, items, outline, isAppend); - - if (!isAppend) { - shapes.sort(function (shape1, shape2) { - var item1pos1 = shape1[pos1Name]; - var item1pos2 = shape1[pos2Name]; - var item2pos1 = shape2[pos1Name]; - var item2pos2 = shape2[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - items.sort(function (a, b) { - var item1pos1 = a.rect[pos1Name]; - var item1pos2 = a.rect[pos2Name]; - var item2pos1 = b.rect[pos1Name]; - var item2pos2 = b.rect[pos2Name]; - - if (item1pos1 - item2pos1) { - return item1pos1 - item2pos1; - } - - return item1pos2 - item2pos2; - }); - } - - return result; - }; - - __proto._getSquareSize = function (item) { - var _a = this.options, - column = _a.column, - margin = _a.margin, - itemSize = _a.itemSize; - - if (column) { - // if column is in options, caculate itemSize from column. - this._itemSize = (this._size + margin) / column - margin; - } else if (itemSize) { - this._itemSize = this.options.itemSize; - } else { - var sizeName = this._style.size2; // if frameSize is 0, caculate frameSize from item.size. - - var frameSize = this._shapes[sizeName] || Math.floor((this._size + margin) / (item.size[sizeName] + margin) / getColumn(item)); - this._itemSize = (this._size + margin) / frameSize - margin; - } - - return this._itemSize; - }; - - return SquareLayout; - }(FrameLayout); - - /** - * Copyright (c) NAVER Corp. - * egjs-infinitegrid projects are licensed under the MIT license - */ - InfiniteGrid.SquareLayout = SquareLayout; - - return InfiniteGrid; - -}))); -//# sourceMappingURL=infinitegrid.squarelayout.js.map diff --git a/dist/infinitegrid.squarelayout.js.map b/dist/infinitegrid.squarelayout.js.map deleted file mode 100644 index eaef66018..000000000 --- a/dist/infinitegrid.squarelayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"infinitegrid.squarelayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/lazyloaded/dist/lazyloaded.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/FrameLayout.ts","../src/layouts/SquareLayout.ts","../src/index.squarelayout.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n this._eventHandler = {};\n this.options = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {String} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport SquareLayout from \"./layouts/SquareLayout\";\n\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","v","nodeName","nodeType","slice","call","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","source","defaultOptions","assign","items","item","jQuery","constructor","jquery","arr","newItems","newGroups","groupKeys","groupKey","group","orgSize","mounted","content","outerHTML","rect","className","classList","contains","RegExp","add","ItemManager","elements","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","categorize","result","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","pos1","pos2","removeTransition","selectContainer","querySelector","style","position","container","children","appendChild","properties","p","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","itemKey","isForward","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","WIDTH","HEIGHT","isDataAttribute","prefix","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkReady","checkFinish","tagName","setTimeout","images","img","j","complete","naturalWidth","itemTarget","onError","onCheck","srcElement","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","isRelayout","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","src","removeAutoSizer","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","tslib_1","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","hasClass","addClass","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","scroller","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","frame","disableFrame","shapes","searchShapeInFrame","sort","a","b","assignOptions","itemSize","frameFill","row","_itemSize","_shapes","getShapes","_style","getStyleNames","point","_checkItemSize","size1Name","size2Name","pos1Name","pos2Name","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","startOutline","fill","endOutline","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","clone","cloneItems","columnLength","l","floor","column","_getSquareSize","makeShapeOutline","pointCaculateName","sign","columnWidth","getColumn","columnCount","shape1","shape2","item1pos1","item1pos2","item2pos1","item2pos2","sizeName","frameSize","FrameLayout","SquareLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;IASA;;;;IAIA,SAASA,WAAT,CAAqBC,KAArB,EAA4B;IAC1B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;IACD;IACD;;;;;;;IAOA,IAAIC,SAAS;IACb;IACA,YAAY;IACV,MAAIA,SAAS;IACb;IACA,cAAY;IACV;;;;;;;;;;;IAWA;;;IAGA,aAASA,SAAT,GAAqB;IACnB,WAAKC,aAAL,GAAqB,EAArB;IACA,WAAKC,OAAL,GAAe,EAAf;IACD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BA,QAAIC,MAAM,GAAGH,SAAS,CAACI,SAAvB;;IAEAD,IAAAA,MAAM,CAACE,OAAP,GAAiB,SAASA,OAAT,CAAiBC,SAAjB,EAA4BC,WAA5B,EAAyC;IACxD,UAAIA,WAAW,KAAK,KAAK,CAAzB,EAA4B;IAC1BA,QAAAA,WAAW,GAAG,EAAd;IACD;;IAED,UAAIC,WAAW,GAAG,KAAKP,aAAL,CAAmBK,SAAnB,KAAiC,EAAn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D,WAAO3V,MAAP;IACA,GAtFS;;IAuFF,wBAAA,GAAR,UAAuB/D,IAAvB;IACO,QAAA9K,iBAAA;IAAA,QAAE2jB,kBAAF;IAAA,QAAU7e,kBAAV;IAAA,QAAkBwc,sBAAlB;;IAEN,QAAIqC,MAAJ,EAAY;IACX;IACA,WAAKlC,SAAL,GAAiB,CAAC,KAAK/P,KAAL,GAAa5M,MAAd,IAAwB6e,MAAxB,GAAiC7e,MAAlD;IACA,KAHD,MAGO,IAAIwc,QAAJ,EAAc;IACpB,WAAKG,SAAL,GAAiB,KAAK9lB,OAAL,CAAa2lB,QAA9B;IACA,KAFM,MAEA;IACN,UAAMmD,QAAQ,GAAG,KAAK7C,MAAL,CAAYvX,KAA7B,CADM;;IAGN,UAAMqa,SAAS,GACZ,KAAKhD,OAAL,CAAa+C,QAAb,KACC5b,IAAI,CAAC6a,KAAL,CAAW,CAAC,KAAKhS,KAAL,GAAa5M,MAAd,KAAyBgG,IAAI,CAAC/B,IAAL,CAAW0b,QAAX,IAAwB3f,MAAjD,IAA2Dmf,SAAS,CAACnZ,IAAD,CAA/E,CAFJ;IAGA,WAAK2W,SAAL,GAAiB,CAAC,KAAK/P,KAAL,GAAa5M,MAAd,IAAwB4f,SAAxB,GAAoC5f,MAArD;IACA;;IACD,WAAO,KAAK2c,SAAZ;IACA,GAjBO;;IAkBT,qBAAA;IA/GA,EAA0CkD,YAA1C;;ICpEA;;;;AAIA,IAGC9D,YAAoB,CAAC+D,YAArB,GAAoCA,YAApC;;;;;;;;"} \ No newline at end of file diff --git a/dist/infinitegrid.squarelayout.min.js b/dist/infinitegrid.squarelayout.min.js deleted file mode 100644 index 93d552420..000000000 --- a/dist/infinitegrid.squarelayout.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.InfiniteGrid=e())}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var l=function(){return(l=Object.assign||function(t){for(var e,i=1,n=arguments.length;i]*)>/)}function q(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return J(t)?i=t:!function(t){return"function"==typeof u.jQuery&&t instanceof u.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return q(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?q(t.toArray(),!0):q(t.get(0),!1),i;if(k(t)){var n=h.createElement("div");n.innerHTML=t,i=n.childNodes}else i=h.querySelectorAll(t);return e?R(i):i&&i[0]}function B(t,e,i,n){if(o){var r=n||!1;"object"==typeof n&&(r=!!c&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function j(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function F(t){return(s?u.getComputedStyle(t):t.currentStyle)||{}}function H(t,e,i){if(J(t))return u["inner"+e]||h.body["client"+e];if(function(t){return 9===t.nodeType}(t)){var n=t.documentElement,r=t.body;return Math.max(r["scroll"+e],n["scroll"+e],r["offset"+e],n["offset"+e],n["client"+e])}var s=0;if(i){var o=t.getBoundingClientRect();s="Width"===e?o.right-o.left:o.bottom-o.top}else s=t["client"+e]||t["offset"+e];if(s)return s;var a=F(t)[e.toLowerCase()];return~a.indexOf("px")&&parseFloat(a)||0}function N(t){return H(t,"Width",!1)}function D(t){return H(t,"Height",!1)}function W(t){return H(t,"Width",!0)}function X(t){return H(t,"Height",!0)}function Y(t){return{width:W(t),height:X(t)}}var Q={vertical:{startPos1:"top",endPos1:"bottom",size1:"height",startPos2:"left",endPos2:"right",size2:"width"},horizontal:{startPos1:"left",endPos1:"right",size1:"width",startPos2:"top",endPos2:"bottom",size2:"height"}};function $(i){for(var t=[],e=1;e=_);++w)++C;i||(m-=C-1)}y.columnWidth=[a,C],f.push(((n={width:C,height:C})[d]=_-(i?0:C),n[g]=m,n.type=v+1,n.index=v,n));for(w=0;w발생할 커스텀 이벤트의 이름\n * @param {Object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @return {Boolean} Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring.
Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.stop(); // When event call to stop, `hi` event not call.\n }\n });\n some.on(\"hi\", (e) => {\n // `currentTarget` is component instance.\n console.log(some === e.currentTarget); // true\n });\n // If you want to more know event design. You can see article.\n // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n */\n\n\n var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n alert(\"hi\");\n }\n thing() {\n this.once(\"hi\", this.hi);\n }\n }\n var some = new Some();\n some.thing();\n some.trigger(\"hi\");\n // fire alert(\"hi\");\n some.trigger(\"hi\");\n // Nothing happens\n */\n\n\n _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {String} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {Boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.on(\"hi\",this.hi); //attach event\n }\n }\n */\n\n\n _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n class Some extends eg.Component {\n hi() {\n console.log(\"hi\");\n }\n some() {\n this.off(\"hi\",this.hi); //detach event\n }\n }\n */\n\n\n _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tDUMMY_POSITION,\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(styles: HTMLElement[\"style\"]) {\n\tstyles[`${TRANSITION}-property`] = \"\";\n\tstyles[`${TRANSITION}-duration`] = \"\";\n\tstyles[TRANSFORM] = \"\";\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(styles);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyles[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyles[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyles[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\n\nexport default class DOMRenderer {\n\tpublic static renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2017 NAVER Corp.\r\n@egjs/lazyloaded JavaScript library\r\n@egjs/lazyloaded project is licensed under the MIT license\r\n\r\n\r\n@version 0.0.2\n*/\nimport Component from '@egjs/component';\n\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction isDataAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nvar elements = [];\nfunction add(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAll);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction remove(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAll);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__;\n\n if (typeof elementPrefix !== \"string\") {\n elementPrefix = prefix;\n }\n\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAll() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\n/**\n * @namespace eg.LazyLoaded\n */\n\n/**\n * This module is used to wait for images or videos to load.\n * @ko 이 모듈은 이미지 또는 비디오 로딩을 대기할 수 있습니다.\n * @memberof eg.LazyLoaded\n * @param -\n * @example\n * ## HTML\n * ```html\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * finish: () => console.log(\"finish\"),\n * error: e => console.log(\"error\", e),\n * });\n * ```\n */\n\nfunction check(elements, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var component = new Component();\n var finishCount = 0;\n var readyCount = 0;\n\n function checkReady() {\n if (--readyCount !== 0) {\n return;\n }\n /**\n * An event occurs when the size of all images is available.\n * @ko 모든 이미지의 사이즈를 구할 수 있는 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#ready\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * ready: () => console.log(\"ready\"),\n * });\n * ```\n */\n\n\n component.trigger(\"ready\");\n }\n\n function checkFinish() {\n if (--finishCount !== 0) {\n return;\n }\n /**\n * An event occurs when all images have been completed loading.\n * @ko 모든 이미지가 로딩이 완료된 상태가 된 경우 이벤트가 발생한다.\n * @event eg.LazyLoaded#finish\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * finish: () => console.log(\"finish\"),\n * });\n * ```\n */\n\n\n component.trigger(\"finish\");\n }\n\n elements.forEach(function (el, i) {\n var tagName = el.tagName;\n\n if (isDataAttribute(el, prefix) && tagName !== \"IMG\") {\n add(el, prefix);\n ++finishCount;\n setTimeout(function () {\n check(toArray(el.querySelectorAll(\"img\")), prefix).on(\"finish\", function () {\n remove(el, prefix);\n checkFinish();\n });\n });\n return;\n }\n\n var images = tagName === \"IMG\" ? [el] : toArray(el.querySelectorAll(\"img\"));\n\n if (!images.length) {\n return;\n }\n\n images.forEach(function (img, j) {\n if (img.complete && (!IS_IE || IS_IE && img.naturalWidth)) {\n if (!img.naturalWidth) {\n setTimeout(function () {\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n });\n }\n\n return;\n }\n\n if (isDataAttribute(img, prefix)) {\n add(img, prefix);\n } else {\n ++readyCount;\n }\n\n ++finishCount;\n\n function onError() {\n /**\n * An event occurs if the image fails to load.\n * @ko 이미지가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.LazyLoaded#error\n * @param {object} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.itemTarget] - The item's element with error images.오류난 이미지가 있는 아이템의 엘리먼트\n * @param {number} [e.itemindex] - The item's index with error images. 오류난 이미지가 있는 아이템의 인덱스\n * @param {HTMLElement} [e.target] - Error image element 오류난 이미지 엘리먼트\n * @param {number} [e.index] - Error image index 오류난 이미지의 인덱스\n * @example\n * ```html\n *
\n * \n * \n * \n *
\n * ```\n * ## Javascript\n * ```js\n * import {check} from \"@egjs/lazyloaded\";\n *\n * eg.LazyLoaded.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * //
...
, 0, , 2\n * console.log(e.itemTarget, e.itemIndex, e.target, e.index),\n * },\n * });\n * ```\n */\n component.trigger(\"error\", {\n itemTarget: el,\n itemIndex: i,\n target: img,\n index: j\n });\n }\n\n function onCheck(e) {\n var target = e.target || e.srcElement;\n removeEvent(target, \"error\", onCheck);\n removeEvent(target, \"load\", onCheck);\n\n if (isDataAttribute(target, prefix)) {\n remove(target, prefix);\n } else {\n checkReady();\n }\n\n if (e.type === \"error\") {\n onError();\n }\n\n checkFinish();\n }\n\n addEvent(img, \"load\", onCheck);\n addEvent(img, \"error\", onCheck);\n IS_IE && img.setAttribute(\"src\", img.getAttribute(\"src\"));\n });\n });\n !readyCount && setTimeout(function () {\n component.trigger(\"ready\");\n });\n !finishCount && setTimeout(function () {\n component.trigger(\"finish\");\n });\n return component;\n}\n\nexport { check, remove as removeAutoSizer };\n//# sourceMappingURL=lazyloaded.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup } from \"./types\";\nimport { check, removeAutoSizer } from \"@egjs/lazyloaded\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tcheck(\n\t\t\telements,\n\t\t\tprefix,\n\t\t).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._complete(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\titemIndex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, itemIndex);\n\t\t}).on(\"finish\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._end(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tprivate _complete(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tremoveAutoSizer(target, prefix);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _end(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tcheck(layoutedItems.map(v => v.el!), attributePrefix).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"finish\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t}, 100);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n
    \n
  • \n
    test1
    \n
  • \n
  • \n
    test2
    \n
  • \n
  • \n
    test3
    \n
  • \n
  • \n
    test4
    \n
  • \n
  • \n
    test5
    \n
  • \n
  • \n
    test6
    \n
  • \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|String|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {Object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {String} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {Boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {Boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {Boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {Boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {Number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {Number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {String} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tDOMRenderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tDOMRenderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"
...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tDOMRenderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property as keyof StyleType] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\te.remove();\n\t\t\t\t\te.removeItem();\n\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"finish\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && DOMRenderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport SquareLayout from \"./layouts/SquareLayout\";\n\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n\nexport default InfiniteGrid;\n"],"names":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","this","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","PolyMap","keys","values","__proto","get","key","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","next","disconnect","getIndex","link","win","Result","prevList","list","added","removed","changed","maintained","changedBeforeAdded","fixed","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","fromLinks","toLinks","forEach","_a","from","to","filter","_","map","fromLink","toLink","fromIndex","orderChanged","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","document","window","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IOS","test","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","html","match","param","multi","el","isWindow","jQuery","constructor","jquery","toArray","isJQuery","isArray","v","$","nodeName","nodeType","slice","call","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","getComputedStyle","currentStyle","isOffset","body","isDocument","doc","documentElement","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","getStyles","parseFloat","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","target","_i","sources","source","arr","ItemManager","elements","groupKey","mounted","content","outerHTML","rect","makeItem","data","property","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","items","item","item2","data2","assign","status","clear","group","_this","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","prop","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","groupIndex","prevItems","newGroup","insert","groupKeys","newGroups","newItems","categorize","result","removedIndex","nextGroups","addedIndex","toIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","nextItems","nextIndex","styles","properties","p","container","view","viewport","_init","resize","DOMRenderer","prevRect","style","setAttribute","position","render","pos1","pos2","removeTransition","setTransition","removeEvent","addEvent","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","orgSize","isAppend","createElements","renderItems","_insert","_calcSize","isResize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","selectContainer","querySelector","className","children","appendChild","createContainer","df","createDocumentFragment","insertBefore","firstChild","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","find","getGroupByKey","endGroup","findLast","nextStartCursor","nextEndCursor","minCursor","min","maxCursor","scrollPos","isForward","endScrollPos","visibles","isVisible","lastIndexOf","setCursor","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","IS_IE","WIDTH","HEIGHT","isDataAttribute","prefix","add","resizeAll","__PREFIX__","elementPrefix","dataWidth","dataHeight","check","component","finishCount","readyCount","checkFinish","tagName","setTimeout","images","img","j","onCheck","srcElement","itemTarget","complete","naturalWidth","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","_complete","_error","_end","infinite","prevGroup","outline","updateSize","groupOutline","every","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","hasTarget","totalIndex","src","removeAutoSizer","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","_timer","clearTimeout","_view","_prevPos","applyScrollPos","scrollTo","pos","arrPos","x","y","scrollBy","scrollLeft","scrollTop","scroll","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_super","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","tslib_1","LayoutKlass","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","getItems","itemKeys","itemKey","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","isRelayout","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","classList","contains","RegExp","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","LOADING_APPEND","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","destroy","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","toItems","_insertItems","_c","ranges","isRecycle","some","removeItems","posName","resetSize","_setCursor","layoutItems","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","frame","disableFrame","column","itemSize","_getSquareSize","columnLength","floor","endOutline","point","fill","l","makeShapeOutline","pointCaculateName","shapes","sign","_style","pos1Name","pos2Name","columnWidth","getColumn","columnCount","_shapes","sort","shape1","shape2","item1pos1","item1pos2","item2pos1","item2pos2","a","b","_itemSize","sizeName","frameSize","defaultOptions","assignOptions","frameFill","row","searchShapeInFrame","getShapes","isHorizontal","getStyleNames","_checkItemSize","size1Name","size2Name","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","startOutline","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","clone","cloneItems","SquareLayout"],"mappings":";;;;;;;;mtBAaA,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OqX,EAAahiB,IAAI,SAAAqf,UAASvb,SAASub,EAAO,MACjDzU,IAAKwU,EAAWpf,IAAI,SAAAqf,UAASvb,SAASub,EAAO,kBAG/C,SAAgBvV,EAAiCmL,EAAwBjG,EAAoBoD,gBAA7EtI,mBAAiCmL,UAE1CyN,EAAQtQ,EAAQtI,WR9FqCA,UACrDA,EAAM9J,IAAI,SAAA+J,UAAQG,EAAO,GAAIH,KQ6FL4Y,CAAW7Y,SAElC,CACNA,MAAO4Y,EACPhY,SAAU5P,KAAKyZ,QAAQmO,EAAOzN,EAASjG,kBExWzC4P,GAAqBgE,aAAeA"} \ No newline at end of file diff --git a/dist/parallax.d.ts b/dist/parallax.d.ts deleted file mode 100644 index f4608e7a9..000000000 --- a/dist/parallax.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IAlign, IJQuery, PositionType, SizeType, IInfiniteGridItem } from "./types"; -export interface IParallaxStyle { - position: PositionType; - size: SizeType; - cammelSize: string; - coordinate: string; -} -declare class Parallax { - options: { - container: HTMLElement; - selector: string; - strength: number; - center: number; - range: number[]; - align: IAlign[keyof IAlign]; - horizontal: boolean; - }; - private _root; - private _container; - private _rootSize; - private _containerPosition; - private _style; - constructor(root?: Window | HTMLElement | IJQuery | string, options?: Partial); - resize(items?: IInfiniteGridItem[]): this; - refresh(items?: IInfiniteGridItem[], scrollPositionStart?: number): this; - private _checkParallaxItem; -} -export default Parallax; diff --git a/dist/parallax.js b/dist/parallax.js deleted file mode 100644 index df07958c2..000000000 --- a/dist/parallax.js +++ /dev/null @@ -1,450 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.eg = global.eg || {}, global.eg.Parallax = factory()); -}(this, (function () { 'use strict'; - - var win; - - if (typeof window === "undefined") { - // window is undefined in node.js - win = { - document: {}, - navigator: { - userAgent: "" - } - }; - } else { - win = window; - } - var document$1 = win.document; - - var _a; - var ua = win.navigator.userAgent; - var SUPPORT_ADDEVENTLISTENER = !!("addEventListener" in document$1); - var SUPPORT_PASSIVE = function () { - var supportsPassiveOption = false; - - try { - if (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) { - // tslint:disable-next-line: no-empty - document$1.addEventListener("test", function () {}, Object.defineProperty({}, "passive", { - get: function () { - supportsPassiveOption = true; - } - })); - } - } catch (e) {// - } - - return supportsPassiveOption; - }(); - var IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua); - var IS_IOS = /iPhone|iPad/.test(ua); - var IS_ANDROID2 = /Android 2\./.test(ua); - var agent = ua.toLowerCase(); - var isMobile = /mobi|ios|android/.test(agent); - var ALIGN = { - START: "start", - CENTER: "center", - END: "end", - JUSTIFY: "justify" - }; - var webkit = /applewebkit\/([\d|.]*)/g.exec(agent); - var WEBKIT_VERSION = webkit && parseInt(webkit[1], 10) || 0; - var TRANSFORM = (_a = function () { - var properties = { - transitionend: "", - webkitTransitionEnd: "-webkit-", - MSTransitionEnd: "-ms-", - oTransitionEnd: "-o-", - mozTransitionEnd: "-moz-" - }; - - for (var property in properties) { - var prefix = properties[property]; - - if ("on" + property.toLowerCase() in win) { - return [prefix + "transform", prefix + "transition", property]; - } - } - - return []; - }(), _a[0]), - TRANSITION = _a[1], - TRANSITION_END = _a[2]; - - function toArray(nodes) { - // SCRIPT5014 in IE8 - var array = []; - - if (nodes) { - var length = nodes.length; - - for (var i = 0; i < length; i++) { - array.push(nodes[i]); - } - } - - return array; - } - function matchHTML(html) { - return html.match(/^<([A-z]+)\s*([^>]*)>/); - } - function $(param, multi) { - if (multi === void 0) { - multi = false; - } - - var el; - - if (typeof param === "string") { - // String (HTML, Selector) - // check if string is HTML tag format - var match = matchHTML(param); // creating element - - if (match) { - // HTML - var dummy = document$1.createElement("div"); - dummy.innerHTML = param; - el = dummy.childNodes; - } else { - // Selector - el = document$1.querySelectorAll(param); - } - - if (multi) { - return toArray(el); - } else { - return el && el[0]; - } - } else if (isWindow(param)) { - // window - el = param; - } else if (isJQuery(param)) { - // jQuery - el = multi ? $(param.toArray(), true) : $(param.get(0), false); - } else if (Array.isArray(param)) { - el = param.map(function (v) { - return $(v); - }); - - if (!multi) { - el = el.length >= 1 ? el[0] : undefined; - } - } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) { - // HTMLElement, Document - el = param; - } else { - el = [].slice.call(el); - } - - return el; - } - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - for (var key in source) { - target[key] = source[key]; - } - }); - return target; - } - function isJQuery(el) { - return typeof win.jQuery === "function" && el instanceof win.jQuery || el.constructor.prototype.jquery && el.toArray; - } - function isWindow(el) { - return el === win; - } - - var style = { - vertical: { - position: "top", - size: "height", - cammelSize: "Height", - coordinate: "Y" - }, - horizontal: { - position: "left", - size: "width", - cammelSize: "Width", - coordinate: "X" - } - }; - var START = ALIGN.START, - CENTER = ALIGN.CENTER; - /** - * @classdesc Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight. You can apply parallax by scrolling the image and speed of the item. - * @ko Parallax는 서로 다른 두 개의 시선에서 바라본 물체의 외관상 위치의 변위 또는 차이입니다. 스크롤에 따라 이미지와 아이템의 속도를 차이를 줌으로써 parallax을 적용할 수 있습니다. - * @class eg.Parallax - * @param {Element|String} [root=window] Scrolling target. If you scroll in the body, set window. 스크롤하는 대상. 만약 body에서 스크롤하면 window로 설정한다. - * @param {Object} [options] The option object of eg.Parallax module eg.Parallax 모듈의 옵션 객체 - * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향) - * @param {Element|String} [options.container=null] Container wrapping items. If root and container have no gaps, do not set option. 아이템들을 감싸고 있는 컨테이너. 만약 root와 container간의 차이가 없으면, 옵션을 설정하지 않아도 된다. - * @param {String} [options.selector="img"] The selector of the image to apply the parallax in the item 아이템안에 있는 parallax를 적용할 이미지의 selector - * @param {Boolean} [options.strength=1] Dimensions that indicate the sensitivity of parallax. The higher the strength, the faster. - * @param {Boolean} [options.center=0] The middle point of parallax. The top is 1 and the bottom is -1. parallax가 가운데로 오는 점. 상단이 1이고 하단이 -1이다. - * @param {Boolean} [options.range=[-1, 1]] Range to apply the parallax. The top is 1 and the bottom is -1. parallax가 적용되는 범위, 상단이 1이고 하단이 -1이다. - * @param {Boolean} [options.align="start"] The alignment of the image in the item. ("start" : top or left, "center": middle) 아이템안의 이미지의 정렬 - * @example - ``` - - ``` - **/ - - var Parallax = - /*#__PURE__*/ - function () { - function Parallax(root, options) { - if (root === void 0) { - root = window; - } - - if (options === void 0) { - options = {}; - } - - this.options = assign({ - container: null, - selector: "img", - strength: 1, - center: 0, - range: [-1, 1], - align: START, - horizontal: false - }, options); - this._root = $(root); - this._container = this.options.container && $(this.options.container); - this._rootSize = 0; - this._containerPosition = 0; - this._style = style[this.options.horizontal ? "horizontal" : "vertical"]; - this.resize(); - } - /** - * As the browser is resized, the gaps between the root and the container and the size of the items are updated. - * @ko 브라우저의 크기가 변경됨으로 써 root와 container의 간격과 아이템들의 크기를 갱신한다. - * @method eg.Parallax#resize - * @param {Array} [items = []] Items to apply parallax. It does not apply if it is not in visible range. parallax를 적용할 아이템들. 가시거리에 존재하지 않으면 적용이 안된다. - * @return {eg.Parallax} An instance of a module itself모듈 자신의 인스턴스 - * @example - ```js - window.addEventListener("resize", function (e) { - parallax.resize(items); - }); - ``` - */ - - - var __proto = Parallax.prototype; - - __proto.resize = function (items) { - var _this = this; - - if (items === void 0) { - items = []; - } - - var root = this._root; - var container = this._container; - var positionName = this._style.position; - var sizeName = this._style.cammelSize; - - if (!container || root === container) { - this._containerPosition = 0; - } else { - var rootRect = (isWindow(root) ? document.body : root).getBoundingClientRect(); - var containertRect = container.getBoundingClientRect(); - this._containerPosition = containertRect[positionName] - rootRect[positionName]; - } - - this._rootSize = isWindow(root) ? window["inner" + sizeName] || document.documentElement["client" + sizeName] : root["client" + sizeName]; - - if (isMobile && isWindow(root)) { - var bodyWidth = document.body.offsetWidth || document.documentElement.offsetWidth; - var windowWidth = window.innerWidth; - this._rootSize = this._rootSize / (bodyWidth / windowWidth); - } - - items.forEach(function (item) { - _this._checkParallaxItem(item.el); - }); - return this; - }; - /** - * Scrolls the image in the item by a parallax. - * @ko 스크롤하면 아이템안의 이미지를 시차적용시킨다. - * @method eg.Parallax#refresh - * @param {Array} [items = []] Items to apply parallax. It does not apply if it is not in visible range. parallax를 적용할 아이템들. 가시거리에 존재하지 않으면 적용이 안된다. - * @param {Number} [scrollPositionStart = 0] The scroll position. - * @return {eg.Parallax} An instance of a module itself모듈 자신의 인스턴스 - * @example - ```js - document.body.addEventListener("scroll", function (e) { - parallax.refresh(items, e.scrollTop); - }); - ``` - */ - - - __proto.refresh = function (items, scrollPositionStart) { - var _this = this; - - if (items === void 0) { - items = []; - } - - if (scrollPositionStart === void 0) { - scrollPositionStart = 0; - } - - var styleNames = this._style; - var positionName = styleNames.position; - var coordinateName = styleNames.coordinate; - var sizeName = styleNames.size; - var options = this.options; - var strength = options.strength, - center = options.center, - range = options.range, - align = options.align; - var rootSize = this._rootSize; - var scrollPositionEnd = scrollPositionStart + rootSize; - var containerPosition = this._containerPosition; - items.forEach(function (item) { - if (!item.rect || !item.size || !item.el) { - return; - } - - var position = containerPosition + item.rect[positionName]; - var itemSize = item.rect[sizeName] || item.size[sizeName]; // check item is in container. - - if (scrollPositionStart > position + itemSize || scrollPositionEnd < position) { - return; - } - - var el = item.el; - - if (!el.__IMAGE__) { - _this._checkParallaxItem(el); - } - - if (el.__IMAGE__ === -1) { - return; - } - - var imageElement = el.__IMAGE__; - var boxElement = el.__BOX__; - var boxSize = boxElement.__SIZE__; - var imageSize = imageElement.__SIZE__; // no parallax - - if (boxSize >= imageSize) { - // remove transform style - imageElement.style[TRANSFORM] = ""; - return; - } // if area's position is center, ratio is 0. - // if area is hidden at the top, ratio is 1. - // if area is hidden at the bottom, ratio is -1. - - - var imagePosition = position + boxSize / 2; - var ratio = (scrollPositionStart + rootSize / 2 - (rootSize + boxSize) / 2 * center - imagePosition) / (rootSize + boxSize) * 2 * strength; // if ratio is out of the range of -1 and 1, show empty space. - - ratio = Math.max(Math.min(ratio, range[1]), range[0]); // dist is the position when thumnail's image is centered. - - var dist = (boxSize - imageSize) / 2; - var translate = dist * (1 - ratio); - - if (align === CENTER) { - translate -= dist; - } - - imageElement.__TRANSLATE__ = translate; - imageElement.__RATIO__ = ratio; - imageElement.style[TRANSFORM] = "translate" + coordinateName + "(" + translate + "px)"; - }); - return this; - }; - - __proto._checkParallaxItem = function (element) { - if (!element) { - return; - } - - var selector = this.options.selector; - - if (!element.__IMAGE__) { - var img = element.querySelector(selector); - element.__IMAGE__ = img || -1; - - if (!img) { - return; - } - - element.__BOX__ = img.parentNode; - } - - if (element.__IMAGE__ === -1) { - return; - } - - var sizeName = this._style.cammelSize; - element.__IMAGE__.__SIZE__ = element.__IMAGE__["offset" + sizeName]; - element.__BOX__.__SIZE__ = element.__BOX__["offset" + sizeName]; - }; - - return Parallax; - }(); - - return Parallax; - -}))); -//# sourceMappingURL=parallax.js.map diff --git a/dist/parallax.js.map b/dist/parallax.js.map deleted file mode 100644 index 8a4170f6d..000000000 --- a/dist/parallax.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parallax.js","sources":["../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/Parallax.ts"],"sourcesContent":["let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions
(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { ALIGN, isMobile, TRANSFORM } from \"./consts\";\nimport { $, isWindow, assign } from \"./utils\";\nimport { IAlign, IJQuery, PositionType, SizeType, InnerSizeType, ClientSizeType, IInfiniteGridItemElement, OffsetSizeType, IInfiniteGridItem } from \"./types\";\n\nexport interface IParallaxStyle {\n\tposition: PositionType;\n\tsize: SizeType;\n\tcammelSize: string;\n\tcoordinate: string;\n}\nconst style: {\n\tvertical: IParallaxStyle;\n\thorizontal: IParallaxStyle;\n} = {\n\tvertical: { position: \"top\", size: \"height\", cammelSize: \"Height\", coordinate: \"Y\" },\n\thorizontal: { position: \"left\", size: \"width\", cammelSize: \"Width\", coordinate: \"X\" },\n};\nconst { START, CENTER } = ALIGN;\n\n/**\n * @classdesc Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight. You can apply parallax by scrolling the image and speed of the item.\n * @ko Parallax는 서로 다른 두 개의 시선에서 바라본 물체의 외관상 위치의 변위 또는 차이입니다. 스크롤에 따라 이미지와 아이템의 속도를 차이를 줌으로써 parallax을 적용할 수 있습니다.\n * @class eg.Parallax\n * @param {Element|String} [root=window] Scrolling target. If you scroll in the body, set window. 스크롤하는 대상. 만약 body에서 스크롤하면 window로 설정한다.\n * @param {Object} [options] The option object of eg.Parallax module eg.Parallax 모듈의 옵션 객체\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Element|String} [options.container=null] Container wrapping items. If root and container have no gaps, do not set option. 아이템들을 감싸고 있는 컨테이너. 만약 root와 container간의 차이가 없으면, 옵션을 설정하지 않아도 된다.\n * @param {String} [options.selector=\"img\"] The selector of the image to apply the parallax in the item 아이템안에 있는 parallax를 적용할 이미지의 selector \n * @param {Boolean} [options.strength=1] Dimensions that indicate the sensitivity of parallax. The higher the strength, the faster.\n * @param {Boolean} [options.center=0] The middle point of parallax. The top is 1 and the bottom is -1. parallax가 가운데로 오는 점. 상단이 1이고 하단이 -1이다. \n * @param {Boolean} [options.range=[-1, 1]] Range to apply the parallax. The top is 1 and the bottom is -1. parallax가 적용되는 범위, 상단이 1이고 하단이 -1이다. \n * @param {Boolean} [options.align=\"start\"] The alignment of the image in the item. (\"start\" : top or left, \"center\": middle) 아이템안의 이미지의 정렬 \n * @example\n```\n\n```\n **/\nclass Parallax {\n\tpublic options: {\n\t\tcontainer: HTMLElement;\n\t\tselector: string;\n\t\tstrength: number;\n\t\tcenter: number;\n\t\trange: number[];\n\t\talign: IAlign[keyof IAlign];\n\t\thorizontal: boolean;\n\t};\n\tprivate _root: Window | HTMLElement;\n\tprivate _container: HTMLElement;\n\tprivate _rootSize: number;\n\tprivate _containerPosition: number;\n\tprivate _style: IParallaxStyle;\n\tconstructor(\n\t\troot: Window | HTMLElement | IJQuery | string = window,\n\t\toptions: Partial = {}) {\n\t\tthis.options = assign({\n\t\t\tcontainer: null,\n\t\t\tselector: \"img\",\n\t\t\tstrength: 1,\n\t\t\tcenter: 0,\n\t\t\trange: [-1, 1],\n\t\t\talign: START,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._root = $(root);\n\t\tthis._container = this.options.container && $(this.options.container);\n\t\tthis._rootSize = 0;\n\t\tthis._containerPosition = 0;\n\t\tthis._style = style[this.options.horizontal ? \"horizontal\" : \"vertical\"];\n\t\tthis.resize();\n\t}\n\t/**\n\t * As the browser is resized, the gaps between the root and the container and the size of the items are updated.\n\t * @ko 브라우저의 크기가 변경됨으로 써 root와 container의 간격과 아이템들의 크기를 갱신한다.\n\t * @method eg.Parallax#resize\n\t * @param {Array} [items = []] Items to apply parallax. It does not apply if it is not in visible range. parallax를 적용할 아이템들. 가시거리에 존재하지 않으면 적용이 안된다.\n\t * @return {eg.Parallax} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n ```js\n window.addEventListener(\"resize\", function (e) {\n\tparallax.resize(items);\n });\n ```\n\t */\n\tpublic resize(items: IInfiniteGridItem[] = []) {\n\t\tconst root = this._root;\n\t\tconst container = this._container;\n\t\tconst positionName = this._style.position;\n\t\tconst sizeName = this._style.cammelSize;\n\n\t\tif (!container || root === container) {\n\t\t\tthis._containerPosition = 0;\n\t\t} else {\n\t\t\tconst rootRect = (isWindow(root) ? document.body : root).getBoundingClientRect();\n\t\t\tconst containertRect = container.getBoundingClientRect();\n\n\t\t\tthis._containerPosition = containertRect[positionName] - rootRect[positionName];\n\t\t}\n\t\tthis._rootSize = isWindow(root) ?\n\t\t\twindow[`inner${sizeName}` as InnerSizeType] ||\n\t\t\tdocument.documentElement[`client${sizeName}` as ClientSizeType] :\n\t\t\troot[`client${sizeName}` as ClientSizeType];\n\n\t\tif (isMobile && isWindow(root)) {\n\t\t\tconst bodyWidth = document.body.offsetWidth || document.documentElement.offsetWidth;\n\t\t\tconst windowWidth = window.innerWidth;\n\n\t\t\tthis._rootSize = this._rootSize / (bodyWidth / windowWidth);\n\t\t}\n\t\titems.forEach(item => {\n\t\t\tthis._checkParallaxItem(item.el!);\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Scrolls the image in the item by a parallax.\n\t * @ko 스크롤하면 아이템안의 이미지를 시차적용시킨다.\n\t * @method eg.Parallax#refresh\n\t * @param {Array} [items = []] Items to apply parallax. It does not apply if it is not in visible range. parallax를 적용할 아이템들. 가시거리에 존재하지 않으면 적용이 안된다.\n\t * @param {Number} [scrollPositionStart = 0] The scroll position.\n\t * @return {eg.Parallax} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n ```js\n document.body.addEventListener(\"scroll\", function (e) {\n\tparallax.refresh(items, e.scrollTop);\n });\n ```\n\t */\n\tpublic refresh(items: IInfiniteGridItem[] = [], scrollPositionStart = 0) {\n\t\tconst styleNames = this._style;\n\t\tconst positionName = styleNames.position;\n\t\tconst coordinateName = styleNames.coordinate;\n\t\tconst sizeName = styleNames.size;\n\t\tconst options = this.options;\n\t\tconst { strength, center, range, align } = options;\n\t\tconst rootSize = this._rootSize;\n\t\tconst scrollPositionEnd = scrollPositionStart + rootSize;\n\t\tconst containerPosition = this._containerPosition;\n\n\t\titems.forEach(item => {\n\t\t\tif (!item.rect || !item.size || !item.el) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst position = containerPosition + item.rect[positionName];\n\t\t\tconst itemSize = item.rect[sizeName] || item.size[sizeName];\n\n\t\t\t// check item is in container.\n\t\t\tif (scrollPositionStart > position + itemSize ||\n\t\t\t\tscrollPositionEnd < position) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst el = item.el;\n\n\t\t\tif (!el.__IMAGE__) {\n\t\t\t\tthis._checkParallaxItem(el);\n\t\t\t}\n\t\t\tif (el.__IMAGE__ === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst imageElement = el.__IMAGE__!;\n\t\t\tconst boxElement = el.__BOX__!;\n\t\t\tconst boxSize = boxElement.__SIZE__!;\n\t\t\tconst imageSize = imageElement.__SIZE__!;\n\n\t\t\t// no parallax\n\t\t\tif (boxSize >= imageSize) {\n\t\t\t\t// remove transform style\n\t\t\t\timageElement.style[TRANSFORM] = \"\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if area's position is center, ratio is 0.\n\t\t\t// if area is hidden at the top, ratio is 1.\n\t\t\t// if area is hidden at the bottom, ratio is -1.\n\t\t\tconst imagePosition = position + boxSize / 2;\n\t\t\tlet ratio = (scrollPositionStart + rootSize / 2 -\n\t\t\t\t(rootSize + boxSize) / 2 * center - imagePosition) /\n\t\t\t\t(rootSize + boxSize) * 2 * strength;\n\n\t\t\t// if ratio is out of the range of -1 and 1, show empty space.\n\t\t\tratio = Math.max(Math.min(ratio, range[1]), range[0]);\n\n\t\t\t// dist is the position when thumnail's image is centered.\n\t\t\tconst dist = (boxSize - imageSize) / 2;\n\t\t\tlet translate = dist * (1 - ratio);\n\n\t\t\tif (align === CENTER) {\n\t\t\t\ttranslate -= dist;\n\t\t\t}\n\n\t\t\timageElement.__TRANSLATE__ = translate;\n\t\t\timageElement.__RATIO__ = ratio;\n\t\t\timageElement.style[TRANSFORM] = `translate${coordinateName}(${translate}px)`;\n\t\t});\n\t\treturn this;\n\t}\n\tprivate _checkParallaxItem(element: IInfiniteGridItemElement) {\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\t\tconst selector = this.options.selector;\n\n\t\tif (!element.__IMAGE__) {\n\t\t\tconst img = element.querySelector(selector);\n\n\t\t\telement.__IMAGE__ = img || -1;\n\t\t\tif (!img) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.__BOX__ = img.parentNode as IInfiniteGridItemElement;\n\t\t}\n\t\tif (element.__IMAGE__ === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst sizeName = this._style.cammelSize;\n\n\t\telement.__IMAGE__.__SIZE__ = element.__IMAGE__[`offset${sizeName}` as OffsetSizeType];\n\t\telement.__BOX__!.__SIZE__ = element.__BOX__![`offset${sizeName}` as OffsetSizeType];\n\t}\n}\n\nexport default Parallax;\n"],"names":["win","window","document","navigator","userAgent","ua","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","Object","defineProperty","addEventListener","get","e","IS_IE","test","IS_IOS","IS_ANDROID2","agent","toLowerCase","isMobile","ALIGN","START","CENTER","END","JUSTIFY","webkit","exec","WEBKIT_VERSION","parseInt","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","length","i","push","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","Array","isArray","map","v","undefined","nodeName","nodeType","slice","call","target","_i","sources","forEach","source","key","jQuery","constructor","prototype","jquery","style","vertical","position","size","cammelSize","coordinate","horizontal","root","options","assign","container","selector","strength","center","range","align","_root","_container","_rootSize","_containerPosition","_style","resize","items","positionName","sizeName","rootRect","body","getBoundingClientRect","containertRect","documentElement","bodyWidth","offsetWidth","windowWidth","innerWidth","item","_this","_checkParallaxItem","scrollPositionStart","styleNames","coordinateName","rootSize","scrollPositionEnd","containerPosition","rect","itemSize","__IMAGE__","imageElement","boxElement","__BOX__","boxSize","__SIZE__","imageSize","imagePosition","ratio","Math","max","min","dist","translate","__TRANSLATE__","__RATIO__","element","img","querySelector","parentNode"],"mappings":";;;;;;;;;;;;;;CAAA,IAAIA,GAAJ;;CAEA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;CAClC;CACAD,EAAAA,GAAG,GAAG;CACLE,IAAAA,QAAQ,EAAE,EADL;CAELC,IAAAA,SAAS,EAAE;CACVC,MAAAA,SAAS,EAAE;CADD;CAFN,GAAN;CAMA,CARD,MAQO;CACNJ,EAAAA,GAAG,GAAGC,MAAN;CACA;CAGM,IAAMC,UAAQ,GAAGF,GAAG,CAACE,QAArB;;;CCZP,IAAMG,EAAE,GAAGJ,GAAM,CAACE,SAAP,CAAiBC,SAA5B;AAEA,CACO,IAAME,wBAAwB,GAAG,CAAC,EAAE,sBAAsBJ,UAAxB,CAAlC;AACP,CAAO,IAAMK,eAAe,GAAI;CAC/B,MAAIC,qBAAqB,GAAG,KAA5B;;CAEA,MAAI;CACH,QAAIF,wBAAwB,IAAIG,MAAM,CAACC,cAAvC,EAAuD;CACtD;CACAR,MAAAA,UAAQ,CAACS,gBAAT,CAA0B,MAA1B,EAAkC,cAAlC,EAA6CF,MAAM,CAACC,cAAP,CAAsB,EAAtB,EAC5C,SAD4C,EACjC;CACXE,QAAAA,GAAG;CACFJ,UAAAA,qBAAqB,GAAG,IAAxB;CACA;CAHU,OADiC,CAA7C;CAMA;CACD,GAVD,CAUE,OAAOK,CAAP,EAAU;CAEX;;CACD,SAAOL,qBAAP;CACA,CAjB8B,EAAxB;AAmBP,CAAO,IAAMM,KAAK,GAAG,kCAAkCC,IAAlC,CAAuCV,EAAvC,CAAd;AACP,CAAO,IAAMW,MAAM,GAAG,cAAcD,IAAd,CAAmBV,EAAnB,CAAf;AACP,CAAO,IAAMY,WAAW,GAAG,cAAcF,IAAd,CAAmBV,EAAnB,CAApB;AACP,CA6BO,IAAMa,KAAK,GAAGb,EAAE,CAACc,WAA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,CAACb,OAAR,GAAkBc,GAAG,CAACE,UAAtB;CACA;;CACD,QAAIH,OAAO,CAAChB,SAAR,KAAsB,CAAC,CAA3B,EAA8B;CAC7B;CACA;;CACD,QAAMrB,QAAQ,GAAG,KAAKJ,MAAL,CAAYhB,UAA7B;CAEAyD,IAAAA,OAAO,CAAChB,SAAR,CAAkBK,QAAlB,GAA6BW,OAAO,CAAChB,SAAR,CAAkB,WAASrB,QAA3B,CAA7B;CACAqC,IAAAA,OAAO,CAACb,OAAR,CAAiBE,QAAjB,GAA4BW,OAAO,CAACb,OAAR,CAAiB,WAASxB,QAA1B,CAA5B;CACA,GAtBO;;CAuBT,iBAAA;CAAC,GAvLD;;;;;;;;"} \ No newline at end of file diff --git a/dist/parallax.min.js b/dist/parallax.min.js deleted file mode 100644 index 8f60ed14b..000000000 --- a/dist/parallax.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2015 NAVER Corp. -name: @egjs/infinitegrid -license: MIT -author: NAVER Corp. -repository: https://github.com/naver/egjs-infinitegrid -version: 3.6.3 -*/ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Parallax=e())}(this,function(){"use strict";var o,t,r=(o="undefined"==typeof window?{document:{},navigator:{userAgent:""}}:window).document,e=o.navigator.userAgent,i=!!("addEventListener"in r),n=(function(){var t=!1;try{i&&Object.defineProperty&&r.addEventListener("test",function(){},Object.defineProperty({},"passive",{get:function(){t=!0}}))}catch(t){}}(),/MSIE|Trident|Windows Phone|Edge/.test(e),/iPhone|iPad/.test(e),/Android 2\./.test(e),e.toLowerCase()),d=/mobi|ios|android/.test(n),s="start",a="center",_=/applewebkit\/([\d|.]*)/g.exec(n),z=(_&&parseInt(_[1],10),(t=function(){var t={transitionend:"",webkitTransitionEnd:"-webkit-",MSTransitionEnd:"-ms-",oTransitionEnd:"-o-",mozTransitionEnd:"-moz-"};for(var e in t){var i=t[e];if("on"+e.toLowerCase()in o)return[i+"transform",i+"transition",e]}return[]}())[0]);t[1],t[2];function c(t,e){var i;if(void 0===e&&(e=!1),"string"!=typeof t)return f(t)?i=t:!function(t){return"function"==typeof o.jQuery&&t instanceof o.jQuery||t.constructor.prototype.jquery&&t.toArray}(t)?Array.isArray(t)?(i=t.map(function(t){return c(t)}),e||(i=1<=i.length?i[0]:void 0)):i=!t.nodeName||1!==t.nodeType&&9!==t.nodeType?[].slice.call(i):t:i=e?c(t.toArray(),!0):c(t.get(0),!1),i;if(function(t){return t.match(/^<([A-z]+)\s*([^>]*)>/)}(t)){var n=r.createElement("div");n.innerHTML=t,i=n.childNodes}else i=r.querySelectorAll(t);return e?function(t){var e=[];if(t)for(var i=t.length,n=0;n {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyles(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { ALIGN, isMobile, TRANSFORM } from \"./consts\";\nimport { $, isWindow, assign } from \"./utils\";\nimport { IAlign, IJQuery, PositionType, SizeType, InnerSizeType, ClientSizeType, IInfiniteGridItemElement, OffsetSizeType, IInfiniteGridItem } from \"./types\";\n\nexport interface IParallaxStyle {\n\tposition: PositionType;\n\tsize: SizeType;\n\tcammelSize: string;\n\tcoordinate: string;\n}\nconst style: {\n\tvertical: IParallaxStyle;\n\thorizontal: IParallaxStyle;\n} = {\n\tvertical: { position: \"top\", size: \"height\", cammelSize: \"Height\", coordinate: \"Y\" },\n\thorizontal: { position: \"left\", size: \"width\", cammelSize: \"Width\", coordinate: \"X\" },\n};\nconst { START, CENTER } = ALIGN;\n\n/**\n * @classdesc Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight. You can apply parallax by scrolling the image and speed of the item.\n * @ko Parallax는 서로 다른 두 개의 시선에서 바라본 물체의 외관상 위치의 변위 또는 차이입니다. 스크롤에 따라 이미지와 아이템의 속도를 차이를 줌으로써 parallax을 적용할 수 있습니다.\n * @class eg.Parallax\n * @param {Element|String} [root=window] Scrolling target. If you scroll in the body, set window. 스크롤하는 대상. 만약 body에서 스크롤하면 window로 설정한다.\n * @param {Object} [options] The option object of eg.Parallax module eg.Parallax 모듈의 옵션 객체\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Element|String} [options.container=null] Container wrapping items. If root and container have no gaps, do not set option. 아이템들을 감싸고 있는 컨테이너. 만약 root와 container간의 차이가 없으면, 옵션을 설정하지 않아도 된다.\n * @param {String} [options.selector=\"img\"] The selector of the image to apply the parallax in the item 아이템안에 있는 parallax를 적용할 이미지의 selector \n * @param {Boolean} [options.strength=1] Dimensions that indicate the sensitivity of parallax. The higher the strength, the faster.\n * @param {Boolean} [options.center=0] The middle point of parallax. The top is 1 and the bottom is -1. parallax가 가운데로 오는 점. 상단이 1이고 하단이 -1이다. \n * @param {Boolean} [options.range=[-1, 1]] Range to apply the parallax. The top is 1 and the bottom is -1. parallax가 적용되는 범위, 상단이 1이고 하단이 -1이다. \n * @param {Boolean} [options.align=\"start\"] The alignment of the image in the item. (\"start\" : top or left, \"center\": middle) 아이템안의 이미지의 정렬 \n * @example\n```\n\n```\n **/\nclass Parallax {\n\tpublic options: {\n\t\tcontainer: HTMLElement;\n\t\tselector: string;\n\t\tstrength: number;\n\t\tcenter: number;\n\t\trange: number[];\n\t\talign: IAlign[keyof IAlign];\n\t\thorizontal: boolean;\n\t};\n\tprivate _root: Window | HTMLElement;\n\tprivate _container: HTMLElement;\n\tprivate _rootSize: number;\n\tprivate _containerPosition: number;\n\tprivate _style: IParallaxStyle;\n\tconstructor(\n\t\troot: Window | HTMLElement | IJQuery | string = window,\n\t\toptions: Partial = {}) {\n\t\tthis.options = assign({\n\t\t\tcontainer: null,\n\t\t\tselector: \"img\",\n\t\t\tstrength: 1,\n\t\t\tcenter: 0,\n\t\t\trange: [-1, 1],\n\t\t\talign: START,\n\t\t\thorizontal: false,\n\t\t}, options);\n\t\tthis._root = $(root);\n\t\tthis._container = this.options.container && $(this.options.container);\n\t\tthis._rootSize = 0;\n\t\tthis._containerPosition = 0;\n\t\tthis._style = style[this.options.horizontal ? \"horizontal\" : \"vertical\"];\n\t\tthis.resize();\n\t}\n\t/**\n\t * As the browser is resized, the gaps between the root and the container and the size of the items are updated.\n\t * @ko 브라우저의 크기가 변경됨으로 써 root와 container의 간격과 아이템들의 크기를 갱신한다.\n\t * @method eg.Parallax#resize\n\t * @param {Array} [items = []] Items to apply parallax. It does not apply if it is not in visible range. parallax를 적용할 아이템들. 가시거리에 존재하지 않으면 적용이 안된다.\n\t * @return {eg.Parallax} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n ```js\n window.addEventListener(\"resize\", function (e) {\n\tparallax.resize(items);\n });\n ```\n\t */\n\tpublic resize(items: IInfiniteGridItem[] = []) {\n\t\tconst root = this._root;\n\t\tconst container = this._container;\n\t\tconst positionName = this._style.position;\n\t\tconst sizeName = this._style.cammelSize;\n\n\t\tif (!container || root === container) {\n\t\t\tthis._containerPosition = 0;\n\t\t} else {\n\t\t\tconst rootRect = (isWindow(root) ? document.body : root).getBoundingClientRect();\n\t\t\tconst containertRect = container.getBoundingClientRect();\n\n\t\t\tthis._containerPosition = containertRect[positionName] - rootRect[positionName];\n\t\t}\n\t\tthis._rootSize = isWindow(root) ?\n\t\t\twindow[`inner${sizeName}` as InnerSizeType] ||\n\t\t\tdocument.documentElement[`client${sizeName}` as ClientSizeType] :\n\t\t\troot[`client${sizeName}` as ClientSizeType];\n\n\t\tif (isMobile && isWindow(root)) {\n\t\t\tconst bodyWidth = document.body.offsetWidth || document.documentElement.offsetWidth;\n\t\t\tconst windowWidth = window.innerWidth;\n\n\t\t\tthis._rootSize = this._rootSize / (bodyWidth / windowWidth);\n\t\t}\n\t\titems.forEach(item => {\n\t\t\tthis._checkParallaxItem(item.el!);\n\t\t});\n\n\t\treturn this;\n\t}\n\t/**\n\t * Scrolls the image in the item by a parallax.\n\t * @ko 스크롤하면 아이템안의 이미지를 시차적용시킨다.\n\t * @method eg.Parallax#refresh\n\t * @param {Array} [items = []] Items to apply parallax. It does not apply if it is not in visible range. parallax를 적용할 아이템들. 가시거리에 존재하지 않으면 적용이 안된다.\n\t * @param {Number} [scrollPositionStart = 0] The scroll position.\n\t * @return {eg.Parallax} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n ```js\n document.body.addEventListener(\"scroll\", function (e) {\n\tparallax.refresh(items, e.scrollTop);\n });\n ```\n\t */\n\tpublic refresh(items: IInfiniteGridItem[] = [], scrollPositionStart = 0) {\n\t\tconst styleNames = this._style;\n\t\tconst positionName = styleNames.position;\n\t\tconst coordinateName = styleNames.coordinate;\n\t\tconst sizeName = styleNames.size;\n\t\tconst options = this.options;\n\t\tconst { strength, center, range, align } = options;\n\t\tconst rootSize = this._rootSize;\n\t\tconst scrollPositionEnd = scrollPositionStart + rootSize;\n\t\tconst containerPosition = this._containerPosition;\n\n\t\titems.forEach(item => {\n\t\t\tif (!item.rect || !item.size || !item.el) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst position = containerPosition + item.rect[positionName];\n\t\t\tconst itemSize = item.rect[sizeName] || item.size[sizeName];\n\n\t\t\t// check item is in container.\n\t\t\tif (scrollPositionStart > position + itemSize ||\n\t\t\t\tscrollPositionEnd < position) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst el = item.el;\n\n\t\t\tif (!el.__IMAGE__) {\n\t\t\t\tthis._checkParallaxItem(el);\n\t\t\t}\n\t\t\tif (el.__IMAGE__ === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst imageElement = el.__IMAGE__!;\n\t\t\tconst boxElement = el.__BOX__!;\n\t\t\tconst boxSize = boxElement.__SIZE__!;\n\t\t\tconst imageSize = imageElement.__SIZE__!;\n\n\t\t\t// no parallax\n\t\t\tif (boxSize >= imageSize) {\n\t\t\t\t// remove transform style\n\t\t\t\timageElement.style[TRANSFORM] = \"\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if area's position is center, ratio is 0.\n\t\t\t// if area is hidden at the top, ratio is 1.\n\t\t\t// if area is hidden at the bottom, ratio is -1.\n\t\t\tconst imagePosition = position + boxSize / 2;\n\t\t\tlet ratio = (scrollPositionStart + rootSize / 2 -\n\t\t\t\t(rootSize + boxSize) / 2 * center - imagePosition) /\n\t\t\t\t(rootSize + boxSize) * 2 * strength;\n\n\t\t\t// if ratio is out of the range of -1 and 1, show empty space.\n\t\t\tratio = Math.max(Math.min(ratio, range[1]), range[0]);\n\n\t\t\t// dist is the position when thumnail's image is centered.\n\t\t\tconst dist = (boxSize - imageSize) / 2;\n\t\t\tlet translate = dist * (1 - ratio);\n\n\t\t\tif (align === CENTER) {\n\t\t\t\ttranslate -= dist;\n\t\t\t}\n\n\t\t\timageElement.__TRANSLATE__ = translate;\n\t\t\timageElement.__RATIO__ = ratio;\n\t\t\timageElement.style[TRANSFORM] = `translate${coordinateName}(${translate}px)`;\n\t\t});\n\t\treturn this;\n\t}\n\tprivate _checkParallaxItem(element: IInfiniteGridItemElement) {\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\t\tconst selector = this.options.selector;\n\n\t\tif (!element.__IMAGE__) {\n\t\t\tconst img = element.querySelector(selector);\n\n\t\t\telement.__IMAGE__ = img || -1;\n\t\t\tif (!img) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.__BOX__ = img.parentNode as IInfiniteGridItemElement;\n\t\t}\n\t\tif (element.__IMAGE__ === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst sizeName = this._style.cammelSize;\n\n\t\telement.__IMAGE__.__SIZE__ = element.__IMAGE__[`offset${sizeName}` as OffsetSizeType];\n\t\telement.__BOX__!.__SIZE__ = element.__BOX__![`offset${sizeName}` as OffsetSizeType];\n\t}\n}\n\nexport default Parallax;\n"],"names":["win","document","window","navigator","userAgent","ua","SUPPORT_ADDEVENTLISTENER","agent","supportsPassiveOption","Object","defineProperty","addEventListener","get","e","test","toLowerCase","isMobile","ALIGN","webkit","exec","TRANSFORM","parseInt","param","multi","el","isWindow","jQuery","constructor","prototype","jquery","toArray","isJQuery","Array","isArray","map","v","$","length","undefined","nodeName","nodeType","slice","call","html","match","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","nodes","array","i","push","style","vertical","position","size","cammelSize","coordinate","horizontal","START","CENTER","root","options","target","_i","sources","forEach","source","key","assign","container","selector","strength","center","range","align","_root","_container","this","_rootSize","_containerPosition","_style","resize","items","positionName","sizeName","rootRect","body","getBoundingClientRect","containertRect","documentElement","bodyWidth","offsetWidth","windowWidth","innerWidth","item","_this","_checkParallaxItem","scrollPositionStart","styleNames","coordinateName","rootSize","scrollPositionEnd","containerPosition","rect","__IMAGE__","imageElement","boxSize","__BOX__","__SIZE__","imageSize","ratio","dist","translate","Math","max","min","__TRANSLATE__","__RATIO__","element","img","querySelector","parentNode"],"mappings":";;;;;;;;uMAAA,IAAIA,IAeSC,GAXZD,EAFqB,oBAAXE,OAEJ,CACLD,SAAU,GACVE,UAAW,CACVC,UAAW,KAIPF,QAIqBD,SCZtBI,EAAKH,EAAOC,UAAUC,UAGfE,KAA8B,qBAAsBL,GAoDpDM,GAnDmB,eAC3BC,GAAwB,MAGvBF,GAA4BG,OAAOC,gBAEtCT,EAASU,iBAAiB,OAAQ,aAAWF,OAAOC,eAAe,GAClE,UAAW,CACXE,eACCJ,GAAwB,MAI1B,MAAOK,KAbsB,GAmBX,kCAAkCC,KAAKT,GACtC,cAAcS,KAAKT,GACd,cAAcS,KAAKT,GA8BzBA,EAAGU,eACXC,EAAW,mBAAmBF,KAAKP,GAEnCU,EACL,QADKA,EAEJ,SAUHC,EAAS,0BAA0BC,KAAKZ,GAchCa,GAZiBF,GAAUG,SAASH,EAAO,GAAI,mRCrB5DI,EACAC,OAEIC,kBAFJD,MAIqB,iBAAVD,SAkBAG,EAASH,GACnBE,EAAKF,YAkMkBE,SACkB,mBAA1BtB,EAAewB,QAAyBF,aAAetB,EAAewB,QACrFF,EAAGG,YAAYC,UAAUC,QAAUL,EAAGM,QAnM5BC,CAAST,GAGTU,MAAMC,QAAQX,IACxBE,EAAKF,EAAMY,IAAI,SAAAC,UAAKC,EAAED,KACjBZ,IACJC,EAAkB,GAAbA,EAAGa,OAAeb,EAAqB,QAAKc,IAMlDd,GAJUF,EAAMiB,UACI,IAAnBjB,EAAMkB,UAAqC,IAAnBlB,EAAM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W,EAAIlC,GAFNnB,EAAWqD,EAAU,KAGzCN,EAAWM,GAAW,EAAInC,EAMtBwC,GAAQL,EAAUG,GAAa,EACjCG,EAAYD,GAAQ,GAJxBD,EAAQG,KAAKC,IAAID,KAAKE,IAAIL,EAAOrC,EAAM,IAAKA,EAAM,MAM9CC,IAAUf,IACbqD,GAAaD,GAGdN,EAAaW,cAAgBJ,EAC7BP,EAAaY,UAAYP,EACzBL,EAAatD,MAAMnC,GAAa,YAAYmF,MAAkBa,cAExDnC,2BAER,SAA2ByC,MACrBA,OAGChD,EAAWO,KAAKhB,QAAQS,aAEzBgD,EAAQd,UAAW,KACjBe,EAAMD,EAAQE,cAAwClD,MAE5DgD,EAAQd,UAAYe,IAAQ,GACvBA,SAGLD,EAAQX,QAAUY,EAAIE,eAEI,IAAvBH,EAAQd,eAGNpB,EAAWP,KAAKG,OAAOzB,WAE7B+D,EAAQd,UAAUI,SAAWU,EAAQd,UAAU,SAASpB,GACxDkC,EAAQX,QAASC,SAAWU,EAAQX,QAAS,SAASvB"} \ No newline at end of file diff --git a/dist/types.d.ts b/dist/types.d.ts deleted file mode 100644 index c29dc758c..000000000 --- a/dist/types.d.ts +++ /dev/null @@ -1,256 +0,0 @@ -import Component from "@egjs/component"; -import InfiniteGrid from "./index.squarelayout"; -export declare type CursorType = "start" | "end"; -export declare type SizeType = "width" | "height"; -export declare type PositionType = "left" | "top"; -export declare type ReversePositionType = "right" | "bottom"; -export declare type RectType = SizeType | PositionType; -export declare type InnerSizeType = "innerWidth" | "innerHeight"; -export declare type ClientSizeType = "clientWidth" | "clientHeight"; -export declare type OffsetSizeType = "offsetWidth" | "offsetHeight"; -export declare type ScrollSizeType = "scrollWidth" | "scrollHeight"; -export interface IInfiniteGridOptions { - itemSelector: string; - isOverflowScroll: boolean; - threshold: number; - isEqualSize: boolean; - isConstantSize: boolean; - useRecycle: boolean; - horizontal: boolean; - transitionDuration: number; - useFit: boolean; - attributePrefix: string; - renderExternal: boolean; -} -export interface IInfiniteGridGroup { - groupKey: string | number; - items: IInfiniteGridItem[]; - outlines: { - start: number[]; - end: number[]; - }; -} -export interface IWatcherOptions { - container: HTMLElement; - isOverflowScroll: boolean; - horizontal: boolean; - resize: () => void; - check: (e: { - isForward: boolean; - scrollPos: number; - orgScrollPos: number; - horizontal: boolean; - }) => void; -} -export interface IInfiniteOptions { - useRecycle: boolean; - threshold: number; - append: (e: { - cache: IInfiniteGridGroup[]; - }) => void; - prepend: (e: { - cache: IInfiniteGridGroup[]; - }) => void; - recycle: (e: { - start: number; - end: number; - }) => void; -} -export interface IInfiniteGridOptions { - itemSelector: string; - isOverflowScroll: boolean; - threshold: number; - isEqualSize: boolean; - isConstantSize: boolean; - useRecycle: boolean; - horizontal: boolean; - transitionDuration: number; - useFit: boolean; - attributePrefix: string; - renderExternal: boolean; -} -export interface IInfiniteGridStatus { - _status: { - processingStatus: number; - loadingSize: number; - loadingStyle: StyleType; - }; - _itemManager: IItemManagerStatus; - _renderer: IDOMRendererStatus; - _watcher: IWatchStatus; - _infinite: IInfiniteStatus; -} -export interface IItemManagerStatus { - _data: IInfiniteGridGroup[]; -} -export interface IInfiniteStatus { - startCursor: number; - endCursor: number; - size: number; -} -export interface IDOMRendererSize { - container: number; - view: number; - viewport: number; - item?: ISize | null; -} -export interface IDOMRendererStatus { - cssText: string; - _size: IDOMRendererSize; -} -export interface IWatchStatus { - _prevPos: number | null; - scrollPos: number; -} -export interface IRemoveResult { - group: IInfiniteGridGroup | null; - items: IInfiniteGridItem[]; -} -export interface IErrorCallbackOptions { - target: HTMLImageElement; - element: HTMLElement; - items: IInfiniteGridItem[]; - item: IInfiniteGridItem; - itemIndex: number; - totalIndex: number; - replace: (src: string) => void; - replaceItem: (content: string) => void; - remove: () => void; - removeItem: () => void; -} -export interface IInfiniteGridItem { - groupKey: string | number; - itemKey?: string | number; - content: string; - el?: IInfiniteGridItemElement | null; - orgSize?: ISize | null; - size?: ISize | null; - rect: IPosition & Partial; - prevRect?: (IPosition & Partial) | null; - mounted: boolean; - [key: string]: any; -} -export interface IIndexes { - groupIndex?: number; - itemIndex?: number; -} -export interface IGroup { - groupKey: string | number; - [key: string]: any; -} -export interface IItem { - groupKey: string | number; - itemKey?: string | number; - [key: string]: any; -} -export declare type Equals = (() => T extends X ? 1 : 2) extends (() => T extends Y ? 1 : 2) ? A : B; -export declare type ExcludeReadOnly = Pick); -}[string & keyof T]>; -export declare type StyleType = Partial>; -export interface IInfiniteGridItemElement extends HTMLElement { - _INFINITEGRID_TRANSITION?: boolean; - __IMAGE__?: -1 | IInfiniteGridItemElement; - __BOX__?: IInfiniteGridItemElement; - __SIZE__?: number; - __TRANSLATE__?: number; - __RATIO__?: number; -} -export interface ITransitionProperties { - property: "transition-property"; - duration: "transition-duration"; - delay: "transition-delay"; -} -export interface IRectlProperties { - startPos1: PositionType; - endPos1: ReversePositionType; - size1: SizeType; - startPos2: PositionType; - endPos2: ReversePositionType; - size2: SizeType; -} -export interface IAlign { - START: "start"; - CENTER: "center"; - END: "end"; - JUSTIFY: "justify"; -} -export interface IPosition { - top: number; - left: number; -} -export interface ISize { - width: number; - height: number; -} -export interface IJQuery { - length: number; - jquery: string; - toArray(): Array; - get(index: number): string | HTMLElement; -} -export interface ILayoutResult { - items: IInfiniteGridItem[]; - outlines: { - start: number[]; - end: number[]; - }; -} -export interface ILayout { - options: { - horizontal: boolean; - margin: number; - [key: string]: any; - }; - append(groupItems: IInfiniteGridItem[], outline: number[], cache?: boolean): ILayoutResult; - prepend(groupItems: IInfiniteGridItem[], outline: number[], cache?: boolean): ILayoutResult; - setSize(size: number): this; - layout(groups: IInfiniteGridGroup[], outline: number[]): this; -} -export interface IImageLoadedOptions { - prefix?: string; - length?: number; - type?: 1 | 2; - complete?: () => void; - end?: () => void; - error?: (e: { - target: LoadingImageElement; - itemIndex: number; - }) => void; -} -export interface LoadingImageElement extends HTMLImageElement { - __ITEM_INDEX__?: number; -} -export interface IDOMRendererOptions { - isEqualSize: boolean; - isConstantSize: boolean; - horizontal: boolean; - container: boolean | HTMLElement; -} -export interface IDOMRendererOrgStyle { - position?: CSSStyleDeclaration["position"]; - overflowX?: CSSStyleDeclaration["overflowX"]; - overflowY?: CSSStyleDeclaration["overflowY"]; -} -export interface IArrayFormat { - length: number; - [index: number]: T; -} -export interface IDOMRendererOptions { - isEqualSize: boolean; - isConstantSize: boolean; - horizontal: boolean; - container: boolean | HTMLElement; -} -export interface IDOMRendererOrgStyle { - position?: CSSStyleDeclaration["position"]; - overflowX?: CSSStyleDeclaration["overflowX"]; - overflowY?: CSSStyleDeclaration["overflowY"]; -} -export declare type ExcludeKeys = keyof Component | "clear" | "destroy" | "remove" | "prepend" | "append" | "setLayout" | "removeByIndex" | "setLoadingBar" | "beforeSync" | "sync" | "getRenderingItems"; -export declare type InfiniteGridMethodsKeys = Exclude; -export declare type InfiniteGridMethods = Pick; diff --git a/package.json b/package.json index 1876c54fd..95e97c62e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@egjs/infinitegrid", - "version": "3.6.3", + "version": "3.6.3-snapshot", "description": "A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance", "sideEffects": false, "module": "dist/infinitegrid.esm.js",