{"version":3,"file":"axes.min.js","sources":["../src/browser.ts","../src/const.ts","../src/utils.ts","../src/Coordinate.ts","../src/AnimationManager.ts","../src/EventManager.ts","../src/InterruptManager.ts","../src/AxisManager.ts","../src/InputObserver.ts","../src/Axes.ts","../src/inputType/InputType.ts","../src/inputType/PanInput.ts","../src/inputType/RotatePanInput.ts","../src/inputType/PinchInput.ts","../src/inputType/WheelInput.ts","../src/inputType/MoveKeyInput.ts","../src/index.umd.ts"],"sourcesContent":["/* eslint-disable no-new-func, no-nested-ternary */\n\nlet win: any;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {};\n} else {\n\twin = window;\n}\n/* eslint-enable no-new-func, no-nested-ternary */\n\nexport {win as window};\n","// export const DIRECTION_NONE = 1;\n// export const DIRECTION_LEFT = 2;\n// export const DIRECTION_RIGHT = 4;\n// export const DIRECTION_HORIZONTAL = 2 | 4;\n// export const DIRECTION_UP = 8;\n// export const DIRECTION_DOWN = 16;\n// export const DIRECTION_VERTICAL = 8 | 16;\n// export const DIRECTION_ALL = 2 | 4 | 8 | 16;\n\nexport interface ObjectInterface {\n\t[key: string]: T;\n}\n\nexport {\n\tDIRECTION_NONE,\n\tDIRECTION_LEFT,\n\tDIRECTION_RIGHT,\n\tDIRECTION_UP,\n\tDIRECTION_DOWN,\n\tDIRECTION_HORIZONTAL,\n\tDIRECTION_VERTICAL,\n\tDIRECTION_ALL,\n} from \"@egjs/hammerjs\";\n\nexport const FIXED_DIGIT = 100000;\nexport const TRANSFORM = (() => {\n\tif (typeof document === \"undefined\") {\n\t\treturn \"\";\n\t}\n\tconst bodyStyle = (document.head || document.getElementsByTagName(\"head\")[0]).style;\n\tconst target = [\"transform\", \"webkitTransform\", \"msTransform\", \"mozTransform\"];\n\tfor (let i = 0, len = target.length; i < len; i++) {\n\t\tif (target[i] in bodyStyle) {\n\t\t\treturn target[i];\n\t\t}\n\t}\n\treturn \"\";\n})();\n","import {window} from \"./browser\";\nimport { ObjectInterface, FIXED_DIGIT } from \"./const\";\n\ndeclare var jQuery: any;\n\nexport function toArray(nodes: NodeList): HTMLElement[] {\n\t// const el = Array.prototype.slice.call(nodes);\n\t// for IE8\n\tconst el = [];\n\tfor (let i = 0, len = nodes.length;\n\t\ti < len; i++) {\n\t\t\tel.push(nodes[i]);\n\t}\n\treturn el;\n}\n\nexport function $(param, multi = false) {\n\tlet el;\n\n\tif (typeof param === \"string\") {\t// String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = param.match(/^<([a-z]+)\\s*([^>]*)>/);\n\n\t\t// creating element\n\t\tif (match) {\t // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = toArray(dummy.childNodes);\n\t\t} else {\t// Selector\n\t\t\tel = toArray(document.querySelectorAll(param));\n\t\t}\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? el[0] : undefined;\n\t\t}\n\t} else if (param === window) { // window\n\t\tel = param;\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) {\t// HTMLElement, Document\n\t\tel = param;\n\t} else if ((\"jQuery\" in window && param instanceof jQuery) ||\n\t\tparam.constructor.prototype.jquery) {\t// jQuery\n\t\tel = multi ? param.toArray() : param.get(0);\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[0] : undefined;\n\t\t}\n\t}\n\treturn el;\n}\n\nlet raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame;\nlet caf = window.cancelAnimationFrame || window.webkitCancelAnimationFrame;\nif (raf && !caf) {\n\tconst keyInfo = {};\n\tconst oldraf = raf;\n\traf = (callback: FrameRequestCallback) => {\n\t\tfunction wrapCallback(timestamp) {\n\t\t\tif (keyInfo[key]) {\n\t\t\t\tcallback(timestamp);\n\t\t\t}\n\t\t}\n\t\tconst key = oldraf(wrapCallback);\n\t\tkeyInfo[key] = true;\n\t\treturn key;\n\t};\n\tcaf = (key: number) => {\n\t\tdelete keyInfo[key];\n\t};\n} else if (!(raf && caf)) {\n\traf = (callback: FrameRequestCallback) => {\n\t\treturn window.setTimeout(() => {\n\t\t\tcallback(window.performance && window.performance.now && window.performance.now() || new Date().getTime());\n\t\t}, 16);\n\t};\n\tcaf = window.clearTimeout;\n}\n\n/**\n * A polyfill for the window.requestAnimationFrame() method.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame\n * @private\n */\nexport function requestAnimationFrame(fp) {\n\treturn raf(fp);\n}\n/**\n* A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.\n* @param {Number} key −\tThe ID value returned through a call to the requestAnimationFrame() method. requestAnimationFrame() 메서드가 반환한 아이디 값\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame\n* @private\n*/\nexport function cancelAnimationFrame(key) {\n\tcaf(key);\n}\nexport function mapToFixed(obj: ObjectInterface) {\n\treturn map(obj, value => toFixed(value));\n}\nexport function map(obj: ObjectInterface, callback: (value: T, key: string) => U): ObjectInterface {\n\tconst tranformed: ObjectInterface = {};\n\n\tfor (const k in obj) {\n\t\tk && (tranformed[k] = callback(obj[k], k));\n\t}\n\treturn tranformed;\n}\n\nexport function filter(obj: ObjectInterface, callback: (value: T, key: string) => boolean): ObjectInterface {\n\tconst filtered: ObjectInterface = {};\n\n\tfor (const k in obj) {\n\t\tk && callback(obj[k], k) && (filtered[k] = obj[k]);\n\t}\n\treturn filtered;\n}\nexport function every(obj: ObjectInterface, callback: (value: T, key: string) => boolean) {\n\tfor (const k in obj) {\n\t\tif (k && !callback(obj[k], k)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\nexport function equal(target: ObjectInterface, base: ObjectInterface): boolean {\n\treturn every(target, (v, k) => v === base[k]);\n}\n\nexport function toFixed(num: number) {\n\treturn Math.round(num * FIXED_DIGIT) / FIXED_DIGIT;\n}\n","import { Axis } from \"./AxisManager\";\nimport { toFixed } from \"./utils\";\n\nexport function getInsidePosition(\n\tdestPos: number,\n\trange: number[],\n\tcircular: boolean[],\n\tbounce?: number[],\n): number {\n\tlet toDestPos: number = destPos;\n\tconst targetRange: number[] = [\n\t\tcircular[0] ? range[0] : (bounce ? range[0] - bounce[0] : range[0]),\n\t\tcircular[1] ? range[1] : (bounce ? range[1] + bounce[1] : range[1]),\n\t];\n\n\ttoDestPos = Math.max(targetRange[0], toDestPos);\n\ttoDestPos = Math.min(targetRange[1], toDestPos);\n\n\treturn +toFixed(toDestPos);\n}\n\n// determine outside\nexport function isOutside(pos: number, range: number[]): boolean {\n\treturn pos < range[0] || pos > range[1];\n}\n\nexport function getDuration(distance: number, deceleration): number {\n\tconst duration = Math.sqrt(distance / deceleration * 2);\n\n\t// when duration is under 100, then value is zero\n\treturn duration < 100 ? 0 : duration;\n}\nexport function isCircularable(destPos: number, range: number[], circular: boolean[]): boolean {\n\treturn (circular[1] && destPos > range[1]) ||\n\t\t(circular[0] && destPos < range[0]);\n}\nexport function getCirculatedPos(pos: number, range: number[], circular: boolean[], isAccurate: boolean): number {\n\tlet toPos = pos;\n\tconst min = range[0];\n\tconst max = range[1];\n\tconst length = max - min;\n\n\tif (circular[1] && pos > max) { // right\n\t\ttoPos = (toPos - max) % length + min;\n\t}\n\tif (circular[0] && pos < min) { // left\n\t\ttoPos = (toPos - min) % length + max;\n\t}\n\treturn isAccurate ? toPos : +toFixed(toPos);\n}\n","import { IInputType } from \"./inputType/InputType\";\nimport { getInsidePosition, isCircularable, getCirculatedPos, getDuration } from \"./Coordinate\";\nimport { Axis, AxisManager } from \"./AxisManager\";\nimport { InterruptManager } from \"./InterruptManager\";\nimport { EventManager, ChangeEventOption } from \"./EventManager\";\nimport { requestAnimationFrame, cancelAnimationFrame, map, every, filter, equal, toFixed, mapToFixed } from \"./utils\";\nimport { AxesOption } from \"./Axes\";\n\nfunction minMax(value: number, min: number, max: number): number {\n\treturn Math.max(Math.min(value, max), min);\n}\n\nexport interface AnimationParam {\n\tdepaPos: Axis;\n\tdestPos: Axis;\n\tduration: number;\n\tdelta: Axis;\n\tisTrusted?: boolean;\n\tsetTo?: (destPos?: Axis, duration?: number) => { destPos: Axis, duration: number };\n\tdone?: () => void;\n\tstartTime?: number;\n\tinputEvent?;\n\tinput?: IInputType;\n}\n\nexport class AnimationManager {\n\tprivate _raf;\n\tprivate _animateParam: AnimationParam;\n\tprivate options: AxesOption;\n\tpublic itm: InterruptManager;\n\tpublic em: EventManager;\n\tpublic axm: AxisManager;\n\n\tconstructor({ options, itm, em, axm }) {\n\t\tthis.options = options;\n\t\tthis.itm = itm;\n\t\tthis.em = em;\n\t\tthis.axm = axm;\n\t\tthis.animationEnd = this.animationEnd.bind(this);\n\t}\n\tgetDuration(depaPos: Axis, destPos: Axis, wishDuration?: number) {\n\t\tlet duration;\n\t\tif (typeof wishDuration !== \"undefined\") {\n\t\t\tduration = wishDuration;\n\t\t} else {\n\t\t\tconst durations: Axis = map(\n\t\t\t\tdestPos,\n\t\t\t\t(v, k) => getDuration(\n\t\t\t\t\tMath.abs(v - depaPos[k]),\n\t\t\t\t\tthis.options.deceleration),\n\t\t\t);\n\t\t\tduration = Object.keys(durations).reduce((max, v) => Math.max(max, durations[v]), -Infinity);\n\t\t}\n\t\treturn minMax(\n\t\t\tduration,\n\t\t\tthis.options.minimumDuration,\n\t\t\tthis.options.maximumDuration);\n\t}\n\n\tprivate createAnimationParam(pos: Axis, duration: number, option?: ChangeEventOption): AnimationParam {\n\t\tconst depaPos: Axis = this.axm.get();\n\t\tconst destPos: Axis = pos;\n\t\tconst inputEvent = option && option.event || null;\n\t\treturn {\n\t\t\tdepaPos,\n\t\t\tdestPos,\n\t\t\tduration: minMax(\n\t\t\t\tduration,\n\t\t\t\tthis.options.minimumDuration,\n\t\t\t\tthis.options.maximumDuration),\n\t\t\tdelta: this.axm.getDelta(depaPos, destPos),\n\t\t\tinputEvent,\n\t\t\tinput: option && option.input || null,\n\t\t\tisTrusted: !!inputEvent,\n\t\t\tdone: this.animationEnd,\n\t\t};\n\t}\n\n\tgrab(axes: string[], option?: ChangeEventOption) {\n\t\tif (this._animateParam && axes.length) {\n\t\t\tconst orgPos: Axis = this.axm.get(axes);\n\t\t\tconst pos: Axis = this.axm.map(orgPos,\n\t\t\t\t(v, opt) => getCirculatedPos(v, opt.range, opt.circular as boolean[], false));\n\t\t\tif (!every(pos, (v, k) => orgPos[k] === v)) {\n\t\t\t\tthis.em.triggerChange(pos, false, orgPos, option, !!option);\n\t\t\t}\n\t\t\tthis._animateParam = null;\n\t\t\tthis._raf && cancelAnimationFrame(this._raf);\n\t\t\tthis._raf = null;\n\t\t\tthis.em.triggerAnimationEnd(!!(option && option.event));\n\t\t}\n\t}\n\n\tgetEventInfo(): ChangeEventOption {\n\t\tif (this._animateParam && this._animateParam.input && this._animateParam.inputEvent) {\n\t\t\treturn {\n\t\t\t\tinput: this._animateParam.input,\n\t\t\t\tevent: this._animateParam.inputEvent,\n\t\t\t};\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\trestore(option: ChangeEventOption) {\n\t\tconst pos: Axis = this.axm.get();\n\t\tconst destPos: Axis = this.axm.map(pos,\n\t\t\t(v, opt) => Math.min(opt.range[1], Math.max(opt.range[0], v)));\n\t\tthis.animateTo(destPos, this.getDuration(pos, destPos), option);\n\t}\n\n\tanimationEnd() {\n\t\tconst beforeParam: ChangeEventOption = this.getEventInfo();\n\t\tthis._animateParam = null;\n\n\t\t// for Circular\n\t\tconst circularTargets = this.axm.filter(\n\t\t\tthis.axm.get(),\n\t\t\t(v, opt) => isCircularable(v, opt.range, opt.circular as boolean[]),\n\t\t);\n\t\tObject.keys(circularTargets).length > 0 && this.setTo(this.axm.map(\n\t\t\tcircularTargets,\n\t\t\t(v, opt) => getCirculatedPos(v, opt.range, opt.circular as boolean[], false),\n\t\t));\n\t\tthis.itm.setInterrupt(false);\n\t\tthis.em.triggerAnimationEnd(!!beforeParam);\n\t\tif (this.axm.isOutside()) {\n\t\t\tthis.restore(beforeParam);\n\t\t} else {\n\t\t\tthis.finish(!!beforeParam);\n\t\t}\n\t}\n\tfinish(isTrusted) {\n\t\tthis._animateParam = null;\n\t\tthis.itm.setInterrupt(false);\n\t\tthis.em.triggerFinish(isTrusted);\n\t}\n\tprivate animateLoop(param: AnimationParam, complete: () => void) {\n\t\tif (param.duration) {\n\t\t\tthis._animateParam = { ...param };\n\t\t\tconst info: AnimationParam = this._animateParam;\n\t\t\tconst self = this;\n\t\t\tlet prevPos = info.depaPos;\n\t\t\tlet prevEasingPer = 0;\n\t\t\tconst directions = map(prevPos, (value, key) => {\n\t\t\t\treturn value <= info.destPos[key] ? 1 : -1;\n\t\t\t});\n\t\t\tlet prevTime = new Date().getTime();\n\t\t\tinfo.startTime = prevTime;\n\n\t\t\t(function loop() {\n\t\t\t\tself._raf = null;\n\t\t\t\tconst currentTime = new Date().getTime();\n\t\t\t\tconst easingPer = self.easing((currentTime - info.startTime) / param.duration);\n\t\t\t\tlet toPos: Axis = map(prevPos, (pos, key) => pos + info.delta[key] * (easingPer - prevEasingPer));\n\n\t\t\t\ttoPos = self.axm.map(toPos, (pos, options, key) => {\n\t\t\t\t\t// fix absolute position to relative position\n\t\t\t\t\t// fix the bouncing phenomenon by changing the range.\n\t\t\t\t\tconst nextPos = getCirculatedPos(pos, options.range, options.circular as boolean[], true);\n\t\t\t\t\tif (pos !== nextPos) {\n\t\t\t\t\t\t// circular\n\t\t\t\t\t\tparam.destPos[key] += -directions[key] * (options.range[1] - options.range[0]);\n\t\t\t\t\t\tprevPos[key] += -directions[key] * (options.range[1] - options.range[0]);\n\t\t\t\t\t}\n\t\t\t\t\treturn nextPos;\n\t\t\t\t});\n\t\t\t\tconst isCanceled = !self.em.triggerChange(toPos, false, mapToFixed(prevPos));\n\n\t\t\t\tprevPos = toPos;\n\t\t\t\tprevTime = currentTime;\n\t\t\t\tprevEasingPer = easingPer;\n\t\t\t\tif (easingPer >= 1) {\n\t\t\t\t\tconst destPos = param.destPos;\n\n\t\t\t\t\tif (!equal(destPos, self.axm.get(Object.keys(destPos)))) {\n\t\t\t\t\t\tself.em.triggerChange(destPos, true, mapToFixed(prevPos));\n\t\t\t\t\t}\n\t\t\t\t\tcomplete();\n\t\t\t\t\treturn;\n\t\t\t\t} else if (isCanceled) {\n\t\t\t\t\tself.finish(false);\n\t\t\t\t} else {\n\t\t\t\t\t// animationEnd\n\t\t\t\t\tself._raf = requestAnimationFrame(loop);\n\t\t\t\t}\n\t\t\t})();\n\t\t} else {\n\t\t\tthis.em.triggerChange(param.destPos, true);\n\t\t\tcomplete();\n\t\t}\n\t}\n\n\tgetUserControll(param: AnimationParam) {\n\t\tconst userWish = param.setTo();\n\t\tuserWish.destPos = this.axm.get(userWish.destPos);\n\t\tuserWish.duration = minMax(\n\t\t\tuserWish.duration,\n\t\t\tthis.options.minimumDuration,\n\t\t\tthis.options.maximumDuration);\n\t\treturn userWish;\n\t}\n\n\tanimateTo(destPos: Axis, duration: number, option?: ChangeEventOption) {\n\t\tconst param: AnimationParam = this.createAnimationParam(destPos, duration, option);\n\t\tconst depaPos = { ...param.depaPos };\n\t\tconst retTrigger = this.em.triggerAnimationStart(param);\n\n\t\t// to control\n\t\tconst userWish = this.getUserControll(param);\n\n\t\t// You can't stop the 'animationStart' event when 'circular' is true.\n\t\tif (!retTrigger && this.axm.every(\n\t\t\tuserWish.destPos,\n\t\t\t(v, opt) => isCircularable(v, opt.range, opt.circular as boolean[]))) {\n\t\t\tconsole.warn(\"You can't stop the 'animation' event when 'circular' is true.\");\n\t\t}\n\n\t\tif (retTrigger && !equal(userWish.destPos, depaPos)) {\n\t\t\tconst inputEvent = option && option.event || null;\n\t\t\tthis.animateLoop({\n\t\t\t\tdepaPos,\n\t\t\t\tdestPos: userWish.destPos,\n\t\t\t\tduration: userWish.duration,\n\t\t\t\tdelta: this.axm.getDelta(depaPos, userWish.destPos),\n\t\t\t\tisTrusted: !!inputEvent,\n\t\t\t\tinputEvent,\n\t\t\t\tinput: option && option.input || null,\n\t\t\t}, () => this.animationEnd());\n\t\t}\n\t}\n\n\teasing(p) {\n\t\treturn p > 1 ? 1 : this.options.easing(p);\n\t}\n\n\tsetTo(pos: Axis, duration: number = 0) {\n\t\tconst axes: string[] = Object.keys(pos);\n\t\tthis.grab(axes);\n\t\tconst orgPos: Axis = this.axm.get(axes);\n\n\t\tif (equal(pos, orgPos)) {\n\t\t\treturn this;\n\t\t}\n\t\tthis.itm.setInterrupt(true);\n\t\tlet movedPos = filter(pos, (v, k) => orgPos[k] !== v);\n\t\tif (!Object.keys(movedPos).length) {\n\t\t\treturn this;\n\t\t}\n\n\t\tmovedPos = this.axm.map(movedPos, (v, opt) => {\n\t\t\tconst { range, circular } = opt;\n\n\t\t\tif (circular && (circular[0] || circular[1])) {\n\t\t\t\treturn v;\n\t\t\t} else {\n\t\t\t\treturn getInsidePosition(v, range, circular as boolean[]);\n\t\t\t}\n\t\t});\n\n\t\tif (equal(movedPos, orgPos)) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (duration > 0) {\n\t\t\tthis.animateTo(movedPos, duration);\n\t\t} else {\n\t\t\tthis.em.triggerChange(movedPos);\n\t\t\tthis.finish(false);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetBy(pos: Axis, duration = 0) {\n\t\treturn this.setTo(\n\t\t\tmap(this.axm.get(Object.keys(pos)), (v, k) => v + pos[k]),\n\t\t\tduration,\n\t\t);\n\t}\n}\n","import { IInputType } from \"./inputType/InputType\";\nimport { Axis } from \"./AxisManager\";\nimport { AnimationParam, AnimationManager } from \"./AnimationManager\";\nimport Axes from \"./Axes\";\n\nexport interface ChangeEventOption {\n\tinput: IInputType;\n\tevent;\n}\n\nexport class EventManager {\n\tpublic am: AnimationManager;\n\tconstructor(private axes: Axes) {}\n\t/**\n\t * This event is fired when a user holds an element on the screen of the device.\n\t * @ko 사용자가 기기의 화면에 손을 대고 있을 때 발생하는 이벤트\n\t * @name eg.Axes#hold\n\t * @event\n\t * @type {object} The object of data to be sent when the event is fired이벤트가 발생할 때 전달되는 데이터 객체\n\t * @property {Object.} pos coordinate 좌표 정보\n\t * @property {Object} input The instance of inputType where the event occurred이벤트가 발생한 inputType 인스턴스\n\t * @property {Object} inputEvent The event object received from inputType inputType으로 부터 받은 이벤트 객체\n\t * @property {Boolean} 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 *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"hold\", function(event) {\n\t * // event.pos\n\t * // event.input\n\t * // event.inputEvent\n\t * // isTrusted\n\t * });\n\t */\n\ttriggerHold(pos: Axis, option: ChangeEventOption) {\n\t\tthis.axes.trigger(\"hold\", {\n\t\t\tpos,\n\t\t\tinput: option.input || null,\n\t\t\tinputEvent: option.event || null,\n\t\t\tisTrusted: true,\n\t\t});\n\t}\n\n\t/**\n\t * Specifies the coordinates to move after the 'change' event. It works when the holding value of the change event is true.\n\t * @ko 'change' 이벤트 이후 이동할 좌표를 지정한다. change이벤트의 holding 값이 true일 경우에 동작한다\n\t * @name set\n * @function\n\t * @param {Object.} pos The coordinate to move to 이동할 좌표\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"change\", function(event) {\n\t * event.holding && event.set({x: 10});\n\t * });\n\t */\n\t/** Specifies the animation coordinates to move after the 'release' or 'animationStart' events.\n\t * @ko 'release' 또는 'animationStart' 이벤트 이후 이동할 좌표를 지정한다.\n\t * @name setTo\n * @function\n\t * @param {Object.} pos The coordinate to move to 이동할 좌표\n\t * @param {Number} [duration] Duration of the animation (unit: ms) 애니메이션 진행 시간(단위: ms)\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"animationStart\", function(event) {\n\t * event.setTo({x: 10}, 2000);\n\t * });\n\t */\n\t/**\n\t * This event is fired when a user release an element on the screen of the device.\n\t * @ko 사용자가 기기의 화면에서 손을 뗐을 때 발생하는 이벤트\n\t * @name eg.Axes#release\n\t * @event\n\t * @type {object} The object of data to be sent when the event is fired이벤트가 발생할 때 전달되는 데이터 객체\n\t * @property {Object.} depaPos The coordinates when releasing an element손을 뗐을 때의 좌표 \n\t * @property {Object.} destPos The coordinates to move to after releasing an element손을 뗀 뒤에 이동할 좌표\n\t * @property {Object.} delta The movement variation of coordinate 좌표의 변화량\n\t * @property {Object} inputEvent The event object received from inputType inputType으로 부터 받은 이벤트 객체\n\t * @property {Object} input The instance of inputType where the event occurred이벤트가 발생한 inputType 인스턴스\n\t * @property {setTo} setTo Specifies the animation coordinates to move after the event 이벤트 이후 이동할 애니메이션 좌표를 지정한다\n\t * @property {Boolean} 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 *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"release\", function(event) {\n\t * // event.depaPos\n\t * // event.destPos\n\t * // event.delta\n\t * // event.input\n\t * // event.inputEvent\n\t * // event.setTo\n\t * // event.isTrusted\n\t *\n\t * // if you want to change the animation coordinates to move after the 'release' event.\n\t * event.setTo({x: 10}, 2000);\n\t * });\n\t */\n\ttriggerRelease(param: AnimationParam) {\n\t\tparam.setTo = this.createUserControll(param.destPos, param.duration);\n\t\tthis.axes.trigger(\"release\", param);\n\t}\n\n\t/**\n\t * This event is fired when coordinate changes.\n\t * @ko 좌표가 변경됐을 때 발생하는 이벤트\n\t * @name eg.Axes#change\n\t * @event\n\t * @type {object} The object of data to be sent when the event is fired 이벤트가 발생할 때 전달되는 데이터 객체\n\t * @property {Object.} pos The coordinate 좌표\n\t * @property {Object.} delta The movement variation of coordinate 좌표의 변화량\n\t * @property {Boolean} holding Indicates whether a user holds an element on the screen of the device.사용자가 기기의 화면을 누르고 있는지 여부\n\t * @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.\n\t * @property {Object} inputEvent The event object received from inputType. If the value is changed by animation, it returns 'null'.inputType으로 부터 받은 이벤트 객체. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.\n\t * @property {set} set Specifies the coordinates to move after the event. It works when the holding value is true 이벤트 이후 이동할 좌표를 지정한다. holding 값이 true일 경우에 동작한다.\n\t * @property {Boolean} 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 *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"change\", function(event) {\n\t * // event.pos\n\t * // event.delta\n\t * // event.input\n\t * // event.inputEvent\n\t * // event.holding\n\t * // event.set\n\t * // event.isTrusted\n\t *\n\t * // if you want to change the coordinates to move after the 'change' event.\n\t * // it works when the holding value of the change event is true.\n\t * event.holding && event.set({x: 10});\n\t * });\n\t */\n\ttriggerChange(pos: Axis, isAccurate?: boolean, depaPos?: Axis, option?: ChangeEventOption, holding: boolean = false) {\n\t\tconst am = this.am;\n\t\tconst axm = am.axm;\n\t\tconst eventInfo = am.getEventInfo();\n\t\tconst moveTo = axm.moveTo(pos, isAccurate, depaPos);\n\t\tconst inputEvent = option && option.event || eventInfo && eventInfo.event || null;\n\t\tconst param = {\n\t\t\tpos: moveTo.pos,\n\t\t\tdelta: moveTo.delta,\n\t\t\tholding,\n\t\t\tinputEvent,\n\t\t\tisTrusted: !!inputEvent,\n\t\t\tinput: option && option.input || eventInfo && eventInfo.input || null,\n\t\t\tset: inputEvent ? this.createUserControll(moveTo.pos) : () => { },\n\t\t};\n\t\tconst result = this.axes.trigger(\"change\", param);\n\n\t\tinputEvent && axm.set(param.set()[\"destPos\"]);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * This event is fired when animation starts.\n\t * @ko 에니메이션이 시작할 때 발생한다.\n\t * @name eg.Axes#animationStart\n\t * @event\n\t * @type {object} The object of data to be sent when the event is fired이벤트가 발생할 때 전달되는 데이터 객체\n\t * @property {Object.} depaPos The coordinates when animation starts애니메이션이 시작 되었을 때의 좌표 \n\t * @property {Object.} destPos The coordinates to move to. If you change this value, you can run the animation이동할 좌표. 이값을 변경하여 애니메이션을 동작시킬수 있다\n\t * @property {Object.} delta The movement variation of coordinate 좌표의 변화량\n\t * @property {Number} duration Duration of the animation (unit: ms). If you change this value, you can control the animation duration time.애니메이션 진행 시간(단위: ms). 이값을 변경하여 애니메이션의 이동시간을 조절할 수 있다.\n\t * @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.\n\t * @property {Object} inputEvent The event object received from inputType inputType으로 부터 받은 이벤트 객체\n\t * @property {setTo} setTo Specifies the animation coordinates to move after the event 이벤트 이후 이동할 애니메이션 좌표를 지정한다\n\t * @property {Boolean} 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 *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"release\", function(event) {\n\t * // event.depaPos\n\t * // event.destPos\n\t * // event.delta\n\t * // event.input\n\t * // event.inputEvent\n\t * // event.setTo\n\t * // event.isTrusted\n\t *\n\t * // if you want to change the animation coordinates to move after the 'animationStart' event.\n\t * event.setTo({x: 10}, 2000);\n\t * });\n\t */\n\ttriggerAnimationStart(param: AnimationParam): boolean {\n\t\tparam.setTo = this.createUserControll(param.destPos, param.duration);\n\t\treturn this.axes.trigger(\"animationStart\", param);\n\t}\n\n\t/**\n\t * This event is fired when animation ends.\n\t * @ko 에니메이션이 끝났을 때 발생한다.\n\t * @name eg.Axes#animationEnd\n\t * @event\n\t * @type {object} The object of data to be sent when the event is fired이벤트가 발생할 때 전달되는 데이터 객체\n\t * @property {Boolean} 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 *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"animationEnd\", function(event) {\n\t * // event.isTrusted\n\t * });\n\t */\n\ttriggerAnimationEnd(isTrusted: boolean = false) {\n\t\tthis.axes.trigger(\"animationEnd\", {\n\t\t\tisTrusted,\n\t\t});\n\t}\n\t/**\n\t * This event is fired when all actions have been completed.\n\t * @ko 에니메이션이 끝났을 때 발생한다.\n\t * @name eg.Axes#finish\n\t * @event\n\t * @type {object} The object of data to be sent when the event is fired이벤트가 발생할 때 전달되는 데이터 객체\n\t * @property {Boolean} 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 *\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * }).on(\"finish\", function(event) {\n\t * // event.isTrusted\n\t * });\n\t */\n\ttriggerFinish(isTrusted: boolean = false) {\n\t\tthis.axes.trigger(\"finish\", {\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate createUserControll(pos: Axis, duration: number = 0) {\n\t\t// to controll\n\t\tconst userControl = {\n\t\t\tdestPos: { ...pos },\n\t\t\tduration,\n\t\t};\n\t\treturn (toPos?: Axis, userDuration?: number): { destPos: Axis, duration: number } => {\n\t\t\ttoPos && (userControl.destPos = { ...toPos });\n\t\t\t(userDuration !== undefined) && (userControl.duration = userDuration);\n\t\t\treturn userControl;\n\t\t};\n\t}\n\n\tsetAnimationManager(am: AnimationManager) {\n\t\tthis.am = am;\n\t}\n\n\tdestroy() {\n\t\tthis.axes.off();\n\t}\n}\n","import { AxesOption } from \"./Axes\";\nexport class InterruptManager {\n\tprivate _prevented = false; // check whether the animation event was prevented\n\tconstructor(private options: AxesOption) { }\n\n\tisInterrupting() {\n\t\t// when interruptable is 'true', return value is always 'true'.\n\t\treturn this.options.interruptable || this._prevented;\n\t}\n\n\tisInterrupted() {\n\t\treturn !this.options.interruptable && this._prevented;\n\t}\n\n\tsetInterrupt(prevented) {\n\t\t!this.options.interruptable && (this._prevented = prevented);\n\t}\n}\n","import { isOutside, getCirculatedPos } from \"./Coordinate\";\nimport { map, filter, every } from \"./utils\";\nimport { ObjectInterface } from \"./const\";\n\nexport interface Axis {\n\t[key: string]: number;\n}\n\nexport interface AxisOption {\n\trange?: number[];\n\tbounce?: number | number[];\n\tcircular?: boolean | boolean[];\n}\n\nexport class AxisManager {\n\tprivate _pos: Axis;\n\tconstructor(private axis: ObjectInterface, private options) {\n\t\tthis._complementOptions();\n\t\tthis._pos = Object.keys(this.axis).reduce((acc, v) => {\n\t\t\tacc[v] = this.axis[v].range[0];\n\t\t\treturn acc;\n\t\t}, {});\n\t}\n\t/**\n\t * set up 'css' expression\n\t * @private\n\t */\n\tprivate _complementOptions() {\n\t\tObject.keys(this.axis).forEach(axis => {\n\t\t\tthis.axis[axis] = {\n\t\t\t\t...{\n\t\t\t\t\trange: [0, 100],\n\t\t\t\t\tbounce: [0, 0],\n\t\t\t\t\tcircular: [false, false],\n\t\t\t\t}, ...this.axis[axis],\n\t\t\t};\n\n\t\t\t[\"bounce\", \"circular\"].forEach(v => {\n\t\t\t\tconst axisOption = this.axis;\n\t\t\t\tconst key = axisOption[axis][v];\n\n\t\t\t\tif (/string|number|boolean/.test(typeof key)) {\n\t\t\t\t\taxisOption[axis][v] = [key, key];\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\tgetDelta(depaPos: Axis, destPos: Axis): Axis {\n\t\tconst fullDepaPos = this.get(depaPos);\n\t\treturn map(this.get(destPos), (v, k) => v - fullDepaPos[k]);\n\t}\n\tget(axes?: string[] | Axis): Axis {\n\t\tif (axes && Array.isArray(axes)) {\n\t\t\treturn axes.reduce((acc, v) => {\n\t\t\t\tif (v && (v in this._pos)) {\n\t\t\t\t\tacc[v] = this._pos[v];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, {});\n\t\t} else {\n\t\t\treturn { ...this._pos, ...((axes || {}) as Axis) };\n\t\t}\n\t}\n\tmoveTo(pos: Axis, isAccurate?: boolean, depaPos: Axis = this._pos): { [key: string]: Axis } {\n\t\tconst delta = map(this._pos, (v, key) => {\n\t\t\treturn key in pos && key in depaPos ? pos[key] - depaPos[key] : 0;\n\t\t});\n\n\t\tthis.set(this.map(pos, (v, opt) => opt ? getCirculatedPos(v, opt.range, opt.circular as boolean[], isAccurate) : 0));\n\t\treturn {\n\t\t\tpos: { ...this._pos },\n\t\t\tdelta,\n\t\t};\n\t}\n\tset(pos: Axis) {\n\t\tfor (const k in pos) {\n\t\t\tif (k && (k in this._pos)) {\n\t\t\t\tthis._pos[k] = pos[k];\n\t\t\t}\n\t\t}\n\t}\n\tevery(\n\t\tpos: Axis,\n\t\tcallback: (value: number, options: AxisOption, key: string) => boolean): boolean {\n\t\tconst axisOptions = this.axis;\n\n\t\treturn every(pos, (value, key) => callback(value, axisOptions[key], key));\n\t}\n\tfilter(\n\t\tpos: Axis,\n\t\tcallback: (value: number, options: AxisOption, key: string) => boolean): Axis {\n\n\t\tconst axisOptions = this.axis;\n\n\t\treturn filter(pos, (value, key) => callback(value, axisOptions[key], key));\n\t}\n\tmap(\n\t\tpos: Axis,\n\t\tcallback: (value: number, options: AxisOption, key: string) => U) {\n\t\tconst axisOptions = this.axis;\n\n\t\treturn map(pos, (value, key) => callback(value, axisOptions[key], key));\n\t}\n\tisOutside(axes?: string[]) {\n\t\treturn !this.every(\n\t\t\taxes ? this.get(axes) : this._pos,\n\t\t\t(v, opt) => !isOutside(v, opt.range),\n\t\t);\n\t}\n}\n","import { InterruptManager } from \"./InterruptManager\";\nimport { IInputType, IInputTypeObserver } from \"./inputType/InputType\";\nimport { EventManager, ChangeEventOption } from \"./EventManager\";\nimport { AxisManager, Axis } from \"./AxisManager\";\nimport { AnimationParam, AnimationManager } from \"./AnimationManager\";\nimport { AxesOption } from \"./Axes\";\nimport { isOutside, getInsidePosition } from \"./Coordinate\";\nimport { map, equal } from \"./utils\";\n\nexport class InputObserver implements IInputTypeObserver {\n\tpublic options: AxesOption;\n\tprivate itm: InterruptManager;\n\tprivate em: EventManager;\n\tprivate axm: AxisManager;\n\tprivate am: AnimationManager;\n\tprivate isOutside = false;\n\tprivate moveDistance: Axis = null;\n\tprivate isStopped = false;\n\tconstructor({ options, itm, em, axm, am }) {\n\t\tthis.options = options;\n\t\tthis.itm = itm;\n\t\tthis.em = em;\n\t\tthis.axm = axm;\n\t\tthis.am = am;\n\t}\n\n\t// when move pointer is held in outside\n\tprivate atOutside(pos: Axis) {\n\t\tif (this.isOutside) {\n\t\t\treturn this.axm.map(pos, (v, opt) => {\n\t\t\t\tconst tn = opt.range[0] - opt.bounce[0];\n\t\t\t\tconst tx = opt.range[1] + opt.bounce[1];\n\t\t\t\treturn v > tx ? tx : (v < tn ? tn : v);\n\t\t\t});\n\t\t} else {\n\t\t\t// when start pointer is held in inside\n\t\t\t// get a initialization slope value to prevent smooth animation.\n\t\t\tconst initSlope = this.am.easing(0.00001) / 0.00001;\n\t\t\treturn this.axm.map(pos, (v, opt) => {\n\t\t\t\tconst min = opt.range[0];\n\t\t\t\tconst max = opt.range[1];\n\t\t\t\tconst out = opt.bounce;\n\t\t\t\tconst circular = opt.circular;\n\n\t\t\t\tif (circular && (circular[0] || circular[1])) {\n\t\t\t\t\treturn v;\n\t\t\t\t} else if (v < min) { // left\n\t\t\t\t\treturn min - this.am.easing((min - v) / (out[0] * initSlope)) * out[0];\n\t\t\t\t} else if (v > max) { // right\n\t\t\t\t\treturn max + this.am.easing((v - max) / (out[1] * initSlope)) * out[1];\n\t\t\t\t}\n\t\t\t\treturn v;\n\t\t\t});\n\t\t}\n\t}\n\tget(input: IInputType): Axis {\n\t\treturn this.axm.get(input.axes);\n\t}\n\thold(input: IInputType, event) {\n\t\tif (this.itm.isInterrupted() || !input.axes.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst changeOption: ChangeEventOption = {\n\t\t\tinput,\n\t\t\tevent,\n\t\t};\n\t\tthis.isStopped = false;\n\t\tthis.itm.setInterrupt(true);\n\t\tthis.am.grab(input.axes, changeOption);\n\t\t!this.moveDistance && this.em.triggerHold(this.axm.get(), changeOption);\n\t\tthis.isOutside = this.axm.isOutside(input.axes);\n\t\tthis.moveDistance = this.axm.get(input.axes);\n\t}\n\tchange(input: IInputType, event, offset: Axis) {\n\t\tif (this.isStopped || !this.itm.isInterrupting() || this.axm.every(offset, v => v === 0)) {\n\t\t\treturn;\n\t\t}\n\t\tlet depaPos: Axis = this.moveDistance || this.axm.get(input.axes);\n\t\tlet destPos: Axis;\n\n\t\t// for outside logic\n\t\tdestPos = map(depaPos, (v, k) => v + (offset[k] || 0));\n\t\tthis.moveDistance && (this.moveDistance = destPos);\n\t\t// from outside to inside\n\t\tif (this.isOutside &&\n\t\t\tthis.axm.every(depaPos, (v, opt) => !isOutside(v, opt.range))) {\n\t\t\tthis.isOutside = false;\n\t\t}\n\t\tdepaPos = this.atOutside(depaPos);\n\t\tdestPos = this.atOutside(destPos);\n\n\t\tconst isCanceled = !this.em.triggerChange(destPos, false, depaPos, {\n\t\t\tinput,\n\t\t\tevent,\n\t\t}, true);\n\n\t\tif (isCanceled) {\n\t\t\tthis.isStopped = true;\n\t\t\tthis.moveDistance = null;\n\t\t\tthis.am.finish(false);\n\t\t}\n\t}\n\trelease(input: IInputType, event, offset: Axis, inputDuration?: number) {\n\t\tif (this.isStopped || !this.itm.isInterrupting() || !this.moveDistance) {\n\t\t\treturn;\n\t\t}\n\t\tconst pos: Axis = this.axm.get(input.axes);\n\t\tconst depaPos: Axis = this.axm.get();\n\t\tlet destPos: Axis = this.axm.get(this.axm.map(offset, (v, opt, k) => {\n\t\t\tif (opt.circular && (opt.circular[0] || opt.circular[1])) {\n\t\t\t\treturn pos[k] + v;\n\t\t\t} else {\n\t\t\t\treturn getInsidePosition(\n\t\t\t\t\tpos[k] + v,\n\t\t\t\t\topt.range,\n\t\t\t\t\topt.circular as boolean[],\n\t\t\t\t\topt.bounce as number[],\n\t\t\t\t);\n\t\t\t}\n\t\t}));\n\t\tconst duration = this.am.getDuration(destPos, pos, inputDuration);\n\n\t\tif (duration === 0) {\n\t\t\tdestPos = { ...depaPos };\n\t\t}\n\t\t// prepare params\n\t\tconst param: AnimationParam = {\n\t\t\tdepaPos,\n\t\t\tdestPos,\n\t\t\tduration,\n\t\t\tdelta: this.axm.getDelta(depaPos, destPos),\n\t\t\tinputEvent: event,\n\t\t\tinput,\n\t\t\tisTrusted: true,\n\t\t};\n\t\tthis.em.triggerRelease(param);\n\t\tthis.moveDistance = null;\n\n\t\t// to contol\n\t\tconst userWish = this.am.getUserControll(param);\n\t\tconst isEqual = equal(userWish.destPos, depaPos);\n\t\tconst changeOption: ChangeEventOption = {\n\t\t\tinput,\n\t\t\tevent,\n\t\t};\n\t\tif (isEqual || userWish.duration === 0) {\n\t\t\t!isEqual && this.em.triggerChange(userWish.destPos, false, depaPos, changeOption, true);\n\t\t\tthis.itm.setInterrupt(false);\n\t\t\tif (this.axm.isOutside()) {\n\t\t\t\tthis.am.restore(changeOption);\n\t\t\t} else {\n\t\t\t\tthis.em.triggerFinish(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.am.animateTo(userWish.destPos, userWish.duration, changeOption);\n\t\t}\n\t}\n}\n","import Component from \"@egjs/component\";\nimport { AnimationManager } from \"./AnimationManager\";\nimport { EventManager } from \"./EventManager\";\nimport { InterruptManager } from \"./InterruptManager\";\nimport { AxisManager, AxisOption, Axis } from \"./AxisManager\";\nimport { InputObserver } from \"./InputObserver\";\nimport {\n\tTRANSFORM,\n\tDIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT,\n\tDIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL\n} from \"./const\";\nimport { IInputType } from \"./inputType/InputType\";\n\nexport interface AxesOption {\n\teasing?: (x: number) => number;\n\tmaximumDuration?: number;\n\tminimumDuration?: number;\n\tdeceleration?: number;\n\tinterruptable?: boolean;\n}\n\n/**\n * @typedef {Object} AxisOption The Axis information. The key of the axis specifies the name to use as the logical virtual coordinate system.\n * @ko 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.\n * @property {Number[]} [range] The coordinate of range 좌표 범위\n * @property {Number} [range.0=0] The coordinate of the minimum 최소 좌표\n * @property {Number} [range.1=0] The coordinate of the maximum 최대 좌표\n * @property {Number[]} [bounce] The size of bouncing area. The coordinates can exceed the coordinate area as much as the bouncing area based on user action. If the coordinates does not exceed the bouncing area when an element is dragged, the coordinates where bouncing effects are applied are retuned back into the coordinate area바운스 영역의 크기. 사용자의 동작에 따라 좌표가 좌표 영역을 넘어 바운스 영역의 크기만큼 더 이동할 수 있다. 사용자가 끌어다 놓는 동작을 했을 때 좌표가 바운스 영역에 있으면, 바운스 효과가 적용된 좌표가 다시 좌표 영역 안으로 들어온다\n * @property {Number} [bounce.0=0] The size of coordinate of the minimum area 최소 좌표 바운스 영역의 크기\n * @property {Number} [bounce.1=0] The size of coordinate of the maximum area 최대 좌표 바운스 영역의 크기\n * @property {Boolean[]} [circular] Indicates whether a circular element is available. If it is set to \"true\" and an element is dragged outside the coordinate area, the element will appear on the other side.순환 여부. 'true'로 설정한 방향의 좌표 영역 밖으로 엘리먼트가 이동하면 반대 방향에서 엘리먼트가 나타난다\n * @property {Boolean} [circular.0=false] Indicates whether to circulate to the coordinate of the minimum 최소 좌표 방향의 순환 여부\n * @property {Boolean} [circular.1=false] Indicates whether to circulate to the coordinate of the maximum 최대 좌표 방향의 순환 여부\n**/\n\n/**\n * @typedef {Object} AxesOption The option object of the eg.Axes module\n * @ko eg.Axes 모듈의 옵션 객체\n * @property {Function} [easing=easing.easeOutCubic] The easing function to apply to an animation 애니메이션에 적용할 easing 함수\n * @property {Number} [maximumDuration=Infinity] Maximum duration of the animation 가속도에 의해 애니메이션이 동작할 때의 최대 좌표 이동 시간\n * @property {Number} [minimumDuration=0] Minimum duration of the animation 가속도에 의해 애니메이션이 동작할 때의 최소 좌표 이동 시간\n * @property {Number} [deceleration=0.0006] Deceleration of the animation where acceleration is manually enabled by user. A higher value indicates shorter running time. 사용자의 동작으로 가속도가 적용된 애니메이션의 감속도. 값이 높을수록 애니메이션 실행 시간이 짧아진다\n * @property {Boolean} [interruptable=true] Indicates whether an animation is interruptible.
- true: It can be paused or stopped by user action or the API.
- false: It cannot be paused or stopped by user action or the API while it is running.진행 중인 애니메이션 중지 가능 여부.
- true: 사용자의 동작이나 API로 애니메이션을 중지할 수 있다.
- false: 애니메이션이 진행 중일 때는 사용자의 동작이나 API가 적용되지 않는다
\n**/\n\n/**\n * @class eg.Axes\n * @classdesc A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.\n * @ko 터치 입력 장치나 마우스와 같은 다양한 입력 장치를 통해 전달 받은 사용자의 동작을 논리적인 가상 좌표로 변경하는 모듈이다. 사용자 동작에 반응하는 UI를 손쉽게 만들수 있다.\n * @extends eg.Component\n *\n * @param {Object.} axis Axis information managed by eg.Axes. The key of the axis specifies the name to use as the logical virtual coordinate system. eg.Axes가 관리하는 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.\n * @param {AxesOption} [options] The option object of the eg.Axes moduleeg.Axes 모듈의 옵션 객체\n * @param {Object.} [startPos] The coordinates to be moved when creating an instance. not triggering change event.인스턴스 생성시 이동할 좌표, change 이벤트는 발생하지 않음.\n *\n * @support {\"ie\": \"10+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.3+ (except 3.x)\"}\n * @example\n *\n * // 1. Initialize eg.Axes\n * const axes = new eg.Axes({\n *\tsomething1: {\n *\t\trange: [0, 150],\n *\t\tbounce: 50\n *\t},\n *\tsomething2: {\n *\t\trange: [0, 200],\n *\t\tbounce: 100\n *\t},\n *\tsomethingN: {\n *\t\trange: [1, 10],\n *\t}\n * }, {\n * deceleration : 0.0024\n * });\n *\n * // 2. attach event handler\n * axes.on({\n *\t\"hold\" : function(evt) {\n *\t},\n *\t\"release\" : function(evt) {\n *\t},\n *\t\"animationStart\" : function(evt) {\n *\t},\n *\t\"animationEnd\" : function(evt) {\n *\t},\n *\t\"change\" : function(evt) {\n *\t}\n * });\n *\n * // 3. Initialize inputTypes\n * const panInputArea = new eg.Axes.PanInput(\"#area\", {\n *\tscale: [0.5, 1]\n * });\n * const panInputHmove = new eg.Axes.PanInput(\"#hmove\");\n * const panInputVmove = new eg.Axes.PanInput(\"#vmove\");\n * const pinchInputArea = new eg.Axes.PinchInput(\"#area\", {\n *\tscale: 1.5\n * });\n *\n * // 4. Connect eg.Axes and InputTypes\n * // [PanInput] When the mouse or touchscreen is down and moved.\n * // Connect the 'something2' axis to the mouse or touchscreen x position and\n * // connect the 'somethingN' axis to the mouse or touchscreen y position.\n * axes.connect([\"something2\", \"somethingN\"], panInputArea); // or axes.connect(\"something2 somethingN\", panInputArea);\n *\n * // Connect only one 'something1' axis to the mouse or touchscreen x position.\n * axes.connect([\"something1\"], panInputHmove); // or axes.connect(\"something1\", panInputHmove);\n *\n * // Connect only one 'something2' axis to the mouse or touchscreen y position.\n * axes.connect([\"\", \"something2\"], panInputVmove); // or axes.connect(\" something2\", panInputVmove);\n *\n * // [PinchInput] Connect 'something2' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * axes.connect(\"something2\", pinchInputArea);\n */\nexport default class Axes 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.Axes.VERSION; // ex) 3.3.3\n\t * @memberof eg.Axes\n\t */\n\tstatic VERSION = \"#__VERSION__#\";\n\t// for tree shaking\n\tstatic PanInput;\n\tstatic PinchInput;\n\tstatic WheelInput;\n\tstatic MoveKeyInput;\n\tstatic RotatePanInput;\n\n\t/**\n\t * @name eg.Axes.TRANSFORM\n\t * @desc Returns the transform attribute with CSS vendor prefixes.\n\t * @ko CSS vendor prefixes를 붙인 transform 속성을 반환한다.\n\t *\n\t * @constant\n\t * @type {String}\n\t * @example\n\t * eg.Axes.TRANSFORM; // \"transform\" or \"webkitTransform\"\n\t */\n\tstatic TRANSFORM = TRANSFORM;\n\t/**\n\t * @name eg.Axes.DIRECTION_NONE\n\t * @constant\n\t * @type {Number}\n\t */\n\tstatic DIRECTION_NONE = DIRECTION_NONE;\n\t/**\n\t * @name eg.Axes.DIRECTION_LEFT\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_LEFT = DIRECTION_LEFT;\n\t/**\n\t * @name eg.Axes.DIRECTION_RIGHT\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_RIGHT = DIRECTION_RIGHT;\n\t/**\n\t * @name eg.Axes.DIRECTION_UP\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_UP = DIRECTION_UP;\n\t/**\n\t * @name eg.Axes.DIRECTION_DOWN\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_DOWN = DIRECTION_DOWN;\n\t/**\n\t * @name eg.Axes.DIRECTION_HORIZONTAL\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;\n\t/**\n\t * @name eg.Axes.DIRECTION_VERTICAL\n\t * @constant\n\t * @type {Number}\n\t*/\n\tstatic DIRECTION_VERTICAL = DIRECTION_VERTICAL;\n\t/**\n\t * @name eg.Axes.DIRECTION_ALL\n\t * @constant\n\t * @type {Number}\n\t*/\n\tpublic static DIRECTION_ALL = DIRECTION_ALL;\n\n\tpublic options: AxesOption;\n\tpublic em: EventManager;\n\tpublic axm: AxisManager;\n\tpublic itm: InterruptManager;\n\tpublic am: AnimationManager;\n\tpublic io: InputObserver;\n\tprivate _inputs: IInputType[] = [];\n\n\tconstructor(public axis: { [key: string]: AxisOption } = {}, options: AxesOption = {}, startPos?: Axis) {\n\t\tsuper();\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\teasing: function easeOutCubic(x) {\n\t\t\t\t\treturn 1 - Math.pow(1 - x, 3);\n\t\t\t\t},\n\t\t\t\tinterruptable: true,\n\t\t\t\tmaximumDuration: Infinity,\n\t\t\t\tminimumDuration: 0,\n\t\t\t\tdeceleration: 0.0006,\n\t\t\t}, ...options,\n\t\t};\n\n\t\tthis.itm = new InterruptManager(this.options);\n\t\tthis.axm = new AxisManager(this.axis, this.options);\n\t\tthis.em = new EventManager(this);\n\t\tthis.am = new AnimationManager(this);\n\t\tthis.io = new InputObserver(this);\n\t\tthis.em.setAnimationManager(this.am);\n\t\tstartPos && this.em.triggerChange(startPos);\n\t}\n\t/**\n\t * Connect the axis of eg.Axes to the inputType.\n\t * @ko eg.Axes의 축과 inputType을 연결한다\n\t * @method eg.Axes#connect\n\t * @param {(String[]|String)} axes The name of the axis to associate with inputType inputType과 연결할 축의 이름\n\t * @param {Object} inputType The inputType instance to associate with the axis of eg.Axes eg.Axes의 축과 연결할 inputType 인스턴스\n\t * @return {eg.Axes} An instance of a module itself 모듈 자신의 인스턴스\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * }\n\t * });\n\t *\n\t * axes.connect(\"x\", new eg.Axes.PanInput(\"#area1\"))\n\t * .connect(\"x xOther\", new eg.Axes.PanInput(\"#area2\"))\n\t * .connect(\" xOther\", new eg.Axes.PanInput(\"#area3\"))\n\t * .connect([\"x\"], new eg.Axes.PanInput(\"#area4\"))\n\t * .connect([\"xOther\", \"x\"], new eg.Axes.PanInput(\"#area5\"))\n\t * .connect([\"\", \"xOther\"], new eg.Axes.PanInput(\"#area6\"));\n\t */\n\tconnect(axes: string[] | string, inputType: IInputType) {\n\t\tlet mapped;\n\t\tif (typeof axes === \"string\") {\n\t\t\tmapped = axes.split(\" \");\n\t\t} else {\n\t\t\tmapped = axes.concat();\n\t\t}\n\n\t\t// check same instance\n\t\tif (~this._inputs.indexOf(inputType)) {\n\t\t\tthis.disconnect(inputType);\n\t\t}\n\n\t\t// check same element in hammer type for share\n\t\tif (\"hammer\" in inputType) {\n\t\t\tconst targets = this._inputs.filter(v => v.hammer && v.element === inputType.element);\n\t\t\tif (targets.length) {\n\t\t\t\tinputType.hammer = targets[0].hammer;\n\t\t\t}\n\t\t}\n\t\tinputType.mapAxes(mapped);\n\t\tinputType.connect(this.io);\n\t\tthis._inputs.push(inputType);\n\t\treturn this;\n\t}\n\t/**\n\t * Disconnect the axis of eg.Axes from the inputType.\n\t * @ko eg.Axes의 축과 inputType의 연결을 끊는다.\n\t * @method eg.Axes#disconnect\n\t * @param {Object} [inputType] An inputType instance associated with the axis of eg.Axes eg.Axes의 축과 연결한 inputType 인스턴스\n\t * @return {eg.Axes} An instance of a module itself 모듈 자신의 인스턴스\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * }\n\t * });\n\t *\n\t * const input1 = new eg.Axes.PanInput(\"#area1\");\n\t * const input2 = new eg.Axes.PanInput(\"#area2\");\n\t * const input3 = new eg.Axes.PanInput(\"#area3\");\n\t *\n\t * axes.connect(\"x\", input1);\n\t * .connect(\"x xOther\", input2)\n\t * .connect([\"xOther\", \"x\"], input3);\n\t *\n\t * axes.disconnect(input1); // disconnects input1\n\t * axes.disconnect(); // disconnects all of them\n\t */\n\tdisconnect(inputType?: IInputType) {\n\t\tif (inputType) {\n\t\t\tconst index = this._inputs.indexOf(inputType);\n\n\t\t\tif (index >= 0) {\n\t\t\t\tthis._inputs[index].disconnect();\n\t\t\t\tthis._inputs.splice(index, 1);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._inputs.forEach(v => v.disconnect());\n\t\t\tthis._inputs = [];\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the current position of the coordinates.\n\t * @ko 좌표의 현재 위치를 반환한다\n\t * @method eg.Axes#get\n\t * @param {Object} [axes] The names of the axis 축 이름들\n\t * @return {Object.} Axis coordinate information 축 좌표 정보\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.get(); // {\"x\": 0, \"xOther\": -100, \"zoom\": 50}\n\t * axes.get([\"x\", \"zoom\"]); // {\"x\": 0, \"zoom\": 50}\n\t */\n\tget(axes?: string[]) {\n\t\treturn this.axm.get(axes);\n\t}\n\n\t/**\n\t * Moves an axis to specific coordinates.\n\t * @ko 좌표를 이동한다.\n\t * @method eg.Axes#setTo\n\t * @param {Object.} pos The coordinate to move to 이동할 좌표\n\t * @param {Number} [duration=0] Duration of the animation (unit: ms) 애니메이션 진행 시간(단위: ms)\n\t * @return {eg.Axes} An instance of a module itself 모듈 자신의 인스턴스\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.setTo({\"x\": 30, \"zoom\": 60});\n\t * axes.get(); // {\"x\": 30, \"xOther\": -100, \"zoom\": 60}\n\t *\n\t * axes.setTo({\"x\": 100, \"xOther\": 60}, 1000); // animatation\n\t *\n\t * // after 1000 ms\n\t * axes.get(); // {\"x\": 100, \"xOther\": 60, \"zoom\": 60}\n\t */\n\tsetTo(pos: Axis, duration = 0) {\n\t\tthis.am.setTo(pos, duration);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Moves an axis from the current coordinates to specific coordinates.\n\t * @ko 현재 좌표를 기준으로 좌표를 이동한다.\n\t * @method eg.Axes#setBy\n\t * @param {Object.} pos The coordinate to move to 이동할 좌표\n\t * @param {Number} [duration=0] Duration of the animation (unit: ms) 애니메이션 진행 시간(단위: ms)\n\t * @return {eg.Axes} An instance of a module itself 모듈 자신의 인스턴스\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.setBy({\"x\": 30, \"zoom\": 10});\n\t * axes.get(); // {\"x\": 30, \"xOther\": -100, \"zoom\": 60}\n\t *\n\t * axes.setBy({\"x\": 70, \"xOther\": 60}, 1000); // animatation\n\t *\n\t * // after 1000 ms\n\t * axes.get(); // {\"x\": 100, \"xOther\": -40, \"zoom\": 60}\n\t */\n\tsetBy(pos: Axis, duration = 0) {\n\t\tthis.am.setBy(pos, duration);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns whether there is a coordinate in the bounce area of ​​the target axis.\n\t * @ko 대상 축 중 bounce영역에 좌표가 존재하는지를 반환한다\n\t * @method eg.Axes#isBounceArea\n\t * @param {Object} [axes] The names of the axis 축 이름들\n\t * @return {Boolen} Whether the bounce area exists. bounce 영역 존재 여부\n\t * @example\n\t * const axes = new eg.Axes({\n\t * \"x\": {\n\t * range: [0, 100]\n\t * },\n\t * \"xOther\": {\n\t * range: [-100, 100]\n\t * },\n\t * \t \"zoom\": {\n\t * range: [50, 30]\n\t * }\n\t * });\n\t *\n\t * axes.isBounceArea([\"x\"]);\n\t * axes.isBounceArea([\"x\", \"zoom\"]);\n\t * axes.isBounceArea();\n\t */\n\tisBounceArea(axes?: string[]) {\n\t\treturn this.axm.isOutside(axes);\n\t}\n\n\t/**\n\t* Destroys properties, and events used in a module and disconnect all connections to inputTypes.\n\t* @ko 모듈에 사용한 속성, 이벤트를 해제한다. 모든 inputType과의 연결을 끊는다.\n\t* @method eg.Axes#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tthis.em.destroy();\n\t}\n}\n","import {Manager, PointerEventInput, TouchMouseInput, TouchInput, MouseInput} from \"@egjs/hammerjs\";\nimport { Axis } from \"../AxisManager\";\nimport { AxesOption } from \"../Axes\";\nimport { window } from \"../browser\";\n\nexport interface IInputType {\n\taxes: string[];\n\telement: HTMLElement;\n\thammer?;\n\tmapAxes(axes: string[]);\n\tconnect(observer: IInputTypeObserver): IInputType;\n\tdisconnect();\n\tdestroy();\n\tenable?();\n\tdisable?();\n\tisEnable?(): boolean;\n}\n\nexport interface IInputTypeObserver {\n\toptions: AxesOption;\n\tget(inputType: IInputType): Axis;\n\tchange(inputType: IInputType, event, offset: Axis);\n\thold(inputType: IInputType, event);\n\trelease(inputType: IInputType, event, offset: Axis, duration?: number);\n}\n\nexport const SUPPORT_POINTER_EVENTS = \"PointerEvent\" in window || \"MSPointerEvent\" in window;\nexport const SUPPORT_TOUCH = \"ontouchstart\" in window;\nexport const UNIQUEKEY = \"_EGJS_AXES_INPUTTYPE_\";\nexport function toAxis(source: string[], offset: number[]): Axis {\n\treturn offset.reduce((acc, v, i) => {\n\t\tif (source[i]) {\n\t\t\tacc[source[i]] = v;\n\t\t}\n\t\treturn acc;\n\t}, {});\n}\nexport function createHammer(element: HTMLElement, options) {\n\ttry {\n\t\t// create Hammer\n\t\treturn new Manager(element, { ...options });\n\t} catch (e) {\n\t\treturn null;\n\t}\n}\nexport function convertInputType(inputType: string[] = []): any {\n\tlet hasTouch = false;\n\tlet hasMouse = false;\n\tlet hasPointer = false;\n\n\tinputType.forEach(v => {\n\t\tswitch (v) {\n\t\t\tcase \"mouse\": hasMouse = true; break;\n\t\t\tcase \"touch\": hasTouch = SUPPORT_TOUCH; break;\n\t\t\tcase \"pointer\": hasPointer = SUPPORT_POINTER_EVENTS;\n\t\t\t// no default\n\t\t}\n\t});\n\tif (hasPointer) {\n\t\treturn PointerEventInput;\n\t} else if (hasTouch && hasMouse) {\n\t\treturn TouchMouseInput;\n\t} else if (hasTouch) {\n\t\treturn TouchInput;\n\t} else if (hasMouse) {\n\t\treturn MouseInput;\n\t}\n\treturn null;\n}\n","import Hammer, { DIRECTION_ALL, DIRECTION_HORIZONTAL, DIRECTION_NONE, DIRECTION_VERTICAL, Manager, Pan } from \"@egjs/hammerjs\";\nimport { $ } from \"../utils\";\nimport { convertInputType, createHammer, IInputType, IInputTypeObserver, toAxis, UNIQUEKEY } from \"./InputType\";\nimport { ObjectInterface } from \"../const\";\n\nexport interface PanInputOption {\n\tinputType?: string[];\n\tscale?: number[];\n\tthresholdAngle?: number;\n\tthreshold?: number;\n\thammerManagerOptions?: ObjectInterface;\n}\n\n// get user's direction\nexport function getDirectionByAngle(angle: number, thresholdAngle: number) {\n\tif (thresholdAngle < 0 || thresholdAngle > 90) {\n\t\treturn DIRECTION_NONE;\n\t}\n\tconst toAngle = Math.abs(angle);\n\n\treturn toAngle > thresholdAngle && toAngle < 180 - thresholdAngle ?\n\t\tDIRECTION_VERTICAL : DIRECTION_HORIZONTAL;\n}\n\nexport function getNextOffset(speeds: number[], deceleration: number) {\n\tconst normalSpeed = Math.sqrt(\n\t\tspeeds[0] * speeds[0] + speeds[1] * speeds[1],\n\t);\n\tconst duration = Math.abs(normalSpeed / -deceleration);\n\treturn [\n\t\tspeeds[0] / 2 * duration,\n\t\tspeeds[1] / 2 * duration,\n\t];\n}\n\nexport function useDirection(\n\tcheckType,\n\tdirection,\n\tuserDirection?): boolean {\n\tif (userDirection) {\n\t\treturn !!((direction === DIRECTION_ALL) ||\n\t\t\t((direction & checkType) && (userDirection & checkType)));\n\t} else {\n\t\treturn !!(direction & checkType);\n\t}\n}\n\n/**\n * @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.\n * @ko eg.Axes.PanInput 모듈의 옵션 객체\n * @property {String[]} [inputType=[\"touch\",\"mouse\", \"pointer\"]] Types of input devices.
- touch: Touch screen
- mouse: Mouse 입력 장치 종류.
- touch: 터치 입력 장치
- mouse: 마우스
\n * @property {Number[]} [scale] Coordinate scale that a user can move사용자의 동작으로 이동하는 좌표의 배율\n * @property {Number} [scale.0=1] horizontal axis scale 수평축 배율\n * @property {Number} [scale.1=1] vertical axis scale 수직축 배율\n * @property {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) 사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)\n * @property {Number} [threshold=0] Minimal pan distance required before recognizing 사용자의 Pan 동작을 인식하기 위해산 최소한의 거리\n * @property {Object} [hammerManagerOptions={cssProps: {userSelect: \"none\",touchSelect: \"none\",touchCallout: \"none\",userDrag: \"none\"}] Options of Hammer.Manager Hammer.Manager의 옵션\n**/\n/**\n * @class eg.Axes.PanInput\n * @classdesc A module that passes the amount of change to eg.Axes when the mouse or touchscreen is down and moved. use less than two axes.\n * @ko 마우스나 터치 스크린을 누르고 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 두개 이하의 축을 사용한다.\n *\n * @example\n * const pan = new eg.Axes.PanInput(\"#area\", {\n * \t\tinputType: [\"touch\"],\n * \t\tscale: [1, 1.3],\n * });\n *\n * // Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.\n * // Connect the 'somethingN' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.\n * axes.connect([\"something2\", \"somethingN\"], pan); // or axes.connect(\"something2 somethingN\", pan);\n *\n * // Connect only one 'something1' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.\n * axes.connect([\"something1\"], pan); // or axes.connect(\"something1\", pan);\n *\n * // Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.\n * axes.connect([\"\", \"something2\"], pan); // or axes.connect(\" something2\", pan);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.PanInput module eg.Axes.PanInput 모듈을 사용할 엘리먼트\n * @param {PanInputOption} [options] The option object of the eg.Axes.PanInput moduleeg.Axes.PanInput 모듈의 옵션 객체\n */\nexport class PanInput implements IInputType {\n\toptions: PanInputOption;\n\taxes: string[] = [];\n\thammer = null;\n\telement: HTMLElement = null;\n\tprotected observer: IInputTypeObserver;\n\tprotected _direction;\n\tprivate panRecognizer = null;\n\n\tconstructor(el: string | HTMLElement, options?: PanInputOption) {\n\t\t/**\n\t\t * Hammer helps you add support for touch gestures to your page\n\t\t *\n\t\t * @external Hammer\n\t\t * @see {@link http://hammerjs.github.io|Hammer.JS}\n\t\t * @see {@link http://hammerjs.github.io/jsdoc/Hammer.html|Hammer.JS API documents}\n\t\t * @see Hammer.JS applies specific CSS properties by {@link http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html|default} when creating an instance. The eg.Axes module removes all default CSS properties provided by Hammer.JS\n\t\t */\n\t\tif (typeof Manager === \"undefined\") {\n\t\t\tthrow new Error(`The Hammerjs must be loaded before eg.Axes.PanInput.\\nhttp://hammerjs.github.io/`);\n\t\t}\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tinputType: [\"touch\", \"mouse\", \"pointer\"],\n\t\t\t\tscale: [1, 1],\n\t\t\t\tthresholdAngle: 45,\n\t\t\t\tthreshold: 0,\n\t\t\t\thammerManagerOptions: {\n\t\t\t\t\t// css properties were removed due to usablility issue\n\t\t\t\t\t// http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html\n\t\t\t\t\tcssProps: {\n\t\t\t\t\t\tuserSelect: \"none\",\n\t\t\t\t\t\ttouchSelect: \"none\",\n\t\t\t\t\t\ttouchCallout: \"none\",\n\t\t\t\t\t\tuserDrag: \"none\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, ...options,\n\t\t};\n\t\tthis.onHammerInput = this.onHammerInput.bind(this);\n\t\tthis.onPanmove = this.onPanmove.bind(this);\n\t\tthis.onPanend = this.onPanend.bind(this);\n\t}\n\n\tpublic mapAxes(axes: string[]) {\n\t\tconst useHorizontal = !!axes[0];\n\t\tconst useVertical = !!axes[1];\n\t\tif (useHorizontal && useVertical) {\n\t\t\tthis._direction = DIRECTION_ALL;\n\t\t} else if (useHorizontal) {\n\t\t\tthis._direction = DIRECTION_HORIZONTAL;\n\t\t} else if (useVertical) {\n\t\t\tthis._direction = DIRECTION_VERTICAL;\n\t\t} else {\n\t\t\tthis._direction = DIRECTION_NONE;\n\t\t}\n\t\tthis.axes = axes;\n\t}\n\n\tpublic connect(observer: IInputTypeObserver): IInputType {\n\t\tconst hammerOption = {\n\t\t\tdirection: this._direction,\n\t\t\tthreshold: this.options.threshold,\n\t\t};\n\t\tif (this.hammer) { // for sharing hammer instance.\n\t\t\t// hammer remove previous PanRecognizer.\n\t\t\tthis.removeRecognizer();\n\t\t\tthis.dettachEvent();\n\t\t} else {\n\t\t\tlet keyValue: string = this.element[UNIQUEKEY];\n\t\t\tif (!keyValue) {\n\t\t\t\tkeyValue = String(Math.round(Math.random() * new Date().getTime()));\n\t\t\t}\n\t\t\tconst inputClass = convertInputType(this.options.inputType);\n\t\t\tif (!inputClass) {\n\t\t\t\tthrow new Error(\"Wrong inputType parameter!\");\n\t\t\t}\n\t\t\tthis.hammer = createHammer(this.element, {\n\t\t\t\t...{\n\t\t\t\t\tinputClass,\n\t\t\t\t}, ... this.options.hammerManagerOptions,\n\t\t\t});\n\t\t\tthis.element[UNIQUEKEY] = keyValue;\n\t\t}\n\t\tthis.panRecognizer = new Pan(hammerOption);\n\n\t\tthis.hammer.add(this.panRecognizer);\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tpublic disconnect() {\n\t\tthis.removeRecognizer();\n\t\tif (this.hammer) {\n\t\t\tthis.dettachEvent();\n\t\t}\n\t\tthis._direction = DIRECTION_NONE;\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.PanInput#destroy\n\t*/\n\tpublic destroy() {\n\t\tthis.disconnect();\n\t\tif (this.hammer && this.hammer.recognizers.length === 0) {\n\t\t\tthis.hammer.destroy();\n\t\t}\n\t\tdelete this.element[UNIQUEKEY];\n\t\tthis.element = null;\n\t\tthis.hammer = null;\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.PanInput#enable\n\t * @return {eg.Axes.PanInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tpublic enable() {\n\t\tthis.hammer && (this.hammer.get(\"pan\").options.enable = true);\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.PanInput#disable\n\t * @return {eg.Axes.PanInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tpublic disable() {\n\t\tthis.hammer && (this.hammer.get(\"pan\").options.enable = false);\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.PanInput#isEnable\n\t * @return {Boolean} Whether to use an input device 입력장치 사용여부\n\t */\n\tpublic isEnable() {\n\t\treturn !!(this.hammer && this.hammer.get(\"pan\").options.enable);\n\t}\n\n\tprivate removeRecognizer() {\n\t\tif (this.hammer && this.panRecognizer) {\n\t\t\tthis.hammer.remove(this.panRecognizer);\n\t\t\tthis.panRecognizer = null;\n\t\t}\n\t}\n\n\tprotected onHammerInput(event) {\n\t\tif (this.isEnable()) {\n\t\t\tif (event.isFirst) {\n\t\t\t\tthis.observer.hold(this, event);\n\t\t\t} else if (event.isFinal) {\n\t\t\t\tthis.onPanend(event);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onPanmove(event) {\n\t\tconst userDirection = getDirectionByAngle(\n\t\t\tevent.angle, this.options.thresholdAngle);\n\n\t\t// not support offset properties in Hammerjs - start\n\t\tconst prevInput = this.hammer.session.prevInput;\n\n\t\t/* eslint-disable no-param-reassign */\n\t\tif (prevInput) {\n\t\t\tevent.offsetX = event.deltaX - prevInput.deltaX;\n\t\t\tevent.offsetY = event.deltaY - prevInput.deltaY;\n\t\t} else {\n\t\t\tevent.offsetX = 0;\n\t\t\tevent.offsetY = 0;\n\t\t}\n\t\tconst offset: number[] = this.getOffset(\n\t\t\t[event.offsetX, event.offsetY],\n\t\t\t[\n\t\t\t\tuseDirection(DIRECTION_HORIZONTAL, this._direction, userDirection),\n\t\t\t\tuseDirection(DIRECTION_VERTICAL, this._direction, userDirection),\n\t\t\t]);\n\t\tconst prevent = offset.some(v => v !== 0);\n\t\tif (prevent) {\n\t\t\tevent.srcEvent.preventDefault();\n\t\t\tevent.srcEvent.stopPropagation();\n\t\t}\n\t\tevent.preventSystemEvent = prevent;\n\t\tprevent && this.observer.change(this, event, toAxis(this.axes, offset));\n\t}\n\n\tprotected onPanend(event) {\n\t\tlet offset: number[] = this.getOffset(\n\t\t\t[\n\t\t\t\tMath.abs(event.velocityX) * (event.deltaX < 0 ? -1 : 1),\n\t\t\t\tMath.abs(event.velocityY) * (event.deltaY < 0 ? -1 : 1),\n\t\t\t],\n\t\t\t[\n\t\t\t\tuseDirection(DIRECTION_HORIZONTAL, this._direction),\n\t\t\t\tuseDirection(DIRECTION_VERTICAL, this._direction),\n\t\t\t]);\n\t\toffset = getNextOffset(offset, this.observer.options.deceleration);\n\t\tthis.observer.release(this, event, toAxis(this.axes, offset));\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.hammer.on(\"hammer.input\", this.onHammerInput)\n\t\t\t.on(\"panstart panmove\", this.onPanmove);\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.hammer.off(\"hammer.input\", this.onHammerInput)\n\t\t\t.off(\"panstart panmove\", this.onPanmove);\n\t\tthis.observer = null;\n\t}\n\n\tprivate getOffset(\n\t\tproperties: number[],\n\t\tdirection: boolean[]): number[] {\n\t\tconst offset: number[] = [0, 0];\n\t\tconst scale = this.options.scale;\n\n\t\tif (direction[0]) {\n\t\t\toffset[0] = (properties[0] * scale[0]);\n\t\t}\n\t\tif (direction[1]) {\n\t\t\toffset[1] = (properties[1] * scale[1]);\n\t\t}\n\t\treturn offset;\n\t}\n}\n","import Axes from \"../Axes\";\nimport { toAxis } from \"./InputType\";\nimport { PanInput, PanInputOption } from \"./PanInput\";\n\nexport class RotatePanInput extends PanInput {\n\tprivate rotateOrigin: number[];\n\tprivate prevAngle: number;\n\tprivate prevQuadrant: number;\n\tprivate lastDiff: number;\n\tprivate coefficientForDistanceToAngle: number;\n\n\tconstructor(el: string | HTMLElement, options?: PanInputOption) {\n\t\tsuper(el, options);\n\n\t\tthis.prevQuadrant = null;\n\t\tthis.lastDiff = 0;\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis._direction = Axes.DIRECTION_ALL;\n\t\tthis.axes = axes;\n\t}\n\n\tonHammerInput(event) {\n\t\tif (this.isEnable()) {\n\t\t\tif (event.isFirst) {\n\t\t\t\tthis.observer.hold(this, event);\n\t\t\t\tthis.onPanstart(event);\n\t\t\t} else if (event.isFinal) {\n\t\t\t\tthis.onPanend(event);\n\t\t\t}\n\t\t}\n\t}\n\n\tonPanstart(event) {\n\t\tconst rect = this.element.getBoundingClientRect();\n\n\t\t/**\n\t\t * Responsive\n\t\t */\n\t\t// TODO: how to do if element is ellipse not circle.\n\t\tthis.coefficientForDistanceToAngle = 360 / (rect.width * Math.PI); // from 2*pi*r * x / 360\n\t\t// TODO: provide a way to set origin like https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin\n\t\tthis.rotateOrigin = [rect.left + (rect.width - 1) / 2, rect.top + (rect.height - 1) / 2];\n\n\t\t// init angle.\n\t\tthis.prevAngle = null;\n\n\t\tthis.triggerChange(event);\n\t}\n\n\tonPanmove(event) {\n\t\tthis.triggerChange(event);\n\t}\n\n\tonPanend(event) {\n\t\tthis.triggerChange(event);\n\t\tthis.triggerAnimation(event);\n\t}\n\n\tprivate triggerChange(event) {\n\t\tconst angle = this.getAngle(event.center.x, event.center.y);\n\t\tconst quadrant = this.getQuadrant(event.center.x, event.center.y);\n\t\tconst diff = this.getDifference(this.prevAngle, angle, this.prevQuadrant, quadrant);\n\n\t\tthis.prevAngle = angle;\n\t\tthis.prevQuadrant = quadrant;\n\n\t\tif (diff === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.lastDiff = diff;\n\t\tthis.observer.change(this, event, toAxis(this.axes, [-diff])); // minus for clockwise\n\t}\n\n\tprivate triggerAnimation(event) {\n\t\tconst vx = event.velocityX;\n\t\tconst vy = event.velocityY;\n\t\tconst velocity = Math.sqrt(vx * vx + vy * vy) * (this.lastDiff > 0 ? -1 : 1); // clockwise\n\t\tconst duration = Math.abs(velocity / -this.observer.options.deceleration);\n\t\tconst distance = velocity / 2 * duration;\n\n\t\tthis.observer.release(this, event, toAxis(this.axes, [distance * this.coefficientForDistanceToAngle]));\n\t}\n\n\tprivate getDifference(prevAngle: number, angle: number, prevQuadrant: number, quadrant: number) {\n\t\tlet diff: number;\n\n\t\tif (prevAngle === null) {\n\t\t\tdiff = 0;\n\t\t} else if (prevQuadrant === 1 && quadrant === 4) {\n\t\t\tdiff = -prevAngle - (360 - angle);\n\t\t} else if (prevQuadrant === 4 && quadrant === 1) {\n\t\t\tdiff = (360 - prevAngle) + angle;\n\t\t} else {\n\t\t\tdiff = angle - prevAngle;\n\t\t}\n\n\t\treturn diff;\n\t}\n\n\tprivate getPosFromOrigin(posX: number, posY: number) {\n\t\treturn {\n\t\t\tx: posX - this.rotateOrigin[0],\n\t\t\ty: this.rotateOrigin[1] - posY,\n\t\t};\n\t}\n\n\tprivate getAngle(posX: number, posY: number) {\n\t\tconst { x, y } = this.getPosFromOrigin(posX, posY);\n\n\t\tconst angle = Math.atan2(y, x) * 180 / Math.PI;\n\t\t// console.log(angle, x, y);\n\t\treturn angle < 0 ? 360 + angle : angle;\n\t}\n\n\t/**\n\t * Quadrant\n\t * y(+)\n\t * |\n\t * 2 | 1\n\t * --------------->x(+)\n\t * 3 | 4\n\t * |\n\t */\n\tprivate getQuadrant(posX: number, posY: number) {\n\t\tconst { x, y } = this.getPosFromOrigin(posX, posY);\n\t\tlet q = 0;\n\n\t\tif (x >= 0 && y >= 0) {\n\t\t\tq = 1;\n\t\t} else if (x < 0 && y >= 0) {\n\t\t\tq = 2;\n\t\t} else if (x < 0 && y < 0) {\n\t\t\tq = 3;\n\t\t} else if (x >= 0 && y < 0) {\n\t\t\tq = 4;\n\t\t}\n\t\treturn q;\n\t}\n}\n","import { InputObserver } from \"./../InputObserver\";\nimport { Manager, Pinch } from \"@egjs/hammerjs\";\nimport { $ } from \"../utils\";\nimport { UNIQUEKEY, toAxis, convertInputType, createHammer, IInputType, IInputTypeObserver } from \"./InputType\";\nimport { Axis } from \"../AxisManager\";\nimport { ObjectInterface } from \"../const\";\n\nexport interface PinchInputOption {\n\tscale?: number;\n\tthreshold?: number;\n\tinputType?: string[];\n\thammerManagerOptions?: ObjectInterface;\n}\n\n/**\n * @typedef {Object} PinchInputOption The option object of the eg.Axes.PinchInput module\n * @ko eg.Axes.PinchInput 모듈의 옵션 객체\n * @property {Number} [scale=1] Coordinate scale that a user can move사용자의 동작으로 이동하는 좌표의 배율\n * @property {Number} [threshold=0] Minimal scale before recognizing 사용자의 Pinch 동작을 인식하기 위해산 최소한의 배율\n * @property {Object} [hammerManagerOptions={cssProps: {userSelect: \"none\",touchSelect: \"none\",touchCallout: \"none\",userDrag: \"none\"}] Options of Hammer.Manager Hammer.Manager의 옵션\n**/\n\n/**\n * @class eg.Axes.PinchInput\n * @classdesc A module that passes the amount of change to eg.Axes when two pointers are moving toward (zoom-in) or away from each other (zoom-out). use one axis.\n * @ko 2개의 pointer를 이용하여 zoom-in하거나 zoom-out 하는 동작의 변화량을 eg.Axes에 전달하는 모듈. 한 개 의 축을 사용한다.\n * @example\n * const pinch = new eg.Axes.PinchInput(\"#area\", {\n * \t\tscale: 1\n * });\n *\n * // Connect 'something' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * axes.connect(\"something\", pinch);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.PinchInput module eg.Axes.PinchInput 모듈을 사용할 엘리먼트\n * @param {PinchInputOption} [options] The option object of the eg.Axes.PinchInput moduleeg.Axes.PinchInput 모듈의 옵션 객체\n */\nexport class PinchInput implements IInputType {\n\n\toptions: PinchInputOption;\n\taxes: string[] = [];\n\thammer = null;\n\telement: HTMLElement = null;\n\n\tprivate observer: IInputTypeObserver;\n\tprivate _base: number = null;\n\tprivate _prev: number = null;\n\tprivate pinchRecognizer = null;\n\n\tconstructor(el, options?: PinchInputOption) {\n\t\t/**\n\t\t * Hammer helps you add support for touch gestures to your page\n\t\t *\n\t\t * @external Hammer\n\t\t * @see {@link http://hammerjs.github.io|Hammer.JS}\n\t\t * @see {@link http://hammerjs.github.io/jsdoc/Hammer.html|Hammer.JS API documents}\n\t\t * @see Hammer.JS applies specific CSS properties by {@link http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html|default} when creating an instance. The eg.Axes module removes all default CSS properties provided by Hammer.JS\n\t\t */\n\t\tif (typeof Manager === \"undefined\") {\n\t\t\tthrow new Error(`The Hammerjs must be loaded before eg.Axes.PinchInput.\\nhttp://hammerjs.github.io/`);\n\t\t}\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tscale: 1,\n\t\t\t\tthreshold: 0,\n\t\t\t\tinputType: [\"touch\", \"pointer\"],\n\t\t\t\thammerManagerOptions: {\n\t\t\t\t\t// css properties were removed due to usablility issue\n\t\t\t\t\t// http://hammerjs.github.io/jsdoc/Hammer.defaults.cssProps.html\n\t\t\t\t\tcssProps: {\n\t\t\t\t\t\tuserSelect: \"none\",\n\t\t\t\t\t\ttouchSelect: \"none\",\n\t\t\t\t\t\ttouchCallout: \"none\",\n\t\t\t\t\t\tuserDrag: \"none\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t...options,\n\t\t};\n\t\tthis.onPinchStart = this.onPinchStart.bind(this);\n\t\tthis.onPinchMove = this.onPinchMove.bind(this);\n\t\tthis.onPinchEnd = this.onPinchEnd.bind(this);\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis.axes = axes;\n\t}\n\n\tconnect(observer: IInputTypeObserver): IInputType {\n\t\tconst hammerOption = { threshold: this.options.threshold };\n\n\t\tif (this.hammer) { // for sharing hammer instance.\n\t\t\t// hammer remove previous PinchRecognizer.\n\t\t\tthis.removeRecognizer();\n\t\t\tthis.dettachEvent();\n\t\t} else {\n\t\t\tlet keyValue: string = this.element[UNIQUEKEY];\n\t\t\tif (!keyValue) {\n\t\t\t\tkeyValue = String(Math.round(Math.random() * new Date().getTime()));\n\t\t\t}\n\t\t\tconst inputClass = convertInputType(this.options.inputType);\n\t\t\tif (!inputClass) {\n\t\t\t\tthrow new Error(\"Wrong inputType parameter!\");\n\t\t\t}\n\t\t\tthis.hammer = createHammer(\n\t\t\t\tthis.element,\n\t\t\t\t{\n\t\t\t\t\t...{\n\t\t\t\t\t\tinputClass,\n\t\t\t\t\t}, ...this.options.hammerManagerOptions,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.element[UNIQUEKEY] = keyValue;\n\t\t}\n\t\tthis.pinchRecognizer = new Pinch(hammerOption);\n\t\tthis.hammer.add(this.pinchRecognizer);\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tdisconnect() {\n\t\tthis.removeRecognizer();\n\t\tif (this.hammer) {\n\t\t\tthis.hammer.remove(this.pinchRecognizer);\n\t\t\tthis.pinchRecognizer = null;\n\t\t\tthis.dettachEvent();\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.PinchInput#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tif (this.hammer && this.hammer.recognizers.length === 0) {\n\t\t\tthis.hammer.destroy();\n\t\t}\n\t\tdelete this.element[UNIQUEKEY];\n\t\tthis.element = null;\n\t\tthis.hammer = null;\n\t}\n\n\tprivate removeRecognizer() {\n\t\tif (this.hammer && this.pinchRecognizer) {\n\t\t\tthis.hammer.remove(this.pinchRecognizer);\n\t\t\tthis.pinchRecognizer = null;\n\t\t}\n\t}\n\n\tprivate onPinchStart(event) {\n\t\tthis._base = this.observer.get(this)[this.axes[0]];\n\t\tconst offset = this.getOffset(event.scale);\n\t\tthis.observer.hold(this, event);\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tthis._prev = event.scale;\n\t}\n\tprivate onPinchMove(event) {\n\t\tconst offset = this.getOffset(event.scale, this._prev);\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tthis._prev = event.scale;\n\t}\n\tprivate onPinchEnd(event) {\n\t\tconst offset = this.getOffset(event.scale, this._prev);\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tthis.observer.release(this, event, toAxis(this.axes, [0]), 0);\n\t\tthis._base = null;\n\t\tthis._prev = null;\n\t}\n\tprivate getOffset(pinchScale: number, prev: number = 1): number {\n\t\treturn this._base * (pinchScale - prev) * this.options.scale;\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.hammer.on(\"pinchstart\", this.onPinchStart)\n\t\t\t.on(\"pinchmove\", this.onPinchMove)\n\t\t\t.on(\"pinchend\", this.onPinchEnd);\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.hammer.off(\"pinchstart\", this.onPinchStart)\n\t\t\t.off(\"pinchmove\", this.onPinchMove)\n\t\t\t.off(\"pinchend\", this.onPinchEnd);\n\t\tthis.observer = null;\n\t\tthis._prev = null;\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.PinchInput#enable\n\t * @return {eg.Axes.PinchInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tenable() {\n\t\tthis.hammer && (this.hammer.get(\"pinch\").options.enable = true);\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.PinchInput#disable\n\t * @return {eg.Axes.PinchInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tdisable() {\n\t\tthis.hammer && (this.hammer.get(\"pinch\").options.enable = false);\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.PinchInput#isEnable\n\t * @return {Boolean} Whether to use an input device 입력장치 사용여부\n\t */\n\tisEnable() {\n\t\treturn !!(this.hammer && this.hammer.get(\"pinch\").options.enable);\n\t}\n}\n","import { InputObserver } from \"./../InputObserver\";\nimport { $ } from \"../utils\";\nimport { UNIQUEKEY, toAxis, IInputType, IInputTypeObserver } from \"./InputType\";\nimport { Axis } from \"../AxisManager\";\n\nexport interface WheelInputOption {\n\tscale?: number;\n\tuseNormalized?: boolean;\n}\n\n/**\n * @typedef {Object} WheelInputOption The option object of the eg.Axes.WheelInput module\n * @ko eg.Axes.WheelInput 모듈의 옵션 객체\n * @property {Number} [scale=1] Coordinate scale that a user can move사용자의 동작으로 이동하는 좌표의 배율\n**/\n\n/**\n * @class eg.Axes.WheelInput\n * @classdesc A module that passes the amount of change to eg.Axes when the mouse wheel is moved. use one axis.\n * @ko 마우스 휠이 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 한 개 의 축을 사용한다.\n *\n * @example\n * const wheel = new eg.Axes.WheelInput(\"#area\", {\n * \t\tscale: 1\n * });\n *\n * // Connect 'something' axis when the mousewheel is moved.\n * axes.connect(\"something\", wheel);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.WheelInput module eg.Axes.WheelInput 모듈을 사용할 엘리먼트\n * @param {WheelInputOption} [options] The option object of the eg.Axes.WheelInput moduleeg.Axes.WheelInput 모듈의 옵션 객체\n */\nexport class WheelInput implements IInputType {\n\toptions: WheelInputOption;\n\taxes: string[] = [];\n\telement: HTMLElement = null;\n\tprivate _isEnabled = false;\n\tprivate _isHolded = false;\n\tprivate _timer = null;\n\tprivate observer: IInputTypeObserver;\n\tconstructor(el, options?: WheelInputOption) {\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tscale: 1,\n\t\t\t\tuseNormalized: true,\n\t\t\t}, ...options,\n\t\t};\n\t\tthis.onWheel = this.onWheel.bind(this);\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis.axes = axes;\n\t}\n\n\tconnect(observer: IInputTypeObserver): IInputType {\n\t\tthis.dettachEvent();\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tdisconnect() {\n\t\tthis.dettachEvent();\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.WheelInput#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tthis.element = null;\n\t}\n\n\tprivate onWheel(event) {\n\t\tif (!this._isEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tevent.preventDefault();\n\n\t\tif (event.deltaY === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._isHolded) {\n\t\t\tthis.observer.hold(this, event);\n\t\t\tthis._isHolded = true;\n\t\t}\n\t\tconst offset = (event.deltaY > 0 ? -1 : 1) * this.options.scale * (this.options.useNormalized ? 1 : Math.abs(event.deltaY));\n\n\t\tthis.observer.change(this, event, toAxis(this.axes, [offset]));\n\t\tclearTimeout(this._timer);\n\t\tconst inst = this;\n\n\t\tthis._timer = setTimeout(() => {\n\t\t\tif (this._isHolded) {\n\t\t\t\tthis._isHolded = false;\n\t\t\t\tthis.observer.release(this, event, toAxis(this.axes, [0]));\n\t\t\t}\n\t\t}, 50);\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.element.addEventListener(\"wheel\", this.onWheel);\n\t\tthis._isEnabled = true;\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.element.removeEventListener(\"wheel\", this.onWheel);\n\t\tthis._isEnabled = false;\n\t\tthis.observer = null;\n\n\t\tif (this._timer) {\n\t\t\tclearTimeout(this._timer);\n\t\t\tthis._timer = null;\n\t\t}\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.WheelInput#enable\n\t * @return {eg.Axes.WheelInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tenable() {\n\t\tthis._isEnabled = true;\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.WheelInput#disable\n\t * @return {eg.Axes.WheelInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tdisable() {\n\t\tthis._isEnabled = false;\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.WheelInput#isEnable\n\t * @return {Boolean} Whether to use an input device 입력장치 사용여부\n\t */\n\tisEnable() {\n\t\treturn this._isEnabled;\n\t}\n}\n","import { InputObserver } from \"./../InputObserver\";\nimport { $ } from \"../utils\";\nimport { toAxis, IInputType, IInputTypeObserver } from \"./InputType\";\nimport { Axis } from \"../AxisManager\";\n\nexport const KEY_LEFT_ARROW = 37;\nexport const KEY_A = 65;\nexport const KEY_UP_ARROW = 38;\nexport const KEY_W = 87;\nexport const KEY_RIGHT_ARROW = 39;\nexport const KEY_D = 68;\nexport const KEY_DOWN_ARROW = 40;\nexport const KEY_S = 83;\n\nconst DIRECTION_REVERSE = -1;\nconst DIRECTION_FORWARD = 1;\nconst DIRECTION_HORIZONTAL = -1;\nconst DIRECTION_VERTICAL = 1;\nconst DELAY = 80;\n\nexport interface MoveKeyInputOption {\n\tscale?: number[];\n}\n\n/**\n * @typedef {Object} MoveKeyInputOption The option object of the eg.Axes.MoveKeyInput module\n * @ko eg.Axes.MoveKeyInput 모듈의 옵션 객체\n * @property {Array} [scale] Coordinate scale that a user can move사용자의 동작으로 이동하는 좌표의 배율\n * @property {Number} [scale[0]=1] Coordinate scale for the first axis첫번째 축의 배율\n * @property {Number} [scale[1]=1] Coordinate scale for the decond axis두번째 축의 배율\n**/\n\n/**\n * @class eg.Axes.MoveKeyInput\n * @classdesc A module that passes the amount of change to eg.Axes when the move key stroke is occured. use two axis.\n * @ko 이동키 입력이 발생했을 때의 변화량을 eg.Axes에 전달하는 모듈. 두 개 의 축을 사용한다.\n *\n * @example\n * const moveKey = new eg.Axes.MoveKeyInput(\"#area\", {\n * \t\tscale: [1, 1]\n * });\n *\n * // Connect 'x', 'y' axes when the moveKey is pressed.\n * axes.connect([\"x\", \"y\"], moveKey);\n *\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.MoveKeyInput module eg.Axes.MoveKeyInput 모듈을 사용할 엘리먼트\n * @param {MoveKeyInputOption} [options] The option object of the eg.Axes.MoveKeyInput moduleeg.Axes.MoveKeyInput 모듈의 옵션 객체\n */\nexport class MoveKeyInput implements IInputType {\n\toptions: MoveKeyInputOption;\n\taxes: string[] = [];\n\telement: HTMLElement = null;\n\tprivate _isEnabled = false;\n\tprivate _isHolded = false;\n\tprivate _timer = null;\n\tprivate observer: IInputTypeObserver;\n\tconstructor(el, options?: MoveKeyInputOption) {\n\t\tthis.element = $(el);\n\t\tthis.options = {\n\t\t\t...{\n\t\t\t\tscale: [1, 1],\n\t\t\t}, ...options,\n\t\t};\n\t\tthis.onKeydown = this.onKeydown.bind(this);\n\t\tthis.onKeyup = this.onKeyup.bind(this);\n\t}\n\n\tmapAxes(axes: string[]) {\n\t\tthis.axes = axes;\n\t}\n\n\tconnect(observer: IInputTypeObserver): IInputType {\n\t\tthis.dettachEvent();\n\n\t\t// add tabindex=\"0\" to the container for making it focusable\n\t\tif (this.element.getAttribute(\"tabindex\") !== \"0\") {\n\t\t\tthis.element.setAttribute(\"tabindex\", \"0\");\n\t\t}\n\n\t\tthis.attachEvent(observer);\n\t\treturn this;\n\t}\n\n\tdisconnect() {\n\t\tthis.dettachEvent();\n\t\treturn this;\n\t}\n\n\t/**\n\t* Destroys elements, properties, and events used in a module.\n\t* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n\t* @method eg.Axes.MoveKeyInput#destroy\n\t*/\n\tdestroy() {\n\t\tthis.disconnect();\n\t\tthis.element = null;\n\t}\n\n\tprivate onKeydown(e) {\n\t\tif (!this._isEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet isMoveKey = true;\n\t\tlet direction = DIRECTION_FORWARD;\n\t\tlet move = DIRECTION_HORIZONTAL;\n\n\t\tswitch (e.keyCode) {\n\t\t\tcase KEY_LEFT_ARROW:\n\t\t\tcase KEY_A:\n\t\t\t\tdirection = DIRECTION_REVERSE;\n\t\t\t\tbreak;\n\t\t\tcase KEY_RIGHT_ARROW:\n\t\t\tcase KEY_D:\n\t\t\t\tbreak;\n\t\t\tcase KEY_DOWN_ARROW:\n\t\t\tcase KEY_S:\n\t\t\t\tdirection = DIRECTION_REVERSE;\n\t\t\t\tmove = DIRECTION_VERTICAL;\n\t\t\t\tbreak;\n\t\t\tcase KEY_UP_ARROW:\n\t\t\tcase KEY_W:\n\t\t\t\tmove = DIRECTION_VERTICAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisMoveKey = false;\n\t\t}\n\t\tif ((move === DIRECTION_HORIZONTAL && !this.axes[0]) ||\n\t\t\t(move === DIRECTION_VERTICAL && !this.axes[1])) {\n\t\t\tisMoveKey = false;\n\t\t}\n\t\tif (!isMoveKey) {\n\t\t\treturn;\n\t\t}\n\t\tconst offsets = move === DIRECTION_HORIZONTAL ? [+this.options.scale[0] * direction, 0] : [0, +this.options.scale[1] * direction];\n\n\t\tif (!this._isHolded) {\n\t\t\tthis.observer.hold(this, event);\n\t\t\tthis._isHolded = true;\n\t\t}\n\t\tclearTimeout(this._timer);\n\t\tthis.observer.change(this, event, toAxis(this.axes, offsets));\n\t}\n\tprivate onKeyup(e) {\n\t\tif (!this._isHolded) {\n\t\t\treturn;\n\t\t}\n\t\tclearTimeout(this._timer);\n\t\tthis._timer = setTimeout(() => {\n\t\t\tthis.observer.release(this, e, toAxis(this.axes, [0, 0]));\n\t\t\tthis._isHolded = false;\n\t\t}, DELAY);\n\t}\n\n\tprivate attachEvent(observer: IInputTypeObserver) {\n\t\tthis.observer = observer;\n\t\tthis.element.addEventListener(\"keydown\", this.onKeydown, false);\n\t\tthis.element.addEventListener(\"keypress\", this.onKeydown, false);\n\t\tthis.element.addEventListener(\"keyup\", this.onKeyup, false);\n\t\tthis._isEnabled = true;\n\t}\n\n\tprivate dettachEvent() {\n\t\tthis.element.removeEventListener(\"keydown\", this.onKeydown, false);\n\t\tthis.element.removeEventListener(\"keypress\", this.onKeydown, false);\n\t\tthis.element.removeEventListener(\"keyup\", this.onKeyup, false);\n\t\tthis._isEnabled = false;\n\t\tthis.observer = null;\n\t}\n\n\t/**\n\t * Enables input devices\n\t * @ko 입력 장치를 사용할 수 있게 한다\n\t * @method eg.Axes.MoveKeyInput#enable\n\t * @return {eg.Axes.MoveKeyInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tenable() {\n\t\tthis._isEnabled = true;\n\t\treturn this;\n\t}\n\t/**\n\t * Disables input devices\n\t * @ko 입력 장치를 사용할 수 없게 한다.\n\t * @method eg.Axes.MoveKeyInput#disable\n\t * @return {eg.Axes.MoveKeyInput} An instance of a module itself 모듈 자신의 인스턴스\n\t */\n\tdisable() {\n\t\tthis._isEnabled = false;\n\t\treturn this;\n\t}\n\t/**\n\t * Returns whether to use an input device\n\t * @ko 입력 장치를 사용 여부를 반환한다.\n\t * @method eg.Axes.MoveKeyInput#isEnable\n\t * @return {Boolean} Whether to use an input device 입력장치 사용여부\n\t */\n\tisEnable() {\n\t\treturn this._isEnabled;\n\t}\n}\n","import Axes from \"./Axes\";\nimport { PanInput } from \"./inputType/PanInput\";\nimport { RotatePanInput } from \"./inputType/RotatePanInput\";\nimport { PinchInput } from \"./inputType/PinchInput\";\nimport { WheelInput } from \"./inputType/WheelInput\";\nimport { MoveKeyInput } from \"./inputType/MoveKeyInput\";\n\nAxes.PanInput = PanInput;\nAxes.RotatePanInput = RotatePanInput;\nAxes.PinchInput = PinchInput;\nAxes.WheelInput = WheelInput;\nAxes.MoveKeyInput = MoveKeyInput;\n\nexport default Axes;\n"],"names":["win","window","FIXED_DIGIT","TRANSFORM","document","bodyStyle","head","getElementsByTagName","style","target","i","len","length","nodes","el","push","param","multi","match","dummy","createElement","innerHTML","toArray","childNodes","querySelectorAll","undefined","nodeName","nodeType","jQuery","constructor","prototype","jquery","get","Array","isArray","map","v","$","raf","requestAnimationFrame","webkitRequestAnimationFrame","caf","cancelAnimationFrame","webkitCancelAnimationFrame","keyInfo_1","oldraf_1","callback","key","timestamp","setTimeout","performance","now","Date","getTime","clearTimeout","obj","value","toFixed","tranformed","k","filtered","base","every","num","Math","round","destPos","range","circular","bounce","toDestPos","targetRange","max","min","pos","isAccurate","toPos","_a","options","itm","em","axm","animationEnd","this","bind","depaPos","wishDuration","duration","durations_1","distance","abs","deceleration","_this","sqrt","Object","keys","reduce","Infinity","minMax","minimumDuration","maximumDuration","option","inputEvent","event","delta","getDelta","input","isTrusted","done","axes","_animateParam","orgPos_1","opt","getCirculatedPos","triggerChange","_raf","triggerAnimationEnd","animateTo","getDuration","beforeParam","getEventInfo","circularTargets","filter","isCircularable","setTo","setInterrupt","isOutside","restore","finish","triggerFinish","complete","info_1","self_1","prevPos_1","prevEasingPer_1","directions_1","prevTime_1","startTime","currentTime","easingPer","easing","nextPos","isCanceled","mapToFixed","equal","loop","userWish","createAnimationParam","retTrigger","triggerAnimationStart","getUserControll","console","warn","animateLoop","p","grab","orgPos","movedPos","getInsidePosition","trigger","createUserControll","holding","am","eventInfo","moveTo","set","result","userControl","userDuration","off","interruptable","_prevented","prevented","axis","_complementOptions","_pos","acc","forEach","axisOption","test","fullDepaPos","axisOptions","tn","tx","initSlope_1","out","isInterrupted","changeOption","isStopped","moveDistance","triggerHold","offset","isInterrupting","atOutside","inputDuration","triggerRelease","isEqual","startPos","_super","x","pow","InterruptManager","AxisManager","EventManager","AnimationManager","io","InputObserver","setAnimationManager","tslib_1","inputType","mapped","split","concat","_inputs","indexOf","disconnect","targets","hammer","element","mapAxes","connect","index","splice","setBy","destroy","Axes","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","Component","SUPPORT_POINTER_EVENTS","SUPPORT_TOUCH","UNIQUEKEY","source","Manager","e","hasTouch","hasMouse","hasPointer","PointerEventInput","TouchMouseInput","TouchInput","MouseInput","checkType","direction","userDirection","Error","scale","thresholdAngle","threshold","hammerManagerOptions","cssProps","userSelect","touchSelect","touchCallout","userDrag","onHammerInput","onPanmove","onPanend","useHorizontal","useVertical","_direction","observer","hammerOption","removeRecognizer","dettachEvent","keyValue","String","random","inputClass","convertInputType","createHammer","panRecognizer","Pan","add","attachEvent","recognizers","enable","remove","isEnable","isFirst","hold","isFinal","angle","toAngle","getDirectionByAngle","prevInput","session","offsetY","offsetX","deltaX","deltaY","getOffset","useDirection","prevent","some","srcEvent","preventDefault","stopPropagation","preventSystemEvent","change","toAxis","speeds","normalSpeed","velocityX","velocityY","release","on","properties","prevQuadrant","lastDiff","onPanstart","rect","getBoundingClientRect","coefficientForDistanceToAngle","width","PI","rotateOrigin","left","top","height","prevAngle","triggerAnimation","getAngle","center","y","quadrant","getQuadrant","diff","getDifference","vx","vy","velocity","posX","posY","atan2","q","PanInput","onPinchStart","onPinchMove","onPinchEnd","pinchRecognizer","Pinch","_base","_prev","pinchScale","prev","useNormalized","onWheel","_isEnabled","_isHolded","_timer","addEventListener","removeEventListener","onKeydown","onKeyup","getAttribute","setAttribute","isMoveKey","move","keyCode","offsets","RotatePanInput","PinchInput","WheelInput","MoveKeyInput"],"mappings":";;;;;;;;;ilBAEIA,qKAIHA,EAFqB,oBAAXC,OAEJ,GAEAA,OCgBA,IAAMC,EAAc,IACdC,EAAa,cACD,oBAAbC,eACH,WAEFC,GAAaD,SAASE,MAAQF,SAASG,qBAAqB,QAAQ,IAAIC,MACxEC,EAAS,CAAC,YAAa,kBAAmB,cAAe,gBACtDC,EAAI,EAAGC,EAAMF,EAAOG,OAAQF,EAAIC,EAAKD,OACzCD,EAAOC,KAAML,SACTI,EAAOC,SAGT,GAXkB,cCpBFG,WAGjBC,EAAK,GACFJ,EAAI,EAAGC,EAAME,EAAMD,OAC3BF,EAAIC,EAAKD,IACRI,EAAGC,KAAKF,EAAMH,WAETI,aAGUE,EAAOC,OACpBH,kBADoBG,MAGH,iBAAVD,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