@egjs/react-flicking 4.2.4 → 4.4.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/Flicking.d.ts +12 -9
- package/declaration/NonStrictPanel.d.ts +10 -0
- package/declaration/ReactElementProvider.d.ts +12 -0
- package/declaration/ReactRenderer.d.ts +3 -3
- package/declaration/StrictPanel.d.ts +12 -0
- package/declaration/types.d.ts +2 -1
- package/dist/flicking.cjs.js +239 -166
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +236 -167
- package/dist/flicking.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/react-flicking/Flicking.tsx +92 -50
- package/src/react-flicking/NonStrictPanel.tsx +29 -0
- package/src/react-flicking/ReactElementProvider.ts +28 -0
- package/src/react-flicking/ReactRenderer.ts +22 -24
- package/src/react-flicking/StrictPanel.tsx +36 -0
- package/src/react-flicking/ViewportSlot.tsx +4 -0
- package/src/react-flicking/consts.ts +0 -1
- package/src/react-flicking/index.umd.ts +4 -0
- package/src/react-flicking/types.ts +3 -1
- package/declaration/NonStrictPanelComponent.d.ts +0 -8
- package/declaration/ReactPanel.d.ts +0 -9
- package/declaration/ReactPanelComponent.d.ts +0 -6
- package/declaration/StrictPanelComponent.d.ts +0 -10
- package/src/react-flicking/NonStrictPanelComponent.tsx +0 -18
- package/src/react-flicking/ReactPanel.ts +0 -20
- package/src/react-flicking/ReactPanelComponent.tsx +0 -6
- package/src/react-flicking/StrictPanelComponent.tsx +0 -24
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import ReactPanelComponent from "./ReactPanelComponent";
|
|
3
|
-
declare class StrictPanelComponent extends React.Component implements ReactPanelComponent {
|
|
4
|
-
hide: boolean;
|
|
5
|
-
private _elRef;
|
|
6
|
-
get element(): HTMLElement;
|
|
7
|
-
render(): JSX.Element;
|
|
8
|
-
private _getElement;
|
|
9
|
-
}
|
|
10
|
-
export default StrictPanelComponent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { findDOMNode } from "react-dom";
|
|
3
|
-
|
|
4
|
-
import ReactPanelComponent from "./ReactPanelComponent";
|
|
5
|
-
|
|
6
|
-
class NonStrictPanelComponent extends React.Component implements ReactPanelComponent {
|
|
7
|
-
public hide: boolean = false;
|
|
8
|
-
|
|
9
|
-
public get element() { return findDOMNode(this) as HTMLElement; }
|
|
10
|
-
|
|
11
|
-
public render() {
|
|
12
|
-
return this.hide
|
|
13
|
-
? <></>
|
|
14
|
-
: this.props.children;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default NonStrictPanelComponent;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ExternalPanel } from "@egjs/flicking";
|
|
2
|
-
|
|
3
|
-
import NonStrictPanelComponent from "./NonStrictPanelComponent";
|
|
4
|
-
|
|
5
|
-
class ReactPanel extends ExternalPanel<NonStrictPanelComponent> {
|
|
6
|
-
public get element() {
|
|
7
|
-
return this._externalComponent.element as HTMLElement;
|
|
8
|
-
}
|
|
9
|
-
public get rendered() { return !this._externalComponent.hide; }
|
|
10
|
-
|
|
11
|
-
public markForShow() {
|
|
12
|
-
this._externalComponent.hide = false;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public markForHide() {
|
|
16
|
-
this._externalComponent.hide = true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default ReactPanel;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import ReactPanelComponent from "./ReactPanelComponent";
|
|
3
|
-
|
|
4
|
-
class StrictPanelComponent extends React.Component implements ReactPanelComponent {
|
|
5
|
-
public hide: boolean = false;
|
|
6
|
-
|
|
7
|
-
private _elRef: React.RefObject<HTMLElement> = React.createRef();
|
|
8
|
-
|
|
9
|
-
public get element() { return this._elRef.current!; }
|
|
10
|
-
|
|
11
|
-
public render() {
|
|
12
|
-
return this.hide
|
|
13
|
-
? <></>
|
|
14
|
-
: this._getElement();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
private _getElement() {
|
|
18
|
-
return React.cloneElement(React.Children.only(this.props.children) as React.ReactElement, {
|
|
19
|
-
ref: this._elRef
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default StrictPanelComponent;
|