@egjs/react-flicking 4.11.5-beta.4 → 4.12.0-beta.10

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 (37) hide show
  1. package/declaration/CrossFlicking.d.ts +24 -0
  2. package/declaration/CrossGroup.d.ts +5 -0
  3. package/declaration/Flicking.d.ts +56 -41
  4. package/declaration/NonStrictPanel.d.ts +12 -12
  5. package/declaration/ReactElementProvider.d.ts +12 -12
  6. package/declaration/ReactRenderer.d.ts +17 -17
  7. package/declaration/StrictPanel.d.ts +14 -14
  8. package/declaration/ViewportSlot.d.ts +5 -5
  9. package/declaration/consts.d.ts +2 -2
  10. package/declaration/index.d.ts +8 -6
  11. package/declaration/index.umd.d.ts +2 -2
  12. package/declaration/types.d.ts +32 -32
  13. package/dist/flicking-inline.css +9 -1
  14. package/dist/flicking.cjs.js +54 -37
  15. package/dist/flicking.cjs.js.map +1 -1
  16. package/dist/flicking.css +4 -0
  17. package/dist/flicking.esm.js +143 -39
  18. package/dist/flicking.esm.js.map +1 -1
  19. package/dist/flicking.js +9221 -0
  20. package/dist/flicking.js.map +1 -0
  21. package/dist/flicking.min.js +10 -0
  22. package/dist/flicking.min.js.map +1 -0
  23. package/dist/flicking.pkgd.js +14483 -0
  24. package/dist/flicking.pkgd.js.map +1 -0
  25. package/dist/flicking.pkgd.min.js +10 -0
  26. package/dist/flicking.pkgd.min.js.map +1 -0
  27. package/dist/flicking.umd.js +54 -37
  28. package/dist/flicking.umd.js.map +1 -1
  29. package/package.json +3 -3
  30. package/src/react-flicking/CrossFlicking.tsx +135 -0
  31. package/src/react-flicking/CrossGroup.tsx +9 -0
  32. package/src/react-flicking/Flicking.tsx +61 -45
  33. package/src/react-flicking/consts.ts +1 -0
  34. package/src/react-flicking/index.ts +5 -1
  35. package/src/react-flicking/types.ts +1 -0
  36. package/dist/flicking-inline.css.map +0 -1
  37. package/dist/flicking.css.map +0 -1
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import { CrossFlickingEvent, HoldStartEvent, HoldEndEvent, MoveStartEvent, MoveEvent, MoveEndEvent, WillChangeEvent, ChangedEvent, CrossFlickingOptions, FlickingOptions } from "@egjs/flicking";
3
+ import { FlickingProps } from "./types";
4
+ import Flicking from "./Flicking";
5
+ export interface CrossFlickingProps extends FlickingProps {
6
+ onSideHoldStart: (e: CrossFlickingEvent<HoldStartEvent<Flicking>>) => any;
7
+ onSideHoldEnd: (e: CrossFlickingEvent<HoldEndEvent<Flicking>>) => any;
8
+ onSideMoveStart: (e: CrossFlickingEvent<MoveStartEvent<Flicking>>) => any;
9
+ onSideMove: (e: CrossFlickingEvent<MoveEvent<Flicking>>) => any;
10
+ onSideMoveEnd: (e: CrossFlickingEvent<MoveEndEvent<Flicking>>) => any;
11
+ onSideWillChange: (e: CrossFlickingEvent<WillChangeEvent<Flicking>>) => any;
12
+ onSideChanged: (e: CrossFlickingEvent<ChangedEvent<Flicking>>) => any;
13
+ }
14
+ export declare const CROSSFLICKING_DEFAULT_PROPS: CrossFlickingProps;
15
+ declare class CrossFlicking extends Flicking {
16
+ static defaultProps: CrossFlickingProps;
17
+ constructor(props: Partial<FlickingProps & FlickingOptions & CrossFlickingOptions & CrossFlickingProps>);
18
+ componentDidMount(): void;
19
+ render(): JSX.Element;
20
+ protected _bindEvents(): void;
21
+ }
22
+ interface CrossFlicking extends Flicking {
23
+ }
24
+ export default CrossFlicking;
@@ -0,0 +1,5 @@
1
+ import React, { ReactNode } from "react";
2
+ declare const CrossGroup: React.ForwardRefExoticComponent<{
3
+ children?: ReactNode;
4
+ } & React.RefAttributes<HTMLDivElement>>;
5
+ export default CrossGroup;
@@ -1,41 +1,56 @@
1
- import * as React from "react";
2
- import Component from "@egjs/component";
3
- import VanillaFlicking, { FlickingOptions } from "@egjs/flicking";
4
- import { FlickingProps } from "./types";
5
- import StrictPanel from "./StrictPanel";
6
- import NonStrictPanel from "./NonStrictPanel";
7
- declare class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>> {
8
- static defaultProps: FlickingProps;
9
- private _vanillaFlicking;
10
- private _panels;
11
- private _pluginsDiffer;
12
- private _jsxDiffer;
13
- private _viewportElement;
14
- private _diffResult;
15
- private _renderEmitter;
16
- private _prevChildren;
17
- get reactPanels(): (StrictPanel | NonStrictPanel | HTMLDivElement)[];
18
- get renderEmitter(): Component<{
19
- render: void;
20
- }>;
21
- constructor(props: Partial<FlickingProps & FlickingOptions>);
22
- componentDidMount(): void;
23
- componentWillUnmount(): void;
24
- shouldComponentUpdate(nextProps: Readonly<Partial<FlickingProps & FlickingOptions>>): boolean;
25
- beforeRender(): void;
26
- componentDidUpdate(): void;
27
- render(): JSX.Element;
28
- private _createPanelRefs;
29
- private _bindEvents;
30
- private _checkPlugins;
31
- private _hasSameChildren;
32
- private _getChildren;
33
- private _getViewportSlot;
34
- private _unpackFragment;
35
- private _getVirtualPanels;
36
- private _getPanels;
37
- private _isFragment;
38
- }
39
- interface Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>>, VanillaFlicking {
40
- }
41
- export default Flicking;
1
+ import * as React from "react";
2
+ import Component from "@egjs/component";
3
+ import ListDiffer from "@egjs/list-differ";
4
+ import VanillaFlicking, { FlickingOptions, FlickingEvents } from "@egjs/flicking";
5
+ import { FlickingProps } from "./types";
6
+ import StrictPanel from "./StrictPanel";
7
+ import NonStrictPanel from "./NonStrictPanel";
8
+ declare class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>> {
9
+ static defaultProps: FlickingProps;
10
+ protected _vanillaFlicking: VanillaFlicking;
11
+ private _panels;
12
+ protected _pluginsDiffer: ListDiffer<any>;
13
+ protected _jsxDiffer: ListDiffer<React.ReactElement>;
14
+ protected _viewportElement: HTMLElement;
15
+ private _diffResult;
16
+ private _renderEmitter;
17
+ protected _prevChildren: React.ReactElement[];
18
+ get reactPanels(): (StrictPanel | NonStrictPanel | HTMLDivElement)[];
19
+ get renderEmitter(): Component<{
20
+ render: void;
21
+ }>;
22
+ constructor(props: Partial<FlickingProps & FlickingOptions>);
23
+ componentDidMount(): void;
24
+ componentWillUnmount(): void;
25
+ shouldComponentUpdate(nextProps: Readonly<Partial<FlickingProps & FlickingOptions>>): boolean;
26
+ beforeRender(): void;
27
+ componentDidUpdate(): void;
28
+ render(): JSX.Element;
29
+ private _createPanelRefs;
30
+ protected _bindEvents(): void;
31
+ protected _bindEvent(eventName: keyof FlickingEvents): void;
32
+ protected _checkPlugins(): void;
33
+ protected _getClasses(attributes: {
34
+ [key: string]: any;
35
+ }, props: typeof this.props): {
36
+ viewportClasses: string[];
37
+ cameraClasses: string[];
38
+ cameraProps: {
39
+ style: {
40
+ transform: string;
41
+ };
42
+ } | {
43
+ style?: undefined;
44
+ };
45
+ };
46
+ private _hasSameChildren;
47
+ protected _getChildren(children?: React.ReactNode): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
48
+ protected _getViewportSlot(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
49
+ private _unpackFragment;
50
+ private _getVirtualPanels;
51
+ protected _getPanels(): JSX.Element[];
52
+ private _isFragment;
53
+ }
54
+ interface Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>>, VanillaFlicking {
55
+ }
56
+ export default Flicking;
@@ -1,12 +1,12 @@
1
- import * as React from "react";
2
- declare class NonStrictPanel extends React.Component<{
3
- children?: React.ReactElement;
4
- }> {
5
- private _hide;
6
- get nativeElement(): HTMLElement;
7
- get rendered(): boolean;
8
- render(): JSX.Element | undefined;
9
- show(): void;
10
- hide(): void;
11
- }
12
- export default NonStrictPanel;
1
+ import * as React from "react";
2
+ declare class NonStrictPanel extends React.Component<{
3
+ children?: React.ReactElement;
4
+ }> {
5
+ private _hide;
6
+ get nativeElement(): HTMLElement;
7
+ get rendered(): boolean;
8
+ render(): JSX.Element | undefined;
9
+ show(): void;
10
+ hide(): void;
11
+ }
12
+ export default NonStrictPanel;
@@ -1,12 +1,12 @@
1
- import { ElementProvider } from "@egjs/flicking";
2
- import StrictPanel from "./StrictPanel";
3
- import NonStrictPanel from "./NonStrictPanel";
4
- declare class ReactElementProvider implements ElementProvider {
5
- private _el;
6
- get element(): HTMLElement;
7
- get rendered(): boolean;
8
- constructor(el: StrictPanel | NonStrictPanel);
9
- show(): void;
10
- hide(): void;
11
- }
12
- export default ReactElementProvider;
1
+ import { ElementProvider } from "@egjs/flicking";
2
+ import StrictPanel from "./StrictPanel";
3
+ import NonStrictPanel from "./NonStrictPanel";
4
+ declare class ReactElementProvider implements ElementProvider {
5
+ private _el;
6
+ get element(): HTMLElement;
7
+ get rendered(): boolean;
8
+ constructor(el: StrictPanel | NonStrictPanel);
9
+ show(): void;
10
+ hide(): void;
11
+ }
12
+ export default ReactElementProvider;
@@ -1,17 +1,17 @@
1
- import { ExternalRenderer, PanelOptions, RendererOptions } from "@egjs/flicking";
2
- import ReactFlicking from "./Flicking";
3
- import StrictPanel from "./StrictPanel";
4
- import NonStrictPanel from "./NonStrictPanel";
5
- export interface ReactRendererOptions extends RendererOptions {
6
- reactFlicking: ReactFlicking;
7
- }
8
- declare class ReactRenderer extends ExternalRenderer {
9
- protected _reactFlicking: ReactFlicking;
10
- constructor(options: ReactRendererOptions);
11
- render(): Promise<void>;
12
- forceRenderAllPanels(): Promise<void>;
13
- destroy(): void;
14
- protected _collectPanels(): void;
15
- protected _createPanel(externalComponent: StrictPanel | NonStrictPanel | HTMLDivElement, options: PanelOptions): import("@egjs/flicking/declaration/core/panel/Panel").default;
16
- }
17
- export default ReactRenderer;
1
+ import { ExternalRenderer, PanelOptions, RendererOptions } from "@egjs/flicking";
2
+ import ReactFlicking from "./Flicking";
3
+ import StrictPanel from "./StrictPanel";
4
+ import NonStrictPanel from "./NonStrictPanel";
5
+ export interface ReactRendererOptions extends RendererOptions {
6
+ reactFlicking: ReactFlicking;
7
+ }
8
+ declare class ReactRenderer extends ExternalRenderer {
9
+ protected _reactFlicking: ReactFlicking;
10
+ constructor(options: ReactRendererOptions);
11
+ render(): Promise<void>;
12
+ forceRenderAllPanels(): Promise<void>;
13
+ destroy(): void;
14
+ protected _collectPanels(): void;
15
+ protected _createPanel(externalComponent: StrictPanel | NonStrictPanel | HTMLDivElement, options: PanelOptions): import("../../../../declaration/core/panel/Panel").default;
16
+ }
17
+ export default ReactRenderer;
@@ -1,14 +1,14 @@
1
- import * as React from "react";
2
- declare class StrictPanel extends React.Component<{
3
- children?: React.ReactElement;
4
- }> {
5
- private _hide;
6
- private _elRef;
7
- get nativeElement(): HTMLElement;
8
- get rendered(): boolean;
9
- render(): JSX.Element;
10
- show(): void;
11
- hide(): void;
12
- private _getElement;
13
- }
14
- export default StrictPanel;
1
+ import * as React from "react";
2
+ declare class StrictPanel extends React.Component<{
3
+ children?: React.ReactElement;
4
+ }> {
5
+ private _hide;
6
+ private _elRef;
7
+ get nativeElement(): HTMLElement;
8
+ get rendered(): boolean;
9
+ render(): JSX.Element;
10
+ show(): void;
11
+ hide(): void;
12
+ private _getElement;
13
+ }
14
+ export default StrictPanel;
@@ -1,5 +1,5 @@
1
- import React, { ReactNode } from "react";
2
- declare const ViewportSlot: React.MemoExoticComponent<(props: {
3
- children?: ReactNode;
4
- }) => JSX.Element>;
5
- export default ViewportSlot;
1
+ import React, { ReactNode } from "react";
2
+ declare const ViewportSlot: React.MemoExoticComponent<(props: {
3
+ children?: ReactNode;
4
+ }) => JSX.Element>;
5
+ export default ViewportSlot;
@@ -1,2 +1,2 @@
1
- import { FlickingProps } from "./types";
2
- export declare const DEFAULT_PROPS: FlickingProps;
1
+ import { FlickingProps } from "./types";
2
+ export declare const DEFAULT_PROPS: FlickingProps;
@@ -1,6 +1,8 @@
1
- import Flicking from "./Flicking";
2
- import ViewportSlot from "./ViewportSlot";
3
- export * from "@egjs/flicking";
4
- export * from "./types";
5
- export { ViewportSlot };
6
- export default Flicking;
1
+ import Flicking from "./Flicking";
2
+ import CrossFlicking from "./CrossFlicking";
3
+ import CrossGroup from "./CrossGroup";
4
+ import ViewportSlot from "./ViewportSlot";
5
+ export * from "@egjs/flicking";
6
+ export * from "./types";
7
+ export { CrossFlicking, CrossGroup, ViewportSlot, };
8
+ export default Flicking;
@@ -1,2 +1,2 @@
1
- import Flicking from "./Flicking";
2
- export default Flicking;
1
+ import Flicking from "./Flicking";
2
+ export default Flicking;
@@ -1,32 +1,32 @@
1
- /// <reference types="react" />
2
- import ReactFlicking from "./Flicking";
3
- import { SelectEvent, NeedPanelEvent, VisibleChangeEvent, HoldStartEvent, HoldEndEvent, MoveStartEvent, MoveEvent, MoveEndEvent, WillChangeEvent, ChangedEvent, WillRestoreEvent, RestoredEvent, ReadyEvent, BeforeResizeEvent, AfterResizeEvent, ReachEdgeEvent, PanelChangeEvent, Plugin, Status } from "@egjs/flicking";
4
- export interface FlickingProps {
5
- viewportTag: keyof JSX.IntrinsicElements;
6
- cameraTag: keyof JSX.IntrinsicElements;
7
- cameraClass: string;
8
- renderOnSameKey: boolean;
9
- plugins: Plugin[];
10
- status?: Status;
11
- useFindDOMNode: boolean;
12
- hideBeforeInit: boolean;
13
- firstPanelSize?: string;
14
- onReady: (e: ReadyEvent<ReactFlicking>) => any;
15
- onBeforeResize: (e: BeforeResizeEvent<ReactFlicking>) => any;
16
- onAfterResize: (e: AfterResizeEvent<ReactFlicking>) => any;
17
- onHoldStart: (e: HoldStartEvent<ReactFlicking>) => any;
18
- onHoldEnd: (e: HoldEndEvent<ReactFlicking>) => any;
19
- onMoveStart: (e: MoveStartEvent<ReactFlicking>) => any;
20
- onMove: (e: MoveEvent<ReactFlicking>) => any;
21
- onMoveEnd: (e: MoveEndEvent<ReactFlicking>) => any;
22
- onWillChange: (e: WillChangeEvent<ReactFlicking>) => any;
23
- onChanged: (e: ChangedEvent<ReactFlicking>) => any;
24
- onWillRestore: (e: WillRestoreEvent<ReactFlicking>) => any;
25
- onRestored: (e: RestoredEvent<ReactFlicking>) => any;
26
- onSelect: (e: SelectEvent<ReactFlicking>) => any;
27
- onNeedPanel: (e: NeedPanelEvent<ReactFlicking>) => any;
28
- onVisibleChange: (e: VisibleChangeEvent<ReactFlicking>) => any;
29
- onReachEdge: (e: ReachEdgeEvent<ReactFlicking>) => any;
30
- onPanelChange: (e: PanelChangeEvent<ReactFlicking>) => any;
31
- [key: string]: any;
32
- }
1
+ /// <reference types="react" />
2
+ import ReactFlicking from "./Flicking";
3
+ import { SelectEvent, NeedPanelEvent, VisibleChangeEvent, HoldStartEvent, HoldEndEvent, MoveStartEvent, MoveEvent, MoveEndEvent, WillChangeEvent, ChangedEvent, WillRestoreEvent, RestoredEvent, ReadyEvent, BeforeResizeEvent, AfterResizeEvent, ReachEdgeEvent, PanelChangeEvent, Plugin, Status } from "@egjs/flicking";
4
+ export interface FlickingProps {
5
+ viewportTag: keyof JSX.IntrinsicElements;
6
+ cameraTag: keyof JSX.IntrinsicElements;
7
+ cameraClass: string;
8
+ renderOnSameKey: boolean;
9
+ plugins: Plugin[];
10
+ status?: Status;
11
+ useFindDOMNode: boolean;
12
+ hideBeforeInit: boolean;
13
+ firstPanelSize?: string;
14
+ onReady: (e: ReadyEvent<ReactFlicking>) => any;
15
+ onBeforeResize: (e: BeforeResizeEvent<ReactFlicking>) => any;
16
+ onAfterResize: (e: AfterResizeEvent<ReactFlicking>) => any;
17
+ onHoldStart: (e: HoldStartEvent<ReactFlicking>) => any;
18
+ onHoldEnd: (e: HoldEndEvent<ReactFlicking>) => any;
19
+ onMoveStart: (e: MoveStartEvent<ReactFlicking>) => any;
20
+ onMove: (e: MoveEvent<ReactFlicking>) => any;
21
+ onMoveEnd: (e: MoveEndEvent<ReactFlicking>) => any;
22
+ onWillChange: (e: WillChangeEvent<ReactFlicking>) => any;
23
+ onChanged: (e: ChangedEvent<ReactFlicking>) => any;
24
+ onWillRestore: (e: WillRestoreEvent<ReactFlicking>) => any;
25
+ onRestored: (e: RestoredEvent<ReactFlicking>) => any;
26
+ onSelect: (e: SelectEvent<ReactFlicking>) => any;
27
+ onNeedPanel: (e: NeedPanelEvent<ReactFlicking>) => any;
28
+ onVisibleChange: (e: VisibleChangeEvent<ReactFlicking>) => any;
29
+ onReachEdge: (e: ReachEdgeEvent<ReactFlicking>) => any;
30
+ onPanelChange: (e: PanelChangeEvent<ReactFlicking>) => any;
31
+ [key: string]: any;
32
+ }
@@ -2,22 +2,29 @@
2
2
  position: relative;
3
3
  overflow: hidden;
4
4
  }
