@egjs/flicking 3.9.0 → 3.9.2

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.
Files changed (64) hide show
  1. package/declaration/Flicking.d.ts +2 -1
  2. package/declaration/types.d.ts +4 -0
  3. package/dist/flicking.esm.js +21 -8
  4. package/dist/flicking.esm.js.map +1 -1
  5. package/dist/flicking.js +21 -8
  6. package/dist/flicking.js.map +1 -1
  7. package/dist/flicking.min.js +2 -2
  8. package/dist/flicking.min.js.map +1 -1
  9. package/dist/flicking.pkgd.js +21 -8
  10. package/dist/flicking.pkgd.js.map +1 -1
  11. package/dist/flicking.pkgd.min.js +2 -2
  12. package/dist/flicking.pkgd.min.js.map +1 -1
  13. package/package.json +2 -6
  14. package/src/Flicking.ts +10 -3
  15. package/src/components/Viewport.ts +9 -4
  16. package/src/consts.ts +1 -0
  17. package/src/types.ts +13 -0
  18. package/doc/eg.Flicking.html +0 -12669
  19. package/doc/fonts/glyphicons-halflings-regular.eot +0 -0
  20. package/doc/fonts/glyphicons-halflings-regular.svg +0 -229
  21. package/doc/fonts/glyphicons-halflings-regular.ttf +0 -0
  22. package/doc/fonts/glyphicons-halflings-regular.woff +0 -0
  23. package/doc/global.html +0 -415
  24. package/doc/img/i.png +0 -0
  25. package/doc/img/type_white.svg +0 -26
  26. package/doc/index.html +0 -501
  27. package/doc/node_modules_@egjs_component_src_Component.ts.html +0 -625
  28. package/doc/scripts/bootstrap.min.js +0 -7
  29. package/doc/scripts/jquery.min.js +0 -6
  30. package/doc/scripts/jquery.min.map +0 -1
  31. package/doc/scripts/linenumber.js +0 -29
  32. package/doc/scripts/main.js +0 -101
  33. package/doc/scripts/prettify/Apache-License-2.0.txt +0 -202
  34. package/doc/scripts/prettify/lang-css.js +0 -2
  35. package/doc/scripts/prettify/prettify.js +0 -28
  36. package/doc/scripts/underscore-min.js +0 -6
  37. package/doc/scripts/underscore-min.map +0 -1
  38. package/doc/src_Flicking.ts.html +0 -1259
  39. package/doc/src_types.ts.html +0 -816
  40. package/doc/styles/bootstrap.min.css +0 -7
  41. package/doc/styles/jaguar.css +0 -469
  42. package/doc/styles/prettify-jsdoc.css +0 -111
  43. package/doc/styles/prettify-tomorrow.css +0 -136
  44. package/doc/styles/style.css +0 -13
  45. package/docs/build/release/3.8.4/dist/flicking.esm.js +0 -5055
  46. package/docs/build/release/3.8.4/dist/flicking.esm.js.map +0 -1
  47. package/docs/build/release/3.8.4/dist/flicking.js +0 -5062
  48. package/docs/build/release/3.8.4/dist/flicking.js.map +0 -1
  49. package/docs/build/release/3.8.4/dist/flicking.min.js +0 -10
  50. package/docs/build/release/3.8.4/dist/flicking.min.js.map +0 -1
  51. package/docs/build/release/3.8.4/dist/flicking.pkgd.js +0 -11391
  52. package/docs/build/release/3.8.4/dist/flicking.pkgd.js.map +0 -1
  53. package/docs/build/release/3.8.4/dist/flicking.pkgd.min.js +0 -10
  54. package/docs/build/release/3.8.4/dist/flicking.pkgd.min.js.map +0 -1
  55. package/docs/build/release/3.9.0/dist/flicking.esm.js +0 -5124
  56. package/docs/build/release/3.9.0/dist/flicking.esm.js.map +0 -1
  57. package/docs/build/release/3.9.0/dist/flicking.js +0 -5131
  58. package/docs/build/release/3.9.0/dist/flicking.js.map +0 -1
  59. package/docs/build/release/3.9.0/dist/flicking.min.js +0 -10
  60. package/docs/build/release/3.9.0/dist/flicking.min.js.map +0 -1
  61. package/docs/build/release/3.9.0/dist/flicking.pkgd.js +0 -11460
  62. package/docs/build/release/3.9.0/dist/flicking.pkgd.js.map +0 -1
  63. package/docs/build/release/3.9.0/dist/flicking.pkgd.min.js +0 -10
  64. package/docs/build/release/3.9.0/dist/flicking.pkgd.min.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egjs/flicking",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.",
5
5
  "main": "dist/flicking.js",
6
6
  "module": "dist/flicking.esm.js",
@@ -22,11 +22,7 @@
22
22
  "demo:deploy": "npm run build && npm run jsdoc && npm run demo:prebuild-version && gh-pages -d docs/build/ --add --remote upstream",
23
23
  "release": "release-helper upstream",
24
24
  "changelog": "node ./config/changelog.js",
25
- "coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
26
- "packages": "npm run packages:update && npm run packages:build && npm run packages:publish",
27
- "packages:update": "pvu --update=react-flicking,ngx-flicking/projects/ngx-flicking,vue-flicking",
28
- "packages:build": "pvu --build=react-flicking,ngx-flicking,vue-flicking",
29
- "packages:publish": "pvu --publish=react-flicking,ngx-flicking/dist/ngx-flicking,vue-flicking"
25
+ "coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
30
26
  },
