@egjs/flicking 4.9.0 → 4.9.1
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/core/panel/Panel.d.ts +1 -1
- package/dist/flicking.esm.js +20 -9
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +20 -9
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +115 -123
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/Flicking.ts +4 -3
- package/src/core/panel/Panel.ts +8 -2
- package/src/renderer/Renderer.ts +2 -2
- package/TODO.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egjs/flicking",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.1",
|
|
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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "npm run test --prefix test/unit",
|
|
24
24
|
"test:chrome": "npm run test:chrome --prefix test/unit",
|
|
25
25
|
"test:cfc": "npm run test --prefix test/cfc",
|
|
26
|
-
"lint": "eslint
|
|
26
|
+
"lint": "eslint src/**/*.ts",
|
|
27
27
|
"lint:test": "eslint 'test/unit/**/*.ts'",
|
|
28
28
|
"jsdoc": "jsdoc -c jsdoc.json",
|
|
29
29
|
"jsdoc:watch": "npm-watch jsdoc",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"typescript-transform-paths": "^2.2.3"
|
|
137
137
|
},
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@egjs/axes": "^3.
|
|
139
|
+
"@egjs/axes": "^3.4.0",
|
|
140
140
|
"@egjs/component": "^3.0.1",
|
|
141
141
|
"@egjs/imready": "^1.1.3",
|
|
142
142
|
"@egjs/list-differ": "^1.0.0"
|
package/src/Flicking.ts
CHANGED
|
@@ -1502,11 +1502,12 @@ class Flicking extends Component<FlickingEvents> {
|
|
|
1502
1502
|
const renderer = this._renderer;
|
|
1503
1503
|
const control = this._control;
|
|
1504
1504
|
const camera = this._camera;
|
|
1505
|
-
const
|
|
1505
|
+
const defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
|
|
1506
1506
|
|
|
1507
|
-
if (!
|
|
1507
|
+
if (!defaultPanel) return;
|
|
1508
1508
|
|
|
1509
|
-
const nearestAnchor = camera.findNearestAnchor(
|
|
1509
|
+
const nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
|
|
1510
|
+
const initialPanel = (nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index) ? nearestAnchor.panel : defaultPanel;
|
|
1510
1511
|
control.setActive(initialPanel, null, false);
|
|
1511
1512
|
|
|
1512
1513
|
if (!nearestAnchor) {
|
package/src/core/panel/Panel.ts
CHANGED
|
@@ -308,7 +308,7 @@ class Panel {
|
|
|
308
308
|
*/
|
|
309
309
|
public resize(cached?: {
|
|
310
310
|
size: number;
|
|
311
|
-
height
|
|
311
|
+
height?: number;
|
|
312
312
|
margin: { prev: number; next: number };
|
|
313
313
|
}): this {
|
|
314
314
|
const el = this.element;
|
|
@@ -321,7 +321,13 @@ class Panel {
|
|
|
321
321
|
if (cached) {
|
|
322
322
|
this._size = cached.size;
|
|
323
323
|
this._margin = { ...cached.margin };
|
|
324
|
-
this._height = cached.height
|
|
324
|
+
this._height = cached.height ?? getElementSize({
|
|
325
|
+
el,
|
|
326
|
+
horizontal: false,
|
|
327
|
+
useFractionalSize,
|
|
328
|
+
useOffset: true,
|
|
329
|
+
style: getStyle(el)
|
|
330
|
+
});
|
|
325
331
|
} else {
|
|
326
332
|
const elStyle = getStyle(el);
|
|
327
333
|
|
package/src/renderer/Renderer.ts
CHANGED
|
@@ -496,8 +496,8 @@ abstract class Renderer {
|
|
|
496
496
|
: { height: panelSize };
|
|
497
497
|
const firstPanelSizeObj = {
|
|
498
498
|
size: panelSize,
|
|
499
|
-
|
|
500
|
-
|
|
499
|
+
margin: referencePanel.margin,
|
|
500
|
+
...(!flicking.horizontal && { height: referencePanel.height})
|
|
501
501
|
};
|
|
502
502
|
|
|
503
503
|
if (!flicking.noPanelStyleOverride) {
|
package/TODO.md
DELETED