@egjs/react-flicking 4.12.0-beta.8 → 4.12.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.
- package/declaration/CrossFlicking.d.ts +26 -11
- package/declaration/CrossGroup.d.ts +6 -5
- package/declaration/Flicking.d.ts +56 -42
- package/declaration/NonStrictPanel.d.ts +12 -12
- package/declaration/ReactElementProvider.d.ts +12 -12
- package/declaration/ReactRenderer.d.ts +17 -17
- package/declaration/StrictPanel.d.ts +14 -14
- package/declaration/ViewportSlot.d.ts +5 -5
- package/declaration/consts.d.ts +2 -2
- package/declaration/index.d.ts +8 -8
- package/declaration/index.umd.d.ts +2 -2
- package/declaration/types.d.ts +32 -34
- package/dist/flicking-inline.css +1 -9
- package/dist/flicking-inline.css.map +1 -0
- package/dist/flicking-inline.min.min.css +1 -0
- package/dist/flicking.cjs.js +54 -37
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.css +5 -9
- package/dist/flicking.css.map +1 -0
- package/dist/flicking.esm.js +113 -50
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.min.min.css +1 -0
- package/dist/flicking.umd.js +54 -37
- package/dist/flicking.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/react-flicking/CrossFlicking.tsx +104 -41
- package/src/react-flicking/CrossGroup.tsx +12 -2
- package/src/react-flicking/Flicking.tsx +51 -35
- package/src/react-flicking/consts.ts +1 -0
- package/src/react-flicking/types.ts +1 -3
- package/declaration/ReactCrossRenderer.d.ts +0 -11
- package/dist/flicking.js +0 -9221
- package/dist/flicking.js.map +0 -1
- package/dist/flicking.min.js +0 -10
- package/dist/flicking.min.js.map +0 -1
- package/dist/flicking.pkgd.js +0 -14483
- package/dist/flicking.pkgd.js.map +0 -1
- package/dist/flicking.pkgd.min.js +0 -10
- package/dist/flicking.pkgd.min.js.map +0 -1
- package/src/react-flicking/ReactCrossRenderer.ts +0 -70
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
onSideWillRestore: (e: CrossFlickingEvent<WillChangeEvent<Flicking>>) => any;
|
|
14
|
+
onSideRestored: (e: CrossFlickingEvent<ChangedEvent<Flicking>>) => any;
|
|
15
|
+
}
|
|
16
|
+
export declare const CROSSFLICKING_DEFAULT_PROPS: CrossFlickingProps;
|
|
17
|
+
declare class CrossFlicking extends Flicking {
|
|
18
|
+
static defaultProps: CrossFlickingProps;
|
|
19
|
+
constructor(props: Partial<FlickingProps & FlickingOptions & CrossFlickingOptions & CrossFlickingProps>);
|
|
20
|
+
componentDidMount(): void;
|
|
21
|
+
render(): JSX.Element;
|
|
22
|
+
protected _bindEvents(): void;
|
|
23
|
+
}
|
|
24
|
+
interface CrossFlicking extends Flicking {
|
|
25
|
+
}
|
|
26
|
+
export default CrossFlicking;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
}
|
|
5
|
-
|
|
1
|
+
import React, { ReactNode, HTMLAttributes } from "react";
|
|
2
|
+
interface CrossGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const CrossGroup: React.ForwardRefExoticComponent<CrossGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export default CrossGroup;
|
|
@@ -1,42 +1,56 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import Component from "@egjs/component";
|
|
3
|
-
import ListDiffer from "@egjs/list-differ";
|
|
4
|
-
import VanillaFlicking, { FlickingOptions } 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
|
|
32
|
-
|
|
33
|
-
protected
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
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("
|
|
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("@egjs/flicking/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;
|
package/declaration/consts.d.ts
CHANGED
|
@@ -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;
|
package/declaration/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
+
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;
|
package/declaration/types.d.ts
CHANGED
|
@@ -1,34 +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
|
-
}
|
|
33
|
-
export interface CrossFlickingProps extends FlickingProps {
|
|
34
|
-
}
|
|
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
|
+
}
|
package/dist/flicking-inline.css
CHANGED
|
@@ -2,29 +2,22 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
.flicking-viewport:not(.vertical) {
|
|
7
6
|
width: 100%;
|
|
8
7
|
height: 100%;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
.flicking-viewport.vertical,
|
|
12
|
-
.flicking-viewport.vertical > .flicking-camera {
|
|
9
|
+
.flicking-viewport.vertical, .flicking-viewport.vertical > .flicking-camera {
|
|
13
10
|
display: inline-block;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
.flicking-viewport.vertical.middle > .flicking-camera > * {
|
|
17
13
|
vertical-align: middle;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
.flicking-viewport.vertical.bottom > .flicking-camera > * {
|
|
21
16
|
vertical-align: bottom;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
.flicking-viewport.vertical > .flicking-camera > * {
|
|
25
19
|
display: block;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
.flicking-viewport.flicking-hidden > .flicking-camera > * {
|
|
29
22
|
visibility: hidden;
|
|
30
23
|
}
|
|
@@ -37,7 +30,6 @@
|
|
|
37
30
|
white-space: nowrap;
|
|
38
31
|
will-change: transform;
|
|
39
32
|
}
|
|
40
|
-
|
|
41
33
|
.flicking-camera > * {
|
|
42
34
|
display: inline-block;
|
|
43
35
|
white-space: normal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../sass/flicking-inline.sass"],"names":[],"mappings":"AAAA;EACE;EACA;;AACA;EACE;EACA;;AACF;EAEE;;AAEA;EACE;;AACF;EACE;;AACF;EACE;;AACJ;EACE;;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA","file":"flicking-inline.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.flicking-viewport{position:relative;overflow:hidden}.flicking-viewport:not(.vertical){width:100%;height:100%}.flicking-viewport.vertical,.flicking-viewport.vertical>.flicking-camera{display:inline-block}.flicking-viewport.vertical.middle>.flicking-camera>*{vertical-align:middle}.flicking-viewport.vertical.bottom>.flicking-camera>*{vertical-align:bottom}.flicking-viewport.vertical>.flicking-camera>*{display:block}.flicking-viewport.flicking-hidden>.flicking-camera>*{visibility:hidden}.flicking-camera{width:100%;height:100%;position:relative;z-index:1;white-space:nowrap;will-change:transform}.flicking-camera>*{display:inline-block;white-space:normal;vertical-align:top}
|
package/dist/flicking.cjs.js
CHANGED
|
@@ -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.12.0
|
|
7
|
+
version: 4.12.0
|
|
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
|
|
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
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
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
|
-
|
|
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
|
|