5
+
5
6
  .flicking-viewport:not(.vertical) {
6
7
  width: 100%;
7
8
  height: 100%;
8
9
  }
9
- .flicking-viewport.vertical, .flicking-viewport.vertical > .flicking-camera {
10
+
11
+ .flicking-viewport.vertical,
12
+ .flicking-viewport.vertical > .flicking-camera {
10
13
  display: inline-block;
11
14
  }
15
+
12
16
  .flicking-viewport.vertical.middle > .flicking-camera > * {
13
17
  vertical-align: middle;
14
18
  }
19
+
15
20
  .flicking-viewport.vertical.bottom > .flicking-camera > * {
16
21
  vertical-align: bottom;
17
22
  }
23
+
18
24
  .flicking-viewport.vertical > .flicking-camera > * {
19
25
  display: block;
20
26
  }
27
+
21
28
  .flicking-viewport.flicking-hidden > .flicking-camera > * {
22
29
  visibility: hidden;
23
30
  }
@@ -30,6 +37,7 @@
30
37
  white-space: nowrap;
31
38
  will-change: transform;
32
39
  }
40
+
33
41
  .flicking-camera > * {
34
42
  display: inline-block;
35
43
  white-space: normal;
@@ -4,7 +4,7 @@ name: @egjs/react-flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking/tree/master/packages/react-flicking
7
- version: 4.11.5-beta.4
7
+ version: 4.12.0-beta.10
8
8
  */
9
9
  'use strict';
10
10
 
@@ -202,6 +202,7 @@ var DEFAULT_PROPS = {
202
202
  viewportTag: "div",
203
203
  cameraTag: "div",
204
204
  cameraClass: "",
205
+ firstPanelSize: "",
205
206
  renderOnSameKey: false,
206
207
  plugins: [],
207
208
  useFindDOMNode: false,
@@ -369,9 +370,9 @@ var NonStrictPanel = /*#__PURE__*/function (_super) {
369
370
  return NonStrictPanel;
370
371
  }(React.Component);
371
372
 
372
- /*
373
- * Copyright (c) 2015 NAVER Corp.
374
- * egjs projects are licensed under the MIT license
373
+ /*
374
+ * Copyright (c) 2015 NAVER Corp.
375
+ * egjs projects are licensed under the MIT license
375
376
  */
376
377
  var ViewportSlot = React.memo(function (props) {
377
378
  return React.createElement(React.Fragment, null, props.children);
@@ -515,40 +516,22 @@ var Flicking = /*#__PURE__*/function (_super) {
515
516
  };
516
517
  __proto.render = function () {
517
518
  var _this = this;
518
- var _a, _b;
519
+ var _a;
519
520
  var props = this.props;
520
521
  var Viewport = props.viewportTag;
521
522
  var Camera = props.cameraTag;
522
523
  var attributes = {};
523
- var flicking = this._vanillaFlicking;
524
524
  this.beforeRender();
525
525
  for (var name in props) {
526
526
  if (!(name in DEFAULT_PROPS) && !(name in VanillaFlicking.prototype)) {
527
527
  attributes[name] = props[name];
528
528
  }
529
529
  }
530
- var initialized = flicking && flicking.initialized;
531
- var viewportClasses = ["flicking-viewport"];
532
- var cameraClasses = ["flicking-camera"];
533
- var isHorizontal = flicking ? flicking.horizontal : (_a = props.horizontal) !== null && _a !== void 0 ? _a : true;
534
- if (!isHorizontal) {
535
- viewportClasses.push("vertical");
536
- }
537
- if (props.hideBeforeInit && !initialized) {
538
- viewportClasses.push("flicking-hidden");
539
- }
540
- if (attributes.className) {
541
- viewportClasses.push(attributes.className);
542
- }
543
- if (props.cameraClass) {
544
- cameraClasses.push(props.cameraClass);
545
- }
546
- var cameraProps = !initialized && props.firstPanelSize ? {
547
- style: {
548
- transform: VanillaFlicking.getDefaultCameraTransform(this.props.align, this.props.horizontal, this.props.firstPanelSize)
549
- }
550
- } : {};
551
- var panels = !!props.virtual && ((_b = props.panelsPerView) !== null && _b !== void 0 ? _b : -1) > 0 ? this._getVirtualPanels() : this._getPanels();
530
+ var _b = this._getClasses(attributes, props),
531
+ viewportClasses = _b.viewportClasses,
532
+ cameraClasses = _b.cameraClasses,
533
+ cameraProps = _b.cameraProps;
534
+ var panels = !!props.virtual && ((_a = props.panelsPerView) !== null && _a !== void 0 ? _a : -1) > 0 ? this._getVirtualPanels() : this._getPanels();
552
535
  return React.createElement(Viewport, __assign({}, attributes, {
553
536
  className: viewportClasses.join(" "),
554
537
  ref: function (e) {
@@ -572,17 +555,21 @@ var Flicking = /*#__PURE__*/function (_super) {
572
555
  var flicking = this._vanillaFlicking;
573
556
  Object.keys(VanillaFlicking.EVENTS).forEach(function (eventKey) {
574
557
  var eventName = VanillaFlicking.EVENTS[eventKey];
575
- var propName = "on".concat(eventName.charAt(0).toUpperCase() + eventName.slice(1));
576
- flicking.on(eventName, function (e) {
577
- e.currentTarget = _this;
578
- var evtHandler = _this.props[propName];
579
- evtHandler(e);
580
- });
558
+ _this._bindEvent(eventName);
581
559
  });
582
560
  flicking.once(VanillaFlicking.EVENTS.READY, function () {
583
561
  _this.forceUpdate();
584
562
  });
585
563
  };
564
+ __proto._bindEvent = function (eventName) {
565
+ var _this = this;
566
+ var propName = "on".concat(eventName.charAt(0).toUpperCase() + eventName.slice(1));
567
+ this._vanillaFlicking.on(eventName, function (e) {
568
+ e.currentTarget = _this;
569
+ var evtHandler = _this.props[propName];
570
+ evtHandler(e);
571
+ });
572
+ };
586
573
  __proto._checkPlugins = function () {
587
574
  var flicking = this._vanillaFlicking;
588
575
  var _a = this._pluginsDiffer.update(this.props.plugins),
@@ -597,6 +584,36 @@ var Flicking = /*#__PURE__*/function (_super) {
597
584
  return prevList[index];
598
585
  }));
599
586
  };
587
+ __proto._getClasses = function (attributes, props) {
588
+ var _a;
589
+ var flicking = this._vanillaFlicking;
590
+ var initialized = flicking && flicking.initialized;
591
+ var viewportClasses = ["flicking-viewport"];
592
+ var cameraClasses = ["flicking-camera"];
593
+ var isHorizontal = flicking ? flicking.horizontal : (_a = props.horizontal) !== null && _a !== void 0 ? _a : true;
594
+ if (!isHorizontal) {
595
+ viewportClasses.push("vertical");
596
+ }
597
+ if (props.hideBeforeInit && !initialized) {
598
+ viewportClasses.push("flicking-hidden");
599
+ }
600
+ if (attributes.className) {
601
+ viewportClasses.push(attributes.className);
602
+ }
603
+ if (props.cameraClass) {
604
+ cameraClasses.push(props.cameraClass);
605
+ }
606
+ var cameraProps = !initialized && props.firstPanelSize ? {
607
+ style: {
608
+ transform: VanillaFlicking.getDefaultCameraTransform(this.props.align, this.props.horizontal, this.props.firstPanelSize)
609
+ }
610
+ } : {};
611
+ return {
612
+ viewportClasses: viewportClasses,
613
+ cameraClasses: cameraClasses,
614
+ cameraProps: cameraProps
615
+ };
616
+ };
600
617
  __proto._hasSameChildren = function (prevChildren, nextChildren) {
601
618
  if (prevChildren.length !== nextChildren.length || prevChildren.length === 0) return false;
602
619
  var same = prevChildren.every(function (child, idx) {
@@ -684,9 +701,9 @@ var Flicking = /*#__PURE__*/function (_super) {
684
701
  return Flicking;
685
702
  }(React.Component);
686
703
 
687
- /*
688
- * Copyright (c) 2015 NAVER Corp.
689
- * egjs projects are licensed under the MIT license
704
+ /*
705
+ * Copyright (c) 2015 NAVER Corp.
706
+ * egjs projects are licensed under the MIT license
690
707
  */
691
708
  Flicking.ViewportSlot = ViewportSlot;
692
709