@egjs/react-flicking 4.15.0 → 4.16.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.
- package/.env +1 -0
- package/{declaration → dist}/CrossFlicking.d.ts +3 -5
- package/{declaration → dist}/CrossGroup.d.ts +1 -1
- package/{declaration → dist}/Flicking.d.ts +8 -8
- package/{declaration → dist}/NonStrictPanel.d.ts +1 -1
- package/{declaration → dist}/ReactRenderer.d.ts +1 -1
- package/{declaration → dist}/StrictPanel.d.ts +1 -1
- package/{declaration → dist}/ViewportSlot.d.ts +1 -1
- package/dist/flicking.cjs.js +1514 -579
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +1573 -651
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +1634 -0
- package/dist/flicking.js.map +1 -0
- package/{declaration → dist}/index.d.ts +3 -3
- package/{declaration → dist}/types.d.ts +1 -2
- package/package.json +18 -33
- package/src/react-flicking/CrossFlicking.tsx +28 -37
- package/src/react-flicking/CrossGroup.tsx +6 -8
- package/src/react-flicking/Flicking.tsx +81 -69
- package/src/react-flicking/NonStrictPanel.tsx +15 -7
- package/src/react-flicking/ReactElementProvider.ts +6 -4
- package/src/react-flicking/ReactRenderer.ts +1 -2
- package/src/react-flicking/StrictPanel.tsx +10 -6
- package/src/react-flicking/consts.ts +14 -14
- package/src/react-flicking/index.ts +4 -7
- package/src/react-flicking/index.umd.ts +1 -1
- package/src/react-flicking/reactive.ts +3 -3
- package/src/react-flicking/types.ts +17 -17
- package/dist/flicking.umd.js +0 -699
- package/dist/flicking.umd.js.map +0 -1
- package/tsconfig.json +0 -30
- /package/{declaration → dist}/ReactElementProvider.d.ts +0 -0
- /package/{declaration → dist}/consts.d.ts +0 -0
- /package/{declaration → dist}/index.umd.d.ts +0 -0
- /package/{declaration → dist}/reactive.d.ts +0 -0
package/dist/flicking.esm.js
CHANGED
|
@@ -1,204 +1,920 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
24
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
25
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
26
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
27
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
28
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
29
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
30
|
-
***************************************************************************** */
|
|
31
|
-
/* global Reflect, Promise */
|
|
32
|
-
|
|
33
|
-
var extendStatics = function (d, b) {
|
|
34
|
-
extendStatics = Object.setPrototypeOf || {
|
|
35
|
-
__proto__: []
|
|
36
|
-
} instanceof Array && function (d, b) {
|
|
37
|
-
d.__proto__ = b;
|
|
38
|
-
} || function (d, b) {
|
|
39
|
-
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
40
|
-
};
|
|
41
|
-
return extendStatics(d, b);
|
|
42
|
-
};
|
|
43
|
-
function __extends(d, b) {
|
|
44
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
45
|
-
extendStatics(d, b);
|
|
46
|
-
function __() {
|
|
47
|
-
this.constructor = d;
|
|
48
|
-
}
|
|
49
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
50
|
-
}
|
|
51
|
-
var __assign = function () {
|
|
52
|
-
__assign = Object.assign || function __assign(t) {
|
|
53
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
54
|
-
s = arguments[i];
|
|
55
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
56
|
-
}
|
|
57
|
-
return t;
|
|
58
|
-
};
|
|
59
|
-
return __assign.apply(this, arguments);
|
|
60
|
-
};
|
|
61
|
-
function __rest(s, e) {
|
|
62
|
-
var t = {};
|
|
63
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
64
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
65
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React__default, { useRef, useMemo, useState, useEffect } from "react";
|
|
3
|
+
import VanillaFlicking__default, { ExternalRenderer, getFlickingAttached, VirtualRenderingStrategy, NormalRenderingStrategy, sync, range, EVENTS, getDefaultCameraTransform, getRenderingPanels, withFlickingMethods, CrossFlicking as CrossFlicking$1, SIDE_EVENTS, flickingReactiveAPIAdapter } from "@egjs/flicking";
|
|
4
|
+
export * from "@egjs/flicking";
|
|
5
|
+
import ListDiffer, { diff } from "@egjs/list-differ";
|
|
6
|
+
import Component from "@egjs/component";
|
|
7
|
+
var jsxRuntime = { exports: {} };
|
|
8
|
+
var reactJsxRuntime_production_min = {};
|
|
9
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
10
|
+
function requireReactJsxRuntime_production_min() {
|
|
11
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
12
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
13
|
+
var f = React__default, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
14
|
+
function q(c, a, g) {
|
|
15
|
+
var b, d = {}, e = null, h = null;
|
|
16
|
+
void 0 !== g && (e = "" + g);
|
|
17
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
18
|
+
void 0 !== a.ref && (h = a.ref);
|
|
19
|
+
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
20
|
+
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
21
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
66
22
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
72
|
-
d;
|
|
73
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
74
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
reactJsxRuntime_production_min.Fragment = l;
|
|
24
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
25
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
26
|
+
return reactJsxRuntime_production_min;
|
|
75
27
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
28
|
+
var reactJsxRuntime_development = {};
|
|
29
|
+
var hasRequiredReactJsxRuntime_development;
|
|
30
|
+
function requireReactJsxRuntime_development() {
|
|
31
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
32
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
33
|
+
if (process.env.NODE_ENV !== "production") {
|
|
34
|
+
(function() {
|
|
35
|
+
var React2 = React__default;
|
|
36
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
37
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
38
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
39
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
40
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
41
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
42
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
43
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
44
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
45
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
46
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
47
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
48
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
49
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
50
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
51
|
+
function getIteratorFn(maybeIterable) {
|
|
52
|
+
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
56
|
+
if (typeof maybeIterator === "function") {
|
|
57
|
+
return maybeIterator;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
88
60
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
61
|
+
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
62
|
+
function error(format) {
|
|
63
|
+
{
|
|
64
|
+
{
|
|
65
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
66
|
+
args[_key2 - 1] = arguments[_key2];
|
|
67
|
+
}
|
|
68
|
+
printWarning("error", format, args);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
95
71
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
|
|
72
|
+
function printWarning(level, format, args) {
|
|
73
|
+
{
|
|
74
|
+
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
75
|
+
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
76
|
+
if (stack !== "") {
|
|
77
|
+
format += "%s";
|
|
78
|
+
args = args.concat([stack]);
|
|
79
|
+
}
|
|
80
|
+
var argsWithFormat = args.map(function(item) {
|
|
81
|
+
return String(item);
|
|
82
|
+
});
|
|
83
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
84
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
var enableScopeAPI = false;
|
|
88
|
+
var enableCacheElement = false;
|
|
89
|
+
var enableTransitionTracing = false;
|
|
90
|
+
var enableLegacyHidden = false;
|
|
91
|
+
var enableDebugTracing = false;
|
|
92
|
+
var REACT_MODULE_REFERENCE;
|
|
93
|
+
{
|
|
94
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
95
|
+
}
|
|
96
|
+
function isValidElementType(type) {
|
|
97
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
if (typeof type === "object" && type !== null) {
|
|
104
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
105
|
+
// types supported by any Flight configuration anywhere since
|
|
106
|
+
// we don't know which Flight build this will end up being used
|
|
107
|
+
// with.
|
|
108
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
115
|
+
var displayName = outerType.displayName;
|
|
116
|
+
if (displayName) {
|
|
117
|
+
return displayName;
|
|
118
|
+
}
|
|
119
|
+
var functionName = innerType.displayName || innerType.name || "";
|
|
120
|
+
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
121
|
+
}
|
|
122
|
+
function getContextName(type) {
|
|
123
|
+
return type.displayName || "Context";
|
|
124
|
+
}
|
|
125
|
+
function getComponentNameFromType(type) {
|
|
126
|
+
if (type == null) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
{
|
|
130
|
+
if (typeof type.tag === "number") {
|
|
131
|
+
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (typeof type === "function") {
|
|
135
|
+
return type.displayName || type.name || null;
|
|
136
|
+
}
|
|
137
|
+
if (typeof type === "string") {
|
|
138
|
+
return type;
|
|
139
|
+
}
|
|
140
|
+
switch (type) {
|
|
141
|
+
case REACT_FRAGMENT_TYPE:
|
|
142
|
+
return "Fragment";
|
|
143
|
+
case REACT_PORTAL_TYPE:
|
|
144
|
+
return "Portal";
|
|
145
|
+
case REACT_PROFILER_TYPE:
|
|
146
|
+
return "Profiler";
|
|
147
|
+
case REACT_STRICT_MODE_TYPE:
|
|
148
|
+
return "StrictMode";
|
|
149
|
+
case REACT_SUSPENSE_TYPE:
|
|
150
|
+
return "Suspense";
|
|
151
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
152
|
+
return "SuspenseList";
|
|
153
|
+
}
|
|
154
|
+
if (typeof type === "object") {
|
|
155
|
+
switch (type.$$typeof) {
|
|
156
|
+
case REACT_CONTEXT_TYPE:
|
|
157
|
+
var context = type;
|
|
158
|
+
return getContextName(context) + ".Consumer";
|
|
159
|
+
case REACT_PROVIDER_TYPE:
|
|
160
|
+
var provider = type;
|
|
161
|
+
return getContextName(provider._context) + ".Provider";
|
|
162
|
+
case REACT_FORWARD_REF_TYPE:
|
|
163
|
+
return getWrappedName(type, type.render, "ForwardRef");
|
|
164
|
+
case REACT_MEMO_TYPE:
|
|
165
|
+
var outerName = type.displayName || null;
|
|
166
|
+
if (outerName !== null) {
|
|
167
|
+
return outerName;
|
|
168
|
+
}
|
|
169
|
+
return getComponentNameFromType(type.type) || "Memo";
|
|
170
|
+
case REACT_LAZY_TYPE: {
|
|
171
|
+
var lazyComponent = type;
|
|
172
|
+
var payload = lazyComponent._payload;
|
|
173
|
+
var init = lazyComponent._init;
|
|
174
|
+
try {
|
|
175
|
+
return getComponentNameFromType(init(payload));
|
|
176
|
+
} catch (x) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
var assign = Object.assign;
|
|
185
|
+
var disabledDepth = 0;
|
|
186
|
+
var prevLog;
|
|
187
|
+
var prevInfo;
|
|
188
|
+
var prevWarn;
|
|
189
|
+
var prevError;
|
|
190
|
+
var prevGroup;
|
|
191
|
+
var prevGroupCollapsed;
|
|
192
|
+
var prevGroupEnd;
|
|
193
|
+
function disabledLog() {
|
|
194
|
+
}
|
|
195
|
+
disabledLog.__reactDisabledLog = true;
|
|
196
|
+
function disableLogs() {
|
|
197
|
+
{
|
|
198
|
+
if (disabledDepth === 0) {
|
|
199
|
+
prevLog = console.log;
|
|
200
|
+
prevInfo = console.info;
|
|
201
|
+
prevWarn = console.warn;
|
|
202
|
+
prevError = console.error;
|
|
203
|
+
prevGroup = console.group;
|
|
204
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
205
|
+
prevGroupEnd = console.groupEnd;
|
|
206
|
+
var props = {
|
|
207
|
+
configurable: true,
|
|
208
|
+
enumerable: true,
|
|
209
|
+
value: disabledLog,
|
|
210
|
+
writable: true
|
|
211
|
+
};
|
|
212
|
+
Object.defineProperties(console, {
|
|
213
|
+
info: props,
|
|
214
|
+
log: props,
|
|
215
|
+
warn: props,
|
|
216
|
+
error: props,
|
|
217
|
+
group: props,
|
|
218
|
+
groupCollapsed: props,
|
|
219
|
+
groupEnd: props
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
disabledDepth++;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function reenableLogs() {
|
|
226
|
+
{
|
|
227
|
+
disabledDepth--;
|
|
228
|
+
if (disabledDepth === 0) {
|
|
229
|
+
var props = {
|
|
230
|
+
configurable: true,
|
|
231
|
+
enumerable: true,
|
|
232
|
+
writable: true
|
|
233
|
+
};
|
|
234
|
+
Object.defineProperties(console, {
|
|
235
|
+
log: assign({}, props, {
|
|
236
|
+
value: prevLog
|
|
237
|
+
}),
|
|
238
|
+
info: assign({}, props, {
|
|
239
|
+
value: prevInfo
|
|
240
|
+
}),
|
|
241
|
+
warn: assign({}, props, {
|
|
242
|
+
value: prevWarn
|
|
243
|
+
}),
|
|
244
|
+
error: assign({}, props, {
|
|
245
|
+
value: prevError
|
|
246
|
+
}),
|
|
247
|
+
group: assign({}, props, {
|
|
248
|
+
value: prevGroup
|
|
249
|
+
}),
|
|
250
|
+
groupCollapsed: assign({}, props, {
|
|
251
|
+
value: prevGroupCollapsed
|
|
252
|
+
}),
|
|
253
|
+
groupEnd: assign({}, props, {
|
|
254
|
+
value: prevGroupEnd
|
|
255
|
+
})
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (disabledDepth < 0) {
|
|
259
|
+
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
264
|
+
var prefix;
|
|
265
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
266
|
+
{
|
|
267
|
+
if (prefix === void 0) {
|
|
268
|
+
try {
|
|
269
|
+
throw Error();
|
|
270
|
+
} catch (x) {
|
|
271
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
272
|
+
prefix = match && match[1] || "";
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return "\n" + prefix + name;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
var reentry = false;
|
|
279
|
+
var componentFrameCache;
|
|
280
|
+
{
|
|
281
|
+
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
282
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
283
|
+
}
|
|
284
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
285
|
+
if (!fn || reentry) {
|
|
286
|
+
return "";
|
|
287
|
+
}
|
|
288
|
+
{
|
|
289
|
+
var frame = componentFrameCache.get(fn);
|
|
290
|
+
if (frame !== void 0) {
|
|
291
|
+
return frame;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
var control;
|
|
295
|
+
reentry = true;
|
|
296
|
+
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
297
|
+
Error.prepareStackTrace = void 0;
|
|
298
|
+
var previousDispatcher;
|
|
299
|
+
{
|
|
300
|
+
previousDispatcher = ReactCurrentDispatcher.current;
|
|
301
|
+
ReactCurrentDispatcher.current = null;
|
|
302
|
+
disableLogs();
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
if (construct) {
|
|
306
|
+
var Fake = function() {
|
|
307
|
+
throw Error();
|
|
308
|
+
};
|
|
309
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
310
|
+
set: function() {
|
|
311
|
+
throw Error();
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
if (typeof Reflect === "object" && Reflect.construct) {
|
|
315
|
+
try {
|
|
316
|
+
Reflect.construct(Fake, []);
|
|
317
|
+
} catch (x) {
|
|
318
|
+
control = x;
|
|
319
|
+
}
|
|
320
|
+
Reflect.construct(fn, [], Fake);
|
|
321
|
+
} else {
|
|
322
|
+
try {
|
|
323
|
+
Fake.call();
|
|
324
|
+
} catch (x) {
|
|
325
|
+
control = x;
|
|
326
|
+
}
|
|
327
|
+
fn.call(Fake.prototype);
|
|
328
|
+
}
|
|
329
|
+
} else {
|
|
330
|
+
try {
|
|
331
|
+
throw Error();
|
|
332
|
+
} catch (x) {
|
|
333
|
+
control = x;
|
|
334
|
+
}
|
|
335
|
+
fn();
|
|
336
|
+
}
|
|
337
|
+
} catch (sample) {
|
|
338
|
+
if (sample && control && typeof sample.stack === "string") {
|
|
339
|
+
var sampleLines = sample.stack.split("\n");
|
|
340
|
+
var controlLines = control.stack.split("\n");
|
|
341
|
+
var s = sampleLines.length - 1;
|
|
342
|
+
var c = controlLines.length - 1;
|
|
343
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
344
|
+
c--;
|
|
345
|
+
}
|
|
346
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
347
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
348
|
+
if (s !== 1 || c !== 1) {
|
|
349
|
+
do {
|
|
350
|
+
s--;
|
|
351
|
+
c--;
|
|
352
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
353
|
+
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
354
|
+
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
355
|
+
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
356
|
+
}
|
|
357
|
+
{
|
|
358
|
+
if (typeof fn === "function") {
|
|
359
|
+
componentFrameCache.set(fn, _frame);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return _frame;
|
|
363
|
+
}
|
|
364
|
+
} while (s >= 1 && c >= 0);
|
|
365
|
+
}
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
} finally {
|
|
371
|
+
reentry = false;
|
|
372
|
+
{
|
|
373
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
374
|
+
reenableLogs();
|
|
375
|
+
}
|
|
376
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
377
|
+
}
|
|
378
|
+
var name = fn ? fn.displayName || fn.name : "";
|
|
379
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
380
|
+
{
|
|
381
|
+
if (typeof fn === "function") {
|
|
382
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return syntheticFrame;
|
|
386
|
+
}
|
|
387
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
388
|
+
{
|
|
389
|
+
return describeNativeComponentFrame(fn, false);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function shouldConstruct(Component2) {
|
|
393
|
+
var prototype = Component2.prototype;
|
|
394
|
+
return !!(prototype && prototype.isReactComponent);
|
|
395
|
+
}
|
|
396
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
397
|
+
if (type == null) {
|
|
398
|
+
return "";
|
|
399
|
+
}
|
|
400
|
+
if (typeof type === "function") {
|
|
401
|
+
{
|
|
402
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (typeof type === "string") {
|
|
406
|
+
return describeBuiltInComponentFrame(type);
|
|
407
|
+
}
|
|
408
|
+
switch (type) {
|
|
409
|
+
case REACT_SUSPENSE_TYPE:
|
|
410
|
+
return describeBuiltInComponentFrame("Suspense");
|
|
411
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
412
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
|
413
|
+
}
|
|
414
|
+
if (typeof type === "object") {
|
|
415
|
+
switch (type.$$typeof) {
|
|
416
|
+
case REACT_FORWARD_REF_TYPE:
|
|
417
|
+
return describeFunctionComponentFrame(type.render);
|
|
418
|
+
case REACT_MEMO_TYPE:
|
|
419
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
420
|
+
case REACT_LAZY_TYPE: {
|
|
421
|
+
var lazyComponent = type;
|
|
422
|
+
var payload = lazyComponent._payload;
|
|
423
|
+
var init = lazyComponent._init;
|
|
424
|
+
try {
|
|
425
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
426
|
+
} catch (x) {
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return "";
|
|
432
|
+
}
|
|
433
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
434
|
+
var loggedTypeFailures = {};
|
|
435
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
436
|
+
function setCurrentlyValidatingElement(element) {
|
|
437
|
+
{
|
|
438
|
+
if (element) {
|
|
439
|
+
var owner = element._owner;
|
|
440
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
441
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
442
|
+
} else {
|
|
443
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
448
|
+
{
|
|
449
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
450
|
+
for (var typeSpecName in typeSpecs) {
|
|
451
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
452
|
+
var error$1 = void 0;
|
|
453
|
+
try {
|
|
454
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
455
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
456
|
+
err.name = "Invariant Violation";
|
|
457
|
+
throw err;
|
|
458
|
+
}
|
|
459
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
460
|
+
} catch (ex) {
|
|
461
|
+
error$1 = ex;
|
|
462
|
+
}
|
|
463
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
464
|
+
setCurrentlyValidatingElement(element);
|
|
465
|
+
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
466
|
+
setCurrentlyValidatingElement(null);
|
|
467
|
+
}
|
|
468
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
469
|
+
loggedTypeFailures[error$1.message] = true;
|
|
470
|
+
setCurrentlyValidatingElement(element);
|
|
471
|
+
error("Failed %s type: %s", location, error$1.message);
|
|
472
|
+
setCurrentlyValidatingElement(null);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
var isArrayImpl = Array.isArray;
|
|
479
|
+
function isArray(a) {
|
|
480
|
+
return isArrayImpl(a);
|
|
481
|
+
}
|
|
482
|
+
function typeName(value) {
|
|
483
|
+
{
|
|
484
|
+
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
485
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
486
|
+
return type;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
function willCoercionThrow(value) {
|
|
490
|
+
{
|
|
491
|
+
try {
|
|
492
|
+
testStringCoercion(value);
|
|
493
|
+
return false;
|
|
494
|
+
} catch (e) {
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function testStringCoercion(value) {
|
|
500
|
+
return "" + value;
|
|
501
|
+
}
|
|
502
|
+
function checkKeyStringCoercion(value) {
|
|
503
|
+
{
|
|
504
|
+
if (willCoercionThrow(value)) {
|
|
505
|
+
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
506
|
+
return testStringCoercion(value);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
511
|
+
var RESERVED_PROPS = {
|
|
512
|
+
key: true,
|
|
513
|
+
ref: true,
|
|
514
|
+
__self: true,
|
|
515
|
+
__source: true
|
|
516
|
+
};
|
|
517
|
+
var specialPropKeyWarningShown;
|
|
518
|
+
var specialPropRefWarningShown;
|
|
519
|
+
function hasValidRef(config) {
|
|
520
|
+
{
|
|
521
|
+
if (hasOwnProperty.call(config, "ref")) {
|
|
522
|
+
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
523
|
+
if (getter && getter.isReactWarning) {
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return config.ref !== void 0;
|
|
529
|
+
}
|
|
530
|
+
function hasValidKey(config) {
|
|
531
|
+
{
|
|
532
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
533
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
534
|
+
if (getter && getter.isReactWarning) {
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return config.key !== void 0;
|
|
540
|
+
}
|
|
541
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
542
|
+
{
|
|
543
|
+
if (typeof config.ref === "string" && ReactCurrentOwner.current && self) ;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
547
|
+
{
|
|
548
|
+
var warnAboutAccessingKey = function() {
|
|
549
|
+
if (!specialPropKeyWarningShown) {
|
|
550
|
+
specialPropKeyWarningShown = true;
|
|
551
|
+
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
552
|
+
}
|
|
144
553
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
554
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
555
|
+
Object.defineProperty(props, "key", {
|
|
556
|
+
get: warnAboutAccessingKey,
|
|
557
|
+
configurable: true
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
562
|
+
{
|
|
563
|
+
var warnAboutAccessingRef = function() {
|
|
564
|
+
if (!specialPropRefWarningShown) {
|
|
565
|
+
specialPropRefWarningShown = true;
|
|
566
|
+
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
570
|
+
Object.defineProperty(props, "ref", {
|
|
571
|
+
get: warnAboutAccessingRef,
|
|
572
|
+
configurable: true
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
577
|
+
var element = {
|
|
578
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
579
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
580
|
+
// Built-in properties that belong on the element
|
|
581
|
+
type,
|
|
582
|
+
key,
|
|
583
|
+
ref,
|
|
584
|
+
props,
|
|
585
|
+
// Record the component responsible for creating this element.
|
|
586
|
+
_owner: owner
|
|
587
|
+
};
|
|
588
|
+
{
|
|
589
|
+
element._store = {};
|
|
590
|
+
Object.defineProperty(element._store, "validated", {
|
|
591
|
+
configurable: false,
|
|
592
|
+
enumerable: false,
|
|
593
|
+
writable: true,
|
|
594
|
+
value: false
|
|
595
|
+
});
|
|
596
|
+
Object.defineProperty(element, "_self", {
|
|
597
|
+
configurable: false,
|
|
598
|
+
enumerable: false,
|
|
599
|
+
writable: false,
|
|
600
|
+
value: self
|
|
601
|
+
});
|
|
602
|
+
Object.defineProperty(element, "_source", {
|
|
603
|
+
configurable: false,
|
|
604
|
+
enumerable: false,
|
|
605
|
+
writable: false,
|
|
606
|
+
value: source
|
|
607
|
+
});
|
|
608
|
+
if (Object.freeze) {
|
|
609
|
+
Object.freeze(element.props);
|
|
610
|
+
Object.freeze(element);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return element;
|
|
614
|
+
};
|
|
615
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
616
|
+
{
|
|
617
|
+
var propName;
|
|
618
|
+
var props = {};
|
|
619
|
+
var key = null;
|
|
620
|
+
var ref = null;
|
|
621
|
+
if (maybeKey !== void 0) {
|
|
622
|
+
{
|
|
623
|
+
checkKeyStringCoercion(maybeKey);
|
|
624
|
+
}
|
|
625
|
+
key = "" + maybeKey;
|
|
626
|
+
}
|
|
627
|
+
if (hasValidKey(config)) {
|
|
628
|
+
{
|
|
629
|
+
checkKeyStringCoercion(config.key);
|
|
630
|
+
}
|
|
631
|
+
key = "" + config.key;
|
|
632
|
+
}
|
|
633
|
+
if (hasValidRef(config)) {
|
|
634
|
+
ref = config.ref;
|
|
635
|
+
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
636
|
+
}
|
|
637
|
+
for (propName in config) {
|
|
638
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
639
|
+
props[propName] = config[propName];
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
if (type && type.defaultProps) {
|
|
643
|
+
var defaultProps = type.defaultProps;
|
|
644
|
+
for (propName in defaultProps) {
|
|
645
|
+
if (props[propName] === void 0) {
|
|
646
|
+
props[propName] = defaultProps[propName];
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
if (key || ref) {
|
|
651
|
+
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
652
|
+
if (key) {
|
|
653
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
654
|
+
}
|
|
655
|
+
if (ref) {
|
|
656
|
+
defineRefPropWarningGetter(props, displayName);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
663
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
664
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
665
|
+
{
|
|
666
|
+
if (element) {
|
|
667
|
+
var owner = element._owner;
|
|
668
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
669
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
670
|
+
} else {
|
|
671
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
var propTypesMisspellWarningShown;
|
|
676
|
+
{
|
|
677
|
+
propTypesMisspellWarningShown = false;
|
|
678
|
+
}
|
|
679
|
+
function isValidElement(object) {
|
|
680
|
+
{
|
|
681
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
function getDeclarationErrorAddendum() {
|
|
685
|
+
{
|
|
686
|
+
if (ReactCurrentOwner$1.current) {
|
|
687
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
688
|
+
if (name) {
|
|
689
|
+
return "\n\nCheck the render method of `" + name + "`.";
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return "";
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
function getSourceInfoErrorAddendum(source) {
|
|
696
|
+
{
|
|
697
|
+
return "";
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
var ownerHasKeyUseWarning = {};
|
|
701
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
702
|
+
{
|
|
703
|
+
var info = getDeclarationErrorAddendum();
|
|
704
|
+
if (!info) {
|
|
705
|
+
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
706
|
+
if (parentName) {
|
|
707
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
return info;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
function validateExplicitKey(element, parentType) {
|
|
714
|
+
{
|
|
715
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
element._store.validated = true;
|
|
719
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
720
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
724
|
+
var childOwner = "";
|
|
725
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
726
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
727
|
+
}
|
|
728
|
+
setCurrentlyValidatingElement$1(element);
|
|
729
|
+
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
730
|
+
setCurrentlyValidatingElement$1(null);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
function validateChildKeys(node, parentType) {
|
|
734
|
+
{
|
|
735
|
+
if (typeof node !== "object") {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
if (isArray(node)) {
|
|
739
|
+
for (var i = 0; i < node.length; i++) {
|
|
740
|
+
var child = node[i];
|
|
741
|
+
if (isValidElement(child)) {
|
|
742
|
+
validateExplicitKey(child, parentType);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
} else if (isValidElement(node)) {
|
|
746
|
+
if (node._store) {
|
|
747
|
+
node._store.validated = true;
|
|
748
|
+
}
|
|
749
|
+
} else if (node) {
|
|
750
|
+
var iteratorFn = getIteratorFn(node);
|
|
751
|
+
if (typeof iteratorFn === "function") {
|
|
752
|
+
if (iteratorFn !== node.entries) {
|
|
753
|
+
var iterator = iteratorFn.call(node);
|
|
754
|
+
var step;
|
|
755
|
+
while (!(step = iterator.next()).done) {
|
|
756
|
+
if (isValidElement(step.value)) {
|
|
757
|
+
validateExplicitKey(step.value, parentType);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
function validatePropTypes(element) {
|
|
766
|
+
{
|
|
767
|
+
var type = element.type;
|
|
768
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
var propTypes;
|
|
772
|
+
if (typeof type === "function") {
|
|
773
|
+
propTypes = type.propTypes;
|
|
774
|
+
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
775
|
+
// Inner props are checked in the reconciler.
|
|
776
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
777
|
+
propTypes = type.propTypes;
|
|
778
|
+
} else {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
if (propTypes) {
|
|
782
|
+
var name = getComponentNameFromType(type);
|
|
783
|
+
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
784
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
785
|
+
propTypesMisspellWarningShown = true;
|
|
786
|
+
var _name = getComponentNameFromType(type);
|
|
787
|
+
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
788
|
+
}
|
|
789
|
+
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
790
|
+
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
function validateFragmentProps(fragment) {
|
|
795
|
+
{
|
|
796
|
+
var keys2 = Object.keys(fragment.props);
|
|
797
|
+
for (var i = 0; i < keys2.length; i++) {
|
|
798
|
+
var key = keys2[i];
|
|
799
|
+
if (key !== "children" && key !== "key") {
|
|
800
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
801
|
+
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
802
|
+
setCurrentlyValidatingElement$1(null);
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
if (fragment.ref !== null) {
|
|
807
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
808
|
+
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
809
|
+
setCurrentlyValidatingElement$1(null);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
var didWarnAboutKeySpread = {};
|
|
814
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
815
|
+
{
|
|
816
|
+
var validType = isValidElementType(type);
|
|
817
|
+
if (!validType) {
|
|
818
|
+
var info = "";
|
|
819
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
820
|
+
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
821
|
+
}
|
|
822
|
+
var sourceInfo = getSourceInfoErrorAddendum();
|
|
823
|
+
if (sourceInfo) {
|
|
824
|
+
info += sourceInfo;
|
|
825
|
+
} else {
|
|
826
|
+
info += getDeclarationErrorAddendum();
|
|
827
|
+
}
|
|
828
|
+
var typeString;
|
|
829
|
+
if (type === null) {
|
|
830
|
+
typeString = "null";
|
|
831
|
+
} else if (isArray(type)) {
|
|
832
|
+
typeString = "array";
|
|
833
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
834
|
+
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
835
|
+
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
836
|
+
} else {
|
|
837
|
+
typeString = typeof type;
|
|
838
|
+
}
|
|
839
|
+
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
840
|
+
}
|
|
841
|
+
var element = jsxDEV(type, props, key, source, self);
|
|
842
|
+
if (element == null) {
|
|
843
|
+
return element;
|
|
844
|
+
}
|
|
845
|
+
if (validType) {
|
|
846
|
+
var children = props.children;
|
|
847
|
+
if (children !== void 0) {
|
|
848
|
+
if (isStaticChildren) {
|
|
849
|
+
if (isArray(children)) {
|
|
850
|
+
for (var i = 0; i < children.length; i++) {
|
|
851
|
+
validateChildKeys(children[i], type);
|
|
852
|
+
}
|
|
853
|
+
if (Object.freeze) {
|
|
854
|
+
Object.freeze(children);
|
|
855
|
+
}
|
|
856
|
+
} else {
|
|
857
|
+
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
858
|
+
}
|
|
859
|
+
} else {
|
|
860
|
+
validateChildKeys(children, type);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
{
|
|
865
|
+
if (hasOwnProperty.call(props, "key")) {
|
|
866
|
+
var componentName = getComponentNameFromType(type);
|
|
867
|
+
var keys2 = Object.keys(props).filter(function(k) {
|
|
868
|
+
return k !== "key";
|
|
869
|
+
});
|
|
870
|
+
var beforeExample = keys2.length > 0 ? "{key: someKey, " + keys2.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
871
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
872
|
+
var afterExample = keys2.length > 0 ? "{" + keys2.join(": ..., ") + ": ...}" : "{}";
|
|
873
|
+
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
874
|
+
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
879
|
+
validateFragmentProps(element);
|
|
880
|
+
} else {
|
|
881
|
+
validatePropTypes(element);
|
|
882
|
+
}
|
|
883
|
+
return element;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
887
|
+
{
|
|
888
|
+
return jsxWithValidation(type, props, key, true);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
892
|
+
{
|
|
893
|
+
return jsxWithValidation(type, props, key, false);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
var jsx = jsxWithValidationDynamic;
|
|
897
|
+
var jsxs = jsxWithValidationStatic;
|
|
898
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
899
|
+
reactJsxRuntime_development.jsx = jsx;
|
|
900
|
+
reactJsxRuntime_development.jsxs = jsxs;
|
|
901
|
+
})();
|
|
189
902
|
}
|
|
903
|
+
return reactJsxRuntime_development;
|
|
190
904
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
905
|
+
var hasRequiredJsxRuntime;
|
|
906
|
+
function requireJsxRuntime() {
|
|
907
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
908
|
+
hasRequiredJsxRuntime = 1;
|
|
909
|
+
if (process.env.NODE_ENV === "production") {
|
|
910
|
+
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
911
|
+
} else {
|
|
912
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
197
913
|
}
|
|
198
|
-
return
|
|
914
|
+
return jsxRuntime.exports;
|
|
199
915
|
}
|
|
200
|
-
|
|
201
|
-
|
|
916
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
917
|
+
const DEFAULT_PROPS = {
|
|
202
918
|
viewportTag: "div",
|
|
203
919
|
cameraTag: "div",
|
|
204
920
|
cameraClass: "",
|
|
@@ -207,235 +923,182 @@ var DEFAULT_PROPS = {
|
|
|
207
923
|
plugins: [],
|
|
208
924
|
useFindDOMNode: false,
|
|
209
925
|
hideBeforeInit: false,
|
|
210
|
-
onReady:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
926
|
+
onReady: (e) => {
|
|
927
|
+
},
|
|
928
|
+
onBeforeResize: (e) => {
|
|
929
|
+
},
|
|
930
|
+
onAfterResize: (e) => {
|
|
931
|
+
},
|
|
932
|
+
onHoldStart: (e) => {
|
|
933
|
+
},
|
|
934
|
+
onHoldEnd: (e) => {
|
|
935
|
+
},
|
|
936
|
+
onMoveStart: (e) => {
|
|
937
|
+
},
|
|
938
|
+
onMove: (e) => {
|
|
939
|
+
},
|
|
940
|
+
onMoveEnd: (e) => {
|
|
941
|
+
},
|
|
942
|
+
onWillChange: (e) => {
|
|
943
|
+
},
|
|
944
|
+
onChanged: (e) => {
|
|
945
|
+
},
|
|
946
|
+
onWillRestore: (e) => {
|
|
947
|
+
},
|
|
948
|
+
onRestored: (e) => {
|
|
949
|
+
},
|
|
950
|
+
onSelect: (e) => {
|
|
951
|
+
},
|
|
952
|
+
onNeedPanel: (e) => {
|
|
953
|
+
},
|
|
954
|
+
onVisibleChange: (e) => {
|
|
955
|
+
},
|
|
956
|
+
onReachEdge: (e) => {
|
|
957
|
+
},
|
|
958
|
+
onPanelChange: (e) => {
|
|
959
|
+
}
|
|
227
960
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
961
|
+
class ReactElementProvider {
|
|
962
|
+
get element() {
|
|
963
|
+
return this._el?.nativeElement;
|
|
964
|
+
}
|
|
965
|
+
get rendered() {
|
|
966
|
+
return this._el?.rendered;
|
|
967
|
+
}
|
|
968
|
+
constructor(el) {
|
|
969
|
+
this._el = el;
|
|
970
|
+
}
|
|
971
|
+
show() {
|
|
972
|
+
this._el?.show();
|
|
973
|
+
}
|
|
974
|
+
hide() {
|
|
975
|
+
this._el?.hide();
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
class ReactRenderer extends ExternalRenderer {
|
|
979
|
+
constructor(options) {
|
|
980
|
+
super(options);
|
|
981
|
+
this._reactFlicking = options.reactFlicking;
|
|
235
982
|
}
|
|
236
983
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
strategy.updateRenderingPanels(flicking);
|
|
255
|
-
}
|
|
256
|
-
strategy.renderPanels(flicking);
|
|
257
|
-
return [2 /*return*/, new Promise(function (resolve) {
|
|
258
|
-
reactFlicking.renderEmitter.once("render", function () {
|
|
259
|
-
_this._rendering = false;
|
|
260
|
-
_this._afterRender();
|
|
261
|
-
resolve();
|
|
262
|
-
});
|
|
263
|
-
reactFlicking.forceUpdate();
|
|
264
|
-
})];
|
|
984
|
+
async render() {
|
|
985
|
+
const flicking = getFlickingAttached(this._flicking);
|
|
986
|
+
const reactFlicking = this._reactFlicking;
|
|
987
|
+
const strategy = this._strategy;
|
|
988
|
+
if (flicking.virtualEnabled) {
|
|
989
|
+
strategy.updateRenderingPanels(flicking);
|
|
990
|
+
this._rendering = true;
|
|
991
|
+
} else {
|
|
992
|
+
this._rendering = true;
|
|
993
|
+
strategy.updateRenderingPanels(flicking);
|
|
994
|
+
}
|
|
995
|
+
strategy.renderPanels(flicking);
|
|
996
|
+
return new Promise((resolve) => {
|
|
997
|
+
reactFlicking.renderEmitter.once("render", () => {
|
|
998
|
+
this._rendering = false;
|
|
999
|
+
this._afterRender();
|
|
1000
|
+
resolve();
|
|
265
1001
|
});
|
|
1002
|
+
reactFlicking.forceUpdate();
|
|
266
1003
|
});
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this._rendering = true;
|
|
277
|
-
return [4 /*yield*/, _super.prototype.forceRenderAllPanels.call(this)];
|
|
278
|
-
case 1:
|
|
279
|
-
_a.sent();
|
|
280
|
-
return [2 /*return*/, new Promise(function (resolve) {
|
|
281
|
-
reactFlicking.renderEmitter.once("render", function () {
|
|
282
|
-
_this._rendering = false;
|
|
283
|
-
resolve();
|
|
284
|
-
});
|
|
285
|
-
reactFlicking.forceUpdate();
|
|
286
|
-
})];
|
|
287
|
-
}
|
|
1004
|
+
}
|
|
1005
|
+
async forceRenderAllPanels() {
|
|
1006
|
+
const reactFlicking = this._reactFlicking;
|
|
1007
|
+
this._rendering = true;
|
|
1008
|
+
await super.forceRenderAllPanels();
|
|
1009
|
+
return new Promise((resolve) => {
|
|
1010
|
+
reactFlicking.renderEmitter.once("render", () => {
|
|
1011
|
+
this._rendering = false;
|
|
1012
|
+
resolve();
|
|
288
1013
|
});
|
|
1014
|
+
reactFlicking.forceUpdate();
|
|
289
1015
|
});
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
1016
|
+
}
|
|
1017
|
+
destroy() {
|
|
1018
|
+
super.destroy();
|
|
293
1019
|
this._reactFlicking.renderEmitter.off("render");
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
1020
|
+
}
|
|
1021
|
+
_collectPanels() {
|
|
1022
|
+
const flicking = getFlickingAttached(this._flicking);
|
|
1023
|
+
const reactFlicking = this._reactFlicking;
|
|
1024
|
+
const reactPanels = reactFlicking.reactPanels;
|
|
299
1025
|
this._panels = this._strategy.collectPanels(flicking, reactPanels);
|
|
300
|
-
}
|
|
301
|
-
|
|
1026
|
+
}
|
|
1027
|
+
_createPanel(externalComponent, options) {
|
|
302
1028
|
return this._strategy.createPanel(externalComponent, options);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
__extends(StrictPanel, _super);
|
|
309
|
-
function StrictPanel() {
|
|
310
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
311
|
-
_this._hide = false;
|
|
312
|
-
_this._elRef = React.createRef();
|
|
313
|
-
return _this;
|
|
314
|
-
}
|
|
315
|
-
var __proto = StrictPanel.prototype;
|
|
316
|
-
Object.defineProperty(__proto, "nativeElement", {
|
|
317
|
-
get: function () {
|
|
318
|
-
return this._elRef.current;
|
|
319
|
-
},
|
|
320
|
-
enumerable: false,
|
|
321
|
-
configurable: true
|
|
322
|
-
});
|
|
323
|
-
Object.defineProperty(__proto, "rendered", {
|
|
324
|
-
get: function () {
|
|
325
|
-
return !this._hide;
|
|
326
|
-
},
|
|
327
|
-
enumerable: false,
|
|
328
|
-
configurable: true
|
|
329
|
-
});
|
|
330
|
-
Object.defineProperty(__proto, "elRef", {
|
|
331
|
-
get: function () {
|
|
332
|
-
return this._elRef;
|
|
333
|
-
},
|
|
334
|
-
enumerable: false,
|
|
335
|
-
configurable: true
|
|
336
|
-
});
|
|
337
|
-
__proto.render = function () {
|
|
338
|
-
return this._hide ? React.createElement(React.Fragment, null) : this._getElement();
|
|
339
|
-
};
|
|
340
|
-
__proto.show = function () {
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
class StrictPanel extends React.Component {
|
|
1032
|
+
constructor() {
|
|
1033
|
+
super(...arguments);
|
|
341
1034
|
this._hide = false;
|
|
342
|
-
|
|
343
|
-
|
|
1035
|
+
this._elRef = React.createRef();
|
|
1036
|
+
}
|
|
1037
|
+
get nativeElement() {
|
|
1038
|
+
return this._elRef.current;
|
|
1039
|
+
}
|
|
1040
|
+
get rendered() {
|
|
1041
|
+
return !this._hide;
|
|
1042
|
+
}
|
|
1043
|
+
get elRef() {
|
|
1044
|
+
return this._elRef;
|
|
1045
|
+
}
|
|
1046
|
+
render() {
|
|
1047
|
+
return this._hide ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}) : this._getElement();
|
|
1048
|
+
}
|
|
1049
|
+
show() {
|
|
1050
|
+
this._hide = false;
|
|
1051
|
+
}
|
|
1052
|
+
hide() {
|
|
344
1053
|
this._hide = true;
|
|
345
|
-
}
|
|
346
|
-
|
|
1054
|
+
}
|
|
1055
|
+
_getElement() {
|
|
347
1056
|
return React.cloneElement(React.Children.only(this.props.children), {
|
|
348
1057
|
ref: this._elRef
|
|
349
1058
|
});
|
|
350
|
-
};
|
|
351
|
-
return StrictPanel;
|
|
352
|
-
}(React.Component);
|
|
353
|
-
|
|
354
|
-
/*
|
|
355
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
356
|
-
* egjs projects are licensed under the MIT license
|
|
357
|
-
*/
|
|
358
|
-
var ViewportSlot = React__default.memo(function (props) {
|
|
359
|
-
return React__default.createElement(React__default.Fragment, null, props.children);
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
var ReactElementProvider = /*#__PURE__*/function () {
|
|
363
|
-
function ReactElementProvider(el) {
|
|
364
|
-
this._el = el;
|
|
365
1059
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
__extends(Flicking, _super);
|
|
396
|
-
function Flicking(props) {
|
|
397
|
-
var _this = _super.call(this, props) || this;
|
|
398
|
-
_this._panels = [];
|
|
399
|
-
_this._renderEmitter = new Component();
|
|
400
|
-
var children = _this._getChildren();
|
|
401
|
-
_this._panels = _this._createPanelRefs(props, children);
|
|
402
|
-
_this._prevChildren = children;
|
|
403
|
-
return _this;
|
|
404
|
-
}
|
|
405
|
-
var __proto = Flicking.prototype;
|
|
406
|
-
Object.defineProperty(__proto, "reactPanels", {
|
|
407
|
-
get: function () {
|
|
408
|
-
return this._panels.map(function (panel) {
|
|
409
|
-
return panel.current;
|
|
410
|
-
});
|
|
411
|
-
},
|
|
412
|
-
enumerable: false,
|
|
413
|
-
configurable: true
|
|
414
|
-
});
|
|
415
|
-
Object.defineProperty(__proto, "renderEmitter", {
|
|
416
|
-
get: function () {
|
|
417
|
-
return this._renderEmitter;
|
|
418
|
-
},
|
|
419
|
-
enumerable: false,
|
|
420
|
-
configurable: true
|
|
421
|
-
});
|
|
422
|
-
__proto.componentDidMount = function () {
|
|
423
|
-
var props = this.props;
|
|
424
|
-
var rendererOptions = {
|
|
1060
|
+
}
|
|
1061
|
+
const ViewportSlot = React__default.memo((props) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: props.children }));
|
|
1062
|
+
var __defProp = Object.defineProperty;
|
|
1063
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
1064
|
+
var result = void 0;
|
|
1065
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1066
|
+
if (decorator = decorators[i])
|
|
1067
|
+
result = decorator(target, key, result) || result;
|
|
1068
|
+
if (result) __defProp(target, key, result);
|
|
1069
|
+
return result;
|
|
1070
|
+
};
|
|
1071
|
+
const _Flicking = class _Flicking extends React.Component {
|
|
1072
|
+
constructor(props) {
|
|
1073
|
+
super(props);
|
|
1074
|
+
this._panels = [];
|
|
1075
|
+
this._renderEmitter = new Component();
|
|
1076
|
+
const children = this._getChildren();
|
|
1077
|
+
this._panels = this._createPanelRefs(props, children);
|
|
1078
|
+
this._prevChildren = children;
|
|
1079
|
+
}
|
|
1080
|
+
get reactPanels() {
|
|
1081
|
+
return this._panels.map((panel) => panel.current);
|
|
1082
|
+
}
|
|
1083
|
+
get renderEmitter() {
|
|
1084
|
+
return this._renderEmitter;
|
|
1085
|
+
}
|
|
1086
|
+
componentDidMount() {
|
|
1087
|
+
const props = this.props;
|
|
1088
|
+
const rendererOptions = {
|
|
425
1089
|
reactFlicking: this,
|
|
426
1090
|
align: props.align,
|
|
427
1091
|
strategy: props.virtual && props.panelsPerView > 0 ? new VirtualRenderingStrategy() : new NormalRenderingStrategy({
|
|
428
1092
|
providerCtor: ReactElementProvider
|
|
429
1093
|
})
|
|
430
1094
|
};
|
|
431
|
-
|
|
1095
|
+
const flicking = new VanillaFlicking__default(this._viewportElement, {
|
|
1096
|
+
...props,
|
|
432
1097
|
externalRenderer: new ReactRenderer(rendererOptions)
|
|
433
|
-
}));
|
|
434
|
-
this._vanillaFlicking = flicking;
|
|
435
|
-
var children = this._getChildren();
|
|
436
|
-
this._jsxDiffer = new ListDiffer(children, function (panel) {
|
|
437
|
-
return panel.key;
|
|
438
1098
|
});
|
|
1099
|
+
this._vanillaFlicking = flicking;
|
|
1100
|
+
const children = this._getChildren();
|
|
1101
|
+
this._jsxDiffer = new ListDiffer(children, (panel) => panel.key);
|
|
439
1102
|
this._pluginsDiffer = new ListDiffer();
|
|
440
1103
|
this._prevChildren = children;
|
|
441
1104
|
this._bindEvents();
|
|
@@ -443,54 +1106,46 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
443
1106
|
if (props.status) {
|
|
444
1107
|
flicking.setStatus(props.status);
|
|
445
1108
|
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
var prevProps = this.props;
|
|
1109
|
+
}
|
|
1110
|
+
componentWillUnmount() {
|
|
1111
|
+
this._vanillaFlicking?.destroy();
|
|
1112
|
+
}
|
|
1113
|
+
shouldComponentUpdate(nextProps) {
|
|
1114
|
+
const vanillaFlicking = this._vanillaFlicking;
|
|
1115
|
+
const prevProps = this.props;
|
|
454
1116
|
if (!vanillaFlicking || !vanillaFlicking.initialized) return false;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
for (var key in restProps) {
|
|
1117
|
+
const { children, ...restProps } = nextProps;
|
|
1118
|
+
for (const key in restProps) {
|
|
458
1119
|
if (prevProps[key] !== nextProps[key]) {
|
|
459
1120
|
return true;
|
|
460
1121
|
}
|
|
461
1122
|
}
|
|
462
|
-
|
|
463
|
-
|
|
1123
|
+
const prevChildren = this._prevChildren;
|
|
1124
|
+
const nextChildren = this._getChildren(children);
|
|
464
1125
|
if (nextProps.renderOnSameKey || !this._hasSameChildren(prevChildren, nextChildren)) return true;
|
|
465
1126
|
return false;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
// Ignore updates before init, they will be updated after "ready" event's force update
|
|
472
|
-
// Also, prevent updates when another update is already queued.
|
|
473
|
-
// This usually happens when render() called twice without calling componentDidMount, like in the case of React.StrictMode.
|
|
1127
|
+
}
|
|
1128
|
+
beforeRender() {
|
|
1129
|
+
const vanillaFlicking = this._vanillaFlicking;
|
|
1130
|
+
const props = this.props;
|
|
1131
|
+
const prevChildren = this._prevChildren;
|
|
474
1132
|
if (!vanillaFlicking || !vanillaFlicking.initialized || this._diffResult) return;
|
|
475
|
-
|
|
1133
|
+
const nextChildren = this._getChildren(props.children);
|
|
476
1134
|
if (props.renderOnSameKey || !this._hasSameChildren(prevChildren, nextChildren)) {
|
|
477
1135
|
this._panels = this._createPanelRefs(props, nextChildren);
|
|
478
1136
|
this._diffResult = this._jsxDiffer.update(nextChildren);
|
|
479
1137
|
this._prevChildren = nextChildren;
|
|
480
1138
|
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
1139
|
+
}
|
|
1140
|
+
componentDidUpdate() {
|
|
1141
|
+
const flicking = this._vanillaFlicking;
|
|
1142
|
+
const renderEmitter = this._renderEmitter;
|
|
1143
|
+
const diffResult = this._diffResult;
|
|
486
1144
|
this._checkPlugins();
|
|
487
1145
|
renderEmitter.trigger("render");
|
|
488
1146
|
flicking.camera.updateOffset();
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
_a.virtual;
|
|
492
|
-
var props = __rest(_a, ["virtual"]);
|
|
493
|
-
for (var key in props) {
|
|
1147
|
+
const { virtual, ...props } = this.props;
|
|
1148
|
+
for (const key in props) {
|
|
494
1149
|
if (key in flicking && flicking[key] !== props[key]) {
|
|
495
1150
|
flicking[key] = props[key];
|
|
496
1151
|
}
|
|
@@ -498,84 +1153,69 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
498
1153
|
if (!diffResult || !flicking.initialized) return;
|
|
499
1154
|
sync(flicking, diffResult, this.reactPanels);
|
|
500
1155
|
this._diffResult = null;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
var Camera = props.cameraTag;
|
|
508
|
-
var attributes = {};
|
|
1156
|
+
}
|
|
1157
|
+
render() {
|
|
1158
|
+
const props = this.props;
|
|
1159
|
+
const Viewport = props.viewportTag;
|
|
1160
|
+
const Camera = props.cameraTag;
|
|
1161
|
+
const attributes = {};
|
|
509
1162
|
this.beforeRender();
|
|
510
|
-
for (
|
|
1163
|
+
for (const name in props) {
|
|
511
1164
|
if (!(name in DEFAULT_PROPS) && !(name in VanillaFlicking__default.prototype)) {
|
|
512
1165
|
attributes[name] = props[name];
|
|
513
1166
|
}
|
|
514
1167
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
Object.keys(EVENTS).forEach(function (eventKey) {
|
|
542
|
-
var eventName = EVENTS[eventKey];
|
|
543
|
-
_this._bindEvent(eventName);
|
|
1168
|
+
const { viewportClasses, cameraClasses, cameraProps } = this._getClasses(attributes, props);
|
|
1169
|
+
const panels = !!props.virtual && (props.panelsPerView ?? -1) > 0 ? this._getVirtualPanels() : this._getPanels();
|
|
1170
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1171
|
+
Viewport,
|
|
1172
|
+
{
|
|
1173
|
+
...attributes,
|
|
1174
|
+
className: viewportClasses.join(" "),
|
|
1175
|
+
ref: (e) => {
|
|
1176
|
+
e && (this._viewportElement = e);
|
|
1177
|
+
},
|
|
1178
|
+
children: [
|
|
1179
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Camera, { className: cameraClasses.join(" "), ...cameraProps, children: panels }),
|
|
1180
|
+
this._getViewportSlot()
|
|
1181
|
+
]
|
|
1182
|
+
}
|
|
1183
|
+
);
|
|
1184
|
+
}
|
|
1185
|
+
_createPanelRefs(props, children) {
|
|
1186
|
+
const panelsPerView = props.panelsPerView ?? -1;
|
|
1187
|
+
return panelsPerView > 0 && !!props.virtual ? range(panelsPerView + 1).map(() => React.createRef()) : children.map(() => React.createRef());
|
|
1188
|
+
}
|
|
1189
|
+
_bindEvents() {
|
|
1190
|
+
const flicking = this._vanillaFlicking;
|
|
1191
|
+
Object.keys(EVENTS).forEach((eventKey) => {
|
|
1192
|
+
const eventName = EVENTS[eventKey];
|
|
1193
|
+
this._bindEvent(eventName);
|
|
544
1194
|
});
|
|
545
|
-
flicking.once(EVENTS.READY,
|
|
546
|
-
|
|
1195
|
+
flicking.once(EVENTS.READY, () => {
|
|
1196
|
+
this.forceUpdate();
|
|
547
1197
|
});
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
var evtHandler = _this.props[propName];
|
|
1198
|
+
}
|
|
1199
|
+
_bindEvent(eventName) {
|
|
1200
|
+
const propName = `on${eventName.charAt(0).toUpperCase() + eventName.slice(1)}`;
|
|
1201
|
+
this._vanillaFlicking.on(eventName, (e) => {
|
|
1202
|
+
e.currentTarget = this;
|
|
1203
|
+
const evtHandler = this.props[propName];
|
|
555
1204
|
evtHandler(e);
|
|
556
1205
|
});
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
flicking
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}));
|
|
571
|
-
};
|
|
572
|
-
__proto._getClasses = function (attributes, props) {
|
|
573
|
-
var _a;
|
|
574
|
-
var flicking = this._vanillaFlicking;
|
|
575
|
-
var initialized = flicking && flicking.initialized;
|
|
576
|
-
var viewportClasses = ["flicking-viewport"];
|
|
577
|
-
var cameraClasses = ["flicking-camera"];
|
|
578
|
-
var isHorizontal = flicking ? flicking.horizontal : (_a = props.horizontal) !== null && _a !== void 0 ? _a : true;
|
|
1206
|
+
}
|
|
1207
|
+
_checkPlugins() {
|
|
1208
|
+
const flicking = this._vanillaFlicking;
|
|
1209
|
+
const { list, added, removed, prevList } = this._pluginsDiffer.update(this.props.plugins);
|
|
1210
|
+
flicking.addPlugins(...added.map((index) => list[index]));
|
|
1211
|
+
flicking.removePlugins(...removed.map((index) => prevList[index]));
|
|
1212
|
+
}
|
|
1213
|
+
_getClasses(attributes, props) {
|
|
1214
|
+
const flicking = this._vanillaFlicking;
|
|
1215
|
+
const initialized = flicking?.initialized;
|
|
1216
|
+
const viewportClasses = ["flicking-viewport"];
|
|
1217
|
+
const cameraClasses = ["flicking-camera"];
|
|
1218
|
+
const isHorizontal = flicking ? flicking.horizontal : props.horizontal ?? true;
|
|
579
1219
|
if (!isHorizontal) {
|
|
580
1220
|
viewportClasses.push("vertical");
|
|
581
1221
|
}
|
|
@@ -588,134 +1228,117 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
588
1228
|
if (props.cameraClass) {
|
|
589
1229
|
cameraClasses.push(props.cameraClass);
|
|
590
1230
|
}
|
|
591
|
-
|
|
1231
|
+
const cameraProps = !initialized && props.firstPanelSize ? {
|
|
592
1232
|
style: {
|
|
593
1233
|
transform: getDefaultCameraTransform(this.props.align, this.props.horizontal, this.props.firstPanelSize)
|
|
594
1234
|
}
|
|
595
1235
|
} : {};
|
|
596
1236
|
return {
|
|
597
|
-
viewportClasses
|
|
598
|
-
cameraClasses
|
|
599
|
-
cameraProps
|
|
1237
|
+
viewportClasses,
|
|
1238
|
+
cameraClasses,
|
|
1239
|
+
cameraProps
|
|
600
1240
|
};
|
|
601
|
-
}
|
|
602
|
-
|
|
1241
|
+
}
|
|
1242
|
+
_hasSameChildren(prevChildren, nextChildren) {
|
|
603
1243
|
if (prevChildren.length !== nextChildren.length || prevChildren.length === 0) return false;
|
|
604
|
-
|
|
605
|
-
|
|
1244
|
+
const same = prevChildren.every((child, idx) => {
|
|
1245
|
+
const nextChild = nextChildren[idx];
|
|
606
1246
|
return child === nextChild;
|
|
607
1247
|
});
|
|
608
1248
|
return same;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
children = this.props.children;
|
|
614
|
-
}
|
|
615
|
-
return React.Children.toArray(children).filter(function (child) {
|
|
616
|
-
return child.type !== ViewportSlot;
|
|
617
|
-
}).reduce(function (all, child) {
|
|
618
|
-
return __spreadArray(__spreadArray([], all, true), _this._unpackFragment(child), true);
|
|
1249
|
+
}
|
|
1250
|
+
_getChildren(children = this.props.children) {
|
|
1251
|
+
return React.Children.toArray(children).filter((child) => child.type !== ViewportSlot).reduce((all, child) => {
|
|
1252
|
+
return [...all, ...this._unpackFragment(child)];
|
|
619
1253
|
}, []);
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
return React.Children.toArray(this.props.children).filter(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
} : {};
|
|
646
|
-
return renderingIndexes.map(function (idx) {
|
|
647
|
-
return React.createElement(StrictPanel, {
|
|
648
|
-
key: idx,
|
|
649
|
-
ref: _this._panels[idx]
|
|
650
|
-
}, React.createElement("div", {
|
|
651
|
-
"data-element-index": idx,
|
|
652
|
-
className: panelClass,
|
|
653
|
-
style: size
|
|
654
|
-
}));
|
|
655
|
-
});
|
|
656
|
-
};
|
|
657
|
-
__proto._getPanels = function () {
|
|
658
|
-
var _this = this;
|
|
659
|
-
var origChildren = this._getChildren();
|
|
660
|
-
var vanillaFlicking = this._vanillaFlicking;
|
|
661
|
-
var diffResult = this._diffResult;
|
|
662
|
-
var children = vanillaFlicking && vanillaFlicking.initialized ? diffResult ? getRenderingPanels(vanillaFlicking, diffResult) : getRenderingPanels(vanillaFlicking, diff(origChildren, origChildren)) : origChildren;
|
|
663
|
-
return children.map(function (child, idx) {
|
|
664
|
-
return React.createElement(StrictPanel, {
|
|
665
|
-
key: child.key,
|
|
666
|
-
ref: _this._panels[idx]
|
|
667
|
-
}, child);
|
|
1254
|
+
}
|
|
1255
|
+
_getViewportSlot() {
|
|
1256
|
+
return React.Children.toArray(this.props.children).filter(
|
|
1257
|
+
(child) => child.type === ViewportSlot
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
_unpackFragment(child) {
|
|
1261
|
+
return this._isFragment(child) ? React.Children.toArray(child.props.children).reduce(
|
|
1262
|
+
(allChilds, fragChild) => [
|
|
1263
|
+
...allChilds,
|
|
1264
|
+
...this._unpackFragment(fragChild)
|
|
1265
|
+
],
|
|
1266
|
+
[]
|
|
1267
|
+
) : [child];
|
|
1268
|
+
}
|
|
1269
|
+
_getVirtualPanels() {
|
|
1270
|
+
const { panelClass = "flicking-panel" } = this.props.virtual;
|
|
1271
|
+
const panelsPerView = this.props.panelsPerView;
|
|
1272
|
+
const flicking = this._vanillaFlicking;
|
|
1273
|
+
const initialized = flicking?.initialized;
|
|
1274
|
+
const renderingIndexes = initialized ? flicking.renderer.strategy.getRenderingIndexesByOrder(flicking) : range(panelsPerView + 1);
|
|
1275
|
+
const firstPanel = flicking?.panels[0];
|
|
1276
|
+
const size = firstPanel ? flicking.horizontal ? { width: firstPanel.size } : { height: firstPanel.size } : {};
|
|
1277
|
+
return renderingIndexes.map((idx) => {
|
|
1278
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(StrictPanel, { ref: this._panels[idx], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-element-index": idx, className: panelClass, style: size }) }, idx);
|
|
668
1279
|
});
|
|
669
|
-
}
|
|
670
|
-
|
|
1280
|
+
}
|
|
1281
|
+
_getPanels() {
|
|
1282
|
+
const origChildren = this._getChildren();
|
|
1283
|
+
const vanillaFlicking = this._vanillaFlicking;
|
|
1284
|
+
const diffResult = this._diffResult;
|
|
1285
|
+
const children = vanillaFlicking?.initialized ? diffResult ? getRenderingPanels(vanillaFlicking, diffResult) : getRenderingPanels(vanillaFlicking, diff(origChildren, origChildren)) : origChildren;
|
|
1286
|
+
return children.map((child, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(StrictPanel, { ref: this._panels[idx], children: child }, child.key));
|
|
1287
|
+
}
|
|
1288
|
+
_isFragment(child) {
|
|
671
1289
|
if (child.type) {
|
|
672
1290
|
return child.type === React.Fragment;
|
|
673
1291
|
}
|
|
674
1292
|
return child === React.Fragment;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
_Flicking.defaultProps = DEFAULT_PROPS;
|
|
1296
|
+
let Flicking = _Flicking;
|
|
1297
|
+
__decorateClass([
|
|
1298
|
+
withFlickingMethods
|
|
1299
|
+
], Flicking.prototype, "_vanillaFlicking");
|
|
1300
|
+
const CROSSFLICKING_DEFAULT_PROPS = {
|
|
1301
|
+
...DEFAULT_PROPS,
|
|
1302
|
+
onSideHoldStart: (e) => {
|
|
1303
|
+
},
|
|
1304
|
+
onSideHoldEnd: (e) => {
|
|
1305
|
+
},
|
|
1306
|
+
onSideMoveStart: (e) => {
|
|
1307
|
+
},
|
|
1308
|
+
onSideMove: (e) => {
|
|
1309
|
+
},
|
|
1310
|
+
onSideMoveEnd: (e) => {
|
|
1311
|
+
},
|
|
1312
|
+
onSideWillChange: (e) => {
|
|
1313
|
+
},
|
|
1314
|
+
onSideChanged: (e) => {
|
|
1315
|
+
},
|
|
1316
|
+
onSideWillRestore: (e) => {
|
|
1317
|
+
},
|
|
1318
|
+
onSideRestored: (e) => {
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
const _CrossFlicking = class _CrossFlicking extends Flicking {
|
|
1322
|
+
componentDidMount() {
|
|
1323
|
+
const props = {};
|
|
1324
|
+
for (const name in this.props) {
|
|
701
1325
|
if (name in CROSSFLICKING_DEFAULT_PROPS || name in CrossFlicking$1.prototype) {
|
|
702
1326
|
props[name] = this.props[name];
|
|
703
1327
|
}
|
|
704
1328
|
}
|
|
705
|
-
|
|
1329
|
+
const rendererOptions = {
|
|
706
1330
|
reactFlicking: this,
|
|
707
1331
|
strategy: new NormalRenderingStrategy({
|
|
708
1332
|
providerCtor: ReactElementProvider
|
|
709
1333
|
})
|
|
710
1334
|
};
|
|
711
|
-
|
|
1335
|
+
const flicking = new CrossFlicking$1(this._viewportElement, {
|
|
1336
|
+
...props,
|
|
712
1337
|
externalRenderer: new ReactRenderer(rendererOptions)
|
|
713
|
-
}));
|
|
714
|
-
this._vanillaFlicking = flicking;
|
|
715
|
-
var children = this._getChildren();
|
|
716
|
-
this._jsxDiffer = new ListDiffer(children, function (panel) {
|
|
717
|
-
return panel.key;
|
|
718
1338
|
});
|
|
1339
|
+
this._vanillaFlicking = flicking;
|
|
1340
|
+
const children = this._getChildren();
|
|
1341
|
+
this._jsxDiffer = new ListDiffer(children, (panel) => panel.key);
|
|
719
1342
|
this._pluginsDiffer = new ListDiffer();
|
|
720
1343
|
this._prevChildren = children;
|
|
721
1344
|
this._bindEvents();
|
|
@@ -723,67 +1346,366 @@ var CrossFlicking = /*#__PURE__*/function (_super) {
|
|
|
723
1346
|
if (props.status) {
|
|
724
1347
|
flicking.setStatus(props.status);
|
|
725
1348
|
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
var attributes = {};
|
|
1349
|
+
}
|
|
1350
|
+
render() {
|
|
1351
|
+
const props = this.props;
|
|
1352
|
+
const Viewport = props.viewportTag;
|
|
1353
|
+
const Camera = props.cameraTag;
|
|
1354
|
+
const attributes = {};
|
|
733
1355
|
this.beforeRender();
|
|
734
|
-
for (
|
|
1356
|
+
for (const name in props) {
|
|
735
1357
|
if (!(name in CROSSFLICKING_DEFAULT_PROPS) && !(name in CrossFlicking$1.prototype)) {
|
|
736
1358
|
attributes[name] = props[name];
|
|
737
1359
|
}
|
|
738
1360
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
1361
|
+
const { viewportClasses, cameraClasses, cameraProps } = this._getClasses(attributes, props);
|
|
1362
|
+
const panels = this._getPanels();
|
|
1363
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1364
|
+
Viewport,
|
|
1365
|
+
{
|
|
1366
|
+
...attributes,
|
|
1367
|
+
className: viewportClasses.join(" "),
|
|
1368
|
+
ref: (e) => {
|
|
1369
|
+
e && (this._viewportElement = e);
|
|
1370
|
+
},
|
|
1371
|
+
children: [
|
|
1372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Camera, { className: cameraClasses.join(" "), ...cameraProps, children: panels }),
|
|
1373
|
+
this._getViewportSlot()
|
|
1374
|
+
]
|
|
1375
|
+
}
|
|
1376
|
+
);
|
|
1377
|
+
}
|
|
1378
|
+
_bindEvents() {
|
|
1379
|
+
super._bindEvents();
|
|
1380
|
+
Object.keys(SIDE_EVENTS).forEach((eventKey) => {
|
|
1381
|
+
const eventName = SIDE_EVENTS[eventKey];
|
|
1382
|
+
this._bindEvent(eventName);
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
_CrossFlicking.defaultProps = CROSSFLICKING_DEFAULT_PROPS;
|
|
1387
|
+
let CrossFlicking = _CrossFlicking;
|
|
1388
|
+
const CrossGroup = React__default.forwardRef(({ children, ...rest }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, ...rest, children }));
|
|
1389
|
+
function keys(obj) {
|
|
1390
|
+
return Object.keys(obj);
|
|
1391
|
+
}
|
|
1392
|
+
function camelize(str) {
|
|
1393
|
+
return str.replace(/[\s-_]([a-z])/g, function(all, letter) {
|
|
1394
|
+
return letter.toUpperCase();
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
function isFunction(val) {
|
|
1398
|
+
return typeof val === "function";
|
|
1399
|
+
}
|
|
1400
|
+
var OBSERVERS_PATH = "__observers__";
|
|
1401
|
+
var COMPUTED_PATH = "__computed__";
|
|
1402
|
+
function __spreadArray(to, from, pack) {
|
|
1403
|
+
if (arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1404
|
+
if (ar || !(i in from)) {
|
|
1405
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1406
|
+
ar[i] = from[i];
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1410
|
+
}
|
|
1411
|
+
function withReactiveMethods(ref, methods) {
|
|
1412
|
+
var obj = {};
|
|
1413
|
+
if (!methods) {
|
|
1414
|
+
return obj;
|
|
1415
|
+
}
|
|
1416
|
+
methods.forEach(function(name) {
|
|
1417
|
+
obj[name] = function() {
|
|
1418
|
+
var args = [];
|
|
1419
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1420
|
+
args[_i] = arguments[_i];
|
|
1421
|
+
}
|
|
1422
|
+
var current = ref.current || ref.value;
|
|
1423
|
+
return current[name].apply(current, args);
|
|
1424
|
+
};
|
|
1425
|
+
});
|
|
1426
|
+
return obj;
|
|
1427
|
+
}
|
|
1428
|
+
function defineObservers(instance) {
|
|
1429
|
+
var observers = {};
|
|
1430
|
+
Object.defineProperty(instance, OBSERVERS_PATH, {
|
|
1431
|
+
get: function() {
|
|
1432
|
+
return observers;
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
return observers;
|
|
1436
|
+
}
|
|
1437
|
+
function getObservers(instance, isComputed) {
|
|
1438
|
+
var _a, _b;
|
|
1439
|
+
if (!instance[OBSERVERS_PATH]) {
|
|
1440
|
+
defineObservers(instance);
|
|
1441
|
+
}
|
|
1442
|
+
var observers = instance[OBSERVERS_PATH];
|
|
1443
|
+
{
|
|
1444
|
+
var computedList = (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a.prototype) === null || _b === void 0 ? void 0 : _b[COMPUTED_PATH];
|
|
1445
|
+
if (computedList) {
|
|
1446
|
+
computedList.forEach(function(name) {
|
|
1447
|
+
if (!(name in observers) && name in instance) {
|
|
1448
|
+
instance[name];
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
return observers;
|
|
1454
|
+
}
|
|
1455
|
+
function adaptReactive(adapter, props) {
|
|
1456
|
+
var objectAdapter = isFunction(adapter) ? {
|
|
1457
|
+
setup: adapter
|
|
1458
|
+
} : adapter;
|
|
1459
|
+
function getProps() {
|
|
1460
|
+
var _a, _b, _c, _d, _e;
|
|
1461
|
+
return (_e = (_c = (_a = props === null || props === void 0 ? void 0 : props()) !== null && _a !== void 0 ? _a : (_b = objectAdapter.props) === null || _b === void 0 ? void 0 : _b.call(objectAdapter)) !== null && _c !== void 0 ? _c : (_d = objectAdapter.data) === null || _d === void 0 ? void 0 : _d.call(objectAdapter)) !== null && _e !== void 0 ? _e : {};
|
|
1462
|
+
}
|
|
1463
|
+
var eventEmitter = new Component();
|
|
1464
|
+
var mountedHooks = [];
|
|
1465
|
+
var initHooks = [];
|
|
1466
|
+
var destroyHooks = [];
|
|
1467
|
+
var onHooks = [];
|
|
1468
|
+
var instanceRef = {
|
|
1469
|
+
current: null
|
|
1470
|
+
};
|
|
1471
|
+
var offHooksList = [];
|
|
1472
|
+
var initialState = null;
|
|
1473
|
+
var eventNames = [];
|
|
1474
|
+
var methodNames = [];
|
|
1475
|
+
var onMounted = function(callback) {
|
|
1476
|
+
mountedHooks.push(callback);
|
|
1477
|
+
};
|
|
1478
|
+
var onInit = function(callback) {
|
|
1479
|
+
initHooks.push(callback);
|
|
1480
|
+
};
|
|
1481
|
+
var onDestroy = function(callback) {
|
|
1482
|
+
destroyHooks.push(callback);
|
|
1483
|
+
};
|
|
1484
|
+
var on = function(callback) {
|
|
1485
|
+
onHooks.push(callback);
|
|
1486
|
+
};
|
|
1487
|
+
var emit = function(eventName) {
|
|
1488
|
+
var params = [];
|
|
1489
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1490
|
+
params[_i - 1] = arguments[_i];
|
|
1491
|
+
}
|
|
1492
|
+
eventEmitter.trigger.apply(eventEmitter, __spreadArray([eventName], params, false));
|
|
1493
|
+
};
|
|
1494
|
+
var setInitialState = function(state) {
|
|
1495
|
+
initialState = state;
|
|
1496
|
+
};
|
|
1497
|
+
var setEvents = function(events) {
|
|
1498
|
+
eventNames = events;
|
|
1499
|
+
};
|
|
1500
|
+
var setMethods = function(methods) {
|
|
1501
|
+
methodNames = methods;
|
|
1502
|
+
};
|
|
1503
|
+
if (objectAdapter.setup) {
|
|
1504
|
+
instanceRef.current = objectAdapter.setup({
|
|
1505
|
+
getProps,
|
|
1506
|
+
setInitialState,
|
|
1507
|
+
setEvents,
|
|
1508
|
+
setMethods,
|
|
1509
|
+
onMounted,
|
|
1510
|
+
onDestroy,
|
|
1511
|
+
onInit,
|
|
1512
|
+
emit,
|
|
1513
|
+
on
|
|
1514
|
+
}) || null;
|
|
1515
|
+
}
|
|
1516
|
+
if (objectAdapter.created) {
|
|
1517
|
+
instanceRef.current = objectAdapter.created(getProps()) || null;
|
|
1518
|
+
}
|
|
1519
|
+
if (objectAdapter.events) {
|
|
1520
|
+
setEvents(objectAdapter.events);
|
|
1521
|
+
}
|
|
1522
|
+
if (objectAdapter.state) {
|
|
1523
|
+
setInitialState(objectAdapter.state);
|
|
1524
|
+
}
|
|
1525
|
+
if (objectAdapter.methods) {
|
|
1526
|
+
setMethods(objectAdapter.methods);
|
|
1527
|
+
}
|
|
1528
|
+
if (objectAdapter.mounted) {
|
|
1529
|
+
onMounted(objectAdapter.mounted);
|
|
1530
|
+
}
|
|
1531
|
+
if (objectAdapter.destroy) {
|
|
1532
|
+
destroyHooks.push(objectAdapter.destroy);
|
|
1533
|
+
}
|
|
1534
|
+
if (objectAdapter.init) {
|
|
1535
|
+
initHooks.push(objectAdapter.init);
|
|
1536
|
+
}
|
|
1537
|
+
if (objectAdapter.on) {
|
|
1538
|
+
onHooks.push(function(instance, eventName, listener) {
|
|
1539
|
+
var off = objectAdapter.on(instance, eventName, listener);
|
|
1540
|
+
return function() {
|
|
1541
|
+
var _a;
|
|
1542
|
+
off && off();
|
|
1543
|
+
(_a = objectAdapter.off) === null || _a === void 0 ? void 0 : _a.call(objectAdapter, instance, eventName, listener);
|
|
1544
|
+
};
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
return {
|
|
1548
|
+
events: function() {
|
|
1549
|
+
return eventNames;
|
|
1550
|
+
},
|
|
1551
|
+
state: function() {
|
|
1552
|
+
var inst = instanceRef.current;
|
|
1553
|
+
if (initialState) {
|
|
1554
|
+
return initialState;
|
|
1555
|
+
}
|
|
1556
|
+
if (inst) {
|
|
1557
|
+
var observers_1 = getObservers(inst);
|
|
1558
|
+
setInitialState(keys(observers_1).reduce(function(prev, cur) {
|
|
1559
|
+
prev[cur] = observers_1[cur].current;
|
|
1560
|
+
return prev;
|
|
1561
|
+
}, {}));
|
|
1562
|
+
}
|
|
1563
|
+
return initialState || {};
|
|
1564
|
+
},
|
|
1565
|
+
instance: function() {
|
|
1566
|
+
return instanceRef.current;
|
|
1567
|
+
},
|
|
1568
|
+
mounted: function() {
|
|
1569
|
+
var props2 = getProps();
|
|
1570
|
+
mountedHooks.forEach(function(hook) {
|
|
1571
|
+
instanceRef.current = hook(props2, instanceRef.current) || instanceRef.current;
|
|
1572
|
+
});
|
|
1573
|
+
},
|
|
1574
|
+
init: function() {
|
|
1575
|
+
var instance = instanceRef.current;
|
|
1576
|
+
var props2 = getProps();
|
|
1577
|
+
offHooksList = eventNames.map(function(eventName) {
|
|
1578
|
+
var listener = function() {
|
|
1579
|
+
var _a;
|
|
1580
|
+
var params = [];
|
|
1581
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1582
|
+
params[_i] = arguments[_i];
|
|
1583
|
+
}
|
|
1584
|
+
(_a = eventEmitter).trigger.apply(_a, __spreadArray([eventName], params, false));
|
|
1585
|
+
};
|
|
1586
|
+
var instance2 = instanceRef.current;
|
|
1587
|
+
return onHooks.map(function(hook) {
|
|
1588
|
+
return hook(instance2, eventName, listener);
|
|
1589
|
+
}).filter(Boolean);
|
|
1590
|
+
});
|
|
1591
|
+
initHooks.forEach(function(hook) {
|
|
1592
|
+
hook(instance, props2);
|
|
1593
|
+
});
|
|
1594
|
+
},
|
|
1595
|
+
destroy: function() {
|
|
1596
|
+
offHooksList.forEach(function(offHooks) {
|
|
1597
|
+
offHooks.forEach(function(hook) {
|
|
1598
|
+
hook();
|
|
1599
|
+
});
|
|
1600
|
+
});
|
|
1601
|
+
eventEmitter.off();
|
|
1602
|
+
var instance = instanceRef.current;
|
|
1603
|
+
var props2 = getProps();
|
|
1604
|
+
destroyHooks.forEach(function(hook) {
|
|
1605
|
+
hook(instance, props2);
|
|
1606
|
+
});
|
|
1607
|
+
},
|
|
1608
|
+
methods: function() {
|
|
1609
|
+
return withReactiveMethods(instanceRef, methodNames);
|
|
1610
|
+
},
|
|
1611
|
+
on: function(eventName, listener) {
|
|
1612
|
+
eventEmitter.on(eventName, listener);
|
|
1613
|
+
},
|
|
1614
|
+
off: function(eventName, listener) {
|
|
1615
|
+
eventEmitter.off(eventName, listener);
|
|
1616
|
+
}
|
|
752
1617
|
};
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
1618
|
+
}
|
|
1619
|
+
function useReactive(reactiveAdapter, props) {
|
|
1620
|
+
var readRef = useRef(true);
|
|
1621
|
+
var adaptResult = useMemo(function() {
|
|
1622
|
+
return adaptReactive(reactiveAdapter, props);
|
|
1623
|
+
}, []);
|
|
1624
|
+
var reactiveState = adaptResult.state();
|
|
1625
|
+
var names = keys(reactiveState);
|
|
1626
|
+
var states = useState({})[0];
|
|
1627
|
+
var _loop_1 = function(name2) {
|
|
1628
|
+
var state = useState(function() {
|
|
1629
|
+
return reactiveState[name2];
|
|
759
1630
|
});
|
|
1631
|
+
states[name2] = {
|
|
1632
|
+
getter: false,
|
|
1633
|
+
set: state[1],
|
|
1634
|
+
value: state[0]
|
|
1635
|
+
};
|
|
760
1636
|
};
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
var
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
var
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
1637
|
+
for (var name in reactiveState) {
|
|
1638
|
+
_loop_1(name);
|
|
1639
|
+
}
|
|
1640
|
+
readRef.current = true;
|
|
1641
|
+
var methods = useMemo(function() {
|
|
1642
|
+
return adaptResult.methods();
|
|
1643
|
+
}, []);
|
|
1644
|
+
useEffect(function() {
|
|
1645
|
+
readRef.current = false;
|
|
1646
|
+
});
|
|
1647
|
+
useEffect(function() {
|
|
1648
|
+
adaptResult.mounted();
|
|
1649
|
+
var inst = adaptResult.instance();
|
|
1650
|
+
names.forEach(function(name2) {
|
|
1651
|
+
inst.subscribe(name2, function(value) {
|
|
1652
|
+
states[name2].value = value;
|
|
1653
|
+
if (states[name2].getter) {
|
|
1654
|
+
states[name2].set(value);
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1657
|
+
});
|
|
1658
|
+
adaptResult.init();
|
|
1659
|
+
return function() {
|
|
1660
|
+
adaptResult.destroy();
|
|
779
1661
|
};
|
|
1662
|
+
}, []);
|
|
1663
|
+
var result = names.reduce(function(result2, name2) {
|
|
1664
|
+
if (!methods[name2]) {
|
|
1665
|
+
Object.defineProperty(result2, name2, {
|
|
1666
|
+
enumerable: true,
|
|
1667
|
+
get: function() {
|
|
1668
|
+
if (readRef.current) {
|
|
1669
|
+
states[name2].getter = true;
|
|
1670
|
+
}
|
|
1671
|
+
return states[name2].value;
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
return result2;
|
|
1676
|
+
}, {});
|
|
1677
|
+
var reactiveEvents = adaptResult.events();
|
|
1678
|
+
reactiveEvents.forEach(function(name2) {
|
|
1679
|
+
result[camelize("on ".concat(name2))] = function(callback, dependencies) {
|
|
1680
|
+
var listener = useMemo(function() {
|
|
1681
|
+
adaptResult.on(name2, callback);
|
|
1682
|
+
return callback;
|
|
1683
|
+
}, dependencies);
|
|
1684
|
+
useEffect(function() {
|
|
1685
|
+
adaptResult.off(name2, listener);
|
|
1686
|
+
adaptResult.on(name2, listener);
|
|
1687
|
+
return function() {
|
|
1688
|
+
adaptResult.off(name2, listener);
|
|
1689
|
+
};
|
|
1690
|
+
}, [listener]);
|
|
1691
|
+
};
|
|
1692
|
+
});
|
|
1693
|
+
keys(methods).forEach(function(name2) {
|
|
1694
|
+
result[name2] = methods[name2];
|
|
780
1695
|
});
|
|
1696
|
+
return result;
|
|
1697
|
+
}
|
|
1698
|
+
const useFlickingReactiveAPI = (flickingRef, options) => {
|
|
1699
|
+
return useReactive(flickingReactiveAPIAdapter, () => ({
|
|
1700
|
+
flicking: flickingRef.current ?? void 0,
|
|
1701
|
+
options
|
|
1702
|
+
}));
|
|
1703
|
+
};
|
|
1704
|
+
export {
|
|
1705
|
+
CrossFlicking,
|
|
1706
|
+
CrossGroup,
|
|
1707
|
+
ViewportSlot,
|
|
1708
|
+
Flicking as default,
|
|
1709
|
+
useFlickingReactiveAPI
|
|
781
1710
|
};
|
|
782
|
-
|
|
783
|
-
/*
|
|
784
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
785
|
-
* egjs projects are licensed under the MIT license
|
|
786
|
-
*/
|
|
787
|
-
|
|
788
|
-
export { CrossFlicking, CrossGroup, ViewportSlot, Flicking as default, useFlickingReactiveAPI };
|
|
789
1711
|
//# sourceMappingURL=flicking.esm.js.map
|