@egjs/flicking 4.10.7 → 4.10.8-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ name: @egjs/flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking
7
- version: 4.10.7
7
+ version: 4.10.7-snapshot
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -171,7 +171,7 @@ version: 4.10.7
171
171
  };
172
172
  }
173
173
  }
174
- function __values$1(o) {
174
+ function __values$4(o) {
175
175
  var s = typeof Symbol === "function" && Symbol.iterator,
176
176
  m = s && o[s],
177
177
  i = 0;
@@ -187,7 +187,7 @@ version: 4.10.7
187
187
  };
188
188
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
189
189
  }
190
- function __read$1(o, n) {
190
+ function __read$4(o, n) {
191
191
  var m = typeof Symbol === "function" && o[Symbol.iterator];
192
192
  if (!m) return o;
193
193
  var i = m.call(o),
@@ -211,8 +211,8 @@ version: 4.10.7
211
211
  }
212
212
 
213
213
  /** @deprecated */
214
- function __spread$1() {
215
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$1(arguments[i]));
214
+ function __spread$3() {
215
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$4(arguments[i]));
216
216
  return ar;
217
217
  }
218
218
 
@@ -222,9 +222,9 @@ version: 4.10.7
222
222
  license: MIT
223
223
  author: NAVER Corp.
224
224
  repository: https://github.com/naver/egjs-component
225
- version: 3.0.4
225
+ version: 3.0.2-snapshot
226
226
  */
227
- /*! *****************************************************************************
227
+ /******************************************************************************
228
228
  Copyright (c) Microsoft Corporation.
229
229
 
230
230
  Permission to use, copy, modify, and/or distribute this software for any
@@ -238,7 +238,7 @@ version: 4.10.7
238
238
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
239
239
  PERFORMANCE OF THIS SOFTWARE.
240
240
  ***************************************************************************** */
241
- function __values(o) {
241
+ function __values$3(o) {
242
242
  var s = typeof Symbol === "function" && Symbol.iterator,
243
243
  m = s && o[s],
244
244
  i = 0;
@@ -254,7 +254,7 @@ version: 4.10.7
254
254
  };
255
255
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
256
256
  }
257
- function __read(o, n) {
257
+ function __read$3(o, n) {
258
258
  var m = typeof Symbol === "function" && o[Symbol.iterator];
259
259
  if (!m) return o;
260
260
  var i = m.call(o),
@@ -276,37 +276,42 @@ version: 4.10.7
276
276
  }
277
277
  return ar;
278
278
  }
279
- function __spread() {
280
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
281
- return ar;
279
+ function __spreadArray(to, from, pack) {
280
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
281
+ if (ar || !(i in from)) {
282
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
283
+ ar[i] = from[i];
284
+ }
285
+ }
286
+ return to.concat(ar || Array.prototype.slice.call(from));
282
287
  }
283
288
 
284
- /*
285
- * Copyright (c) 2015 NAVER Corp.
286
- * egjs projects are licensed under the MIT license
289
+ /*
290
+ * Copyright (c) 2015 NAVER Corp.
291
+ * egjs projects are licensed under the MIT license
287
292
  */
