@m4l/components 0.0.13 → 0.0.14
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/dist/commonjs.js +1 -1
- package/dist/components/CompanyLogo/index.d.ts +3 -0
- package/dist/components/CompanyLogo/index.js +83 -0
- package/dist/components/CompanyLogo/styles.d.ts +5 -0
- package/dist/components/CompanyLogo/types.d.ts +6 -0
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/Image/index.d.ts +3 -0
- package/dist/components/Image/index.js +115 -0
- package/dist/components/Image/styles.d.ts +5 -0
- package/dist/components/Image/types.d.ts +19 -0
- package/dist/components/LanguagePopover/index.d.ts +3 -0
- package/dist/components/LanguagePopover/index.js +7 -0
- package/dist/components/LanguagePopover/types.d.ts +3 -0
- package/dist/components/Loadable/index.d.ts +2 -0
- package/dist/components/Loadable/index.js +13 -0
- package/dist/components/ModalDialog/index.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/mui_extended/LinkWithRoute/index.d.ts +3 -0
- package/dist/components/mui_extended/LinkWithRoute/index.js +30 -0
- package/dist/components/mui_extended/LinkWithRoute/types.d.ts +11 -0
- package/dist/components/mui_extended/MenuActions/styles.d.ts +2 -2
- package/dist/components/mui_extended/Typography/index.d.ts +3 -0
- package/dist/components/mui_extended/Typography/index.js +21 -0
- package/dist/components/mui_extended/Typography/types.d.ts +9 -0
- package/dist/components/mui_extended/index.d.ts +3 -1
- package/dist/index.js +39 -34
- package/dist/react-lazy-load-image-component.js +769 -0
- package/dist/style.css +1 -0
- package/package.json +9 -1
- package/dist/hooks/useResponsive.d.ts +0 -8
- package/dist/vendor.js +0 -70
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
import require$$0 from "react";
|
|
2
|
+
import require$$2 from "react-dom";
|
|
3
|
+
var build = { exports: {} };
|
|
4
|
+
(() => {
|
|
5
|
+
var e = { 296: (e2, t2, r2) => {
|
|
6
|
+
var o2 = /^\s+|\s+$/g, n = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, s = /^0o[0-7]+$/i, c = parseInt, u = typeof r2.g == "object" && r2.g && r2.g.Object === Object && r2.g, l = typeof self == "object" && self && self.Object === Object && self, a = u || l || Function("return this")(), f = Object.prototype.toString, p = Math.max, y = Math.min, d = function() {
|
|
7
|
+
return a.Date.now();
|
|
8
|
+
};
|
|
9
|
+
function b(e3) {
|
|
10
|
+
var t3 = typeof e3;
|
|
11
|
+
return !!e3 && (t3 == "object" || t3 == "function");
|
|
12
|
+
}
|
|
13
|
+
function h(e3) {
|
|
14
|
+
if (typeof e3 == "number")
|
|
15
|
+
return e3;
|
|
16
|
+
if (function(e4) {
|
|
17
|
+
return typeof e4 == "symbol" || function(e5) {
|
|
18
|
+
return !!e5 && typeof e5 == "object";
|
|
19
|
+
}(e4) && f.call(e4) == "[object Symbol]";
|
|
20
|
+
}(e3))
|
|
21
|
+
return NaN;
|
|
22
|
+
if (b(e3)) {
|
|
23
|
+
var t3 = typeof e3.valueOf == "function" ? e3.valueOf() : e3;
|
|
24
|
+
e3 = b(t3) ? t3 + "" : t3;
|
|
25
|
+
}
|
|
26
|
+
if (typeof e3 != "string")
|
|
27
|
+
return e3 === 0 ? e3 : +e3;
|
|
28
|
+
e3 = e3.replace(o2, "");
|
|
29
|
+
var r3 = i.test(e3);
|
|
30
|
+
return r3 || s.test(e3) ? c(e3.slice(2), r3 ? 2 : 8) : n.test(e3) ? NaN : +e3;
|
|
31
|
+
}
|
|
32
|
+
e2.exports = function(e3, t3, r3) {
|
|
33
|
+
var o3, n2, i2, s2, c2, u2, l2 = 0, a2 = false, f2 = false, v = true;
|
|
34
|
+
if (typeof e3 != "function")
|
|
35
|
+
throw new TypeError("Expected a function");
|
|
36
|
+
function m(t4) {
|
|
37
|
+
var r4 = o3, i3 = n2;
|
|
38
|
+
return o3 = n2 = void 0, l2 = t4, s2 = e3.apply(i3, r4);
|
|
39
|
+
}
|
|
40
|
+
function O(e4) {
|
|
41
|
+
return l2 = e4, c2 = setTimeout(g, t3), a2 ? m(e4) : s2;
|
|
42
|
+
}
|
|
43
|
+
function w(e4) {
|
|
44
|
+
var r4 = e4 - u2;
|
|
45
|
+
return u2 === void 0 || r4 >= t3 || r4 < 0 || f2 && e4 - l2 >= i2;
|
|
46
|
+
}
|
|
47
|
+
function g() {
|
|
48
|
+
var e4 = d();
|
|
49
|
+
if (w(e4))
|
|
50
|
+
return P(e4);
|
|
51
|
+
c2 = setTimeout(g, function(e5) {
|
|
52
|
+
var r4 = t3 - (e5 - u2);
|
|
53
|
+
return f2 ? y(r4, i2 - (e5 - l2)) : r4;
|
|
54
|
+
}(e4));
|
|
55
|
+
}
|
|
56
|
+
function P(e4) {
|
|
57
|
+
return c2 = void 0, v && o3 ? m(e4) : (o3 = n2 = void 0, s2);
|
|
58
|
+
}
|
|
59
|
+
function T() {
|
|
60
|
+
var e4 = d(), r4 = w(e4);
|
|
61
|
+
if (o3 = arguments, n2 = this, u2 = e4, r4) {
|
|
62
|
+
if (c2 === void 0)
|
|
63
|
+
return O(u2);
|
|
64
|
+
if (f2)
|
|
65
|
+
return c2 = setTimeout(g, t3), m(u2);
|
|
66
|
+
}
|
|
67
|
+
return c2 === void 0 && (c2 = setTimeout(g, t3)), s2;
|
|
68
|
+
}
|
|
69
|
+
return t3 = h(t3) || 0, b(r3) && (a2 = !!r3.leading, i2 = (f2 = "maxWait" in r3) ? p(h(r3.maxWait) || 0, t3) : i2, v = "trailing" in r3 ? !!r3.trailing : v), T.cancel = function() {
|
|
70
|
+
c2 !== void 0 && clearTimeout(c2), l2 = 0, o3 = u2 = n2 = c2 = void 0;
|
|
71
|
+
}, T.flush = function() {
|
|
72
|
+
return c2 === void 0 ? s2 : P(d());
|
|
73
|
+
}, T;
|
|
74
|
+
};
|
|
75
|
+
}, 96: (e2, t2, r2) => {
|
|
76
|
+
var o2 = "Expected a function", n = /^\s+|\s+$/g, i = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, u = parseInt, l = typeof r2.g == "object" && r2.g && r2.g.Object === Object && r2.g, a = typeof self == "object" && self && self.Object === Object && self, f = l || a || Function("return this")(), p = Object.prototype.toString, y = Math.max, d = Math.min, b = function() {
|
|
77
|
+
return f.Date.now();
|
|
78
|
+
};
|
|
79
|
+
function h(e3) {
|
|
80
|
+
var t3 = typeof e3;
|
|
81
|
+
return !!e3 && (t3 == "object" || t3 == "function");
|
|
82
|
+
}
|
|
83
|
+
function v(e3) {
|
|
84
|
+
if (typeof e3 == "number")
|
|
85
|
+
return e3;
|
|
86
|
+
if (function(e4) {
|
|
87
|
+
return typeof e4 == "symbol" || function(e5) {
|
|
88
|
+
return !!e5 && typeof e5 == "object";
|
|
89
|
+
}(e4) && p.call(e4) == "[object Symbol]";
|
|
90
|
+
}(e3))
|
|
91
|
+
return NaN;
|
|
92
|
+
if (h(e3)) {
|
|
93
|
+
var t3 = typeof e3.valueOf == "function" ? e3.valueOf() : e3;
|
|
94
|
+
e3 = h(t3) ? t3 + "" : t3;
|
|
95
|
+
}
|
|
96
|
+
if (typeof e3 != "string")
|
|
97
|
+
return e3 === 0 ? e3 : +e3;
|
|
98
|
+
e3 = e3.replace(n, "");
|
|
99
|
+
var r3 = s.test(e3);
|
|
100
|
+
return r3 || c.test(e3) ? u(e3.slice(2), r3 ? 2 : 8) : i.test(e3) ? NaN : +e3;
|
|
101
|
+
}
|
|
102
|
+
e2.exports = function(e3, t3, r3) {
|
|
103
|
+
var n2 = true, i2 = true;
|
|
104
|
+
if (typeof e3 != "function")
|
|
105
|
+
throw new TypeError(o2);
|
|
106
|
+
return h(r3) && (n2 = "leading" in r3 ? !!r3.leading : n2, i2 = "trailing" in r3 ? !!r3.trailing : i2), function(e4, t4, r4) {
|
|
107
|
+
var n3, i3, s2, c2, u2, l2, a2 = 0, f2 = false, p2 = false, m = true;
|
|
108
|
+
if (typeof e4 != "function")
|
|
109
|
+
throw new TypeError(o2);
|
|
110
|
+
function O(t5) {
|
|
111
|
+
var r5 = n3, o3 = i3;
|
|
112
|
+
return n3 = i3 = void 0, a2 = t5, c2 = e4.apply(o3, r5);
|
|
113
|
+
}
|
|
114
|
+
function w(e5) {
|
|
115
|
+
return a2 = e5, u2 = setTimeout(P, t4), f2 ? O(e5) : c2;
|
|
116
|
+
}
|
|
117
|
+
function g(e5) {
|
|
118
|
+
var r5 = e5 - l2;
|
|
119
|
+
return l2 === void 0 || r5 >= t4 || r5 < 0 || p2 && e5 - a2 >= s2;
|
|
120
|
+
}
|
|
121
|
+
function P() {
|
|
122
|
+
var e5 = b();
|
|
123
|
+
if (g(e5))
|
|
124
|
+
return T(e5);
|
|
125
|
+
u2 = setTimeout(P, function(e6) {
|
|
126
|
+
var r5 = t4 - (e6 - l2);
|
|
127
|
+
return p2 ? d(r5, s2 - (e6 - a2)) : r5;
|
|
128
|
+
}(e5));
|
|
129
|
+
}
|
|
130
|
+
function T(e5) {
|
|
131
|
+
return u2 = void 0, m && n3 ? O(e5) : (n3 = i3 = void 0, c2);
|
|
132
|
+
}
|
|
133
|
+
function j() {
|
|
134
|
+
var e5 = b(), r5 = g(e5);
|
|
135
|
+
if (n3 = arguments, i3 = this, l2 = e5, r5) {
|
|
136
|
+
if (u2 === void 0)
|
|
137
|
+
return w(l2);
|
|
138
|
+
if (p2)
|
|
139
|
+
return u2 = setTimeout(P, t4), O(l2);
|
|
140
|
+
}
|
|
141
|
+
return u2 === void 0 && (u2 = setTimeout(P, t4)), c2;
|
|
142
|
+
}
|
|
143
|
+
return t4 = v(t4) || 0, h(r4) && (f2 = !!r4.leading, s2 = (p2 = "maxWait" in r4) ? y(v(r4.maxWait) || 0, t4) : s2, m = "trailing" in r4 ? !!r4.trailing : m), j.cancel = function() {
|
|
144
|
+
u2 !== void 0 && clearTimeout(u2), a2 = 0, n3 = l2 = i3 = u2 = void 0;
|
|
145
|
+
}, j.flush = function() {
|
|
146
|
+
return u2 === void 0 ? c2 : T(b());
|
|
147
|
+
}, j;
|
|
148
|
+
}(e3, t3, { leading: n2, maxWait: t3, trailing: i2 });
|
|
149
|
+
};
|
|
150
|
+
}, 703: (e2, t2, r2) => {
|
|
151
|
+
var o2 = r2(414);
|
|
152
|
+
function n() {
|
|
153
|
+
}
|
|
154
|
+
function i() {
|
|
155
|
+
}
|
|
156
|
+
i.resetWarningCache = n, e2.exports = function() {
|
|
157
|
+
function e3(e4, t4, r4, n2, i2, s) {
|
|
158
|
+
if (s !== o2) {
|
|
159
|
+
var c = 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 c.name = "Invariant Violation", c;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function t3() {
|
|
164
|
+
return e3;
|
|
165
|
+
}
|
|
166
|
+
e3.isRequired = e3;
|
|
167
|
+
var r3 = { array: e3, bool: e3, func: e3, number: e3, object: e3, string: e3, symbol: e3, any: e3, arrayOf: t3, element: e3, elementType: e3, instanceOf: t3, node: e3, objectOf: t3, oneOf: t3, oneOfType: t3, shape: t3, exact: t3, checkPropTypes: i, resetWarningCache: n };
|
|
168
|
+
return r3.PropTypes = r3, r3;
|
|
169
|
+
};
|
|
170
|
+
}, 697: (e2, t2, r2) => {
|
|
171
|
+
e2.exports = r2(703)();
|
|
172
|
+
}, 414: (e2) => {
|
|
173
|
+
e2.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
174
|
+
} }, t = {};
|
|
175
|
+
function r(o2) {
|
|
176
|
+
var n = t[o2];
|
|
177
|
+
if (n !== void 0)
|
|
178
|
+
return n.exports;
|
|
179
|
+
var i = t[o2] = { exports: {} };
|
|
180
|
+
return e[o2](i, i.exports, r), i.exports;
|
|
181
|
+
}
|
|
182
|
+
r.n = (e2) => {
|
|
183
|
+
var t2 = e2 && e2.__esModule ? () => e2.default : () => e2;
|
|
184
|
+
return r.d(t2, { a: t2 }), t2;
|
|
185
|
+
}, r.d = (e2, t2) => {
|
|
186
|
+
for (var o2 in t2)
|
|
187
|
+
r.o(t2, o2) && !r.o(e2, o2) && Object.defineProperty(e2, o2, { enumerable: true, get: t2[o2] });
|
|
188
|
+
}, r.g = function() {
|
|
189
|
+
if (typeof globalThis == "object")
|
|
190
|
+
return globalThis;
|
|
191
|
+
try {
|
|
192
|
+
return this || new Function("return this")();
|
|
193
|
+
} catch (e2) {
|
|
194
|
+
if (typeof window == "object")
|
|
195
|
+
return window;
|
|
196
|
+
}
|
|
197
|
+
}(), r.o = (e2, t2) => Object.prototype.hasOwnProperty.call(e2, t2), r.r = (e2) => {
|
|
198
|
+
typeof Symbol != "undefined" && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true });
|
|
199
|
+
};
|
|
200
|
+
var o = {};
|
|
201
|
+
(() => {
|
|
202
|
+
r.r(o), r.d(o, { LazyLoadComponent: () => J, LazyLoadImage: () => ie, trackWindowScroll: () => C });
|
|
203
|
+
const e2 = require$$0;
|
|
204
|
+
var t2 = r.n(e2), n = r(697);
|
|
205
|
+
const i = require$$2;
|
|
206
|
+
var s = r.n(i);
|
|
207
|
+
function c() {
|
|
208
|
+
return typeof window != "undefined" && "IntersectionObserver" in window && "isIntersecting" in window.IntersectionObserverEntry.prototype;
|
|
209
|
+
}
|
|
210
|
+
function u(e3) {
|
|
211
|
+
return (u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
|
|
212
|
+
return typeof e4;
|
|
213
|
+
} : function(e4) {
|
|
214
|
+
return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
215
|
+
})(e3);
|
|
216
|
+
}
|
|
217
|
+
function l(e3, t3) {
|
|
218
|
+
var r2 = Object.keys(e3);
|
|
219
|
+
if (Object.getOwnPropertySymbols) {
|
|
220
|
+
var o2 = Object.getOwnPropertySymbols(e3);
|
|
221
|
+
t3 && (o2 = o2.filter(function(t4) {
|
|
222
|
+
return Object.getOwnPropertyDescriptor(e3, t4).enumerable;
|
|
223
|
+
})), r2.push.apply(r2, o2);
|
|
224
|
+
}
|
|
225
|
+
return r2;
|
|
226
|
+
}
|
|
227
|
+
function a(e3, t3, r2) {
|
|
228
|
+
return t3 in e3 ? Object.defineProperty(e3, t3, { value: r2, enumerable: true, configurable: true, writable: true }) : e3[t3] = r2, e3;
|
|
229
|
+
}
|
|
230
|
+
function f(e3, t3) {
|
|
231
|
+
for (var r2 = 0; r2 < t3.length; r2++) {
|
|
232
|
+
var o2 = t3[r2];
|
|
233
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, o2.key, o2);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function p(e3, t3) {
|
|
237
|
+
return (p = Object.setPrototypeOf || function(e4, t4) {
|
|
238
|
+
return e4.__proto__ = t4, e4;
|
|
239
|
+
})(e3, t3);
|
|
240
|
+
}
|
|
241
|
+
function y(e3, t3) {
|
|
242
|
+
if (t3 && (u(t3) === "object" || typeof t3 == "function"))
|
|
243
|
+
return t3;
|
|
244
|
+
if (t3 !== void 0)
|
|
245
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
246
|
+
return function(e4) {
|
|
247
|
+
if (e4 === void 0)
|
|
248
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
249
|
+
return e4;
|
|
250
|
+
}(e3);
|
|
251
|
+
}
|
|
252
|
+
function d(e3) {
|
|
253
|
+
return (d = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
|
|
254
|
+
return e4.__proto__ || Object.getPrototypeOf(e4);
|
|
255
|
+
})(e3);
|
|
256
|
+
}
|
|
257
|
+
var b = function(e3) {
|
|
258
|
+
e3.forEach(function(e4) {
|
|
259
|
+
e4.isIntersecting && e4.target.onVisible();
|
|
260
|
+
});
|
|
261
|
+
}, h = {}, v = function(e3) {
|
|
262
|
+
!function(e4, t3) {
|
|
263
|
+
if (typeof t3 != "function" && t3 !== null)
|
|
264
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
265
|
+
e4.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e4, writable: true, configurable: true } }), t3 && p(e4, t3);
|
|
266
|
+
}(v2, e3);
|
|
267
|
+
var r2, o2, n2, i2, u2 = (n2 = v2, i2 = function() {
|
|
268
|
+
if (typeof Reflect == "undefined" || !Reflect.construct)
|
|
269
|
+
return false;
|
|
270
|
+
if (Reflect.construct.sham)
|
|
271
|
+
return false;
|
|
272
|
+
if (typeof Proxy == "function")
|
|
273
|
+
return true;
|
|
274
|
+
try {
|
|
275
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
276
|
+
})), true;
|
|
277
|
+
} catch (e4) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
}(), function() {
|
|
281
|
+
var e4, t3 = d(n2);
|
|
282
|
+
if (i2) {
|
|
283
|
+
var r3 = d(this).constructor;
|
|
284
|
+
e4 = Reflect.construct(t3, arguments, r3);
|
|
285
|
+
} else
|
|
286
|
+
e4 = t3.apply(this, arguments);
|
|
287
|
+
return y(this, e4);
|
|
288
|
+
});
|
|
289
|
+
function v2(e4) {
|
|
290
|
+
var t3;
|
|
291
|
+
if (function(e5, t4) {
|
|
292
|
+
if (!(e5 instanceof t4))
|
|
293
|
+
throw new TypeError("Cannot call a class as a function");
|
|
294
|
+
}(this, v2), (t3 = u2.call(this, e4)).supportsObserver = !e4.scrollPosition && e4.useIntersectionObserver && c(), t3.supportsObserver) {
|
|
295
|
+
var r3 = e4.threshold;
|
|
296
|
+
t3.observer = function(e5) {
|
|
297
|
+
return h[e5] = h[e5] || new IntersectionObserver(b, { rootMargin: e5 + "px" }), h[e5];
|
|
298
|
+
}(r3);
|
|
299
|
+
}
|
|
300
|
+
return t3;
|
|
301
|
+
}
|
|
302
|
+
return r2 = v2, (o2 = [{ key: "componentDidMount", value: function() {
|
|
303
|
+
this.placeholder && this.observer && (this.placeholder.onVisible = this.props.onVisible, this.observer.observe(this.placeholder)), this.supportsObserver || this.updateVisibility();
|
|
304
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
305
|
+
this.observer && this.observer.unobserve(this.placeholder);
|
|
306
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
307
|
+
this.supportsObserver || this.updateVisibility();
|
|
308
|
+
} }, { key: "getPlaceholderBoundingBox", value: function() {
|
|
309
|
+
var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props.scrollPosition, t3 = this.placeholder.getBoundingClientRect(), r3 = s().findDOMNode(this.placeholder).style, o3 = { left: parseInt(r3.getPropertyValue("margin-left"), 10) || 0, top: parseInt(r3.getPropertyValue("margin-top"), 10) || 0 };
|
|
310
|
+
return { bottom: e4.y + t3.bottom + o3.top, left: e4.x + t3.left + o3.left, right: e4.x + t3.right + o3.left, top: e4.y + t3.top + o3.top };
|
|
311
|
+
} }, { key: "isPlaceholderInViewport", value: function() {
|
|
312
|
+
if (typeof window == "undefined" || !this.placeholder)
|
|
313
|
+
return false;
|
|
314
|
+
var e4 = this.props, t3 = e4.scrollPosition, r3 = e4.threshold, o3 = this.getPlaceholderBoundingBox(t3), n3 = t3.y + window.innerHeight, i3 = t3.x, s2 = t3.x + window.innerWidth, c2 = t3.y;
|
|
315
|
+
return Boolean(c2 - r3 <= o3.bottom && n3 + r3 >= o3.top && i3 - r3 <= o3.right && s2 + r3 >= o3.left);
|
|
316
|
+
} }, { key: "updateVisibility", value: function() {
|
|
317
|
+
this.isPlaceholderInViewport() && this.props.onVisible();
|
|
318
|
+
} }, { key: "render", value: function() {
|
|
319
|
+
var e4 = this, r3 = this.props, o3 = r3.className, n3 = r3.height, i3 = r3.placeholder, s2 = r3.style, c2 = r3.width;
|
|
320
|
+
if (i3 && typeof i3.type != "function")
|
|
321
|
+
return t2().cloneElement(i3, { ref: function(t3) {
|
|
322
|
+
return e4.placeholder = t3;
|
|
323
|
+
} });
|
|
324
|
+
var u3 = function(e5) {
|
|
325
|
+
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
326
|
+
var r4 = arguments[t3] != null ? arguments[t3] : {};
|
|
327
|
+
t3 % 2 ? l(Object(r4), true).forEach(function(t4) {
|
|
328
|
+
a(e5, t4, r4[t4]);
|
|
329
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(r4)) : l(Object(r4)).forEach(function(t4) {
|
|
330
|
+
Object.defineProperty(e5, t4, Object.getOwnPropertyDescriptor(r4, t4));
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
return e5;
|
|
334
|
+
}({ display: "inline-block" }, s2);
|
|
335
|
+
return c2 !== void 0 && (u3.width = c2), n3 !== void 0 && (u3.height = n3), t2().createElement("span", { className: o3, ref: function(t3) {
|
|
336
|
+
return e4.placeholder = t3;
|
|
337
|
+
}, style: u3 }, i3);
|
|
338
|
+
} }]) && f(r2.prototype, o2), v2;
|
|
339
|
+
}(t2().Component);
|
|
340
|
+
v.propTypes = { onVisible: n.PropTypes.func.isRequired, className: n.PropTypes.string, height: n.PropTypes.oneOfType([n.PropTypes.number, n.PropTypes.string]), placeholder: n.PropTypes.element, threshold: n.PropTypes.number, useIntersectionObserver: n.PropTypes.bool, scrollPosition: n.PropTypes.shape({ x: n.PropTypes.number.isRequired, y: n.PropTypes.number.isRequired }), width: n.PropTypes.oneOfType([n.PropTypes.number, n.PropTypes.string]) }, v.defaultProps = { className: "", placeholder: null, threshold: 100, useIntersectionObserver: true };
|
|
341
|
+
const m = v;
|
|
342
|
+
var O = r(296), w = r.n(O), g = r(96), P = r.n(g), T = function(e3) {
|
|
343
|
+
var t3 = getComputedStyle(e3, null);
|
|
344
|
+
return t3.getPropertyValue("overflow") + t3.getPropertyValue("overflow-y") + t3.getPropertyValue("overflow-x");
|
|
345
|
+
};
|
|
346
|
+
const j = function(e3) {
|
|
347
|
+
if (!(e3 instanceof HTMLElement))
|
|
348
|
+
return window;
|
|
349
|
+
for (var t3 = e3; t3 && t3 instanceof HTMLElement; ) {
|
|
350
|
+
if (/(scroll|auto)/.test(T(t3)))
|
|
351
|
+
return t3;
|
|
352
|
+
t3 = t3.parentNode;
|
|
353
|
+
}
|
|
354
|
+
return window;
|
|
355
|
+
};
|
|
356
|
+
function S(e3) {
|
|
357
|
+
return (S = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
|
|
358
|
+
return typeof e4;
|
|
359
|
+
} : function(e4) {
|
|
360
|
+
return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
361
|
+
})(e3);
|
|
362
|
+
}
|
|
363
|
+
var E = ["delayMethod", "delayTime"];
|
|
364
|
+
function _() {
|
|
365
|
+
return (_ = Object.assign || function(e3) {
|
|
366
|
+
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
367
|
+
var r2 = arguments[t3];
|
|
368
|
+
for (var o2 in r2)
|
|
369
|
+
Object.prototype.hasOwnProperty.call(r2, o2) && (e3[o2] = r2[o2]);
|
|
370
|
+
}
|
|
371
|
+
return e3;
|
|
372
|
+
}).apply(this, arguments);
|
|
373
|
+
}
|
|
374
|
+
function I(e3, t3) {
|
|
375
|
+
for (var r2 = 0; r2 < t3.length; r2++) {
|
|
376
|
+
var o2 = t3[r2];
|
|
377
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, o2.key, o2);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function L(e3, t3) {
|
|
381
|
+
return (L = Object.setPrototypeOf || function(e4, t4) {
|
|
382
|
+
return e4.__proto__ = t4, e4;
|
|
383
|
+
})(e3, t3);
|
|
384
|
+
}
|
|
385
|
+
function x(e3, t3) {
|
|
386
|
+
if (t3 && (S(t3) === "object" || typeof t3 == "function"))
|
|
387
|
+
return t3;
|
|
388
|
+
if (t3 !== void 0)
|
|
389
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
390
|
+
return R(e3);
|
|
391
|
+
}
|
|
392
|
+
function R(e3) {
|
|
393
|
+
if (e3 === void 0)
|
|
394
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
395
|
+
return e3;
|
|
396
|
+
}
|
|
397
|
+
function k(e3) {
|
|
398
|
+
return (k = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
|
|
399
|
+
return e4.__proto__ || Object.getPrototypeOf(e4);
|
|
400
|
+
})(e3);
|
|
401
|
+
}
|
|
402
|
+
var D = function() {
|
|
403
|
+
return typeof window == "undefined" ? 0 : window.scrollX || window.pageXOffset;
|
|
404
|
+
}, N = function() {
|
|
405
|
+
return typeof window == "undefined" ? 0 : window.scrollY || window.pageYOffset;
|
|
406
|
+
};
|
|
407
|
+
const C = function(e3) {
|
|
408
|
+
var r2 = function(r3) {
|
|
409
|
+
!function(e4, t3) {
|
|
410
|
+
if (typeof t3 != "function" && t3 !== null)
|
|
411
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
412
|
+
e4.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e4, writable: true, configurable: true } }), t3 && L(e4, t3);
|
|
413
|
+
}(a2, r3);
|
|
414
|
+
var o2, n2, i2, u2, l2 = (i2 = a2, u2 = function() {
|
|
415
|
+
if (typeof Reflect == "undefined" || !Reflect.construct)
|
|
416
|
+
return false;
|
|
417
|
+
if (Reflect.construct.sham)
|
|
418
|
+
return false;
|
|
419
|
+
if (typeof Proxy == "function")
|
|
420
|
+
return true;
|
|
421
|
+
try {
|
|
422
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
423
|
+
})), true;
|
|
424
|
+
} catch (e4) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
}(), function() {
|
|
428
|
+
var e4, t3 = k(i2);
|
|
429
|
+
if (u2) {
|
|
430
|
+
var r4 = k(this).constructor;
|
|
431
|
+
e4 = Reflect.construct(t3, arguments, r4);
|
|
432
|
+
} else
|
|
433
|
+
e4 = t3.apply(this, arguments);
|
|
434
|
+
return x(this, e4);
|
|
435
|
+
});
|
|
436
|
+
function a2(e4) {
|
|
437
|
+
var r4;
|
|
438
|
+
if (function(e5, t3) {
|
|
439
|
+
if (!(e5 instanceof t3))
|
|
440
|
+
throw new TypeError("Cannot call a class as a function");
|
|
441
|
+
}(this, a2), (r4 = l2.call(this, e4)).useIntersectionObserver = e4.useIntersectionObserver && c(), r4.useIntersectionObserver)
|
|
442
|
+
return x(r4);
|
|
443
|
+
var o3 = r4.onChangeScroll.bind(R(r4));
|
|
444
|
+
return e4.delayMethod === "debounce" ? r4.delayedScroll = w()(o3, e4.delayTime) : e4.delayMethod === "throttle" && (r4.delayedScroll = P()(o3, e4.delayTime)), r4.state = { scrollPosition: { x: D(), y: N() } }, r4.baseComponentRef = t2().createRef(), r4;
|
|
445
|
+
}
|
|
446
|
+
return o2 = a2, (n2 = [{ key: "componentDidMount", value: function() {
|
|
447
|
+
this.addListeners();
|
|
448
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
449
|
+
this.removeListeners();
|
|
450
|
+
} }, { key: "componentDidUpdate", value: function() {
|
|
451
|
+
typeof window == "undefined" || this.useIntersectionObserver || j(s().findDOMNode(this.baseComponentRef.current)) !== this.scrollElement && (this.removeListeners(), this.addListeners());
|
|
452
|
+
} }, { key: "addListeners", value: function() {
|
|
453
|
+
typeof window == "undefined" || this.useIntersectionObserver || (this.scrollElement = j(s().findDOMNode(this.baseComponentRef.current)), this.scrollElement.addEventListener("scroll", this.delayedScroll, { passive: true }), window.addEventListener("resize", this.delayedScroll, { passive: true }), this.scrollElement !== window && window.addEventListener("scroll", this.delayedScroll, { passive: true }));
|
|
454
|
+
} }, { key: "removeListeners", value: function() {
|
|
455
|
+
typeof window == "undefined" || this.useIntersectionObserver || (this.scrollElement.removeEventListener("scroll", this.delayedScroll), window.removeEventListener("resize", this.delayedScroll), this.scrollElement !== window && window.removeEventListener("scroll", this.delayedScroll));
|
|
456
|
+
} }, { key: "onChangeScroll", value: function() {
|
|
457
|
+
this.useIntersectionObserver || this.setState({ scrollPosition: { x: D(), y: N() } });
|
|
458
|
+
} }, { key: "render", value: function() {
|
|
459
|
+
var r4 = this.props, o3 = (r4.delayMethod, r4.delayTime, function(e4, t3) {
|
|
460
|
+
if (e4 == null)
|
|
461
|
+
return {};
|
|
462
|
+
var r5, o4, n4 = function(e5, t4) {
|
|
463
|
+
if (e5 == null)
|
|
464
|
+
return {};
|
|
465
|
+
var r6, o5, n5 = {}, i4 = Object.keys(e5);
|
|
466
|
+
for (o5 = 0; o5 < i4.length; o5++)
|
|
467
|
+
r6 = i4[o5], t4.indexOf(r6) >= 0 || (n5[r6] = e5[r6]);
|
|
468
|
+
return n5;
|
|
469
|
+
}(e4, t3);
|
|
470
|
+
if (Object.getOwnPropertySymbols) {
|
|
471
|
+
var i3 = Object.getOwnPropertySymbols(e4);
|
|
472
|
+
for (o4 = 0; o4 < i3.length; o4++)
|
|
473
|
+
r5 = i3[o4], t3.indexOf(r5) >= 0 || Object.prototype.propertyIsEnumerable.call(e4, r5) && (n4[r5] = e4[r5]);
|
|
474
|
+
}
|
|
475
|
+
return n4;
|
|
476
|
+
}(r4, E)), n3 = this.useIntersectionObserver ? null : this.state.scrollPosition;
|
|
477
|
+
return t2().createElement(e3, _({ forwardRef: this.baseComponentRef, scrollPosition: n3 }, o3));
|
|
478
|
+
} }]) && I(o2.prototype, n2), a2;
|
|
479
|
+
}(t2().Component);
|
|
480
|
+
return r2.propTypes = { delayMethod: n.PropTypes.oneOf(["debounce", "throttle"]), delayTime: n.PropTypes.number, useIntersectionObserver: n.PropTypes.bool }, r2.defaultProps = { delayMethod: "throttle", delayTime: 300, useIntersectionObserver: true }, r2;
|
|
481
|
+
};
|
|
482
|
+
function M(e3) {
|
|
483
|
+
return (M = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
|
|
484
|
+
return typeof e4;
|
|
485
|
+
} : function(e4) {
|
|
486
|
+
return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
487
|
+
})(e3);
|
|
488
|
+
}
|
|
489
|
+
function B(e3, t3) {
|
|
490
|
+
for (var r2 = 0; r2 < t3.length; r2++) {
|
|
491
|
+
var o2 = t3[r2];
|
|
492
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, o2.key, o2);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function V(e3, t3) {
|
|
496
|
+
return (V = Object.setPrototypeOf || function(e4, t4) {
|
|
497
|
+
return e4.__proto__ = t4, e4;
|
|
498
|
+
})(e3, t3);
|
|
499
|
+
}
|
|
500
|
+
function W(e3, t3) {
|
|
501
|
+
if (t3 && (M(t3) === "object" || typeof t3 == "function"))
|
|
502
|
+
return t3;
|
|
503
|
+
if (t3 !== void 0)
|
|
504
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
505
|
+
return function(e4) {
|
|
506
|
+
if (e4 === void 0)
|
|
507
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
508
|
+
return e4;
|
|
509
|
+
}(e3);
|
|
510
|
+
}
|
|
511
|
+
function z(e3) {
|
|
512
|
+
return (z = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
|
|
513
|
+
return e4.__proto__ || Object.getPrototypeOf(e4);
|
|
514
|
+
})(e3);
|
|
515
|
+
}
|
|
516
|
+
var $ = function(e3) {
|
|
517
|
+
!function(e4, t3) {
|
|
518
|
+
if (typeof t3 != "function" && t3 !== null)
|
|
519
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
520
|
+
e4.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e4, writable: true, configurable: true } }), t3 && V(e4, t3);
|
|
521
|
+
}(c2, e3);
|
|
522
|
+
var r2, o2, n2, i2, s2 = (n2 = c2, i2 = function() {
|
|
523
|
+
if (typeof Reflect == "undefined" || !Reflect.construct)
|
|
524
|
+
return false;
|
|
525
|
+
if (Reflect.construct.sham)
|
|
526
|
+
return false;
|
|
527
|
+
if (typeof Proxy == "function")
|
|
528
|
+
return true;
|
|
529
|
+
try {
|
|
530
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
531
|
+
})), true;
|
|
532
|
+
} catch (e4) {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
}(), function() {
|
|
536
|
+
var e4, t3 = z(n2);
|
|
537
|
+
if (i2) {
|
|
538
|
+
var r3 = z(this).constructor;
|
|
539
|
+
e4 = Reflect.construct(t3, arguments, r3);
|
|
540
|
+
} else
|
|
541
|
+
e4 = t3.apply(this, arguments);
|
|
542
|
+
return W(this, e4);
|
|
543
|
+
});
|
|
544
|
+
function c2(e4) {
|
|
545
|
+
return function(e5, t3) {
|
|
546
|
+
if (!(e5 instanceof t3))
|
|
547
|
+
throw new TypeError("Cannot call a class as a function");
|
|
548
|
+
}(this, c2), s2.call(this, e4);
|
|
549
|
+
}
|
|
550
|
+
return r2 = c2, (o2 = [{ key: "render", value: function() {
|
|
551
|
+
return t2().createElement(m, this.props);
|
|
552
|
+
} }]) && B(r2.prototype, o2), c2;
|
|
553
|
+
}(t2().Component);
|
|
554
|
+
const U = C($);
|
|
555
|
+
function q(e3) {
|
|
556
|
+
return (q = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
|
|
557
|
+
return typeof e4;
|
|
558
|
+
} : function(e4) {
|
|
559
|
+
return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
560
|
+
})(e3);
|
|
561
|
+
}
|
|
562
|
+
function F(e3, t3) {
|
|
563
|
+
for (var r2 = 0; r2 < t3.length; r2++) {
|
|
564
|
+
var o2 = t3[r2];
|
|
565
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, o2.key, o2);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
function H(e3, t3) {
|
|
569
|
+
return (H = Object.setPrototypeOf || function(e4, t4) {
|
|
570
|
+
return e4.__proto__ = t4, e4;
|
|
571
|
+
})(e3, t3);
|
|
572
|
+
}
|
|
573
|
+
function Y(e3, t3) {
|
|
574
|
+
if (t3 && (q(t3) === "object" || typeof t3 == "function"))
|
|
575
|
+
return t3;
|
|
576
|
+
if (t3 !== void 0)
|
|
577
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
578
|
+
return X(e3);
|
|
579
|
+
}
|
|
580
|
+
function X(e3) {
|
|
581
|
+
if (e3 === void 0)
|
|
582
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
583
|
+
return e3;
|
|
584
|
+
}
|
|
585
|
+
function A(e3) {
|
|
586
|
+
return (A = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
|
|
587
|
+
return e4.__proto__ || Object.getPrototypeOf(e4);
|
|
588
|
+
})(e3);
|
|
589
|
+
}
|
|
590
|
+
var G = function(e3) {
|
|
591
|
+
!function(e4, t3) {
|
|
592
|
+
if (typeof t3 != "function" && t3 !== null)
|
|
593
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
594
|
+
e4.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e4, writable: true, configurable: true } }), t3 && H(e4, t3);
|
|
595
|
+
}(u2, e3);
|
|
596
|
+
var r2, o2, n2, i2, s2 = (n2 = u2, i2 = function() {
|
|
597
|
+
if (typeof Reflect == "undefined" || !Reflect.construct)
|
|
598
|
+
return false;
|
|
599
|
+
if (Reflect.construct.sham)
|
|
600
|
+
return false;
|
|
601
|
+
if (typeof Proxy == "function")
|
|
602
|
+
return true;
|
|
603
|
+
try {
|
|
604
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
605
|
+
})), true;
|
|
606
|
+
} catch (e4) {
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
}(), function() {
|
|
610
|
+
var e4, t3 = A(n2);
|
|
611
|
+
if (i2) {
|
|
612
|
+
var r3 = A(this).constructor;
|
|
613
|
+
e4 = Reflect.construct(t3, arguments, r3);
|
|
614
|
+
} else
|
|
615
|
+
e4 = t3.apply(this, arguments);
|
|
616
|
+
return Y(this, e4);
|
|
617
|
+
});
|
|
618
|
+
function u2(e4) {
|
|
619
|
+
var t3;
|
|
620
|
+
!function(e5, t4) {
|
|
621
|
+
if (!(e5 instanceof t4))
|
|
622
|
+
throw new TypeError("Cannot call a class as a function");
|
|
623
|
+
}(this, u2), t3 = s2.call(this, e4);
|
|
624
|
+
var r3 = e4.afterLoad, o3 = e4.beforeLoad, n3 = e4.scrollPosition, i3 = e4.visibleByDefault;
|
|
625
|
+
return t3.state = { visible: i3 }, i3 && (o3(), r3()), t3.onVisible = t3.onVisible.bind(X(t3)), t3.isScrollTracked = Boolean(n3 && Number.isFinite(n3.x) && n3.x >= 0 && Number.isFinite(n3.y) && n3.y >= 0), t3;
|
|
626
|
+
}
|
|
627
|
+
return r2 = u2, (o2 = [{ key: "componentDidUpdate", value: function(e4, t3) {
|
|
628
|
+
t3.visible !== this.state.visible && this.props.afterLoad();
|
|
629
|
+
} }, { key: "onVisible", value: function() {
|
|
630
|
+
this.props.beforeLoad(), this.setState({ visible: true });
|
|
631
|
+
} }, { key: "render", value: function() {
|
|
632
|
+
if (this.state.visible)
|
|
633
|
+
return this.props.children;
|
|
634
|
+
var e4 = this.props, r3 = e4.className, o3 = e4.delayMethod, n3 = e4.delayTime, i3 = e4.height, s3 = e4.placeholder, u3 = e4.scrollPosition, l2 = e4.style, a2 = e4.threshold, f2 = e4.useIntersectionObserver, p2 = e4.width;
|
|
635
|
+
return this.isScrollTracked || f2 && c() ? t2().createElement(m, { className: r3, height: i3, onVisible: this.onVisible, placeholder: s3, scrollPosition: u3, style: l2, threshold: a2, useIntersectionObserver: f2, width: p2 }) : t2().createElement(U, { className: r3, delayMethod: o3, delayTime: n3, height: i3, onVisible: this.onVisible, placeholder: s3, style: l2, threshold: a2, width: p2 });
|
|
636
|
+
} }]) && F(r2.prototype, o2), u2;
|
|
637
|
+
}(t2().Component);
|
|
638
|
+
G.propTypes = { afterLoad: n.PropTypes.func, beforeLoad: n.PropTypes.func, useIntersectionObserver: n.PropTypes.bool, visibleByDefault: n.PropTypes.bool }, G.defaultProps = { afterLoad: function() {
|
|
639
|
+
return {};
|
|
640
|
+
}, beforeLoad: function() {
|
|
641
|
+
return {};
|
|
642
|
+
}, useIntersectionObserver: true, visibleByDefault: false };
|
|
643
|
+
const J = G;
|
|
644
|
+
function K(e3) {
|
|
645
|
+
return (K = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
|
|
646
|
+
return typeof e4;
|
|
647
|
+
} : function(e4) {
|
|
648
|
+
return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
649
|
+
})(e3);
|
|
650
|
+
}
|
|
651
|
+
var Q = ["afterLoad", "beforeLoad", "delayMethod", "delayTime", "effect", "placeholder", "placeholderSrc", "scrollPosition", "threshold", "useIntersectionObserver", "visibleByDefault", "wrapperClassName", "wrapperProps"];
|
|
652
|
+
function Z() {
|
|
653
|
+
return (Z = Object.assign || function(e3) {
|
|
654
|
+
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
655
|
+
var r2 = arguments[t3];
|
|
656
|
+
for (var o2 in r2)
|
|
657
|
+
Object.prototype.hasOwnProperty.call(r2, o2) && (e3[o2] = r2[o2]);
|
|
658
|
+
}
|
|
659
|
+
return e3;
|
|
660
|
+
}).apply(this, arguments);
|
|
661
|
+
}
|
|
662
|
+
function ee(e3, t3) {
|
|
663
|
+
for (var r2 = 0; r2 < t3.length; r2++) {
|
|
664
|
+
var o2 = t3[r2];
|
|
665
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, o2.key, o2);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
function te(e3, t3) {
|
|
669
|
+
return (te = Object.setPrototypeOf || function(e4, t4) {
|
|
670
|
+
return e4.__proto__ = t4, e4;
|
|
671
|
+
})(e3, t3);
|
|
672
|
+
}
|
|
673
|
+
function re(e3, t3) {
|
|
674
|
+
if (t3 && (K(t3) === "object" || typeof t3 == "function"))
|
|
675
|
+
return t3;
|
|
676
|
+
if (t3 !== void 0)
|
|
677
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
678
|
+
return function(e4) {
|
|
679
|
+
if (e4 === void 0)
|
|
680
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
681
|
+
return e4;
|
|
682
|
+
}(e3);
|
|
683
|
+
}
|
|
684
|
+
function oe(e3) {
|
|
685
|
+
return (oe = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
|
|
686
|
+
return e4.__proto__ || Object.getPrototypeOf(e4);
|
|
687
|
+
})(e3);
|
|
688
|
+
}
|
|
689
|
+
var ne = function(e3) {
|
|
690
|
+
!function(e4, t3) {
|
|
691
|
+
if (typeof t3 != "function" && t3 !== null)
|
|
692
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
693
|
+
e4.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e4, writable: true, configurable: true } }), t3 && te(e4, t3);
|
|
694
|
+
}(c2, e3);
|
|
695
|
+
var r2, o2, n2, i2, s2 = (n2 = c2, i2 = function() {
|
|
696
|
+
if (typeof Reflect == "undefined" || !Reflect.construct)
|
|
697
|
+
return false;
|
|
698
|
+
if (Reflect.construct.sham)
|
|
699
|
+
return false;
|
|
700
|
+
if (typeof Proxy == "function")
|
|
701
|
+
return true;
|
|
702
|
+
try {
|
|
703
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
704
|
+
})), true;
|
|
705
|
+
} catch (e4) {
|
|
706
|
+
return false;
|
|
707
|
+
}
|
|
708
|
+
}(), function() {
|
|
709
|
+
var e4, t3 = oe(n2);
|
|
710
|
+
if (i2) {
|
|
711
|
+
var r3 = oe(this).constructor;
|
|
712
|
+
e4 = Reflect.construct(t3, arguments, r3);
|
|
713
|
+
} else
|
|
714
|
+
e4 = t3.apply(this, arguments);
|
|
715
|
+
return re(this, e4);
|
|
716
|
+
});
|
|
717
|
+
function c2(e4) {
|
|
718
|
+
var t3;
|
|
719
|
+
return function(e5, t4) {
|
|
720
|
+
if (!(e5 instanceof t4))
|
|
721
|
+
throw new TypeError("Cannot call a class as a function");
|
|
722
|
+
}(this, c2), (t3 = s2.call(this, e4)).state = { loaded: false }, t3;
|
|
723
|
+
}
|
|
724
|
+
return r2 = c2, (o2 = [{ key: "onImageLoad", value: function() {
|
|
725
|
+
var e4 = this;
|
|
726
|
+
return this.state.loaded ? null : function() {
|
|
727
|
+
e4.props.afterLoad(), e4.setState({ loaded: true });
|
|
728
|
+
};
|
|
729
|
+
} }, { key: "getImg", value: function() {
|
|
730
|
+
var e4 = this.props, r3 = (e4.afterLoad, e4.beforeLoad, e4.delayMethod, e4.delayTime, e4.effect, e4.placeholder, e4.placeholderSrc, e4.scrollPosition, e4.threshold, e4.useIntersectionObserver, e4.visibleByDefault, e4.wrapperClassName, e4.wrapperProps, function(e5, t3) {
|
|
731
|
+
if (e5 == null)
|
|
732
|
+
return {};
|
|
733
|
+
var r4, o3, n3 = function(e6, t4) {
|
|
734
|
+
if (e6 == null)
|
|
735
|
+
return {};
|
|
736
|
+
var r5, o4, n4 = {}, i4 = Object.keys(e6);
|
|
737
|
+
for (o4 = 0; o4 < i4.length; o4++)
|
|
738
|
+
r5 = i4[o4], t4.indexOf(r5) >= 0 || (n4[r5] = e6[r5]);
|
|
739
|
+
return n4;
|
|
740
|
+
}(e5, t3);
|
|
741
|
+
if (Object.getOwnPropertySymbols) {
|
|
742
|
+
var i3 = Object.getOwnPropertySymbols(e5);
|
|
743
|
+
for (o3 = 0; o3 < i3.length; o3++)
|
|
744
|
+
r4 = i3[o3], t3.indexOf(r4) >= 0 || Object.prototype.propertyIsEnumerable.call(e5, r4) && (n3[r4] = e5[r4]);
|
|
745
|
+
}
|
|
746
|
+
return n3;
|
|
747
|
+
}(e4, Q));
|
|
748
|
+
return t2().createElement("img", Z({ onLoad: this.onImageLoad() }, r3));
|
|
749
|
+
} }, { key: "getLazyLoadImage", value: function() {
|
|
750
|
+
var e4 = this.props, r3 = e4.beforeLoad, o3 = e4.className, n3 = e4.delayMethod, i3 = e4.delayTime, s3 = e4.height, c3 = e4.placeholder, u2 = e4.scrollPosition, l2 = e4.style, a2 = e4.threshold, f2 = e4.useIntersectionObserver, p2 = e4.visibleByDefault, y2 = e4.width;
|
|
751
|
+
return t2().createElement(J, { beforeLoad: r3, className: o3, delayMethod: n3, delayTime: i3, height: s3, placeholder: c3, scrollPosition: u2, style: l2, threshold: a2, useIntersectionObserver: f2, visibleByDefault: p2, width: y2 }, this.getImg());
|
|
752
|
+
} }, { key: "getWrappedLazyLoadImage", value: function(e4) {
|
|
753
|
+
var r3 = this.props, o3 = r3.effect, n3 = r3.height, i3 = r3.placeholderSrc, s3 = r3.width, c3 = r3.wrapperClassName, u2 = r3.wrapperProps, l2 = this.state.loaded, a2 = l2 ? " lazy-load-image-loaded" : "";
|
|
754
|
+
return t2().createElement("span", Z({ className: c3 + " lazy-load-image-background " + o3 + a2, style: { backgroundImage: l2 || !i3 ? "" : "url(".concat(i3, ")"), backgroundSize: l2 || !i3 ? "" : "100% 100%", color: "transparent", display: "inline-block", height: n3, width: s3 } }, u2), e4);
|
|
755
|
+
} }, { key: "render", value: function() {
|
|
756
|
+
var e4 = this.props, t3 = e4.effect, r3 = e4.placeholderSrc, o3 = e4.visibleByDefault, n3 = e4.wrapperClassName, i3 = e4.wrapperProps, s3 = this.getLazyLoadImage();
|
|
757
|
+
return (t3 || r3) && !o3 || n3 || i3 ? this.getWrappedLazyLoadImage(s3) : s3;
|
|
758
|
+
} }]) && ee(r2.prototype, o2), c2;
|
|
759
|
+
}(t2().Component);
|
|
760
|
+
ne.propTypes = { afterLoad: n.PropTypes.func, beforeLoad: n.PropTypes.func, delayMethod: n.PropTypes.string, delayTime: n.PropTypes.number, effect: n.PropTypes.string, placeholderSrc: n.PropTypes.string, threshold: n.PropTypes.number, useIntersectionObserver: n.PropTypes.bool, visibleByDefault: n.PropTypes.bool, wrapperClassName: n.PropTypes.string, wrapperProps: n.PropTypes.object }, ne.defaultProps = { afterLoad: function() {
|
|
761
|
+
return {};
|
|
762
|
+
}, beforeLoad: function() {
|
|
763
|
+
return {};
|
|
764
|
+
}, delayMethod: "throttle", delayTime: 300, effect: "", placeholderSrc: null, threshold: 100, useIntersectionObserver: true, visibleByDefault: false, wrapperClassName: "" };
|
|
765
|
+
const ie = ne;
|
|
766
|
+
})(), build.exports = o;
|
|
767
|
+
})();
|
|
768
|
+
const blur = /* @__PURE__ */ (() => ".lazy-load-image-background.blur{filter:blur(15px)}.lazy-load-image-background.blur.lazy-load-image-loaded{filter:blur(0);transition:filter .3s}.lazy-load-image-background.blur>img{opacity:0}.lazy-load-image-background.blur.lazy-load-image-loaded>img{opacity:1;transition:opacity .3s}\n")();
|
|
769
|
+
export { build as b };
|