31
27
  "repository": {
32
28
  "type": "git",
package/src/Flicking.ts CHANGED
@@ -30,6 +30,7 @@ import {
30
30
  SelectEvent,
31
31
  NeedPanelEvent,
32
32
  VisibleChangeEvent,
33
+ ContentLoadEvent,
33
34
  ContentErrorEvent,
34
35
  MoveTypeStringOption,
35
36
  ValueOf,
@@ -54,6 +55,7 @@ class Flicking extends Component<{
54
55
  select: SelectEvent;
55
56
  needPanel: NeedPanelEvent;
56
57
  visibleChange: VisibleChangeEvent;
58
+ contentLoad: ContentLoadEvent;
57
59
  contentError: ContentErrorEvent;
58
60
  }> {
59
61
  /**
@@ -871,12 +873,17 @@ class Flicking extends Component<{
871
873
  if (options.resizeOnContentsReady) {
872
874
  const contentsReadyChecker = new ImReady();
873
875
 
874
- contentsReadyChecker.on("preReady", () => {
876
+ const onContentLoad = () => {
875
877
  this.resize();
876
- });
878
+ this.trigger(EVENTS.CONTENT_LOAD, {
879
+ type: EVENTS.CONTENT_LOAD,
880
+ });
881
+ };
882
+
883
+ contentsReadyChecker.on("preReady", onContentLoad);
877
884
  contentsReadyChecker.on("readyElement", e => {
878
885
  if (e.hasLoading && e.isPreReadyOver) {
879
- this.resize();
886
+ onContentLoad();
880
887
  }
881
888
  });
882
889
  contentsReadyChecker.on("error", e => {
@@ -1265,14 +1265,18 @@ export default class Viewport {
1265
1265
  // For each panels, clone itself while last panel's position + size is below viewport size
1266
1266
  const panels = panelManager.originalPanels();
1267
1267
  const reversedPanels = panels.concat().reverse();
1268
-
1269
1268
  const sumOriginalPanelSize = lastPanel.getPosition() + lastPanel.getSize() - firstPanel.getPosition() + gap;
1269
+
1270
+ if (sumOriginalPanelSize <= 0) {
1271
+ return;
1272
+ }
1273
+
1270
1274
  const relativeAnchorPosition = firstPanel.getRelativeAnchorPosition();
1271
1275
  const relativeHangerPosition = this.getRelativeHangerPosition();
1272
1276
 
1273
1277
  const areaPrev = (relativeHangerPosition - relativeAnchorPosition) % sumOriginalPanelSize;
1274
1278
  let sizeSum = 0;
1275
- let panelAtLeftBoundary!: Panel;
1279
+ let panelAtLeftBoundary: Panel | null = null;
1276
1280
  for (const panel of reversedPanels) {
1277
1281
  if (!panel) {
1278
1282
  continue;
@@ -1286,7 +1290,7 @@ export default class Viewport {
1286
1290
 
1287
1291
  const areaNext = (viewportSize - relativeHangerPosition + relativeAnchorPosition) % sumOriginalPanelSize;
1288
1292
  sizeSum = 0;
1289
- let panelAtRightBoundary!: Panel;
1293
+ let panelAtRightBoundary: Panel | null = null;
1290
1294
  for (const panel of panels) {
1291
1295
  if (!panel) {
1292
1296
  continue;
@@ -1299,7 +1303,8 @@ export default class Viewport {
1299
1303
  }
1300
1304
 
1301
1305
  // Need one more set of clones on prev area of original panel 0
1302
- const needCloneOnPrev = panelAtLeftBoundary.getIndex() !== 0
1306
+ const needCloneOnPrev = (panelAtLeftBoundary && panelAtRightBoundary)
1307
+ && panelAtLeftBoundary.getIndex() !== 0
1303
1308
  && panelAtLeftBoundary.getIndex() <= panelAtRightBoundary.getIndex();
1304
1309
 
1305
1310
  // Visible count of panel 0 on first screen
package/src/consts.ts CHANGED
@@ -95,6 +95,7 @@ export const EVENTS: EventType = {
95
95
  SELECT: "select",
96
96
  NEED_PANEL: "needPanel",
97
97
  VISIBLE_CHANGE: "visibleChange",
98
+ CONTENT_LOAD: "contentLoad",
98
99
  CONTENT_ERROR: "contentError",
99
100
  };
100
101
 
package/src/types.ts CHANGED
@@ -311,6 +311,7 @@ export interface EventType {
311
311
  readonly SELECT: "select";
312
312
  readonly NEED_PANEL: "needPanel";
313
313
  readonly VISIBLE_CHANGE: "visibleChange";
314
+ readonly CONTENT_LOAD: "contentLoad";
314
315
  readonly CONTENT_ERROR: "contentError";
315
316
  }
316
317
 
@@ -467,6 +468,18 @@ export type VisibleChangeEvent = {
467
468
  };
468
469
  };
469
470
 
471
+ /**
472
+ * Event triggered when each image/video element inside Flicking has loaded. This event is only triggered with `resizeOnContentsReady` option.
473
+ * @ko Flicking 내부의 이미지/비디오 엘리먼트들이 로드되었을 때마다 트리거되는 이벤트. `resizeOnContentsReady` 옵션이 활성화된 경우에만 트리거된다.
474
+ * @typedef
475
+ * @type object
476
+ * @memberof eg.Flicking
477
+ * @property {string} type Name of the event.<ko>이벤트명</ko>
478
+ */
479
+ export type ContentLoadEvent = {
480
+ type: string;
481
+ };
482
+
470
483
  /**
471
484
  * Event triggered each time the image/video element inside Flicking fails to load. This event is only triggered with `resizeOnContentsReady` option.
472
485
  * @ko Flicking 내부의 이미지/비디오 엘리먼트의 로드가 실패했을때마다 발생했을 때마다 트리거되는 이벤트. `resizeOnContentsReady` 옵션이 활성화된 경우에만 트리거된다.