@egjs/flicking 4.12.0-beta.1 → 4.12.0-beta.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.
- package/declaration/CrossFlicking.d.ts +5 -0
- package/declaration/const/external.d.ts +2 -0
- package/dist/flicking.cjs.js +93 -37
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +93 -37
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +93 -37
- 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 +858 -795
- 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 +1 -1
- package/src/CrossFlicking.ts +86 -42
- package/src/const/external.ts +2 -0
package/dist/flicking.js
CHANGED
|
@@ -4,7 +4,7 @@ name: @egjs/flicking
|
|
|
4
4
|
license: MIT
|
|
5
5
|
author: NAVER Corp.
|
|
6
6
|
repository: https://github.com/naver/egjs-flicking
|
|
7
|
-
version: 4.12.0-beta.
|
|
7
|
+
version: 4.12.0-beta.2
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
|
|
@@ -387,6 +387,8 @@ version: 4.12.0-beta.1
|
|
|
387
387
|
STRICT: "strict"
|
|
388
388
|
};
|
|
389
389
|
var CLASS = {
|
|
390
|
+
VIEWPORT: "flicking-viewport",
|
|
391
|
+
CAMERA: "flicking-camera",
|
|
390
392
|
VERTICAL: "vertical",
|
|
391
393
|
HIDDEN: "flicking-hidden",
|
|
392
394
|
DEFAULT_VIRTUAL: "flicking-panel"
|
|
@@ -7967,7 +7969,7 @@ version: 4.12.0-beta.1
|
|
|
7967
7969
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7968
7970
|
* ```
|
|
7969
7971
|
*/
|
|
7970
|
-
Flicking.VERSION = "4.12.0-beta.
|
|
7972
|
+
Flicking.VERSION = "4.12.0-beta.2";
|
|
7971
7973
|
return Flicking;
|
|
7972
7974
|
}(Component);
|
|
7973
7975
|
|
|
@@ -7984,7 +7986,6 @@ version: 4.12.0-beta.1
|
|
|
7984
7986
|
var CrossFlicking = /*#__PURE__*/function (_super) {
|
|
7985
7987
|
__extends(CrossFlicking, _super);
|
|
7986
7988
|
// Options Setter
|
|
7987
|
-
// UI / LAYOUT
|
|
7988
7989
|
// public set align(val: FlickingOptions["align"]) {
|
|
7989
7990
|
// this._align = val;
|
|
7990
7991
|
// }
|
|
@@ -8056,19 +8057,55 @@ version: 4.12.0-beta.1
|
|
|
8056
8057
|
_this._syncToCategory(e.index, _this.index);
|
|
8057
8058
|
}
|
|
8058
8059
|
};
|
|
8060
|
+
var horizontalPanels = toArray(getElement(root).children[0].children);
|
|
8059
8061
|
// Internal states
|
|
8060
|
-
_this._verticalState =
|
|
8062
|
+
_this._verticalState = _this._createVerticalState(horizontalPanels);
|
|
8061
8063
|
_this._moveDirection = null;
|
|
8062
8064
|
_this._nextIndex = 0;
|
|
8063
8065
|
// Bind options
|
|
8064
8066
|
_this._verticalOptions = verticalOptions;
|
|
8065
|
-
return _this;
|
|
8066
8067
|
// Create core components
|
|
8067
|
-
|
|
8068
|
+
_this._verticalFlicking = _this._createVerticalFlicking(horizontalPanels);
|
|
8069
|
+
return _this;
|
|
8068
8070
|
}
|
|
8069
8071
|
var __proto = CrossFlicking.prototype;
|
|
8070
|
-
Object.defineProperty(__proto, "
|
|
8072
|
+
Object.defineProperty(__proto, "verticalFlicking", {
|
|
8071
8073
|
// Components
|
|
8074
|
+
/**
|
|
8075
|
+
* {@link Control} instance of the Flicking
|
|
8076
|
+
* @ko 현재 Flicking에 활성화된 {@link Control} 인스턴스
|
|
8077
|
+
* @type {Control}
|
|
8078
|
+
* @default SnapControl
|
|
8079
|
+
* @readonly
|
|
8080
|
+
* @see Control
|
|
8081
|
+
* @see SnapControl
|
|
8082
|
+
* @see FreeControl
|
|
8083
|
+
*/
|
|
8084
|
+
get: function () {
|
|
8085
|
+
return this._verticalFlicking;
|
|
8086
|
+
},
|
|
8087
|
+
enumerable: false,
|
|
8088
|
+
configurable: true
|
|
8089
|
+
});
|
|
8090
|
+
Object.defineProperty(__proto, "verticalState", {
|
|
8091
|
+
// Internal States
|
|
8092
|
+
/**
|
|
8093
|
+
* Whether Flicking's {@link Flicking#init init()} is called.
|
|
8094
|
+
* This is `true` when {@link Flicking#init init()} is called, and is `false` after calling {@link Flicking#destroy destroy()}.
|
|
8095
|
+
* @ko Flicking의 {@link Flicking#init init()}이 호출되었는지를 나타내는 멤버 변수.
|
|
8096
|
+
* 이 값은 {@link Flicking#init init()}이 호출되었으면 `true`로 변하고, {@link Flicking#destroy destroy()}호출 이후에 다시 `false`로 변경됩니다.
|
|
8097
|
+
* @type {boolean}
|
|
8098
|
+
* @default false
|
|
8099
|
+
* @readonly
|
|
8100
|
+
*/
|
|
8101
|
+
get: function () {
|
|
8102
|
+
return this._verticalState;
|
|
8103
|
+
},
|
|
8104
|
+
enumerable: false,
|
|
8105
|
+
configurable: true
|
|
8106
|
+
});
|
|
8107
|
+
Object.defineProperty(__proto, "verticalOptions", {
|
|
8108
|
+
// Options Getter
|
|
8072
8109
|
/**
|
|
8073
8110
|
* Change active panel index on mouse/touch hold while animating.
|
|
8074
8111
|
* `index` of the `willChange`/`willRestore` event will be used as new index.
|
|
@@ -8095,37 +8132,56 @@ version: 4.12.0-beta.1
|
|
|
8095
8132
|
__proto.init = function () {
|
|
8096
8133
|
var _this = this;
|
|
8097
8134
|
return _super.prototype.init.call(this).then(function () {
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8135
|
+
return _this._addComponentEvents();
|
|
8136
|
+
});
|
|
8137
|
+
};
|
|
8138
|
+
__proto._addComponentEvents = function () {
|
|
8139
|
+
var _this = this;
|
|
8140
|
+
this.on(EVENTS.HOLD_START, this._onHorizontalHoldStart);
|
|
8141
|
+
this.on(EVENTS.MOVE, this._onHorizontalMove);
|
|
8142
|
+
this.on(EVENTS.MOVE_END, this._onHorizontalMoveEnd);
|
|
8143
|
+
this._verticalFlicking.forEach(function (flicking) {
|
|
8144
|
+
flicking.on(EVENTS.HOLD_START, _this._onVerticalHoldStart);
|
|
8145
|
+
flicking.on(EVENTS.MOVE, _this._onVerticalMove);
|
|
8146
|
+
flicking.on(EVENTS.MOVE_END, _this._onVerticalMoveEnd);
|
|
8147
|
+
flicking.on(EVENTS.CHANGED, _this._onVerticalChanged);
|
|
8148
|
+
});
|
|
8149
|
+
};
|
|
8150
|
+
__proto._createVerticalState = function (panels) {
|
|
8151
|
+
// data-index로 분류하기 전에 임시로 모든 children에 대해 vertical flicking으로 해보자.
|
|
8152
|
+
// panels에 data-attributes가 붙어있을 때와 안 붙어있을 때를 다르게 처리
|
|
8153
|
+
// 붙어있다면 가상의 viewport들을 index 갯수만큼 만들어줘야 한다
|
|
8154
|
+
var verticalPanels = "";
|
|
8155
|
+
var verticalState = panels.reduce(function (state, panel) {
|
|
8156
|
+
var start = state.length ? +state[state.length - 1].end + 1 : 0;
|
|
8157
|
+
verticalPanels += panel.innerHTML;
|
|
8158
|
+
return __spread(state, [{
|
|
8159
|
+
start: start,
|
|
8160
|
+
end: start + panel.children.length - 1,
|
|
8161
|
+
element: panel
|
|
8162
|
+
}]);
|
|
8163
|
+
}, []);
|
|
8164
|
+
var verticalCamera = document.createElement("div");
|
|
8165
|
+
verticalCamera.classList.add(CLASS.CAMERA);
|
|
8166
|
+
verticalCamera.innerHTML = verticalPanels;
|
|
8167
|
+
panels.forEach(function (panel) {
|
|
8168
|
+
[CLASS.VIEWPORT, CLASS.VERTICAL].forEach(function (className) {
|
|
8169
|
+
if (!panel.classList.contains(className)) {
|
|
8170
|
+
panel.classList.add(className);
|
|
8171
|
+
}
|
|
8128
8172
|
});
|
|
8173
|
+
panel.innerHTML = verticalCamera.outerHTML;
|
|
8174
|
+
});
|
|
8175
|
+
return verticalState;
|
|
8176
|
+
};
|
|
8177
|
+
__proto._createVerticalFlicking = function (panels) {
|
|
8178
|
+
var _this = this;
|
|
8179
|
+
return panels.map(function (panel, i) {
|
|
8180
|
+
return new Flicking(panel, __assign(__assign({}, _this.verticalOptions), {
|
|
8181
|
+
horizontal: false,
|
|
8182
|
+
panelsPerView: 1,
|
|
8183
|
+
defaultIndex: _this._verticalState[i].start
|
|
8184
|
+
}));
|
|
8129
8185
|
});
|
|
8130
8186
|
};
|
|
8131
8187
|
__proto._syncToCategory = function (index, outerIndex) {
|