@m4l/components 0.1.12 → 0.1.13
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/assets/Logo/index.228dcb5a.js +86 -0
- package/commonjs.565e6834.js +12 -0
- package/components/CommonActions/components/ActionCancel/index.cba1b460.js +17 -0
- package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +49 -0
- package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +31 -0
- package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +18 -0
- package/components/CommonActions/components/Actions/index.e8148d98.js +743 -0
- package/components/CompanyLogo/{index.js → index.f81c179c.js} +42 -48
- package/components/DataGrid/index.b688877d.js +894 -0
- package/components/DynamicFilter/index.82ce857e.js +1158 -0
- package/components/ErrorLabel/index.c8615f16.js +19 -0
- package/components/Icon/index.cbca79b0.js +70 -0
- package/components/Image/index.e790b50b.js +122 -0
- package/components/LanguagePopover/index.3d9611cb.js +87 -0
- package/components/Loadable/index.f5518558.js +15 -0
- package/components/ModalDialog/index.3850c053.js +168 -0
- package/components/NoItemSelected/{index.js → index.12f0ca67.js} +43 -50
- package/components/ObjectLogs/index.27ef875d.js +266 -0
- package/components/Page/index.6d69977e.js +35 -0
- package/components/Page/index.d.ts +1 -1
- package/components/PaperForm/index.d7c74064.js +105 -0
- package/components/Period/index.5e68286a.js +160 -0
- package/components/PropertyValue/index.ab3dd7e9.js +116 -0
- package/components/Resizeable/{index.js → index.45995d2b.js} +21 -19
- package/components/ScrollBar/index.39eeb2de.js +49 -0
- package/components/ScrollToTop/index.e06f98f6.js +11 -0
- package/components/SplitLayout/{index.js → index.4032673d.js} +35 -35
- package/components/animate/IconButtonAnimate/index.d.ts +1 -1
- package/components/animate/LoadingScreen/{index.js → index.f1cec7db.js} +29 -27
- package/components/animate/MotionContainer/index.8d9f9d80.js +30 -0
- package/components/animate/MotionLazyContainer/index.572dd012.js +15 -0
- package/components/animate/features.0fbf41e1.js +5 -0
- package/components/animate/variants/{bounce.js → bounce.784aaaaa.js} +15 -16
- package/components/animate/variants/container.11f82b76.js +20 -0
- package/components/animate/variants/fade.b561c0fc.js +59 -0
- package/components/animate/variants/{index.js → index.7a912140.js} +0 -0
- package/components/animate/variants/transition.bd46b9ce.js +15 -0
- package/components/formatters/BooleanFormatter/index.cca53b7f.js +42 -0
- package/components/formatters/DateFormatter/index.ad8d9b8e.js +57 -0
- package/components/formatters/index.55856d65.js +106 -0
- package/components/hook-form/FormProvider/index.257acd9f.js +55 -0
- package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +122 -0
- package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +153 -0
- package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +59 -0
- package/components/hook-form/RHFDateTime/index.fc5cbafe.js +68 -0
- package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +34 -0
- package/components/hook-form/RHFPeriod/index.23c254e9.js +45 -0
- package/components/hook-form/RHFRadioGroup/index.b3335e13.js +43 -0
- package/components/hook-form/RHFSelect/index.b6ca8bb2.js +36 -0
- package/components/hook-form/RHFTextField/index.4c455f75.js +77 -0
- package/components/hook-form/RHFTextField/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/index.ed3d739f.js +244 -0
- package/components/mui_extended/Accordion/index.2116e423.js +103 -0
- package/components/mui_extended/Avatar/index.0a2a4523.js +32 -0
- package/components/mui_extended/Avatar/index.d.ts +1 -1
- package/components/mui_extended/BoxIcon/index.e638ecc8.js +22 -0
- package/components/mui_extended/Breadcrumbs/index.5e37d903.js +89 -0
- package/components/mui_extended/Button/index.84d8898c.js +110 -0
- package/components/mui_extended/IconButton/index.88f3aadb.js +98 -0
- package/components/mui_extended/LinkWithRoute/index.d4b263de.js +28 -0
- package/components/mui_extended/MenuPopover/index.488fc536.js +131 -0
- package/components/mui_extended/Pager/index.0576814f.js +126 -0
- package/components/mui_extended/Tab/index.e0653a0a.js +28 -0
- package/components/mui_extended/Typography/index.0c4604b3.js +22 -0
- package/contexts/ModalContext/index.2188b69e.js +150 -0
- package/hooks/useFormAddEdit/index.d4845f1a.js +26 -0
- package/hooks/useModal/index.6571d2d9.js +6 -0
- package/index.js +162 -70
- package/lodash.e09401f0.js +32 -0
- package/node_modules.168cb897.js +55 -0
- package/package.json +1 -1
- package/react-data-grid.d46d625e.js +2115 -0
- package/react-draggable.20e95c61.js +714 -0
- package/react-json-view.f56a7f8e.js +2762 -0
- package/react-lazy-load-image-component.45b56650.js +784 -0
- package/react-resizable.5277deaf.js +371 -0
- package/react-splitter-layout.7810ac1b.js +165 -0
- package/utils/index.214d9542.js +435 -0
- package/assets/Logo/index.js +0 -91
- package/commonjs.js +0 -9
- package/components/CommonActions/components/ActionCancel/index.js +0 -15
- package/components/CommonActions/components/ActionFormCancel/index.js +0 -62
- package/components/CommonActions/components/ActionFormIntro/index.js +0 -35
- package/components/CommonActions/components/ActionIntro/index.js +0 -16
- package/components/CommonActions/components/Actions/index.js +0 -859
- package/components/DataGrid/index.js +0 -1067
- package/components/DynamicFilter/index.js +0 -1573
- package/components/ErrorLabel/index.js +0 -18
- package/components/Icon/index.js +0 -80
- package/components/Image/index.js +0 -128
- package/components/LanguagePopover/index.js +0 -93
- package/components/Loadable/index.js +0 -13
- package/components/ModalDialog/index.js +0 -180
- package/components/ObjectLogs/index.js +0 -284
- package/components/Page/index.js +0 -36
- package/components/PaperForm/index.js +0 -110
- package/components/Period/index.js +0 -230
- package/components/PropertyValue/index.js +0 -142
- package/components/ScrollBar/index.js +0 -52
- package/components/ScrollToTop/index.js +0 -10
- package/components/animate/MotionContainer/index.js +0 -31
- package/components/animate/MotionLazyContainer/index.js +0 -13
- package/components/animate/features.js +0 -2
- package/components/animate/variants/container.js +0 -20
- package/components/animate/variants/fade.js +0 -61
- package/components/animate/variants/transition.js +0 -16
- package/components/formatters/BooleanFormatter/index.js +0 -52
- package/components/formatters/DateFormatter/index.js +0 -66
- package/components/formatters/index.js +0 -112
- package/components/hook-form/FormProvider/index.js +0 -61
- package/components/hook-form/RHFAutocomplete/index.js +0 -144
- package/components/hook-form/RHFAutocompleteAsync/index.js +0 -191
- package/components/hook-form/RHFCheckbox/index.js +0 -65
- package/components/hook-form/RHFDateTime/index.js +0 -79
- package/components/hook-form/RHFMultiCheckbox/index.js +0 -32
- package/components/hook-form/RHFPeriod/index.js +0 -47
- package/components/hook-form/RHFRadioGroup/index.js +0 -41
- package/components/hook-form/RHFSelect/index.js +0 -34
- package/components/hook-form/RHFTextField/index.js +0 -87
- package/components/hook-form/RHFUpload/index.js +0 -255
- package/components/mui_extended/Accordion/index.js +0 -105
- package/components/mui_extended/Avatar/index.js +0 -33
- package/components/mui_extended/BoxIcon/index.js +0 -20
- package/components/mui_extended/Breadcrumbs/index.js +0 -92
- package/components/mui_extended/Button/index.js +0 -131
- package/components/mui_extended/IconButton/index.js +0 -108
- package/components/mui_extended/LinkWithRoute/index.js +0 -30
- package/components/mui_extended/MenuPopover/index.js +0 -135
- package/components/mui_extended/Pager/index.js +0 -137
- package/components/mui_extended/Tab/index.js +0 -30
- package/components/mui_extended/Typography/index.js +0 -21
- package/contexts/ModalContext/index.js +0 -165
- package/hooks/useFormAddEdit/index.js +0 -42
- package/hooks/useModal/index.js +0 -4
- package/lodash.js +0 -62
- package/node_modules.js +0 -54
- package/react-data-grid.js +0 -2652
- package/react-draggable.js +0 -960
- package/react-json-view.js +0 -2764
- package/react-lazy-load-image-component.js +0 -792
- package/react-resizable.js +0 -541
- package/react-splitter-layout.js +0 -165
- package/utils/index.js +0 -572
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
import Ce from "react";
|
|
2
|
+
import Me from "react-dom";
|
|
3
|
+
var Be = { exports: {} };
|
|
4
|
+
(() => {
|
|
5
|
+
var Ie = { 296: (y, f, c) => {
|
|
6
|
+
var te = /^\s+|\s+$/g, X = /^[-+]0x[0-9a-f]+$/i, A = /^0b[01]+$/i, w = /^0o[0-7]+$/i, D = parseInt, Z = typeof c.g == "object" && c.g && c.g.Object === Object && c.g, ie = typeof self == "object" && self && self.Object === Object && self, oe = Z || ie || Function("return this")(), se = Object.prototype.toString, re = Math.max, ue = Math.min, U = function() {
|
|
7
|
+
return oe.Date.now();
|
|
8
|
+
};
|
|
9
|
+
function N(p) {
|
|
10
|
+
var a = typeof p;
|
|
11
|
+
return !!p && (a == "object" || a == "function");
|
|
12
|
+
}
|
|
13
|
+
function G(p) {
|
|
14
|
+
if (typeof p == "number")
|
|
15
|
+
return p;
|
|
16
|
+
if (function(j) {
|
|
17
|
+
return typeof j == "symbol" || function(_) {
|
|
18
|
+
return !!_ && typeof _ == "object";
|
|
19
|
+
}(j) && se.call(j) == "[object Symbol]";
|
|
20
|
+
}(p))
|
|
21
|
+
return NaN;
|
|
22
|
+
if (N(p)) {
|
|
23
|
+
var a = typeof p.valueOf == "function" ? p.valueOf() : p;
|
|
24
|
+
p = N(a) ? a + "" : a;
|
|
25
|
+
}
|
|
26
|
+
if (typeof p != "string")
|
|
27
|
+
return p === 0 ? p : +p;
|
|
28
|
+
p = p.replace(te, "");
|
|
29
|
+
var P = A.test(p);
|
|
30
|
+
return P || w.test(p) ? D(p.slice(2), P ? 2 : 8) : X.test(p) ? NaN : +p;
|
|
31
|
+
}
|
|
32
|
+
y.exports = function(p, a, P) {
|
|
33
|
+
var j, _, C, F, O, L, M = 0, q = !1, V = !1, W = !0;
|
|
34
|
+
if (typeof p != "function")
|
|
35
|
+
throw new TypeError("Expected a function");
|
|
36
|
+
function S(v) {
|
|
37
|
+
var B = j, Y = _;
|
|
38
|
+
return j = _ = void 0, M = v, F = p.apply(Y, B);
|
|
39
|
+
}
|
|
40
|
+
function z(v) {
|
|
41
|
+
return M = v, O = setTimeout(J, a), q ? S(v) : F;
|
|
42
|
+
}
|
|
43
|
+
function H(v) {
|
|
44
|
+
var B = v - L;
|
|
45
|
+
return L === void 0 || B >= a || B < 0 || V && v - M >= C;
|
|
46
|
+
}
|
|
47
|
+
function J() {
|
|
48
|
+
var v = U();
|
|
49
|
+
if (H(v))
|
|
50
|
+
return K(v);
|
|
51
|
+
O = setTimeout(J, function(B) {
|
|
52
|
+
var Y = a - (B - L);
|
|
53
|
+
return V ? ue(Y, C - (B - M)) : Y;
|
|
54
|
+
}(v));
|
|
55
|
+
}
|
|
56
|
+
function K(v) {
|
|
57
|
+
return O = void 0, W && j ? S(v) : (j = _ = void 0, F);
|
|
58
|
+
}
|
|
59
|
+
function ee() {
|
|
60
|
+
var v = U(), B = H(v);
|
|
61
|
+
if (j = arguments, _ = this, L = v, B) {
|
|
62
|
+
if (O === void 0)
|
|
63
|
+
return z(L);
|
|
64
|
+
if (V)
|
|
65
|
+
return O = setTimeout(J, a), S(L);
|
|
66
|
+
}
|
|
67
|
+
return O === void 0 && (O = setTimeout(J, a)), F;
|
|
68
|
+
}
|
|
69
|
+
return a = G(a) || 0, N(P) && (q = !!P.leading, C = (V = "maxWait" in P) ? re(G(P.maxWait) || 0, a) : C, W = "trailing" in P ? !!P.trailing : W), ee.cancel = function() {
|
|
70
|
+
O !== void 0 && clearTimeout(O), M = 0, j = L = _ = O = void 0;
|
|
71
|
+
}, ee.flush = function() {
|
|
72
|
+
return O === void 0 ? F : K(U());
|
|
73
|
+
}, ee;
|
|
74
|
+
};
|
|
75
|
+
}, 96: (y, f, c) => {
|
|
76
|
+
var te = "Expected a function", X = /^\s+|\s+$/g, A = /^[-+]0x[0-9a-f]+$/i, w = /^0b[01]+$/i, D = /^0o[0-7]+$/i, Z = parseInt, ie = typeof c.g == "object" && c.g && c.g.Object === Object && c.g, oe = typeof self == "object" && self && self.Object === Object && self, se = ie || oe || Function("return this")(), re = Object.prototype.toString, ue = Math.max, U = Math.min, N = function() {
|
|
77
|
+
return se.Date.now();
|
|
78
|
+
};
|
|
79
|
+
function G(a) {
|
|
80
|
+
var P = typeof a;
|
|
81
|
+
return !!a && (P == "object" || P == "function");
|
|
82
|
+
}
|
|
83
|
+
function p(a) {
|
|
84
|
+
if (typeof a == "number")
|
|
85
|
+
return a;
|
|
86
|
+
if (function(_) {
|
|
87
|
+
return typeof _ == "symbol" || function(C) {
|
|
88
|
+
return !!C && typeof C == "object";
|
|
89
|
+
}(_) && re.call(_) == "[object Symbol]";
|
|
90
|
+
}(a))
|
|
91
|
+
return NaN;
|
|
92
|
+
if (G(a)) {
|
|
93
|
+
var P = typeof a.valueOf == "function" ? a.valueOf() : a;
|
|
94
|
+
a = G(P) ? P + "" : P;
|
|
95
|
+
}
|
|
96
|
+
if (typeof a != "string")
|
|
97
|
+
return a === 0 ? a : +a;
|
|
98
|
+
a = a.replace(X, "");
|
|
99
|
+
var j = w.test(a);
|
|
100
|
+
return j || D.test(a) ? Z(a.slice(2), j ? 2 : 8) : A.test(a) ? NaN : +a;
|
|
101
|
+
}
|
|
102
|
+
y.exports = function(a, P, j) {
|
|
103
|
+
var _ = !0, C = !0;
|
|
104
|
+
if (typeof a != "function")
|
|
105
|
+
throw new TypeError(te);
|
|
106
|
+
return G(j) && (_ = "leading" in j ? !!j.leading : _, C = "trailing" in j ? !!j.trailing : C), function(F, O, L) {
|
|
107
|
+
var M, q, V, W, S, z, H = 0, J = !1, K = !1, ee = !0;
|
|
108
|
+
if (typeof F != "function")
|
|
109
|
+
throw new TypeError(te);
|
|
110
|
+
function v(x) {
|
|
111
|
+
var $ = M, le = q;
|
|
112
|
+
return M = q = void 0, H = x, W = F.apply(le, $);
|
|
113
|
+
}
|
|
114
|
+
function B(x) {
|
|
115
|
+
return H = x, S = setTimeout(ce, O), J ? v(x) : W;
|
|
116
|
+
}
|
|
117
|
+
function Y(x) {
|
|
118
|
+
var $ = x - z;
|
|
119
|
+
return z === void 0 || $ >= O || $ < 0 || K && x - H >= V;
|
|
120
|
+
}
|
|
121
|
+
function ce() {
|
|
122
|
+
var x = N();
|
|
123
|
+
if (Y(x))
|
|
124
|
+
return pe(x);
|
|
125
|
+
S = setTimeout(ce, function($) {
|
|
126
|
+
var le = O - ($ - z);
|
|
127
|
+
return K ? U(le, V - ($ - H)) : le;
|
|
128
|
+
}(x));
|
|
129
|
+
}
|
|
130
|
+
function pe(x) {
|
|
131
|
+
return S = void 0, ee && M ? v(x) : (M = q = void 0, W);
|
|
132
|
+
}
|
|
133
|
+
function ae() {
|
|
134
|
+
var x = N(), $ = Y(x);
|
|
135
|
+
if (M = arguments, q = this, z = x, $) {
|
|
136
|
+
if (S === void 0)
|
|
137
|
+
return B(z);
|
|
138
|
+
if (K)
|
|
139
|
+
return S = setTimeout(ce, O), v(z);
|
|
140
|
+
}
|
|
141
|
+
return S === void 0 && (S = setTimeout(ce, O)), W;
|
|
142
|
+
}
|
|
143
|
+
return O = p(O) || 0, G(L) && (J = !!L.leading, V = (K = "maxWait" in L) ? ue(p(L.maxWait) || 0, O) : V, ee = "trailing" in L ? !!L.trailing : ee), ae.cancel = function() {
|
|
144
|
+
S !== void 0 && clearTimeout(S), H = 0, M = z = q = S = void 0;
|
|
145
|
+
}, ae.flush = function() {
|
|
146
|
+
return S === void 0 ? W : pe(N());
|
|
147
|
+
}, ae;
|
|
148
|
+
}(a, P, { leading: _, maxWait: P, trailing: C });
|
|
149
|
+
};
|
|
150
|
+
}, 703: (y, f, c) => {
|
|
151
|
+
var te = c(414);
|
|
152
|
+
function X() {
|
|
153
|
+
}
|
|
154
|
+
function A() {
|
|
155
|
+
}
|
|
156
|
+
A.resetWarningCache = X, y.exports = function() {
|
|
157
|
+
function w(ie, oe, se, re, ue, U) {
|
|
158
|
+
if (U !== te) {
|
|
159
|
+
var N = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
160
|
+
throw N.name = "Invariant Violation", N;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function D() {
|
|
164
|
+
return w;
|
|
165
|
+
}
|
|
166
|
+
w.isRequired = w;
|
|
167
|
+
var Z = { array: w, bool: w, func: w, number: w, object: w, string: w, symbol: w, any: w, arrayOf: D, element: w, elementType: w, instanceOf: D, node: w, objectOf: D, oneOf: D, oneOfType: D, shape: D, exact: D, checkPropTypes: A, resetWarningCache: X };
|
|
168
|
+
return Z.PropTypes = Z, Z;
|
|
169
|
+
};
|
|
170
|
+
}, 697: (y, f, c) => {
|
|
171
|
+
y.exports = c(703)();
|
|
172
|
+
}, 414: (y) => {
|
|
173
|
+
y.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
174
|
+
} }, Oe = {};
|
|
175
|
+
function E(y) {
|
|
176
|
+
var f = Oe[y];
|
|
177
|
+
if (f !== void 0)
|
|
178
|
+
return f.exports;
|
|
179
|
+
var c = Oe[y] = { exports: {} };
|
|
180
|
+
return Ie[y](c, c.exports, E), c.exports;
|
|
181
|
+
}
|
|
182
|
+
E.n = (y) => {
|
|
183
|
+
var f = y && y.__esModule ? () => y.default : () => y;
|
|
184
|
+
return E.d(f, { a: f }), f;
|
|
185
|
+
}, E.d = (y, f) => {
|
|
186
|
+
for (var c in f)
|
|
187
|
+
E.o(f, c) && !E.o(y, c) && Object.defineProperty(y, c, { enumerable: !0, get: f[c] });
|
|
188
|
+
}, E.g = function() {
|
|
189
|
+
if (typeof globalThis == "object")
|
|
190
|
+
return globalThis;
|
|
191
|
+
try {
|
|
192
|
+
return this || new Function("return this")();
|
|
193
|
+
} catch {
|
|
194
|
+
if (typeof window == "object")
|
|
195
|
+
return window;
|
|
196
|
+
}
|
|
197
|
+
}(), E.o = (y, f) => Object.prototype.hasOwnProperty.call(y, f), E.r = (y) => {
|
|
198
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(y, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(y, "__esModule", { value: !0 });
|
|
199
|
+
};
|
|
200
|
+
var de = {};
|
|
201
|
+
(() => {
|
|
202
|
+
E.r(de), E.d(de, { LazyLoadComponent: () => Pe, LazyLoadImage: () => Ne, trackWindowScroll: () => J });
|
|
203
|
+
const y = Ce;
|
|
204
|
+
var f = E.n(y), c = E(697);
|
|
205
|
+
const te = Me;
|
|
206
|
+
var X = E.n(te);
|
|
207
|
+
function A() {
|
|
208
|
+
return typeof window < "u" && "IntersectionObserver" in window && "isIntersecting" in window.IntersectionObserverEntry.prototype;
|
|
209
|
+
}
|
|
210
|
+
function w(r) {
|
|
211
|
+
return (w = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
212
|
+
return typeof e;
|
|
213
|
+
} : function(e) {
|
|
214
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
215
|
+
})(r);
|
|
216
|
+
}
|
|
217
|
+
function D(r, e) {
|
|
218
|
+
var i = Object.keys(r);
|
|
219
|
+
if (Object.getOwnPropertySymbols) {
|
|
220
|
+
var n = Object.getOwnPropertySymbols(r);
|
|
221
|
+
e && (n = n.filter(function(I) {
|
|
222
|
+
return Object.getOwnPropertyDescriptor(r, I).enumerable;
|
|
223
|
+
})), i.push.apply(i, n);
|
|
224
|
+
}
|
|
225
|
+
return i;
|
|
226
|
+
}
|
|
227
|
+
function Z(r, e, i) {
|
|
228
|
+
return e in r ? Object.defineProperty(r, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = i, r;
|
|
229
|
+
}
|
|
230
|
+
function ie(r, e) {
|
|
231
|
+
for (var i = 0; i < e.length; i++) {
|
|
232
|
+
var n = e[i];
|
|
233
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function oe(r, e) {
|
|
237
|
+
return (oe = Object.setPrototypeOf || function(i, n) {
|
|
238
|
+
return i.__proto__ = n, i;
|
|
239
|
+
})(r, e);
|
|
240
|
+
}
|
|
241
|
+
function se(r, e) {
|
|
242
|
+
if (e && (w(e) === "object" || typeof e == "function"))
|
|
243
|
+
return e;
|
|
244
|
+
if (e !== void 0)
|
|
245
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
246
|
+
return function(i) {
|
|
247
|
+
if (i === void 0)
|
|
248
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
249
|
+
return i;
|
|
250
|
+
}(r);
|
|
251
|
+
}
|
|
252
|
+
function re(r) {
|
|
253
|
+
return (re = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
|
|
254
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
255
|
+
})(r);
|
|
256
|
+
}
|
|
257
|
+
var ue = function(r) {
|
|
258
|
+
r.forEach(function(e) {
|
|
259
|
+
e.isIntersecting && e.target.onVisible();
|
|
260
|
+
});
|
|
261
|
+
}, U = {}, N = function(r) {
|
|
262
|
+
(function(t, o) {
|
|
263
|
+
if (typeof o != "function" && o !== null)
|
|
264
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
265
|
+
t.prototype = Object.create(o && o.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), o && oe(t, o);
|
|
266
|
+
})(b, r);
|
|
267
|
+
var e, i, n, I, Q = (n = b, I = function() {
|
|
268
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
269
|
+
return !1;
|
|
270
|
+
if (typeof Proxy == "function")
|
|
271
|
+
return !0;
|
|
272
|
+
try {
|
|
273
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
274
|
+
})), !0;
|
|
275
|
+
} catch {
|
|
276
|
+
return !1;
|
|
277
|
+
}
|
|
278
|
+
}(), function() {
|
|
279
|
+
var t, o = re(n);
|
|
280
|
+
if (I) {
|
|
281
|
+
var s = re(this).constructor;
|
|
282
|
+
t = Reflect.construct(o, arguments, s);
|
|
283
|
+
} else
|
|
284
|
+
t = o.apply(this, arguments);
|
|
285
|
+
return se(this, t);
|
|
286
|
+
});
|
|
287
|
+
function b(t) {
|
|
288
|
+
var o;
|
|
289
|
+
if (function(u, l) {
|
|
290
|
+
if (!(u instanceof l))
|
|
291
|
+
throw new TypeError("Cannot call a class as a function");
|
|
292
|
+
}(this, b), (o = Q.call(this, t)).supportsObserver = !t.scrollPosition && t.useIntersectionObserver && A(), o.supportsObserver) {
|
|
293
|
+
var s = t.threshold;
|
|
294
|
+
o.observer = function(u) {
|
|
295
|
+
return U[u] = U[u] || new IntersectionObserver(ue, { rootMargin: u + "px" }), U[u];
|
|
296
|
+
}(s);
|
|
297
|
+
}
|
|
298
|
+
return o;
|
|
299
|
+
}
|
|
300
|
+
return e = b, (i = [{ key: "componentDidMount", value: function() {
|
|
301
|
+
this.placeholder && this.observer && (this.placeholder.onVisible = this.props.onVisible, this.observer.observe(this.placeholder)), this.supportsObserver || this.updateVisibility();
|
|
302
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
303
|
+
this.observer && this.observer.unobserve(this.placeholder);
|
|
304
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
305
|
+
this.supportsObserver || this.updateVisibility();
|
|
306
|
+
} }, { key: "getPlaceholderBoundingBox", value: function() {
|
|
307
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props.scrollPosition, o = this.placeholder.getBoundingClientRect(), s = X().findDOMNode(this.placeholder).style, u = { left: parseInt(s.getPropertyValue("margin-left"), 10) || 0, top: parseInt(s.getPropertyValue("margin-top"), 10) || 0 };
|
|
308
|
+
return { bottom: t.y + o.bottom + u.top, left: t.x + o.left + u.left, right: t.x + o.right + u.left, top: t.y + o.top + u.top };
|
|
309
|
+
} }, { key: "isPlaceholderInViewport", value: function() {
|
|
310
|
+
if (typeof window > "u" || !this.placeholder)
|
|
311
|
+
return !1;
|
|
312
|
+
var t = this.props, o = t.scrollPosition, s = t.threshold, u = this.getPlaceholderBoundingBox(o), l = o.y + window.innerHeight, d = o.x, m = o.x + window.innerWidth, g = o.y;
|
|
313
|
+
return Boolean(g - s <= u.bottom && l + s >= u.top && d - s <= u.right && m + s >= u.left);
|
|
314
|
+
} }, { key: "updateVisibility", value: function() {
|
|
315
|
+
this.isPlaceholderInViewport() && this.props.onVisible();
|
|
316
|
+
} }, { key: "render", value: function() {
|
|
317
|
+
var t = this, o = this.props, s = o.className, u = o.height, l = o.placeholder, d = o.style, m = o.width;
|
|
318
|
+
if (l && typeof l.type != "function")
|
|
319
|
+
return f().cloneElement(l, { ref: function(h) {
|
|
320
|
+
return t.placeholder = h;
|
|
321
|
+
} });
|
|
322
|
+
var g = function(h) {
|
|
323
|
+
for (var R = 1; R < arguments.length; R++) {
|
|
324
|
+
var T = arguments[R] != null ? arguments[R] : {};
|
|
325
|
+
R % 2 ? D(Object(T), !0).forEach(function(k) {
|
|
326
|
+
Z(h, k, T[k]);
|
|
327
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(h, Object.getOwnPropertyDescriptors(T)) : D(Object(T)).forEach(function(k) {
|
|
328
|
+
Object.defineProperty(h, k, Object.getOwnPropertyDescriptor(T, k));
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
return h;
|
|
332
|
+
}({ display: "inline-block" }, d);
|
|
333
|
+
return m !== void 0 && (g.width = m), u !== void 0 && (g.height = u), f().createElement("span", { className: s, ref: function(h) {
|
|
334
|
+
return t.placeholder = h;
|
|
335
|
+
}, style: g }, l);
|
|
336
|
+
} }]) && ie(e.prototype, i), b;
|
|
337
|
+
}(f().Component);
|
|
338
|
+
N.propTypes = { onVisible: c.PropTypes.func.isRequired, className: c.PropTypes.string, height: c.PropTypes.oneOfType([c.PropTypes.number, c.PropTypes.string]), placeholder: c.PropTypes.element, threshold: c.PropTypes.number, useIntersectionObserver: c.PropTypes.bool, scrollPosition: c.PropTypes.shape({ x: c.PropTypes.number.isRequired, y: c.PropTypes.number.isRequired }), width: c.PropTypes.oneOfType([c.PropTypes.number, c.PropTypes.string]) }, N.defaultProps = { className: "", placeholder: null, threshold: 100, useIntersectionObserver: !0 };
|
|
339
|
+
const G = N;
|
|
340
|
+
var p = E(296), a = E.n(p), P = E(96), j = E.n(P), _ = function(r) {
|
|
341
|
+
var e = getComputedStyle(r, null);
|
|
342
|
+
return e.getPropertyValue("overflow") + e.getPropertyValue("overflow-y") + e.getPropertyValue("overflow-x");
|
|
343
|
+
};
|
|
344
|
+
const C = function(r) {
|
|
345
|
+
if (!(r instanceof HTMLElement))
|
|
346
|
+
return window;
|
|
347
|
+
for (var e = r; e && e instanceof HTMLElement; ) {
|
|
348
|
+
if (/(scroll|auto)/.test(_(e)))
|
|
349
|
+
return e;
|
|
350
|
+
e = e.parentNode;
|
|
351
|
+
}
|
|
352
|
+
return window;
|
|
353
|
+
};
|
|
354
|
+
function F(r) {
|
|
355
|
+
return (F = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
356
|
+
return typeof e;
|
|
357
|
+
} : function(e) {
|
|
358
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
359
|
+
})(r);
|
|
360
|
+
}
|
|
361
|
+
var O = ["delayMethod", "delayTime"];
|
|
362
|
+
function L() {
|
|
363
|
+
return (L = Object.assign || function(r) {
|
|
364
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
365
|
+
var i = arguments[e];
|
|
366
|
+
for (var n in i)
|
|
367
|
+
Object.prototype.hasOwnProperty.call(i, n) && (r[n] = i[n]);
|
|
368
|
+
}
|
|
369
|
+
return r;
|
|
370
|
+
}).apply(this, arguments);
|
|
371
|
+
}
|
|
372
|
+
function M(r, e) {
|
|
373
|
+
for (var i = 0; i < e.length; i++) {
|
|
374
|
+
var n = e[i];
|
|
375
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function q(r, e) {
|
|
379
|
+
return (q = Object.setPrototypeOf || function(i, n) {
|
|
380
|
+
return i.__proto__ = n, i;
|
|
381
|
+
})(r, e);
|
|
382
|
+
}
|
|
383
|
+
function V(r, e) {
|
|
384
|
+
if (e && (F(e) === "object" || typeof e == "function"))
|
|
385
|
+
return e;
|
|
386
|
+
if (e !== void 0)
|
|
387
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
388
|
+
return W(r);
|
|
389
|
+
}
|
|
390
|
+
function W(r) {
|
|
391
|
+
if (r === void 0)
|
|
392
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
393
|
+
return r;
|
|
394
|
+
}
|
|
395
|
+
function S(r) {
|
|
396
|
+
return (S = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
|
|
397
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
398
|
+
})(r);
|
|
399
|
+
}
|
|
400
|
+
var z = function() {
|
|
401
|
+
return typeof window > "u" ? 0 : window.scrollX || window.pageXOffset;
|
|
402
|
+
}, H = function() {
|
|
403
|
+
return typeof window > "u" ? 0 : window.scrollY || window.pageYOffset;
|
|
404
|
+
};
|
|
405
|
+
const J = function(r) {
|
|
406
|
+
var e = function(i) {
|
|
407
|
+
(function(s, u) {
|
|
408
|
+
if (typeof u != "function" && u !== null)
|
|
409
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
410
|
+
s.prototype = Object.create(u && u.prototype, { constructor: { value: s, writable: !0, configurable: !0 } }), u && q(s, u);
|
|
411
|
+
})(o, i);
|
|
412
|
+
var n, I, Q, b, t = (Q = o, b = function() {
|
|
413
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
414
|
+
return !1;
|
|
415
|
+
if (typeof Proxy == "function")
|
|
416
|
+
return !0;
|
|
417
|
+
try {
|
|
418
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
419
|
+
})), !0;
|
|
420
|
+
} catch {
|
|
421
|
+
return !1;
|
|
422
|
+
}
|
|
423
|
+
}(), function() {
|
|
424
|
+
var s, u = S(Q);
|
|
425
|
+
if (b) {
|
|
426
|
+
var l = S(this).constructor;
|
|
427
|
+
s = Reflect.construct(u, arguments, l);
|
|
428
|
+
} else
|
|
429
|
+
s = u.apply(this, arguments);
|
|
430
|
+
return V(this, s);
|
|
431
|
+
});
|
|
432
|
+
function o(s) {
|
|
433
|
+
var u;
|
|
434
|
+
if (function(d, m) {
|
|
435
|
+
if (!(d instanceof m))
|
|
436
|
+
throw new TypeError("Cannot call a class as a function");
|
|
437
|
+
}(this, o), (u = t.call(this, s)).useIntersectionObserver = s.useIntersectionObserver && A(), u.useIntersectionObserver)
|
|
438
|
+
return V(u);
|
|
439
|
+
var l = u.onChangeScroll.bind(W(u));
|
|
440
|
+
return s.delayMethod === "debounce" ? u.delayedScroll = a()(l, s.delayTime) : s.delayMethod === "throttle" && (u.delayedScroll = j()(l, s.delayTime)), u.state = { scrollPosition: { x: z(), y: H() } }, u.baseComponentRef = f().createRef(), u;
|
|
441
|
+
}
|
|
442
|
+
return n = o, (I = [{ key: "componentDidMount", value: function() {
|
|
443
|
+
this.addListeners();
|
|
444
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
445
|
+
this.removeListeners();
|
|
446
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
447
|
+
typeof window > "u" || this.useIntersectionObserver || C(X().findDOMNode(this.baseComponentRef.current)) !== this.scrollElement && (this.removeListeners(), this.addListeners());
|
|
448
|
+
} }, { key: "addListeners", value: function() {
|
|
449
|
+
typeof window > "u" || this.useIntersectionObserver || (this.scrollElement = C(X().findDOMNode(this.baseComponentRef.current)), this.scrollElement.addEventListener("scroll", this.delayedScroll, { passive: !0 }), window.addEventListener("resize", this.delayedScroll, { passive: !0 }), this.scrollElement !== window && window.addEventListener("scroll", this.delayedScroll, { passive: !0 }));
|
|
450
|
+
} }, { key: "removeListeners", value: function() {
|
|
451
|
+
typeof window > "u" || this.useIntersectionObserver || (this.scrollElement.removeEventListener("scroll", this.delayedScroll), window.removeEventListener("resize", this.delayedScroll), this.scrollElement !== window && window.removeEventListener("scroll", this.delayedScroll));
|
|
452
|
+
} }, { key: "onChangeScroll", value: function() {
|
|
453
|
+
this.useIntersectionObserver || this.setState({ scrollPosition: { x: z(), y: H() } });
|
|
454
|
+
} }, { key: "render", value: function() {
|
|
455
|
+
var s = this.props, u = (s.delayMethod, s.delayTime, function(d, m) {
|
|
456
|
+
if (d == null)
|
|
457
|
+
return {};
|
|
458
|
+
var g, h, R = function(k, fe) {
|
|
459
|
+
if (k == null)
|
|
460
|
+
return {};
|
|
461
|
+
var ne, ye, _e = {}, xe = Object.keys(k);
|
|
462
|
+
for (ye = 0; ye < xe.length; ye++)
|
|
463
|
+
ne = xe[ye], fe.indexOf(ne) >= 0 || (_e[ne] = k[ne]);
|
|
464
|
+
return _e;
|
|
465
|
+
}(d, m);
|
|
466
|
+
if (Object.getOwnPropertySymbols) {
|
|
467
|
+
var T = Object.getOwnPropertySymbols(d);
|
|
468
|
+
for (h = 0; h < T.length; h++)
|
|
469
|
+
g = T[h], m.indexOf(g) >= 0 || Object.prototype.propertyIsEnumerable.call(d, g) && (R[g] = d[g]);
|
|
470
|
+
}
|
|
471
|
+
return R;
|
|
472
|
+
}(s, O)), l = this.useIntersectionObserver ? null : this.state.scrollPosition;
|
|
473
|
+
return f().createElement(r, L({ forwardRef: this.baseComponentRef, scrollPosition: l }, u));
|
|
474
|
+
} }]) && M(n.prototype, I), o;
|
|
475
|
+
}(f().Component);
|
|
476
|
+
return e.propTypes = { delayMethod: c.PropTypes.oneOf(["debounce", "throttle"]), delayTime: c.PropTypes.number, useIntersectionObserver: c.PropTypes.bool }, e.defaultProps = { delayMethod: "throttle", delayTime: 300, useIntersectionObserver: !0 }, e;
|
|
477
|
+
};
|
|
478
|
+
function K(r) {
|
|
479
|
+
return (K = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
480
|
+
return typeof e;
|
|
481
|
+
} : function(e) {
|
|
482
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
483
|
+
})(r);
|
|
484
|
+
}
|
|
485
|
+
function ee(r, e) {
|
|
486
|
+
for (var i = 0; i < e.length; i++) {
|
|
487
|
+
var n = e[i];
|
|
488
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function v(r, e) {
|
|
492
|
+
return (v = Object.setPrototypeOf || function(i, n) {
|
|
493
|
+
return i.__proto__ = n, i;
|
|
494
|
+
})(r, e);
|
|
495
|
+
}
|
|
496
|
+
function B(r, e) {
|
|
497
|
+
if (e && (K(e) === "object" || typeof e == "function"))
|
|
498
|
+
return e;
|
|
499
|
+
if (e !== void 0)
|
|
500
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
501
|
+
return function(i) {
|
|
502
|
+
if (i === void 0)
|
|
503
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
504
|
+
return i;
|
|
505
|
+
}(r);
|
|
506
|
+
}
|
|
507
|
+
function Y(r) {
|
|
508
|
+
return (Y = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
|
|
509
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
510
|
+
})(r);
|
|
511
|
+
}
|
|
512
|
+
var ce = function(r) {
|
|
513
|
+
(function(t, o) {
|
|
514
|
+
if (typeof o != "function" && o !== null)
|
|
515
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
516
|
+
t.prototype = Object.create(o && o.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), o && v(t, o);
|
|
517
|
+
})(b, r);
|
|
518
|
+
var e, i, n, I, Q = (n = b, I = function() {
|
|
519
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
520
|
+
return !1;
|
|
521
|
+
if (typeof Proxy == "function")
|
|
522
|
+
return !0;
|
|
523
|
+
try {
|
|
524
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
525
|
+
})), !0;
|
|
526
|
+
} catch {
|
|
527
|
+
return !1;
|
|
528
|
+
}
|
|
529
|
+
}(), function() {
|
|
530
|
+
var t, o = Y(n);
|
|
531
|
+
if (I) {
|
|
532
|
+
var s = Y(this).constructor;
|
|
533
|
+
t = Reflect.construct(o, arguments, s);
|
|
534
|
+
} else
|
|
535
|
+
t = o.apply(this, arguments);
|
|
536
|
+
return B(this, t);
|
|
537
|
+
});
|
|
538
|
+
function b(t) {
|
|
539
|
+
return function(o, s) {
|
|
540
|
+
if (!(o instanceof s))
|
|
541
|
+
throw new TypeError("Cannot call a class as a function");
|
|
542
|
+
}(this, b), Q.call(this, t);
|
|
543
|
+
}
|
|
544
|
+
return e = b, (i = [{ key: "render", value: function() {
|
|
545
|
+
return f().createElement(G, this.props);
|
|
546
|
+
} }]) && ee(e.prototype, i), b;
|
|
547
|
+
}(f().Component);
|
|
548
|
+
const pe = J(ce);
|
|
549
|
+
function ae(r) {
|
|
550
|
+
return (ae = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
551
|
+
return typeof e;
|
|
552
|
+
} : function(e) {
|
|
553
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
554
|
+
})(r);
|
|
555
|
+
}
|
|
556
|
+
function x(r, e) {
|
|
557
|
+
for (var i = 0; i < e.length; i++) {
|
|
558
|
+
var n = e[i];
|
|
559
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function $(r, e) {
|
|
563
|
+
return ($ = Object.setPrototypeOf || function(i, n) {
|
|
564
|
+
return i.__proto__ = n, i;
|
|
565
|
+
})(r, e);
|
|
566
|
+
}
|
|
567
|
+
function le(r, e) {
|
|
568
|
+
if (e && (ae(e) === "object" || typeof e == "function"))
|
|
569
|
+
return e;
|
|
570
|
+
if (e !== void 0)
|
|
571
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
572
|
+
return we(r);
|
|
573
|
+
}
|
|
574
|
+
function we(r) {
|
|
575
|
+
if (r === void 0)
|
|
576
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
577
|
+
return r;
|
|
578
|
+
}
|
|
579
|
+
function be(r) {
|
|
580
|
+
return (be = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
|
|
581
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
582
|
+
})(r);
|
|
583
|
+
}
|
|
584
|
+
var he = function(r) {
|
|
585
|
+
(function(t, o) {
|
|
586
|
+
if (typeof o != "function" && o !== null)
|
|
587
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
588
|
+
t.prototype = Object.create(o && o.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), o && $(t, o);
|
|
589
|
+
})(b, r);
|
|
590
|
+
var e, i, n, I, Q = (n = b, I = function() {
|
|
591
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
592
|
+
return !1;
|
|
593
|
+
if (typeof Proxy == "function")
|
|
594
|
+
return !0;
|
|
595
|
+
try {
|
|
596
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
597
|
+
})), !0;
|
|
598
|
+
} catch {
|
|
599
|
+
return !1;
|
|
600
|
+
}
|
|
601
|
+
}(), function() {
|
|
602
|
+
var t, o = be(n);
|
|
603
|
+
if (I) {
|
|
604
|
+
var s = be(this).constructor;
|
|
605
|
+
t = Reflect.construct(o, arguments, s);
|
|
606
|
+
} else
|
|
607
|
+
t = o.apply(this, arguments);
|
|
608
|
+
return le(this, t);
|
|
609
|
+
});
|
|
610
|
+
function b(t) {
|
|
611
|
+
var o;
|
|
612
|
+
(function(m, g) {
|
|
613
|
+
if (!(m instanceof g))
|
|
614
|
+
throw new TypeError("Cannot call a class as a function");
|
|
615
|
+
})(this, b), o = Q.call(this, t);
|
|
616
|
+
var s = t.afterLoad, u = t.beforeLoad, l = t.scrollPosition, d = t.visibleByDefault;
|
|
617
|
+
return o.state = { visible: d }, d && (u(), s()), o.onVisible = o.onVisible.bind(we(o)), o.isScrollTracked = Boolean(l && Number.isFinite(l.x) && l.x >= 0 && Number.isFinite(l.y) && l.y >= 0), o;
|
|
618
|
+
}
|
|
619
|
+
return e = b, (i = [{ key: "componentDidUpdate", value: function(t, o) {
|
|
620
|
+
o.visible !== this.state.visible && this.props.afterLoad();
|
|
621
|
+
} }, { key: "onVisible", value: function() {
|
|
622
|
+
this.props.beforeLoad(), this.setState({ visible: !0 });
|
|
623
|
+
} }, { key: "render", value: function() {
|
|
624
|
+
if (this.state.visible)
|
|
625
|
+
return this.props.children;
|
|
626
|
+
var t = this.props, o = t.className, s = t.delayMethod, u = t.delayTime, l = t.height, d = t.placeholder, m = t.scrollPosition, g = t.style, h = t.threshold, R = t.useIntersectionObserver, T = t.width;
|
|
627
|
+
return this.isScrollTracked || R && A() ? f().createElement(G, { className: o, height: l, onVisible: this.onVisible, placeholder: d, scrollPosition: m, style: g, threshold: h, useIntersectionObserver: R, width: T }) : f().createElement(pe, { className: o, delayMethod: s, delayTime: u, height: l, onVisible: this.onVisible, placeholder: d, style: g, threshold: h, width: T });
|
|
628
|
+
} }]) && x(e.prototype, i), b;
|
|
629
|
+
}(f().Component);
|
|
630
|
+
he.propTypes = { afterLoad: c.PropTypes.func, beforeLoad: c.PropTypes.func, useIntersectionObserver: c.PropTypes.bool, visibleByDefault: c.PropTypes.bool }, he.defaultProps = { afterLoad: function() {
|
|
631
|
+
return {};
|
|
632
|
+
}, beforeLoad: function() {
|
|
633
|
+
return {};
|
|
634
|
+
}, useIntersectionObserver: !0, visibleByDefault: !1 };
|
|
635
|
+
const Pe = he;
|
|
636
|
+
function je(r) {
|
|
637
|
+
return (je = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
638
|
+
return typeof e;
|
|
639
|
+
} : function(e) {
|
|
640
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
641
|
+
})(r);
|
|
642
|
+
}
|
|
643
|
+
var Le = ["afterLoad", "beforeLoad", "delayMethod", "delayTime", "effect", "placeholder", "placeholderSrc", "scrollPosition", "threshold", "useIntersectionObserver", "visibleByDefault", "wrapperClassName", "wrapperProps"];
|
|
644
|
+
function Te(r, e) {
|
|
645
|
+
var i = Object.keys(r);
|
|
646
|
+
if (Object.getOwnPropertySymbols) {
|
|
647
|
+
var n = Object.getOwnPropertySymbols(r);
|
|
648
|
+
e && (n = n.filter(function(I) {
|
|
649
|
+
return Object.getOwnPropertyDescriptor(r, I).enumerable;
|
|
650
|
+
})), i.push.apply(i, n);
|
|
651
|
+
}
|
|
652
|
+
return i;
|
|
653
|
+
}
|
|
654
|
+
function Se(r) {
|
|
655
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
656
|
+
var i = arguments[e] != null ? arguments[e] : {};
|
|
657
|
+
e % 2 ? Te(Object(i), !0).forEach(function(n) {
|
|
658
|
+
Re(r, n, i[n]);
|
|
659
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(i)) : Te(Object(i)).forEach(function(n) {
|
|
660
|
+
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(i, n));
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
return r;
|
|
664
|
+
}
|
|
665
|
+
function Re(r, e, i) {
|
|
666
|
+
return e in r ? Object.defineProperty(r, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = i, r;
|
|
667
|
+
}
|
|
668
|
+
function ve() {
|
|
669
|
+
return (ve = Object.assign || function(r) {
|
|
670
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
671
|
+
var i = arguments[e];
|
|
672
|
+
for (var n in i)
|
|
673
|
+
Object.prototype.hasOwnProperty.call(i, n) && (r[n] = i[n]);
|
|
674
|
+
}
|
|
675
|
+
return r;
|
|
676
|
+
}).apply(this, arguments);
|
|
677
|
+
}
|
|
678
|
+
function ke(r, e) {
|
|
679
|
+
for (var i = 0; i < e.length; i++) {
|
|
680
|
+
var n = e[i];
|
|
681
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
function Ee(r, e) {
|
|
685
|
+
return (Ee = Object.setPrototypeOf || function(i, n) {
|
|
686
|
+
return i.__proto__ = n, i;
|
|
687
|
+
})(r, e);
|
|
688
|
+
}
|
|
689
|
+
function De(r, e) {
|
|
690
|
+
if (e && (je(e) === "object" || typeof e == "function"))
|
|
691
|
+
return e;
|
|
692
|
+
if (e !== void 0)
|
|
693
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
694
|
+
return function(i) {
|
|
695
|
+
if (i === void 0)
|
|
696
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
697
|
+
return i;
|
|
698
|
+
}(r);
|
|
699
|
+
}
|
|
700
|
+
function me(r) {
|
|
701
|
+
return (me = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
|
|
702
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
703
|
+
})(r);
|
|
704
|
+
}
|
|
705
|
+
var ge = function(r) {
|
|
706
|
+
(function(t, o) {
|
|
707
|
+
if (typeof o != "function" && o !== null)
|
|
708
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
709
|
+
t.prototype = Object.create(o && o.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), o && Ee(t, o);
|
|
710
|
+
})(b, r);
|
|
711
|
+
var e, i, n, I, Q = (n = b, I = function() {
|
|
712
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
713
|
+
return !1;
|
|
714
|
+
if (typeof Proxy == "function")
|
|
715
|
+
return !0;
|
|
716
|
+
try {
|
|
717
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
718
|
+
})), !0;
|
|
719
|
+
} catch {
|
|
720
|
+
return !1;
|
|
721
|
+
}
|
|
722
|
+
}(), function() {
|
|
723
|
+
var t, o = me(n);
|
|
724
|
+
if (I) {
|
|
725
|
+
var s = me(this).constructor;
|
|
726
|
+
t = Reflect.construct(o, arguments, s);
|
|
727
|
+
} else
|
|
728
|
+
t = o.apply(this, arguments);
|
|
729
|
+
return De(this, t);
|
|
730
|
+
});
|
|
731
|
+
function b(t) {
|
|
732
|
+
var o;
|
|
733
|
+
return function(s, u) {
|
|
734
|
+
if (!(s instanceof u))
|
|
735
|
+
throw new TypeError("Cannot call a class as a function");
|
|
736
|
+
}(this, b), (o = Q.call(this, t)).state = { loaded: !1 }, o;
|
|
737
|
+
}
|
|
738
|
+
return e = b, (i = [{ key: "onImageLoad", value: function() {
|
|
739
|
+
var t = this;
|
|
740
|
+
return this.state.loaded ? null : function() {
|
|
741
|
+
t.props.afterLoad(), t.setState({ loaded: !0 });
|
|
742
|
+
};
|
|
743
|
+
} }, { key: "getImg", value: function() {
|
|
744
|
+
var t = this.props, o = (t.afterLoad, t.beforeLoad, t.delayMethod, t.delayTime, t.effect, t.placeholder, t.placeholderSrc, t.scrollPosition, t.threshold, t.useIntersectionObserver, t.visibleByDefault, t.wrapperClassName, t.wrapperProps, function(s, u) {
|
|
745
|
+
if (s == null)
|
|
746
|
+
return {};
|
|
747
|
+
var l, d, m = function(h, R) {
|
|
748
|
+
if (h == null)
|
|
749
|
+
return {};
|
|
750
|
+
var T, k, fe = {}, ne = Object.keys(h);
|
|
751
|
+
for (k = 0; k < ne.length; k++)
|
|
752
|
+
T = ne[k], R.indexOf(T) >= 0 || (fe[T] = h[T]);
|
|
753
|
+
return fe;
|
|
754
|
+
}(s, u);
|
|
755
|
+
if (Object.getOwnPropertySymbols) {
|
|
756
|
+
var g = Object.getOwnPropertySymbols(s);
|
|
757
|
+
for (d = 0; d < g.length; d++)
|
|
758
|
+
l = g[d], u.indexOf(l) >= 0 || Object.prototype.propertyIsEnumerable.call(s, l) && (m[l] = s[l]);
|
|
759
|
+
}
|
|
760
|
+
return m;
|
|
761
|
+
}(t, Le));
|
|
762
|
+
return f().createElement("img", ve({ onLoad: this.onImageLoad() }, o));
|
|
763
|
+
} }, { key: "getLazyLoadImage", value: function() {
|
|
764
|
+
var t = this.props, o = t.beforeLoad, s = t.className, u = t.delayMethod, l = t.delayTime, d = t.height, m = t.placeholder, g = t.scrollPosition, h = t.style, R = t.threshold, T = t.useIntersectionObserver, k = t.visibleByDefault, fe = t.width;
|
|
765
|
+
return f().createElement(Pe, { beforeLoad: o, className: s, delayMethod: u, delayTime: l, height: d, placeholder: m, scrollPosition: g, style: h, threshold: R, useIntersectionObserver: T, visibleByDefault: k, width: fe }, this.getImg());
|
|
766
|
+
} }, { key: "getWrappedLazyLoadImage", value: function(t) {
|
|
767
|
+
var o = this.props, s = o.effect, u = o.height, l = o.placeholderSrc, d = o.width, m = o.wrapperClassName, g = o.wrapperProps, h = this.state.loaded, R = h ? " lazy-load-image-loaded" : "", T = h || !l ? {} : { backgroundImage: "url(".concat(l, ")"), backgroundSize: "100% 100%" };
|
|
768
|
+
return f().createElement("span", ve({ className: m + " lazy-load-image-background " + s + R, style: Se(Se({}, T), {}, { color: "transparent", display: "inline-block", height: u, width: d }) }, g), t);
|
|
769
|
+
} }, { key: "render", value: function() {
|
|
770
|
+
var t = this.props, o = t.effect, s = t.placeholderSrc, u = t.visibleByDefault, l = t.wrapperClassName, d = t.wrapperProps, m = this.getLazyLoadImage();
|
|
771
|
+
return (o || s) && !u || l || d ? this.getWrappedLazyLoadImage(m) : m;
|
|
772
|
+
} }]) && ke(e.prototype, i), b;
|
|
773
|
+
}(f().Component);
|
|
774
|
+
ge.propTypes = { afterLoad: c.PropTypes.func, beforeLoad: c.PropTypes.func, delayMethod: c.PropTypes.string, delayTime: c.PropTypes.number, effect: c.PropTypes.string, placeholderSrc: c.PropTypes.string, threshold: c.PropTypes.number, useIntersectionObserver: c.PropTypes.bool, visibleByDefault: c.PropTypes.bool, wrapperClassName: c.PropTypes.string, wrapperProps: c.PropTypes.object }, ge.defaultProps = { afterLoad: function() {
|
|
775
|
+
return {};
|
|
776
|
+
}, beforeLoad: function() {
|
|
777
|
+
return {};
|
|
778
|
+
}, delayMethod: "throttle", delayTime: 300, effect: "", placeholderSrc: null, threshold: 100, useIntersectionObserver: !0, visibleByDefault: !1, wrapperClassName: "" };
|
|
779
|
+
const Ne = ge;
|
|
780
|
+
})(), Be.exports = de;
|
|
781
|
+
})();
|
|
782
|
+
export {
|
|
783
|
+
Be as b
|
|
784
|
+
};
|