288
- var isUndefined = function (value) {
293
+ var isUndefined$3 = function (value) {
289
294
  return typeof value === "undefined";
290
295
  };
291
296
 
292
297
  // This class name is not matched to file name intentionally
293
- /**
294
- * Event class to provide additional properties
295
- * @ko Component에서 추가적인 프로퍼티를 제공하는 이벤트 클래스
298
+ /**
299
+ * Event class to provide additional properties
300
+ * @ko Component에서 추가적인 프로퍼티를 제공하는 이벤트 클래스
296
301
  */
297
- var ComponentEvent = /*#__PURE__*/function () {
298
- /**
299
- * Create a new instance of ComponentEvent.
300
- * @ko ComponentEvent의 새로운 인스턴스를 생성한다.
301
- * @param eventType The name of the event.<ko>이벤트 이름.</ko>
302
- * @param props An object that contains additional event properties.<ko>추가적인 이벤트 프로퍼티 오브젝트.</ko>
302
+ var ComponentEvent$4 = /*#__PURE__*/function () {
303
+ /**
304
+ * Create a new instance of ComponentEvent.
305
+ * @ko ComponentEvent의 새로운 인스턴스를 생성한다.
306
+ * @param eventType The name of the event.<ko>이벤트 이름.</ko>
307
+ * @param props An object that contains additional event properties.<ko>추가적인 이벤트 프로퍼티 오브젝트.</ko>
303
308
  */
304
309
  function ComponentEvent(eventType, props) {
305
310
  var e_1, _a;
306
311
  this._canceled = false;
307
312
  if (props) {
308
313
  try {
309
- for (var _b = __values(Object.keys(props)), _c = _b.next(); !_c.done; _c = _b.next()) {
314
+ for (var _b = __values$3(Object.keys(props)), _c = _b.next(); !_c.done; _c = _b.next()) {
310
315
  var key = _c.value;
311
316
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
312
317
  this[key] = props[key];
@@ -325,18 +330,18 @@ version: 4.10.7
325
330
  }
326
331
  this.eventType = eventType;
327
332
  }
328
- /**
329
- * Stop the event. {@link ComponentEvent#isCanceled} will return `true` after.
330
- * @ko 이벤트를 중단한다. 이후 {@link ComponentEvent#isCanceled}가 `true`를 반환한다.
333
+ /**
334
+ * Stop the event. {@link ComponentEvent#isCanceled} will return `true` after.
335
+ * @ko 이벤트를 중단한다. 이후 {@link ComponentEvent#isCanceled}가 `true`를 반환한다.
331
336
  */
332
337
  var __proto = ComponentEvent.prototype;
333
338
  __proto.stop = function () {
334
339
  this._canceled = true;
335
340
  };
336
- /**
337
- * Returns a boolean value that indicates whether {@link ComponentEvent#stop} is called before.
338
- * @ko {@link ComponentEvent#stop}이 호출되었는지 여부를 반환한다.
339
- * @return {boolean} A boolean value that indicates whether {@link ComponentEvent#stop} is called before.<ko>이전에 {@link ComponentEvent#stop}이 불려졌는지 여부를 반환한다.</ko>
341
+ /**
342
+ * Returns a boolean value that indicates whether {@link ComponentEvent#stop} is called before.
343
+ * @ko {@link ComponentEvent#stop}이 호출되었는지 여부를 반환한다.
344
+ * @return {boolean} A boolean value that indicates whether {@link ComponentEvent#stop} is called before.<ko>이전에 {@link ComponentEvent#stop}이 불려졌는지 여부를 반환한다.</ko>
340
345
  */
341
346
  __proto.isCanceled = function () {
342
347
  return this._canceled;
@@ -344,57 +349,57 @@ version: 4.10.7
344
349
  return ComponentEvent;
345
350
  }();
346
351
 
347
- /**
348
- * A class used to manage events in a component
349
- * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스
352
+ /**
353
+ * A class used to manage events in a component
354
+ * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스
350
355
  */
351
- var Component = /*#__PURE__*/function () {
352
- /**
353
- * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"}
356
+ var Component$3 = /*#__PURE__*/function () {
357
+ /**
358
+ * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"}
354
359
  */
355
360
  function Component() {
356
361
  this._eventHandler = {};
357
362
  }
358
- /**
359
- * Trigger a custom event.
360
- * @ko 커스텀 이벤트를 발생시킨다
361
- * @param {string | ComponentEvent} event The name of the custom event to be triggered or an instance of the ComponentEvent<ko>발생할 커스텀 이벤트의 이름 또는 ComponentEvent의 인스턴스</ko>
362
- * @param {any[]} params Event data to be sent when triggering a custom event <ko>커스텀 이벤트가 발생할 때 전달할 데이터</ko>
363
- * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
364
- * @example
365
- * ```ts
366
- * import Component, { ComponentEvent } from "@egjs/component";
367
- *
368
- * class Some extends Component<{
369
- * beforeHi: ComponentEvent<{ foo: number; bar: string }>;
370
- * hi: { foo: { a: number; b: boolean } };
371
- * someEvent: (foo: number, bar: string) => void;
372
- * someOtherEvent: void; // When there's no event argument
373
- * }> {
374
- * some(){
375
- * if(this.trigger("beforeHi")){ // When event call to stop return false.
376
- * this.trigger("hi");// fire hi event.
377
- * }
378
- * }
379
- * }
380
- *
381
- * const some = new Some();
382
- * some.on("beforeHi", e => {
383
- * if(condition){
384
- * e.stop(); // When event call to stop, `hi` event not call.
385
- * }
386
- * // `currentTarget` is component instance.
387
- * console.log(some === e.currentTarget); // true
388
- *
389
- * typeof e.foo; // number
390
- * typeof e.bar; // string
391
- * });
392
- * some.on("hi", e => {
393
- * typeof e.foo.b; // boolean
394
- * });
395
- * // If you want to more know event design. You can see article.
396
- * // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
397
- * ```
363
+ /**
364
+ * Trigger a custom event.
365
+ * @ko 커스텀 이벤트를 발생시킨다
366
+ * @param {string | ComponentEvent} event The name of the custom event to be triggered or an instance of the ComponentEvent<ko>발생할 커스텀 이벤트의 이름 또는 ComponentEvent의 인스턴스</ko>
367
+ * @param {any[]} params Event data to be sent when triggering a custom event <ko>커스텀 이벤트가 발생할 때 전달할 데이터</ko>
368
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
369
+ * @example
370
+ * ```ts
371
+ * import Component, { ComponentEvent } from "@egjs/component";
372
+ *
373
+ * class Some extends Component<{
374
+ * beforeHi: ComponentEvent<{ foo: number; bar: string }>;
375
+ * hi: { foo: { a: number; b: boolean } };
376
+ * someEvent: (foo: number, bar: string) => void;
377
+ * someOtherEvent: void; // When there's no event argument
378
+ * }> {
379
+ * some(){
380
+ * if(this.trigger("beforeHi")){ // When event call to stop return false.
381
+ * this.trigger("hi");// fire hi event.
382
+ * }
383
+ * }
384
+ * }
385
+ *
386
+ * const some = new Some();
387
+ * some.on("beforeHi", e => {
388
+ * if(condition){
389
+ * e.stop(); // When event call to stop, `hi` event not call.
390
+ * }
391
+ * // `currentTarget` is component instance.
392
+ * console.log(some === e.currentTarget); // true
393
+ *
394
+ * typeof e.foo; // number
395
+ * typeof e.bar; // string
396
+ * });
397
+ * some.on("hi", e => {
398
+ * typeof e.foo.b; // boolean
399
+ * });
400
+ * // If you want to more know event design. You can see article.
401
+ * // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
402
+ * ```
398
403
  */
399
404
  var __proto = Component.prototype;
400
405
  __proto.trigger = function (event) {
@@ -402,12 +407,12 @@ version: 4.10.7
402
407
  for (var _i = 1; _i < arguments.length; _i++) {
403
408
  params[_i - 1] = arguments[_i];
404
409
  }
405
- var eventName = event instanceof ComponentEvent ? event.eventType : event;
406
- var handlers = __spread(this._eventHandler[eventName] || []);
410
+ var eventName = event instanceof ComponentEvent$4 ? event.eventType : event;
411
+ var handlers = __spreadArray([], __read$3(this._eventHandler[eventName] || []), false);
407
412
  if (handlers.length <= 0) {
408
413
  return this;
409
414
  }
410
- if (event instanceof ComponentEvent) {
415
+ if (event instanceof ComponentEvent$4) {
411
416
  event.currentTarget = this;
412
417
  handlers.forEach(function (handler) {
413
418
  handler(event);
@@ -415,43 +420,43 @@ version: 4.10.7
415
420
  } else {
416
421
  handlers.forEach(function (handler) {
417
422
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
418
- handler.apply(void 0, __spread(params));
423
+ handler.apply(void 0, __spreadArray([], __read$3(params), false));
419
424
  });
420
425
  }
421
426
  return this;
422
427
  };
423
- /**
424
- * Executed event just one time.
425
- * @ko 이벤트가 한번만 실행된다.
426
- * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
427
- * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
428
- * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
429
- * @example
430
- * ```ts
431
- * import Component, { ComponentEvent } from "@egjs/component";
432
- *
433
- * class Some extends Component<{
434
- * hi: ComponentEvent;
435
- * }> {
436
- * hi() {
437
- * alert("hi");
438
- * }
439
- * thing() {
440
- * this.once("hi", this.hi);
441
- * }
442
- * }
443
- *
444
- * var some = new Some();
445
- * some.thing();
446
- * some.trigger(new ComponentEvent("hi"));
447
- * // fire alert("hi");
448
- * some.trigger(new ComponentEvent("hi"));
449
- * // Nothing happens
450
- * ```
428
+ /**
429
+ * Executed event just one time.
430
+ * @ko 이벤트가 한번만 실행된다.
431
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
432
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
433
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
434
+ * @example
435
+ * ```ts
436
+ * import Component, { ComponentEvent } from "@egjs/component";
437
+ *
438
+ * class Some extends Component<{
439
+ * hi: ComponentEvent;
440
+ * }> {
441
+ * hi() {
442
+ * alert("hi");
443
+ * }
444
+ * thing() {
445
+ * this.once("hi", this.hi);
446
+ * }
447
+ * }
448
+ *
449
+ * var some = new Some();
450
+ * some.thing();
451
+ * some.trigger(new ComponentEvent("hi"));
452
+ * // fire alert("hi");
453
+ * some.trigger(new ComponentEvent("hi"));
454
+ * // Nothing happens
455
+ * ```
451
456
  */
452
457
  __proto.once = function (eventName, handlerToAttach) {
453
458
  var _this = this;
454
- if (typeof eventName === "object" && isUndefined(handlerToAttach)) {
459
+ if (typeof eventName === "object" && isUndefined$3(handlerToAttach)) {
455
460
  var eventHash = eventName;
456
461
  for (var key in eventHash) {
457
462
  this.once(key, eventHash[key]);
@@ -464,58 +469,58 @@ version: 4.10.7
464
469
  args[_i] = arguments[_i];
465
470
  }
466
471
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
467
- handlerToAttach.apply(void 0, __spread(args));
472
+ handlerToAttach.apply(void 0, __spreadArray([], __read$3(args), false));
468
473
  _this.off(eventName, listener_1);
469
474
  };
470
475
  this.on(eventName, listener_1);
471
476
  }
472
477
  return this;
473
478
  };
474
- /**
475
- * Checks whether an event has been attached to a component.
476
- * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.
477
- * @param {string} eventName The name of the event to be attached <ko>등록 여부를 확인할 이벤트의 이름</ko>
478
- * @return {boolean} Indicates whether the event is attached. <ko>이벤트 등록 여부</ko>
479
- * @example
480
- * ```ts
481
- * import Component from "@egjs/component";
482
- *
483
- * class Some extends Component<{
484
- * hi: void;
485
- * }> {
486
- * some() {
487
- * this.hasOn("hi");// check hi event.
488
- * }
489
- * }
490
- * ```
479
+ /**
480
+ * Checks whether an event has been attached to a component.
481
+ * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.
482
+ * @param {string} eventName The name of the event to be attached <ko>등록 여부를 확인할 이벤트의 이름</ko>
483
+ * @return {boolean} Indicates whether the event is attached. <ko>이벤트 등록 여부</ko>
484
+ * @example
485
+ * ```ts
486
+ * import Component from "@egjs/component";
487
+ *
488
+ * class Some extends Component<{
489
+ * hi: void;
490
+ * }> {
491
+ * some() {
492
+ * this.hasOn("hi");// check hi event.
493
+ * }
494
+ * }
495
+ * ```
491
496
  */
492
497
  __proto.hasOn = function (eventName) {
493
498
  return !!this._eventHandler[eventName];
494
499
  };
495
- /**
496
- * Attaches an event to a component.
497
- * @ko 컴포넌트에 이벤트를 등록한다.
498
- * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
499
- * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
500
- * @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
501
- * @example
502
- * ```ts
503
- * import Component, { ComponentEvent } from "@egjs/component";
504
- *
505
- * class Some extends Component<{
506
- * hi: void;
507
- * }> {
508
- * hi() {
509
- * console.log("hi");
510
- * }
511
- * some() {
512
- * this.on("hi",this.hi); //attach event
513
- * }
514
- * }
515
- * ```
500
+ /**
501
+ * Attaches an event to a component.
502
+ * @ko 컴포넌트에 이벤트를 등록한다.
503
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
504
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
505
+ * @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
506
+ * @example
507
+ * ```ts
508
+ * import Component, { ComponentEvent } from "@egjs/component";
509
+ *
510
+ * class Some extends Component<{
511
+ * hi: void;
512
+ * }> {
513
+ * hi() {
514
+ * console.log("hi");
515
+ * }
516
+ * some() {
517
+ * this.on("hi",this.hi); //attach event
518
+ * }
519
+ * }
520
+ * ```
516
521
  */
517
522
  __proto.on = function (eventName, handlerToAttach) {
518
- if (typeof eventName === "object" && isUndefined(handlerToAttach)) {
523
+ if (typeof eventName === "object" && isUndefined$3(handlerToAttach)) {
519
524
  var eventHash = eventName;
520
525
  for (var name in eventHash) {
521
526
  this.on(name, eventHash[name]);
@@ -523,7 +528,7 @@ version: 4.10.7
523
528
  return this;
524
529
  } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
525
530
  var handlerList = this._eventHandler[eventName];
526
- if (isUndefined(handlerList)) {
531
+ if (isUndefined$3(handlerList)) {
527
532
  this._eventHandler[eventName] = [];
528
533
  handlerList = this._eventHandler[eventName];
529
534
  }
@@ -531,37 +536,37 @@ version: 4.10.7
531
536
  }
532
537
  return this;
533
538
  };
534
- /**
535
- * Detaches an event from the component.<br/>If the `eventName` is not given this will detach all event handlers attached.<br/>If the `handlerToDetach` is not given, this will detach all event handlers for `eventName`.
536
- * @ko 컴포넌트에 등록된 이벤트를 해제한다.<br/>`eventName`이 주어지지 않았을 경우 모든 이벤트 핸들러를 제거한다.<br/>`handlerToAttach`가 주어지지 않았을 경우 `eventName`에 해당하는 모든 이벤트 핸들러를 제거한다.
537
- * @param {string?} eventName The name of the event to be detached <ko>해제할 이벤트의 이름</ko>
538
- * @param {function?} handlerToDetach The handler function of the event to be detached <ko>해제할 이벤트의 핸들러 함수</ko>
539
- * @return An instance of a component itself <ko>컴포넌트 자신의 인스턴스</ko>
540
- * @example
541
- * ```ts
542
- * import Component, { ComponentEvent } from "@egjs/component";
543
- *
544
- * class Some extends Component<{
545
- * hi: void;
546
- * }> {
547
- * hi() {
548
- * console.log("hi");
549
- * }
550
- * some() {
551
- * this.off("hi",this.hi); //detach event
552
- * }
553
- * }
554
- * ```
539
+ /**
540
+ * Detaches an event from the component.<br/>If the `eventName` is not given this will detach all event handlers attached.<br/>If the `handlerToDetach` is not given, this will detach all event handlers for `eventName`.
541
+ * @ko 컴포넌트에 등록된 이벤트를 해제한다.<br/>`eventName`이 주어지지 않았을 경우 모든 이벤트 핸들러를 제거한다.<br/>`handlerToAttach`가 주어지지 않았을 경우 `eventName`에 해당하는 모든 이벤트 핸들러를 제거한다.
542
+ * @param {string?} eventName The name of the event to be detached <ko>해제할 이벤트의 이름</ko>
543
+ * @param {function?} handlerToDetach The handler function of the event to be detached <ko>해제할 이벤트의 핸들러 함수</ko>
544
+ * @return An instance of a component itself <ko>컴포넌트 자신의 인스턴스</ko>
545
+ * @example
546
+ * ```ts
547
+ * import Component, { ComponentEvent } from "@egjs/component";
548
+ *
549
+ * class Some extends Component<{
550
+ * hi: void;
551
+ * }> {
552
+ * hi() {
553
+ * console.log("hi");
554
+ * }
555
+ * some() {
556
+ * this.off("hi",this.hi); //detach event
557
+ * }
558
+ * }
559
+ * ```
555
560
  */
556
561
  __proto.off = function (eventName, handlerToDetach) {
557
562
  var e_1, _a;
558
563
  // Detach all event handlers.
559
- if (isUndefined(eventName)) {
564
+ if (isUndefined$3(eventName)) {
560
565
  this._eventHandler = {};
561
566
  return this;
562
567
  }
563
568
  // Detach all handlers for eventname or detach event handlers by object.
564
- if (isUndefined(handlerToDetach)) {
569
+ if (isUndefined$3(handlerToDetach)) {
565
570
  if (typeof eventName === "string") {
566
571
  delete this._eventHandler[eventName];
567
572
  return this;
@@ -578,7 +583,7 @@ version: 4.10.7
578
583
  if (handlerList) {
579
584
  var idx = 0;
580
585
  try {
581
- for (var handlerList_1 = __values(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
586
+ for (var handlerList_1 = __values$3(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
582
587
  var handlerFunction = handlerList_1_1.value;
583
588
  if (handlerFunction === handlerToDetach) {
584
589
  handlerList.splice(idx, 1);
@@ -603,25 +608,25 @@ version: 4.10.7
603
608
  }
604
609
  return this;
605
610
  };
606
- /**
607
- * Version info string
608
- * @ko 버전정보 문자열
609
- * @name VERSION
610
- * @static
611
- * @example
612
- * Component.VERSION; // ex) 3.0.0
613
- * @memberof Component
611
+ /**
612
+ * Version info string
613
+ * @ko 버전정보 문자열
614
+ * @name VERSION
615
+ * @static
616
+ * @example
617
+ * Component.VERSION; // ex) 3.0.0
618
+ * @memberof Component
614
619
  */
615
- Component.VERSION = "3.0.4";
620
+ Component.VERSION = "3.0.2-snapshot";
616
621
  return Component;
617
622
  }();
618
623
 
619
- /*
620
- * Copyright (c) 2015 NAVER Corp.
621
- * egjs projects are licensed under the MIT license
624
+ /*
625
+ * Copyright (c) 2015 NAVER Corp.
626
+ * egjs projects are licensed under the MIT license
622
627
  */
623
628
  // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-assignment
624
- var ComponentEvent$1 = ComponentEvent;
629
+ var ComponentEvent$1$2 = ComponentEvent$4;
625
630
 
626
631
  /*
627
632
  * Copyright (c) 2015 NAVER Corp.
@@ -971,7 +976,7 @@ version: 4.10.7
971
976
  if (isString(el)) {
972
977
  var tempDiv = document.createElement("div");
973
978
  tempDiv.innerHTML = el;
974
- elements.push.apply(elements, __spread$1(toArray$2(tempDiv.children)));
979
+ elements.push.apply(elements, __spread$3(toArray$2(tempDiv.children)));
975
980
  while (tempDiv.firstChild) {
976
981
  tempDiv.removeChild(tempDiv.firstChild);
977
982
  }
@@ -989,7 +994,7 @@ version: 4.10.7
989
994
  var includes = function (array, target) {
990
995
  var e_1, _a;
991
996
  try {
992
- for (var array_1 = __values$1(array), array_1_1 = array_1.next(); !array_1_1.done; array_1_1 = array_1.next()) {
997
+ for (var array_1 = __values$4(array), array_1_1 = array_1.next(); !array_1_1.done; array_1_1 = array_1.next()) {
993
998
  var val = array_1_1.value;
994
999
  if (val === target) return true;
995
1000
  }
@@ -1023,7 +1028,7 @@ version: 4.10.7
1023
1028
  var find$1 = function (array, checker) {
1024
1029
  var e_2, _a;
1025
1030
  try {
1026
- for (var array_2 = __values$1(array), array_2_1 = array_2.next(); !array_2_1.done; array_2_1 = array_2.next()) {
1031
+ for (var array_2 = __values$4(array), array_2_1 = array_2.next(); !array_2_1.done; array_2_1 = array_2.next()) {
1027
1032
  var val = array_2_1.value;
1028
1033
  if (checker(val)) {
1029
1034
  return val;
@@ -2094,199 +2099,1006 @@ version: 4.10.7
2094
2099
  }
2095
2100
 
2096
2101
  /*
2097
- Copyright (c) NAVER Crop.
2098
- name: @cfcs/core
2102
+ Copyright (c) NAVER Corp.
2103
+ name: @egjs/component
2099
2104
  license: MIT
2100
- author: NAVER Crop.
2101
- repository: https://github.com/naver/cfcs
2102
- version: 0.0.4
2105
+ author: NAVER Corp.
2106
+ repository: https://github.com/naver/egjs-component
2107
+ version: 3.0.4
2103
2108
  */
2104
-
2105
- /**
2106
- * cfcs
2107
- * Copyright (c) 2022-present NAVER Corp.
2108
- * MIT license
2109
- */
2110
- function keys(obj) {
2111
- return Object.keys(obj);
2112
- }
2113
-
2114
- var OBSERVERS_PATH = "__observers__";
2115
-
2116
- var Observer =
2117
- /*#__PURE__*/
2118
- function () {
2119
- function Observer(value) {
2120
- this._emitter = new Component();
2121
- this._current = value;
2122
- }
2123
-
2124
- var __proto = Observer.prototype;
2125
- Object.defineProperty(__proto, "current", {
2126
- get: function () {
2127
- return this._current;
2128
- },
2129
- set: function (value) {
2130
- var isUpdate = value !== this._current;
2131
- this._current = value;
2132
-
2133
- if (isUpdate) {
2134
- this._emitter.trigger("update", value);
2135
- }
2136
- },
2137
- enumerable: false,
2138
- configurable: true
2139
- });
2140
-
2141
- __proto.subscribe = function (callback) {
2142
- this._emitter.on("update", callback);
2143
- };
2144
-
2145
- __proto.unsubscribe = function (callback) {
2146
- this._emitter.off("update", callback);
2147
- };
2148
-
2149
- return Observer;
2150
- }();
2151
- function observe(defaultValue) {
2152
- return new Observer(defaultValue);
2153
- }
2154
- function getObservers(instance) {
2155
- if (!instance[OBSERVERS_PATH]) {
2156
- instance[OBSERVERS_PATH] = {};
2157
- }
2158
-
2159
- return instance[OBSERVERS_PATH];
2160
- }
2161
- function getObserver(instance, name, defaultValue) {
2162
- var observers = getObservers(instance);
2163
-
2164
- if (!observers[name]) {
2165
- observers[name] = observe(defaultValue);
2166
- }
2167
-
2168
- return observers[name];
2169
- }
2170
-
2171
- function injectReactiveSubscribe(object) {
2172
- object["subscribe"] = function (name, callback) {
2173
- getObserver(this, name).subscribe(callback);
2174
- };
2175
-
2176
- object["unsubscribe"] = function (name, callback) {
2177
- var _this = this;
2178
-
2179
- if (!name) {
2180
- keys(getObservers(this)).forEach(function (observerName) {
2181
- _this.unsubscribe(observerName);
2182
- });
2183
- return;
2184
- }
2185
-
2186
- if (!(name in this)) {
2187
- return;
2188
- }
2189
-
2190
- getObserver(this, name).unsubscribe(callback);
2191
- };
2192
- }
2193
- function ReactiveSubscribe(Constructor) {
2194
- var prototype = Constructor.prototype;
2195
- injectReactiveSubscribe(prototype);
2196
- }
2197
-
2198
- /*
2199
- Copyright (c) NAVER Corp.
2200
- name: @egjs/axes
2201
- license: MIT
2202
- author: NAVER Corp.
2203
- repository: https://github.com/naver/egjs-axes
2204
- version: 3.8.4
2205
- */
2206
-
2207
2109
  /*! *****************************************************************************
2208
- Copyright (c) Microsoft Corporation. All rights reserved.
2209
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
2210
- this file except in compliance with the License. You may obtain a copy of the
2211
- License at http://www.apache.org/licenses/LICENSE-2.0
2110
+ Copyright (c) Microsoft Corporation.
2212
2111
 
2213
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2214
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
2215
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
2216
- MERCHANTABLITY OR NON-INFRINGEMENT.
2112
+ Permission to use, copy, modify, and/or distribute this software for any
2113
+ purpose with or without fee is hereby granted.
2217
2114
 
2218
- See the Apache Version 2.0 License for specific language governing permissions
2219
- and limitations under the License.
2115
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2116
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2117
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2118
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2119
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2120
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2121
+ PERFORMANCE OF THIS SOFTWARE.
2220
2122
  ***************************************************************************** */
2221
-
2222
- /* global Reflect, Promise */
2223
- var extendStatics$1 = function (d, b) {
2224
- extendStatics$1 = Object.setPrototypeOf || {
2225
- __proto__: []
2226
- } instanceof Array && function (d, b) {
2227
- d.__proto__ = b;
2228
- } || function (d, b) {
2229
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2123
+ function __values$2(o) {
2124
+ var s = typeof Symbol === "function" && Symbol.iterator,
2125
+ m = s && o[s],
2126
+ i = 0;
2127
+ if (m) return m.call(o);
2128
+ if (o && typeof o.length === "number") return {
2129
+ next: function () {
2130
+ if (o && i >= o.length) o = void 0;
2131
+ return {
2132
+ value: o && o[i++],
2133
+ done: !o
2134
+ };
2135
+ }
2230
2136
  };
2231
-
2232
- return extendStatics$1(d, b);
2233
- };
2234
-
2235
- function __extends$1(d, b) {
2236
- extendStatics$1(d, b);
2237
-
2238
- function __() {
2239
- this.constructor = d;
2240
- }
2241
-
2242
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2137
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2243
2138
  }
2244
- var __assign$1 = function () {
2245
- __assign$1 = Object.assign || function __assign(t) {
2246
- for (var s, i = 1, n = arguments.length; i < n; i++) {
2247
- s = arguments[i];
2248
-
2249
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
2139
+ function __read$2(o, n) {
2140
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2141
+ if (!m) return o;
2142
+ var i = m.call(o),
2143
+ r,
2144
+ ar = [],
2145
+ e;
2146
+ try {
2147
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2148
+ } catch (error) {
2149
+ e = {
2150
+ error: error
2151
+ };
2152
+ } finally {
2153
+ try {
2154
+ if (r && !r.done && (m = i["return"])) m.call(i);
2155
+ } finally {
2156
+ if (e) throw e.error;
2250
2157
  }
2251
-
2252
- return t;
2253
- };
2254
-
2255
- return __assign$1.apply(this, arguments);
2256
- };
2257
- function __decorate(decorators, target, key, desc) {
2258
- var c = arguments.length,
2259
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
2260
- d;
2261
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2262
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2158
+ }
2159
+ return ar;
2160
+ }
2161
+ function __spread$2() {
2162
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$2(arguments[i]));
2163
+ return ar;
2263
2164
  }
2264
2165
 
2265
2166
  /*
2266
2167
  * Copyright (c) 2015 NAVER Corp.
2267
2168
  * egjs projects are licensed under the MIT license
2268
2169
  */
2170
+ var isUndefined$2 = function (value) {
2171
+ return typeof value === "undefined";
2172
+ };
2269
2173
 
2270
- /* eslint-disable no-new-func, no-nested-ternary */
2271
- var win;
2272
-
2273
- if (typeof window === "undefined") {
2274
- // window is undefined in node.js
2275
- win = {
2276
- navigator: {
2277
- userAgent: ""
2174
+ // This class name is not matched to file name intentionally
2175
+ /**
2176
+ * Event class to provide additional properties
2177
+ * @ko Component에서 추가적인 프로퍼티를 제공하는 이벤트 클래스
2178
+ */
2179
+ var ComponentEvent$3 = /*#__PURE__*/function () {
2180
+ /**
2181
+ * Create a new instance of ComponentEvent.
2182
+ * @ko ComponentEvent의 새로운 인스턴스를 생성한다.
2183
+ * @param eventType The name of the event.<ko>이벤트 이름.</ko>
2184
+ * @param props An object that contains additional event properties.<ko>추가적인 이벤트 프로퍼티 오브젝트.</ko>
2185
+ */
2186
+ function ComponentEvent(eventType, props) {
2187
+ var e_1, _a;
2188
+ this._canceled = false;
2189
+ if (props) {
2190
+ try {
2191
+ for (var _b = __values$2(Object.keys(props)), _c = _b.next(); !_c.done; _c = _b.next()) {
2192
+ var key = _c.value;
2193
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2194
+ this[key] = props[key];
2195
+ }
2196
+ } catch (e_1_1) {
2197
+ e_1 = {
2198
+ error: e_1_1
2199
+ };
2200
+ } finally {
2201
+ try {
2202
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2203
+ } finally {
2204
+ if (e_1) throw e_1.error;
2205
+ }
2206
+ }
2278
2207
  }
2208
+ this.eventType = eventType;
2209
+ }
2210
+ /**
2211
+ * Stop the event. {@link ComponentEvent#isCanceled} will return `true` after.
2212
+ * @ko 이벤트를 중단한다. 이후 {@link ComponentEvent#isCanceled}가 `true`를 반환한다.
2213
+ */
2214
+ var __proto = ComponentEvent.prototype;
2215
+ __proto.stop = function () {
2216
+ this._canceled = true;
2279
2217
  };
2280
- } else {
2281
- win = window;
2282
- }
2218
+ /**
2219
+ * Returns a boolean value that indicates whether {@link ComponentEvent#stop} is called before.
2220
+ * @ko {@link ComponentEvent#stop}이 호출되었는지 여부를 반환한다.
2221
+ * @return {boolean} A boolean value that indicates whether {@link ComponentEvent#stop} is called before.<ko>이전에 {@link ComponentEvent#stop}이 불려졌는지 여부를 반환한다.</ko>
2222
+ */
2223
+ __proto.isCanceled = function () {
2224
+ return this._canceled;
2225
+ };
2226
+ return ComponentEvent;
2227
+ }();
2283
2228
 
2284
- /*
2285
- * Copyright (c) 2015 NAVER Corp.
2286
- * egjs projects are licensed under the MIT license
2229
+ /**
2230
+ * A class used to manage events in a component
2231
+ * @ko 컴포넌트의 이벤트을 관리할 있게 하는 클래스
2287
2232
  */
2288
- var DIRECTION_NONE = 1;
2289
- var DIRECTION_LEFT = 2;
2233
+ var Component$2 = /*#__PURE__*/function () {
2234
+ /**
2235
+ * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"}
2236
+ */
2237
+ function Component() {
2238
+ this._eventHandler = {};
2239
+ }
2240
+ /**
2241
+ * Trigger a custom event.
2242
+ * @ko 커스텀 이벤트를 발생시킨다
2243
+ * @param {string | ComponentEvent} event The name of the custom event to be triggered or an instance of the ComponentEvent<ko>발생할 커스텀 이벤트의 이름 또는 ComponentEvent의 인스턴스</ko>
2244
+ * @param {any[]} params Event data to be sent when triggering a custom event <ko>커스텀 이벤트가 발생할 때 전달할 데이터</ko>
2245
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
2246
+ * @example
2247
+ * ```ts
2248
+ * import Component, { ComponentEvent } from "@egjs/component";
2249
+ *
2250
+ * class Some extends Component<{
2251
+ * beforeHi: ComponentEvent<{ foo: number; bar: string }>;
2252
+ * hi: { foo: { a: number; b: boolean } };
2253
+ * someEvent: (foo: number, bar: string) => void;
2254
+ * someOtherEvent: void; // When there's no event argument
2255
+ * }> {
2256
+ * some(){
2257
+ * if(this.trigger("beforeHi")){ // When event call to stop return false.
2258
+ * this.trigger("hi");// fire hi event.
2259
+ * }
2260
+ * }
2261
+ * }
2262
+ *
2263
+ * const some = new Some();
2264
+ * some.on("beforeHi", e => {
2265
+ * if(condition){
2266
+ * e.stop(); // When event call to stop, `hi` event not call.
2267
+ * }
2268
+ * // `currentTarget` is component instance.
2269
+ * console.log(some === e.currentTarget); // true
2270
+ *
2271
+ * typeof e.foo; // number
2272
+ * typeof e.bar; // string
2273
+ * });
2274
+ * some.on("hi", e => {
2275
+ * typeof e.foo.b; // boolean
2276
+ * });
2277
+ * // If you want to more know event design. You can see article.
2278
+ * // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
2279
+ * ```
2280
+ */
2281
+ var __proto = Component.prototype;
2282
+ __proto.trigger = function (event) {
2283
+ var params = [];
2284
+ for (var _i = 1; _i < arguments.length; _i++) {
2285
+ params[_i - 1] = arguments[_i];
2286
+ }
2287
+ var eventName = event instanceof ComponentEvent$3 ? event.eventType : event;
2288
+ var handlers = __spread$2(this._eventHandler[eventName] || []);
2289
+ if (handlers.length <= 0) {
2290
+ return this;
2291
+ }
2292
+ if (event instanceof ComponentEvent$3) {
2293
+ event.currentTarget = this;
2294
+ handlers.forEach(function (handler) {
2295
+ handler(event);
2296
+ });
2297
+ } else {
2298
+ handlers.forEach(function (handler) {
2299
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
2300
+ handler.apply(void 0, __spread$2(params));
2301
+ });
2302
+ }
2303
+ return this;
2304
+ };
2305
+ /**
2306
+ * Executed event just one time.
2307
+ * @ko 이벤트가 한번만 실행된다.
2308
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
2309
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
2310
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
2311
+ * @example
2312
+ * ```ts
2313
+ * import Component, { ComponentEvent } from "@egjs/component";
2314
+ *
2315
+ * class Some extends Component<{
2316
+ * hi: ComponentEvent;
2317
+ * }> {
2318
+ * hi() {
2319
+ * alert("hi");
2320
+ * }
2321
+ * thing() {
2322
+ * this.once("hi", this.hi);
2323
+ * }
2324
+ * }
2325
+ *
2326
+ * var some = new Some();
2327
+ * some.thing();
2328
+ * some.trigger(new ComponentEvent("hi"));
2329
+ * // fire alert("hi");
2330
+ * some.trigger(new ComponentEvent("hi"));
2331
+ * // Nothing happens
2332
+ * ```
2333
+ */
2334
+ __proto.once = function (eventName, handlerToAttach) {
2335
+ var _this = this;
2336
+ if (typeof eventName === "object" && isUndefined$2(handlerToAttach)) {
2337
+ var eventHash = eventName;
2338
+ for (var key in eventHash) {
2339
+ this.once(key, eventHash[key]);
2340
+ }
2341
+ return this;
2342
+ } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
2343
+ var listener_1 = function () {
2344
+ var args = [];
2345
+ for (var _i = 0; _i < arguments.length; _i++) {
2346
+ args[_i] = arguments[_i];
2347
+ }
2348
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
2349
+ handlerToAttach.apply(void 0, __spread$2(args));
2350
+ _this.off(eventName, listener_1);
2351
+ };
2352
+ this.on(eventName, listener_1);
2353
+ }
2354
+ return this;
2355
+ };
2356
+ /**
2357
+ * Checks whether an event has been attached to a component.
2358
+ * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.
2359
+ * @param {string} eventName The name of the event to be attached <ko>등록 여부를 확인할 이벤트의 이름</ko>
2360
+ * @return {boolean} Indicates whether the event is attached. <ko>이벤트 등록 여부</ko>
2361
+ * @example
2362
+ * ```ts
2363
+ * import Component from "@egjs/component";
2364
+ *
2365
+ * class Some extends Component<{
2366
+ * hi: void;
2367
+ * }> {
2368
+ * some() {
2369
+ * this.hasOn("hi");// check hi event.
2370
+ * }
2371
+ * }
2372
+ * ```
2373
+ */
2374
+ __proto.hasOn = function (eventName) {
2375
+ return !!this._eventHandler[eventName];
2376
+ };
2377
+ /**
2378
+ * Attaches an event to a component.
2379
+ * @ko 컴포넌트에 이벤트를 등록한다.
2380
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
2381
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
2382
+ * @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
2383
+ * @example
2384
+ * ```ts
2385
+ * import Component, { ComponentEvent } from "@egjs/component";
2386
+ *
2387
+ * class Some extends Component<{
2388
+ * hi: void;
2389
+ * }> {
2390
+ * hi() {
2391
+ * console.log("hi");
2392
+ * }
2393
+ * some() {
2394
+ * this.on("hi",this.hi); //attach event
2395
+ * }
2396
+ * }
2397
+ * ```
2398
+ */
2399
+ __proto.on = function (eventName, handlerToAttach) {
2400
+ if (typeof eventName === "object" && isUndefined$2(handlerToAttach)) {
2401
+ var eventHash = eventName;
2402
+ for (var name in eventHash) {
2403
+ this.on(name, eventHash[name]);
2404
+ }
2405
+ return this;
2406
+ } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
2407
+ var handlerList = this._eventHandler[eventName];
2408
+ if (isUndefined$2(handlerList)) {
2409
+ this._eventHandler[eventName] = [];
2410
+ handlerList = this._eventHandler[eventName];
2411
+ }
2412
+ handlerList.push(handlerToAttach);
2413
+ }
2414
+ return this;
2415
+ };
2416
+ /**
2417
+ * Detaches an event from the component.<br/>If the `eventName` is not given this will detach all event handlers attached.<br/>If the `handlerToDetach` is not given, this will detach all event handlers for `eventName`.
2418
+ * @ko 컴포넌트에 등록된 이벤트를 해제한다.<br/>`eventName`이 주어지지 않았을 경우 모든 이벤트 핸들러를 제거한다.<br/>`handlerToAttach`가 주어지지 않았을 경우 `eventName`에 해당하는 모든 이벤트 핸들러를 제거한다.
2419
+ * @param {string?} eventName The name of the event to be detached <ko>해제할 이벤트의 이름</ko>
2420
+ * @param {function?} handlerToDetach The handler function of the event to be detached <ko>해제할 이벤트의 핸들러 함수</ko>
2421
+ * @return An instance of a component itself <ko>컴포넌트 자신의 인스턴스</ko>
2422
+ * @example
2423
+ * ```ts
2424
+ * import Component, { ComponentEvent } from "@egjs/component";
2425
+ *
2426
+ * class Some extends Component<{
2427
+ * hi: void;
2428
+ * }> {
2429
+ * hi() {
2430
+ * console.log("hi");
2431
+ * }
2432
+ * some() {
2433
+ * this.off("hi",this.hi); //detach event
2434
+ * }
2435
+ * }
2436
+ * ```
2437
+ */
2438
+ __proto.off = function (eventName, handlerToDetach) {
2439
+ var e_1, _a;
2440
+ // Detach all event handlers.
2441
+ if (isUndefined$2(eventName)) {
2442
+ this._eventHandler = {};
2443
+ return this;
2444
+ }
2445
+ // Detach all handlers for eventname or detach event handlers by object.
2446
+ if (isUndefined$2(handlerToDetach)) {
2447
+ if (typeof eventName === "string") {
2448
+ delete this._eventHandler[eventName];
2449
+ return this;
2450
+ } else {
2451
+ var eventHash = eventName;
2452
+ for (var name in eventHash) {
2453
+ this.off(name, eventHash[name]);
2454
+ }
2455
+ return this;
2456
+ }
2457
+ }
2458
+ // Detach single event handler
2459
+ var handlerList = this._eventHandler[eventName];
2460
+ if (handlerList) {
2461
+ var idx = 0;
2462
+ try {
2463
+ for (var handlerList_1 = __values$2(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
2464
+ var handlerFunction = handlerList_1_1.value;
2465
+ if (handlerFunction === handlerToDetach) {
2466
+ handlerList.splice(idx, 1);
2467
+ if (handlerList.length <= 0) {
2468
+ delete this._eventHandler[eventName];
2469
+ }
2470
+ break;
2471
+ }
2472
+ idx++;
2473
+ }
2474
+ } catch (e_1_1) {
2475
+ e_1 = {
2476
+ error: e_1_1
2477
+ };
2478
+ } finally {
2479
+ try {
2480
+ if (handlerList_1_1 && !handlerList_1_1.done && (_a = handlerList_1.return)) _a.call(handlerList_1);
2481
+ } finally {
2482
+ if (e_1) throw e_1.error;
2483
+ }
2484
+ }
2485
+ }
2486
+ return this;
2487
+ };
2488
+ /**
2489
+ * Version info string
2490
+ * @ko 버전정보 문자열
2491
+ * @name VERSION
2492
+ * @static
2493
+ * @example
2494
+ * Component.VERSION; // ex) 3.0.0
2495
+ * @memberof Component
2496
+ */
2497
+ Component.VERSION = "3.0.4";
2498
+ return Component;
2499
+ }();
2500
+
2501
+ /*
2502
+ * Copyright (c) 2015 NAVER Corp.
2503
+ * egjs projects are licensed under the MIT license
2504
+ */
2505
+ // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-assignment
2506
+ var ComponentEvent$1$1 = ComponentEvent$3;
2507
+
2508
+ /*
2509
+ Copyright (c) NAVER Corp.
2510
+ name: @egjs/component
2511
+ license: MIT
2512
+ author: NAVER Corp.
2513
+ repository: https://github.com/naver/egjs-component
2514
+ version: 3.0.4
2515
+ */
2516
+ /*! *****************************************************************************
2517
+ Copyright (c) Microsoft Corporation.
2518
+
2519
+ Permission to use, copy, modify, and/or distribute this software for any
2520
+ purpose with or without fee is hereby granted.
2521
+
2522
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2523
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2524
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2525
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2526
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2527
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2528
+ PERFORMANCE OF THIS SOFTWARE.
2529
+ ***************************************************************************** */
2530
+ function __values$1(o) {
2531
+ var s = typeof Symbol === "function" && Symbol.iterator,
2532
+ m = s && o[s],
2533
+ i = 0;
2534
+ if (m) return m.call(o);
2535
+ if (o && typeof o.length === "number") return {
2536
+ next: function () {
2537
+ if (o && i >= o.length) o = void 0;
2538
+ return {
2539
+ value: o && o[i++],
2540
+ done: !o
2541
+ };
2542
+ }
2543
+ };
2544
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2545
+ }
2546
+ function __read$1(o, n) {
2547
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2548
+ if (!m) return o;
2549
+ var i = m.call(o),
2550
+ r,
2551
+ ar = [],
2552
+ e;
2553
+ try {
2554
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2555
+ } catch (error) {
2556
+ e = {
2557
+ error: error
2558
+ };
2559
+ } finally {
2560
+ try {
2561
+ if (r && !r.done && (m = i["return"])) m.call(i);
2562
+ } finally {
2563
+ if (e) throw e.error;
2564
+ }
2565
+ }
2566
+ return ar;
2567
+ }
2568
+ function __spread$1() {
2569
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$1(arguments[i]));
2570
+ return ar;
2571
+ }
2572
+
2573
+ /*
2574
+ * Copyright (c) 2015 NAVER Corp.
2575
+ * egjs projects are licensed under the MIT license
2576
+ */
2577
+ var isUndefined$1 = function (value) {
2578
+ return typeof value === "undefined";
2579
+ };
2580
+
2581
+ // This class name is not matched to file name intentionally
2582
+ /**
2583
+ * Event class to provide additional properties
2584
+ * @ko Component에서 추가적인 프로퍼티를 제공하는 이벤트 클래스
2585
+ */
2586
+ var ComponentEvent$2 = /*#__PURE__*/function () {
2587
+ /**
2588
+ * Create a new instance of ComponentEvent.
2589
+ * @ko ComponentEvent의 새로운 인스턴스를 생성한다.
2590
+ * @param eventType The name of the event.<ko>이벤트 이름.</ko>
2591
+ * @param props An object that contains additional event properties.<ko>추가적인 이벤트 프로퍼티 오브젝트.</ko>
2592
+ */
2593
+ function ComponentEvent(eventType, props) {
2594
+ var e_1, _a;
2595
+ this._canceled = false;
2596
+ if (props) {
2597
+ try {
2598
+ for (var _b = __values$1(Object.keys(props)), _c = _b.next(); !_c.done; _c = _b.next()) {
2599
+ var key = _c.value;
2600
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2601
+ this[key] = props[key];
2602
+ }
2603
+ } catch (e_1_1) {
2604
+ e_1 = {
2605
+ error: e_1_1
2606
+ };
2607
+ } finally {
2608
+ try {
2609
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2610
+ } finally {
2611
+ if (e_1) throw e_1.error;
2612
+ }
2613
+ }
2614
+ }
2615
+ this.eventType = eventType;
2616
+ }
2617
+ /**
2618
+ * Stop the event. {@link ComponentEvent#isCanceled} will return `true` after.
2619
+ * @ko 이벤트를 중단한다. 이후 {@link ComponentEvent#isCanceled}가 `true`를 반환한다.
2620
+ */
2621
+ var __proto = ComponentEvent.prototype;
2622
+ __proto.stop = function () {
2623
+ this._canceled = true;
2624
+ };
2625
+ /**
2626
+ * Returns a boolean value that indicates whether {@link ComponentEvent#stop} is called before.
2627
+ * @ko {@link ComponentEvent#stop}이 호출되었는지 여부를 반환한다.
2628
+ * @return {boolean} A boolean value that indicates whether {@link ComponentEvent#stop} is called before.<ko>이전에 {@link ComponentEvent#stop}이 불려졌는지 여부를 반환한다.</ko>
2629
+ */
2630
+ __proto.isCanceled = function () {
2631
+ return this._canceled;
2632
+ };
2633
+ return ComponentEvent;
2634
+ }();
2635
+
2636
+ /**
2637
+ * A class used to manage events in a component
2638
+ * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스
2639
+ */
2640
+ var Component$1 = /*#__PURE__*/function () {
2641
+ /**
2642
+ * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"}
2643
+ */
2644
+ function Component() {
2645
+ this._eventHandler = {};
2646
+ }
2647
+ /**
2648
+ * Trigger a custom event.
2649
+ * @ko 커스텀 이벤트를 발생시킨다
2650
+ * @param {string | ComponentEvent} event The name of the custom event to be triggered or an instance of the ComponentEvent<ko>발생할 커스텀 이벤트의 이름 또는 ComponentEvent의 인스턴스</ko>
2651
+ * @param {any[]} params Event data to be sent when triggering a custom event <ko>커스텀 이벤트가 발생할 때 전달할 데이터</ko>
2652
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
2653
+ * @example
2654
+ * ```ts
2655
+ * import Component, { ComponentEvent } from "@egjs/component";
2656
+ *
2657
+ * class Some extends Component<{
2658
+ * beforeHi: ComponentEvent<{ foo: number; bar: string }>;
2659
+ * hi: { foo: { a: number; b: boolean } };
2660
+ * someEvent: (foo: number, bar: string) => void;
2661
+ * someOtherEvent: void; // When there's no event argument
2662
+ * }> {
2663
+ * some(){
2664
+ * if(this.trigger("beforeHi")){ // When event call to stop return false.
2665
+ * this.trigger("hi");// fire hi event.
2666
+ * }
2667
+ * }
2668
+ * }
2669
+ *
2670
+ * const some = new Some();
2671
+ * some.on("beforeHi", e => {
2672
+ * if(condition){
2673
+ * e.stop(); // When event call to stop, `hi` event not call.
2674
+ * }
2675
+ * // `currentTarget` is component instance.
2676
+ * console.log(some === e.currentTarget); // true
2677
+ *
2678
+ * typeof e.foo; // number
2679
+ * typeof e.bar; // string
2680
+ * });
2681
+ * some.on("hi", e => {
2682
+ * typeof e.foo.b; // boolean
2683
+ * });
2684
+ * // If you want to more know event design. You can see article.
2685
+ * // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
2686
+ * ```
2687
+ */
2688
+ var __proto = Component.prototype;
2689
+ __proto.trigger = function (event) {
2690
+ var params = [];
2691
+ for (var _i = 1; _i < arguments.length; _i++) {
2692
+ params[_i - 1] = arguments[_i];
2693
+ }
2694
+ var eventName = event instanceof ComponentEvent$2 ? event.eventType : event;
2695
+ var handlers = __spread$1(this._eventHandler[eventName] || []);
2696
+ if (handlers.length <= 0) {
2697
+ return this;
2698
+ }
2699
+ if (event instanceof ComponentEvent$2) {
2700
+ event.currentTarget = this;
2701
+ handlers.forEach(function (handler) {
2702
+ handler(event);
2703
+ });
2704
+ } else {
2705
+ handlers.forEach(function (handler) {
2706
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
2707
+ handler.apply(void 0, __spread$1(params));
2708
+ });
2709
+ }
2710
+ return this;
2711
+ };
2712
+ /**
2713
+ * Executed event just one time.
2714
+ * @ko 이벤트가 한번만 실행된다.
2715
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
2716
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
2717
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
2718
+ * @example
2719
+ * ```ts
2720
+ * import Component, { ComponentEvent } from "@egjs/component";
2721
+ *
2722
+ * class Some extends Component<{
2723
+ * hi: ComponentEvent;
2724
+ * }> {
2725
+ * hi() {
2726
+ * alert("hi");
2727
+ * }
2728
+ * thing() {
2729
+ * this.once("hi", this.hi);
2730
+ * }
2731
+ * }
2732
+ *
2733
+ * var some = new Some();
2734
+ * some.thing();
2735
+ * some.trigger(new ComponentEvent("hi"));
2736
+ * // fire alert("hi");
2737
+ * some.trigger(new ComponentEvent("hi"));
2738
+ * // Nothing happens
2739
+ * ```
2740
+ */
2741
+ __proto.once = function (eventName, handlerToAttach) {
2742
+ var _this = this;
2743
+ if (typeof eventName === "object" && isUndefined$1(handlerToAttach)) {
2744
+ var eventHash = eventName;
2745
+ for (var key in eventHash) {
2746
+ this.once(key, eventHash[key]);
2747
+ }
2748
+ return this;
2749
+ } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
2750
+ var listener_1 = function () {
2751
+ var args = [];
2752
+ for (var _i = 0; _i < arguments.length; _i++) {
2753
+ args[_i] = arguments[_i];
2754
+ }
2755
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
2756
+ handlerToAttach.apply(void 0, __spread$1(args));
2757
+ _this.off(eventName, listener_1);
2758
+ };
2759
+ this.on(eventName, listener_1);
2760
+ }
2761
+ return this;
2762
+ };
2763
+ /**
2764
+ * Checks whether an event has been attached to a component.
2765
+ * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.
2766
+ * @param {string} eventName The name of the event to be attached <ko>등록 여부를 확인할 이벤트의 이름</ko>
2767
+ * @return {boolean} Indicates whether the event is attached. <ko>이벤트 등록 여부</ko>
2768
+ * @example
2769
+ * ```ts
2770
+ * import Component from "@egjs/component";
2771
+ *
2772
+ * class Some extends Component<{
2773
+ * hi: void;
2774
+ * }> {
2775
+ * some() {
2776
+ * this.hasOn("hi");// check hi event.
2777
+ * }
2778
+ * }
2779
+ * ```
2780
+ */
2781
+ __proto.hasOn = function (eventName) {
2782
+ return !!this._eventHandler[eventName];
2783
+ };
2784
+ /**
2785
+ * Attaches an event to a component.
2786
+ * @ko 컴포넌트에 이벤트를 등록한다.
2787
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
2788
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
2789
+ * @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
2790
+ * @example
2791
+ * ```ts
2792
+ * import Component, { ComponentEvent } from "@egjs/component";
2793
+ *
2794
+ * class Some extends Component<{
2795
+ * hi: void;
2796
+ * }> {
2797
+ * hi() {
2798
+ * console.log("hi");
2799
+ * }
2800
+ * some() {
2801
+ * this.on("hi",this.hi); //attach event
2802
+ * }
2803
+ * }
2804
+ * ```
2805
+ */
2806
+ __proto.on = function (eventName, handlerToAttach) {
2807
+ if (typeof eventName === "object" && isUndefined$1(handlerToAttach)) {
2808
+ var eventHash = eventName;
2809
+ for (var name in eventHash) {
2810
+ this.on(name, eventHash[name]);
2811
+ }
2812
+ return this;
2813
+ } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
2814
+ var handlerList = this._eventHandler[eventName];
2815
+ if (isUndefined$1(handlerList)) {
2816
+ this._eventHandler[eventName] = [];
2817
+ handlerList = this._eventHandler[eventName];
2818
+ }
2819
+ handlerList.push(handlerToAttach);
2820
+ }
2821
+ return this;
2822
+ };
2823
+ /**
2824
+ * Detaches an event from the component.<br/>If the `eventName` is not given this will detach all event handlers attached.<br/>If the `handlerToDetach` is not given, this will detach all event handlers for `eventName`.
2825
+ * @ko 컴포넌트에 등록된 이벤트를 해제한다.<br/>`eventName`이 주어지지 않았을 경우 모든 이벤트 핸들러를 제거한다.<br/>`handlerToAttach`가 주어지지 않았을 경우 `eventName`에 해당하는 모든 이벤트 핸들러를 제거한다.
2826
+ * @param {string?} eventName The name of the event to be detached <ko>해제할 이벤트의 이름</ko>
2827
+ * @param {function?} handlerToDetach The handler function of the event to be detached <ko>해제할 이벤트의 핸들러 함수</ko>
2828
+ * @return An instance of a component itself <ko>컴포넌트 자신의 인스턴스</ko>
2829
+ * @example
2830
+ * ```ts
2831
+ * import Component, { ComponentEvent } from "@egjs/component";
2832
+ *
2833
+ * class Some extends Component<{
2834
+ * hi: void;
2835
+ * }> {
2836
+ * hi() {
2837
+ * console.log("hi");
2838
+ * }
2839
+ * some() {
2840
+ * this.off("hi",this.hi); //detach event
2841
+ * }
2842
+ * }
2843
+ * ```
2844
+ */
2845
+ __proto.off = function (eventName, handlerToDetach) {
2846
+ var e_1, _a;
2847
+ // Detach all event handlers.
2848
+ if (isUndefined$1(eventName)) {
2849
+ this._eventHandler = {};
2850
+ return this;
2851
+ }
2852
+ // Detach all handlers for eventname or detach event handlers by object.
2853
+ if (isUndefined$1(handlerToDetach)) {
2854
+ if (typeof eventName === "string") {
2855
+ delete this._eventHandler[eventName];
2856
+ return this;
2857
+ } else {
2858
+ var eventHash = eventName;
2859
+ for (var name in eventHash) {
2860
+ this.off(name, eventHash[name]);
2861
+ }
2862
+ return this;
2863
+ }
2864
+ }
2865
+ // Detach single event handler
2866
+ var handlerList = this._eventHandler[eventName];
2867
+ if (handlerList) {
2868
+ var idx = 0;
2869
+ try {
2870
+ for (var handlerList_1 = __values$1(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
2871
+ var handlerFunction = handlerList_1_1.value;
2872
+ if (handlerFunction === handlerToDetach) {
2873
+ handlerList.splice(idx, 1);
2874
+ if (handlerList.length <= 0) {
2875
+ delete this._eventHandler[eventName];
2876
+ }
2877
+ break;
2878
+ }
2879
+ idx++;
2880
+ }
2881
+ } catch (e_1_1) {
2882
+ e_1 = {
2883
+ error: e_1_1
2884
+ };
2885
+ } finally {
2886
+ try {
2887
+ if (handlerList_1_1 && !handlerList_1_1.done && (_a = handlerList_1.return)) _a.call(handlerList_1);
2888
+ } finally {
2889
+ if (e_1) throw e_1.error;
2890
+ }
2891
+ }
2892
+ }
2893
+ return this;
2894
+ };
2895
+ /**
2896
+ * Version info string
2897
+ * @ko 버전정보 문자열
2898
+ * @name VERSION
2899
+ * @static
2900
+ * @example
2901
+ * Component.VERSION; // ex) 3.0.0
2902
+ * @memberof Component
2903
+ */
2904
+ Component.VERSION = "3.0.4";
2905
+ return Component;
2906
+ }();
2907
+
2908
+ /*
2909
+ Copyright (c) NAVER Crop.
2910
+ name: @cfcs/core
2911
+ license: MIT
2912
+ author: NAVER Crop.
2913
+ repository: https://github.com/naver/cfcs
2914
+ version: 0.0.4
2915
+ */
2916
+
2917
+ /**
2918
+ * cfcs
2919
+ * Copyright (c) 2022-present NAVER Corp.
2920
+ * MIT license
2921
+ */
2922
+ function keys(obj) {
2923
+ return Object.keys(obj);
2924
+ }
2925
+
2926
+ var OBSERVERS_PATH = "__observers__";
2927
+
2928
+ var Observer =
2929
+ /*#__PURE__*/
2930
+ function () {
2931
+ function Observer(value) {
2932
+ this._emitter = new Component$1();
2933
+ this._current = value;
2934
+ }
2935
+
2936
+ var __proto = Observer.prototype;
2937
+ Object.defineProperty(__proto, "current", {
2938
+ get: function () {
2939
+ return this._current;
2940
+ },
2941
+ set: function (value) {
2942
+ var isUpdate = value !== this._current;
2943
+ this._current = value;
2944
+
2945
+ if (isUpdate) {
2946
+ this._emitter.trigger("update", value);
2947
+ }
2948
+ },
2949
+ enumerable: false,
2950
+ configurable: true
2951
+ });
2952
+
2953
+ __proto.subscribe = function (callback) {
2954
+ this._emitter.on("update", callback);
2955
+ };
2956
+
2957
+ __proto.unsubscribe = function (callback) {
2958
+ this._emitter.off("update", callback);
2959
+ };
2960
+
2961
+ return Observer;
2962
+ }();
2963
+ function observe(defaultValue) {
2964
+ return new Observer(defaultValue);
2965
+ }
2966
+ function getObservers(instance) {
2967
+ if (!instance[OBSERVERS_PATH]) {
2968
+ instance[OBSERVERS_PATH] = {};
2969
+ }
2970
+
2971
+ return instance[OBSERVERS_PATH];
2972
+ }
2973
+ function getObserver(instance, name, defaultValue) {
2974
+ var observers = getObservers(instance);
2975
+
2976
+ if (!observers[name]) {
2977
+ observers[name] = observe(defaultValue);
2978
+ }
2979
+
2980
+ return observers[name];
2981
+ }
2982
+
2983
+ function injectReactiveSubscribe(object) {
2984
+ object["subscribe"] = function (name, callback) {
2985
+ getObserver(this, name).subscribe(callback);
2986
+ };
2987
+
2988
+ object["unsubscribe"] = function (name, callback) {
2989
+ var _this = this;
2990
+
2991
+ if (!name) {
2992
+ keys(getObservers(this)).forEach(function (observerName) {
2993
+ _this.unsubscribe(observerName);
2994
+ });
2995
+ return;
2996
+ }
2997
+
2998
+ if (!(name in this)) {
2999
+ return;
3000
+ }
3001
+
3002
+ getObserver(this, name).unsubscribe(callback);
3003
+ };
3004
+ }
3005
+ function ReactiveSubscribe(Constructor) {
3006
+ var prototype = Constructor.prototype;
3007
+ injectReactiveSubscribe(prototype);
3008
+ }
3009
+
3010
+ /*
3011
+ Copyright (c) NAVER Corp.
3012
+ name: @egjs/axes
3013
+ license: MIT
3014
+ author: NAVER Corp.
3015
+ repository: https://github.com/naver/egjs-axes
3016
+ version: 3.8.4
3017
+ */
3018
+
3019
+ /*! *****************************************************************************
3020
+ Copyright (c) Microsoft Corporation. All rights reserved.
3021
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
3022
+ this file except in compliance with the License. You may obtain a copy of the
3023
+ License at http://www.apache.org/licenses/LICENSE-2.0
3024
+
3025
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
3026
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
3027
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
3028
+ MERCHANTABLITY OR NON-INFRINGEMENT.
3029
+
3030
+ See the Apache Version 2.0 License for specific language governing permissions
3031
+ and limitations under the License.
3032
+ ***************************************************************************** */
3033
+
3034
+ /* global Reflect, Promise */
3035
+ var extendStatics$1 = function (d, b) {
3036
+ extendStatics$1 = Object.setPrototypeOf || {
3037
+ __proto__: []
3038
+ } instanceof Array && function (d, b) {
3039
+ d.__proto__ = b;
3040
+ } || function (d, b) {
3041
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3042
+ };
3043
+
3044
+ return extendStatics$1(d, b);
3045
+ };
3046
+
3047
+ function __extends$1(d, b) {
3048
+ extendStatics$1(d, b);
3049
+
3050
+ function __() {
3051
+ this.constructor = d;
3052
+ }
3053
+
3054
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3055
+ }
3056
+ var __assign$1 = function () {
3057
+ __assign$1 = Object.assign || function __assign(t) {
3058
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3059
+ s = arguments[i];
3060
+
3061
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3062
+ }
3063
+
3064
+ return t;
3065
+ };
3066
+
3067
+ return __assign$1.apply(this, arguments);
3068
+ };
3069
+ function __decorate(decorators, target, key, desc) {
3070
+ var c = arguments.length,
3071
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
3072
+ d;
3073
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3074
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3075
+ }
3076
+
3077
+ /*
3078
+ * Copyright (c) 2015 NAVER Corp.
3079
+ * egjs projects are licensed under the MIT license
3080
+ */
3081
+
3082
+ /* eslint-disable no-new-func, no-nested-ternary */
3083
+ var win;
3084
+
3085
+ if (typeof window === "undefined") {
3086
+ // window is undefined in node.js
3087
+ win = {
3088
+ navigator: {
3089
+ userAgent: ""
3090
+ }
3091
+ };
3092
+ } else {
3093
+ win = window;
3094
+ }
3095
+
3096
+ /*
3097
+ * Copyright (c) 2015 NAVER Corp.
3098
+ * egjs projects are licensed under the MIT license
3099
+ */
3100
+ var DIRECTION_NONE = 1;
3101
+ var DIRECTION_LEFT = 2;
2290
3102
  var DIRECTION_RIGHT = 4;
2291
3103
  var DIRECTION_HORIZONTAL = 2 | 4;
2292
3104
  var DIRECTION_UP = 8;
@@ -2634,7 +3446,7 @@ version: 4.10.7
2634
3446
  __proto.hold = function (pos, option) {
2635
3447
  var roundPos = this._getRoundPos(pos).roundPos;
2636
3448
 
2637
- this._axes.trigger(new ComponentEvent$1("hold", {
3449
+ this._axes.trigger(new ComponentEvent$1$1("hold", {
2638
3450
  pos: roundPos,
2639
3451
  input: option.input || null,
2640
3452
  inputEvent: option.event || null,
@@ -2727,7 +3539,7 @@ version: 4.10.7
2727
3539
  param.depaPos = roundDepa;
2728
3540
  param.setTo = this._createUserControll(param.destPos, param.duration);
2729
3541
 
2730
- this._axes.trigger(new ComponentEvent$1("release", __assign$1(__assign$1({}, param), {
3542
+ this._axes.trigger(new ComponentEvent$1$1("release", __assign$1(__assign$1({}, param), {
2731
3543
  bounceRatio: this._getBounceRatio(roundPos)
2732
3544
  })));
2733
3545
  };
@@ -2799,7 +3611,7 @@ version: 4.10.7
2799
3611
  set: inputEvent ? this._createUserControll(moveTo.pos) : function () {} // eslint-disable-line @typescript-eslint/no-empty-function
2800
3612
 
2801
3613
  };
2802
- var event = new ComponentEvent$1("change", param);
3614
+ var event = new ComponentEvent$1$1("change", param);
2803
3615
 
2804
3616
  this._axes.trigger(event);
2805
3617
 
@@ -2861,7 +3673,7 @@ version: 4.10.7
2861
3673
  param.destPos = roundPos;
2862
3674
  param.depaPos = roundDepa;
2863
3675
  param.setTo = this._createUserControll(param.destPos, param.duration);
2864
- var event = new ComponentEvent$1("animationStart", param);
3676
+ var event = new ComponentEvent$1$1("animationStart", param);
2865
3677
 
2866
3678
  this._axes.trigger(event);
2867
3679
 
@@ -2895,7 +3707,7 @@ version: 4.10.7
2895
3707
  isTrusted = false;
2896
3708
  }
2897
3709
 
2898
- this._axes.trigger(new ComponentEvent$1("animationEnd", {
3710
+ this._axes.trigger(new ComponentEvent$1$1("animationEnd", {
2899
3711
  isTrusted: isTrusted
2900
3712
  }));
2901
3713
  };
@@ -2927,7 +3739,7 @@ version: 4.10.7
2927
3739
  isTrusted = false;
2928
3740
  }
2929
3741
 
2930
- this._axes.trigger(new ComponentEvent$1("finish", {
3742
+ this._axes.trigger(new ComponentEvent$1$1("finish", {
2931
3743
  isTrusted: isTrusted
2932
3744
  }));
2933
3745
  };
@@ -5065,7 +5877,7 @@ version: 4.10.7
5065
5877
  Axes.DIRECTION_ALL = DIRECTION_ALL;
5066
5878
  Axes = __decorate([ReactiveSubscribe], Axes);
5067
5879
  return Axes;
5068
- }(Component);
5880
+ }(Component$2);
5069
5881
 
5070
5882
  /*
5071
5883
  * Copyright (c) 2015 NAVER Corp.
@@ -5651,7 +6463,7 @@ version: 4.10.7
5651
6463
  var position = axesEvent.pos[POSITION_KEY];
5652
6464
  var newPosition = flicking.circularEnabled ? circulatePosition(position, camera.range.min, camera.range.max) : position;
5653
6465
  camera.lookAt(newPosition);
5654
- var moveEvent = new ComponentEvent$1(EVENTS.MOVE, {
6466
+ var moveEvent = new ComponentEvent$1$2(EVENTS.MOVE, {
5655
6467
  isTrusted: axesEvent.isTrusted,
5656
6468
  holding: this.holding,
5657
6469
  direction: getDirection$1(0, axesEvent.delta[POSITION_KEY]),
@@ -5706,7 +6518,7 @@ version: 4.10.7
5706
6518
  transitTo(STATE_TYPE.DISABLED);
5707
6519
  return;
5708
6520
  }
5709
- var holdStartEvent = new ComponentEvent$1(EVENTS.HOLD_START, {
6521
+ var holdStartEvent = new ComponentEvent$1$2(EVENTS.HOLD_START, {
5710
6522
  axesEvent: axesEvent
5711
6523
  });
5712
6524
  flicking.trigger(holdStartEvent);
@@ -5723,7 +6535,7 @@ version: 4.10.7
5723
6535
  transitTo = ctx.transitTo;
5724
6536
  var controller = flicking.control.controller;
5725
6537
  var animatingContext = controller.animatingContext;
5726
- var moveStartEvent = new ComponentEvent$1(EVENTS.MOVE_START, {
6538
+ var moveStartEvent = new ComponentEvent$1$2(EVENTS.MOVE_START, {
5727
6539
  isTrusted: axesEvent.isTrusted,
5728
6540
  holding: this.holding,
5729
6541
  direction: getDirection$1(animatingContext.start, animatingContext.end),
@@ -5773,7 +6585,7 @@ version: 4.10.7
5773
6585
  transitTo = ctx.transitTo;
5774
6586
  var inputEvent = axesEvent.inputEvent;
5775
6587
  var offset = flicking.horizontal ? inputEvent.offsetX : inputEvent.offsetY;
5776
- var moveStartEvent = new ComponentEvent$1(EVENTS.MOVE_START, {
6588
+ var moveStartEvent = new ComponentEvent$1$2(EVENTS.MOVE_START, {
5777
6589
  isTrusted: axesEvent.isTrusted,
5778
6590
  holding: this.holding,
5779
6591
  direction: getDirection$1(0, -offset),
@@ -5791,7 +6603,7 @@ version: 4.10.7
5791
6603
  var flicking = ctx.flicking,
5792
6604
  axesEvent = ctx.axesEvent,
5793
6605
  transitTo = ctx.transitTo;
5794
- flicking.trigger(new ComponentEvent$1(EVENTS.HOLD_END, {
6606
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.HOLD_END, {
5795
6607
  axesEvent: axesEvent
5796
6608
  }));
5797
6609
  if (axesEvent.delta.flick !== 0) {
@@ -5838,7 +6650,7 @@ version: 4.10.7
5838
6650
  var panels = flicking.renderer.panels;
5839
6651
  var clickedPanel = null;
5840
6652
  try {
5841
- for (var panels_1 = __values$1(panels), panels_1_1 = panels_1.next(); !panels_1_1.done; panels_1_1 = panels_1.next()) {
6653
+ for (var panels_1 = __values$4(panels), panels_1_1 = panels_1.next(); !panels_1_1.done; panels_1_1 = panels_1.next()) {
5842
6654
  var panel = panels_1_1.value;
5843
6655
  if (panel.contains(clickedElement)) {
5844
6656
  clickedPanel = panel;
@@ -5859,7 +6671,7 @@ version: 4.10.7
5859
6671
  if (clickedPanel) {
5860
6672
  var cameraPosition = flicking.camera.position;
5861
6673
  var clickedPanelPosition = clickedPanel.position;
5862
- flicking.trigger(new ComponentEvent$1(EVENTS.SELECT, {
6674
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.SELECT, {
5863
6675
  index: clickedPanel.index,
5864
6676
  panel: clickedPanel,
5865
6677
  // Direction to the clicked panel
@@ -5906,7 +6718,7 @@ version: 4.10.7
5906
6718
  transitTo = ctx.transitTo;
5907
6719
  // Update last position to cope with Axes's animating behavior
5908
6720
  // Axes uses start position when animation start
5909
- flicking.trigger(new ComponentEvent$1(EVENTS.HOLD_END, {
6721
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.HOLD_END, {
5910
6722
  axesEvent: axesEvent
5911
6723
  }));
5912
6724
  if (flicking.renderer.panelCount <= 0) {
@@ -5965,7 +6777,7 @@ version: 4.10.7
5965
6777
  if (flicking.changeOnHold && targetPanel) {
5966
6778
  control.setActive(targetPanel, control.activePanel, axesEvent.isTrusted);
5967
6779
  }
5968
- var holdStartEvent = new ComponentEvent$1(EVENTS.HOLD_START, {
6780
+ var holdStartEvent = new ComponentEvent$1$2(EVENTS.HOLD_START, {
5969
6781
  axesEvent: axesEvent
5970
6782
  });
5971
6783
  flicking.trigger(holdStartEvent);
@@ -5986,7 +6798,7 @@ version: 4.10.7
5986
6798
  var controller = control.controller;
5987
6799
  var animatingContext = controller.animatingContext;
5988
6800
  transitTo(STATE_TYPE.IDLE);
5989
- flicking.trigger(new ComponentEvent$1(EVENTS.MOVE_END, {
6801
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.MOVE_END, {
5990
6802
  isTrusted: axesEvent.isTrusted,
5991
6803
  direction: getDirection$1(animatingContext.start, animatingContext.end),
5992
6804
  axesEvent: axesEvent
@@ -6826,7 +7638,7 @@ version: 4.10.7
6826
7638
  this._activePanel = newActivePanel;
6827
7639
  flicking.camera.updateAdaptiveHeight();
6828
7640
  if (newActivePanel !== prevActivePanel) {
6829
- flicking.trigger(new ComponentEvent$1(EVENTS.CHANGED, {
7641
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.CHANGED, {
6830
7642
  index: newActivePanel.index,
6831
7643
  panel: newActivePanel,
6832
7644
  prevIndex: (_a = prevActivePanel === null || prevActivePanel === void 0 ? void 0 : prevActivePanel.index) !== null && _a !== void 0 ? _a : -1,
@@ -6835,7 +7647,7 @@ version: 4.10.7
6835
7647
  direction: prevActivePanel ? getDirection$1(prevActivePanel.position, newActivePanel.position) : DIRECTION.NONE
6836
7648
  }));
6837
7649
  } else {
6838
- flicking.trigger(new ComponentEvent$1(EVENTS.RESTORED, {
7650
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.RESTORED, {
6839
7651
  isTrusted: isTrusted
6840
7652
  }));
6841
7653
  }
@@ -6854,7 +7666,7 @@ version: 4.10.7
6854
7666
  var triggeringEvent = panel !== this._activePanel ? EVENTS.WILL_CHANGE : EVENTS.WILL_RESTORE;
6855
7667
  var camera = flicking.camera;
6856
7668
  var activePanel = this._activePanel;
6857
- var event = new ComponentEvent$1(triggeringEvent, {
7669
+ var event = new ComponentEvent$1$2(triggeringEvent, {
6858
7670
  index: panel.index,
6859
7671
  panel: panel,
6860
7672
  isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
@@ -7949,7 +8761,7 @@ version: 4.10.7
7949
8761
  var supportedStyle = document.documentElement.style;
7950
8762
  var transformName = "";
7951
8763
  try {
7952
- for (var transforms_1 = __values$1(transforms), transforms_1_1 = transforms_1.next(); !transforms_1_1.done; transforms_1_1 = transforms_1.next()) {
8764
+ for (var transforms_1 = __values$4(transforms), transforms_1_1 = transforms_1.next(); !transforms_1_1.done; transforms_1_1 = transforms_1.next()) {
7953
8765
  var prefixedTransform = transforms_1_1.value;
7954
8766
  if (prefixedTransform in supportedStyle) {
7955
8767
  transformName = prefixedTransform;
@@ -8421,263 +9233,670 @@ version: 4.10.7
8421
9233
  return this._mode.canSee(panel);
8422
9234
  };
8423
9235
  /**
8424
- * Update {@link Camera#range range} of Camera
8425
- * @ko Camera의 {@link Camera#range range}를 업데이트합니다
8426
- * @method
8427
- * @abstract
8428
- * @memberof Camera
8429
- * @instance
8430
- * @name updateRange
9236
+ * Update {@link Camera#range range} of Camera
9237
+ * @ko Camera의 {@link Camera#range range}를 업데이트합니다
9238
+ * @method
9239
+ * @abstract
9240
+ * @memberof Camera
9241
+ * @instance
9242
+ * @name updateRange
9243
+ * @chainable
9244
+ * @throws {FlickingError}
9245
+ * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
9246
+ * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
9247
+ * @return {this}
9248
+ */
9249
+ __proto.updateRange = function () {
9250
+ var flicking = getFlickingAttached(this._flicking);
9251
+ var renderer = flicking.renderer;
9252
+ var panels = renderer.panels;
9253
+ this._updateMode();
9254
+ this._range = this._mode.getRange();
9255
+ panels.forEach(function (panel) {
9256
+ return panel.updateCircularToggleDirection();
9257
+ });
9258
+ return this;
9259
+ };
9260
+ /**
9261
+ * Update Camera's {@link Camera#alignPosition alignPosition}
9262
+ * @ko Camera의 {@link Camera#alignPosition alignPosition}을 업데이트합니다
9263
+ * @chainable
9264
+ * @return {this}
9265
+ */
9266
+ __proto.updateAlignPos = function () {
9267
+ var align = this._align;
9268
+ var alignVal = typeof align === "object" ? align.camera : align;
9269
+ this._alignPos = parseAlign$1(alignVal, this.size);
9270
+ return this;
9271
+ };
9272
+ /**
9273
+ * Update Camera's {@link Camera#anchorPoints anchorPoints}
9274
+ * @ko Camera의 {@link Camera#anchorPoints anchorPoints}를 업데이트합니다
9275
+ * @throws {FlickingError}
9276
+ * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
9277
+ * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
9278
+ * @chainable
9279
+ * @return {this}
9280
+ */
9281
+ __proto.updateAnchors = function () {
9282
+ this._anchors = this._mode.getAnchors();
9283
+ return this;
9284
+ };
9285
+ /**
9286
+ * Update Viewport's height to active panel's height
9287
+ * @ko 현재 선택된 패널의 높이와 동일하도록 뷰포트의 높이를 업데이트합니다
9288
+ * @throws {FlickingError}
9289
+ * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
9290
+ * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
9291
+ * @chainable
9292
+ * @return {this}
9293
+ */
9294
+ __proto.updateAdaptiveHeight = function () {
9295
+ var flicking = getFlickingAttached(this._flicking);
9296
+ var activePanel = flicking.control.activePanel;
9297
+ if (!flicking.horizontal || !flicking.adaptive || !activePanel) return;
9298
+ flicking.viewport.setSize({
9299
+ height: activePanel.height
9300
+ });
9301
+ };
9302
+ /**
9303
+ * Update current offset of the camera
9304
+ * @ko 현재 카메라의 오프셋을 업데이트합니다
8431
9305
  * @chainable
8432
- * @throws {FlickingError}
8433
- * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
8434
- * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
8435
9306
  * @return {this}
8436
9307
  */
8437
- __proto.updateRange = function () {
9308
+ __proto.updateOffset = function () {
8438
9309
  var flicking = getFlickingAttached(this._flicking);
8439
- var renderer = flicking.renderer;
8440
- var panels = renderer.panels;
8441
- this._updateMode();
8442
- this._range = this._mode.getRange();
8443
- panels.forEach(function (panel) {
8444
- return panel.updateCircularToggleDirection();
9310
+ var position = this._position;
9311
+ var unRenderedPanels = flicking.panels.filter(function (panel) {
9312
+ return !panel.rendered;
8445
9313
  });
9314
+ this._offset = unRenderedPanels.filter(function (panel) {
9315
+ return panel.position + panel.offset < position;
9316
+ }).reduce(function (offset, panel) {
9317
+ return offset + panel.sizeIncludingMargin;
9318
+ }, 0);
9319
+ this._circularOffset = this._mode.getCircularOffset();
9320
+ this.applyTransform();
8446
9321
  return this;
8447
9322
  };
8448
9323
  /**
8449
- * Update Camera's {@link Camera#alignPosition alignPosition}
8450
- * @ko Camera의 {@link Camera#alignPosition alignPosition} 업데이트합니다
9324
+ * Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
9325
+ * @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
8451
9326
  * @chainable
8452
9327
  * @return {this}
8453
9328
  */
8454
- __proto.updateAlignPos = function () {
8455
- var align = this._align;
8456
- var alignVal = typeof align === "object" ? align.camera : align;
8457
- this._alignPos = parseAlign$1(alignVal, this.size);
9329
+ __proto.resetNeedPanelHistory = function () {
9330
+ this._needPanelTriggered = {
9331
+ prev: false,
9332
+ next: false
9333
+ };
8458
9334
  return this;
8459
9335
  };
8460
9336
  /**
8461
- * Update Camera's {@link Camera#anchorPoints anchorPoints}
8462
- * @ko Camera의 {@link Camera#anchorPoints anchorPoints}를 업데이트합니다
8463
- * @throws {FlickingError}
8464
- * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
8465
- * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
8466
- * @chainable
9337
+ * Apply "transform" style with the current position to camera element
9338
+ * @ko 현재 위치를 기준으로한 transform 스타일을 카메라 엘리먼트에 적용합니다.
8467
9339
  * @return {this}
8468
9340
  */
8469
- __proto.updateAnchors = function () {
8470
- this._anchors = this._mode.getAnchors();
8471
- return this;
8472
- };
8473
- /**
8474
- * Update Viewport's height to active panel's height
8475
- * @ko 현재 선택된 패널의 높이와 동일하도록 뷰포트의 높이를 업데이트합니다
8476
- * @throws {FlickingError}
8477
- * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
8478
- * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
8479
- * @chainable
8480
- * @return {this}
9341
+ __proto.applyTransform = function () {
9342
+ var el = this._el;
9343
+ var flicking = getFlickingAttached(this._flicking);
9344
+ var renderer = flicking.renderer;
9345
+ if (renderer.rendering || !flicking.initialized) return this;
9346
+ var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
9347
+ el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
9348
+ return this;
9349
+ };
9350
+ __proto._resetInternalValues = function () {
9351
+ this._position = 0;
9352
+ this._alignPos = 0;
9353
+ this._offset = 0;
9354
+ this._circularOffset = 0;
9355
+ this._circularEnabled = false;
9356
+ this._range = {
9357
+ min: 0,
9358
+ max: 0
9359
+ };
9360
+ this._visiblePanels = [];
9361
+ this._anchors = [];
9362
+ this._needPanelTriggered = {
9363
+ prev: false,
9364
+ next: false
9365
+ };
9366
+ };
9367
+ __proto._refreshVisiblePanels = function () {
9368
+ var _this = this;
9369
+ var flicking = getFlickingAttached(this._flicking);
9370
+ var panels = flicking.renderer.panels;
9371
+ var newVisiblePanels = panels.filter(function (panel) {
9372
+ return _this.canSee(panel);
9373
+ });
9374
+ var prevVisiblePanels = this._visiblePanels;
9375
+ this._visiblePanels = newVisiblePanels;
9376
+ var added = newVisiblePanels.filter(function (panel) {
9377
+ return !includes(prevVisiblePanels, panel);
9378
+ });
9379
+ var removed = prevVisiblePanels.filter(function (panel) {
9380
+ return !includes(newVisiblePanels, panel);
9381
+ });
9382
+ if (added.length > 0 || removed.length > 0) {
9383
+ void flicking.renderer.render().then(function () {
9384
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.VISIBLE_CHANGE, {
9385
+ added: added,
9386
+ removed: removed,
9387
+ visiblePanels: newVisiblePanels
9388
+ }));
9389
+ });
9390
+ }
9391
+ };
9392
+ __proto._checkNeedPanel = function () {
9393
+ var needPanelTriggered = this._needPanelTriggered;
9394
+ if (needPanelTriggered.prev && needPanelTriggered.next) return;
9395
+ var flicking = getFlickingAttached(this._flicking);
9396
+ var panels = flicking.renderer.panels;
9397
+ if (panels.length <= 0) {
9398
+ if (!needPanelTriggered.prev) {
9399
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.NEED_PANEL, {
9400
+ direction: DIRECTION.PREV
9401
+ }));
9402
+ needPanelTriggered.prev = true;
9403
+ }
9404
+ if (!needPanelTriggered.next) {
9405
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.NEED_PANEL, {
9406
+ direction: DIRECTION.NEXT
9407
+ }));
9408
+ needPanelTriggered.next = true;
9409
+ }
9410
+ return;
9411
+ }
9412
+ var cameraPosition = this._position;
9413
+ var cameraSize = this.size;
9414
+ var cameraRange = this._range;
9415
+ var needPanelThreshold = flicking.needPanelThreshold;
9416
+ var cameraPrev = cameraPosition - this._alignPos;
9417
+ var cameraNext = cameraPrev + cameraSize;
9418
+ var firstPanel = panels[0];
9419
+ var lastPanel = panels[panels.length - 1];
9420
+ if (!needPanelTriggered.prev) {
9421
+ var firstPanelPrev = firstPanel.range.min;
9422
+ if (cameraPrev <= firstPanelPrev + needPanelThreshold || cameraPosition <= cameraRange.min + needPanelThreshold) {
9423
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.NEED_PANEL, {
9424
+ direction: DIRECTION.PREV
9425
+ }));
9426
+ needPanelTriggered.prev = true;
9427
+ }
9428
+ }
9429
+ if (!needPanelTriggered.next) {
9430
+ var lastPanelNext = lastPanel.range.max;
9431
+ if (cameraNext >= lastPanelNext - needPanelThreshold || cameraPosition >= cameraRange.max - needPanelThreshold) {
9432
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.NEED_PANEL, {
9433
+ direction: DIRECTION.NEXT
9434
+ }));
9435
+ needPanelTriggered.next = true;
9436
+ }
9437
+ }
9438
+ };
9439
+ __proto._checkReachEnd = function (prevPos, newPos) {
9440
+ var flicking = getFlickingAttached(this._flicking);
9441
+ var range = this._range;
9442
+ var wasBetweenRange = prevPos > range.min && prevPos < range.max;
9443
+ var isBetweenRange = newPos > range.min && newPos < range.max;
9444
+ if (!wasBetweenRange || isBetweenRange) return;
9445
+ var direction = newPos <= range.min ? DIRECTION.PREV : DIRECTION.NEXT;
9446
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.REACH_EDGE, {
9447
+ direction: direction
9448
+ }));
9449
+ };
9450
+ __proto._updateMode = function () {
9451
+ var flicking = getFlickingAttached(this._flicking);
9452
+ if (flicking.circular) {
9453
+ var circularMode = new CircularCameraMode(flicking);
9454
+ var canSetCircularMode = circularMode.checkAvailability();
9455
+ if (canSetCircularMode) {
9456
+ this._mode = circularMode;
9457
+ } else {
9458
+ var fallbackMode = flicking.circularFallback;
9459
+ this._mode = fallbackMode === CIRCULAR_FALLBACK.BOUND ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
9460
+ }
9461
+ this._circularEnabled = canSetCircularMode;
9462
+ } else {
9463
+ this._mode = flicking.bound ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
9464
+ this._circularEnabled = false;
9465
+ }
9466
+ };
9467
+ __proto._togglePanels = function (prevPos, pos) {
9468
+ if (pos === prevPos) return false;
9469
+ var flicking = getFlickingAttached(this._flicking);
9470
+ var panels = flicking.renderer.panels;
9471
+ var toggled = panels.map(function (panel) {
9472
+ return panel.toggle(prevPos, pos);
9473
+ });
9474
+ return toggled.some(function (isToggled) {
9475
+ return isToggled;
9476
+ });
9477
+ };
9478
+ return Camera;
9479
+ }();
9480
+
9481
+ /*
9482
+ * Copyright (c) 2015 NAVER Corp.
9483
+ * egjs projects are licensed under the MIT license
9484
+ */
9485
+
9486
+ var Camera = {
9487
+ __proto__: null,
9488
+ Camera: Camera$1,
9489
+ LinearCameraMode: LinearCameraMode,
9490
+ CircularCameraMode: CircularCameraMode,
9491
+ BoundCameraMode: BoundCameraMode
9492
+ };
9493
+
9494
+ /*
9495
+ Copyright (c) NAVER Corp.
9496
+ name: @egjs/component
9497
+ license: MIT
9498
+ author: NAVER Corp.
9499
+ repository: https://github.com/naver/egjs-component
9500
+ version: 3.0.4
9501
+ */
9502
+ /*! *****************************************************************************
9503
+ Copyright (c) Microsoft Corporation.
9504
+
9505
+ Permission to use, copy, modify, and/or distribute this software for any
9506
+ purpose with or without fee is hereby granted.
9507
+
9508
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9509
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9510
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
9511
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
9512
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
9513
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
9514
+ PERFORMANCE OF THIS SOFTWARE.
9515
+ ***************************************************************************** */
9516
+ function __values(o) {
9517
+ var s = typeof Symbol === "function" && Symbol.iterator,
9518
+ m = s && o[s],
9519
+ i = 0;
9520
+ if (m) return m.call(o);
9521
+ if (o && typeof o.length === "number") return {
9522
+ next: function () {
9523
+ if (o && i >= o.length) o = void 0;
9524
+ return {
9525
+ value: o && o[i++],
9526
+ done: !o
9527
+ };
9528
+ }
9529
+ };
9530
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
9531
+ }
9532
+ function __read(o, n) {
9533
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
9534
+ if (!m) return o;
9535
+ var i = m.call(o),
9536
+ r,
9537
+ ar = [],
9538
+ e;
9539
+ try {
9540
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
9541
+ } catch (error) {
9542
+ e = {
9543
+ error: error
9544
+ };
9545
+ } finally {
9546
+ try {
9547
+ if (r && !r.done && (m = i["return"])) m.call(i);
9548
+ } finally {
9549
+ if (e) throw e.error;
9550
+ }
9551
+ }
9552
+ return ar;
9553
+ }
9554
+ function __spread() {
9555
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
9556
+ return ar;
9557
+ }
9558
+
9559
+ /*
9560
+ * Copyright (c) 2015 NAVER Corp.
9561
+ * egjs projects are licensed under the MIT license
9562
+ */
9563
+ var isUndefined = function (value) {
9564
+ return typeof value === "undefined";
9565
+ };
9566
+
9567
+ // This class name is not matched to file name intentionally
9568
+ /**
9569
+ * Event class to provide additional properties
9570
+ * @ko Component에서 추가적인 프로퍼티를 제공하는 이벤트 클래스
9571
+ */
9572
+ var ComponentEvent = /*#__PURE__*/function () {
9573
+ /**
9574
+ * Create a new instance of ComponentEvent.
9575
+ * @ko ComponentEvent의 새로운 인스턴스를 생성한다.
9576
+ * @param eventType The name of the event.<ko>이벤트 이름.</ko>
9577
+ * @param props An object that contains additional event properties.<ko>추가적인 이벤트 프로퍼티 오브젝트.</ko>
9578
+ */
9579
+ function ComponentEvent(eventType, props) {
9580
+ var e_1, _a;
9581
+ this._canceled = false;
9582
+ if (props) {
9583
+ try {
9584
+ for (var _b = __values(Object.keys(props)), _c = _b.next(); !_c.done; _c = _b.next()) {
9585
+ var key = _c.value;
9586
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
9587
+ this[key] = props[key];
9588
+ }
9589
+ } catch (e_1_1) {
9590
+ e_1 = {
9591
+ error: e_1_1
9592
+ };
9593
+ } finally {
9594
+ try {
9595
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
9596
+ } finally {
9597
+ if (e_1) throw e_1.error;
9598
+ }
9599
+ }
9600
+ }
9601
+ this.eventType = eventType;
9602
+ }
9603
+ /**
9604
+ * Stop the event. {@link ComponentEvent#isCanceled} will return `true` after.
9605
+ * @ko 이벤트를 중단한다. 이후 {@link ComponentEvent#isCanceled}가 `true`를 반환한다.
8481
9606
  */
8482
- __proto.updateAdaptiveHeight = function () {
8483
- var flicking = getFlickingAttached(this._flicking);
8484
- var activePanel = flicking.control.activePanel;
8485
- if (!flicking.horizontal || !flicking.adaptive || !activePanel) return;
8486
- flicking.viewport.setSize({
8487
- height: activePanel.height
8488
- });
9607
+ var __proto = ComponentEvent.prototype;
9608
+ __proto.stop = function () {
9609
+ this._canceled = true;
8489
9610
  };
8490
- /**
8491
- * Update current offset of the camera
8492
- * @ko 현재 카메라의 오프셋을 업데이트합니다
8493
- * @chainable
8494
- * @return {this}
9611
+ /**
9612
+ * Returns a boolean value that indicates whether {@link ComponentEvent#stop} is called before.
9613
+ * @ko {@link ComponentEvent#stop}이 호출되었는지 여부를 반환한다.
9614
+ * @return {boolean} A boolean value that indicates whether {@link ComponentEvent#stop} is called before.<ko>이전에 {@link ComponentEvent#stop}이 불려졌는지 여부를 반환한다.</ko>
8495
9615
  */
8496
- __proto.updateOffset = function () {
8497
- var flicking = getFlickingAttached(this._flicking);
8498
- var position = this._position;
8499
- var unRenderedPanels = flicking.panels.filter(function (panel) {
8500
- return !panel.rendered;
8501
- });
8502
- this._offset = unRenderedPanels.filter(function (panel) {
8503
- return panel.position + panel.offset < position;
8504
- }).reduce(function (offset, panel) {
8505
- return offset + panel.sizeIncludingMargin;
8506
- }, 0);
8507
- this._circularOffset = this._mode.getCircularOffset();
8508
- this.applyTransform();
8509
- return this;
9616
+ __proto.isCanceled = function () {
9617
+ return this._canceled;
8510
9618
  };
8511
- /**
8512
- * Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
8513
- * @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
8514
- * @chainable
8515
- * @return {this}
9619
+ return ComponentEvent;
9620
+ }();
9621
+
9622
+ /**
9623
+ * A class used to manage events in a component
9624
+ * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스
9625
+ */
9626
+ var Component = /*#__PURE__*/function () {
9627
+ /**
9628
+ * @support {"ie": "7+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.1+ (except 3.x)"}
8516
9629
  */
8517
- __proto.resetNeedPanelHistory = function () {
8518
- this._needPanelTriggered = {
8519
- prev: false,
8520
- next: false
8521
- };
8522
- return this;
8523
- };
8524
- /**
8525
- * Apply "transform" style with the current position to camera element
8526
- * @ko 현재 위치를 기준으로한 transform 스타일을 카메라 엘리먼트에 적용합니다.
8527
- * @return {this}
9630
+ function Component() {
9631
+ this._eventHandler = {};
9632
+ }
9633
+ /**
9634
+ * Trigger a custom event.
9635
+ * @ko 커스텀 이벤트를 발생시킨다
9636
+ * @param {string | ComponentEvent} event The name of the custom event to be triggered or an instance of the ComponentEvent<ko>발생할 커스텀 이벤트의 이름 또는 ComponentEvent의 인스턴스</ko>
9637
+ * @param {any[]} params Event data to be sent when triggering a custom event <ko>커스텀 이벤트가 발생할 때 전달할 데이터</ko>
9638
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
9639
+ * @example
9640
+ * ```ts
9641
+ * import Component, { ComponentEvent } from "@egjs/component";
9642
+ *
9643
+ * class Some extends Component<{
9644
+ * beforeHi: ComponentEvent<{ foo: number; bar: string }>;
9645
+ * hi: { foo: { a: number; b: boolean } };
9646
+ * someEvent: (foo: number, bar: string) => void;
9647
+ * someOtherEvent: void; // When there's no event argument
9648
+ * }> {
9649
+ * some(){
9650
+ * if(this.trigger("beforeHi")){ // When event call to stop return false.
9651
+ * this.trigger("hi");// fire hi event.
9652
+ * }
9653
+ * }
9654
+ * }
9655
+ *
9656
+ * const some = new Some();
9657
+ * some.on("beforeHi", e => {
9658
+ * if(condition){
9659
+ * e.stop(); // When event call to stop, `hi` event not call.
9660
+ * }
9661
+ * // `currentTarget` is component instance.
9662
+ * console.log(some === e.currentTarget); // true
9663
+ *
9664
+ * typeof e.foo; // number
9665
+ * typeof e.bar; // string
9666
+ * });
9667
+ * some.on("hi", e => {
9668
+ * typeof e.foo.b; // boolean
9669
+ * });
9670
+ * // If you want to more know event design. You can see article.
9671
+ * // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
9672
+ * ```
8528
9673
  */
8529
- __proto.applyTransform = function () {
8530
- var el = this._el;
8531
- var flicking = getFlickingAttached(this._flicking);
8532
- var renderer = flicking.renderer;
8533
- if (renderer.rendering || !flicking.initialized) return this;
8534
- var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
8535
- el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
9674
+ var __proto = Component.prototype;
9675
+ __proto.trigger = function (event) {
9676
+ var params = [];
9677
+ for (var _i = 1; _i < arguments.length; _i++) {
9678
+ params[_i - 1] = arguments[_i];
9679
+ }
9680
+ var eventName = event instanceof ComponentEvent ? event.eventType : event;
9681
+ var handlers = __spread(this._eventHandler[eventName] || []);
9682
+ if (handlers.length <= 0) {
9683
+ return this;
9684
+ }
9685
+ if (event instanceof ComponentEvent) {
9686
+ event.currentTarget = this;
9687
+ handlers.forEach(function (handler) {
9688
+ handler(event);
9689
+ });
9690
+ } else {
9691
+ handlers.forEach(function (handler) {
9692
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
9693
+ handler.apply(void 0, __spread(params));
9694
+ });
9695
+ }
8536
9696
  return this;
8537
9697
  };
8538
- __proto._resetInternalValues = function () {
8539
- this._position = 0;
8540
- this._alignPos = 0;
8541
- this._offset = 0;
8542
- this._circularOffset = 0;
8543
- this._circularEnabled = false;
8544
- this._range = {
8545
- min: 0,
8546
- max: 0
8547
- };
8548
- this._visiblePanels = [];
8549
- this._anchors = [];
8550
- this._needPanelTriggered = {
8551
- prev: false,
8552
- next: false
8553
- };
8554
- };
8555
- __proto._refreshVisiblePanels = function () {
8556
- var _this = this;
8557
- var flicking = getFlickingAttached(this._flicking);
8558
- var panels = flicking.renderer.panels;
8559
- var newVisiblePanels = panels.filter(function (panel) {
8560
- return _this.canSee(panel);
8561
- });
8562
- var prevVisiblePanels = this._visiblePanels;
8563
- this._visiblePanels = newVisiblePanels;
8564
- var added = newVisiblePanels.filter(function (panel) {
8565
- return !includes(prevVisiblePanels, panel);
8566
- });
8567
- var removed = prevVisiblePanels.filter(function (panel) {
8568
- return !includes(newVisiblePanels, panel);
8569
- });
8570
- if (added.length > 0 || removed.length > 0) {
8571
- void flicking.renderer.render().then(function () {
8572
- flicking.trigger(new ComponentEvent$1(EVENTS.VISIBLE_CHANGE, {
8573
- added: added,
8574
- removed: removed,
8575
- visiblePanels: newVisiblePanels
8576
- }));
8577
- });
9698
+ /**
9699
+ * Executed event just one time.
9700
+ * @ko 이벤트가 한번만 실행된다.
9701
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
9702
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
9703
+ * @return An instance of the component itself<ko>컴포넌트 자신의 인스턴스</ko>
9704
+ * @example
9705
+ * ```ts
9706
+ * import Component, { ComponentEvent } from "@egjs/component";
9707
+ *
9708
+ * class Some extends Component<{
9709
+ * hi: ComponentEvent;
9710
+ * }> {
9711
+ * hi() {
9712
+ * alert("hi");
9713
+ * }
9714
+ * thing() {
9715
+ * this.once("hi", this.hi);
9716
+ * }
9717
+ * }
9718
+ *
9719
+ * var some = new Some();
9720
+ * some.thing();
9721
+ * some.trigger(new ComponentEvent("hi"));
9722
+ * // fire alert("hi");
9723
+ * some.trigger(new ComponentEvent("hi"));
9724
+ * // Nothing happens
9725
+ * ```
9726
+ */
9727
+ __proto.once = function (eventName, handlerToAttach) {
9728
+ var _this = this;
9729
+ if (typeof eventName === "object" && isUndefined(handlerToAttach)) {
9730
+ var eventHash = eventName;
9731
+ for (var key in eventHash) {
9732
+ this.once(key, eventHash[key]);
9733
+ }
9734
+ return this;
9735
+ } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
9736
+ var listener_1 = function () {
9737
+ var args = [];
9738
+ for (var _i = 0; _i < arguments.length; _i++) {
9739
+ args[_i] = arguments[_i];
9740
+ }
9741
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
9742
+ handlerToAttach.apply(void 0, __spread(args));
9743
+ _this.off(eventName, listener_1);
9744
+ };
9745
+ this.on(eventName, listener_1);
8578
9746
  }
9747
+ return this;
8579
9748
  };
8580
- __proto._checkNeedPanel = function () {
8581
- var needPanelTriggered = this._needPanelTriggered;
8582
- if (needPanelTriggered.prev && needPanelTriggered.next) return;
8583
- var flicking = getFlickingAttached(this._flicking);
8584
- var panels = flicking.renderer.panels;
8585
- if (panels.length <= 0) {
8586
- if (!needPanelTriggered.prev) {
8587
- flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
8588
- direction: DIRECTION.PREV
8589
- }));
8590
- needPanelTriggered.prev = true;
9749
+ /**
9750
+ * Checks whether an event has been attached to a component.
9751
+ * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.
9752
+ * @param {string} eventName The name of the event to be attached <ko>등록 여부를 확인할 이벤트의 이름</ko>
9753
+ * @return {boolean} Indicates whether the event is attached. <ko>이벤트 등록 여부</ko>
9754
+ * @example
9755
+ * ```ts
9756
+ * import Component from "@egjs/component";
9757
+ *
9758
+ * class Some extends Component<{
9759
+ * hi: void;
9760
+ * }> {
9761
+ * some() {
9762
+ * this.hasOn("hi");// check hi event.
9763
+ * }
9764
+ * }
9765
+ * ```
9766
+ */
9767
+ __proto.hasOn = function (eventName) {
9768
+ return !!this._eventHandler[eventName];
9769
+ };
9770
+ /**
9771
+ * Attaches an event to a component.
9772
+ * @ko 컴포넌트에 이벤트를 등록한다.
9773
+ * @param {string} eventName The name of the event to be attached or an event name - event handler mapped object.<ko>등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트</ko>
9774
+ * @param {function} handlerToAttach The handler function of the event to be attached <ko>등록할 이벤트의 핸들러 함수</ko>
9775
+ * @return An instance of a component itself<ko>컴포넌트 자신의 인스턴스</ko>
9776
+ * @example
9777
+ * ```ts
9778
+ * import Component, { ComponentEvent } from "@egjs/component";
9779
+ *
9780
+ * class Some extends Component<{
9781
+ * hi: void;
9782
+ * }> {
9783
+ * hi() {
9784
+ * console.log("hi");
9785
+ * }
9786
+ * some() {
9787
+ * this.on("hi",this.hi); //attach event
9788
+ * }
9789
+ * }
9790
+ * ```
9791
+ */
9792
+ __proto.on = function (eventName, handlerToAttach) {
9793
+ if (typeof eventName === "object" && isUndefined(handlerToAttach)) {
9794
+ var eventHash = eventName;
9795
+ for (var name in eventHash) {
9796
+ this.on(name, eventHash[name]);
8591
9797
  }
8592
- if (!needPanelTriggered.next) {
8593
- flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
8594
- direction: DIRECTION.NEXT
8595
- }));
8596
- needPanelTriggered.next = true;
9798
+ return this;
9799
+ } else if (typeof eventName === "string" && typeof handlerToAttach === "function") {
9800
+ var handlerList = this._eventHandler[eventName];
9801
+ if (isUndefined(handlerList)) {
9802
+ this._eventHandler[eventName] = [];
9803
+ handlerList = this._eventHandler[eventName];
8597
9804
  }
8598
- return;
9805
+ handlerList.push(handlerToAttach);
8599
9806
  }
8600
- var cameraPosition = this._position;
8601
- var cameraSize = this.size;
8602
- var cameraRange = this._range;
8603
- var needPanelThreshold = flicking.needPanelThreshold;
8604
- var cameraPrev = cameraPosition - this._alignPos;
8605
- var cameraNext = cameraPrev + cameraSize;
8606
- var firstPanel = panels[0];
8607
- var lastPanel = panels[panels.length - 1];
8608
- if (!needPanelTriggered.prev) {
8609
- var firstPanelPrev = firstPanel.range.min;
8610
- if (cameraPrev <= firstPanelPrev + needPanelThreshold || cameraPosition <= cameraRange.min + needPanelThreshold) {
8611
- flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
8612
- direction: DIRECTION.PREV
8613
- }));
8614
- needPanelTriggered.prev = true;
8615
- }
9807
+ return this;
9808
+ };
9809
+ /**
9810
+ * Detaches an event from the component.<br/>If the `eventName` is not given this will detach all event handlers attached.<br/>If the `handlerToDetach` is not given, this will detach all event handlers for `eventName`.
9811
+ * @ko 컴포넌트에 등록된 이벤트를 해제한다.<br/>`eventName`이 주어지지 않았을 경우 모든 이벤트 핸들러를 제거한다.<br/>`handlerToAttach`가 주어지지 않았을 경우 `eventName`에 해당하는 모든 이벤트 핸들러를 제거한다.
9812
+ * @param {string?} eventName The name of the event to be detached <ko>해제할 이벤트의 이름</ko>
9813
+ * @param {function?} handlerToDetach The handler function of the event to be detached <ko>해제할 이벤트의 핸들러 함수</ko>
9814
+ * @return An instance of a component itself <ko>컴포넌트 자신의 인스턴스</ko>
9815
+ * @example
9816
+ * ```ts
9817
+ * import Component, { ComponentEvent } from "@egjs/component";
9818
+ *
9819
+ * class Some extends Component<{
9820
+ * hi: void;
9821
+ * }> {
9822
+ * hi() {
9823
+ * console.log("hi");
9824
+ * }
9825
+ * some() {
9826
+ * this.off("hi",this.hi); //detach event
9827
+ * }
9828
+ * }
9829
+ * ```
9830
+ */
9831
+ __proto.off = function (eventName, handlerToDetach) {
9832
+ var e_1, _a;
9833
+ // Detach all event handlers.
9834
+ if (isUndefined(eventName)) {
9835
+ this._eventHandler = {};
9836
+ return this;
8616
9837
  }
8617
- if (!needPanelTriggered.next) {
8618
- var lastPanelNext = lastPanel.range.max;
8619
- if (cameraNext >= lastPanelNext - needPanelThreshold || cameraPosition >= cameraRange.max - needPanelThreshold) {
8620
- flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
8621
- direction: DIRECTION.NEXT
8622
- }));
8623
- needPanelTriggered.next = true;
9838
+ // Detach all handlers for eventname or detach event handlers by object.
9839
+ if (isUndefined(handlerToDetach)) {
9840
+ if (typeof eventName === "string") {
9841
+ delete this._eventHandler[eventName];
9842
+ return this;
9843
+ } else {
9844
+ var eventHash = eventName;
9845
+ for (var name in eventHash) {
9846
+ this.off(name, eventHash[name]);
9847
+ }
9848
+ return this;
8624
9849
  }
8625
9850
  }
8626
- };
8627
- __proto._checkReachEnd = function (prevPos, newPos) {
8628
- var flicking = getFlickingAttached(this._flicking);
8629
- var range = this._range;
8630
- var wasBetweenRange = prevPos > range.min && prevPos < range.max;
8631
- var isBetweenRange = newPos > range.min && newPos < range.max;
8632
- if (!wasBetweenRange || isBetweenRange) return;
8633
- var direction = newPos <= range.min ? DIRECTION.PREV : DIRECTION.NEXT;
8634
- flicking.trigger(new ComponentEvent$1(EVENTS.REACH_EDGE, {
8635
- direction: direction
8636
- }));
8637
- };
8638
- __proto._updateMode = function () {
8639
- var flicking = getFlickingAttached(this._flicking);
8640
- if (flicking.circular) {
8641
- var circularMode = new CircularCameraMode(flicking);
8642
- var canSetCircularMode = circularMode.checkAvailability();
8643
- if (canSetCircularMode) {
8644
- this._mode = circularMode;
8645
- } else {
8646
- var fallbackMode = flicking.circularFallback;
8647
- this._mode = fallbackMode === CIRCULAR_FALLBACK.BOUND ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
9851
+ // Detach single event handler
9852
+ var handlerList = this._eventHandler[eventName];
9853
+ if (handlerList) {
9854
+ var idx = 0;
9855
+ try {
9856
+ for (var handlerList_1 = __values(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {
9857
+ var handlerFunction = handlerList_1_1.value;
9858
+ if (handlerFunction === handlerToDetach) {
9859
+ handlerList.splice(idx, 1);
9860
+ if (handlerList.length <= 0) {
9861
+ delete this._eventHandler[eventName];
9862
+ }
9863
+ break;
9864
+ }
9865
+ idx++;
9866
+ }
9867
+ } catch (e_1_1) {
9868
+ e_1 = {
9869
+ error: e_1_1
9870
+ };
9871
+ } finally {
9872
+ try {
9873
+ if (handlerList_1_1 && !handlerList_1_1.done && (_a = handlerList_1.return)) _a.call(handlerList_1);
9874
+ } finally {
9875
+ if (e_1) throw e_1.error;
9876
+ }
8648
9877
  }
8649
- this._circularEnabled = canSetCircularMode;
8650
- } else {
8651
- this._mode = flicking.bound ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
8652
- this._circularEnabled = false;
8653
9878
  }
9879
+ return this;
8654
9880
  };
8655
- __proto._togglePanels = function (prevPos, pos) {
8656
- if (pos === prevPos) return false;
8657
- var flicking = getFlickingAttached(this._flicking);
8658
- var panels = flicking.renderer.panels;
8659
- var toggled = panels.map(function (panel) {
8660
- return panel.toggle(prevPos, pos);
8661
- });
8662
- return toggled.some(function (isToggled) {
8663
- return isToggled;
8664
- });
8665
- };
8666
- return Camera;
9881
+ /**
9882
+ * Version info string
9883
+ * @ko 버전정보 문자열
9884
+ * @name VERSION
9885
+ * @static
9886
+ * @example
9887
+ * Component.VERSION; // ex) 3.0.0
9888
+ * @memberof Component
9889
+ */
9890
+ Component.VERSION = "3.0.4";
9891
+ return Component;
8667
9892
  }();
8668
9893
 
8669
- /*
8670
- * Copyright (c) 2015 NAVER Corp.
8671
- * egjs projects are licensed under the MIT license
9894
+ /*
9895
+ * Copyright (c) 2015 NAVER Corp.
9896
+ * egjs projects are licensed under the MIT license
8672
9897
  */
8673
-
8674
- var Camera = {
8675
- __proto__: null,
8676
- Camera: Camera$1,
8677
- LinearCameraMode: LinearCameraMode,
8678
- CircularCameraMode: CircularCameraMode,
8679
- BoundCameraMode: BoundCameraMode
8680
- };
9898
+ // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-assignment
9899
+ var ComponentEvent$1 = ComponentEvent;
8681
9900
 
8682
9901
  /*
8683
9902
  Copyright (c) NAVER Corp.
@@ -9717,7 +10936,7 @@ version: 4.10.7
9717
10936
  for (var _i = 0; _i < arguments.length; _i++) {
9718
10937
  items[_i] = arguments[_i];
9719
10938
  }
9720
- var allPanelsInserted = this.batchInsertDefer.apply(this, __spread$1(items));
10939
+ var allPanelsInserted = this.batchInsertDefer.apply(this, __spread$3(items));
9721
10940
  if (allPanelsInserted.length <= 0) return [];
9722
10941
  this.updateAfterPanelChange(allPanelsInserted, []);
9723
10942
  return allPanelsInserted;
@@ -9748,7 +10967,7 @@ version: 4.10.7
9748
10967
  flicking: flicking
9749
10968
  });
9750
10969
  });
9751
- panels.splice.apply(panels, __spread$1([insertingIdx, 0], panelsInserted));
10970
+ panels.splice.apply(panels, __spread$3([insertingIdx, 0], panelsInserted));
9752
10971
  if (item.hasDOMInElements) {
9753
10972
  // Insert the actual elements as camera element's children
9754
10973
  _this._insertPanelElements(panelsInserted, (_a = panelsPushed[0]) !== null && _a !== void 0 ? _a : null);
@@ -9767,7 +10986,7 @@ version: 4.10.7
9767
10986
  panel.increaseIndex(panelsInserted.length);
9768
10987
  panel.updatePosition();
9769
10988
  });
9770
- return __spread$1(addedPanels, panelsInserted);
10989
+ return __spread$3(addedPanels, panelsInserted);
9771
10990
  }, []);
9772
10991
  return allPanelsInserted;
9773
10992
  };
@@ -9787,7 +11006,7 @@ version: 4.10.7
9787
11006
  for (var _i = 0; _i < arguments.length; _i++) {
9788
11007
  items[_i] = arguments[_i];
9789
11008
  }
9790
- var allPanelsRemoved = this.batchRemoveDefer.apply(this, __spread$1(items));
11009
+ var allPanelsRemoved = this.batchRemoveDefer.apply(this, __spread$3(items));
9791
11010
  if (allPanelsRemoved.length <= 0) return [];
9792
11011
  this.updateAfterPanelChange([], allPanelsRemoved);
9793
11012
  return allPanelsRemoved;
@@ -9829,7 +11048,7 @@ version: 4.10.7
9829
11048
  if (includes(panelsRemoved, activePanel)) {
9830
11049
  control.resetActive();
9831
11050
  }
9832
- return __spread$1(removed, panelsRemoved);
11051
+ return __spread$3(removed, panelsRemoved);
9833
11052
  }, []);
9834
11053
  return allPanelsRemoved;
9835
11054
  };
@@ -9872,11 +11091,11 @@ version: 4.10.7
9872
11091
  }
9873
11092
  flicking.camera.updateOffset();
9874
11093
  if (panelsAdded.length > 0 || panelsRemoved.length > 0) {
9875
- flicking.trigger(new ComponentEvent$1(EVENTS.PANEL_CHANGE, {
11094
+ flicking.trigger(new ComponentEvent$1$2(EVENTS.PANEL_CHANGE, {
9876
11095
  added: panelsAdded,
9877
11096
  removed: panelsRemoved
9878
11097
  }));
9879
- this.checkPanelContentsReady(__spread$1(panelsAdded, panelsRemoved));
11098
+ this.checkPanelContentsReady(__spread$3(panelsAdded, panelsRemoved));
9880
11099
  }
9881
11100
  };
9882
11101
  /**
@@ -10761,7 +11980,7 @@ version: 4.10.7
10761
11980
  var notToggled = renderedPanels.filter(function (panel) {
10762
11981
  return !panel.toggled;
10763
11982
  });
10764
- return __spread$1(toggledPrev, notToggled, toggledNext).map(function (panel) {
11983
+ return __spread$3(toggledPrev, notToggled, toggledNext).map(function (panel) {
10765
11984
  return panel.index;
10766
11985
  });
10767
11986
  };
@@ -10941,7 +12160,7 @@ version: 4.10.7
10941
12160
  };
10942
12161
  __proto.getRenderingIndexesByOrder = function (flicking) {
10943
12162
  var virtualManager = flicking.virtual;
10944
- var visiblePanels = __spread$1(flicking.visiblePanels).filter(function (panel) {
12163
+ var visiblePanels = __spread$3(flicking.visiblePanels).filter(function (panel) {
10945
12164
  return panel.rendered;
10946
12165
  }).sort(function (panel1, panel2) {
10947
12166
  return panel1.position + panel1.offset - (panel2.position + panel2.offset);
@@ -10961,7 +12180,7 @@ version: 4.10.7
10961
12180
  }).map(function (el) {
10962
12181
  return el.idx;
10963
12182
  });
10964
- return __spread$1(visibleIndexes, invisibleIndexes);
12183
+ return __spread$3(visibleIndexes, invisibleIndexes);
10965
12184
  };
10966
12185
  __proto.getRenderingElementsByOrder = function (flicking) {
10967
12186
  var virtualManager = flicking.virtual;
@@ -12246,7 +13465,7 @@ version: 4.10.7
12246
13465
  if (preventEventsBeforeInit) {
12247
13466
  _this.trigger = originalTrigger;
12248
13467
  }
12249
- _this.trigger(new ComponentEvent$1(EVENTS.READY));
13468
+ _this.trigger(new ComponentEvent$1$2(EVENTS.READY));
12250
13469
  });
12251
13470
  };
12252
13471
  /**
@@ -12595,7 +13814,7 @@ version: 4.10.7
12595
13814
  return item.init(_this);
12596
13815
  });
12597
13816
  }
12598
- (_a = this._plugins).push.apply(_a, __spread$1(plugins));
13817
+ (_a = this._plugins).push.apply(_a, __spread$3(plugins));
12599
13818
  return this;
12600
13819
  };
12601
13820
  /**
@@ -12644,7 +13863,7 @@ version: 4.10.7
12644
13863
  prevWidth = viewport.width;
12645
13864
  prevHeight = viewport.height;
12646
13865
  prevProgressInPanel = activePanel ? camera.getProgressInPanel(activePanel) : 0;
12647
- this.trigger(new ComponentEvent$1(EVENTS.BEFORE_RESIZE, {
13866
+ this.trigger(new ComponentEvent$1$2(EVENTS.BEFORE_RESIZE, {
12648
13867
  width: prevWidth,
12649
13868
  height: prevHeight,
12650
13869
  element: viewport.element
@@ -12669,7 +13888,7 @@ version: 4.10.7
12669
13888
  newWidth = viewport.width;
12670
13889
  newHeight = viewport.height;
12671
13890
  sizeChanged = newWidth !== prevWidth || newHeight !== prevHeight;
12672
- this.trigger(new ComponentEvent$1(EVENTS.AFTER_RESIZE, {
13891
+ this.trigger(new ComponentEvent$1$2(EVENTS.AFTER_RESIZE, {
12673
13892
  width: viewport.width,
12674
13893
  height: viewport.height,
12675
13894
  prev: {
@@ -12862,7 +14081,7 @@ version: 4.10.7
12862
14081
  var renderer = this._renderer;
12863
14082
  var camera = this._camera;
12864
14083
  var control = this._control;
12865
- this.trigger(new ComponentEvent$1(EVENTS.BEFORE_RESIZE, {
14084
+ this.trigger(new ComponentEvent$1$2(EVENTS.BEFORE_RESIZE, {
12866
14085
  width: 0,
12867
14086
  height: 0,
12868
14087
  element: viewport.element
@@ -12877,7 +14096,7 @@ version: 4.10.7
12877
14096
  var newWidth = viewport.width;
12878
14097
  var newHeight = viewport.height;
12879
14098
  var sizeChanged = newWidth !== 0 || newHeight !== 0;
12880
- this.trigger(new ComponentEvent$1(EVENTS.AFTER_RESIZE, {
14099
+ this.trigger(new ComponentEvent$1$2(EVENTS.AFTER_RESIZE, {
12881
14100
  width: viewport.width,
12882
14101
  height: viewport.height,
12883
14102
  prev: {
@@ -12898,9 +14117,9 @@ version: 4.10.7
12898
14117
  * Flicking.VERSION; // ex) 4.0.0
12899
14118
  * ```
12900
14119
  */
12901
- Flicking.VERSION = "4.10.7";
14120
+ Flicking.VERSION = "4.10.7-snapshot";
12902
14121
  return Flicking;
12903
- }(Component);
14122
+ }(Component$3);
12904
14123
 
12905
14124
  /*
12906
14125
  * Copyright (c) 2015 NAVER Corp.
@@ -12935,7 +14154,7 @@ version: 4.10.7
12935
14154
  * ```
12936
14155
  */
12937
14156
  var withFlickingMethods = function (prototype, flickingName) {
12938
- [Component.prototype, Flicking.prototype].forEach(function (proto) {
14157
+ [Component$3.prototype, Flicking.prototype].forEach(function (proto) {
12939
14158
  Object.getOwnPropertyNames(proto).filter(function (name) {
12940
14159
  return !prototype[name] && name.indexOf("_") !== 0 && name !== "constructor";
12941
14160
  }).forEach(function (name) {
@@ -12949,7 +14168,7 @@ version: 4.10.7
12949
14168
  for (var _i = 0; _i < arguments.length; _i++) {
12950
14169
  args[_i] = arguments[_i];
12951
14170
  }
12952
- return (_a = descriptor.value).call.apply(_a, __spread$1([this[flickingName]], args));
14171
+ return (_a = descriptor.value).call.apply(_a, __spread$3([this[flickingName]], args));
12953
14172
  }
12954
14173
  });
12955
14174
  } else {
@@ -12968,7 +14187,7 @@ version: 4.10.7
12968
14187
  for (var _i = 0; _i < arguments.length; _i++) {
12969
14188
  args[_i] = arguments[_i];
12970
14189
  }
12971
- return (_a = descriptor.set) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spread$1([this[flickingName]], args));
14190
+ return (_a = descriptor.set) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spread$3([this[flickingName]], args));
12972
14191
  };
12973
14192
  }
12974
14193
  Object.defineProperty(prototype, name, getterDescriptor);
@@ -12980,7 +14199,7 @@ version: 4.10.7
12980
14199
  var sync = (function (flicking, diffResult, rendered) {
12981
14200
  var renderer = flicking.renderer;
12982
14201
  var panels = renderer.panels;
12983
- var prevList = __spread$1(diffResult.prevList);
14202
+ var prevList = __spread$3(diffResult.prevList);
12984
14203
  var added = [];
12985
14204
  var removed = [];
12986
14205
  if (diffResult.removed.length > 0) {
@@ -12991,7 +14210,7 @@ version: 4.10.7
12991
14210
  endIdx_1 = removedIdx;
12992
14211
  }
12993
14212
  if (prevIdx_1 >= 0 && removedIdx !== prevIdx_1 - 1) {
12994
- removed.push.apply(removed, __spread$1(batchRemove(renderer, prevIdx_1, endIdx_1 + 1)));
14213
+ removed.push.apply(removed, __spread$3(batchRemove(renderer, prevIdx_1, endIdx_1 + 1)));
12995
14214
  endIdx_1 = removedIdx;
12996
14215
  prevIdx_1 = removedIdx;
12997
14216
  } else {
@@ -12999,10 +14218,10 @@ version: 4.10.7
12999
14218
  }
13000
14219
  prevList.splice(removedIdx, 1);
13001
14220
  });
13002
- removed.push.apply(removed, __spread$1(batchRemove(renderer, prevIdx_1, endIdx_1 + 1)));
14221
+ removed.push.apply(removed, __spread$3(batchRemove(renderer, prevIdx_1, endIdx_1 + 1)));
13003
14222
  }
13004
14223
  diffResult.ordered.forEach(function (_a) {
13005
- var _b = __read$1(_a, 2),
14224
+ var _b = __read$4(_a, 2),
13006
14225
  from = _b[0],
13007
14226
  to = _b[1];
13008
14227
  var prevPanel = panels.splice(from, 1)[0];
@@ -13033,7 +14252,7 @@ version: 4.10.7
13033
14252
  startIdx_1 = idx;
13034
14253
  }
13035
14254
  if (prevIdx_2 >= 0 && addedIdx !== prevIdx_2 + 1) {
13036
- added.push.apply(added, __spread$1(batchInsert(renderer, diffResult, addedElements_1, startIdx_1, idx + 1)));
14255
+ added.push.apply(added, __spread$3(batchInsert(renderer, diffResult, addedElements_1, startIdx_1, idx + 1)));
13037
14256
  startIdx_1 = -1;
13038
14257
  prevIdx_2 = -1;
13039
14258
  } else {
@@ -13041,7 +14260,7 @@ version: 4.10.7
13041
14260
  }
13042
14261
  });
13043
14262
  if (startIdx_1 >= 0) {
13044
- added.push.apply(added, __spread$1(batchInsert(renderer, diffResult, addedElements_1, startIdx_1)));
14263
+ added.push.apply(added, __spread$3(batchInsert(renderer, diffResult, addedElements_1, startIdx_1)));
13045
14264
  }
13046
14265
  }
13047
14266
  if (diffResult.added.length > 0 || diffResult.removed.length > 0) {
@@ -13049,7 +14268,7 @@ version: 4.10.7
13049
14268
  }
13050
14269
  });
13051
14270
  var batchInsert = function (renderer, diffResult, addedElements, startIdx, endIdx) {
13052
- return renderer.batchInsertDefer.apply(renderer, __spread$1(diffResult.added.slice(startIdx, endIdx).map(function (index, elIdx) {
14271
+ return renderer.batchInsertDefer.apply(renderer, __spread$3(diffResult.added.slice(startIdx, endIdx).map(function (index, elIdx) {
13053
14272
  return {
13054
14273
  index: index,
13055
14274
  elements: [addedElements[elIdx]],
@@ -13072,13 +14291,13 @@ version: 4.10.7
13072
14291
  return map;
13073
14292
  }, {});
13074
14293
  var maintainedMap = diffResult.maintained.reduce(function (map, _a) {
13075
- var _b = __read$1(_a, 2),
14294
+ var _b = __read$4(_a, 2),
13076
14295
  prev = _b[0],
13077
14296
  current = _b[1];
13078
14297
  map[prev] = current;
13079
14298
  return map;
13080
14299
  }, {});
13081
- return __spread$1(flicking.panels.filter(function (panel) {
14300
+ return __spread$3(flicking.panels.filter(function (panel) {
13082
14301
  return !removedPanels[panel.index];
13083
14302
  })
13084
14303
  // Sort panels by position