ui-beyable 1.0.4 → 1.0.5
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/README.md +67 -67
- package/lib/cjs/components/Button/BYbtn.d.ts +6 -6
- package/lib/cjs/components/Collapse/BYcollapse.d.ts +4 -4
- package/lib/cjs/components/Modal/BYmodal.d.ts +4 -4
- package/lib/cjs/esm/components/BYbtn.d.ts +6 -6
- package/lib/cjs/esm/components/Button/BYbtn.d.ts +6 -6
- package/lib/cjs/esm/components/Button/type.d.ts +27 -27
- package/lib/cjs/esm/components/Button.d.ts +7 -7
- package/lib/cjs/esm/components/Collapse/BYcollapse.d.ts +4 -4
- package/lib/cjs/esm/components/Collapse/type.d.ts +5 -5
- package/lib/cjs/esm/components/Modal/BYmodal.d.ts +4 -4
- package/lib/cjs/esm/components/Modal/types.d.ts +11 -11
- package/lib/cjs/esm/components/Portal/BYportal.d.ts +3 -3
- package/lib/cjs/esm/components/Portal/type.d.ts +6 -6
- package/lib/cjs/esm/components/type.d.ts +27 -27
- package/lib/cjs/esm/index.d.ts +60 -60
- package/lib/cjs/index.css +32 -32
- package/lib/cjs/index.css.map +1 -1
- package/lib/cjs/index.d.ts +5 -11
- package/lib/cjs/index.js +0 -4755
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/BYbtn.d.ts +6 -6
- package/lib/esm/components/Button/BYbtn.d.ts +6 -6
- package/lib/esm/components/Button.d.ts +7 -7
- package/lib/esm/components/Collapse/BYcollapse.d.ts +4 -4
- package/lib/esm/components/Modal/BYmodal.d.ts +4 -4
- package/lib/esm/components/type.d.ts +27 -27
- package/lib/esm/index.css +32 -32
- package/lib/esm/index.css.map +1 -1
- package/lib/esm/index.d.ts +5 -11
- package/lib/esm/index.js +2 -4751
- package/lib/esm/index.js.map +1 -1
- package/lib/index.d.ts +40 -40
- package/package.json +3 -18
- package/lib/cjs/components/Avatar/Avatar.d.ts +0 -5
- package/lib/cjs/components/Avatar/type.d.ts +0 -5
- package/lib/cjs/components/Breadcrumb/BYbreadcrumbItem.d.ts +0 -4
- package/lib/cjs/components/Breadcrumb/Breadcrumb.d.ts +0 -5
- package/lib/cjs/components/Breadcrumb/type.d.ts +0 -21
- package/lib/cjs/components/Checkbox/Checkbox.d.ts +0 -4
- package/lib/cjs/components/Checkbox/type.d.ts +0 -15
- package/lib/cjs/components/InputCustom/InputCustom.d.ts +0 -10
- package/lib/cjs/components/InputCustom/types.d.ts +0 -40
- package/lib/cjs/components/Spinner/Spinner.d.ts +0 -4
- package/lib/cjs/components/Spinner/type.d.ts +0 -3
- package/lib/cjs/components/SpinnerWheel/BYspinnerWheel.d.ts +0 -6
- package/lib/cjs/components/SpinnerWheel/type.d.ts +0 -5
- package/lib/esm/components/Avatar/Avatar.d.ts +0 -5
- package/lib/esm/components/Avatar/type.d.ts +0 -5
- package/lib/esm/components/Breadcrumb/BYbreadcrumbItem.d.ts +0 -4
- package/lib/esm/components/Breadcrumb/Breadcrumb.d.ts +0 -5
- package/lib/esm/components/Breadcrumb/type.d.ts +0 -21
- package/lib/esm/components/Checkbox/Checkbox.d.ts +0 -4
- package/lib/esm/components/Checkbox/type.d.ts +0 -15
- package/lib/esm/components/InputCustom/InputCustom.d.ts +0 -10
- package/lib/esm/components/InputCustom/types.d.ts +0 -40
- package/lib/esm/components/Spinner/Spinner.d.ts +0 -4
- package/lib/esm/components/Spinner/type.d.ts +0 -3
- package/lib/esm/components/SpinnerWheel/BYspinnerWheel.d.ts +0 -6
- package/lib/esm/components/SpinnerWheel/type.d.ts +0 -5
package/lib/cjs/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var ReactDOM = require('react-dom');
|
|
5
|
-
var crypto$1 = require('crypto');
|
|
6
5
|
|
|
7
6
|
var Btn = function (_a) {
|
|
8
7
|
var children = _a.children, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.htmlTag, htmlTag = _c === void 0 ? "button" : _c, onClickFunction = _a.onClickFunction, onClick = _a.onClick, _d = _a.href, href = _d === void 0 ? '' : _d, _e = _a.target, target = _e === void 0 ? '' : _e, _f = _a.message, message = _f === void 0 ? '' : _f, _g = _a.color, color = _g === void 0 ? 'primary' : _g, _h = _a.style, style = _h === void 0 ? '' : _h, _j = _a.rounded, rounded = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, _l = _a.className, className = _l === void 0 ? '' : _l, _m = _a.strong, strong = _m === void 0 ? false : _m, _o = _a.light, light = _o === void 0 ? false : _o, _p = _a.size, size = _p === void 0 ? "" : _p, _q = _a.fontSize, fontSize = _q === void 0 ? '' : _q, _r = _a.fullWidth, fullWidth = _r === void 0 ? false : _r, _s = _a.fullHeight, fullHeight = _s === void 0 ? false : _s, icon = _a.icon, _t = _a.iconPosition, iconPosition = _t === void 0 ? 'before' : _t, _u = _a.arrow, arrow = _u === void 0 ? false : _u, dataFor = _a.dataFor, dataTip = _a.dataTip;
|
|
@@ -163,4762 +162,8 @@ function Collapse(_a) {
|
|
|
163
162
|
React.createElement("div", { className: styles.body, ref: bodyRef }, children)));
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
var Avatar = function (_a) {
|
|
167
|
-
var _b = _a.id, id = _b === void 0 ? '42' : _b, _c = _a.name, name = _c === void 0 ? 'A' : _c, _d = _a.size, size = _d === void 0 ? "m" : _d;
|
|
168
|
-
var cssClass = ['avatar'];
|
|
169
|
-
var colors = ['red', 'orange', 'yellow', 'green_apple', 'green', 'lightblue', 'blue', 'purple', 'pink'];
|
|
170
|
-
var getUserColor = function () {
|
|
171
|
-
var tmpId = parseInt(id.replace(/^\D+/g, ''));
|
|
172
|
-
var nb = colors.length;
|
|
173
|
-
var index = tmpId % nb;
|
|
174
|
-
return colors[index];
|
|
175
|
-
};
|
|
176
|
-
// INITIAL
|
|
177
|
-
var initial = name.slice(0, 1).toUpperCase();
|
|
178
|
-
// SIZE
|
|
179
|
-
if (size) {
|
|
180
|
-
cssClass.push('size_' + size);
|
|
181
|
-
}
|
|
182
|
-
// COLOR
|
|
183
|
-
var color = getUserColor();
|
|
184
|
-
if (color) {
|
|
185
|
-
cssClass.push('color_' + color);
|
|
186
|
-
}
|
|
187
|
-
return (React.createElement("div", { className: cssClass.join(' '), title: name }, initial));
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
function BreadcrumbItem(_a) {
|
|
191
|
-
var index = _a.index, name = _a.name, onClickFunction = _a.onClickFunction, stepSelected = _a.stepSelected, _b = _a.showIndex, showIndex = _b === void 0 ? 1 : _b;
|
|
192
|
-
return (React.createElement("li", { className: stepSelected === index ? 'item_active' : 'item', onClick: function () { return onClickFunction(index); } },
|
|
193
|
-
showIndex &&
|
|
194
|
-
React.createElement("span", { className: 'item_index' },
|
|
195
|
-
React.createElement("span", { className: 'item_index_inner' }, index)),
|
|
196
|
-
React.createElement("span", { className: 'item_name' }, name)));
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function Breadcrumb(_a) {
|
|
200
|
-
var itemOfBreadcrumb = _a.itemOfBreadcrumb, onClickFunction = _a.onClickFunction, stepSelected = _a.stepSelected;
|
|
201
|
-
return (React.createElement("ul", { className: 'list' }, itemOfBreadcrumb && itemOfBreadcrumb.map(function (item) {
|
|
202
|
-
return React.createElement(BreadcrumbItem, { key: item.index, index: item.index, name: item.title, onClickFunction: function () { return onClickFunction(item.index); }, stepSelected: stepSelected });
|
|
203
|
-
})));
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function getDefaultExportFromCjs (x) {
|
|
207
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
var propTypes = {exports: {}};
|
|
211
|
-
|
|
212
|
-
var reactIs = {exports: {}};
|
|
213
|
-
|
|
214
|
-
var reactIs_production_min = {};
|
|
215
|
-
|
|
216
|
-
/** @license React v16.13.1
|
|
217
|
-
* react-is.production.min.js
|
|
218
|
-
*
|
|
219
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the MIT license found in the
|
|
222
|
-
* LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
var hasRequiredReactIs_production_min;
|
|
226
|
-
|
|
227
|
-
function requireReactIs_production_min () {
|
|
228
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
229
|
-
hasRequiredReactIs_production_min = 1;
|
|
230
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
231
|
-
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
232
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
233
|
-
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
234
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
235
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
236
|
-
return reactIs_production_min;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
var reactIs_development = {};
|
|
240
|
-
|
|
241
|
-
/** @license React v16.13.1
|
|
242
|
-
* react-is.development.js
|
|
243
|
-
*
|
|
244
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the MIT license found in the
|
|
247
|
-
* LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/
|
|
249
|
-
|
|
250
|
-
var hasRequiredReactIs_development;
|
|
251
|
-
|
|
252
|
-
function requireReactIs_development () {
|
|
253
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
254
|
-
hasRequiredReactIs_development = 1;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (process.env.NODE_ENV !== "production") {
|
|
259
|
-
(function() {
|
|
260
|
-
|
|
261
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
262
|
-
// nor polyfill, then a plain number is used for performance.
|
|
263
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
264
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
265
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
266
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
267
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
268
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
269
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
270
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
271
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
272
|
-
|
|
273
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
274
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
275
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
276
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
277
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
278
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
279
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
280
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
281
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
282
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
283
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
284
|
-
|
|
285
|
-
function isValidElementType(type) {
|
|
286
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
287
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function typeOf(object) {
|
|
291
|
-
if (typeof object === 'object' && object !== null) {
|
|
292
|
-
var $$typeof = object.$$typeof;
|
|
293
|
-
|
|
294
|
-
switch ($$typeof) {
|
|
295
|
-
case REACT_ELEMENT_TYPE:
|
|
296
|
-
var type = object.type;
|
|
297
|
-
|
|
298
|
-
switch (type) {
|
|
299
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
300
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
301
|
-
case REACT_FRAGMENT_TYPE:
|
|
302
|
-
case REACT_PROFILER_TYPE:
|
|
303
|
-
case REACT_STRICT_MODE_TYPE:
|
|
304
|
-
case REACT_SUSPENSE_TYPE:
|
|
305
|
-
return type;
|
|
306
|
-
|
|
307
|
-
default:
|
|
308
|
-
var $$typeofType = type && type.$$typeof;
|
|
309
|
-
|
|
310
|
-
switch ($$typeofType) {
|
|
311
|
-
case REACT_CONTEXT_TYPE:
|
|
312
|
-
case REACT_FORWARD_REF_TYPE:
|
|
313
|
-
case REACT_LAZY_TYPE:
|
|
314
|
-
case REACT_MEMO_TYPE:
|
|
315
|
-
case REACT_PROVIDER_TYPE:
|
|
316
|
-
return $$typeofType;
|
|
317
|
-
|
|
318
|
-
default:
|
|
319
|
-
return $$typeof;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
case REACT_PORTAL_TYPE:
|
|
325
|
-
return $$typeof;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
return undefined;
|
|
330
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
331
|
-
|
|
332
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
333
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
334
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
335
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
336
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
337
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
338
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
339
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
340
|
-
var Memo = REACT_MEMO_TYPE;
|
|
341
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
342
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
343
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
344
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
345
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
346
|
-
|
|
347
|
-
function isAsyncMode(object) {
|
|
348
|
-
{
|
|
349
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
350
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
351
|
-
|
|
352
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
357
|
-
}
|
|
358
|
-
function isConcurrentMode(object) {
|
|
359
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
360
|
-
}
|
|
361
|
-
function isContextConsumer(object) {
|
|
362
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
363
|
-
}
|
|
364
|
-
function isContextProvider(object) {
|
|
365
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
366
|
-
}
|
|
367
|
-
function isElement(object) {
|
|
368
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
369
|
-
}
|
|
370
|
-
function isForwardRef(object) {
|
|
371
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
372
|
-
}
|
|
373
|
-
function isFragment(object) {
|
|
374
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
375
|
-
}
|
|
376
|
-
function isLazy(object) {
|
|
377
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
378
|
-
}
|
|
379
|
-
function isMemo(object) {
|
|
380
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
381
|
-
}
|
|
382
|
-
function isPortal(object) {
|
|
383
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
384
|
-
}
|
|
385
|
-
function isProfiler(object) {
|
|
386
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
387
|
-
}
|
|
388
|
-
function isStrictMode(object) {
|
|
389
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
390
|
-
}
|
|
391
|
-
function isSuspense(object) {
|
|
392
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
396
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
397
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
398
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
399
|
-
reactIs_development.Element = Element;
|
|
400
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
401
|
-
reactIs_development.Fragment = Fragment;
|
|
402
|
-
reactIs_development.Lazy = Lazy;
|
|
403
|
-
reactIs_development.Memo = Memo;
|
|
404
|
-
reactIs_development.Portal = Portal;
|
|
405
|
-
reactIs_development.Profiler = Profiler;
|
|
406
|
-
reactIs_development.StrictMode = StrictMode;
|
|
407
|
-
reactIs_development.Suspense = Suspense;
|
|
408
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
409
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
410
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
411
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
412
|
-
reactIs_development.isElement = isElement;
|
|
413
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
414
|
-
reactIs_development.isFragment = isFragment;
|
|
415
|
-
reactIs_development.isLazy = isLazy;
|
|
416
|
-
reactIs_development.isMemo = isMemo;
|
|
417
|
-
reactIs_development.isPortal = isPortal;
|
|
418
|
-
reactIs_development.isProfiler = isProfiler;
|
|
419
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
420
|
-
reactIs_development.isSuspense = isSuspense;
|
|
421
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
422
|
-
reactIs_development.typeOf = typeOf;
|
|
423
|
-
})();
|
|
424
|
-
}
|
|
425
|
-
return reactIs_development;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
var hasRequiredReactIs;
|
|
429
|
-
|
|
430
|
-
function requireReactIs () {
|
|
431
|
-
if (hasRequiredReactIs) return reactIs.exports;
|
|
432
|
-
hasRequiredReactIs = 1;
|
|
433
|
-
|
|
434
|
-
if (process.env.NODE_ENV === 'production') {
|
|
435
|
-
reactIs.exports = requireReactIs_production_min();
|
|
436
|
-
} else {
|
|
437
|
-
reactIs.exports = requireReactIs_development();
|
|
438
|
-
}
|
|
439
|
-
return reactIs.exports;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
/*
|
|
443
|
-
object-assign
|
|
444
|
-
(c) Sindre Sorhus
|
|
445
|
-
@license MIT
|
|
446
|
-
*/
|
|
447
|
-
|
|
448
|
-
var objectAssign;
|
|
449
|
-
var hasRequiredObjectAssign;
|
|
450
|
-
|
|
451
|
-
function requireObjectAssign () {
|
|
452
|
-
if (hasRequiredObjectAssign) return objectAssign;
|
|
453
|
-
hasRequiredObjectAssign = 1;
|
|
454
|
-
/* eslint-disable no-unused-vars */
|
|
455
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
456
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
457
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
458
|
-
|
|
459
|
-
function toObject(val) {
|
|
460
|
-
if (val === null || val === undefined) {
|
|
461
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
return Object(val);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function shouldUseNative() {
|
|
468
|
-
try {
|
|
469
|
-
if (!Object.assign) {
|
|
470
|
-
return false;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
474
|
-
|
|
475
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
476
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
477
|
-
test1[5] = 'de';
|
|
478
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
479
|
-
return false;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
483
|
-
var test2 = {};
|
|
484
|
-
for (var i = 0; i < 10; i++) {
|
|
485
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
486
|
-
}
|
|
487
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
488
|
-
return test2[n];
|
|
489
|
-
});
|
|
490
|
-
if (order2.join('') !== '0123456789') {
|
|
491
|
-
return false;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
495
|
-
var test3 = {};
|
|
496
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
497
|
-
test3[letter] = letter;
|
|
498
|
-
});
|
|
499
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
500
|
-
'abcdefghijklmnopqrst') {
|
|
501
|
-
return false;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
return true;
|
|
505
|
-
} catch (err) {
|
|
506
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
507
|
-
return false;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
512
|
-
var from;
|
|
513
|
-
var to = toObject(target);
|
|
514
|
-
var symbols;
|
|
515
|
-
|
|
516
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
517
|
-
from = Object(arguments[s]);
|
|
518
|
-
|
|
519
|
-
for (var key in from) {
|
|
520
|
-
if (hasOwnProperty.call(from, key)) {
|
|
521
|
-
to[key] = from[key];
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
if (getOwnPropertySymbols) {
|
|
526
|
-
symbols = getOwnPropertySymbols(from);
|
|
527
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
528
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
529
|
-
to[symbols[i]] = from[symbols[i]];
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
return to;
|
|
536
|
-
};
|
|
537
|
-
return objectAssign;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
542
|
-
*
|
|
543
|
-
* This source code is licensed under the MIT license found in the
|
|
544
|
-
* LICENSE file in the root directory of this source tree.
|
|
545
|
-
*/
|
|
546
|
-
|
|
547
|
-
var ReactPropTypesSecret_1;
|
|
548
|
-
var hasRequiredReactPropTypesSecret;
|
|
549
|
-
|
|
550
|
-
function requireReactPropTypesSecret () {
|
|
551
|
-
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
552
|
-
hasRequiredReactPropTypesSecret = 1;
|
|
553
|
-
|
|
554
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
555
|
-
|
|
556
|
-
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
557
|
-
return ReactPropTypesSecret_1;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
var has$1;
|
|
561
|
-
var hasRequiredHas;
|
|
562
|
-
|
|
563
|
-
function requireHas () {
|
|
564
|
-
if (hasRequiredHas) return has$1;
|
|
565
|
-
hasRequiredHas = 1;
|
|
566
|
-
has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
567
|
-
return has$1;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
572
|
-
*
|
|
573
|
-
* This source code is licensed under the MIT license found in the
|
|
574
|
-
* LICENSE file in the root directory of this source tree.
|
|
575
|
-
*/
|
|
576
|
-
|
|
577
|
-
var checkPropTypes_1;
|
|
578
|
-
var hasRequiredCheckPropTypes;
|
|
579
|
-
|
|
580
|
-
function requireCheckPropTypes () {
|
|
581
|
-
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
582
|
-
hasRequiredCheckPropTypes = 1;
|
|
583
|
-
|
|
584
|
-
var printWarning = function() {};
|
|
585
|
-
|
|
586
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
587
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
588
|
-
var loggedTypeFailures = {};
|
|
589
|
-
var has = requireHas();
|
|
590
|
-
|
|
591
|
-
printWarning = function(text) {
|
|
592
|
-
var message = 'Warning: ' + text;
|
|
593
|
-
if (typeof console !== 'undefined') {
|
|
594
|
-
console.error(message);
|
|
595
|
-
}
|
|
596
|
-
try {
|
|
597
|
-
// --- Welcome to debugging React ---
|
|
598
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
599
|
-
// to find the callsite that caused this warning to fire.
|
|
600
|
-
throw new Error(message);
|
|
601
|
-
} catch (x) { /**/ }
|
|
602
|
-
};
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Assert that the values match with the type specs.
|
|
607
|
-
* Error messages are memorized and will only be shown once.
|
|
608
|
-
*
|
|
609
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
610
|
-
* @param {object} values Runtime values that need to be type-checked
|
|
611
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
612
|
-
* @param {string} componentName Name of the component for error messages.
|
|
613
|
-
* @param {?Function} getStack Returns the component stack.
|
|
614
|
-
* @private
|
|
615
|
-
*/
|
|
616
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
617
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
618
|
-
for (var typeSpecName in typeSpecs) {
|
|
619
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
620
|
-
var error;
|
|
621
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
622
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
623
|
-
// After these have been cleaned up, we'll let them throw.
|
|
624
|
-
try {
|
|
625
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
626
|
-
// behavior as without this statement except with a better message.
|
|
627
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
628
|
-
var err = Error(
|
|
629
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
630
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
631
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
632
|
-
);
|
|
633
|
-
err.name = 'Invariant Violation';
|
|
634
|
-
throw err;
|
|
635
|
-
}
|
|
636
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
637
|
-
} catch (ex) {
|
|
638
|
-
error = ex;
|
|
639
|
-
}
|
|
640
|
-
if (error && !(error instanceof Error)) {
|
|
641
|
-
printWarning(
|
|
642
|
-
(componentName || 'React class') + ': type specification of ' +
|
|
643
|
-
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
644
|
-
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
645
|
-
'You may have forgotten to pass an argument to the type checker ' +
|
|
646
|
-
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
647
|
-
'shape all require an argument).'
|
|
648
|
-
);
|
|
649
|
-
}
|
|
650
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
651
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
652
|
-
// same error.
|
|
653
|
-
loggedTypeFailures[error.message] = true;
|
|
654
|
-
|
|
655
|
-
var stack = getStack ? getStack() : '';
|
|
656
|
-
|
|
657
|
-
printWarning(
|
|
658
|
-
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
659
|
-
);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* Resets warning cache when testing.
|
|
668
|
-
*
|
|
669
|
-
* @private
|
|
670
|
-
*/
|
|
671
|
-
checkPropTypes.resetWarningCache = function() {
|
|
672
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
673
|
-
loggedTypeFailures = {};
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
checkPropTypes_1 = checkPropTypes;
|
|
678
|
-
return checkPropTypes_1;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
683
|
-
*
|
|
684
|
-
* This source code is licensed under the MIT license found in the
|
|
685
|
-
* LICENSE file in the root directory of this source tree.
|
|
686
|
-
*/
|
|
687
|
-
|
|
688
|
-
var factoryWithTypeCheckers;
|
|
689
|
-
var hasRequiredFactoryWithTypeCheckers;
|
|
690
|
-
|
|
691
|
-
function requireFactoryWithTypeCheckers () {
|
|
692
|
-
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
693
|
-
hasRequiredFactoryWithTypeCheckers = 1;
|
|
694
|
-
|
|
695
|
-
var ReactIs = requireReactIs();
|
|
696
|
-
var assign = requireObjectAssign();
|
|
697
|
-
|
|
698
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
699
|
-
var has = requireHas();
|
|
700
|
-
var checkPropTypes = requireCheckPropTypes();
|
|
701
|
-
|
|
702
|
-
var printWarning = function() {};
|
|
703
|
-
|
|
704
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
705
|
-
printWarning = function(text) {
|
|
706
|
-
var message = 'Warning: ' + text;
|
|
707
|
-
if (typeof console !== 'undefined') {
|
|
708
|
-
console.error(message);
|
|
709
|
-
}
|
|
710
|
-
try {
|
|
711
|
-
// --- Welcome to debugging React ---
|
|
712
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
713
|
-
// to find the callsite that caused this warning to fire.
|
|
714
|
-
throw new Error(message);
|
|
715
|
-
} catch (x) {}
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
function emptyFunctionThatReturnsNull() {
|
|
720
|
-
return null;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
724
|
-
/* global Symbol */
|
|
725
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
726
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* Returns the iterator method function contained on the iterable object.
|
|
730
|
-
*
|
|
731
|
-
* Be sure to invoke the function with the iterable as context:
|
|
732
|
-
*
|
|
733
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
|
734
|
-
* if (iteratorFn) {
|
|
735
|
-
* var iterator = iteratorFn.call(myIterable);
|
|
736
|
-
* ...
|
|
737
|
-
* }
|
|
738
|
-
*
|
|
739
|
-
* @param {?object} maybeIterable
|
|
740
|
-
* @return {?function}
|
|
741
|
-
*/
|
|
742
|
-
function getIteratorFn(maybeIterable) {
|
|
743
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
744
|
-
if (typeof iteratorFn === 'function') {
|
|
745
|
-
return iteratorFn;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* Collection of methods that allow declaration and validation of props that are
|
|
751
|
-
* supplied to React components. Example usage:
|
|
752
|
-
*
|
|
753
|
-
* var Props = require('ReactPropTypes');
|
|
754
|
-
* var MyArticle = React.createClass({
|
|
755
|
-
* propTypes: {
|
|
756
|
-
* // An optional string prop named "description".
|
|
757
|
-
* description: Props.string,
|
|
758
|
-
*
|
|
759
|
-
* // A required enum prop named "category".
|
|
760
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
761
|
-
*
|
|
762
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
|
763
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
|
764
|
-
* },
|
|
765
|
-
* render: function() { ... }
|
|
766
|
-
* });
|
|
767
|
-
*
|
|
768
|
-
* A more formal specification of how these methods are used:
|
|
769
|
-
*
|
|
770
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
771
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
772
|
-
*
|
|
773
|
-
* Each and every declaration produces a function with the same signature. This
|
|
774
|
-
* allows the creation of custom validation functions. For example:
|
|
775
|
-
*
|
|
776
|
-
* var MyLink = React.createClass({
|
|
777
|
-
* propTypes: {
|
|
778
|
-
* // An optional string or URI prop named "href".
|
|
779
|
-
* href: function(props, propName, componentName) {
|
|
780
|
-
* var propValue = props[propName];
|
|
781
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
|
782
|
-
* !(propValue instanceof URI)) {
|
|
783
|
-
* return new Error(
|
|
784
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
785
|
-
* componentName
|
|
786
|
-
* );
|
|
787
|
-
* }
|
|
788
|
-
* }
|
|
789
|
-
* },
|
|
790
|
-
* render: function() {...}
|
|
791
|
-
* });
|
|
792
|
-
*
|
|
793
|
-
* @internal
|
|
794
|
-
*/
|
|
795
|
-
|
|
796
|
-
var ANONYMOUS = '<<anonymous>>';
|
|
797
|
-
|
|
798
|
-
// Important!
|
|
799
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
800
|
-
var ReactPropTypes = {
|
|
801
|
-
array: createPrimitiveTypeChecker('array'),
|
|
802
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
803
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
|
804
|
-
func: createPrimitiveTypeChecker('function'),
|
|
805
|
-
number: createPrimitiveTypeChecker('number'),
|
|
806
|
-
object: createPrimitiveTypeChecker('object'),
|
|
807
|
-
string: createPrimitiveTypeChecker('string'),
|
|
808
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
|
809
|
-
|
|
810
|
-
any: createAnyTypeChecker(),
|
|
811
|
-
arrayOf: createArrayOfTypeChecker,
|
|
812
|
-
element: createElementTypeChecker(),
|
|
813
|
-
elementType: createElementTypeTypeChecker(),
|
|
814
|
-
instanceOf: createInstanceTypeChecker,
|
|
815
|
-
node: createNodeChecker(),
|
|
816
|
-
objectOf: createObjectOfTypeChecker,
|
|
817
|
-
oneOf: createEnumTypeChecker,
|
|
818
|
-
oneOfType: createUnionTypeChecker,
|
|
819
|
-
shape: createShapeTypeChecker,
|
|
820
|
-
exact: createStrictShapeTypeChecker,
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
825
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
826
|
-
*/
|
|
827
|
-
/*eslint-disable no-self-compare*/
|
|
828
|
-
function is(x, y) {
|
|
829
|
-
// SameValue algorithm
|
|
830
|
-
if (x === y) {
|
|
831
|
-
// Steps 1-5, 7-10
|
|
832
|
-
// Steps 6.b-6.e: +0 != -0
|
|
833
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
834
|
-
} else {
|
|
835
|
-
// Step 6.a: NaN == NaN
|
|
836
|
-
return x !== x && y !== y;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
/*eslint-enable no-self-compare*/
|
|
840
|
-
|
|
841
|
-
/**
|
|
842
|
-
* We use an Error-like object for backward compatibility as people may call
|
|
843
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
|
844
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
845
|
-
* is prohibitively expensive if they are created too often, such as what
|
|
846
|
-
* happens in oneOfType() for any type before the one that matched.
|
|
847
|
-
*/
|
|
848
|
-
function PropTypeError(message, data) {
|
|
849
|
-
this.message = message;
|
|
850
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
851
|
-
this.stack = '';
|
|
852
|
-
}
|
|
853
|
-
// Make `instanceof Error` still work for returned errors.
|
|
854
|
-
PropTypeError.prototype = Error.prototype;
|
|
855
|
-
|
|
856
|
-
function createChainableTypeChecker(validate) {
|
|
857
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
858
|
-
var manualPropTypeCallCache = {};
|
|
859
|
-
var manualPropTypeWarningCount = 0;
|
|
860
|
-
}
|
|
861
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
862
|
-
componentName = componentName || ANONYMOUS;
|
|
863
|
-
propFullName = propFullName || propName;
|
|
864
|
-
|
|
865
|
-
if (secret !== ReactPropTypesSecret) {
|
|
866
|
-
if (throwOnDirectAccess) {
|
|
867
|
-
// New behavior only for users of `prop-types` package
|
|
868
|
-
var err = new Error(
|
|
869
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
870
|
-
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
871
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
872
|
-
);
|
|
873
|
-
err.name = 'Invariant Violation';
|
|
874
|
-
throw err;
|
|
875
|
-
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
876
|
-
// Old behavior for people using React.PropTypes
|
|
877
|
-
var cacheKey = componentName + ':' + propName;
|
|
878
|
-
if (
|
|
879
|
-
!manualPropTypeCallCache[cacheKey] &&
|
|
880
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
881
|
-
manualPropTypeWarningCount < 3
|
|
882
|
-
) {
|
|
883
|
-
printWarning(
|
|
884
|
-
'You are manually calling a React.PropTypes validation ' +
|
|
885
|
-
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
886
|
-
'and will throw in the standalone `prop-types` package. ' +
|
|
887
|
-
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
888
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
889
|
-
);
|
|
890
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
891
|
-
manualPropTypeWarningCount++;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
if (props[propName] == null) {
|
|
896
|
-
if (isRequired) {
|
|
897
|
-
if (props[propName] === null) {
|
|
898
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
899
|
-
}
|
|
900
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
901
|
-
}
|
|
902
|
-
return null;
|
|
903
|
-
} else {
|
|
904
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
909
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
910
|
-
|
|
911
|
-
return chainedCheckType;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
915
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
916
|
-
var propValue = props[propName];
|
|
917
|
-
var propType = getPropType(propValue);
|
|
918
|
-
if (propType !== expectedType) {
|
|
919
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
920
|
-
// check, but we can offer a more precise error message here rather than
|
|
921
|
-
// 'of type `object`'.
|
|
922
|
-
var preciseType = getPreciseType(propValue);
|
|
923
|
-
|
|
924
|
-
return new PropTypeError(
|
|
925
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
926
|
-
{expectedType: expectedType}
|
|
927
|
-
);
|
|
928
|
-
}
|
|
929
|
-
return null;
|
|
930
|
-
}
|
|
931
|
-
return createChainableTypeChecker(validate);
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
function createAnyTypeChecker() {
|
|
935
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
939
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
940
|
-
if (typeof typeChecker !== 'function') {
|
|
941
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
942
|
-
}
|
|
943
|
-
var propValue = props[propName];
|
|
944
|
-
if (!Array.isArray(propValue)) {
|
|
945
|
-
var propType = getPropType(propValue);
|
|
946
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
947
|
-
}
|
|
948
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
949
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
950
|
-
if (error instanceof Error) {
|
|
951
|
-
return error;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
return null;
|
|
955
|
-
}
|
|
956
|
-
return createChainableTypeChecker(validate);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
function createElementTypeChecker() {
|
|
960
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
961
|
-
var propValue = props[propName];
|
|
962
|
-
if (!isValidElement(propValue)) {
|
|
963
|
-
var propType = getPropType(propValue);
|
|
964
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
965
|
-
}
|
|
966
|
-
return null;
|
|
967
|
-
}
|
|
968
|
-
return createChainableTypeChecker(validate);
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
function createElementTypeTypeChecker() {
|
|
972
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
973
|
-
var propValue = props[propName];
|
|
974
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
975
|
-
var propType = getPropType(propValue);
|
|
976
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
977
|
-
}
|
|
978
|
-
return null;
|
|
979
|
-
}
|
|
980
|
-
return createChainableTypeChecker(validate);
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
984
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
985
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
986
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
987
|
-
var actualClassName = getClassName(props[propName]);
|
|
988
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
989
|
-
}
|
|
990
|
-
return null;
|
|
991
|
-
}
|
|
992
|
-
return createChainableTypeChecker(validate);
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
function createEnumTypeChecker(expectedValues) {
|
|
996
|
-
if (!Array.isArray(expectedValues)) {
|
|
997
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
998
|
-
if (arguments.length > 1) {
|
|
999
|
-
printWarning(
|
|
1000
|
-
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
1001
|
-
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
1002
|
-
);
|
|
1003
|
-
} else {
|
|
1004
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return emptyFunctionThatReturnsNull;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1011
|
-
var propValue = props[propName];
|
|
1012
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
1013
|
-
if (is(propValue, expectedValues[i])) {
|
|
1014
|
-
return null;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
1019
|
-
var type = getPreciseType(value);
|
|
1020
|
-
if (type === 'symbol') {
|
|
1021
|
-
return String(value);
|
|
1022
|
-
}
|
|
1023
|
-
return value;
|
|
1024
|
-
});
|
|
1025
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
1026
|
-
}
|
|
1027
|
-
return createChainableTypeChecker(validate);
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
1031
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1032
|
-
if (typeof typeChecker !== 'function') {
|
|
1033
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
1034
|
-
}
|
|
1035
|
-
var propValue = props[propName];
|
|
1036
|
-
var propType = getPropType(propValue);
|
|
1037
|
-
if (propType !== 'object') {
|
|
1038
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
1039
|
-
}
|
|
1040
|
-
for (var key in propValue) {
|
|
1041
|
-
if (has(propValue, key)) {
|
|
1042
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1043
|
-
if (error instanceof Error) {
|
|
1044
|
-
return error;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
return null;
|
|
1049
|
-
}
|
|
1050
|
-
return createChainableTypeChecker(validate);
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
1054
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
1055
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
1056
|
-
return emptyFunctionThatReturnsNull;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1060
|
-
var checker = arrayOfTypeCheckers[i];
|
|
1061
|
-
if (typeof checker !== 'function') {
|
|
1062
|
-
printWarning(
|
|
1063
|
-
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
1064
|
-
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
1065
|
-
);
|
|
1066
|
-
return emptyFunctionThatReturnsNull;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1071
|
-
var expectedTypes = [];
|
|
1072
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1073
|
-
var checker = arrayOfTypeCheckers[i];
|
|
1074
|
-
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
1075
|
-
if (checkerResult == null) {
|
|
1076
|
-
return null;
|
|
1077
|
-
}
|
|
1078
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
1079
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
1083
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
1084
|
-
}
|
|
1085
|
-
return createChainableTypeChecker(validate);
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
function createNodeChecker() {
|
|
1089
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1090
|
-
if (!isNode(props[propName])) {
|
|
1091
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
1092
|
-
}
|
|
1093
|
-
return null;
|
|
1094
|
-
}
|
|
1095
|
-
return createChainableTypeChecker(validate);
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
1099
|
-
return new PropTypeError(
|
|
1100
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
1101
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
1102
|
-
);
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
1106
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1107
|
-
var propValue = props[propName];
|
|
1108
|
-
var propType = getPropType(propValue);
|
|
1109
|
-
if (propType !== 'object') {
|
|
1110
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1111
|
-
}
|
|
1112
|
-
for (var key in shapeTypes) {
|
|
1113
|
-
var checker = shapeTypes[key];
|
|
1114
|
-
if (typeof checker !== 'function') {
|
|
1115
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1116
|
-
}
|
|
1117
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1118
|
-
if (error) {
|
|
1119
|
-
return error;
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
return null;
|
|
1123
|
-
}
|
|
1124
|
-
return createChainableTypeChecker(validate);
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
1128
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1129
|
-
var propValue = props[propName];
|
|
1130
|
-
var propType = getPropType(propValue);
|
|
1131
|
-
if (propType !== 'object') {
|
|
1132
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1133
|
-
}
|
|
1134
|
-
// We need to check all keys in case some are required but missing from props.
|
|
1135
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
1136
|
-
for (var key in allKeys) {
|
|
1137
|
-
var checker = shapeTypes[key];
|
|
1138
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
1139
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1140
|
-
}
|
|
1141
|
-
if (!checker) {
|
|
1142
|
-
return new PropTypeError(
|
|
1143
|
-
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
1144
|
-
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
1145
|
-
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
1146
|
-
);
|
|
1147
|
-
}
|
|
1148
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1149
|
-
if (error) {
|
|
1150
|
-
return error;
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
return null;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
return createChainableTypeChecker(validate);
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
function isNode(propValue) {
|
|
1160
|
-
switch (typeof propValue) {
|
|
1161
|
-
case 'number':
|
|
1162
|
-
case 'string':
|
|
1163
|
-
case 'undefined':
|
|
1164
|
-
return true;
|
|
1165
|
-
case 'boolean':
|
|
1166
|
-
return !propValue;
|
|
1167
|
-
case 'object':
|
|
1168
|
-
if (Array.isArray(propValue)) {
|
|
1169
|
-
return propValue.every(isNode);
|
|
1170
|
-
}
|
|
1171
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
1172
|
-
return true;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
1176
|
-
if (iteratorFn) {
|
|
1177
|
-
var iterator = iteratorFn.call(propValue);
|
|
1178
|
-
var step;
|
|
1179
|
-
if (iteratorFn !== propValue.entries) {
|
|
1180
|
-
while (!(step = iterator.next()).done) {
|
|
1181
|
-
if (!isNode(step.value)) {
|
|
1182
|
-
return false;
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
} else {
|
|
1186
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1187
|
-
while (!(step = iterator.next()).done) {
|
|
1188
|
-
var entry = step.value;
|
|
1189
|
-
if (entry) {
|
|
1190
|
-
if (!isNode(entry[1])) {
|
|
1191
|
-
return false;
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
} else {
|
|
1197
|
-
return false;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
return true;
|
|
1201
|
-
default:
|
|
1202
|
-
return false;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
function isSymbol(propType, propValue) {
|
|
1207
|
-
// Native Symbol.
|
|
1208
|
-
if (propType === 'symbol') {
|
|
1209
|
-
return true;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
// falsy value can't be a Symbol
|
|
1213
|
-
if (!propValue) {
|
|
1214
|
-
return false;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1218
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1219
|
-
return true;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1223
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1224
|
-
return true;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
return false;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1231
|
-
function getPropType(propValue) {
|
|
1232
|
-
var propType = typeof propValue;
|
|
1233
|
-
if (Array.isArray(propValue)) {
|
|
1234
|
-
return 'array';
|
|
1235
|
-
}
|
|
1236
|
-
if (propValue instanceof RegExp) {
|
|
1237
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1238
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1239
|
-
// passes PropTypes.object.
|
|
1240
|
-
return 'object';
|
|
1241
|
-
}
|
|
1242
|
-
if (isSymbol(propType, propValue)) {
|
|
1243
|
-
return 'symbol';
|
|
1244
|
-
}
|
|
1245
|
-
return propType;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
|
1249
|
-
// See `createPrimitiveTypeChecker`.
|
|
1250
|
-
function getPreciseType(propValue) {
|
|
1251
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1252
|
-
return '' + propValue;
|
|
1253
|
-
}
|
|
1254
|
-
var propType = getPropType(propValue);
|
|
1255
|
-
if (propType === 'object') {
|
|
1256
|
-
if (propValue instanceof Date) {
|
|
1257
|
-
return 'date';
|
|
1258
|
-
} else if (propValue instanceof RegExp) {
|
|
1259
|
-
return 'regexp';
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
return propType;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1266
|
-
// For example, "undefined" or "of type array"
|
|
1267
|
-
function getPostfixForTypeWarning(value) {
|
|
1268
|
-
var type = getPreciseType(value);
|
|
1269
|
-
switch (type) {
|
|
1270
|
-
case 'array':
|
|
1271
|
-
case 'object':
|
|
1272
|
-
return 'an ' + type;
|
|
1273
|
-
case 'boolean':
|
|
1274
|
-
case 'date':
|
|
1275
|
-
case 'regexp':
|
|
1276
|
-
return 'a ' + type;
|
|
1277
|
-
default:
|
|
1278
|
-
return type;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
// Returns class name of the object, if any.
|
|
1283
|
-
function getClassName(propValue) {
|
|
1284
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1285
|
-
return ANONYMOUS;
|
|
1286
|
-
}
|
|
1287
|
-
return propValue.constructor.name;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1291
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1292
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1293
|
-
|
|
1294
|
-
return ReactPropTypes;
|
|
1295
|
-
};
|
|
1296
|
-
return factoryWithTypeCheckers;
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
/**
|
|
1300
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1301
|
-
*
|
|
1302
|
-
* This source code is licensed under the MIT license found in the
|
|
1303
|
-
* LICENSE file in the root directory of this source tree.
|
|
1304
|
-
*/
|
|
1305
|
-
|
|
1306
|
-
var factoryWithThrowingShims;
|
|
1307
|
-
var hasRequiredFactoryWithThrowingShims;
|
|
1308
|
-
|
|
1309
|
-
function requireFactoryWithThrowingShims () {
|
|
1310
|
-
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1311
|
-
hasRequiredFactoryWithThrowingShims = 1;
|
|
1312
|
-
|
|
1313
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
1314
|
-
|
|
1315
|
-
function emptyFunction() {}
|
|
1316
|
-
function emptyFunctionWithReset() {}
|
|
1317
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1318
|
-
|
|
1319
|
-
factoryWithThrowingShims = function() {
|
|
1320
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1321
|
-
if (secret === ReactPropTypesSecret) {
|
|
1322
|
-
// It is still safe when called from React.
|
|
1323
|
-
return;
|
|
1324
|
-
}
|
|
1325
|
-
var err = new Error(
|
|
1326
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1327
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1328
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
1329
|
-
);
|
|
1330
|
-
err.name = 'Invariant Violation';
|
|
1331
|
-
throw err;
|
|
1332
|
-
} shim.isRequired = shim;
|
|
1333
|
-
function getShim() {
|
|
1334
|
-
return shim;
|
|
1335
|
-
} // Important!
|
|
1336
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1337
|
-
var ReactPropTypes = {
|
|
1338
|
-
array: shim,
|
|
1339
|
-
bigint: shim,
|
|
1340
|
-
bool: shim,
|
|
1341
|
-
func: shim,
|
|
1342
|
-
number: shim,
|
|
1343
|
-
object: shim,
|
|
1344
|
-
string: shim,
|
|
1345
|
-
symbol: shim,
|
|
1346
|
-
|
|
1347
|
-
any: shim,
|
|
1348
|
-
arrayOf: getShim,
|
|
1349
|
-
element: shim,
|
|
1350
|
-
elementType: shim,
|
|
1351
|
-
instanceOf: getShim,
|
|
1352
|
-
node: shim,
|
|
1353
|
-
objectOf: getShim,
|
|
1354
|
-
oneOf: getShim,
|
|
1355
|
-
oneOfType: getShim,
|
|
1356
|
-
shape: getShim,
|
|
1357
|
-
exact: getShim,
|
|
1358
|
-
|
|
1359
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
1360
|
-
resetWarningCache: emptyFunction
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1364
|
-
|
|
1365
|
-
return ReactPropTypes;
|
|
1366
|
-
};
|
|
1367
|
-
return factoryWithThrowingShims;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
/**
|
|
1371
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1372
|
-
*
|
|
1373
|
-
* This source code is licensed under the MIT license found in the
|
|
1374
|
-
* LICENSE file in the root directory of this source tree.
|
|
1375
|
-
*/
|
|
1376
|
-
|
|
1377
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1378
|
-
var ReactIs = requireReactIs();
|
|
1379
|
-
|
|
1380
|
-
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1381
|
-
// http://fb.me/prop-types-in-prod
|
|
1382
|
-
var throwOnDirectAccess = true;
|
|
1383
|
-
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1384
|
-
} else {
|
|
1385
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1386
|
-
// http://fb.me/prop-types-in-prod
|
|
1387
|
-
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
var propTypesExports = propTypes.exports;
|
|
1391
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
1392
|
-
|
|
1393
|
-
function rng$1() {
|
|
1394
|
-
return crypto$1.randomBytes(16);
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
/**
|
|
1398
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
1399
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
1400
|
-
*/
|
|
1401
|
-
var byteToHex$1 = [];
|
|
1402
|
-
|
|
1403
|
-
for (var i = 0; i < 256; ++i) {
|
|
1404
|
-
byteToHex$1[i] = (i + 0x100).toString(16).substr(1);
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
function bytesToUuid(buf, offset) {
|
|
1408
|
-
var i = offset || 0;
|
|
1409
|
-
var bth = byteToHex$1; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
|
1410
|
-
|
|
1411
|
-
return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
function v4$1(options, buf, offset) {
|
|
1415
|
-
var i = buf && offset || 0;
|
|
1416
|
-
|
|
1417
|
-
if (typeof options == 'string') {
|
|
1418
|
-
buf = options === 'binary' ? new Array(16) : null;
|
|
1419
|
-
options = null;
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
options = options || {};
|
|
1423
|
-
var rnds = options.random || (options.rng || rng$1)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
1424
|
-
|
|
1425
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
1426
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
1427
|
-
|
|
1428
|
-
if (buf) {
|
|
1429
|
-
for (var ii = 0; ii < 16; ++ii) {
|
|
1430
|
-
buf[i + ii] = rnds[ii];
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
return buf || bytesToUuid(rnds);
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
function ownKeys$2(object, enumerableOnly) {
|
|
1438
|
-
var keys = Object.keys(object);
|
|
1439
|
-
if (Object.getOwnPropertySymbols) {
|
|
1440
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
1441
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
1442
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1443
|
-
})), keys.push.apply(keys, symbols);
|
|
1444
|
-
}
|
|
1445
|
-
return keys;
|
|
1446
|
-
}
|
|
1447
|
-
function _objectSpread2(target) {
|
|
1448
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1449
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
1450
|
-
i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
|
|
1451
|
-
_defineProperty(target, key, source[key]);
|
|
1452
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
|
|
1453
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1454
|
-
});
|
|
1455
|
-
}
|
|
1456
|
-
return target;
|
|
1457
|
-
}
|
|
1458
|
-
function _classCallCheck(instance, Constructor) {
|
|
1459
|
-
if (!(instance instanceof Constructor)) {
|
|
1460
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
function _defineProperties(target, props) {
|
|
1464
|
-
for (var i = 0; i < props.length; i++) {
|
|
1465
|
-
var descriptor = props[i];
|
|
1466
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1467
|
-
descriptor.configurable = true;
|
|
1468
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1469
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
1473
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
1474
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
1475
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
1476
|
-
writable: false
|
|
1477
|
-
});
|
|
1478
|
-
return Constructor;
|
|
1479
|
-
}
|
|
1480
|
-
function _defineProperty(obj, key, value) {
|
|
1481
|
-
if (key in obj) {
|
|
1482
|
-
Object.defineProperty(obj, key, {
|
|
1483
|
-
value: value,
|
|
1484
|
-
enumerable: true,
|
|
1485
|
-
configurable: true,
|
|
1486
|
-
writable: true
|
|
1487
|
-
});
|
|
1488
|
-
} else {
|
|
1489
|
-
obj[key] = value;
|
|
1490
|
-
}
|
|
1491
|
-
return obj;
|
|
1492
|
-
}
|
|
1493
|
-
function _extends() {
|
|
1494
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1495
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1496
|
-
var source = arguments[i];
|
|
1497
|
-
for (var key in source) {
|
|
1498
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1499
|
-
target[key] = source[key];
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
return target;
|
|
1504
|
-
};
|
|
1505
|
-
return _extends.apply(this, arguments);
|
|
1506
|
-
}
|
|
1507
|
-
function _inherits(subClass, superClass) {
|
|
1508
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
1509
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
1510
|
-
}
|
|
1511
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
1512
|
-
constructor: {
|
|
1513
|
-
value: subClass,
|
|
1514
|
-
writable: true,
|
|
1515
|
-
configurable: true
|
|
1516
|
-
}
|
|
1517
|
-
});
|
|
1518
|
-
Object.defineProperty(subClass, "prototype", {
|
|
1519
|
-
writable: false
|
|
1520
|
-
});
|
|
1521
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
1522
|
-
}
|
|
1523
|
-
function _getPrototypeOf(o) {
|
|
1524
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
1525
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
1526
|
-
};
|
|
1527
|
-
return _getPrototypeOf(o);
|
|
1528
|
-
}
|
|
1529
|
-
function _setPrototypeOf(o, p) {
|
|
1530
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
1531
|
-
o.__proto__ = p;
|
|
1532
|
-
return o;
|
|
1533
|
-
};
|
|
1534
|
-
return _setPrototypeOf(o, p);
|
|
1535
|
-
}
|
|
1536
|
-
function _isNativeReflectConstruct() {
|
|
1537
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
1538
|
-
if (Reflect.construct.sham) return false;
|
|
1539
|
-
if (typeof Proxy === "function") return true;
|
|
1540
|
-
try {
|
|
1541
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
1542
|
-
return true;
|
|
1543
|
-
} catch (e) {
|
|
1544
|
-
return false;
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
function _assertThisInitialized(self) {
|
|
1548
|
-
if (self === void 0) {
|
|
1549
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1550
|
-
}
|
|
1551
|
-
return self;
|
|
1552
|
-
}
|
|
1553
|
-
function _possibleConstructorReturn(self, call) {
|
|
1554
|
-
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
1555
|
-
return call;
|
|
1556
|
-
} else if (call !== void 0) {
|
|
1557
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1558
|
-
}
|
|
1559
|
-
return _assertThisInitialized(self);
|
|
1560
|
-
}
|
|
1561
|
-
function _createSuper(Derived) {
|
|
1562
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
1563
|
-
return function _createSuperInternal() {
|
|
1564
|
-
var Super = _getPrototypeOf(Derived),
|
|
1565
|
-
result;
|
|
1566
|
-
if (hasNativeReflectConstruct) {
|
|
1567
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
1568
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
1569
|
-
} else {
|
|
1570
|
-
result = Super.apply(this, arguments);
|
|
1571
|
-
}
|
|
1572
|
-
return _possibleConstructorReturn(this, result);
|
|
1573
|
-
};
|
|
1574
|
-
}
|
|
1575
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
1576
|
-
if (!o) return;
|
|
1577
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1578
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1579
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1580
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1581
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1582
|
-
}
|
|
1583
|
-
function _arrayLikeToArray(arr, len) {
|
|
1584
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
1585
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1586
|
-
return arr2;
|
|
1587
|
-
}
|
|
1588
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
1589
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
1590
|
-
if (!it) {
|
|
1591
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
1592
|
-
if (it) o = it;
|
|
1593
|
-
var i = 0;
|
|
1594
|
-
var F = function () {};
|
|
1595
|
-
return {
|
|
1596
|
-
s: F,
|
|
1597
|
-
n: function () {
|
|
1598
|
-
if (i >= o.length) return {
|
|
1599
|
-
done: true
|
|
1600
|
-
};
|
|
1601
|
-
return {
|
|
1602
|
-
done: false,
|
|
1603
|
-
value: o[i++]
|
|
1604
|
-
};
|
|
1605
|
-
},
|
|
1606
|
-
e: function (e) {
|
|
1607
|
-
throw e;
|
|
1608
|
-
},
|
|
1609
|
-
f: F
|
|
1610
|
-
};
|
|
1611
|
-
}
|
|
1612
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1613
|
-
}
|
|
1614
|
-
var normalCompletion = true,
|
|
1615
|
-
didErr = false,
|
|
1616
|
-
err;
|
|
1617
|
-
return {
|
|
1618
|
-
s: function () {
|
|
1619
|
-
it = it.call(o);
|
|
1620
|
-
},
|
|
1621
|
-
n: function () {
|
|
1622
|
-
var step = it.next();
|
|
1623
|
-
normalCompletion = step.done;
|
|
1624
|
-
return step;
|
|
1625
|
-
},
|
|
1626
|
-
e: function (e) {
|
|
1627
|
-
didErr = true;
|
|
1628
|
-
err = e;
|
|
1629
|
-
},
|
|
1630
|
-
f: function () {
|
|
1631
|
-
try {
|
|
1632
|
-
if (!normalCompletion && it.return != null) it.return();
|
|
1633
|
-
} finally {
|
|
1634
|
-
if (didErr) throw err;
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
};
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
1641
|
-
|
|
1642
|
-
var check = function (it) {
|
|
1643
|
-
return it && it.Math == Math && it;
|
|
1644
|
-
};
|
|
1645
|
-
|
|
1646
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
1647
|
-
var global$a =
|
|
1648
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
1649
|
-
check(typeof globalThis == 'object' && globalThis) ||
|
|
1650
|
-
check(typeof window == 'object' && window) ||
|
|
1651
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
1652
|
-
check(typeof self == 'object' && self) ||
|
|
1653
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
1654
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
1655
|
-
(function () { return this; })() || Function('return this')();
|
|
1656
|
-
|
|
1657
|
-
var objectGetOwnPropertyDescriptor = {};
|
|
1658
|
-
|
|
1659
|
-
var fails$9 = function (exec) {
|
|
1660
|
-
try {
|
|
1661
|
-
return !!exec();
|
|
1662
|
-
} catch (error) {
|
|
1663
|
-
return true;
|
|
1664
|
-
}
|
|
1665
|
-
};
|
|
1666
|
-
|
|
1667
|
-
var fails$8 = fails$9;
|
|
1668
|
-
|
|
1669
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
1670
|
-
var descriptors = !fails$8(function () {
|
|
1671
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1672
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
1673
|
-
});
|
|
1674
|
-
|
|
1675
|
-
var fails$7 = fails$9;
|
|
1676
|
-
|
|
1677
|
-
var functionBindNative = !fails$7(function () {
|
|
1678
|
-
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
1679
|
-
var test = (function () { /* empty */ }).bind();
|
|
1680
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
1681
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
1682
|
-
});
|
|
1683
|
-
|
|
1684
|
-
var NATIVE_BIND$2 = functionBindNative;
|
|
1685
|
-
|
|
1686
|
-
var call$4 = Function.prototype.call;
|
|
1687
|
-
|
|
1688
|
-
var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
|
|
1689
|
-
return call$4.apply(call$4, arguments);
|
|
1690
|
-
};
|
|
1691
|
-
|
|
1692
|
-
var objectPropertyIsEnumerable = {};
|
|
1693
|
-
|
|
1694
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
1695
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1696
|
-
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
1697
|
-
|
|
1698
|
-
// Nashorn ~ JDK8 bug
|
|
1699
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
1700
|
-
|
|
1701
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
1702
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
1703
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
1704
|
-
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
1705
|
-
return !!descriptor && descriptor.enumerable;
|
|
1706
|
-
} : $propertyIsEnumerable;
|
|
1707
|
-
|
|
1708
|
-
var createPropertyDescriptor$2 = function (bitmap, value) {
|
|
1709
|
-
return {
|
|
1710
|
-
enumerable: !(bitmap & 1),
|
|
1711
|
-
configurable: !(bitmap & 2),
|
|
1712
|
-
writable: !(bitmap & 4),
|
|
1713
|
-
value: value
|
|
1714
|
-
};
|
|
1715
|
-
};
|
|
1716
|
-
|
|
1717
|
-
var NATIVE_BIND$1 = functionBindNative;
|
|
1718
|
-
|
|
1719
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
1720
|
-
var call$3 = FunctionPrototype$1.call;
|
|
1721
|
-
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$3, call$3);
|
|
1722
|
-
|
|
1723
|
-
var functionUncurryThisRaw = function (fn) {
|
|
1724
|
-
return NATIVE_BIND$1 ? uncurryThisWithBind(fn) : function () {
|
|
1725
|
-
return call$3.apply(fn, arguments);
|
|
1726
|
-
};
|
|
1727
|
-
};
|
|
1728
|
-
|
|
1729
|
-
var uncurryThisRaw$1 = functionUncurryThisRaw;
|
|
1730
|
-
|
|
1731
|
-
var toString$1 = uncurryThisRaw$1({}.toString);
|
|
1732
|
-
var stringSlice = uncurryThisRaw$1(''.slice);
|
|
1733
|
-
|
|
1734
|
-
var classofRaw$2 = function (it) {
|
|
1735
|
-
return stringSlice(toString$1(it), 8, -1);
|
|
1736
|
-
};
|
|
1737
|
-
|
|
1738
|
-
var classofRaw$1 = classofRaw$2;
|
|
1739
|
-
var uncurryThisRaw = functionUncurryThisRaw;
|
|
1740
|
-
|
|
1741
|
-
var functionUncurryThis = function (fn) {
|
|
1742
|
-
// Nashorn bug:
|
|
1743
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
1744
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
1745
|
-
if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
|
|
1746
|
-
};
|
|
1747
|
-
|
|
1748
|
-
var uncurryThis$9 = functionUncurryThis;
|
|
1749
|
-
var fails$6 = fails$9;
|
|
1750
|
-
var classof$3 = classofRaw$2;
|
|
1751
|
-
|
|
1752
|
-
var $Object$3 = Object;
|
|
1753
|
-
var split = uncurryThis$9(''.split);
|
|
1754
|
-
|
|
1755
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
1756
|
-
var indexedObject = fails$6(function () {
|
|
1757
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
1758
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
1759
|
-
return !$Object$3('z').propertyIsEnumerable(0);
|
|
1760
|
-
}) ? function (it) {
|
|
1761
|
-
return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
|
|
1762
|
-
} : $Object$3;
|
|
1763
|
-
|
|
1764
|
-
// we can't use just `it == null` since of `document.all` special case
|
|
1765
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
1766
|
-
var isNullOrUndefined$2 = function (it) {
|
|
1767
|
-
return it === null || it === undefined;
|
|
1768
|
-
};
|
|
1769
|
-
|
|
1770
|
-
var isNullOrUndefined$1 = isNullOrUndefined$2;
|
|
1771
|
-
|
|
1772
|
-
var $TypeError$5 = TypeError;
|
|
1773
|
-
|
|
1774
|
-
// `RequireObjectCoercible` abstract operation
|
|
1775
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
1776
|
-
var requireObjectCoercible$2 = function (it) {
|
|
1777
|
-
if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
|
|
1778
|
-
return it;
|
|
1779
|
-
};
|
|
1780
|
-
|
|
1781
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
1782
|
-
var IndexedObject$1 = indexedObject;
|
|
1783
|
-
var requireObjectCoercible$1 = requireObjectCoercible$2;
|
|
1784
|
-
|
|
1785
|
-
var toIndexedObject$4 = function (it) {
|
|
1786
|
-
return IndexedObject$1(requireObjectCoercible$1(it));
|
|
1787
|
-
};
|
|
1788
|
-
|
|
1789
|
-
var documentAll$2 = typeof document == 'object' && document.all;
|
|
1790
|
-
|
|
1791
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
1792
|
-
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
1793
|
-
|
|
1794
|
-
var documentAll_1 = {
|
|
1795
|
-
all: documentAll$2,
|
|
1796
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
1797
|
-
};
|
|
1798
|
-
|
|
1799
|
-
var $documentAll$1 = documentAll_1;
|
|
1800
|
-
|
|
1801
|
-
var documentAll$1 = $documentAll$1.all;
|
|
1802
|
-
|
|
1803
|
-
// `IsCallable` abstract operation
|
|
1804
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
1805
|
-
var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
1806
|
-
return typeof argument == 'function' || argument === documentAll$1;
|
|
1807
|
-
} : function (argument) {
|
|
1808
|
-
return typeof argument == 'function';
|
|
1809
|
-
};
|
|
1810
|
-
|
|
1811
|
-
var isCallable$b = isCallable$c;
|
|
1812
|
-
var $documentAll = documentAll_1;
|
|
1813
|
-
|
|
1814
|
-
var documentAll = $documentAll.all;
|
|
1815
|
-
|
|
1816
|
-
var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
1817
|
-
return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
|
|
1818
|
-
} : function (it) {
|
|
1819
|
-
return typeof it == 'object' ? it !== null : isCallable$b(it);
|
|
1820
|
-
};
|
|
1821
|
-
|
|
1822
|
-
var global$9 = global$a;
|
|
1823
|
-
var isCallable$a = isCallable$c;
|
|
1824
|
-
|
|
1825
|
-
var aFunction = function (argument) {
|
|
1826
|
-
return isCallable$a(argument) ? argument : undefined;
|
|
1827
|
-
};
|
|
1828
|
-
|
|
1829
|
-
var getBuiltIn$5 = function (namespace, method) {
|
|
1830
|
-
return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
|
|
1831
|
-
};
|
|
1832
|
-
|
|
1833
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
1834
|
-
|
|
1835
|
-
var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
|
|
1836
|
-
|
|
1837
|
-
var getBuiltIn$4 = getBuiltIn$5;
|
|
1838
|
-
|
|
1839
|
-
var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
|
|
1840
|
-
|
|
1841
|
-
var global$8 = global$a;
|
|
1842
|
-
var userAgent = engineUserAgent;
|
|
1843
|
-
|
|
1844
|
-
var process$1 = global$8.process;
|
|
1845
|
-
var Deno = global$8.Deno;
|
|
1846
|
-
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
|
1847
|
-
var v8 = versions && versions.v8;
|
|
1848
|
-
var match, version;
|
|
1849
|
-
|
|
1850
|
-
if (v8) {
|
|
1851
|
-
match = v8.split('.');
|
|
1852
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
1853
|
-
// but their correct versions are not interesting for us
|
|
1854
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
1858
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
1859
|
-
if (!version && userAgent) {
|
|
1860
|
-
match = userAgent.match(/Edge\/(\d+)/);
|
|
1861
|
-
if (!match || match[1] >= 74) {
|
|
1862
|
-
match = userAgent.match(/Chrome\/(\d+)/);
|
|
1863
|
-
if (match) version = +match[1];
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
var engineV8Version = version;
|
|
1868
|
-
|
|
1869
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
1870
|
-
|
|
1871
|
-
var V8_VERSION = engineV8Version;
|
|
1872
|
-
var fails$5 = fails$9;
|
|
1873
|
-
|
|
1874
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
1875
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
|
|
1876
|
-
var symbol = Symbol();
|
|
1877
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
1878
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
1879
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
1880
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
1881
|
-
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
1882
|
-
});
|
|
1883
|
-
|
|
1884
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
1885
|
-
|
|
1886
|
-
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
1887
|
-
|
|
1888
|
-
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
1889
|
-
&& !Symbol.sham
|
|
1890
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
1891
|
-
|
|
1892
|
-
var getBuiltIn$3 = getBuiltIn$5;
|
|
1893
|
-
var isCallable$9 = isCallable$c;
|
|
1894
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
1895
|
-
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
1896
|
-
|
|
1897
|
-
var $Object$2 = Object;
|
|
1898
|
-
|
|
1899
|
-
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
1900
|
-
return typeof it == 'symbol';
|
|
1901
|
-
} : function (it) {
|
|
1902
|
-
var $Symbol = getBuiltIn$3('Symbol');
|
|
1903
|
-
return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
|
|
1904
|
-
};
|
|
1905
|
-
|
|
1906
|
-
var $String$1 = String;
|
|
1907
|
-
|
|
1908
|
-
var tryToString$1 = function (argument) {
|
|
1909
|
-
try {
|
|
1910
|
-
return $String$1(argument);
|
|
1911
|
-
} catch (error) {
|
|
1912
|
-
return 'Object';
|
|
1913
|
-
}
|
|
1914
|
-
};
|
|
1915
|
-
|
|
1916
|
-
var isCallable$8 = isCallable$c;
|
|
1917
|
-
var tryToString = tryToString$1;
|
|
1918
|
-
|
|
1919
|
-
var $TypeError$4 = TypeError;
|
|
1920
|
-
|
|
1921
|
-
// `Assert: IsCallable(argument) is true`
|
|
1922
|
-
var aCallable$2 = function (argument) {
|
|
1923
|
-
if (isCallable$8(argument)) return argument;
|
|
1924
|
-
throw $TypeError$4(tryToString(argument) + ' is not a function');
|
|
1925
|
-
};
|
|
1926
|
-
|
|
1927
|
-
var aCallable$1 = aCallable$2;
|
|
1928
|
-
var isNullOrUndefined = isNullOrUndefined$2;
|
|
1929
|
-
|
|
1930
|
-
// `GetMethod` abstract operation
|
|
1931
|
-
// https://tc39.es/ecma262/#sec-getmethod
|
|
1932
|
-
var getMethod$1 = function (V, P) {
|
|
1933
|
-
var func = V[P];
|
|
1934
|
-
return isNullOrUndefined(func) ? undefined : aCallable$1(func);
|
|
1935
|
-
};
|
|
1936
|
-
|
|
1937
|
-
var call$2 = functionCall;
|
|
1938
|
-
var isCallable$7 = isCallable$c;
|
|
1939
|
-
var isObject$5 = isObject$6;
|
|
1940
|
-
|
|
1941
|
-
var $TypeError$3 = TypeError;
|
|
1942
|
-
|
|
1943
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
1944
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
1945
|
-
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
1946
|
-
var fn, val;
|
|
1947
|
-
if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
1948
|
-
if (isCallable$7(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
|
|
1949
|
-
if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
1950
|
-
throw $TypeError$3("Can't convert object to primitive value");
|
|
1951
|
-
};
|
|
1952
|
-
|
|
1953
|
-
var shared$3 = {exports: {}};
|
|
1954
|
-
|
|
1955
|
-
var global$7 = global$a;
|
|
1956
|
-
|
|
1957
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
1958
|
-
var defineProperty$2 = Object.defineProperty;
|
|
1959
|
-
|
|
1960
|
-
var defineGlobalProperty$3 = function (key, value) {
|
|
1961
|
-
try {
|
|
1962
|
-
defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
|
|
1963
|
-
} catch (error) {
|
|
1964
|
-
global$7[key] = value;
|
|
1965
|
-
} return value;
|
|
1966
|
-
};
|
|
1967
|
-
|
|
1968
|
-
var global$6 = global$a;
|
|
1969
|
-
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
1970
|
-
|
|
1971
|
-
var SHARED = '__core-js_shared__';
|
|
1972
|
-
var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
1973
|
-
|
|
1974
|
-
var sharedStore = store$3;
|
|
1975
|
-
|
|
1976
|
-
var store$2 = sharedStore;
|
|
1977
|
-
|
|
1978
|
-
(shared$3.exports = function (key, value) {
|
|
1979
|
-
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
1980
|
-
})('versions', []).push({
|
|
1981
|
-
version: '3.25.5',
|
|
1982
|
-
mode: 'global',
|
|
1983
|
-
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
1984
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
1985
|
-
source: 'https://github.com/zloirock/core-js'
|
|
1986
|
-
});
|
|
1987
|
-
|
|
1988
|
-
var requireObjectCoercible = requireObjectCoercible$2;
|
|
1989
|
-
|
|
1990
|
-
var $Object$1 = Object;
|
|
1991
|
-
|
|
1992
|
-
// `ToObject` abstract operation
|
|
1993
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
1994
|
-
var toObject$2 = function (argument) {
|
|
1995
|
-
return $Object$1(requireObjectCoercible(argument));
|
|
1996
|
-
};
|
|
1997
|
-
|
|
1998
|
-
var uncurryThis$7 = functionUncurryThis;
|
|
1999
|
-
var toObject$1 = toObject$2;
|
|
2000
|
-
|
|
2001
|
-
var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
|
|
2002
|
-
|
|
2003
|
-
// `HasOwnProperty` abstract operation
|
|
2004
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
2005
|
-
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
2006
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
2007
|
-
return hasOwnProperty(toObject$1(it), key);
|
|
2008
|
-
};
|
|
2009
|
-
|
|
2010
|
-
var uncurryThis$6 = functionUncurryThis;
|
|
2011
|
-
|
|
2012
|
-
var id = 0;
|
|
2013
|
-
var postfix = Math.random();
|
|
2014
|
-
var toString = uncurryThis$6(1.0.toString);
|
|
2015
|
-
|
|
2016
|
-
var uid$2 = function (key) {
|
|
2017
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
2018
|
-
};
|
|
2019
|
-
|
|
2020
|
-
var global$5 = global$a;
|
|
2021
|
-
var shared$2 = shared$3.exports;
|
|
2022
|
-
var hasOwn$6 = hasOwnProperty_1;
|
|
2023
|
-
var uid$1 = uid$2;
|
|
2024
|
-
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
2025
|
-
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
2026
|
-
|
|
2027
|
-
var WellKnownSymbolsStore = shared$2('wks');
|
|
2028
|
-
var Symbol$1 = global$5.Symbol;
|
|
2029
|
-
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
2030
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
2031
|
-
|
|
2032
|
-
var wellKnownSymbol$5 = function (name) {
|
|
2033
|
-
if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
2034
|
-
var description = 'Symbol.' + name;
|
|
2035
|
-
if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
|
|
2036
|
-
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
2037
|
-
} else if (USE_SYMBOL_AS_UID && symbolFor) {
|
|
2038
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
2039
|
-
} else {
|
|
2040
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
2041
|
-
}
|
|
2042
|
-
} return WellKnownSymbolsStore[name];
|
|
2043
|
-
};
|
|
2044
|
-
|
|
2045
|
-
var call$1 = functionCall;
|
|
2046
|
-
var isObject$4 = isObject$6;
|
|
2047
|
-
var isSymbol$1 = isSymbol$2;
|
|
2048
|
-
var getMethod = getMethod$1;
|
|
2049
|
-
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
2050
|
-
var wellKnownSymbol$4 = wellKnownSymbol$5;
|
|
2051
|
-
|
|
2052
|
-
var $TypeError$2 = TypeError;
|
|
2053
|
-
var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
|
|
2054
|
-
|
|
2055
|
-
// `ToPrimitive` abstract operation
|
|
2056
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
2057
|
-
var toPrimitive$1 = function (input, pref) {
|
|
2058
|
-
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
2059
|
-
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
2060
|
-
var result;
|
|
2061
|
-
if (exoticToPrim) {
|
|
2062
|
-
if (pref === undefined) pref = 'default';
|
|
2063
|
-
result = call$1(exoticToPrim, input, pref);
|
|
2064
|
-
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
2065
|
-
throw $TypeError$2("Can't convert object to primitive value");
|
|
2066
|
-
}
|
|
2067
|
-
if (pref === undefined) pref = 'number';
|
|
2068
|
-
return ordinaryToPrimitive(input, pref);
|
|
2069
|
-
};
|
|
2070
|
-
|
|
2071
|
-
var toPrimitive = toPrimitive$1;
|
|
2072
|
-
var isSymbol = isSymbol$2;
|
|
2073
|
-
|
|
2074
|
-
// `ToPropertyKey` abstract operation
|
|
2075
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
2076
|
-
var toPropertyKey$2 = function (argument) {
|
|
2077
|
-
var key = toPrimitive(argument, 'string');
|
|
2078
|
-
return isSymbol(key) ? key : key + '';
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
|
-
var global$4 = global$a;
|
|
2082
|
-
var isObject$3 = isObject$6;
|
|
2083
|
-
|
|
2084
|
-
var document$1 = global$4.document;
|
|
2085
|
-
// typeof document.createElement is 'object' in old IE
|
|
2086
|
-
var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
|
|
2087
|
-
|
|
2088
|
-
var documentCreateElement$1 = function (it) {
|
|
2089
|
-
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
2090
|
-
};
|
|
2091
|
-
|
|
2092
|
-
var DESCRIPTORS$7 = descriptors;
|
|
2093
|
-
var fails$4 = fails$9;
|
|
2094
|
-
var createElement = documentCreateElement$1;
|
|
2095
|
-
|
|
2096
|
-
// Thanks to IE8 for its funny defineProperty
|
|
2097
|
-
var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
|
|
2098
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
2099
|
-
return Object.defineProperty(createElement('div'), 'a', {
|
|
2100
|
-
get: function () { return 7; }
|
|
2101
|
-
}).a != 7;
|
|
2102
|
-
});
|
|
2103
|
-
|
|
2104
|
-
var DESCRIPTORS$6 = descriptors;
|
|
2105
|
-
var call = functionCall;
|
|
2106
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
2107
|
-
var createPropertyDescriptor$1 = createPropertyDescriptor$2;
|
|
2108
|
-
var toIndexedObject$3 = toIndexedObject$4;
|
|
2109
|
-
var toPropertyKey$1 = toPropertyKey$2;
|
|
2110
|
-
var hasOwn$5 = hasOwnProperty_1;
|
|
2111
|
-
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
2112
|
-
|
|
2113
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
2114
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
2115
|
-
|
|
2116
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
2117
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
2118
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
2119
|
-
O = toIndexedObject$3(O);
|
|
2120
|
-
P = toPropertyKey$1(P);
|
|
2121
|
-
if (IE8_DOM_DEFINE$1) try {
|
|
2122
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
2123
|
-
} catch (error) { /* empty */ }
|
|
2124
|
-
if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
|
-
var objectDefineProperty = {};
|
|
2128
|
-
|
|
2129
|
-
var DESCRIPTORS$5 = descriptors;
|
|
2130
|
-
var fails$3 = fails$9;
|
|
2131
|
-
|
|
2132
|
-
// V8 ~ Chrome 36-
|
|
2133
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
2134
|
-
var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
|
|
2135
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
2136
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
2137
|
-
value: 42,
|
|
2138
|
-
writable: false
|
|
2139
|
-
}).prototype != 42;
|
|
2140
|
-
});
|
|
2141
|
-
|
|
2142
|
-
var isObject$2 = isObject$6;
|
|
2143
|
-
|
|
2144
|
-
var $String = String;
|
|
2145
|
-
var $TypeError$1 = TypeError;
|
|
2146
|
-
|
|
2147
|
-
// `Assert: Type(argument) is Object`
|
|
2148
|
-
var anObject$4 = function (argument) {
|
|
2149
|
-
if (isObject$2(argument)) return argument;
|
|
2150
|
-
throw $TypeError$1($String(argument) + ' is not an object');
|
|
2151
|
-
};
|
|
2152
|
-
|
|
2153
|
-
var DESCRIPTORS$4 = descriptors;
|
|
2154
|
-
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
2155
|
-
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
2156
|
-
var anObject$3 = anObject$4;
|
|
2157
|
-
var toPropertyKey = toPropertyKey$2;
|
|
2158
|
-
|
|
2159
|
-
var $TypeError = TypeError;
|
|
2160
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
2161
|
-
var $defineProperty = Object.defineProperty;
|
|
2162
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
2163
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
2164
|
-
var ENUMERABLE = 'enumerable';
|
|
2165
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
2166
|
-
var WRITABLE = 'writable';
|
|
2167
|
-
|
|
2168
|
-
// `Object.defineProperty` method
|
|
2169
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
2170
|
-
objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
2171
|
-
anObject$3(O);
|
|
2172
|
-
P = toPropertyKey(P);
|
|
2173
|
-
anObject$3(Attributes);
|
|
2174
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
2175
|
-
var current = $getOwnPropertyDescriptor(O, P);
|
|
2176
|
-
if (current && current[WRITABLE]) {
|
|
2177
|
-
O[P] = Attributes.value;
|
|
2178
|
-
Attributes = {
|
|
2179
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
2180
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
2181
|
-
writable: false
|
|
2182
|
-
};
|
|
2183
|
-
}
|
|
2184
|
-
} return $defineProperty(O, P, Attributes);
|
|
2185
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
2186
|
-
anObject$3(O);
|
|
2187
|
-
P = toPropertyKey(P);
|
|
2188
|
-
anObject$3(Attributes);
|
|
2189
|
-
if (IE8_DOM_DEFINE) try {
|
|
2190
|
-
return $defineProperty(O, P, Attributes);
|
|
2191
|
-
} catch (error) { /* empty */ }
|
|
2192
|
-
if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
|
|
2193
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
2194
|
-
return O;
|
|
2195
|
-
};
|
|
2196
|
-
|
|
2197
|
-
var DESCRIPTORS$3 = descriptors;
|
|
2198
|
-
var definePropertyModule$3 = objectDefineProperty;
|
|
2199
|
-
var createPropertyDescriptor = createPropertyDescriptor$2;
|
|
2200
|
-
|
|
2201
|
-
var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
|
|
2202
|
-
return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
|
|
2203
|
-
} : function (object, key, value) {
|
|
2204
|
-
object[key] = value;
|
|
2205
|
-
return object;
|
|
2206
|
-
};
|
|
2207
|
-
|
|
2208
|
-
var makeBuiltIn$2 = {exports: {}};
|
|
2209
|
-
|
|
2210
|
-
var DESCRIPTORS$2 = descriptors;
|
|
2211
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
2212
|
-
|
|
2213
|
-
var FunctionPrototype = Function.prototype;
|
|
2214
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
2215
|
-
var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
|
|
2216
|
-
|
|
2217
|
-
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
|
2218
|
-
// additional protection from minified / mangled / dropped function names
|
|
2219
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
2220
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
2221
|
-
|
|
2222
|
-
var functionName = {
|
|
2223
|
-
EXISTS: EXISTS,
|
|
2224
|
-
PROPER: PROPER,
|
|
2225
|
-
CONFIGURABLE: CONFIGURABLE
|
|
2226
|
-
};
|
|
2227
|
-
|
|
2228
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
2229
|
-
var isCallable$6 = isCallable$c;
|
|
2230
|
-
var store$1 = sharedStore;
|
|
2231
|
-
|
|
2232
|
-
var functionToString = uncurryThis$5(Function.toString);
|
|
2233
|
-
|
|
2234
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
2235
|
-
if (!isCallable$6(store$1.inspectSource)) {
|
|
2236
|
-
store$1.inspectSource = function (it) {
|
|
2237
|
-
return functionToString(it);
|
|
2238
|
-
};
|
|
2239
|
-
}
|
|
2240
|
-
|
|
2241
|
-
var inspectSource$2 = store$1.inspectSource;
|
|
2242
|
-
|
|
2243
|
-
var global$3 = global$a;
|
|
2244
|
-
var isCallable$5 = isCallable$c;
|
|
2245
|
-
|
|
2246
|
-
var WeakMap$1 = global$3.WeakMap;
|
|
2247
|
-
|
|
2248
|
-
var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
2249
|
-
|
|
2250
|
-
var shared$1 = shared$3.exports;
|
|
2251
|
-
var uid = uid$2;
|
|
2252
|
-
|
|
2253
|
-
var keys = shared$1('keys');
|
|
2254
|
-
|
|
2255
|
-
var sharedKey$2 = function (key) {
|
|
2256
|
-
return keys[key] || (keys[key] = uid(key));
|
|
2257
|
-
};
|
|
2258
|
-
|
|
2259
|
-
var hiddenKeys$4 = {};
|
|
2260
|
-
|
|
2261
|
-
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
2262
|
-
var global$2 = global$a;
|
|
2263
|
-
var isObject$1 = isObject$6;
|
|
2264
|
-
var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
|
|
2265
|
-
var hasOwn$3 = hasOwnProperty_1;
|
|
2266
|
-
var shared = sharedStore;
|
|
2267
|
-
var sharedKey$1 = sharedKey$2;
|
|
2268
|
-
var hiddenKeys$3 = hiddenKeys$4;
|
|
2269
|
-
|
|
2270
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
2271
|
-
var TypeError$1 = global$2.TypeError;
|
|
2272
|
-
var WeakMap = global$2.WeakMap;
|
|
2273
|
-
var set, get, has;
|
|
2274
|
-
|
|
2275
|
-
var enforce = function (it) {
|
|
2276
|
-
return has(it) ? get(it) : set(it, {});
|
|
2277
|
-
};
|
|
2278
|
-
|
|
2279
|
-
var getterFor = function (TYPE) {
|
|
2280
|
-
return function (it) {
|
|
2281
|
-
var state;
|
|
2282
|
-
if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
|
|
2283
|
-
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
2284
|
-
} return state;
|
|
2285
|
-
};
|
|
2286
|
-
};
|
|
2287
|
-
|
|
2288
|
-
if (NATIVE_WEAK_MAP || shared.state) {
|
|
2289
|
-
var store = shared.state || (shared.state = new WeakMap());
|
|
2290
|
-
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
2291
|
-
store.get = store.get;
|
|
2292
|
-
store.has = store.has;
|
|
2293
|
-
store.set = store.set;
|
|
2294
|
-
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
2295
|
-
set = function (it, metadata) {
|
|
2296
|
-
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
2297
|
-
metadata.facade = it;
|
|
2298
|
-
store.set(it, metadata);
|
|
2299
|
-
return metadata;
|
|
2300
|
-
};
|
|
2301
|
-
get = function (it) {
|
|
2302
|
-
return store.get(it) || {};
|
|
2303
|
-
};
|
|
2304
|
-
has = function (it) {
|
|
2305
|
-
return store.has(it);
|
|
2306
|
-
};
|
|
2307
|
-
} else {
|
|
2308
|
-
var STATE = sharedKey$1('state');
|
|
2309
|
-
hiddenKeys$3[STATE] = true;
|
|
2310
|
-
set = function (it, metadata) {
|
|
2311
|
-
if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
2312
|
-
metadata.facade = it;
|
|
2313
|
-
createNonEnumerableProperty$1(it, STATE, metadata);
|
|
2314
|
-
return metadata;
|
|
2315
|
-
};
|
|
2316
|
-
get = function (it) {
|
|
2317
|
-
return hasOwn$3(it, STATE) ? it[STATE] : {};
|
|
2318
|
-
};
|
|
2319
|
-
has = function (it) {
|
|
2320
|
-
return hasOwn$3(it, STATE);
|
|
2321
|
-
};
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
var internalState = {
|
|
2325
|
-
set: set,
|
|
2326
|
-
get: get,
|
|
2327
|
-
has: has,
|
|
2328
|
-
enforce: enforce,
|
|
2329
|
-
getterFor: getterFor
|
|
2330
|
-
};
|
|
2331
|
-
|
|
2332
|
-
var fails$2 = fails$9;
|
|
2333
|
-
var isCallable$4 = isCallable$c;
|
|
2334
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
2335
|
-
var DESCRIPTORS$1 = descriptors;
|
|
2336
|
-
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
2337
|
-
var inspectSource$1 = inspectSource$2;
|
|
2338
|
-
var InternalStateModule = internalState;
|
|
2339
|
-
|
|
2340
|
-
var enforceInternalState = InternalStateModule.enforce;
|
|
2341
|
-
var getInternalState = InternalStateModule.get;
|
|
2342
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
2343
|
-
var defineProperty$1 = Object.defineProperty;
|
|
2344
|
-
|
|
2345
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
|
|
2346
|
-
return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
2347
|
-
});
|
|
2348
|
-
|
|
2349
|
-
var TEMPLATE = String(String).split('String');
|
|
2350
|
-
|
|
2351
|
-
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
2352
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
2353
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
2354
|
-
}
|
|
2355
|
-
if (options && options.getter) name = 'get ' + name;
|
|
2356
|
-
if (options && options.setter) name = 'set ' + name;
|
|
2357
|
-
if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
2358
|
-
if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
|
|
2359
|
-
else value.name = name;
|
|
2360
|
-
}
|
|
2361
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
|
|
2362
|
-
defineProperty$1(value, 'length', { value: options.arity });
|
|
2363
|
-
}
|
|
2364
|
-
try {
|
|
2365
|
-
if (options && hasOwn$2(options, 'constructor') && options.constructor) {
|
|
2366
|
-
if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
|
|
2367
|
-
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
2368
|
-
} else if (value.prototype) value.prototype = undefined;
|
|
2369
|
-
} catch (error) { /* empty */ }
|
|
2370
|
-
var state = enforceInternalState(value);
|
|
2371
|
-
if (!hasOwn$2(state, 'source')) {
|
|
2372
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
2373
|
-
} return value;
|
|
2374
|
-
};
|
|
2375
|
-
|
|
2376
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
2377
|
-
// eslint-disable-next-line no-extend-native -- required
|
|
2378
|
-
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
2379
|
-
return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
|
|
2380
|
-
}, 'toString');
|
|
2381
|
-
|
|
2382
|
-
var isCallable$3 = isCallable$c;
|
|
2383
|
-
var definePropertyModule$2 = objectDefineProperty;
|
|
2384
|
-
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
2385
|
-
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
2386
|
-
|
|
2387
|
-
var defineBuiltIn$1 = function (O, key, value, options) {
|
|
2388
|
-
if (!options) options = {};
|
|
2389
|
-
var simple = options.enumerable;
|
|
2390
|
-
var name = options.name !== undefined ? options.name : key;
|
|
2391
|
-
if (isCallable$3(value)) makeBuiltIn(value, name, options);
|
|
2392
|
-
if (options.global) {
|
|
2393
|
-
if (simple) O[key] = value;
|
|
2394
|
-
else defineGlobalProperty$1(key, value);
|
|
2395
|
-
} else {
|
|
2396
|
-
try {
|
|
2397
|
-
if (!options.unsafe) delete O[key];
|
|
2398
|
-
else if (O[key]) simple = true;
|
|
2399
|
-
} catch (error) { /* empty */ }
|
|
2400
|
-
if (simple) O[key] = value;
|
|
2401
|
-
else definePropertyModule$2.f(O, key, {
|
|
2402
|
-
value: value,
|
|
2403
|
-
enumerable: false,
|
|
2404
|
-
configurable: !options.nonConfigurable,
|
|
2405
|
-
writable: !options.nonWritable
|
|
2406
|
-
});
|
|
2407
|
-
} return O;
|
|
2408
|
-
};
|
|
2409
|
-
|
|
2410
|
-
var objectGetOwnPropertyNames = {};
|
|
2411
|
-
|
|
2412
|
-
var ceil = Math.ceil;
|
|
2413
|
-
var floor = Math.floor;
|
|
2414
|
-
|
|
2415
|
-
// `Math.trunc` method
|
|
2416
|
-
// https://tc39.es/ecma262/#sec-math.trunc
|
|
2417
|
-
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
2418
|
-
var mathTrunc = Math.trunc || function trunc(x) {
|
|
2419
|
-
var n = +x;
|
|
2420
|
-
return (n > 0 ? floor : ceil)(n);
|
|
2421
|
-
};
|
|
2422
|
-
|
|
2423
|
-
var trunc = mathTrunc;
|
|
2424
|
-
|
|
2425
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
2426
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
2427
|
-
var toIntegerOrInfinity$2 = function (argument) {
|
|
2428
|
-
var number = +argument;
|
|
2429
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
2430
|
-
return number !== number || number === 0 ? 0 : trunc(number);
|
|
2431
|
-
};
|
|
2432
|
-
|
|
2433
|
-
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
2434
|
-
|
|
2435
|
-
var max = Math.max;
|
|
2436
|
-
var min$1 = Math.min;
|
|
2437
|
-
|
|
2438
|
-
// Helper for a popular repeating case of the spec:
|
|
2439
|
-
// Let integer be ? ToInteger(index).
|
|
2440
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
2441
|
-
var toAbsoluteIndex$1 = function (index, length) {
|
|
2442
|
-
var integer = toIntegerOrInfinity$1(index);
|
|
2443
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
2444
|
-
};
|
|
2445
|
-
|
|
2446
|
-
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
2447
|
-
|
|
2448
|
-
var min = Math.min;
|
|
2449
|
-
|
|
2450
|
-
// `ToLength` abstract operation
|
|
2451
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
2452
|
-
var toLength$1 = function (argument) {
|
|
2453
|
-
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
2454
|
-
};
|
|
2455
|
-
|
|
2456
|
-
var toLength = toLength$1;
|
|
2457
|
-
|
|
2458
|
-
// `LengthOfArrayLike` abstract operation
|
|
2459
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
2460
|
-
var lengthOfArrayLike$2 = function (obj) {
|
|
2461
|
-
return toLength(obj.length);
|
|
2462
|
-
};
|
|
2463
|
-
|
|
2464
|
-
var toIndexedObject$2 = toIndexedObject$4;
|
|
2465
|
-
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
2466
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$2;
|
|
2467
|
-
|
|
2468
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
2469
|
-
var createMethod$1 = function (IS_INCLUDES) {
|
|
2470
|
-
return function ($this, el, fromIndex) {
|
|
2471
|
-
var O = toIndexedObject$2($this);
|
|
2472
|
-
var length = lengthOfArrayLike$1(O);
|
|
2473
|
-
var index = toAbsoluteIndex(fromIndex, length);
|
|
2474
|
-
var value;
|
|
2475
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
2476
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
2477
|
-
if (IS_INCLUDES && el != el) while (length > index) {
|
|
2478
|
-
value = O[index++];
|
|
2479
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
2480
|
-
if (value != value) return true;
|
|
2481
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
2482
|
-
} else for (;length > index; index++) {
|
|
2483
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
2484
|
-
} return !IS_INCLUDES && -1;
|
|
2485
|
-
};
|
|
2486
|
-
};
|
|
2487
|
-
|
|
2488
|
-
var arrayIncludes = {
|
|
2489
|
-
// `Array.prototype.includes` method
|
|
2490
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
2491
|
-
includes: createMethod$1(true),
|
|
2492
|
-
// `Array.prototype.indexOf` method
|
|
2493
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
2494
|
-
indexOf: createMethod$1(false)
|
|
2495
|
-
};
|
|
2496
|
-
|
|
2497
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
2498
|
-
var hasOwn$1 = hasOwnProperty_1;
|
|
2499
|
-
var toIndexedObject$1 = toIndexedObject$4;
|
|
2500
|
-
var indexOf = arrayIncludes.indexOf;
|
|
2501
|
-
var hiddenKeys$2 = hiddenKeys$4;
|
|
2502
|
-
|
|
2503
|
-
var push$1 = uncurryThis$4([].push);
|
|
2504
|
-
|
|
2505
|
-
var objectKeysInternal = function (object, names) {
|
|
2506
|
-
var O = toIndexedObject$1(object);
|
|
2507
|
-
var i = 0;
|
|
2508
|
-
var result = [];
|
|
2509
|
-
var key;
|
|
2510
|
-
for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
|
|
2511
|
-
// Don't enum bug & hidden keys
|
|
2512
|
-
while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
|
|
2513
|
-
~indexOf(result, key) || push$1(result, key);
|
|
2514
|
-
}
|
|
2515
|
-
return result;
|
|
2516
|
-
};
|
|
2517
|
-
|
|
2518
|
-
// IE8- don't enum bug keys
|
|
2519
|
-
var enumBugKeys$3 = [
|
|
2520
|
-
'constructor',
|
|
2521
|
-
'hasOwnProperty',
|
|
2522
|
-
'isPrototypeOf',
|
|
2523
|
-
'propertyIsEnumerable',
|
|
2524
|
-
'toLocaleString',
|
|
2525
|
-
'toString',
|
|
2526
|
-
'valueOf'
|
|
2527
|
-
];
|
|
2528
|
-
|
|
2529
|
-
var internalObjectKeys$1 = objectKeysInternal;
|
|
2530
|
-
var enumBugKeys$2 = enumBugKeys$3;
|
|
2531
|
-
|
|
2532
|
-
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
2533
|
-
|
|
2534
|
-
// `Object.getOwnPropertyNames` method
|
|
2535
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
2536
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
2537
|
-
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
2538
|
-
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
2539
|
-
};
|
|
2540
|
-
|
|
2541
|
-
var objectGetOwnPropertySymbols = {};
|
|
2542
|
-
|
|
2543
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
2544
|
-
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
2545
|
-
|
|
2546
|
-
var getBuiltIn$2 = getBuiltIn$5;
|
|
2547
|
-
var uncurryThis$3 = functionUncurryThis;
|
|
2548
|
-
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
2549
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
2550
|
-
var anObject$2 = anObject$4;
|
|
2551
|
-
|
|
2552
|
-
var concat = uncurryThis$3([].concat);
|
|
2553
|
-
|
|
2554
|
-
// all object keys, includes non-enumerable and symbols
|
|
2555
|
-
var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
2556
|
-
var keys = getOwnPropertyNamesModule.f(anObject$2(it));
|
|
2557
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
2558
|
-
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
2559
|
-
};
|
|
2560
|
-
|
|
2561
|
-
var hasOwn = hasOwnProperty_1;
|
|
2562
|
-
var ownKeys = ownKeys$1;
|
|
2563
|
-
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
2564
|
-
var definePropertyModule$1 = objectDefineProperty;
|
|
2565
|
-
|
|
2566
|
-
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
2567
|
-
var keys = ownKeys(source);
|
|
2568
|
-
var defineProperty = definePropertyModule$1.f;
|
|
2569
|
-
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
2570
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2571
|
-
var key = keys[i];
|
|
2572
|
-
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
|
2573
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
|
|
2578
|
-
var fails$1 = fails$9;
|
|
2579
|
-
var isCallable$2 = isCallable$c;
|
|
2580
|
-
|
|
2581
|
-
var replacement = /#|\.prototype\./;
|
|
2582
|
-
|
|
2583
|
-
var isForced$1 = function (feature, detection) {
|
|
2584
|
-
var value = data[normalize(feature)];
|
|
2585
|
-
return value == POLYFILL ? true
|
|
2586
|
-
: value == NATIVE ? false
|
|
2587
|
-
: isCallable$2(detection) ? fails$1(detection)
|
|
2588
|
-
: !!detection;
|
|
2589
|
-
};
|
|
2590
|
-
|
|
2591
|
-
var normalize = isForced$1.normalize = function (string) {
|
|
2592
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
2593
|
-
};
|
|
2594
|
-
|
|
2595
|
-
var data = isForced$1.data = {};
|
|
2596
|
-
var NATIVE = isForced$1.NATIVE = 'N';
|
|
2597
|
-
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
2598
|
-
|
|
2599
|
-
var isForced_1 = isForced$1;
|
|
2600
|
-
|
|
2601
|
-
var global$1 = global$a;
|
|
2602
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
2603
|
-
var createNonEnumerableProperty = createNonEnumerableProperty$2;
|
|
2604
|
-
var defineBuiltIn = defineBuiltIn$1;
|
|
2605
|
-
var defineGlobalProperty = defineGlobalProperty$3;
|
|
2606
|
-
var copyConstructorProperties = copyConstructorProperties$1;
|
|
2607
|
-
var isForced = isForced_1;
|
|
2608
|
-
|
|
2609
|
-
/*
|
|
2610
|
-
options.target - name of the target object
|
|
2611
|
-
options.global - target is the global object
|
|
2612
|
-
options.stat - export as static methods of target
|
|
2613
|
-
options.proto - export as prototype methods of target
|
|
2614
|
-
options.real - real prototype method for the `pure` version
|
|
2615
|
-
options.forced - export even if the native feature is available
|
|
2616
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
2617
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
2618
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
2619
|
-
options.sham - add a flag to not completely full polyfills
|
|
2620
|
-
options.enumerable - export as enumerable property
|
|
2621
|
-
options.dontCallGetSet - prevent calling a getter on target
|
|
2622
|
-
options.name - the .name of the function if it does not match the key
|
|
2623
|
-
*/
|
|
2624
|
-
var _export = function (options, source) {
|
|
2625
|
-
var TARGET = options.target;
|
|
2626
|
-
var GLOBAL = options.global;
|
|
2627
|
-
var STATIC = options.stat;
|
|
2628
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
2629
|
-
if (GLOBAL) {
|
|
2630
|
-
target = global$1;
|
|
2631
|
-
} else if (STATIC) {
|
|
2632
|
-
target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
2633
|
-
} else {
|
|
2634
|
-
target = (global$1[TARGET] || {}).prototype;
|
|
2635
|
-
}
|
|
2636
|
-
if (target) for (key in source) {
|
|
2637
|
-
sourceProperty = source[key];
|
|
2638
|
-
if (options.dontCallGetSet) {
|
|
2639
|
-
descriptor = getOwnPropertyDescriptor(target, key);
|
|
2640
|
-
targetProperty = descriptor && descriptor.value;
|
|
2641
|
-
} else targetProperty = target[key];
|
|
2642
|
-
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
2643
|
-
// contained in target
|
|
2644
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
2645
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
2646
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
2647
|
-
}
|
|
2648
|
-
// add a flag to not completely full polyfills
|
|
2649
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
2650
|
-
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
2651
|
-
}
|
|
2652
|
-
defineBuiltIn(target, key, sourceProperty, options);
|
|
2653
|
-
}
|
|
2654
|
-
};
|
|
2655
|
-
|
|
2656
|
-
var uncurryThis$2 = functionUncurryThis;
|
|
2657
|
-
var aCallable = aCallable$2;
|
|
2658
|
-
var NATIVE_BIND = functionBindNative;
|
|
2659
|
-
|
|
2660
|
-
var bind$1 = uncurryThis$2(uncurryThis$2.bind);
|
|
2661
|
-
|
|
2662
|
-
// optional / simple context binding
|
|
2663
|
-
var functionBindContext = function (fn, that) {
|
|
2664
|
-
aCallable(fn);
|
|
2665
|
-
return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
|
|
2666
|
-
return fn.apply(that, arguments);
|
|
2667
|
-
};
|
|
2668
|
-
};
|
|
2669
|
-
|
|
2670
|
-
var classof$2 = classofRaw$2;
|
|
2671
|
-
|
|
2672
|
-
// `IsArray` abstract operation
|
|
2673
|
-
// https://tc39.es/ecma262/#sec-isarray
|
|
2674
|
-
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
2675
|
-
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
2676
|
-
return classof$2(argument) == 'Array';
|
|
2677
|
-
};
|
|
2678
|
-
|
|
2679
|
-
var wellKnownSymbol$3 = wellKnownSymbol$5;
|
|
2680
|
-
|
|
2681
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
|
|
2682
|
-
var test = {};
|
|
2683
|
-
|
|
2684
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
2685
|
-
|
|
2686
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
2687
|
-
|
|
2688
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
2689
|
-
var isCallable$1 = isCallable$c;
|
|
2690
|
-
var classofRaw = classofRaw$2;
|
|
2691
|
-
var wellKnownSymbol$2 = wellKnownSymbol$5;
|
|
2692
|
-
|
|
2693
|
-
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
2694
|
-
var $Object = Object;
|
|
2695
|
-
|
|
2696
|
-
// ES3 wrong here
|
|
2697
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
2698
|
-
|
|
2699
|
-
// fallback for IE11 Script Access Denied error
|
|
2700
|
-
var tryGet = function (it, key) {
|
|
2701
|
-
try {
|
|
2702
|
-
return it[key];
|
|
2703
|
-
} catch (error) { /* empty */ }
|
|
2704
|
-
};
|
|
2705
|
-
|
|
2706
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
2707
|
-
var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
2708
|
-
var O, tag, result;
|
|
2709
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
2710
|
-
// @@toStringTag case
|
|
2711
|
-
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
2712
|
-
// builtinTag case
|
|
2713
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
2714
|
-
// ES3 arguments fallback
|
|
2715
|
-
: (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
|
2716
|
-
};
|
|
2717
|
-
|
|
2718
|
-
var uncurryThis$1 = functionUncurryThis;
|
|
2719
|
-
var fails = fails$9;
|
|
2720
|
-
var isCallable = isCallable$c;
|
|
2721
|
-
var classof = classof$1;
|
|
2722
|
-
var getBuiltIn$1 = getBuiltIn$5;
|
|
2723
|
-
var inspectSource = inspectSource$2;
|
|
2724
|
-
|
|
2725
|
-
var noop = function () { /* empty */ };
|
|
2726
|
-
var empty = [];
|
|
2727
|
-
var construct = getBuiltIn$1('Reflect', 'construct');
|
|
2728
|
-
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
2729
|
-
var exec = uncurryThis$1(constructorRegExp.exec);
|
|
2730
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
2731
|
-
|
|
2732
|
-
var isConstructorModern = function isConstructor(argument) {
|
|
2733
|
-
if (!isCallable(argument)) return false;
|
|
2734
|
-
try {
|
|
2735
|
-
construct(noop, empty, argument);
|
|
2736
|
-
return true;
|
|
2737
|
-
} catch (error) {
|
|
2738
|
-
return false;
|
|
2739
|
-
}
|
|
2740
|
-
};
|
|
2741
|
-
|
|
2742
|
-
var isConstructorLegacy = function isConstructor(argument) {
|
|
2743
|
-
if (!isCallable(argument)) return false;
|
|
2744
|
-
switch (classof(argument)) {
|
|
2745
|
-
case 'AsyncFunction':
|
|
2746
|
-
case 'GeneratorFunction':
|
|
2747
|
-
case 'AsyncGeneratorFunction': return false;
|
|
2748
|
-
}
|
|
2749
|
-
try {
|
|
2750
|
-
// we can't check .prototype since constructors produced by .bind haven't it
|
|
2751
|
-
// `Function#toString` throws on some built-it function in some legacy engines
|
|
2752
|
-
// (for example, `DOMQuad` and similar in FF41-)
|
|
2753
|
-
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
2754
|
-
} catch (error) {
|
|
2755
|
-
return true;
|
|
2756
|
-
}
|
|
2757
|
-
};
|
|
2758
|
-
|
|
2759
|
-
isConstructorLegacy.sham = true;
|
|
2760
|
-
|
|
2761
|
-
// `IsConstructor` abstract operation
|
|
2762
|
-
// https://tc39.es/ecma262/#sec-isconstructor
|
|
2763
|
-
var isConstructor$1 = !construct || fails(function () {
|
|
2764
|
-
var called;
|
|
2765
|
-
return isConstructorModern(isConstructorModern.call)
|
|
2766
|
-
|| !isConstructorModern(Object)
|
|
2767
|
-
|| !isConstructorModern(function () { called = true; })
|
|
2768
|
-
|| called;
|
|
2769
|
-
}) ? isConstructorLegacy : isConstructorModern;
|
|
2770
|
-
|
|
2771
|
-
var isArray = isArray$1;
|
|
2772
|
-
var isConstructor = isConstructor$1;
|
|
2773
|
-
var isObject = isObject$6;
|
|
2774
|
-
var wellKnownSymbol$1 = wellKnownSymbol$5;
|
|
2775
|
-
|
|
2776
|
-
var SPECIES = wellKnownSymbol$1('species');
|
|
2777
|
-
var $Array = Array;
|
|
2778
|
-
|
|
2779
|
-
// a part of `ArraySpeciesCreate` abstract operation
|
|
2780
|
-
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
2781
|
-
var arraySpeciesConstructor$1 = function (originalArray) {
|
|
2782
|
-
var C;
|
|
2783
|
-
if (isArray(originalArray)) {
|
|
2784
|
-
C = originalArray.constructor;
|
|
2785
|
-
// cross-realm fallback
|
|
2786
|
-
if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
|
|
2787
|
-
else if (isObject(C)) {
|
|
2788
|
-
C = C[SPECIES];
|
|
2789
|
-
if (C === null) C = undefined;
|
|
2790
|
-
}
|
|
2791
|
-
} return C === undefined ? $Array : C;
|
|
2792
|
-
};
|
|
2793
|
-
|
|
2794
|
-
var arraySpeciesConstructor = arraySpeciesConstructor$1;
|
|
2795
|
-
|
|
2796
|
-
// `ArraySpeciesCreate` abstract operation
|
|
2797
|
-
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
2798
|
-
var arraySpeciesCreate$1 = function (originalArray, length) {
|
|
2799
|
-
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
2800
|
-
};
|
|
2801
|
-
|
|
2802
|
-
var bind = functionBindContext;
|
|
2803
|
-
var uncurryThis = functionUncurryThis;
|
|
2804
|
-
var IndexedObject = indexedObject;
|
|
2805
|
-
var toObject = toObject$2;
|
|
2806
|
-
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
2807
|
-
var arraySpeciesCreate = arraySpeciesCreate$1;
|
|
2808
|
-
|
|
2809
|
-
var push = uncurryThis([].push);
|
|
2810
|
-
|
|
2811
|
-
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
2812
|
-
var createMethod = function (TYPE) {
|
|
2813
|
-
var IS_MAP = TYPE == 1;
|
|
2814
|
-
var IS_FILTER = TYPE == 2;
|
|
2815
|
-
var IS_SOME = TYPE == 3;
|
|
2816
|
-
var IS_EVERY = TYPE == 4;
|
|
2817
|
-
var IS_FIND_INDEX = TYPE == 6;
|
|
2818
|
-
var IS_FILTER_REJECT = TYPE == 7;
|
|
2819
|
-
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
2820
|
-
return function ($this, callbackfn, that, specificCreate) {
|
|
2821
|
-
var O = toObject($this);
|
|
2822
|
-
var self = IndexedObject(O);
|
|
2823
|
-
var boundFunction = bind(callbackfn, that);
|
|
2824
|
-
var length = lengthOfArrayLike(self);
|
|
2825
|
-
var index = 0;
|
|
2826
|
-
var create = specificCreate || arraySpeciesCreate;
|
|
2827
|
-
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
|
2828
|
-
var value, result;
|
|
2829
|
-
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
2830
|
-
value = self[index];
|
|
2831
|
-
result = boundFunction(value, index, O);
|
|
2832
|
-
if (TYPE) {
|
|
2833
|
-
if (IS_MAP) target[index] = result; // map
|
|
2834
|
-
else if (result) switch (TYPE) {
|
|
2835
|
-
case 3: return true; // some
|
|
2836
|
-
case 5: return value; // find
|
|
2837
|
-
case 6: return index; // findIndex
|
|
2838
|
-
case 2: push(target, value); // filter
|
|
2839
|
-
} else switch (TYPE) {
|
|
2840
|
-
case 4: return false; // every
|
|
2841
|
-
case 7: push(target, value); // filterReject
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
|
2846
|
-
};
|
|
2847
|
-
};
|
|
2848
|
-
|
|
2849
|
-
var arrayIteration = {
|
|
2850
|
-
// `Array.prototype.forEach` method
|
|
2851
|
-
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
2852
|
-
forEach: createMethod(0),
|
|
2853
|
-
// `Array.prototype.map` method
|
|
2854
|
-
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
2855
|
-
map: createMethod(1),
|
|
2856
|
-
// `Array.prototype.filter` method
|
|
2857
|
-
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
2858
|
-
filter: createMethod(2),
|
|
2859
|
-
// `Array.prototype.some` method
|
|
2860
|
-
// https://tc39.es/ecma262/#sec-array.prototype.some
|
|
2861
|
-
some: createMethod(3),
|
|
2862
|
-
// `Array.prototype.every` method
|
|
2863
|
-
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
2864
|
-
every: createMethod(4),
|
|
2865
|
-
// `Array.prototype.find` method
|
|
2866
|
-
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
2867
|
-
find: createMethod(5),
|
|
2868
|
-
// `Array.prototype.findIndex` method
|
|
2869
|
-
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
|
2870
|
-
findIndex: createMethod(6),
|
|
2871
|
-
// `Array.prototype.filterReject` method
|
|
2872
|
-
// https://github.com/tc39/proposal-array-filtering
|
|
2873
|
-
filterReject: createMethod(7)
|
|
2874
|
-
};
|
|
2875
|
-
|
|
2876
|
-
var objectDefineProperties = {};
|
|
2877
|
-
|
|
2878
|
-
var internalObjectKeys = objectKeysInternal;
|
|
2879
|
-
var enumBugKeys$1 = enumBugKeys$3;
|
|
2880
|
-
|
|
2881
|
-
// `Object.keys` method
|
|
2882
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
2883
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
2884
|
-
var objectKeys$1 = Object.keys || function keys(O) {
|
|
2885
|
-
return internalObjectKeys(O, enumBugKeys$1);
|
|
2886
|
-
};
|
|
2887
|
-
|
|
2888
|
-
var DESCRIPTORS = descriptors;
|
|
2889
|
-
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
2890
|
-
var definePropertyModule = objectDefineProperty;
|
|
2891
|
-
var anObject$1 = anObject$4;
|
|
2892
|
-
var toIndexedObject = toIndexedObject$4;
|
|
2893
|
-
var objectKeys = objectKeys$1;
|
|
2894
|
-
|
|
2895
|
-
// `Object.defineProperties` method
|
|
2896
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
2897
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
2898
|
-
objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
2899
|
-
anObject$1(O);
|
|
2900
|
-
var props = toIndexedObject(Properties);
|
|
2901
|
-
var keys = objectKeys(Properties);
|
|
2902
|
-
var length = keys.length;
|
|
2903
|
-
var index = 0;
|
|
2904
|
-
var key;
|
|
2905
|
-
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
|
2906
|
-
return O;
|
|
2907
|
-
};
|
|
2908
|
-
|
|
2909
|
-
var getBuiltIn = getBuiltIn$5;
|
|
2910
|
-
|
|
2911
|
-
var html$1 = getBuiltIn('document', 'documentElement');
|
|
2912
|
-
|
|
2913
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
2914
|
-
|
|
2915
|
-
var anObject = anObject$4;
|
|
2916
|
-
var definePropertiesModule = objectDefineProperties;
|
|
2917
|
-
var enumBugKeys = enumBugKeys$3;
|
|
2918
|
-
var hiddenKeys = hiddenKeys$4;
|
|
2919
|
-
var html = html$1;
|
|
2920
|
-
var documentCreateElement = documentCreateElement$1;
|
|
2921
|
-
var sharedKey = sharedKey$2;
|
|
2922
|
-
|
|
2923
|
-
var GT = '>';
|
|
2924
|
-
var LT = '<';
|
|
2925
|
-
var PROTOTYPE = 'prototype';
|
|
2926
|
-
var SCRIPT = 'script';
|
|
2927
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
2928
|
-
|
|
2929
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
2930
|
-
|
|
2931
|
-
var scriptTag = function (content) {
|
|
2932
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
2933
|
-
};
|
|
2934
|
-
|
|
2935
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
2936
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
2937
|
-
activeXDocument.write(scriptTag(''));
|
|
2938
|
-
activeXDocument.close();
|
|
2939
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
2940
|
-
activeXDocument = null; // avoid memory leak
|
|
2941
|
-
return temp;
|
|
2942
|
-
};
|
|
2943
|
-
|
|
2944
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
2945
|
-
var NullProtoObjectViaIFrame = function () {
|
|
2946
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
2947
|
-
var iframe = documentCreateElement('iframe');
|
|
2948
|
-
var JS = 'java' + SCRIPT + ':';
|
|
2949
|
-
var iframeDocument;
|
|
2950
|
-
iframe.style.display = 'none';
|
|
2951
|
-
html.appendChild(iframe);
|
|
2952
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
2953
|
-
iframe.src = String(JS);
|
|
2954
|
-
iframeDocument = iframe.contentWindow.document;
|
|
2955
|
-
iframeDocument.open();
|
|
2956
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
2957
|
-
iframeDocument.close();
|
|
2958
|
-
return iframeDocument.F;
|
|
2959
|
-
};
|
|
2960
|
-
|
|
2961
|
-
// Check for document.domain and active x support
|
|
2962
|
-
// No need to use active x approach when document.domain is not set
|
|
2963
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
2964
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
2965
|
-
// avoid IE GC bug
|
|
2966
|
-
var activeXDocument;
|
|
2967
|
-
var NullProtoObject = function () {
|
|
2968
|
-
try {
|
|
2969
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
2970
|
-
} catch (error) { /* ignore */ }
|
|
2971
|
-
NullProtoObject = typeof document != 'undefined'
|
|
2972
|
-
? document.domain && activeXDocument
|
|
2973
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
2974
|
-
: NullProtoObjectViaIFrame()
|
|
2975
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
2976
|
-
var length = enumBugKeys.length;
|
|
2977
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
2978
|
-
return NullProtoObject();
|
|
2979
|
-
};
|
|
2980
|
-
|
|
2981
|
-
hiddenKeys[IE_PROTO] = true;
|
|
2982
|
-
|
|
2983
|
-
// `Object.create` method
|
|
2984
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
2985
|
-
// eslint-disable-next-line es/no-object-create -- safe
|
|
2986
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
2987
|
-
var result;
|
|
2988
|
-
if (O !== null) {
|
|
2989
|
-
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
2990
|
-
result = new EmptyConstructor();
|
|
2991
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
2992
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
2993
|
-
result[IE_PROTO] = O;
|
|
2994
|
-
} else result = NullProtoObject();
|
|
2995
|
-
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
2996
|
-
};
|
|
2997
|
-
|
|
2998
|
-
var wellKnownSymbol = wellKnownSymbol$5;
|
|
2999
|
-
var create = objectCreate;
|
|
3000
|
-
var defineProperty = objectDefineProperty.f;
|
|
3001
|
-
|
|
3002
|
-
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
3003
|
-
var ArrayPrototype = Array.prototype;
|
|
3004
|
-
|
|
3005
|
-
// Array.prototype[@@unscopables]
|
|
3006
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
3007
|
-
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
3008
|
-
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
|
3009
|
-
configurable: true,
|
|
3010
|
-
value: create(null)
|
|
3011
|
-
});
|
|
3012
|
-
}
|
|
3013
|
-
|
|
3014
|
-
// add a key to Array.prototype[@@unscopables]
|
|
3015
|
-
var addToUnscopables$1 = function (key) {
|
|
3016
|
-
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
3017
|
-
};
|
|
3018
|
-
|
|
3019
|
-
var $ = _export;
|
|
3020
|
-
var $find = arrayIteration.find;
|
|
3021
|
-
var addToUnscopables = addToUnscopables$1;
|
|
3022
|
-
|
|
3023
|
-
var FIND = 'find';
|
|
3024
|
-
var SKIPS_HOLES = true;
|
|
3025
|
-
|
|
3026
|
-
// Shouldn't skip holes
|
|
3027
|
-
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
|
3028
|
-
|
|
3029
|
-
// `Array.prototype.find` method
|
|
3030
|
-
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
3031
|
-
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
|
3032
|
-
find: function find(callbackfn /* , that = undefined */) {
|
|
3033
|
-
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
3034
|
-
}
|
|
3035
|
-
});
|
|
3036
|
-
|
|
3037
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
3038
|
-
addToUnscopables(FIND);
|
|
3039
|
-
|
|
3040
|
-
var CONSTANT = {
|
|
3041
|
-
GLOBAL: {
|
|
3042
|
-
HIDE: '__react_tooltip_hide_event',
|
|
3043
|
-
REBUILD: '__react_tooltip_rebuild_event',
|
|
3044
|
-
SHOW: '__react_tooltip_show_event'
|
|
3045
|
-
}
|
|
3046
|
-
};
|
|
3047
|
-
|
|
3048
|
-
/**
|
|
3049
|
-
* Static methods for react-tooltip
|
|
3050
|
-
*/
|
|
3051
|
-
var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
|
|
3052
|
-
// Compatible with IE
|
|
3053
|
-
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
|
|
3054
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
|
|
3055
|
-
var event;
|
|
3056
|
-
if (typeof window.CustomEvent === 'function') {
|
|
3057
|
-
event = new window.CustomEvent(eventName, {
|
|
3058
|
-
detail: opts
|
|
3059
|
-
});
|
|
3060
|
-
} else {
|
|
3061
|
-
event = document.createEvent('Event');
|
|
3062
|
-
event.initEvent(eventName, false, true, opts);
|
|
3063
|
-
}
|
|
3064
|
-
window.dispatchEvent(event);
|
|
3065
|
-
};
|
|
3066
|
-
function staticMethods (target) {
|
|
3067
|
-
/**
|
|
3068
|
-
* Hide all tooltip
|
|
3069
|
-
* @trigger ReactTooltip.hide()
|
|
3070
|
-
*/
|
|
3071
|
-
target.hide = function (target) {
|
|
3072
|
-
dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
|
|
3073
|
-
target: target
|
|
3074
|
-
});
|
|
3075
|
-
};
|
|
3076
|
-
|
|
3077
|
-
/**
|
|
3078
|
-
* Rebuild all tooltip
|
|
3079
|
-
* @trigger ReactTooltip.rebuild()
|
|
3080
|
-
*/
|
|
3081
|
-
target.rebuild = function () {
|
|
3082
|
-
dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
|
|
3083
|
-
};
|
|
3084
|
-
|
|
3085
|
-
/**
|
|
3086
|
-
* Show specific tooltip
|
|
3087
|
-
* @trigger ReactTooltip.show()
|
|
3088
|
-
*/
|
|
3089
|
-
target.show = function (target) {
|
|
3090
|
-
dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
|
|
3091
|
-
target: target
|
|
3092
|
-
});
|
|
3093
|
-
};
|
|
3094
|
-
target.prototype.globalRebuild = function () {
|
|
3095
|
-
if (this.mount) {
|
|
3096
|
-
this.unbindListener();
|
|
3097
|
-
this.bindListener();
|
|
3098
|
-
}
|
|
3099
|
-
};
|
|
3100
|
-
target.prototype.globalShow = function (event) {
|
|
3101
|
-
if (this.mount) {
|
|
3102
|
-
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
3103
|
-
// Create a fake event, specific show will limit the type to `solid`
|
|
3104
|
-
// only `float` type cares e.clientX e.clientY
|
|
3105
|
-
this.showTooltip({
|
|
3106
|
-
currentTarget: hasTarget && event.detail.target
|
|
3107
|
-
}, true);
|
|
3108
|
-
}
|
|
3109
|
-
};
|
|
3110
|
-
target.prototype.globalHide = function (event) {
|
|
3111
|
-
if (this.mount) {
|
|
3112
|
-
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
3113
|
-
this.hideTooltip({
|
|
3114
|
-
currentTarget: hasTarget && event.detail.target
|
|
3115
|
-
}, hasTarget);
|
|
3116
|
-
}
|
|
3117
|
-
};
|
|
3118
|
-
}
|
|
3119
|
-
|
|
3120
|
-
/**
|
|
3121
|
-
* Events that should be bound to the window
|
|
3122
|
-
*/
|
|
3123
|
-
function windowListener (target) {
|
|
3124
|
-
target.prototype.bindWindowEvents = function (resizeHide) {
|
|
3125
|
-
// ReactTooltip.hide
|
|
3126
|
-
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
3127
|
-
window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false);
|
|
3128
|
-
|
|
3129
|
-
// ReactTooltip.rebuild
|
|
3130
|
-
window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
|
|
3131
|
-
window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false);
|
|
3132
|
-
|
|
3133
|
-
// ReactTooltip.show
|
|
3134
|
-
window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
|
|
3135
|
-
window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false);
|
|
3136
|
-
|
|
3137
|
-
// Resize
|
|
3138
|
-
if (resizeHide) {
|
|
3139
|
-
window.removeEventListener('resize', this.onWindowResize);
|
|
3140
|
-
window.addEventListener('resize', this.onWindowResize, false);
|
|
3141
|
-
}
|
|
3142
|
-
};
|
|
3143
|
-
target.prototype.unbindWindowEvents = function () {
|
|
3144
|
-
window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
|
|
3145
|
-
window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
|
|
3146
|
-
window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
|
|
3147
|
-
window.removeEventListener('resize', this.onWindowResize);
|
|
3148
|
-
};
|
|
3149
|
-
|
|
3150
|
-
/**
|
|
3151
|
-
* invoked by resize event of window
|
|
3152
|
-
*/
|
|
3153
|
-
target.prototype.onWindowResize = function () {
|
|
3154
|
-
if (!this.mount) return;
|
|
3155
|
-
this.hideTooltip();
|
|
3156
|
-
};
|
|
3157
|
-
}
|
|
3158
|
-
|
|
3159
|
-
/**
|
|
3160
|
-
* Custom events to control showing and hiding of tooltip
|
|
3161
|
-
*
|
|
3162
|
-
* @attributes
|
|
3163
|
-
* - `event` {String}
|
|
3164
|
-
* - `eventOff` {String}
|
|
3165
|
-
*/
|
|
3166
|
-
|
|
3167
|
-
var checkStatus = function checkStatus(dataEventOff, e) {
|
|
3168
|
-
var show = this.state.show;
|
|
3169
|
-
var id = this.props.id;
|
|
3170
|
-
var isCapture = this.isCapture(e.currentTarget);
|
|
3171
|
-
var currentItem = e.currentTarget.getAttribute('currentItem');
|
|
3172
|
-
if (!isCapture) e.stopPropagation();
|
|
3173
|
-
if (show && currentItem === 'true') {
|
|
3174
|
-
if (!dataEventOff) this.hideTooltip(e);
|
|
3175
|
-
} else {
|
|
3176
|
-
e.currentTarget.setAttribute('currentItem', 'true');
|
|
3177
|
-
setUntargetItems(e.currentTarget, this.getTargetArray(id));
|
|
3178
|
-
this.showTooltip(e);
|
|
3179
|
-
}
|
|
3180
|
-
};
|
|
3181
|
-
var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
|
|
3182
|
-
for (var i = 0; i < targetArray.length; i++) {
|
|
3183
|
-
if (currentTarget !== targetArray[i]) {
|
|
3184
|
-
targetArray[i].setAttribute('currentItem', 'false');
|
|
3185
|
-
} else {
|
|
3186
|
-
targetArray[i].setAttribute('currentItem', 'true');
|
|
3187
|
-
}
|
|
3188
|
-
}
|
|
3189
|
-
};
|
|
3190
|
-
var customListeners = {
|
|
3191
|
-
id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
|
|
3192
|
-
set: function set(target, event, listener) {
|
|
3193
|
-
if (this.id in target) {
|
|
3194
|
-
var map = target[this.id];
|
|
3195
|
-
map[event] = listener;
|
|
3196
|
-
} else {
|
|
3197
|
-
// this is workaround for WeakMap, which is not supported in older browsers, such as IE
|
|
3198
|
-
Object.defineProperty(target, this.id, {
|
|
3199
|
-
configurable: true,
|
|
3200
|
-
value: _defineProperty({}, event, listener)
|
|
3201
|
-
});
|
|
3202
|
-
}
|
|
3203
|
-
},
|
|
3204
|
-
get: function get(target, event) {
|
|
3205
|
-
var map = target[this.id];
|
|
3206
|
-
if (map !== undefined) {
|
|
3207
|
-
return map[event];
|
|
3208
|
-
}
|
|
3209
|
-
}
|
|
3210
|
-
};
|
|
3211
|
-
function customEvent (target) {
|
|
3212
|
-
target.prototype.isCustomEvent = function (ele) {
|
|
3213
|
-
var event = this.state.event;
|
|
3214
|
-
return event || !!ele.getAttribute('data-event');
|
|
3215
|
-
};
|
|
3216
|
-
|
|
3217
|
-
/* Bind listener for custom event */
|
|
3218
|
-
target.prototype.customBindListener = function (ele) {
|
|
3219
|
-
var _this = this;
|
|
3220
|
-
var _this$state = this.state,
|
|
3221
|
-
event = _this$state.event,
|
|
3222
|
-
eventOff = _this$state.eventOff;
|
|
3223
|
-
var dataEvent = ele.getAttribute('data-event') || event;
|
|
3224
|
-
var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
|
|
3225
|
-
dataEvent.split(' ').forEach(function (event) {
|
|
3226
|
-
ele.removeEventListener(event, customListeners.get(ele, event));
|
|
3227
|
-
var customListener = checkStatus.bind(_this, dataEventOff);
|
|
3228
|
-
customListeners.set(ele, event, customListener);
|
|
3229
|
-
ele.addEventListener(event, customListener, false);
|
|
3230
|
-
});
|
|
3231
|
-
if (dataEventOff) {
|
|
3232
|
-
dataEventOff.split(' ').forEach(function (event) {
|
|
3233
|
-
ele.removeEventListener(event, _this.hideTooltip);
|
|
3234
|
-
ele.addEventListener(event, _this.hideTooltip, false);
|
|
3235
|
-
});
|
|
3236
|
-
}
|
|
3237
|
-
};
|
|
3238
|
-
|
|
3239
|
-
/* Unbind listener for custom event */
|
|
3240
|
-
target.prototype.customUnbindListener = function (ele) {
|
|
3241
|
-
var _this$state2 = this.state,
|
|
3242
|
-
event = _this$state2.event,
|
|
3243
|
-
eventOff = _this$state2.eventOff;
|
|
3244
|
-
var dataEvent = event || ele.getAttribute('data-event');
|
|
3245
|
-
var dataEventOff = eventOff || ele.getAttribute('data-event-off');
|
|
3246
|
-
ele.removeEventListener(dataEvent, customListeners.get(ele, event));
|
|
3247
|
-
if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
|
|
3248
|
-
};
|
|
3249
|
-
}
|
|
3250
|
-
|
|
3251
|
-
/**
|
|
3252
|
-
* Util method to judge if it should follow capture model
|
|
3253
|
-
*/
|
|
3254
|
-
|
|
3255
|
-
function isCapture (target) {
|
|
3256
|
-
target.prototype.isCapture = function (currentTarget) {
|
|
3257
|
-
return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
|
|
3258
|
-
};
|
|
3259
|
-
}
|
|
3260
|
-
|
|
3261
|
-
/**
|
|
3262
|
-
* Util method to get effect
|
|
3263
|
-
*/
|
|
3264
|
-
|
|
3265
|
-
function getEffect (target) {
|
|
3266
|
-
target.prototype.getEffect = function (currentTarget) {
|
|
3267
|
-
var dataEffect = currentTarget.getAttribute('data-effect');
|
|
3268
|
-
return dataEffect || this.props.effect || 'float';
|
|
3269
|
-
};
|
|
3270
|
-
}
|
|
3271
|
-
|
|
3272
|
-
/**
|
|
3273
|
-
* Util method to get effect
|
|
3274
|
-
*/
|
|
3275
|
-
var makeProxy = function makeProxy(e) {
|
|
3276
|
-
var proxy = {};
|
|
3277
|
-
for (var key in e) {
|
|
3278
|
-
if (typeof e[key] === 'function') {
|
|
3279
|
-
proxy[key] = e[key].bind(e);
|
|
3280
|
-
} else {
|
|
3281
|
-
proxy[key] = e[key];
|
|
3282
|
-
}
|
|
3283
|
-
}
|
|
3284
|
-
return proxy;
|
|
3285
|
-
};
|
|
3286
|
-
var bodyListener = function bodyListener(callback, options, e) {
|
|
3287
|
-
var _options$respectEffec = options.respectEffect,
|
|
3288
|
-
respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
|
|
3289
|
-
_options$customEvent = options.customEvent,
|
|
3290
|
-
customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
|
|
3291
|
-
var id = this.props.id;
|
|
3292
|
-
var tip = null;
|
|
3293
|
-
var forId;
|
|
3294
|
-
var target = e.target;
|
|
3295
|
-
var lastTarget;
|
|
3296
|
-
// walk up parent chain until tip is found
|
|
3297
|
-
// there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
|
|
3298
|
-
while (tip === null && target !== null) {
|
|
3299
|
-
lastTarget = target;
|
|
3300
|
-
tip = target.getAttribute('data-tip') || null;
|
|
3301
|
-
forId = target.getAttribute('data-for') || null;
|
|
3302
|
-
target = target.parentElement;
|
|
3303
|
-
}
|
|
3304
|
-
target = lastTarget || e.target;
|
|
3305
|
-
if (this.isCustomEvent(target) && !customEvent) {
|
|
3306
|
-
return;
|
|
3307
|
-
}
|
|
3308
|
-
var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
|
|
3309
|
-
if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
|
|
3310
|
-
var proxy = makeProxy(e);
|
|
3311
|
-
proxy.currentTarget = target;
|
|
3312
|
-
callback(proxy);
|
|
3313
|
-
}
|
|
3314
|
-
};
|
|
3315
|
-
var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
|
|
3316
|
-
var events = {};
|
|
3317
|
-
targetArray.forEach(function (target) {
|
|
3318
|
-
var event = target.getAttribute(dataAttribute);
|
|
3319
|
-
if (event) event.split(' ').forEach(function (event) {
|
|
3320
|
-
return events[event] = true;
|
|
3321
|
-
});
|
|
3322
|
-
});
|
|
3323
|
-
return events;
|
|
3324
|
-
};
|
|
3325
|
-
var getBody = function getBody() {
|
|
3326
|
-
return document.getElementsByTagName('body')[0];
|
|
3327
|
-
};
|
|
3328
|
-
function bodyMode (target) {
|
|
3329
|
-
target.prototype.isBodyMode = function () {
|
|
3330
|
-
return !!this.props.bodyMode;
|
|
3331
|
-
};
|
|
3332
|
-
target.prototype.bindBodyListener = function (targetArray) {
|
|
3333
|
-
var _this = this;
|
|
3334
|
-
var _this$state = this.state,
|
|
3335
|
-
event = _this$state.event,
|
|
3336
|
-
eventOff = _this$state.eventOff,
|
|
3337
|
-
possibleCustomEvents = _this$state.possibleCustomEvents,
|
|
3338
|
-
possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
|
|
3339
|
-
var body = getBody();
|
|
3340
|
-
var customEvents = findCustomEvents(targetArray, 'data-event');
|
|
3341
|
-
var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
|
|
3342
|
-
if (event != null) customEvents[event] = true;
|
|
3343
|
-
if (eventOff != null) customEventsOff[eventOff] = true;
|
|
3344
|
-
possibleCustomEvents.split(' ').forEach(function (event) {
|
|
3345
|
-
return customEvents[event] = true;
|
|
3346
|
-
});
|
|
3347
|
-
possibleCustomEventsOff.split(' ').forEach(function (event) {
|
|
3348
|
-
return customEventsOff[event] = true;
|
|
3349
|
-
});
|
|
3350
|
-
this.unbindBodyListener(body);
|
|
3351
|
-
var listeners = this.bodyModeListeners = {};
|
|
3352
|
-
if (event == null) {
|
|
3353
|
-
listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
|
|
3354
|
-
listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
|
|
3355
|
-
respectEffect: true
|
|
3356
|
-
});
|
|
3357
|
-
listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
|
|
3358
|
-
}
|
|
3359
|
-
for (var _event in customEvents) {
|
|
3360
|
-
listeners[_event] = bodyListener.bind(this, function (e) {
|
|
3361
|
-
var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
|
|
3362
|
-
checkStatus.call(_this, targetEventOff, e);
|
|
3363
|
-
}, {
|
|
3364
|
-
customEvent: true
|
|
3365
|
-
});
|
|
3366
|
-
}
|
|
3367
|
-
for (var _event2 in customEventsOff) {
|
|
3368
|
-
listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
|
|
3369
|
-
customEvent: true
|
|
3370
|
-
});
|
|
3371
|
-
}
|
|
3372
|
-
for (var _event3 in listeners) {
|
|
3373
|
-
body.addEventListener(_event3, listeners[_event3]);
|
|
3374
|
-
}
|
|
3375
|
-
};
|
|
3376
|
-
target.prototype.unbindBodyListener = function (body) {
|
|
3377
|
-
body = body || getBody();
|
|
3378
|
-
var listeners = this.bodyModeListeners;
|
|
3379
|
-
for (var event in listeners) {
|
|
3380
|
-
body.removeEventListener(event, listeners[event]);
|
|
3381
|
-
}
|
|
3382
|
-
};
|
|
3383
|
-
}
|
|
3384
|
-
|
|
3385
|
-
/**
|
|
3386
|
-
* Tracking target removing from DOM.
|
|
3387
|
-
* It's necessary to hide tooltip when it's target disappears.
|
|
3388
|
-
* Otherwise, the tooltip would be shown forever until another target
|
|
3389
|
-
* is triggered.
|
|
3390
|
-
*
|
|
3391
|
-
* If MutationObserver is not available, this feature just doesn't work.
|
|
3392
|
-
*/
|
|
3393
|
-
|
|
3394
|
-
// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
|
|
3395
|
-
var getMutationObserverClass = function getMutationObserverClass() {
|
|
3396
|
-
return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
|
3397
|
-
};
|
|
3398
|
-
function trackRemoval (target) {
|
|
3399
|
-
target.prototype.bindRemovalTracker = function () {
|
|
3400
|
-
var _this = this;
|
|
3401
|
-
var MutationObserver = getMutationObserverClass();
|
|
3402
|
-
if (MutationObserver == null) return;
|
|
3403
|
-
var observer = new MutationObserver(function (mutations) {
|
|
3404
|
-
for (var m1 = 0; m1 < mutations.length; m1++) {
|
|
3405
|
-
var mutation = mutations[m1];
|
|
3406
|
-
for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
|
|
3407
|
-
var element = mutation.removedNodes[m2];
|
|
3408
|
-
if (element === _this.state.currentTarget) {
|
|
3409
|
-
_this.hideTooltip();
|
|
3410
|
-
return;
|
|
3411
|
-
}
|
|
3412
|
-
}
|
|
3413
|
-
}
|
|
3414
|
-
});
|
|
3415
|
-
observer.observe(window.document, {
|
|
3416
|
-
childList: true,
|
|
3417
|
-
subtree: true
|
|
3418
|
-
});
|
|
3419
|
-
this.removalTracker = observer;
|
|
3420
|
-
};
|
|
3421
|
-
target.prototype.unbindRemovalTracker = function () {
|
|
3422
|
-
if (this.removalTracker) {
|
|
3423
|
-
this.removalTracker.disconnect();
|
|
3424
|
-
this.removalTracker = null;
|
|
3425
|
-
}
|
|
3426
|
-
};
|
|
3427
|
-
}
|
|
3428
|
-
|
|
3429
|
-
/**
|
|
3430
|
-
* Calculate the position of tooltip
|
|
3431
|
-
*
|
|
3432
|
-
* @params
|
|
3433
|
-
* - `e` {Event} the event of current mouse
|
|
3434
|
-
* - `target` {Element} the currentTarget of the event
|
|
3435
|
-
* - `node` {DOM} the react-tooltip object
|
|
3436
|
-
* - `place` {String} top / right / bottom / left
|
|
3437
|
-
* - `effect` {String} float / solid
|
|
3438
|
-
* - `offset` {Object} the offset to default position
|
|
3439
|
-
*
|
|
3440
|
-
* @return {Object}
|
|
3441
|
-
* - `isNewState` {Bool} required
|
|
3442
|
-
* - `newState` {Object}
|
|
3443
|
-
* - `position` {Object} {left: {Number}, top: {Number}}
|
|
3444
|
-
*/
|
|
3445
|
-
function getPosition (e, target, node, place, desiredPlace, effect, offset) {
|
|
3446
|
-
var _getDimensions = getDimensions(node),
|
|
3447
|
-
tipWidth = _getDimensions.width,
|
|
3448
|
-
tipHeight = _getDimensions.height;
|
|
3449
|
-
var _getDimensions2 = getDimensions(target),
|
|
3450
|
-
targetWidth = _getDimensions2.width,
|
|
3451
|
-
targetHeight = _getDimensions2.height;
|
|
3452
|
-
var _getCurrentOffset = getCurrentOffset(e, target, effect),
|
|
3453
|
-
mouseX = _getCurrentOffset.mouseX,
|
|
3454
|
-
mouseY = _getCurrentOffset.mouseY;
|
|
3455
|
-
var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
|
|
3456
|
-
var _calculateOffset = calculateOffset(offset),
|
|
3457
|
-
extraOffsetX = _calculateOffset.extraOffsetX,
|
|
3458
|
-
extraOffsetY = _calculateOffset.extraOffsetY;
|
|
3459
|
-
var windowWidth = window.innerWidth;
|
|
3460
|
-
var windowHeight = window.innerHeight;
|
|
3461
|
-
var _getParent = getParent(node),
|
|
3462
|
-
parentTop = _getParent.parentTop,
|
|
3463
|
-
parentLeft = _getParent.parentLeft;
|
|
3464
|
-
|
|
3465
|
-
// Get the edge offset of the tooltip
|
|
3466
|
-
var getTipOffsetLeft = function getTipOffsetLeft(place) {
|
|
3467
|
-
var offsetX = defaultOffset[place].l;
|
|
3468
|
-
return mouseX + offsetX + extraOffsetX;
|
|
3469
|
-
};
|
|
3470
|
-
var getTipOffsetRight = function getTipOffsetRight(place) {
|
|
3471
|
-
var offsetX = defaultOffset[place].r;
|
|
3472
|
-
return mouseX + offsetX + extraOffsetX;
|
|
3473
|
-
};
|
|
3474
|
-
var getTipOffsetTop = function getTipOffsetTop(place) {
|
|
3475
|
-
var offsetY = defaultOffset[place].t;
|
|
3476
|
-
return mouseY + offsetY + extraOffsetY;
|
|
3477
|
-
};
|
|
3478
|
-
var getTipOffsetBottom = function getTipOffsetBottom(place) {
|
|
3479
|
-
var offsetY = defaultOffset[place].b;
|
|
3480
|
-
return mouseY + offsetY + extraOffsetY;
|
|
3481
|
-
};
|
|
3482
|
-
|
|
3483
|
-
//
|
|
3484
|
-
// Functions to test whether the tooltip's sides are inside
|
|
3485
|
-
// the client window for a given orientation p
|
|
3486
|
-
//
|
|
3487
|
-
// _____________
|
|
3488
|
-
// | | <-- Right side
|
|
3489
|
-
// | p = 'left' |\
|
|
3490
|
-
// | |/ |\
|
|
3491
|
-
// |_____________| |_\ <-- Mouse
|
|
3492
|
-
// / \ |
|
|
3493
|
-
// |
|
|
3494
|
-
// |
|
|
3495
|
-
// Bottom side
|
|
3496
|
-
//
|
|
3497
|
-
var outsideLeft = function outsideLeft(p) {
|
|
3498
|
-
return getTipOffsetLeft(p) < 0;
|
|
3499
|
-
};
|
|
3500
|
-
var outsideRight = function outsideRight(p) {
|
|
3501
|
-
return getTipOffsetRight(p) > windowWidth;
|
|
3502
|
-
};
|
|
3503
|
-
var outsideTop = function outsideTop(p) {
|
|
3504
|
-
return getTipOffsetTop(p) < 0;
|
|
3505
|
-
};
|
|
3506
|
-
var outsideBottom = function outsideBottom(p) {
|
|
3507
|
-
return getTipOffsetBottom(p) > windowHeight;
|
|
3508
|
-
};
|
|
3509
|
-
|
|
3510
|
-
// Check whether the tooltip with orientation p is completely inside the client window
|
|
3511
|
-
var outside = function outside(p) {
|
|
3512
|
-
return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
|
|
3513
|
-
};
|
|
3514
|
-
var inside = function inside(p) {
|
|
3515
|
-
return !outside(p);
|
|
3516
|
-
};
|
|
3517
|
-
var placeIsInside = {
|
|
3518
|
-
top: inside('top'),
|
|
3519
|
-
bottom: inside('bottom'),
|
|
3520
|
-
left: inside('left'),
|
|
3521
|
-
right: inside('right')
|
|
3522
|
-
};
|
|
3523
|
-
function choose() {
|
|
3524
|
-
var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
|
|
3525
|
-
var _iterator = _createForOfIteratorHelper(allPlaces),
|
|
3526
|
-
_step;
|
|
3527
|
-
try {
|
|
3528
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
3529
|
-
var d = _step.value;
|
|
3530
|
-
if (placeIsInside[d]) return d;
|
|
3531
|
-
}
|
|
3532
|
-
// if nothing is inside, just use the old place.
|
|
3533
|
-
} catch (err) {
|
|
3534
|
-
_iterator.e(err);
|
|
3535
|
-
} finally {
|
|
3536
|
-
_iterator.f();
|
|
3537
|
-
}
|
|
3538
|
-
return place;
|
|
3539
|
-
}
|
|
3540
|
-
var chosen = choose();
|
|
3541
|
-
var isNewState = false;
|
|
3542
|
-
var newPlace;
|
|
3543
|
-
if (chosen && chosen !== place) {
|
|
3544
|
-
isNewState = true;
|
|
3545
|
-
newPlace = chosen;
|
|
3546
|
-
}
|
|
3547
|
-
if (isNewState) {
|
|
3548
|
-
return {
|
|
3549
|
-
isNewState: true,
|
|
3550
|
-
newState: {
|
|
3551
|
-
place: newPlace
|
|
3552
|
-
}
|
|
3553
|
-
};
|
|
3554
|
-
}
|
|
3555
|
-
return {
|
|
3556
|
-
isNewState: false,
|
|
3557
|
-
position: {
|
|
3558
|
-
left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
|
|
3559
|
-
top: parseInt(getTipOffsetTop(place) - parentTop, 10)
|
|
3560
|
-
}
|
|
3561
|
-
};
|
|
3562
|
-
}
|
|
3563
|
-
var getDimensions = function getDimensions(node) {
|
|
3564
|
-
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
3565
|
-
height = _node$getBoundingClie.height,
|
|
3566
|
-
width = _node$getBoundingClie.width;
|
|
3567
|
-
return {
|
|
3568
|
-
height: parseInt(height, 10),
|
|
3569
|
-
width: parseInt(width, 10)
|
|
3570
|
-
};
|
|
3571
|
-
};
|
|
3572
|
-
|
|
3573
|
-
// Get current mouse offset
|
|
3574
|
-
var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
|
|
3575
|
-
var boundingClientRect = currentTarget.getBoundingClientRect();
|
|
3576
|
-
var targetTop = boundingClientRect.top;
|
|
3577
|
-
var targetLeft = boundingClientRect.left;
|
|
3578
|
-
var _getDimensions3 = getDimensions(currentTarget),
|
|
3579
|
-
targetWidth = _getDimensions3.width,
|
|
3580
|
-
targetHeight = _getDimensions3.height;
|
|
3581
|
-
if (effect === 'float') {
|
|
3582
|
-
return {
|
|
3583
|
-
mouseX: e.clientX,
|
|
3584
|
-
mouseY: e.clientY
|
|
3585
|
-
};
|
|
3586
|
-
}
|
|
3587
|
-
return {
|
|
3588
|
-
mouseX: targetLeft + targetWidth / 2,
|
|
3589
|
-
mouseY: targetTop + targetHeight / 2
|
|
3590
|
-
};
|
|
3591
|
-
};
|
|
3592
|
-
|
|
3593
|
-
// List all possibility of tooltip final offset
|
|
3594
|
-
// This is useful in judging if it is necessary for tooltip to switch position when out of window
|
|
3595
|
-
var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
|
|
3596
|
-
var top;
|
|
3597
|
-
var right;
|
|
3598
|
-
var bottom;
|
|
3599
|
-
var left;
|
|
3600
|
-
var disToMouse = 3;
|
|
3601
|
-
var triangleHeight = 2;
|
|
3602
|
-
var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
|
|
3603
|
-
|
|
3604
|
-
if (effect === 'float') {
|
|
3605
|
-
top = {
|
|
3606
|
-
l: -(tipWidth / 2),
|
|
3607
|
-
r: tipWidth / 2,
|
|
3608
|
-
t: -(tipHeight + disToMouse + triangleHeight),
|
|
3609
|
-
b: -disToMouse
|
|
3610
|
-
};
|
|
3611
|
-
bottom = {
|
|
3612
|
-
l: -(tipWidth / 2),
|
|
3613
|
-
r: tipWidth / 2,
|
|
3614
|
-
t: disToMouse + cursorHeight,
|
|
3615
|
-
b: tipHeight + disToMouse + triangleHeight + cursorHeight
|
|
3616
|
-
};
|
|
3617
|
-
left = {
|
|
3618
|
-
l: -(tipWidth + disToMouse + triangleHeight),
|
|
3619
|
-
r: -disToMouse,
|
|
3620
|
-
t: -(tipHeight / 2),
|
|
3621
|
-
b: tipHeight / 2
|
|
3622
|
-
};
|
|
3623
|
-
right = {
|
|
3624
|
-
l: disToMouse,
|
|
3625
|
-
r: tipWidth + disToMouse + triangleHeight,
|
|
3626
|
-
t: -(tipHeight / 2),
|
|
3627
|
-
b: tipHeight / 2
|
|
3628
|
-
};
|
|
3629
|
-
} else if (effect === 'solid') {
|
|
3630
|
-
top = {
|
|
3631
|
-
l: -(tipWidth / 2),
|
|
3632
|
-
r: tipWidth / 2,
|
|
3633
|
-
t: -(targetHeight / 2 + tipHeight + triangleHeight),
|
|
3634
|
-
b: -(targetHeight / 2)
|
|
3635
|
-
};
|
|
3636
|
-
bottom = {
|
|
3637
|
-
l: -(tipWidth / 2),
|
|
3638
|
-
r: tipWidth / 2,
|
|
3639
|
-
t: targetHeight / 2,
|
|
3640
|
-
b: targetHeight / 2 + tipHeight + triangleHeight
|
|
3641
|
-
};
|
|
3642
|
-
left = {
|
|
3643
|
-
l: -(tipWidth + targetWidth / 2 + triangleHeight),
|
|
3644
|
-
r: -(targetWidth / 2),
|
|
3645
|
-
t: -(tipHeight / 2),
|
|
3646
|
-
b: tipHeight / 2
|
|
3647
|
-
};
|
|
3648
|
-
right = {
|
|
3649
|
-
l: targetWidth / 2,
|
|
3650
|
-
r: tipWidth + targetWidth / 2 + triangleHeight,
|
|
3651
|
-
t: -(tipHeight / 2),
|
|
3652
|
-
b: tipHeight / 2
|
|
3653
|
-
};
|
|
3654
|
-
}
|
|
3655
|
-
return {
|
|
3656
|
-
top: top,
|
|
3657
|
-
bottom: bottom,
|
|
3658
|
-
left: left,
|
|
3659
|
-
right: right
|
|
3660
|
-
};
|
|
3661
|
-
};
|
|
3662
|
-
|
|
3663
|
-
// Consider additional offset into position calculation
|
|
3664
|
-
var calculateOffset = function calculateOffset(offset) {
|
|
3665
|
-
var extraOffsetX = 0;
|
|
3666
|
-
var extraOffsetY = 0;
|
|
3667
|
-
if (Object.prototype.toString.apply(offset) === '[object String]') {
|
|
3668
|
-
offset = JSON.parse(offset.toString().replace(/'/g, '"'));
|
|
3669
|
-
}
|
|
3670
|
-
for (var key in offset) {
|
|
3671
|
-
if (key === 'top') {
|
|
3672
|
-
extraOffsetY -= parseInt(offset[key], 10);
|
|
3673
|
-
} else if (key === 'bottom') {
|
|
3674
|
-
extraOffsetY += parseInt(offset[key], 10);
|
|
3675
|
-
} else if (key === 'left') {
|
|
3676
|
-
extraOffsetX -= parseInt(offset[key], 10);
|
|
3677
|
-
} else if (key === 'right') {
|
|
3678
|
-
extraOffsetX += parseInt(offset[key], 10);
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
|
-
return {
|
|
3682
|
-
extraOffsetX: extraOffsetX,
|
|
3683
|
-
extraOffsetY: extraOffsetY
|
|
3684
|
-
};
|
|
3685
|
-
};
|
|
3686
|
-
|
|
3687
|
-
// Get the offset of the parent elements
|
|
3688
|
-
var getParent = function getParent(currentTarget) {
|
|
3689
|
-
var currentParent = currentTarget;
|
|
3690
|
-
while (currentParent) {
|
|
3691
|
-
var computedStyle = window.getComputedStyle(currentParent);
|
|
3692
|
-
// transform and will-change: transform change the containing block
|
|
3693
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
|
|
3694
|
-
if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
|
|
3695
|
-
currentParent = currentParent.parentElement;
|
|
3696
|
-
}
|
|
3697
|
-
var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
|
|
3698
|
-
var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
|
|
3699
|
-
return {
|
|
3700
|
-
parentTop: parentTop,
|
|
3701
|
-
parentLeft: parentLeft
|
|
3702
|
-
};
|
|
3703
|
-
};
|
|
3704
|
-
|
|
3705
|
-
/**
|
|
3706
|
-
* To get the tooltip content
|
|
3707
|
-
* it may comes from data-tip or this.props.children
|
|
3708
|
-
* it should support multiline
|
|
3709
|
-
*
|
|
3710
|
-
* @params
|
|
3711
|
-
* - `tip` {String} value of data-tip
|
|
3712
|
-
* - `children` {ReactElement} this.props.children
|
|
3713
|
-
* - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
|
|
3714
|
-
*
|
|
3715
|
-
* @return
|
|
3716
|
-
* - String or react component
|
|
3717
|
-
*/
|
|
3718
|
-
function TipContent(tip, children, getContent, multiline) {
|
|
3719
|
-
if (children) return children;
|
|
3720
|
-
if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
|
|
3721
|
-
if (getContent === null) return null; // Tip not exist and children is null or undefined
|
|
3722
|
-
|
|
3723
|
-
var regexp = /<br\s*\/?>/;
|
|
3724
|
-
if (!multiline || multiline === 'false' || !regexp.test(tip)) {
|
|
3725
|
-
// No trim(), so that user can keep their input
|
|
3726
|
-
return tip;
|
|
3727
|
-
}
|
|
3728
|
-
|
|
3729
|
-
// Multiline tooltip content
|
|
3730
|
-
return tip.split(regexp).map(function (d, i) {
|
|
3731
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
3732
|
-
key: i,
|
|
3733
|
-
className: "multi-line"
|
|
3734
|
-
}, d);
|
|
3735
|
-
});
|
|
3736
|
-
}
|
|
3737
|
-
|
|
3738
|
-
/**
|
|
3739
|
-
* Support aria- and role in ReactTooltip
|
|
3740
|
-
*
|
|
3741
|
-
* @params props {Object}
|
|
3742
|
-
* @return {Object}
|
|
3743
|
-
*/
|
|
3744
|
-
function parseAria(props) {
|
|
3745
|
-
var ariaObj = {};
|
|
3746
|
-
Object.keys(props).filter(function (prop) {
|
|
3747
|
-
// aria-xxx and role is acceptable
|
|
3748
|
-
return /(^aria-\w+$|^role$)/.test(prop);
|
|
3749
|
-
}).forEach(function (prop) {
|
|
3750
|
-
ariaObj[prop] = props[prop];
|
|
3751
|
-
});
|
|
3752
|
-
return ariaObj;
|
|
3753
|
-
}
|
|
3754
|
-
|
|
3755
|
-
/**
|
|
3756
|
-
* Convert nodelist to array
|
|
3757
|
-
* @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
|
|
3758
|
-
* NodeLists are functions in Safari
|
|
3759
|
-
*/
|
|
3760
|
-
|
|
3761
|
-
function nodeListToArray (nodeList) {
|
|
3762
|
-
var length = nodeList.length;
|
|
3763
|
-
if (nodeList.hasOwnProperty) {
|
|
3764
|
-
return Array.prototype.slice.call(nodeList);
|
|
3765
|
-
}
|
|
3766
|
-
return new Array(length).fill().map(function (index) {
|
|
3767
|
-
return nodeList[index];
|
|
3768
|
-
});
|
|
3769
|
-
}
|
|
3770
|
-
|
|
3771
|
-
function generateUUID() {
|
|
3772
|
-
return 't' + v4$1();
|
|
3773
|
-
}
|
|
3774
|
-
|
|
3775
|
-
var baseCss = ".__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: \"\";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n bottom: 0;\n left: 50%;\n margin-left: -11px;\n}\n.__react_component_tooltip.place-bottom::before {\n top: 0;\n left: 50%;\n margin-left: -11px;\n}\n.__react_component_tooltip.place-left::before {\n right: 0;\n top: 50%;\n margin-top: -9px;\n}\n.__react_component_tooltip.place-right::before {\n left: 0;\n top: 50%;\n margin-top: -9px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
|
|
3776
|
-
|
|
3777
|
-
/**
|
|
3778
|
-
* Default pop-up style values (text color, background color).
|
|
3779
|
-
*/
|
|
3780
|
-
var defaultColors = {
|
|
3781
|
-
dark: {
|
|
3782
|
-
text: '#fff',
|
|
3783
|
-
background: '#222',
|
|
3784
|
-
border: 'transparent',
|
|
3785
|
-
arrow: '#222'
|
|
3786
|
-
},
|
|
3787
|
-
success: {
|
|
3788
|
-
text: '#fff',
|
|
3789
|
-
background: '#8DC572',
|
|
3790
|
-
border: 'transparent',
|
|
3791
|
-
arrow: '#8DC572'
|
|
3792
|
-
},
|
|
3793
|
-
warning: {
|
|
3794
|
-
text: '#fff',
|
|
3795
|
-
background: '#F0AD4E',
|
|
3796
|
-
border: 'transparent',
|
|
3797
|
-
arrow: '#F0AD4E'
|
|
3798
|
-
},
|
|
3799
|
-
error: {
|
|
3800
|
-
text: '#fff',
|
|
3801
|
-
background: '#BE6464',
|
|
3802
|
-
border: 'transparent',
|
|
3803
|
-
arrow: '#BE6464'
|
|
3804
|
-
},
|
|
3805
|
-
info: {
|
|
3806
|
-
text: '#fff',
|
|
3807
|
-
background: '#337AB7',
|
|
3808
|
-
border: 'transparent',
|
|
3809
|
-
arrow: '#337AB7'
|
|
3810
|
-
},
|
|
3811
|
-
light: {
|
|
3812
|
-
text: '#222',
|
|
3813
|
-
background: '#fff',
|
|
3814
|
-
border: 'transparent',
|
|
3815
|
-
arrow: '#fff'
|
|
3816
|
-
}
|
|
3817
|
-
};
|
|
3818
|
-
function getDefaultPopupColors(type) {
|
|
3819
|
-
return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
|
|
3820
|
-
}
|
|
3821
|
-
var DEFAULT_PADDING = '8px 21px';
|
|
3822
|
-
var DEFAULT_RADIUS = {
|
|
3823
|
-
tooltip: 3,
|
|
3824
|
-
arrow: 0
|
|
3825
|
-
};
|
|
3826
|
-
|
|
3827
|
-
/**
|
|
3828
|
-
* Generates the specific tooltip style for use on render.
|
|
3829
|
-
*/
|
|
3830
|
-
function generateTooltipStyle(uuid, customColors, type, hasBorder, padding, radius) {
|
|
3831
|
-
return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding, radius);
|
|
3832
|
-
}
|
|
3833
|
-
|
|
3834
|
-
/**
|
|
3835
|
-
* Generates the tooltip style rules based on the element-specified "data-type" property.
|
|
3836
|
-
*/
|
|
3837
|
-
function generateStyle(uuid, colors) {
|
|
3838
|
-
var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
|
|
3839
|
-
var radius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_RADIUS;
|
|
3840
|
-
var textColor = colors.text;
|
|
3841
|
-
var backgroundColor = colors.background;
|
|
3842
|
-
var borderColor = colors.border;
|
|
3843
|
-
var arrowColor = colors.arrow;
|
|
3844
|
-
var arrowRadius = radius.arrow;
|
|
3845
|
-
var tooltipRadius = radius.tooltip;
|
|
3846
|
-
return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\n\t border-radius: ").concat(tooltipRadius, "px;\n\t padding: ").concat(padding, ";\n \t}\n\n \t.").concat(uuid, ".place-top {\n margin-top: -10px;\n }\n .").concat(uuid, ".place-top::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: 2;\n width: 20px;\n height: 12px;\n }\n .").concat(uuid, ".place-top::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n bottom: -6px;\n left: 50%;\n margin-left: -6px;\n transform: rotate(135deg);\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 18px;\n height: 10px;\n }\n .").concat(uuid, ".place-bottom::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n top: -6px;\n left: 50%;\n margin-left: -6px;\n transform: rotate(45deg);\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 10px;\n height: 18px;\n }\n .").concat(uuid, ".place-left::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n right: -6px;\n top: 50%;\n margin-top: -6px;\n transform: rotate(45deg);\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 10px;\n height: 18px;\n }\n .").concat(uuid, ".place-right::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n left: -6px;\n top: 50%;\n margin-top: -6px;\n transform: rotate(-135deg);\n }\n ");
|
|
3847
|
-
}
|
|
3848
|
-
function getPopupColors(customColors, type, hasBorder) {
|
|
3849
|
-
var textColor = customColors.text;
|
|
3850
|
-
var backgroundColor = customColors.background;
|
|
3851
|
-
var borderColor = customColors.border;
|
|
3852
|
-
var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
|
|
3853
|
-
var colors = getDefaultPopupColors(type);
|
|
3854
|
-
if (textColor) {
|
|
3855
|
-
colors.text = textColor;
|
|
3856
|
-
}
|
|
3857
|
-
if (backgroundColor) {
|
|
3858
|
-
colors.background = backgroundColor;
|
|
3859
|
-
}
|
|
3860
|
-
if (hasBorder) {
|
|
3861
|
-
if (borderColor) {
|
|
3862
|
-
colors.border = borderColor;
|
|
3863
|
-
} else {
|
|
3864
|
-
colors.border = type === 'light' ? 'black' : 'white';
|
|
3865
|
-
}
|
|
3866
|
-
}
|
|
3867
|
-
if (arrowColor) {
|
|
3868
|
-
colors.arrow = arrowColor;
|
|
3869
|
-
}
|
|
3870
|
-
return colors;
|
|
3871
|
-
}
|
|
3872
|
-
|
|
3873
|
-
var _class, _class2;
|
|
3874
|
-
|
|
3875
|
-
/* Polyfill */
|
|
3876
|
-
var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
|
|
3877
|
-
_inherits(ReactTooltip, _React$Component);
|
|
3878
|
-
var _super = _createSuper(ReactTooltip);
|
|
3879
|
-
function ReactTooltip(props) {
|
|
3880
|
-
var _this;
|
|
3881
|
-
_classCallCheck(this, ReactTooltip);
|
|
3882
|
-
_this = _super.call(this, props);
|
|
3883
|
-
_this.state = {
|
|
3884
|
-
uuid: props.uuid || generateUUID(),
|
|
3885
|
-
place: props.place || 'top',
|
|
3886
|
-
// Direction of tooltip
|
|
3887
|
-
desiredPlace: props.place || 'top',
|
|
3888
|
-
type: props.type || 'dark',
|
|
3889
|
-
// Color theme of tooltip
|
|
3890
|
-
effect: props.effect || 'float',
|
|
3891
|
-
// float or fixed
|
|
3892
|
-
show: false,
|
|
3893
|
-
border: false,
|
|
3894
|
-
borderClass: 'border',
|
|
3895
|
-
customColors: {},
|
|
3896
|
-
customRadius: {},
|
|
3897
|
-
offset: {},
|
|
3898
|
-
padding: props.padding,
|
|
3899
|
-
extraClass: '',
|
|
3900
|
-
html: false,
|
|
3901
|
-
delayHide: 0,
|
|
3902
|
-
delayShow: 0,
|
|
3903
|
-
event: props.event || null,
|
|
3904
|
-
eventOff: props.eventOff || null,
|
|
3905
|
-
currentEvent: null,
|
|
3906
|
-
// Current mouse event
|
|
3907
|
-
currentTarget: null,
|
|
3908
|
-
// Current target of mouse event
|
|
3909
|
-
ariaProps: parseAria(props),
|
|
3910
|
-
// aria- and role attributes
|
|
3911
|
-
isEmptyTip: false,
|
|
3912
|
-
disable: false,
|
|
3913
|
-
possibleCustomEvents: props.possibleCustomEvents || '',
|
|
3914
|
-
possibleCustomEventsOff: props.possibleCustomEventsOff || '',
|
|
3915
|
-
originTooltip: null,
|
|
3916
|
-
isMultiline: false
|
|
3917
|
-
};
|
|
3918
|
-
_this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'hideTooltipOnScroll', 'getTooltipContent', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize', 'mouseOnToolTip']);
|
|
3919
|
-
_this.mount = true;
|
|
3920
|
-
_this.delayShowLoop = null;
|
|
3921
|
-
_this.delayHideLoop = null;
|
|
3922
|
-
_this.delayReshow = null;
|
|
3923
|
-
_this.intervalUpdateContent = null;
|
|
3924
|
-
return _this;
|
|
3925
|
-
}
|
|
3926
|
-
|
|
3927
|
-
/**
|
|
3928
|
-
* For unify the bind and unbind listener
|
|
3929
|
-
*/
|
|
3930
|
-
_createClass(ReactTooltip, [{
|
|
3931
|
-
key: "bind",
|
|
3932
|
-
value: function bind(methodArray) {
|
|
3933
|
-
var _this2 = this;
|
|
3934
|
-
methodArray.forEach(function (method) {
|
|
3935
|
-
_this2[method] = _this2[method].bind(_this2);
|
|
3936
|
-
});
|
|
3937
|
-
}
|
|
3938
|
-
}, {
|
|
3939
|
-
key: "componentDidMount",
|
|
3940
|
-
value: function componentDidMount() {
|
|
3941
|
-
var _this$props = this.props;
|
|
3942
|
-
_this$props.insecure;
|
|
3943
|
-
var resizeHide = _this$props.resizeHide,
|
|
3944
|
-
disableInternalStyle = _this$props.disableInternalStyle;
|
|
3945
|
-
this.mount = true;
|
|
3946
|
-
this.bindListener(); // Bind listener for tooltip
|
|
3947
|
-
this.bindWindowEvents(resizeHide); // Bind global event for static method
|
|
3948
|
-
|
|
3949
|
-
if (!disableInternalStyle) {
|
|
3950
|
-
this.injectStyles(); // Inject styles for each DOM root having tooltip.
|
|
3951
|
-
}
|
|
3952
|
-
}
|
|
3953
|
-
}, {
|
|
3954
|
-
key: "componentWillUnmount",
|
|
3955
|
-
value: function componentWillUnmount() {
|
|
3956
|
-
this.mount = false;
|
|
3957
|
-
this.clearTimer();
|
|
3958
|
-
this.unbindListener();
|
|
3959
|
-
this.removeScrollListener(this.state.currentTarget);
|
|
3960
|
-
this.unbindWindowEvents();
|
|
3961
|
-
}
|
|
3962
|
-
|
|
3963
|
-
/* Look for the closest DOM root having tooltip and inject styles. */
|
|
3964
|
-
}, {
|
|
3965
|
-
key: "injectStyles",
|
|
3966
|
-
value: function injectStyles() {
|
|
3967
|
-
var tooltipRef = this.tooltipRef;
|
|
3968
|
-
if (!tooltipRef) {
|
|
3969
|
-
return;
|
|
3970
|
-
}
|
|
3971
|
-
var parentNode = tooltipRef.parentNode;
|
|
3972
|
-
while (parentNode.parentNode) {
|
|
3973
|
-
parentNode = parentNode.parentNode;
|
|
3974
|
-
}
|
|
3975
|
-
var domRoot;
|
|
3976
|
-
switch (parentNode.constructor.name) {
|
|
3977
|
-
case 'Document':
|
|
3978
|
-
case 'HTMLDocument':
|
|
3979
|
-
case undefined:
|
|
3980
|
-
domRoot = parentNode.head;
|
|
3981
|
-
break;
|
|
3982
|
-
case 'ShadowRoot':
|
|
3983
|
-
default:
|
|
3984
|
-
domRoot = parentNode;
|
|
3985
|
-
break;
|
|
3986
|
-
}
|
|
3987
|
-
|
|
3988
|
-
// Prevent styles duplication.
|
|
3989
|
-
if (!domRoot.querySelector('style[data-react-tooltip]')) {
|
|
3990
|
-
var style = document.createElement('style');
|
|
3991
|
-
style.textContent = baseCss;
|
|
3992
|
-
style.setAttribute('data-react-tooltip', 'true');
|
|
3993
|
-
domRoot.appendChild(style);
|
|
3994
|
-
}
|
|
3995
|
-
}
|
|
3996
|
-
|
|
3997
|
-
/**
|
|
3998
|
-
* Return if the mouse is on the tooltip.
|
|
3999
|
-
* @returns {boolean} true - mouse is on the tooltip
|
|
4000
|
-
*/
|
|
4001
|
-
}, {
|
|
4002
|
-
key: "mouseOnToolTip",
|
|
4003
|
-
value: function mouseOnToolTip() {
|
|
4004
|
-
var show = this.state.show;
|
|
4005
|
-
if (show && this.tooltipRef) {
|
|
4006
|
-
/* old IE or Firefox work around */
|
|
4007
|
-
if (!this.tooltipRef.matches) {
|
|
4008
|
-
/* old IE work around */
|
|
4009
|
-
if (this.tooltipRef.msMatchesSelector) {
|
|
4010
|
-
this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;
|
|
4011
|
-
} else {
|
|
4012
|
-
/* old Firefox work around */
|
|
4013
|
-
this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
return this.tooltipRef.matches(':hover');
|
|
4017
|
-
}
|
|
4018
|
-
return false;
|
|
4019
|
-
}
|
|
4020
|
-
|
|
4021
|
-
/**
|
|
4022
|
-
* Pick out corresponded target elements
|
|
4023
|
-
*/
|
|
4024
|
-
}, {
|
|
4025
|
-
key: "getTargetArray",
|
|
4026
|
-
value: function getTargetArray(id) {
|
|
4027
|
-
var targetArray = [];
|
|
4028
|
-
var selector;
|
|
4029
|
-
if (!id) {
|
|
4030
|
-
selector = '[data-tip]:not([data-for])';
|
|
4031
|
-
} else {
|
|
4032
|
-
var escaped = id.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
4033
|
-
selector = "[data-tip][data-for=\"".concat(escaped, "\"]");
|
|
4034
|
-
}
|
|
4035
|
-
|
|
4036
|
-
// Scan document for shadow DOM elements
|
|
4037
|
-
nodeListToArray(document.getElementsByTagName('*')).filter(function (element) {
|
|
4038
|
-
return element.shadowRoot;
|
|
4039
|
-
}).forEach(function (element) {
|
|
4040
|
-
targetArray = targetArray.concat(nodeListToArray(element.shadowRoot.querySelectorAll(selector)));
|
|
4041
|
-
});
|
|
4042
|
-
return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));
|
|
4043
|
-
}
|
|
4044
|
-
|
|
4045
|
-
/**
|
|
4046
|
-
* Bind listener to the target elements
|
|
4047
|
-
* These listeners used to trigger showing or hiding the tooltip
|
|
4048
|
-
*/
|
|
4049
|
-
}, {
|
|
4050
|
-
key: "bindListener",
|
|
4051
|
-
value: function bindListener() {
|
|
4052
|
-
var _this3 = this;
|
|
4053
|
-
var _this$props2 = this.props,
|
|
4054
|
-
id = _this$props2.id,
|
|
4055
|
-
globalEventOff = _this$props2.globalEventOff,
|
|
4056
|
-
isCapture = _this$props2.isCapture;
|
|
4057
|
-
var targetArray = this.getTargetArray(id);
|
|
4058
|
-
targetArray.forEach(function (target) {
|
|
4059
|
-
if (target.getAttribute('currentItem') === null) {
|
|
4060
|
-
target.setAttribute('currentItem', 'false');
|
|
4061
|
-
}
|
|
4062
|
-
_this3.unbindBasicListener(target);
|
|
4063
|
-
if (_this3.isCustomEvent(target)) {
|
|
4064
|
-
_this3.customUnbindListener(target);
|
|
4065
|
-
}
|
|
4066
|
-
});
|
|
4067
|
-
if (this.isBodyMode()) {
|
|
4068
|
-
this.bindBodyListener(targetArray);
|
|
4069
|
-
} else {
|
|
4070
|
-
targetArray.forEach(function (target) {
|
|
4071
|
-
var isCaptureMode = _this3.isCapture(target);
|
|
4072
|
-
var effect = _this3.getEffect(target);
|
|
4073
|
-
if (_this3.isCustomEvent(target)) {
|
|
4074
|
-
_this3.customBindListener(target);
|
|
4075
|
-
return;
|
|
4076
|
-
}
|
|
4077
|
-
target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);
|
|
4078
|
-
target.addEventListener('focus', _this3.showTooltip, isCaptureMode);
|
|
4079
|
-
if (effect === 'float') {
|
|
4080
|
-
target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);
|
|
4081
|
-
}
|
|
4082
|
-
target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);
|
|
4083
|
-
target.addEventListener('blur', _this3.hideTooltip, isCaptureMode);
|
|
4084
|
-
});
|
|
4085
|
-
}
|
|
4086
|
-
|
|
4087
|
-
// Global event to hide tooltip
|
|
4088
|
-
if (globalEventOff) {
|
|
4089
|
-
window.removeEventListener(globalEventOff, this.hideTooltip);
|
|
4090
|
-
window.addEventListener(globalEventOff, this.hideTooltip, isCapture);
|
|
4091
|
-
}
|
|
4092
|
-
|
|
4093
|
-
// Track removal of targetArray elements from DOM
|
|
4094
|
-
this.bindRemovalTracker();
|
|
4095
|
-
}
|
|
4096
|
-
|
|
4097
|
-
/**
|
|
4098
|
-
* Unbind listeners on target elements
|
|
4099
|
-
*/
|
|
4100
|
-
}, {
|
|
4101
|
-
key: "unbindListener",
|
|
4102
|
-
value: function unbindListener() {
|
|
4103
|
-
var _this4 = this;
|
|
4104
|
-
var _this$props3 = this.props,
|
|
4105
|
-
id = _this$props3.id,
|
|
4106
|
-
globalEventOff = _this$props3.globalEventOff;
|
|
4107
|
-
if (this.isBodyMode()) {
|
|
4108
|
-
this.unbindBodyListener();
|
|
4109
|
-
} else {
|
|
4110
|
-
var targetArray = this.getTargetArray(id);
|
|
4111
|
-
targetArray.forEach(function (target) {
|
|
4112
|
-
_this4.unbindBasicListener(target);
|
|
4113
|
-
if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);
|
|
4114
|
-
});
|
|
4115
|
-
}
|
|
4116
|
-
if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);
|
|
4117
|
-
this.unbindRemovalTracker();
|
|
4118
|
-
}
|
|
4119
|
-
|
|
4120
|
-
/**
|
|
4121
|
-
* Invoke this before bind listener and unmount the component
|
|
4122
|
-
* it is necessary to invoke this even when binding custom event
|
|
4123
|
-
* so that the tooltip can switch between custom and default listener
|
|
4124
|
-
*/
|
|
4125
|
-
}, {
|
|
4126
|
-
key: "unbindBasicListener",
|
|
4127
|
-
value: function unbindBasicListener(target) {
|
|
4128
|
-
var isCaptureMode = this.isCapture(target);
|
|
4129
|
-
target.removeEventListener('mouseenter', this.showTooltip, isCaptureMode);
|
|
4130
|
-
target.removeEventListener('mousemove', this.updateTooltip, isCaptureMode);
|
|
4131
|
-
target.removeEventListener('mouseleave', this.hideTooltip, isCaptureMode);
|
|
4132
|
-
}
|
|
4133
|
-
}, {
|
|
4134
|
-
key: "getTooltipContent",
|
|
4135
|
-
value: function getTooltipContent() {
|
|
4136
|
-
var _this$props4 = this.props,
|
|
4137
|
-
getContent = _this$props4.getContent,
|
|
4138
|
-
children = _this$props4.children;
|
|
4139
|
-
|
|
4140
|
-
// Generate tooltip content
|
|
4141
|
-
var content;
|
|
4142
|
-
if (getContent) {
|
|
4143
|
-
if (Array.isArray(getContent)) {
|
|
4144
|
-
content = getContent[0] && getContent[0](this.state.originTooltip);
|
|
4145
|
-
} else {
|
|
4146
|
-
content = getContent(this.state.originTooltip);
|
|
4147
|
-
}
|
|
4148
|
-
}
|
|
4149
|
-
return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
|
|
4150
|
-
}
|
|
4151
|
-
}, {
|
|
4152
|
-
key: "isEmptyTip",
|
|
4153
|
-
value: function isEmptyTip(placeholder) {
|
|
4154
|
-
return typeof placeholder === 'string' && placeholder === '' || placeholder === null;
|
|
4155
|
-
}
|
|
4156
|
-
|
|
4157
|
-
/**
|
|
4158
|
-
* When mouse enter, show the tooltip
|
|
4159
|
-
*/
|
|
4160
|
-
}, {
|
|
4161
|
-
key: "showTooltip",
|
|
4162
|
-
value: function showTooltip(e, isGlobalCall) {
|
|
4163
|
-
if (!this.tooltipRef) {
|
|
4164
|
-
return;
|
|
4165
|
-
}
|
|
4166
|
-
if (isGlobalCall) {
|
|
4167
|
-
// Don't trigger other elements belongs to other ReactTooltip
|
|
4168
|
-
var targetArray = this.getTargetArray(this.props.id);
|
|
4169
|
-
var isMyElement = targetArray.some(function (ele) {
|
|
4170
|
-
return ele === e.currentTarget;
|
|
4171
|
-
});
|
|
4172
|
-
if (!isMyElement) return;
|
|
4173
|
-
}
|
|
4174
|
-
// Get the tooltip content
|
|
4175
|
-
// calculate in this phrase so that tip width height can be detected
|
|
4176
|
-
var _this$props5 = this.props,
|
|
4177
|
-
multiline = _this$props5.multiline,
|
|
4178
|
-
getContent = _this$props5.getContent;
|
|
4179
|
-
var originTooltip = e.currentTarget.getAttribute('data-tip');
|
|
4180
|
-
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
|
|
4181
|
-
|
|
4182
|
-
// If it is focus event or called by ReactTooltip.show, switch to `solid` effect
|
|
4183
|
-
var switchToSolid = e instanceof window.FocusEvent || isGlobalCall;
|
|
4184
|
-
|
|
4185
|
-
// if it needs to skip adding hide listener to scroll
|
|
4186
|
-
var scrollHide = true;
|
|
4187
|
-
if (e.currentTarget.getAttribute('data-scroll-hide')) {
|
|
4188
|
-
scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';
|
|
4189
|
-
} else if (this.props.scrollHide != null) {
|
|
4190
|
-
scrollHide = this.props.scrollHide;
|
|
4191
|
-
}
|
|
4192
|
-
|
|
4193
|
-
// adding aria-describedby to target to make tooltips read by screen readers
|
|
4194
|
-
if (e && e.currentTarget && e.currentTarget.setAttribute) {
|
|
4195
|
-
e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
|
|
4196
|
-
}
|
|
4197
|
-
|
|
4198
|
-
// Make sure the correct place is set
|
|
4199
|
-
var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
|
|
4200
|
-
var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
|
|
4201
|
-
var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
|
|
4202
|
-
var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
|
|
4203
|
-
if (result.position && this.props.overridePosition) {
|
|
4204
|
-
result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
|
|
4205
|
-
}
|
|
4206
|
-
var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0];
|
|
4207
|
-
|
|
4208
|
-
// To prevent previously created timers from triggering
|
|
4209
|
-
this.clearTimer();
|
|
4210
|
-
var target = e.currentTarget;
|
|
4211
|
-
var reshowDelay = this.state.show ? target.getAttribute('data-delay-update') || this.props.delayUpdate : 0;
|
|
4212
|
-
var self = this;
|
|
4213
|
-
var updateState = function updateState() {
|
|
4214
|
-
self.setState({
|
|
4215
|
-
originTooltip: originTooltip,
|
|
4216
|
-
isMultiline: isMultiline,
|
|
4217
|
-
desiredPlace: desiredPlace,
|
|
4218
|
-
place: place,
|
|
4219
|
-
type: target.getAttribute('data-type') || self.props.type || 'dark',
|
|
4220
|
-
customColors: {
|
|
4221
|
-
text: target.getAttribute('data-text-color') || self.props.textColor || null,
|
|
4222
|
-
background: target.getAttribute('data-background-color') || self.props.backgroundColor || null,
|
|
4223
|
-
border: target.getAttribute('data-border-color') || self.props.borderColor || null,
|
|
4224
|
-
arrow: target.getAttribute('data-arrow-color') || self.props.arrowColor || null
|
|
4225
|
-
},
|
|
4226
|
-
customRadius: {
|
|
4227
|
-
tooltip: target.getAttribute('data-tooltip-radius') || self.props.tooltipRadius || '3',
|
|
4228
|
-
arrow: target.getAttribute('data-arrow-radius') || self.props.arrowRadius || '0'
|
|
4229
|
-
},
|
|
4230
|
-
effect: effect,
|
|
4231
|
-
offset: offset,
|
|
4232
|
-
padding: target.getAttribute('data-padding') || self.props.padding,
|
|
4233
|
-
html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,
|
|
4234
|
-
delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,
|
|
4235
|
-
delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
|
|
4236
|
-
delayUpdate: target.getAttribute('data-delay-update') || self.props.delayUpdate || 0,
|
|
4237
|
-
border: (target.getAttribute('data-border') ? target.getAttribute('data-border') === 'true' : self.props.border) || false,
|
|
4238
|
-
borderClass: target.getAttribute('data-border-class') || self.props.borderClass || 'border',
|
|
4239
|
-
extraClass: target.getAttribute('data-class') || self.props["class"] || self.props.className || '',
|
|
4240
|
-
disable: (target.getAttribute('data-tip-disable') ? target.getAttribute('data-tip-disable') === 'true' : self.props.disable) || false,
|
|
4241
|
-
currentTarget: target
|
|
4242
|
-
}, function () {
|
|
4243
|
-
if (scrollHide) {
|
|
4244
|
-
self.addScrollListener(self.state.currentTarget);
|
|
4245
|
-
}
|
|
4246
|
-
self.updateTooltip(e);
|
|
4247
|
-
if (getContent && Array.isArray(getContent)) {
|
|
4248
|
-
self.intervalUpdateContent = setInterval(function () {
|
|
4249
|
-
if (self.mount) {
|
|
4250
|
-
var _getContent = self.props.getContent;
|
|
4251
|
-
var placeholder = TipContent(originTooltip, '', _getContent[0](), isMultiline);
|
|
4252
|
-
var isEmptyTip = self.isEmptyTip(placeholder);
|
|
4253
|
-
self.setState({
|
|
4254
|
-
isEmptyTip: isEmptyTip
|
|
4255
|
-
});
|
|
4256
|
-
self.updatePosition();
|
|
4257
|
-
}
|
|
4258
|
-
}, getContent[1]);
|
|
4259
|
-
}
|
|
4260
|
-
});
|
|
4261
|
-
};
|
|
4262
|
-
|
|
4263
|
-
// If there is no delay call immediately, don't allow events to get in first.
|
|
4264
|
-
if (reshowDelay) {
|
|
4265
|
-
this.delayReshow = setTimeout(updateState, reshowDelay);
|
|
4266
|
-
} else {
|
|
4267
|
-
updateState();
|
|
4268
|
-
}
|
|
4269
|
-
}
|
|
4270
|
-
|
|
4271
|
-
/**
|
|
4272
|
-
* When mouse hover, update tool tip
|
|
4273
|
-
*/
|
|
4274
|
-
}, {
|
|
4275
|
-
key: "updateTooltip",
|
|
4276
|
-
value: function updateTooltip(e) {
|
|
4277
|
-
var _this5 = this;
|
|
4278
|
-
var _this$state = this.state,
|
|
4279
|
-
delayShow = _this$state.delayShow,
|
|
4280
|
-
disable = _this$state.disable;
|
|
4281
|
-
var _this$props6 = this.props,
|
|
4282
|
-
afterShow = _this$props6.afterShow,
|
|
4283
|
-
disableProp = _this$props6.disable;
|
|
4284
|
-
var placeholder = this.getTooltipContent();
|
|
4285
|
-
var eventTarget = e.currentTarget || e.target;
|
|
4286
|
-
|
|
4287
|
-
// Check if the mouse is actually over the tooltip, if so don't hide the tooltip
|
|
4288
|
-
if (this.mouseOnToolTip()) {
|
|
4289
|
-
return;
|
|
4290
|
-
}
|
|
4291
|
-
|
|
4292
|
-
// if the tooltip is empty, disable the tooltip
|
|
4293
|
-
if (this.isEmptyTip(placeholder) || disable || disableProp) {
|
|
4294
|
-
return;
|
|
4295
|
-
}
|
|
4296
|
-
var delayTime = !this.state.show ? parseInt(delayShow, 10) : 0;
|
|
4297
|
-
var updateState = function updateState() {
|
|
4298
|
-
if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {
|
|
4299
|
-
var isInvisible = !_this5.state.show;
|
|
4300
|
-
_this5.setState({
|
|
4301
|
-
currentEvent: e,
|
|
4302
|
-
currentTarget: eventTarget,
|
|
4303
|
-
show: true
|
|
4304
|
-
}, function () {
|
|
4305
|
-
_this5.updatePosition(function () {
|
|
4306
|
-
if (isInvisible && afterShow) {
|
|
4307
|
-
afterShow(e);
|
|
4308
|
-
}
|
|
4309
|
-
});
|
|
4310
|
-
});
|
|
4311
|
-
}
|
|
4312
|
-
};
|
|
4313
|
-
if (this.delayShowLoop) {
|
|
4314
|
-
clearTimeout(this.delayShowLoop);
|
|
4315
|
-
}
|
|
4316
|
-
if (delayTime) {
|
|
4317
|
-
this.delayShowLoop = setTimeout(updateState, delayTime);
|
|
4318
|
-
} else {
|
|
4319
|
-
this.delayShowLoop = null;
|
|
4320
|
-
updateState();
|
|
4321
|
-
}
|
|
4322
|
-
}
|
|
4323
|
-
|
|
4324
|
-
/*
|
|
4325
|
-
* If we're mousing over the tooltip remove it when we leave.
|
|
4326
|
-
*/
|
|
4327
|
-
}, {
|
|
4328
|
-
key: "listenForTooltipExit",
|
|
4329
|
-
value: function listenForTooltipExit() {
|
|
4330
|
-
var show = this.state.show;
|
|
4331
|
-
if (show && this.tooltipRef) {
|
|
4332
|
-
this.tooltipRef.addEventListener('mouseleave', this.hideTooltip);
|
|
4333
|
-
}
|
|
4334
|
-
}
|
|
4335
|
-
}, {
|
|
4336
|
-
key: "removeListenerForTooltipExit",
|
|
4337
|
-
value: function removeListenerForTooltipExit() {
|
|
4338
|
-
var show = this.state.show;
|
|
4339
|
-
if (show && this.tooltipRef) {
|
|
4340
|
-
this.tooltipRef.removeEventListener('mouseleave', this.hideTooltip);
|
|
4341
|
-
}
|
|
4342
|
-
}
|
|
4343
|
-
|
|
4344
|
-
/**
|
|
4345
|
-
* When mouse leave, hide tooltip
|
|
4346
|
-
*/
|
|
4347
|
-
}, {
|
|
4348
|
-
key: "hideTooltip",
|
|
4349
|
-
value: function hideTooltip(e, hasTarget) {
|
|
4350
|
-
var _this6 = this;
|
|
4351
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
4352
|
-
isScroll: false
|
|
4353
|
-
};
|
|
4354
|
-
var disable = this.state.disable;
|
|
4355
|
-
var isScroll = options.isScroll;
|
|
4356
|
-
var delayHide = isScroll ? 0 : this.state.delayHide;
|
|
4357
|
-
var _this$props7 = this.props,
|
|
4358
|
-
afterHide = _this$props7.afterHide,
|
|
4359
|
-
disableProp = _this$props7.disable;
|
|
4360
|
-
var placeholder = this.getTooltipContent();
|
|
4361
|
-
if (!this.mount) return;
|
|
4362
|
-
if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
|
|
4363
|
-
if (hasTarget) {
|
|
4364
|
-
// Don't trigger other elements belongs to other ReactTooltip
|
|
4365
|
-
var targetArray = this.getTargetArray(this.props.id);
|
|
4366
|
-
var isMyElement = targetArray.some(function (ele) {
|
|
4367
|
-
return ele === e.currentTarget;
|
|
4368
|
-
});
|
|
4369
|
-
if (!isMyElement || !this.state.show) return;
|
|
4370
|
-
}
|
|
4371
|
-
|
|
4372
|
-
// clean up aria-describedby when hiding tooltip
|
|
4373
|
-
if (e && e.currentTarget && e.currentTarget.removeAttribute) {
|
|
4374
|
-
e.currentTarget.removeAttribute('aria-describedby');
|
|
4375
|
-
}
|
|
4376
|
-
var resetState = function resetState() {
|
|
4377
|
-
var isVisible = _this6.state.show;
|
|
4378
|
-
// Check if the mouse is actually over the tooltip, if so don't hide the tooltip
|
|
4379
|
-
if (_this6.mouseOnToolTip()) {
|
|
4380
|
-
_this6.listenForTooltipExit();
|
|
4381
|
-
return;
|
|
4382
|
-
}
|
|
4383
|
-
_this6.removeListenerForTooltipExit();
|
|
4384
|
-
_this6.setState({
|
|
4385
|
-
show: false
|
|
4386
|
-
}, function () {
|
|
4387
|
-
_this6.removeScrollListener(_this6.state.currentTarget);
|
|
4388
|
-
if (isVisible && afterHide) {
|
|
4389
|
-
afterHide(e);
|
|
4390
|
-
}
|
|
4391
|
-
});
|
|
4392
|
-
};
|
|
4393
|
-
this.clearTimer();
|
|
4394
|
-
if (delayHide) {
|
|
4395
|
-
this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));
|
|
4396
|
-
} else {
|
|
4397
|
-
resetState();
|
|
4398
|
-
}
|
|
4399
|
-
}
|
|
4400
|
-
|
|
4401
|
-
/**
|
|
4402
|
-
* When scroll, hide tooltip
|
|
4403
|
-
*/
|
|
4404
|
-
}, {
|
|
4405
|
-
key: "hideTooltipOnScroll",
|
|
4406
|
-
value: function hideTooltipOnScroll(event, hasTarget) {
|
|
4407
|
-
this.hideTooltip(event, hasTarget, {
|
|
4408
|
-
isScroll: true
|
|
4409
|
-
});
|
|
4410
|
-
}
|
|
4411
|
-
|
|
4412
|
-
/**
|
|
4413
|
-
* Add scroll event listener when tooltip show
|
|
4414
|
-
* automatically hide the tooltip when scrolling
|
|
4415
|
-
*/
|
|
4416
|
-
}, {
|
|
4417
|
-
key: "addScrollListener",
|
|
4418
|
-
value: function addScrollListener(currentTarget) {
|
|
4419
|
-
var isCaptureMode = this.isCapture(currentTarget);
|
|
4420
|
-
window.addEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
|
|
4421
|
-
}
|
|
4422
|
-
}, {
|
|
4423
|
-
key: "removeScrollListener",
|
|
4424
|
-
value: function removeScrollListener(currentTarget) {
|
|
4425
|
-
var isCaptureMode = this.isCapture(currentTarget);
|
|
4426
|
-
window.removeEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
|
|
4427
|
-
}
|
|
4428
|
-
|
|
4429
|
-
// Calculation the position
|
|
4430
|
-
}, {
|
|
4431
|
-
key: "updatePosition",
|
|
4432
|
-
value: function updatePosition(callbackAfter) {
|
|
4433
|
-
var _this7 = this;
|
|
4434
|
-
var _this$state2 = this.state,
|
|
4435
|
-
currentEvent = _this$state2.currentEvent,
|
|
4436
|
-
currentTarget = _this$state2.currentTarget,
|
|
4437
|
-
place = _this$state2.place,
|
|
4438
|
-
desiredPlace = _this$state2.desiredPlace,
|
|
4439
|
-
effect = _this$state2.effect,
|
|
4440
|
-
offset = _this$state2.offset;
|
|
4441
|
-
var node = this.tooltipRef;
|
|
4442
|
-
var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
|
|
4443
|
-
if (result.position && this.props.overridePosition) {
|
|
4444
|
-
result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
|
|
4445
|
-
}
|
|
4446
|
-
if (result.isNewState) {
|
|
4447
|
-
// Switch to reverse placement
|
|
4448
|
-
return this.setState(result.newState, function () {
|
|
4449
|
-
_this7.updatePosition(callbackAfter);
|
|
4450
|
-
});
|
|
4451
|
-
}
|
|
4452
|
-
if (callbackAfter && typeof callbackAfter === 'function') {
|
|
4453
|
-
callbackAfter();
|
|
4454
|
-
}
|
|
4455
|
-
|
|
4456
|
-
// Set tooltip position
|
|
4457
|
-
node.style.left = result.position.left + 'px';
|
|
4458
|
-
node.style.top = result.position.top + 'px';
|
|
4459
|
-
}
|
|
4460
|
-
|
|
4461
|
-
/**
|
|
4462
|
-
* CLear all kinds of timeout of interval
|
|
4463
|
-
*/
|
|
4464
|
-
}, {
|
|
4465
|
-
key: "clearTimer",
|
|
4466
|
-
value: function clearTimer() {
|
|
4467
|
-
if (this.delayShowLoop) {
|
|
4468
|
-
clearTimeout(this.delayShowLoop);
|
|
4469
|
-
this.delayShowLoop = null;
|
|
4470
|
-
}
|
|
4471
|
-
if (this.delayHideLoop) {
|
|
4472
|
-
clearTimeout(this.delayHideLoop);
|
|
4473
|
-
this.delayHideLoop = null;
|
|
4474
|
-
}
|
|
4475
|
-
if (this.delayReshow) {
|
|
4476
|
-
clearTimeout(this.delayReshow);
|
|
4477
|
-
this.delayReshow = null;
|
|
4478
|
-
}
|
|
4479
|
-
if (this.intervalUpdateContent) {
|
|
4480
|
-
clearInterval(this.intervalUpdateContent);
|
|
4481
|
-
this.intervalUpdateContent = null;
|
|
4482
|
-
}
|
|
4483
|
-
}
|
|
4484
|
-
}, {
|
|
4485
|
-
key: "hasCustomColors",
|
|
4486
|
-
value: function hasCustomColors() {
|
|
4487
|
-
var _this8 = this;
|
|
4488
|
-
return Boolean(Object.keys(this.state.customColors).find(function (color) {
|
|
4489
|
-
return color !== 'border' && _this8.state.customColors[color];
|
|
4490
|
-
}) || this.state.border && this.state.customColors['border']);
|
|
4491
|
-
}
|
|
4492
|
-
}, {
|
|
4493
|
-
key: "render",
|
|
4494
|
-
value: function render() {
|
|
4495
|
-
var _this9 = this;
|
|
4496
|
-
var _this$state3 = this.state,
|
|
4497
|
-
extraClass = _this$state3.extraClass,
|
|
4498
|
-
html = _this$state3.html,
|
|
4499
|
-
ariaProps = _this$state3.ariaProps,
|
|
4500
|
-
disable = _this$state3.disable,
|
|
4501
|
-
uuid = _this$state3.uuid;
|
|
4502
|
-
var content = this.getTooltipContent();
|
|
4503
|
-
var isEmptyTip = this.isEmptyTip(content);
|
|
4504
|
-
var style = this.props.disableInternalStyle ? '' : generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding, this.state.customRadius);
|
|
4505
|
-
var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' ' + this.state.borderClass : '') + " place-".concat(this.state.place) + // top, bottom, left, right
|
|
4506
|
-
" type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
|
|
4507
|
-
// dark, success, warning, error, info, light, custom
|
|
4508
|
-
this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
|
|
4509
|
-
var Wrapper = this.props.wrapper;
|
|
4510
|
-
if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {
|
|
4511
|
-
Wrapper = ReactTooltip.defaultProps.wrapper;
|
|
4512
|
-
}
|
|
4513
|
-
var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
|
|
4514
|
-
if (html) {
|
|
4515
|
-
var htmlContent = "".concat(content).concat(style ? "\n<style aria-hidden=\"true\">".concat(style, "</style>") : '');
|
|
4516
|
-
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
4517
|
-
className: "".concat(wrapperClassName),
|
|
4518
|
-
id: this.props.id || uuid,
|
|
4519
|
-
ref: function ref(_ref) {
|
|
4520
|
-
return _this9.tooltipRef = _ref;
|
|
4521
|
-
}
|
|
4522
|
-
}, ariaProps, {
|
|
4523
|
-
"data-id": "tooltip",
|
|
4524
|
-
dangerouslySetInnerHTML: {
|
|
4525
|
-
__html: htmlContent
|
|
4526
|
-
}
|
|
4527
|
-
}));
|
|
4528
|
-
} else {
|
|
4529
|
-
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
4530
|
-
className: "".concat(wrapperClassName),
|
|
4531
|
-
id: this.props.id || uuid
|
|
4532
|
-
}, ariaProps, {
|
|
4533
|
-
ref: function ref(_ref2) {
|
|
4534
|
-
return _this9.tooltipRef = _ref2;
|
|
4535
|
-
},
|
|
4536
|
-
"data-id": "tooltip"
|
|
4537
|
-
}), style && /*#__PURE__*/React.createElement("style", {
|
|
4538
|
-
dangerouslySetInnerHTML: {
|
|
4539
|
-
__html: style
|
|
4540
|
-
},
|
|
4541
|
-
"aria-hidden": "true"
|
|
4542
|
-
}), content);
|
|
4543
|
-
}
|
|
4544
|
-
}
|
|
4545
|
-
}], [{
|
|
4546
|
-
key: "propTypes",
|
|
4547
|
-
get: function get() {
|
|
4548
|
-
return {
|
|
4549
|
-
uuid: PropTypes.string,
|
|
4550
|
-
children: PropTypes.any,
|
|
4551
|
-
place: PropTypes.string,
|
|
4552
|
-
type: PropTypes.string,
|
|
4553
|
-
effect: PropTypes.string,
|
|
4554
|
-
offset: PropTypes.object,
|
|
4555
|
-
padding: PropTypes.string,
|
|
4556
|
-
multiline: PropTypes.bool,
|
|
4557
|
-
border: PropTypes.bool,
|
|
4558
|
-
borderClass: PropTypes.string,
|
|
4559
|
-
textColor: PropTypes.string,
|
|
4560
|
-
backgroundColor: PropTypes.string,
|
|
4561
|
-
borderColor: PropTypes.string,
|
|
4562
|
-
arrowColor: PropTypes.string,
|
|
4563
|
-
arrowRadius: PropTypes.string,
|
|
4564
|
-
tooltipRadius: PropTypes.string,
|
|
4565
|
-
insecure: PropTypes.bool,
|
|
4566
|
-
"class": PropTypes.string,
|
|
4567
|
-
className: PropTypes.string,
|
|
4568
|
-
id: PropTypes.string,
|
|
4569
|
-
html: PropTypes.bool,
|
|
4570
|
-
delayHide: PropTypes.number,
|
|
4571
|
-
delayUpdate: PropTypes.number,
|
|
4572
|
-
delayShow: PropTypes.number,
|
|
4573
|
-
event: PropTypes.string,
|
|
4574
|
-
eventOff: PropTypes.string,
|
|
4575
|
-
isCapture: PropTypes.bool,
|
|
4576
|
-
globalEventOff: PropTypes.string,
|
|
4577
|
-
getContent: PropTypes.any,
|
|
4578
|
-
afterShow: PropTypes.func,
|
|
4579
|
-
afterHide: PropTypes.func,
|
|
4580
|
-
overridePosition: PropTypes.func,
|
|
4581
|
-
disable: PropTypes.bool,
|
|
4582
|
-
scrollHide: PropTypes.bool,
|
|
4583
|
-
resizeHide: PropTypes.bool,
|
|
4584
|
-
wrapper: PropTypes.string,
|
|
4585
|
-
bodyMode: PropTypes.bool,
|
|
4586
|
-
possibleCustomEvents: PropTypes.string,
|
|
4587
|
-
possibleCustomEventsOff: PropTypes.string,
|
|
4588
|
-
clickable: PropTypes.bool,
|
|
4589
|
-
disableInternalStyle: PropTypes.bool
|
|
4590
|
-
};
|
|
4591
|
-
}
|
|
4592
|
-
}, {
|
|
4593
|
-
key: "getDerivedStateFromProps",
|
|
4594
|
-
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
4595
|
-
var ariaProps = prevState.ariaProps;
|
|
4596
|
-
var newAriaProps = parseAria(nextProps);
|
|
4597
|
-
var isChanged = Object.keys(newAriaProps).some(function (props) {
|
|
4598
|
-
return newAriaProps[props] !== ariaProps[props];
|
|
4599
|
-
});
|
|
4600
|
-
if (!isChanged) {
|
|
4601
|
-
return null;
|
|
4602
|
-
}
|
|
4603
|
-
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
4604
|
-
ariaProps: newAriaProps
|
|
4605
|
-
});
|
|
4606
|
-
}
|
|
4607
|
-
}]);
|
|
4608
|
-
return ReactTooltip;
|
|
4609
|
-
}(React.Component), _defineProperty(_class2, "defaultProps", {
|
|
4610
|
-
insecure: true,
|
|
4611
|
-
resizeHide: true,
|
|
4612
|
-
wrapper: 'div',
|
|
4613
|
-
clickable: false
|
|
4614
|
-
}), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
|
|
4615
|
-
|
|
4616
|
-
function Checkbox(_a) {
|
|
4617
|
-
var children = _a.children, _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.tooltip, tooltip = _c === void 0 ? '' : _c, name = _a.name, value = _a.value, checked = _a.checked, forcedChecked = _a.forcedChecked, _d = _a.disabled, disabled = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.size, size = _e === void 0 ? "m" : _e, _f = _a.fullWidth, fullWidth = _f === void 0 ? false : _f;
|
|
4618
|
-
var change = function (ev) {
|
|
4619
|
-
if (typeof onChange === 'function') {
|
|
4620
|
-
onChange(ev);
|
|
4621
|
-
}
|
|
4622
|
-
};
|
|
4623
|
-
var cssClass = ['cb_label'];
|
|
4624
|
-
if (disabled) {
|
|
4625
|
-
cssClass.push('disabled');
|
|
4626
|
-
}
|
|
4627
|
-
if (size) {
|
|
4628
|
-
cssClass.push(size);
|
|
4629
|
-
}
|
|
4630
|
-
var childrenClass = ['cb_label_text'];
|
|
4631
|
-
var tooltipClass = [];
|
|
4632
|
-
if (fullWidth) {
|
|
4633
|
-
childrenClass.push('flex_item_full');
|
|
4634
|
-
cssClass.push('flex');
|
|
4635
|
-
}
|
|
4636
|
-
else {
|
|
4637
|
-
childrenClass.push('flex_item_auto');
|
|
4638
|
-
cssClass.push('flex_inline');
|
|
4639
|
-
}
|
|
4640
|
-
if (tooltip) {
|
|
4641
|
-
cssClass.push(fullWidth ? 'flex_item_full' : 'flex_item_auto');
|
|
4642
|
-
tooltipClass.push(fullWidth ? 'flex' : 'flex_inline');
|
|
4643
|
-
}
|
|
4644
|
-
var inner = (React.createElement("label", { className: cssClass.join(' ') },
|
|
4645
|
-
forcedChecked !== undefined ?
|
|
4646
|
-
React.createElement("input", { type: "checkbox", name: name, value: value, checked: forcedChecked ? true : false, onChange: function (ev) { return change(ev); }, disabled: disabled, readOnly: true })
|
|
4647
|
-
:
|
|
4648
|
-
React.createElement("input", { type: "checkbox", name: name, value: value, onChange: function (ev) { return change(ev); }, defaultChecked: checked ? true : false, disabled: disabled }),
|
|
4649
|
-
React.createElement("span", { className: "cb_label_icon flex_item_fix flex_item_align_start" }),
|
|
4650
|
-
React.createElement("span", { className: childrenClass.join(' ') }, label || children)));
|
|
4651
|
-
if (tooltip) {
|
|
4652
|
-
return (React.createElement("span", { className: tooltipClass.join(' ') },
|
|
4653
|
-
inner,
|
|
4654
|
-
React.createElement("span", { className: "cb_label_tooltip flex_item_fix flex_item_align_start" },
|
|
4655
|
-
React.createElement("a", { className: "icon_btn s v_al_bl", "data-tip": tooltip },
|
|
4656
|
-
React.createElement("i", { className: "fas fa-info-circle" })),
|
|
4657
|
-
React.createElement(ReactTooltip, { backgroundColor: "black", effect: "solid", place: "bottom", eventOff: "click", delayShow: 600 }))));
|
|
4658
|
-
}
|
|
4659
|
-
else {
|
|
4660
|
-
return inner;
|
|
4661
|
-
}
|
|
4662
|
-
}
|
|
4663
|
-
|
|
4664
|
-
function Spinner(_a) {
|
|
4665
|
-
var _b = _a.overlay, overlay = _b === void 0 ? false : _b;
|
|
4666
|
-
return (React.createElement(React.Fragment, null, overlay ?
|
|
4667
|
-
React.createElement("div", { className: "spinner_overlay" },
|
|
4668
|
-
React.createElement("div", { className: "spinner" },
|
|
4669
|
-
React.createElement("div", { className: "rect1" }),
|
|
4670
|
-
React.createElement("div", { className: "rect2" }),
|
|
4671
|
-
React.createElement("div", { className: "rect3" }),
|
|
4672
|
-
React.createElement("div", { className: "rect4" }),
|
|
4673
|
-
React.createElement("div", { className: "rect5" })))
|
|
4674
|
-
:
|
|
4675
|
-
React.createElement("div", { className: "spinner" },
|
|
4676
|
-
React.createElement("div", { className: "rect1" }),
|
|
4677
|
-
React.createElement("div", { className: "rect2" }),
|
|
4678
|
-
React.createElement("div", { className: "rect3" }),
|
|
4679
|
-
React.createElement("div", { className: "rect4" }),
|
|
4680
|
-
React.createElement("div", { className: "rect5" }))));
|
|
4681
|
-
}
|
|
4682
|
-
|
|
4683
|
-
function SpinnerWheel(_a) {
|
|
4684
|
-
var _b = _a.wheelSize, wheelSize = _b === void 0 ? 'm' : _b, // xxs, xs, s, m, l
|
|
4685
|
-
_c = _a.display, // xxs, xs, s, m, l
|
|
4686
|
-
display = _c === void 0 ? 'overlay' : _c, // block | inline | overlay
|
|
4687
|
-
_d = _a.verticalSize, // block | inline | overlay
|
|
4688
|
-
verticalSize = _d === void 0 ? 'l' : _d;
|
|
4689
|
-
var cssClass = ['wheel'];
|
|
4690
|
-
// wheelSize
|
|
4691
|
-
if (wheelSize) {
|
|
4692
|
-
cssClass.push('size_' + wheelSize);
|
|
4693
|
-
}
|
|
4694
|
-
// Display
|
|
4695
|
-
if (display == 'block') {
|
|
4696
|
-
cssClass.push('full');
|
|
4697
|
-
// verticalSize
|
|
4698
|
-
if (verticalSize) {
|
|
4699
|
-
cssClass.push('vertical_size_' + verticalSize);
|
|
4700
|
-
}
|
|
4701
|
-
}
|
|
4702
|
-
var wheel = (React.createElement("div", { className: cssClass.join(' ') }));
|
|
4703
|
-
if (display == 'overlay') {
|
|
4704
|
-
return (React.createElement("div", { className: 'mask' }, wheel));
|
|
4705
|
-
}
|
|
4706
|
-
return wheel;
|
|
4707
|
-
}
|
|
4708
|
-
|
|
4709
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
4710
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
4711
|
-
// generators (like Math.random()).
|
|
4712
|
-
let getRandomValues;
|
|
4713
|
-
const rnds8 = new Uint8Array(16);
|
|
4714
|
-
function rng() {
|
|
4715
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
4716
|
-
if (!getRandomValues) {
|
|
4717
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
4718
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
4719
|
-
|
|
4720
|
-
if (!getRandomValues) {
|
|
4721
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
4722
|
-
}
|
|
4723
|
-
}
|
|
4724
|
-
|
|
4725
|
-
return getRandomValues(rnds8);
|
|
4726
|
-
}
|
|
4727
|
-
|
|
4728
|
-
/**
|
|
4729
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
4730
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
4731
|
-
*/
|
|
4732
|
-
|
|
4733
|
-
const byteToHex = [];
|
|
4734
|
-
|
|
4735
|
-
for (let i = 0; i < 256; ++i) {
|
|
4736
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
4737
|
-
}
|
|
4738
|
-
|
|
4739
|
-
function unsafeStringify(arr, offset = 0) {
|
|
4740
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
4741
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
4742
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
4743
|
-
}
|
|
4744
|
-
|
|
4745
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
4746
|
-
var native = {
|
|
4747
|
-
randomUUID
|
|
4748
|
-
};
|
|
4749
|
-
|
|
4750
|
-
function v4(options, buf, offset) {
|
|
4751
|
-
if (native.randomUUID && !buf && !options) {
|
|
4752
|
-
return native.randomUUID();
|
|
4753
|
-
}
|
|
4754
|
-
|
|
4755
|
-
options = options || {};
|
|
4756
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
4757
|
-
|
|
4758
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
4759
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
4760
|
-
|
|
4761
|
-
if (buf) {
|
|
4762
|
-
offset = offset || 0;
|
|
4763
|
-
|
|
4764
|
-
for (let i = 0; i < 16; ++i) {
|
|
4765
|
-
buf[offset + i] = rnds[i];
|
|
4766
|
-
}
|
|
4767
|
-
|
|
4768
|
-
return buf;
|
|
4769
|
-
}
|
|
4770
|
-
|
|
4771
|
-
return unsafeStringify(rnds);
|
|
4772
|
-
}
|
|
4773
|
-
|
|
4774
|
-
// TODO : onChange return e.target.value
|
|
4775
|
-
function InputCustom(_a) {
|
|
4776
|
-
var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.type, type = _c === void 0 ? "text" : _c, onChange = _a.onChange, handleChangeForm = _a.handleChangeForm, // DEPRECATED : replace by onChange
|
|
4777
|
-
_d = _a.placeholder, // DEPRECATED : replace by onChange
|
|
4778
|
-
placeholder = _d === void 0 ? "" : _d, _e = _a.placeHolder, placeHolder = _e === void 0 ? "" : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.readonly, readonly = _g === void 0 ? false : _g, name = _a.name, min = _a.min, max = _a.max, _h = _a.label, label = _h === void 0 ? "" : _h, _j = _a.labelClassName, labelClassName = _j === void 0 ? "" : _j, _k = _a.description, description = _k === void 0 ? "" : _k, _l = _a.descriptionBottom, descriptionBottom = _l === void 0 ? "" : _l, _m = _a.labelTooltip, labelTooltip = _m === void 0 ? "" : _m, _o = _a.blockClassName, blockClassName = _o === void 0 ? "" : _o, _p = _a.size, size = _p === void 0 ? "m" : _p, _q = _a.color, color = _q === void 0 ? "grey" : _q, unit = _a.unit, isAnError = _a.isAnError, _r = _a.fullWidth, fullWidth = _r === void 0 ? false : _r, width = _a.width, // 'Full' || 's' || 'xs' || 'xxs'
|
|
4779
|
-
_s = _a.className, // 'Full' || 's' || 'xs' || 'xxs'
|
|
4780
|
-
className = _s === void 0 ? "" : _s, style = _a.style, _t = _a.selectOnFocus, selectOnFocus = _t === void 0 ? false : _t, _u = _a.autoFocus, autoFocus = _u === void 0 ? false : _u, _v = _a.spellCheck, spellCheck = _v === void 0 ? true : _v, onEnter = _a.onEnter, onFocus = _a.onFocus, onBlur = _a.onBlur, append = _a.append, prepend = _a.prepend, _w = _a.rows, rows = _w === void 0 ? 3 : _w, // For textarea
|
|
4781
|
-
_x = _a.autogrow, // For textarea
|
|
4782
|
-
autogrow = _x === void 0 ? false : _x, // Vertical for textarea, Horizontal for text
|
|
4783
|
-
maxHeight = _a.maxHeight, // For textarea autogrow
|
|
4784
|
-
maxWidth = _a.maxWidth // For text autogrow
|
|
4785
|
-
;
|
|
4786
|
-
var inputEl = React.useRef(null);
|
|
4787
|
-
var inputId = v4();
|
|
4788
|
-
var inputClass = ['custom_input'];
|
|
4789
|
-
var labelClass = ['form_block_label'];
|
|
4790
|
-
var blockClass = ['form_block'];
|
|
4791
|
-
if (autogrow && type == "text") {
|
|
4792
|
-
inputClass.push('w_auto');
|
|
4793
|
-
inputClass.push('is_autogrow');
|
|
4794
|
-
fullWidth = null;
|
|
4795
|
-
width = null;
|
|
4796
|
-
}
|
|
4797
|
-
if (fullWidth) {
|
|
4798
|
-
width = 'full';
|
|
4799
|
-
}
|
|
4800
|
-
if (width) {
|
|
4801
|
-
inputClass.push('w_' + width);
|
|
4802
|
-
}
|
|
4803
|
-
if (style === "ghost") {
|
|
4804
|
-
inputClass.push('ghost');
|
|
4805
|
-
}
|
|
4806
|
-
if (color === "white") {
|
|
4807
|
-
inputClass.push('bg_' + color);
|
|
4808
|
-
}
|
|
4809
|
-
if (className) {
|
|
4810
|
-
inputClass.push(className);
|
|
4811
|
-
}
|
|
4812
|
-
if (disabled) {
|
|
4813
|
-
inputClass.push('disabled');
|
|
4814
|
-
}
|
|
4815
|
-
if (readonly) {
|
|
4816
|
-
inputClass.push('readonly');
|
|
4817
|
-
}
|
|
4818
|
-
if (labelClassName) {
|
|
4819
|
-
labelClass.push(labelClassName);
|
|
4820
|
-
}
|
|
4821
|
-
if (isAnError) {
|
|
4822
|
-
inputClass.push('error');
|
|
4823
|
-
}
|
|
4824
|
-
if (blockClassName) {
|
|
4825
|
-
blockClass.push(blockClassName);
|
|
4826
|
-
}
|
|
4827
|
-
// Size : xs, s, default, l, xl, xxl
|
|
4828
|
-
if (size) {
|
|
4829
|
-
inputClass.push(size);
|
|
4830
|
-
}
|
|
4831
|
-
var change = function (e) {
|
|
4832
|
-
if (typeof onChange === 'function') {
|
|
4833
|
-
onChange(e);
|
|
4834
|
-
}
|
|
4835
|
-
if (typeof handleChangeForm === 'function') {
|
|
4836
|
-
handleChangeForm(e);
|
|
4837
|
-
}
|
|
4838
|
-
};
|
|
4839
|
-
var handleKeyPress = function (e) {
|
|
4840
|
-
if (typeof onEnter === 'function') {
|
|
4841
|
-
if (e.key === 'Enter') {
|
|
4842
|
-
onEnter(e);
|
|
4843
|
-
}
|
|
4844
|
-
}
|
|
4845
|
-
};
|
|
4846
|
-
var handleFocus = function (e) {
|
|
4847
|
-
if (selectOnFocus) {
|
|
4848
|
-
e.target.select();
|
|
4849
|
-
}
|
|
4850
|
-
if (typeof onFocus === 'function') {
|
|
4851
|
-
onFocus(e);
|
|
4852
|
-
}
|
|
4853
|
-
};
|
|
4854
|
-
var handleBlur = function (e) {
|
|
4855
|
-
if (typeof onBlur === 'function') {
|
|
4856
|
-
onBlur(e);
|
|
4857
|
-
}
|
|
4858
|
-
};
|
|
4859
|
-
var onInput = function () {
|
|
4860
|
-
if (!autogrow)
|
|
4861
|
-
return;
|
|
4862
|
-
if (!inputEl.current)
|
|
4863
|
-
return;
|
|
4864
|
-
var c = inputEl.current;
|
|
4865
|
-
// Autogrow
|
|
4866
|
-
if (type == 'textarea') {
|
|
4867
|
-
c.style.height = "auto";
|
|
4868
|
-
var h = maxHeight ? Math.min(maxHeight, c.scrollHeight) : c.scrollHeight;
|
|
4869
|
-
c.style.height = h + "px";
|
|
4870
|
-
return;
|
|
4871
|
-
}
|
|
4872
|
-
if (type == 'text') {
|
|
4873
|
-
c.style.width = "auto";
|
|
4874
|
-
c.style.maxWidth = "80px";
|
|
4875
|
-
var w = maxWidth ? Math.min(maxWidth, c.scrollWidth) : c.scrollWidth;
|
|
4876
|
-
c.style.width = w + "px";
|
|
4877
|
-
c.style.maxWidth = "";
|
|
4878
|
-
return;
|
|
4879
|
-
}
|
|
4880
|
-
};
|
|
4881
|
-
React.useEffect(function () {
|
|
4882
|
-
onInput();
|
|
4883
|
-
}, [value]);
|
|
4884
|
-
var input = (React.createElement(React.Fragment, null,
|
|
4885
|
-
React.createElement("label", { className: inputClass.join(' ') },
|
|
4886
|
-
prepend && prepend,
|
|
4887
|
-
type == 'textarea' ?
|
|
4888
|
-
React.createElement("textarea", { ref: inputEl, id: inputId, name: name, onChange: function (e) { return change(e); }, value: value, placeholder: placeholder || placeHolder, onFocus: function (e) { return handleFocus(e); }, onBlur: function (e) { return handleBlur(e); }, autoFocus: autoFocus, rows: typeof rows === "string" ? parseInt(rows) : rows, onKeyPress: function (e) { return handleKeyPress(e); }, disabled: disabled, readOnly: readonly, spellCheck: spellCheck })
|
|
4889
|
-
:
|
|
4890
|
-
React.createElement("input", { ref: inputEl, id: inputId, type: type, name: name, min: min, max: max, onChange: function (e) { return change(e); }, value: value, placeholder: placeholder || placeHolder, onFocus: function (e) { return handleFocus(e); }, onBlur: function (e) { return handleBlur(e); }, autoFocus: autoFocus, onKeyPress: function (e) { return handleKeyPress(e); }, disabled: disabled, readOnly: readonly }),
|
|
4891
|
-
unit &&
|
|
4892
|
-
React.createElement("span", { className: "custom_input_unit" }, unit),
|
|
4893
|
-
append && append),
|
|
4894
|
-
isAnError &&
|
|
4895
|
-
React.createElement("div", { className: "custom_input_sub_error" }, isAnError),
|
|
4896
|
-
descriptionBottom &&
|
|
4897
|
-
React.createElement("div", { className: "custom_input_sub_desc" }, descriptionBottom)));
|
|
4898
|
-
if (label) {
|
|
4899
|
-
return (React.createElement("div", { className: blockClass.join(' ') },
|
|
4900
|
-
React.createElement("div", { className: labelClass.join(' ') },
|
|
4901
|
-
React.createElement("label", { htmlFor: inputId }, label),
|
|
4902
|
-
labelTooltip &&
|
|
4903
|
-
React.createElement(React.Fragment, null,
|
|
4904
|
-
React.createElement("a", { className: "icon_btn s v_al_bl", "data-tip": labelTooltip },
|
|
4905
|
-
React.createElement("i", { className: "fas fa-info-circle" })),
|
|
4906
|
-
React.createElement(ReactTooltip, { backgroundColor: "black", effect: "solid", place: "bottom", eventOff: "click", delayShow: 600 }))),
|
|
4907
|
-
description &&
|
|
4908
|
-
React.createElement("div", { className: "form_block_description" }, description),
|
|
4909
|
-
input));
|
|
4910
|
-
}
|
|
4911
|
-
return input;
|
|
4912
|
-
}
|
|
4913
|
-
|
|
4914
|
-
exports.Avatar = Avatar;
|
|
4915
|
-
exports.Breadcrumb = Breadcrumb;
|
|
4916
165
|
exports.Btn = BYbtn;
|
|
4917
|
-
exports.Checkbox = Checkbox;
|
|
4918
166
|
exports.Collapse = Collapse;
|
|
4919
|
-
exports.InputCustom = InputCustom;
|
|
4920
167
|
exports.Modal = Modal;
|
|
4921
168
|
exports.Portal = Portal;
|
|
4922
|
-
exports.Spinner = Spinner;
|
|
4923
|
-
exports.SpinnerWheel = SpinnerWheel;
|
|
4924
169
|
//# sourceMappingURL=index.js.map
|