@wix/video 1.72.0
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/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/cjs/Video.js +121 -0
- package/dist/cjs/Video.js.map +1 -0
- package/dist/cjs/Video.module.scss +27 -0
- package/dist/cjs/Video.stories.js +68 -0
- package/dist/cjs/Video.stories.js.map +1 -0
- package/dist/cjs/custom-element/WowVideo.js +88 -0
- package/dist/cjs/custom-element/WowVideo.js.map +1 -0
- package/dist/cjs/custom-element/registry.js +34 -0
- package/dist/cjs/custom-element/registry.js.map +1 -0
- package/dist/cjs/custom-element/utils.js +138 -0
- package/dist/cjs/custom-element/utils.js.map +1 -0
- package/dist/cjs/custom-element/videoLayout.js +120 -0
- package/dist/cjs/custom-element/videoLayout.js.map +1 -0
- package/dist/cjs/customElementInit.js +10 -0
- package/dist/cjs/customElementInit.js.map +1 -0
- package/dist/cjs/dataManifest.js +53 -0
- package/dist/cjs/dataManifest.js.map +1 -0
- package/dist/cjs/external-types.d.js +2 -0
- package/dist/cjs/external-types.d.js.map +1 -0
- package/dist/cjs/index.js +23 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/storybook/Container.js +33 -0
- package/dist/cjs/storybook/Container.js.map +1 -0
- package/dist/cjs/storybook/args.js +178 -0
- package/dist/cjs/storybook/args.js.map +1 -0
- package/dist/cjs/test-types.d.js +2 -0
- package/dist/cjs/test-types.d.js.map +1 -0
- package/dist/cjs/types.js +4 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/Video.js +95 -0
- package/dist/esm/Video.js.map +1 -0
- package/dist/esm/Video.module.scss +27 -0
- package/dist/esm/Video.stories.js +47 -0
- package/dist/esm/Video.stories.js.map +1 -0
- package/dist/esm/custom-element/WowVideo.js +83 -0
- package/dist/esm/custom-element/WowVideo.js.map +1 -0
- package/dist/esm/custom-element/registry.js +29 -0
- package/dist/esm/custom-element/registry.js.map +1 -0
- package/dist/esm/custom-element/utils.js +131 -0
- package/dist/esm/custom-element/utils.js.map +1 -0
- package/dist/esm/custom-element/videoLayout.js +117 -0
- package/dist/esm/custom-element/videoLayout.js.map +1 -0
- package/dist/esm/customElementInit.js +13 -0
- package/dist/esm/customElementInit.js.map +1 -0
- package/dist/esm/dataManifest.js +49 -0
- package/dist/esm/dataManifest.js.map +1 -0
- package/dist/esm/external-types.d.js +2 -0
- package/dist/esm/external-types.d.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/storybook/Container.js +21 -0
- package/dist/esm/storybook/Container.js.map +1 -0
- package/dist/esm/storybook/args.js +174 -0
- package/dist/esm/storybook/args.js.map +1 -0
- package/dist/esm/test-types.d.js +2 -0
- package/dist/esm/test-types.d.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/statics/189.chunk.js +35383 -0
- package/dist/statics/189.chunk.js.map +1 -0
- package/dist/statics/189.chunk.min.js +2 -0
- package/dist/statics/189.chunk.min.js.map +1 -0
- package/dist/statics/janet/110.8a580c2d.iframe.bundle.js +10826 -0
- package/dist/statics/janet/110.8a580c2d.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/134.6007b391.iframe.bundle.js +484 -0
- package/dist/statics/janet/134.6007b391.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/134.d48c36bc94ecd2280c0a.manager.bundle.js +1 -0
- package/dist/statics/janet/317.2df397a1e1f34d5a30fd.manager.bundle.js +1 -0
- package/dist/statics/janet/326.e8fcdb36.iframe.bundle.js +1998 -0
- package/dist/statics/janet/326.e8fcdb36.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/326.ff40cdf1778fd94969c8.manager.bundle.js +2 -0
- package/dist/statics/janet/326.ff40cdf1778fd94969c8.manager.bundle.js.LICENSE.txt +31 -0
- package/dist/statics/janet/470.aab6696c.iframe.bundle.js +35380 -0
- package/dist/statics/janet/470.aab6696c.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/599.37d4aa34.iframe.bundle.js +3294 -0
- package/dist/statics/janet/599.37d4aa34.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/599.47c7dacc8997e4d71eac.manager.bundle.js +1 -0
- package/dist/statics/janet/61.5cb88eb5.iframe.bundle.js +2652 -0
- package/dist/statics/janet/61.5cb88eb5.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/61.a575d4776ab0d42da5c8.manager.bundle.js +1 -0
- package/dist/statics/janet/673.59f2a23a.iframe.bundle.js +173 -0
- package/dist/statics/janet/673.59f2a23a.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/725.0db49c6347dfe44ace2d.manager.bundle.js +2 -0
- package/dist/statics/janet/725.0db49c6347dfe44ace2d.manager.bundle.js.LICENSE.txt +8 -0
- package/dist/statics/janet/725.cbba2e4b.iframe.bundle.js +10451 -0
- package/dist/statics/janet/725.cbba2e4b.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/734.428ea23e9773cd26fb57.manager.bundle.js +2 -0
- package/dist/statics/janet/734.428ea23e9773cd26fb57.manager.bundle.js.LICENSE.txt +94 -0
- package/dist/statics/janet/833.75275036.iframe.bundle.js +6777 -0
- package/dist/statics/janet/833.75275036.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/833.ef639b005d7b76723595.manager.bundle.js +2 -0
- package/dist/statics/janet/833.ef639b005d7b76723595.manager.bundle.js.LICENSE.txt +12 -0
- package/dist/statics/janet/W-06.svg +1 -0
- package/dist/statics/janet/favicon.ico +0 -0
- package/dist/statics/janet/iframe.html +364 -0
- package/dist/statics/janet/index.html +59 -0
- package/dist/statics/janet/janet.json +10 -0
- package/dist/statics/janet/main.666d4853f3d62ab20aa1.manager.bundle.js +1 -0
- package/dist/statics/janet/main.d8a321d6.iframe.bundle.js +73260 -0
- package/dist/statics/janet/main.d8a321d6.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/project.json +1 -0
- package/dist/statics/janet/runtime~main.2195d24e465f19ad9c9a.manager.bundle.js +1 -0
- package/dist/statics/janet/w-06.ico +0 -0
- package/dist/statics/manifest.json +4 -0
- package/dist/statics/manifest.min.json +4 -0
- package/dist/statics/video.css +10 -0
- package/dist/statics/video.css.map +1 -0
- package/dist/statics/video.min.css +1 -0
- package/dist/statics/video.rtl.css +8 -0
- package/dist/statics/video.rtl.min.css +1 -0
- package/dist/statics/video.umd.js +5990 -0
- package/dist/statics/video.umd.js.map +1 -0
- package/dist/statics/video.umd.min.js +2 -0
- package/dist/statics/video.umd.min.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Video.d.ts +5 -0
- package/dist/types/Video.d.ts.map +1 -0
- package/dist/types/Video.stories.d.ts +20 -0
- package/dist/types/Video.stories.d.ts.map +1 -0
- package/dist/types/custom-element/WowVideo.d.ts +4 -0
- package/dist/types/custom-element/WowVideo.d.ts.map +1 -0
- package/dist/types/custom-element/registry.d.ts +3 -0
- package/dist/types/custom-element/registry.d.ts.map +1 -0
- package/dist/types/custom-element/utils.d.ts +11 -0
- package/dist/types/custom-element/utils.d.ts.map +1 -0
- package/dist/types/custom-element/videoLayout.d.ts +35 -0
- package/dist/types/custom-element/videoLayout.d.ts.map +1 -0
- package/dist/types/customElementInit.d.ts +4 -0
- package/dist/types/customElementInit.d.ts.map +1 -0
- package/dist/types/dataManifest.d.ts +2 -0
- package/dist/types/dataManifest.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/storybook/Container.d.ts +5 -0
- package/dist/types/storybook/Container.d.ts.map +1 -0
- package/dist/types/storybook/args.d.ts +174 -0
- package/dist/types/storybook/args.d.ts.map +1 -0
- package/dist/types/types.d.ts +62 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,3294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(self["webpackChunk_wix_video"] = self["webpackChunk_wix_video"] || []).push([[599],{
|
|
3
|
+
|
|
4
|
+
/***/ 13599:
|
|
5
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
|
+
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ WithToolTipState: () => (/* binding */ WithToolTipState),
|
|
10
|
+
/* harmony export */ WithTooltip: () => (/* binding */ WithToolTipState),
|
|
11
|
+
/* harmony export */ WithTooltipPure: () => (/* binding */ WithTooltipPure)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58070);
|
|
14
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
15
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93510);
|
|
16
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
17
|
+
/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2432);
|
|
18
|
+
/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
19
|
+
/* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45968);
|
|
20
|
+
/* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
21
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80630);
|
|
22
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
23
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10568);
|
|
24
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
25
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18867);
|
|
26
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6__);
|
|
27
|
+
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68291);
|
|
28
|
+
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_7__);
|
|
29
|
+
/* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(87050);
|
|
30
|
+
/* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_8__);
|
|
31
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98376);
|
|
32
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_9__);
|
|
33
|
+
/* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58225);
|
|
34
|
+
/* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10__);
|
|
35
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5305);
|
|
36
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_11__);
|
|
37
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(93277);
|
|
38
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__);
|
|
39
|
+
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(34147);
|
|
40
|
+
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_13__);
|
|
41
|
+
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(16411);
|
|
42
|
+
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_14__);
|
|
43
|
+
/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(14293);
|
|
44
|
+
/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_15__);
|
|
45
|
+
/* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(33975);
|
|
46
|
+
/* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_16__);
|
|
47
|
+
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(33873);
|
|
48
|
+
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_17__);
|
|
49
|
+
/* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(68470);
|
|
50
|
+
/* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_18__);
|
|
51
|
+
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(11011);
|
|
52
|
+
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_19__);
|
|
53
|
+
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(47010);
|
|
54
|
+
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_20__);
|
|
55
|
+
/* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(63252);
|
|
56
|
+
/* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_21__);
|
|
57
|
+
/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(56569);
|
|
58
|
+
/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_22__);
|
|
59
|
+
/* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(85668);
|
|
60
|
+
/* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_23__);
|
|
61
|
+
/* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(10865);
|
|
62
|
+
/* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_24__);
|
|
63
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(18981);
|
|
64
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_25__);
|
|
65
|
+
/* harmony import */ var core_js_modules_es_array_buffer_constructor_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(49694);
|
|
66
|
+
/* harmony import */ var core_js_modules_es_array_buffer_constructor_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_buffer_constructor_js__WEBPACK_IMPORTED_MODULE_26__);
|
|
67
|
+
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(8697);
|
|
68
|
+
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_27__);
|
|
69
|
+
/* harmony import */ var core_js_modules_es_regexp_flags_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(47146);
|
|
70
|
+
/* harmony import */ var core_js_modules_es_regexp_flags_js__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_flags_js__WEBPACK_IMPORTED_MODULE_28__);
|
|
71
|
+
/* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(39428);
|
|
72
|
+
/* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_29__);
|
|
73
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(62234);
|
|
74
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_30__);
|
|
75
|
+
/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(47748);
|
|
76
|
+
/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_31__);
|
|
77
|
+
/* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(86741);
|
|
78
|
+
/* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_32___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_32__);
|
|
79
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(11875);
|
|
80
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_33__);
|
|
81
|
+
/* harmony import */ var _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(94106);
|
|
82
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(14041);
|
|
83
|
+
/* harmony import */ var _storybook_theming__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(88480);
|
|
84
|
+
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(43144);
|
|
85
|
+
/* harmony import */ var memoizerific__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(27430);
|
|
86
|
+
/* harmony import */ var memoizerific__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(memoizerific__WEBPACK_IMPORTED_MODULE_36__);
|
|
87
|
+
/* harmony import */ var _storybook_csf__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(82098);
|
|
88
|
+
/* harmony import */ var _storybook_csf__WEBPACK_IMPORTED_MODULE_37___default = /*#__PURE__*/__webpack_require__.n(_storybook_csf__WEBPACK_IMPORTED_MODULE_37__);
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
var _templateObject, _templateObject2;
|
|
95
|
+
|
|
96
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
97
|
+
|
|
98
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
99
|
+
|
|
100
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
101
|
+
|
|
102
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
103
|
+
|
|
104
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
105
|
+
|
|
106
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
107
|
+
|
|
108
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
109
|
+
|
|
110
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
function getNodeName(element) {
|
|
153
|
+
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function getWindow(node) {
|
|
157
|
+
if (node == null) {
|
|
158
|
+
return window;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (node.toString() !== '[object Window]') {
|
|
162
|
+
var ownerDocument = node.ownerDocument;
|
|
163
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return node;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function isElement(node) {
|
|
170
|
+
var OwnElement = getWindow(node).Element;
|
|
171
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function isHTMLElement(node) {
|
|
175
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
176
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function isShadowRoot(node) {
|
|
180
|
+
// IE 11 has no ShadowRoot
|
|
181
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
186
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
187
|
+
} // and applies them to the HTMLElements such as popper and arrow
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
function applyStyles(_ref) {
|
|
191
|
+
var state = _ref.state;
|
|
192
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
193
|
+
var style = state.styles[name] || {};
|
|
194
|
+
var attributes = state.attributes[name] || {};
|
|
195
|
+
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
196
|
+
|
|
197
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
198
|
+
return;
|
|
199
|
+
} // Flow doesn't support to extend this property, but it's the most
|
|
200
|
+
// effective way to apply styles to an HTMLElement
|
|
201
|
+
// $FlowFixMe[cannot-write]
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
Object.assign(element.style, style);
|
|
205
|
+
Object.keys(attributes).forEach(function (name) {
|
|
206
|
+
var value = attributes[name];
|
|
207
|
+
|
|
208
|
+
if (value === false) {
|
|
209
|
+
element.removeAttribute(name);
|
|
210
|
+
} else {
|
|
211
|
+
element.setAttribute(name, value === true ? '' : value);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function effect$2(_ref2) {
|
|
218
|
+
var state = _ref2.state;
|
|
219
|
+
var initialStyles = {
|
|
220
|
+
popper: {
|
|
221
|
+
position: state.options.strategy,
|
|
222
|
+
left: '0',
|
|
223
|
+
top: '0',
|
|
224
|
+
margin: '0'
|
|
225
|
+
},
|
|
226
|
+
arrow: {
|
|
227
|
+
position: 'absolute'
|
|
228
|
+
},
|
|
229
|
+
reference: {}
|
|
230
|
+
};
|
|
231
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
232
|
+
state.styles = initialStyles;
|
|
233
|
+
|
|
234
|
+
if (state.elements.arrow) {
|
|
235
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return function () {
|
|
239
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
240
|
+
var element = state.elements[name];
|
|
241
|
+
var attributes = state.attributes[name] || {};
|
|
242
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
|
243
|
+
|
|
244
|
+
var style = styleProperties.reduce(function (style, property) {
|
|
245
|
+
style[property] = '';
|
|
246
|
+
return style;
|
|
247
|
+
}, {}); // arrow is optional + virtual elements
|
|
248
|
+
|
|
249
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
Object.assign(element.style, style);
|
|
254
|
+
Object.keys(attributes).forEach(function (attribute) {
|
|
255
|
+
element.removeAttribute(attribute);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
var applyStyles$1 = {
|
|
263
|
+
name: 'applyStyles',
|
|
264
|
+
enabled: true,
|
|
265
|
+
phase: 'write',
|
|
266
|
+
fn: applyStyles,
|
|
267
|
+
effect: effect$2,
|
|
268
|
+
requires: ['computeStyles']
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
function getBasePlacement(placement) {
|
|
272
|
+
return placement.split('-')[0];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
var max = Math.max;
|
|
276
|
+
var min = Math.min;
|
|
277
|
+
var round = Math.round;
|
|
278
|
+
|
|
279
|
+
function getBoundingClientRect(element, includeScale) {
|
|
280
|
+
if (includeScale === void 0) {
|
|
281
|
+
includeScale = false;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
var rect = element.getBoundingClientRect();
|
|
285
|
+
var scaleX = 1;
|
|
286
|
+
var scaleY = 1;
|
|
287
|
+
|
|
288
|
+
if (isHTMLElement(element) && includeScale) {
|
|
289
|
+
var offsetHeight = element.offsetHeight;
|
|
290
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
|
291
|
+
// Fallback to 1 in case both values are `0`
|
|
292
|
+
|
|
293
|
+
if (offsetWidth > 0) {
|
|
294
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (offsetHeight > 0) {
|
|
298
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return {
|
|
303
|
+
width: rect.width / scaleX,
|
|
304
|
+
height: rect.height / scaleY,
|
|
305
|
+
top: rect.top / scaleY,
|
|
306
|
+
right: rect.right / scaleX,
|
|
307
|
+
bottom: rect.bottom / scaleY,
|
|
308
|
+
left: rect.left / scaleX,
|
|
309
|
+
x: rect.left / scaleX,
|
|
310
|
+
y: rect.top / scaleY
|
|
311
|
+
};
|
|
312
|
+
} // means it doesn't take into account transforms.
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
function getLayoutRect(element) {
|
|
316
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
317
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
318
|
+
|
|
319
|
+
var width = element.offsetWidth;
|
|
320
|
+
var height = element.offsetHeight;
|
|
321
|
+
|
|
322
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
323
|
+
width = clientRect.width;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
327
|
+
height = clientRect.height;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return {
|
|
331
|
+
x: element.offsetLeft,
|
|
332
|
+
y: element.offsetTop,
|
|
333
|
+
width: width,
|
|
334
|
+
height: height
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function contains(parent, child) {
|
|
339
|
+
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
|
340
|
+
|
|
341
|
+
if (parent.contains(child)) {
|
|
342
|
+
return true;
|
|
343
|
+
} // then fallback to custom implementation with Shadow DOM support
|
|
344
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
345
|
+
var next = child;
|
|
346
|
+
|
|
347
|
+
do {
|
|
348
|
+
if (next && parent.isSameNode(next)) {
|
|
349
|
+
return true;
|
|
350
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
next = next.parentNode || next.host;
|
|
354
|
+
} while (next);
|
|
355
|
+
} // Give up, the result is false
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function getComputedStyle(element) {
|
|
362
|
+
return getWindow(element).getComputedStyle(element);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function isTableElement(element) {
|
|
366
|
+
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function getDocumentElement(element) {
|
|
370
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
371
|
+
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
372
|
+
element.document) || window.document).documentElement;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function getParentNode(element) {
|
|
376
|
+
if (getNodeName(element) === 'html') {
|
|
377
|
+
return element;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
381
|
+
// $FlowFixMe[incompatible-return]
|
|
382
|
+
// $FlowFixMe[prop-missing]
|
|
383
|
+
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
384
|
+
element.parentNode || ( // DOM Element detected
|
|
385
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
386
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
387
|
+
getDocumentElement(element) // fallback
|
|
388
|
+
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function getTrueOffsetParent(element) {
|
|
393
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
394
|
+
getComputedStyle(element).position === 'fixed') {
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return element.offsetParent;
|
|
399
|
+
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
|
400
|
+
// return the containing block
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
function getContainingBlock(element) {
|
|
404
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
|
|
405
|
+
var isIE = navigator.userAgent.indexOf('Trident') !== -1;
|
|
406
|
+
|
|
407
|
+
if (isIE && isHTMLElement(element)) {
|
|
408
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
409
|
+
var elementCss = getComputedStyle(element);
|
|
410
|
+
|
|
411
|
+
if (elementCss.position === 'fixed') {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
var currentNode = getParentNode(element);
|
|
417
|
+
|
|
418
|
+
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
419
|
+
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
420
|
+
// create a containing block.
|
|
421
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
422
|
+
|
|
423
|
+
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
|
424
|
+
return currentNode;
|
|
425
|
+
} else {
|
|
426
|
+
currentNode = currentNode.parentNode;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return null;
|
|
431
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
432
|
+
// such as table ancestors and cross browser bugs.
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
function getOffsetParent(element) {
|
|
436
|
+
var window = getWindow(element);
|
|
437
|
+
var offsetParent = getTrueOffsetParent(element);
|
|
438
|
+
|
|
439
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
440
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
|
444
|
+
return window;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function getMainAxisFromPlacement(placement) {
|
|
451
|
+
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function within(min$1, value, max$1) {
|
|
455
|
+
return max(min$1, min(value, max$1));
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function withinMaxClamp(min, value, max) {
|
|
459
|
+
var v = within(min, value, max);
|
|
460
|
+
return v > max ? max : v;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function getFreshSideObject() {
|
|
464
|
+
return {
|
|
465
|
+
top: 0,
|
|
466
|
+
right: 0,
|
|
467
|
+
bottom: 0,
|
|
468
|
+
left: 0
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function mergePaddingObject(paddingObject) {
|
|
473
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function expandToHashMap(value, keys) {
|
|
477
|
+
return keys.reduce(function (hashMap, key) {
|
|
478
|
+
hashMap[key] = value;
|
|
479
|
+
return hashMap;
|
|
480
|
+
}, {});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
484
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
485
|
+
placement: state.placement
|
|
486
|
+
})) : padding;
|
|
487
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.f));
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
function arrow(_ref) {
|
|
491
|
+
var _state$modifiersData$;
|
|
492
|
+
|
|
493
|
+
var state = _ref.state,
|
|
494
|
+
name = _ref.name,
|
|
495
|
+
options = _ref.options;
|
|
496
|
+
var arrowElement = state.elements.arrow;
|
|
497
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
498
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
499
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
|
500
|
+
var isVertical = [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r].indexOf(basePlacement) >= 0;
|
|
501
|
+
var len = isVertical ? 'height' : 'width';
|
|
502
|
+
|
|
503
|
+
if (!arrowElement || !popperOffsets) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
508
|
+
var arrowRect = getLayoutRect(arrowElement);
|
|
509
|
+
var minProp = axis === 'y' ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l;
|
|
510
|
+
var maxProp = axis === 'y' ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r;
|
|
511
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
512
|
+
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
513
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
514
|
+
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
515
|
+
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
516
|
+
// outside of the popper bounds
|
|
517
|
+
|
|
518
|
+
var min = paddingObject[minProp];
|
|
519
|
+
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
520
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
521
|
+
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
|
522
|
+
|
|
523
|
+
var axisProp = axis;
|
|
524
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function effect$1(_ref2) {
|
|
528
|
+
var state = _ref2.state,
|
|
529
|
+
options = _ref2.options;
|
|
530
|
+
var _options$element = options.element,
|
|
531
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
532
|
+
|
|
533
|
+
if (arrowElement == null) {
|
|
534
|
+
return;
|
|
535
|
+
} // CSS selector
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
if (typeof arrowElement === 'string') {
|
|
539
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
540
|
+
|
|
541
|
+
if (!arrowElement) {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if (false) {}
|
|
547
|
+
|
|
548
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
|
549
|
+
if (false) {}
|
|
550
|
+
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
state.elements.arrow = arrowElement;
|
|
555
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
var arrow$1 = {
|
|
559
|
+
name: 'arrow',
|
|
560
|
+
enabled: true,
|
|
561
|
+
phase: 'main',
|
|
562
|
+
fn: arrow,
|
|
563
|
+
effect: effect$1,
|
|
564
|
+
requires: ['popperOffsets'],
|
|
565
|
+
requiresIfExists: ['preventOverflow']
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
function getVariation(placement) {
|
|
569
|
+
return placement.split('-')[1];
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
var unsetSides = {
|
|
573
|
+
top: 'auto',
|
|
574
|
+
right: 'auto',
|
|
575
|
+
bottom: 'auto',
|
|
576
|
+
left: 'auto'
|
|
577
|
+
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
|
578
|
+
// Zooming can change the DPR, but it seems to report a value that will
|
|
579
|
+
// cleanly divide the values into the appropriate subpixels.
|
|
580
|
+
|
|
581
|
+
function roundOffsetsByDPR(_ref) {
|
|
582
|
+
var x = _ref.x,
|
|
583
|
+
y = _ref.y;
|
|
584
|
+
var win = window;
|
|
585
|
+
var dpr = win.devicePixelRatio || 1;
|
|
586
|
+
return {
|
|
587
|
+
x: round(x * dpr) / dpr || 0,
|
|
588
|
+
y: round(y * dpr) / dpr || 0
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
function mapToStyles(_ref2) {
|
|
593
|
+
var _Object$assign2;
|
|
594
|
+
|
|
595
|
+
var popper = _ref2.popper,
|
|
596
|
+
popperRect = _ref2.popperRect,
|
|
597
|
+
placement = _ref2.placement,
|
|
598
|
+
variation = _ref2.variation,
|
|
599
|
+
offsets = _ref2.offsets,
|
|
600
|
+
position = _ref2.position,
|
|
601
|
+
gpuAcceleration = _ref2.gpuAcceleration,
|
|
602
|
+
adaptive = _ref2.adaptive,
|
|
603
|
+
roundOffsets = _ref2.roundOffsets,
|
|
604
|
+
isFixed = _ref2.isFixed;
|
|
605
|
+
var _offsets$x = offsets.x,
|
|
606
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
607
|
+
_offsets$y = offsets.y,
|
|
608
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
609
|
+
|
|
610
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
611
|
+
x: x,
|
|
612
|
+
y: y
|
|
613
|
+
}) : {
|
|
614
|
+
x: x,
|
|
615
|
+
y: y
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
x = _ref3.x;
|
|
619
|
+
y = _ref3.y;
|
|
620
|
+
var hasX = offsets.hasOwnProperty('x');
|
|
621
|
+
var hasY = offsets.hasOwnProperty('y');
|
|
622
|
+
var sideX = _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l;
|
|
623
|
+
var sideY = _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t;
|
|
624
|
+
var win = window;
|
|
625
|
+
|
|
626
|
+
if (adaptive) {
|
|
627
|
+
var offsetParent = getOffsetParent(popper);
|
|
628
|
+
var heightProp = 'clientHeight';
|
|
629
|
+
var widthProp = 'clientWidth';
|
|
630
|
+
|
|
631
|
+
if (offsetParent === getWindow(popper)) {
|
|
632
|
+
offsetParent = getDocumentElement(popper);
|
|
633
|
+
|
|
634
|
+
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
|
635
|
+
heightProp = 'scrollHeight';
|
|
636
|
+
widthProp = 'scrollWidth';
|
|
637
|
+
}
|
|
638
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
offsetParent = offsetParent;
|
|
642
|
+
|
|
643
|
+
if (placement === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t || (placement === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l || placement === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r) && variation === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.i) {
|
|
644
|
+
sideY = _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h;
|
|
645
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
646
|
+
offsetParent[heightProp];
|
|
647
|
+
y -= offsetY - popperRect.height;
|
|
648
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
if (placement === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l || (placement === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t || placement === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h) && variation === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.i) {
|
|
652
|
+
sideX = _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r;
|
|
653
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
654
|
+
offsetParent[widthProp];
|
|
655
|
+
x -= offsetX - popperRect.width;
|
|
656
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
var commonStyles = Object.assign({
|
|
661
|
+
position: position
|
|
662
|
+
}, adaptive && unsetSides);
|
|
663
|
+
|
|
664
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
665
|
+
x: x,
|
|
666
|
+
y: y
|
|
667
|
+
}) : {
|
|
668
|
+
x: x,
|
|
669
|
+
y: y
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
x = _ref4.x;
|
|
673
|
+
y = _ref4.y;
|
|
674
|
+
|
|
675
|
+
if (gpuAcceleration) {
|
|
676
|
+
var _Object$assign;
|
|
677
|
+
|
|
678
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function computeStyles(_ref5) {
|
|
685
|
+
var state = _ref5.state,
|
|
686
|
+
options = _ref5.options;
|
|
687
|
+
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
688
|
+
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
689
|
+
_options$adaptive = options.adaptive,
|
|
690
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
691
|
+
_options$roundOffsets = options.roundOffsets,
|
|
692
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
693
|
+
|
|
694
|
+
if (false) { var transitionProperty; }
|
|
695
|
+
|
|
696
|
+
var commonStyles = {
|
|
697
|
+
placement: getBasePlacement(state.placement),
|
|
698
|
+
variation: getVariation(state.placement),
|
|
699
|
+
popper: state.elements.popper,
|
|
700
|
+
popperRect: state.rects.popper,
|
|
701
|
+
gpuAcceleration: gpuAcceleration,
|
|
702
|
+
isFixed: state.options.strategy === 'fixed'
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
706
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
707
|
+
offsets: state.modifiersData.popperOffsets,
|
|
708
|
+
position: state.options.strategy,
|
|
709
|
+
adaptive: adaptive,
|
|
710
|
+
roundOffsets: roundOffsets
|
|
711
|
+
})));
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (state.modifiersData.arrow != null) {
|
|
715
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
716
|
+
offsets: state.modifiersData.arrow,
|
|
717
|
+
position: 'absolute',
|
|
718
|
+
adaptive: false,
|
|
719
|
+
roundOffsets: roundOffsets
|
|
720
|
+
})));
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
724
|
+
'data-popper-placement': state.placement
|
|
725
|
+
});
|
|
726
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
var computeStyles$1 = {
|
|
730
|
+
name: 'computeStyles',
|
|
731
|
+
enabled: true,
|
|
732
|
+
phase: 'beforeWrite',
|
|
733
|
+
fn: computeStyles,
|
|
734
|
+
data: {}
|
|
735
|
+
};
|
|
736
|
+
var passive = {
|
|
737
|
+
passive: true
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
function effect(_ref) {
|
|
741
|
+
var state = _ref.state,
|
|
742
|
+
instance = _ref.instance,
|
|
743
|
+
options = _ref.options;
|
|
744
|
+
var _options$scroll = options.scroll,
|
|
745
|
+
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
746
|
+
_options$resize = options.resize,
|
|
747
|
+
resize = _options$resize === void 0 ? true : _options$resize;
|
|
748
|
+
var window = getWindow(state.elements.popper);
|
|
749
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
750
|
+
|
|
751
|
+
if (scroll) {
|
|
752
|
+
scrollParents.forEach(function (scrollParent) {
|
|
753
|
+
scrollParent.addEventListener('scroll', instance.update, passive);
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if (resize) {
|
|
758
|
+
window.addEventListener('resize', instance.update, passive);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return function () {
|
|
762
|
+
if (scroll) {
|
|
763
|
+
scrollParents.forEach(function (scrollParent) {
|
|
764
|
+
scrollParent.removeEventListener('scroll', instance.update, passive);
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (resize) {
|
|
769
|
+
window.removeEventListener('resize', instance.update, passive);
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
var eventListeners = {
|
|
776
|
+
name: 'eventListeners',
|
|
777
|
+
enabled: true,
|
|
778
|
+
phase: 'write',
|
|
779
|
+
fn: function fn() {},
|
|
780
|
+
effect: effect,
|
|
781
|
+
data: {}
|
|
782
|
+
};
|
|
783
|
+
var hash$1 = {
|
|
784
|
+
left: 'right',
|
|
785
|
+
right: 'left',
|
|
786
|
+
bottom: 'top',
|
|
787
|
+
top: 'bottom'
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
function getOppositePlacement(placement) {
|
|
791
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
792
|
+
return hash$1[matched];
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
var hash = {
|
|
797
|
+
start: 'end',
|
|
798
|
+
end: 'start'
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
function getOppositeVariationPlacement(placement) {
|
|
802
|
+
return placement.replace(/start|end/g, function (matched) {
|
|
803
|
+
return hash[matched];
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function getWindowScroll(node) {
|
|
808
|
+
var win = getWindow(node);
|
|
809
|
+
var scrollLeft = win.pageXOffset;
|
|
810
|
+
var scrollTop = win.pageYOffset;
|
|
811
|
+
return {
|
|
812
|
+
scrollLeft: scrollLeft,
|
|
813
|
+
scrollTop: scrollTop
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function getWindowScrollBarX(element) {
|
|
818
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
819
|
+
// incorrect for RTL.
|
|
820
|
+
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
821
|
+
// it's not an issue. I don't think anyone ever specifies width on <html>
|
|
822
|
+
// anyway.
|
|
823
|
+
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
824
|
+
// this (e.g. Edge 2019, IE11, Safari)
|
|
825
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
function getViewportRect(element) {
|
|
829
|
+
var win = getWindow(element);
|
|
830
|
+
var html = getDocumentElement(element);
|
|
831
|
+
var visualViewport = win.visualViewport;
|
|
832
|
+
var width = html.clientWidth;
|
|
833
|
+
var height = html.clientHeight;
|
|
834
|
+
var x = 0;
|
|
835
|
+
var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
|
|
836
|
+
// can be obscured underneath it.
|
|
837
|
+
// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
|
|
838
|
+
// if it isn't open, so if this isn't available, the popper will be detected
|
|
839
|
+
// to overflow the bottom of the screen too early.
|
|
840
|
+
|
|
841
|
+
if (visualViewport) {
|
|
842
|
+
width = visualViewport.width;
|
|
843
|
+
height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
|
|
844
|
+
// In Chrome, it returns a value very close to 0 (+/-) but contains rounding
|
|
845
|
+
// errors due to floating point numbers, so we need to check precision.
|
|
846
|
+
// Safari returns a number <= 0, usually < -1 when pinch-zoomed
|
|
847
|
+
// Feature detection fails in mobile emulation mode in Chrome.
|
|
848
|
+
// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
|
|
849
|
+
// 0.001
|
|
850
|
+
// Fallback here: "Not Safari" userAgent
|
|
851
|
+
|
|
852
|
+
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
853
|
+
x = visualViewport.offsetLeft;
|
|
854
|
+
y = visualViewport.offsetTop;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
return {
|
|
859
|
+
width: width,
|
|
860
|
+
height: height,
|
|
861
|
+
x: x + getWindowScrollBarX(element),
|
|
862
|
+
y: y
|
|
863
|
+
};
|
|
864
|
+
} // of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
function getDocumentRect(element) {
|
|
868
|
+
var _element$ownerDocumen;
|
|
869
|
+
|
|
870
|
+
var html = getDocumentElement(element);
|
|
871
|
+
var winScroll = getWindowScroll(element);
|
|
872
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
873
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
874
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
875
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
876
|
+
var y = -winScroll.scrollTop;
|
|
877
|
+
|
|
878
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
879
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
return {
|
|
883
|
+
width: width,
|
|
884
|
+
height: height,
|
|
885
|
+
x: x,
|
|
886
|
+
y: y
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function isScrollParent(element) {
|
|
891
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
892
|
+
var _getComputedStyle = getComputedStyle(element),
|
|
893
|
+
overflow = _getComputedStyle.overflow,
|
|
894
|
+
overflowX = _getComputedStyle.overflowX,
|
|
895
|
+
overflowY = _getComputedStyle.overflowY;
|
|
896
|
+
|
|
897
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function getScrollParent(node) {
|
|
901
|
+
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
902
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
903
|
+
return node.ownerDocument.body;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
907
|
+
return node;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
return getScrollParent(getParentNode(node));
|
|
911
|
+
}
|
|
912
|
+
/*
|
|
913
|
+
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
914
|
+
until we get to the top window object. This list is what we attach scroll listeners
|
|
915
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
916
|
+
reference element's position.
|
|
917
|
+
*/
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
function listScrollParents(element, list) {
|
|
921
|
+
var _element$ownerDocumen;
|
|
922
|
+
|
|
923
|
+
if (list === void 0) {
|
|
924
|
+
list = [];
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
var scrollParent = getScrollParent(element);
|
|
928
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
929
|
+
var win = getWindow(scrollParent);
|
|
930
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
931
|
+
var updatedList = list.concat(target);
|
|
932
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
933
|
+
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
function rectToClientRect(rect) {
|
|
937
|
+
return Object.assign({}, rect, {
|
|
938
|
+
left: rect.x,
|
|
939
|
+
top: rect.y,
|
|
940
|
+
right: rect.x + rect.width,
|
|
941
|
+
bottom: rect.y + rect.height
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
function getInnerBoundingClientRect(element) {
|
|
946
|
+
var rect = getBoundingClientRect(element);
|
|
947
|
+
rect.top = rect.top + element.clientTop;
|
|
948
|
+
rect.left = rect.left + element.clientLeft;
|
|
949
|
+
rect.bottom = rect.top + element.clientHeight;
|
|
950
|
+
rect.right = rect.left + element.clientWidth;
|
|
951
|
+
rect.width = element.clientWidth;
|
|
952
|
+
rect.height = element.clientHeight;
|
|
953
|
+
rect.x = rect.left;
|
|
954
|
+
rect.y = rect.top;
|
|
955
|
+
return rect;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
function getClientRectFromMixedType(element, clippingParent) {
|
|
959
|
+
return clippingParent === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.v ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
960
|
+
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
961
|
+
// clipping (or hiding) overflowing elements with a position different from
|
|
962
|
+
// `initial`
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
function getClippingParents(element) {
|
|
966
|
+
var clippingParents = listScrollParents(getParentNode(element));
|
|
967
|
+
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
|
968
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
969
|
+
|
|
970
|
+
if (!isElement(clipperElement)) {
|
|
971
|
+
return [];
|
|
972
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
return clippingParents.filter(function (clippingParent) {
|
|
976
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
977
|
+
});
|
|
978
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
979
|
+
// clipping parents
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
function getClippingRect(element, boundary, rootBoundary) {
|
|
983
|
+
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
|
984
|
+
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
|
985
|
+
var firstClippingParent = clippingParents[0];
|
|
986
|
+
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
987
|
+
var rect = getClientRectFromMixedType(element, clippingParent);
|
|
988
|
+
accRect.top = max(rect.top, accRect.top);
|
|
989
|
+
accRect.right = min(rect.right, accRect.right);
|
|
990
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
991
|
+
accRect.left = max(rect.left, accRect.left);
|
|
992
|
+
return accRect;
|
|
993
|
+
}, getClientRectFromMixedType(element, firstClippingParent));
|
|
994
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
995
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
996
|
+
clippingRect.x = clippingRect.left;
|
|
997
|
+
clippingRect.y = clippingRect.top;
|
|
998
|
+
return clippingRect;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
function computeOffsets(_ref) {
|
|
1002
|
+
var reference = _ref.reference,
|
|
1003
|
+
element = _ref.element,
|
|
1004
|
+
placement = _ref.placement;
|
|
1005
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
1006
|
+
var variation = placement ? getVariation(placement) : null;
|
|
1007
|
+
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
1008
|
+
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
1009
|
+
var offsets;
|
|
1010
|
+
|
|
1011
|
+
switch (basePlacement) {
|
|
1012
|
+
case _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t:
|
|
1013
|
+
offsets = {
|
|
1014
|
+
x: commonX,
|
|
1015
|
+
y: reference.y - element.height
|
|
1016
|
+
};
|
|
1017
|
+
break;
|
|
1018
|
+
|
|
1019
|
+
case _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h:
|
|
1020
|
+
offsets = {
|
|
1021
|
+
x: commonX,
|
|
1022
|
+
y: reference.y + reference.height
|
|
1023
|
+
};
|
|
1024
|
+
break;
|
|
1025
|
+
|
|
1026
|
+
case _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r:
|
|
1027
|
+
offsets = {
|
|
1028
|
+
x: reference.x + reference.width,
|
|
1029
|
+
y: commonY
|
|
1030
|
+
};
|
|
1031
|
+
break;
|
|
1032
|
+
|
|
1033
|
+
case _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l:
|
|
1034
|
+
offsets = {
|
|
1035
|
+
x: reference.x - element.width,
|
|
1036
|
+
y: commonY
|
|
1037
|
+
};
|
|
1038
|
+
break;
|
|
1039
|
+
|
|
1040
|
+
default:
|
|
1041
|
+
offsets = {
|
|
1042
|
+
x: reference.x,
|
|
1043
|
+
y: reference.y
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
1048
|
+
|
|
1049
|
+
if (mainAxis != null) {
|
|
1050
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
1051
|
+
|
|
1052
|
+
switch (variation) {
|
|
1053
|
+
case _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.s:
|
|
1054
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
1055
|
+
break;
|
|
1056
|
+
|
|
1057
|
+
case _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.i:
|
|
1058
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
return offsets;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
function detectOverflow(state, options) {
|
|
1067
|
+
if (options === void 0) {
|
|
1068
|
+
options = {};
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
var _options = options,
|
|
1072
|
+
_options$placement = _options.placement,
|
|
1073
|
+
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
|
1074
|
+
_options$boundary = _options.boundary,
|
|
1075
|
+
boundary = _options$boundary === void 0 ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.j : _options$boundary,
|
|
1076
|
+
_options$rootBoundary = _options.rootBoundary,
|
|
1077
|
+
rootBoundary = _options$rootBoundary === void 0 ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.v : _options$rootBoundary,
|
|
1078
|
+
_options$elementConte = _options.elementContext,
|
|
1079
|
+
elementContext = _options$elementConte === void 0 ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.p : _options$elementConte,
|
|
1080
|
+
_options$altBoundary = _options.altBoundary,
|
|
1081
|
+
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
|
1082
|
+
_options$padding = _options.padding,
|
|
1083
|
+
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
1084
|
+
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.f));
|
|
1085
|
+
var altContext = elementContext === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.p ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.k : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.p;
|
|
1086
|
+
var popperRect = state.rects.popper;
|
|
1087
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
1088
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
1089
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
1090
|
+
var popperOffsets = computeOffsets({
|
|
1091
|
+
reference: referenceClientRect,
|
|
1092
|
+
element: popperRect,
|
|
1093
|
+
strategy: 'absolute',
|
|
1094
|
+
placement: placement
|
|
1095
|
+
});
|
|
1096
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
1097
|
+
var elementClientRect = elementContext === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.p ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
1098
|
+
// 0 or negative = within the clipping rect
|
|
1099
|
+
|
|
1100
|
+
var overflowOffsets = {
|
|
1101
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
1102
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
1103
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
1104
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
1105
|
+
};
|
|
1106
|
+
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
|
1107
|
+
|
|
1108
|
+
if (elementContext === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.p && offsetData) {
|
|
1109
|
+
var offset = offsetData[placement];
|
|
1110
|
+
Object.keys(overflowOffsets).forEach(function (key) {
|
|
1111
|
+
var multiply = [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h].indexOf(key) >= 0 ? 1 : -1;
|
|
1112
|
+
var axis = [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h].indexOf(key) >= 0 ? 'y' : 'x';
|
|
1113
|
+
overflowOffsets[key] += offset[axis] * multiply;
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
return overflowOffsets;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
function computeAutoPlacement(state, options) {
|
|
1121
|
+
if (options === void 0) {
|
|
1122
|
+
options = {};
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
var _options = options,
|
|
1126
|
+
placement = _options.placement,
|
|
1127
|
+
boundary = _options.boundary,
|
|
1128
|
+
rootBoundary = _options.rootBoundary,
|
|
1129
|
+
padding = _options.padding,
|
|
1130
|
+
flipVariations = _options.flipVariations,
|
|
1131
|
+
_options$allowedAutoP = _options.allowedAutoPlacements,
|
|
1132
|
+
allowedAutoPlacements = _options$allowedAutoP === void 0 ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.n : _options$allowedAutoP;
|
|
1133
|
+
var variation = getVariation(placement);
|
|
1134
|
+
var placements$1 = variation ? flipVariations ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.m : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.m.filter(function (placement) {
|
|
1135
|
+
return getVariation(placement) === variation;
|
|
1136
|
+
}) : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.f;
|
|
1137
|
+
var allowedPlacements = placements$1.filter(function (placement) {
|
|
1138
|
+
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
if (allowedPlacements.length === 0) {
|
|
1142
|
+
allowedPlacements = placements$1;
|
|
1143
|
+
|
|
1144
|
+
if (false) {}
|
|
1145
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
1149
|
+
acc[placement] = detectOverflow(state, {
|
|
1150
|
+
placement: placement,
|
|
1151
|
+
boundary: boundary,
|
|
1152
|
+
rootBoundary: rootBoundary,
|
|
1153
|
+
padding: padding
|
|
1154
|
+
})[getBasePlacement(placement)];
|
|
1155
|
+
return acc;
|
|
1156
|
+
}, {});
|
|
1157
|
+
return Object.keys(overflows).sort(function (a, b) {
|
|
1158
|
+
return overflows[a] - overflows[b];
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
function getExpandedFallbackPlacements(placement) {
|
|
1163
|
+
if (getBasePlacement(placement) === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.o) {
|
|
1164
|
+
return [];
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
var oppositePlacement = getOppositePlacement(placement);
|
|
1168
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
function flip(_ref) {
|
|
1172
|
+
var state = _ref.state,
|
|
1173
|
+
options = _ref.options,
|
|
1174
|
+
name = _ref.name;
|
|
1175
|
+
|
|
1176
|
+
if (state.modifiersData[name]._skip) {
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
var _options$mainAxis = options.mainAxis,
|
|
1181
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
1182
|
+
_options$altAxis = options.altAxis,
|
|
1183
|
+
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
|
1184
|
+
specifiedFallbackPlacements = options.fallbackPlacements,
|
|
1185
|
+
padding = options.padding,
|
|
1186
|
+
boundary = options.boundary,
|
|
1187
|
+
rootBoundary = options.rootBoundary,
|
|
1188
|
+
altBoundary = options.altBoundary,
|
|
1189
|
+
_options$flipVariatio = options.flipVariations,
|
|
1190
|
+
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
|
1191
|
+
allowedAutoPlacements = options.allowedAutoPlacements;
|
|
1192
|
+
var preferredPlacement = state.options.placement;
|
|
1193
|
+
var basePlacement = getBasePlacement(preferredPlacement);
|
|
1194
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
|
1195
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
1196
|
+
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
1197
|
+
return acc.concat(getBasePlacement(placement) === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.o ? computeAutoPlacement(state, {
|
|
1198
|
+
placement: placement,
|
|
1199
|
+
boundary: boundary,
|
|
1200
|
+
rootBoundary: rootBoundary,
|
|
1201
|
+
padding: padding,
|
|
1202
|
+
flipVariations: flipVariations,
|
|
1203
|
+
allowedAutoPlacements: allowedAutoPlacements
|
|
1204
|
+
}) : placement);
|
|
1205
|
+
}, []);
|
|
1206
|
+
var referenceRect = state.rects.reference;
|
|
1207
|
+
var popperRect = state.rects.popper;
|
|
1208
|
+
var checksMap = new Map();
|
|
1209
|
+
var makeFallbackChecks = true;
|
|
1210
|
+
var firstFittingPlacement = placements[0];
|
|
1211
|
+
|
|
1212
|
+
for (var i = 0; i < placements.length; i++) {
|
|
1213
|
+
var placement = placements[i];
|
|
1214
|
+
|
|
1215
|
+
var _basePlacement = getBasePlacement(placement);
|
|
1216
|
+
|
|
1217
|
+
var isStartVariation = getVariation(placement) === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.s;
|
|
1218
|
+
var isVertical = [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h].indexOf(_basePlacement) >= 0;
|
|
1219
|
+
var len = isVertical ? 'width' : 'height';
|
|
1220
|
+
var overflow = detectOverflow(state, {
|
|
1221
|
+
placement: placement,
|
|
1222
|
+
boundary: boundary,
|
|
1223
|
+
rootBoundary: rootBoundary,
|
|
1224
|
+
altBoundary: altBoundary,
|
|
1225
|
+
padding: padding
|
|
1226
|
+
});
|
|
1227
|
+
var mainVariationSide = isVertical ? isStartVariation ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l : isStartVariation ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t;
|
|
1228
|
+
|
|
1229
|
+
if (referenceRect[len] > popperRect[len]) {
|
|
1230
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
1234
|
+
var checks = [];
|
|
1235
|
+
|
|
1236
|
+
if (checkMainAxis) {
|
|
1237
|
+
checks.push(overflow[_basePlacement] <= 0);
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
if (checkAltAxis) {
|
|
1241
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
if (checks.every(function (check) {
|
|
1245
|
+
return check;
|
|
1246
|
+
})) {
|
|
1247
|
+
firstFittingPlacement = placement;
|
|
1248
|
+
makeFallbackChecks = false;
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
checksMap.set(placement, checks);
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
if (makeFallbackChecks) {
|
|
1256
|
+
// `2` may be desired in some cases – research later
|
|
1257
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
|
1258
|
+
|
|
1259
|
+
var _loop = function _loop(_i) {
|
|
1260
|
+
var fittingPlacement = placements.find(function (placement) {
|
|
1261
|
+
var checks = checksMap.get(placement);
|
|
1262
|
+
|
|
1263
|
+
if (checks) {
|
|
1264
|
+
return checks.slice(0, _i).every(function (check) {
|
|
1265
|
+
return check;
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
|
|
1270
|
+
if (fittingPlacement) {
|
|
1271
|
+
firstFittingPlacement = fittingPlacement;
|
|
1272
|
+
return "break";
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
1277
|
+
var _ret = _loop(_i);
|
|
1278
|
+
|
|
1279
|
+
if (_ret === "break") break;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
if (state.placement !== firstFittingPlacement) {
|
|
1284
|
+
state.modifiersData[name]._skip = true;
|
|
1285
|
+
state.placement = firstFittingPlacement;
|
|
1286
|
+
state.reset = true;
|
|
1287
|
+
}
|
|
1288
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
var flip$1 = {
|
|
1292
|
+
name: 'flip',
|
|
1293
|
+
enabled: true,
|
|
1294
|
+
phase: 'main',
|
|
1295
|
+
fn: flip,
|
|
1296
|
+
requiresIfExists: ['offset'],
|
|
1297
|
+
data: {
|
|
1298
|
+
_skip: false
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
1303
|
+
if (preventedOffsets === void 0) {
|
|
1304
|
+
preventedOffsets = {
|
|
1305
|
+
x: 0,
|
|
1306
|
+
y: 0
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
return {
|
|
1311
|
+
top: overflow.top - rect.height - preventedOffsets.y,
|
|
1312
|
+
right: overflow.right - rect.width + preventedOffsets.x,
|
|
1313
|
+
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
1314
|
+
left: overflow.left - rect.width - preventedOffsets.x
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
function isAnySideFullyClipped(overflow) {
|
|
1319
|
+
return [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l].some(function (side) {
|
|
1320
|
+
return overflow[side] >= 0;
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function hide(_ref) {
|
|
1325
|
+
var state = _ref.state,
|
|
1326
|
+
name = _ref.name;
|
|
1327
|
+
var referenceRect = state.rects.reference;
|
|
1328
|
+
var popperRect = state.rects.popper;
|
|
1329
|
+
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
1330
|
+
var referenceOverflow = detectOverflow(state, {
|
|
1331
|
+
elementContext: 'reference'
|
|
1332
|
+
});
|
|
1333
|
+
var popperAltOverflow = detectOverflow(state, {
|
|
1334
|
+
altBoundary: true
|
|
1335
|
+
});
|
|
1336
|
+
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
1337
|
+
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
1338
|
+
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
1339
|
+
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
1340
|
+
state.modifiersData[name] = {
|
|
1341
|
+
referenceClippingOffsets: referenceClippingOffsets,
|
|
1342
|
+
popperEscapeOffsets: popperEscapeOffsets,
|
|
1343
|
+
isReferenceHidden: isReferenceHidden,
|
|
1344
|
+
hasPopperEscaped: hasPopperEscaped
|
|
1345
|
+
};
|
|
1346
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
1347
|
+
'data-popper-reference-hidden': isReferenceHidden,
|
|
1348
|
+
'data-popper-escaped': hasPopperEscaped
|
|
1349
|
+
});
|
|
1350
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
var hide$1 = {
|
|
1354
|
+
name: 'hide',
|
|
1355
|
+
enabled: true,
|
|
1356
|
+
phase: 'main',
|
|
1357
|
+
requiresIfExists: ['preventOverflow'],
|
|
1358
|
+
fn: hide
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
1362
|
+
var basePlacement = getBasePlacement(placement);
|
|
1363
|
+
var invertDistance = [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
1364
|
+
|
|
1365
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
1366
|
+
placement: placement
|
|
1367
|
+
})) : offset,
|
|
1368
|
+
skidding = _ref[0],
|
|
1369
|
+
distance = _ref[1];
|
|
1370
|
+
|
|
1371
|
+
skidding = skidding || 0;
|
|
1372
|
+
distance = (distance || 0) * invertDistance;
|
|
1373
|
+
return [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r].indexOf(basePlacement) >= 0 ? {
|
|
1374
|
+
x: distance,
|
|
1375
|
+
y: skidding
|
|
1376
|
+
} : {
|
|
1377
|
+
x: skidding,
|
|
1378
|
+
y: distance
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
function offset(_ref2) {
|
|
1383
|
+
var state = _ref2.state,
|
|
1384
|
+
options = _ref2.options,
|
|
1385
|
+
name = _ref2.name;
|
|
1386
|
+
var _options$offset = options.offset,
|
|
1387
|
+
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
1388
|
+
var data = _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.n.reduce(function (acc, placement) {
|
|
1389
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
|
1390
|
+
return acc;
|
|
1391
|
+
}, {});
|
|
1392
|
+
var _data$state$placement = data[state.placement],
|
|
1393
|
+
x = _data$state$placement.x,
|
|
1394
|
+
y = _data$state$placement.y;
|
|
1395
|
+
|
|
1396
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
1397
|
+
state.modifiersData.popperOffsets.x += x;
|
|
1398
|
+
state.modifiersData.popperOffsets.y += y;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
state.modifiersData[name] = data;
|
|
1402
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1403
|
+
|
|
1404
|
+
|
|
1405
|
+
var offset$1 = {
|
|
1406
|
+
name: 'offset',
|
|
1407
|
+
enabled: true,
|
|
1408
|
+
phase: 'main',
|
|
1409
|
+
requires: ['popperOffsets'],
|
|
1410
|
+
fn: offset
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
function popperOffsets(_ref) {
|
|
1414
|
+
var state = _ref.state,
|
|
1415
|
+
name = _ref.name; // Offsets are the actual position the popper needs to have to be
|
|
1416
|
+
// properly positioned near its reference element
|
|
1417
|
+
// This is the most basic placement, and will be adjusted by
|
|
1418
|
+
// the modifiers in the next step
|
|
1419
|
+
|
|
1420
|
+
state.modifiersData[name] = computeOffsets({
|
|
1421
|
+
reference: state.rects.reference,
|
|
1422
|
+
element: state.rects.popper,
|
|
1423
|
+
strategy: 'absolute',
|
|
1424
|
+
placement: state.placement
|
|
1425
|
+
});
|
|
1426
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
var popperOffsets$1 = {
|
|
1430
|
+
name: 'popperOffsets',
|
|
1431
|
+
enabled: true,
|
|
1432
|
+
phase: 'read',
|
|
1433
|
+
fn: popperOffsets,
|
|
1434
|
+
data: {}
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
function getAltAxis(axis) {
|
|
1438
|
+
return axis === 'x' ? 'y' : 'x';
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
function preventOverflow(_ref) {
|
|
1442
|
+
var state = _ref.state,
|
|
1443
|
+
options = _ref.options,
|
|
1444
|
+
name = _ref.name;
|
|
1445
|
+
var _options$mainAxis = options.mainAxis,
|
|
1446
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
1447
|
+
_options$altAxis = options.altAxis,
|
|
1448
|
+
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
|
1449
|
+
boundary = options.boundary,
|
|
1450
|
+
rootBoundary = options.rootBoundary,
|
|
1451
|
+
altBoundary = options.altBoundary,
|
|
1452
|
+
padding = options.padding,
|
|
1453
|
+
_options$tether = options.tether,
|
|
1454
|
+
tether = _options$tether === void 0 ? true : _options$tether,
|
|
1455
|
+
_options$tetherOffset = options.tetherOffset,
|
|
1456
|
+
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
1457
|
+
var overflow = detectOverflow(state, {
|
|
1458
|
+
boundary: boundary,
|
|
1459
|
+
rootBoundary: rootBoundary,
|
|
1460
|
+
padding: padding,
|
|
1461
|
+
altBoundary: altBoundary
|
|
1462
|
+
});
|
|
1463
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
1464
|
+
var variation = getVariation(state.placement);
|
|
1465
|
+
var isBasePlacement = !variation;
|
|
1466
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
1467
|
+
var altAxis = getAltAxis(mainAxis);
|
|
1468
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
1469
|
+
var referenceRect = state.rects.reference;
|
|
1470
|
+
var popperRect = state.rects.popper;
|
|
1471
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
1472
|
+
placement: state.placement
|
|
1473
|
+
})) : tetherOffset;
|
|
1474
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
1475
|
+
mainAxis: tetherOffsetValue,
|
|
1476
|
+
altAxis: tetherOffsetValue
|
|
1477
|
+
} : Object.assign({
|
|
1478
|
+
mainAxis: 0,
|
|
1479
|
+
altAxis: 0
|
|
1480
|
+
}, tetherOffsetValue);
|
|
1481
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
1482
|
+
var data = {
|
|
1483
|
+
x: 0,
|
|
1484
|
+
y: 0
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
if (!popperOffsets) {
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
if (checkMainAxis) {
|
|
1492
|
+
var _offsetModifierState$;
|
|
1493
|
+
|
|
1494
|
+
var mainSide = mainAxis === 'y' ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l;
|
|
1495
|
+
var altSide = mainAxis === 'y' ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r;
|
|
1496
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
1497
|
+
var offset = popperOffsets[mainAxis];
|
|
1498
|
+
var min$1 = offset + overflow[mainSide];
|
|
1499
|
+
var max$1 = offset - overflow[altSide];
|
|
1500
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1501
|
+
var minLen = variation === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.s ? referenceRect[len] : popperRect[len];
|
|
1502
|
+
var maxLen = variation === _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.s ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
1503
|
+
// outside the reference bounds
|
|
1504
|
+
|
|
1505
|
+
var arrowElement = state.elements.arrow;
|
|
1506
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
1507
|
+
width: 0,
|
|
1508
|
+
height: 0
|
|
1509
|
+
};
|
|
1510
|
+
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
|
1511
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
1512
|
+
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
|
1513
|
+
// to include its full size in the calculation. If the reference is small
|
|
1514
|
+
// and near the edge of a boundary, the popper can overflow even if the
|
|
1515
|
+
// reference is not overflowing as well (e.g. virtual elements with no
|
|
1516
|
+
// width or height)
|
|
1517
|
+
|
|
1518
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
1519
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
1520
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
1521
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
1522
|
+
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
1523
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
1524
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
1525
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
1526
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
1527
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
1528
|
+
data[mainAxis] = preventedOffset - offset;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
if (checkAltAxis) {
|
|
1532
|
+
var _offsetModifierState$2;
|
|
1533
|
+
|
|
1534
|
+
var _mainSide = mainAxis === 'x' ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l;
|
|
1535
|
+
|
|
1536
|
+
var _altSide = mainAxis === 'x' ? _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.h : _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.r;
|
|
1537
|
+
|
|
1538
|
+
var _offset = popperOffsets[altAxis];
|
|
1539
|
+
|
|
1540
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
1541
|
+
|
|
1542
|
+
var _min = _offset + overflow[_mainSide];
|
|
1543
|
+
|
|
1544
|
+
var _max = _offset - overflow[_altSide];
|
|
1545
|
+
|
|
1546
|
+
var isOriginSide = [_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.t, _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.l].indexOf(basePlacement) !== -1;
|
|
1547
|
+
|
|
1548
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
1549
|
+
|
|
1550
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
1551
|
+
|
|
1552
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
1553
|
+
|
|
1554
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
1555
|
+
|
|
1556
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
1557
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
state.modifiersData[name] = data;
|
|
1561
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
var preventOverflow$1 = {
|
|
1565
|
+
name: 'preventOverflow',
|
|
1566
|
+
enabled: true,
|
|
1567
|
+
phase: 'main',
|
|
1568
|
+
fn: preventOverflow,
|
|
1569
|
+
requiresIfExists: ['offset']
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
function getHTMLElementScroll(element) {
|
|
1573
|
+
return {
|
|
1574
|
+
scrollLeft: element.scrollLeft,
|
|
1575
|
+
scrollTop: element.scrollTop
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
function getNodeScroll(node) {
|
|
1580
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
1581
|
+
return getWindowScroll(node);
|
|
1582
|
+
} else {
|
|
1583
|
+
return getHTMLElementScroll(node);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
function isElementScaled(element) {
|
|
1588
|
+
var rect = element.getBoundingClientRect();
|
|
1589
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
1590
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
1591
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
1592
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
|
1593
|
+
// Composite means it takes into account transforms as well as layout.
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
1597
|
+
if (isFixed === void 0) {
|
|
1598
|
+
isFixed = false;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1602
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
1603
|
+
var documentElement = getDocumentElement(offsetParent);
|
|
1604
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
1605
|
+
var scroll = {
|
|
1606
|
+
scrollLeft: 0,
|
|
1607
|
+
scrollTop: 0
|
|
1608
|
+
};
|
|
1609
|
+
var offsets = {
|
|
1610
|
+
x: 0,
|
|
1611
|
+
y: 0
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1615
|
+
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
1616
|
+
isScrollParent(documentElement)) {
|
|
1617
|
+
scroll = getNodeScroll(offsetParent);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
if (isHTMLElement(offsetParent)) {
|
|
1621
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
1622
|
+
offsets.x += offsetParent.clientLeft;
|
|
1623
|
+
offsets.y += offsetParent.clientTop;
|
|
1624
|
+
} else if (documentElement) {
|
|
1625
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
return {
|
|
1630
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1631
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1632
|
+
width: rect.width,
|
|
1633
|
+
height: rect.height
|
|
1634
|
+
};
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
function order(modifiers) {
|
|
1638
|
+
var map = new Map();
|
|
1639
|
+
var visited = new Set();
|
|
1640
|
+
var result = [];
|
|
1641
|
+
modifiers.forEach(function (modifier) {
|
|
1642
|
+
map.set(modifier.name, modifier);
|
|
1643
|
+
}); // On visiting object, check for its dependencies and visit them recursively
|
|
1644
|
+
|
|
1645
|
+
function sort(modifier) {
|
|
1646
|
+
visited.add(modifier.name);
|
|
1647
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
1648
|
+
requires.forEach(function (dep) {
|
|
1649
|
+
if (!visited.has(dep)) {
|
|
1650
|
+
var depModifier = map.get(dep);
|
|
1651
|
+
|
|
1652
|
+
if (depModifier) {
|
|
1653
|
+
sort(depModifier);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1657
|
+
result.push(modifier);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
modifiers.forEach(function (modifier) {
|
|
1661
|
+
if (!visited.has(modifier.name)) {
|
|
1662
|
+
// check for visited object
|
|
1663
|
+
sort(modifier);
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
return result;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
function orderModifiers(modifiers) {
|
|
1670
|
+
// order based on dependencies
|
|
1671
|
+
var orderedModifiers = order(modifiers); // order based on phase
|
|
1672
|
+
|
|
1673
|
+
return _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.q.reduce(function (acc, phase) {
|
|
1674
|
+
return acc.concat(orderedModifiers.filter(function (modifier) {
|
|
1675
|
+
return modifier.phase === phase;
|
|
1676
|
+
}));
|
|
1677
|
+
}, []);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
function debounce(fn) {
|
|
1681
|
+
var pending;
|
|
1682
|
+
return function () {
|
|
1683
|
+
if (!pending) {
|
|
1684
|
+
pending = new Promise(function (resolve) {
|
|
1685
|
+
Promise.resolve().then(function () {
|
|
1686
|
+
pending = undefined;
|
|
1687
|
+
resolve(fn());
|
|
1688
|
+
});
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
return pending;
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
function format(str) {
|
|
1697
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1698
|
+
args[_key - 1] = arguments[_key];
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
return [].concat(args).reduce(function (p, c) {
|
|
1702
|
+
return p.replace(/%s/, c);
|
|
1703
|
+
}, str);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
|
1707
|
+
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
|
1708
|
+
var VALID_PROPERTIES = (/* unused pure expression or super */ null && (['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']));
|
|
1709
|
+
|
|
1710
|
+
function validateModifiers(modifiers) {
|
|
1711
|
+
modifiers.forEach(function (modifier) {
|
|
1712
|
+
[].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
|
|
1713
|
+
.filter(function (value, index, self) {
|
|
1714
|
+
return self.indexOf(value) === index;
|
|
1715
|
+
}).forEach(function (key) {
|
|
1716
|
+
switch (key) {
|
|
1717
|
+
case 'name':
|
|
1718
|
+
if (typeof modifier.name !== 'string') {
|
|
1719
|
+
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
break;
|
|
1723
|
+
|
|
1724
|
+
case 'enabled':
|
|
1725
|
+
if (typeof modifier.enabled !== 'boolean') {
|
|
1726
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
break;
|
|
1730
|
+
|
|
1731
|
+
case 'phase':
|
|
1732
|
+
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
|
1733
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
break;
|
|
1737
|
+
|
|
1738
|
+
case 'fn':
|
|
1739
|
+
if (typeof modifier.fn !== 'function') {
|
|
1740
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
break;
|
|
1744
|
+
|
|
1745
|
+
case 'effect':
|
|
1746
|
+
if (modifier.effect != null && typeof modifier.effect !== 'function') {
|
|
1747
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
break;
|
|
1751
|
+
|
|
1752
|
+
case 'requires':
|
|
1753
|
+
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
|
1754
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
break;
|
|
1758
|
+
|
|
1759
|
+
case 'requiresIfExists':
|
|
1760
|
+
if (!Array.isArray(modifier.requiresIfExists)) {
|
|
1761
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
break;
|
|
1765
|
+
|
|
1766
|
+
case 'options':
|
|
1767
|
+
case 'data':
|
|
1768
|
+
break;
|
|
1769
|
+
|
|
1770
|
+
default:
|
|
1771
|
+
console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
|
|
1772
|
+
return "\"" + s + "\"";
|
|
1773
|
+
}).join(', ') + "; but \"" + key + "\" was provided.");
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
modifier.requires && modifier.requires.forEach(function (requirement) {
|
|
1777
|
+
if (modifiers.find(function (mod) {
|
|
1778
|
+
return mod.name === requirement;
|
|
1779
|
+
}) == null) {
|
|
1780
|
+
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
|
1781
|
+
}
|
|
1782
|
+
});
|
|
1783
|
+
});
|
|
1784
|
+
});
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
function uniqueBy(arr, fn) {
|
|
1788
|
+
var identifiers = new Set();
|
|
1789
|
+
return arr.filter(function (item) {
|
|
1790
|
+
var identifier = fn(item);
|
|
1791
|
+
|
|
1792
|
+
if (!identifiers.has(identifier)) {
|
|
1793
|
+
identifiers.add(identifier);
|
|
1794
|
+
return true;
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
function mergeByName(modifiers) {
|
|
1800
|
+
var merged = modifiers.reduce(function (merged, current) {
|
|
1801
|
+
var existing = merged[current.name];
|
|
1802
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
|
1803
|
+
options: Object.assign({}, existing.options, current.options),
|
|
1804
|
+
data: Object.assign({}, existing.data, current.data)
|
|
1805
|
+
}) : current;
|
|
1806
|
+
return merged;
|
|
1807
|
+
}, {}); // IE11 does not support Object.values
|
|
1808
|
+
|
|
1809
|
+
return Object.keys(merged).map(function (key) {
|
|
1810
|
+
return merged[key];
|
|
1811
|
+
});
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
|
|
1815
|
+
var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
|
|
1816
|
+
var DEFAULT_OPTIONS = {
|
|
1817
|
+
placement: 'bottom',
|
|
1818
|
+
modifiers: [],
|
|
1819
|
+
strategy: 'absolute'
|
|
1820
|
+
};
|
|
1821
|
+
|
|
1822
|
+
function areValidElements() {
|
|
1823
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1824
|
+
args[_key] = arguments[_key];
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
return !args.some(function (element) {
|
|
1828
|
+
return !(element && typeof element.getBoundingClientRect === 'function');
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
function popperGenerator(generatorOptions) {
|
|
1833
|
+
if (generatorOptions === void 0) {
|
|
1834
|
+
generatorOptions = {};
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
var _generatorOptions = generatorOptions,
|
|
1838
|
+
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
|
1839
|
+
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
|
1840
|
+
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
|
1841
|
+
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
1842
|
+
return function createPopper(reference, popper, options) {
|
|
1843
|
+
if (options === void 0) {
|
|
1844
|
+
options = defaultOptions;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
var state = {
|
|
1848
|
+
placement: 'bottom',
|
|
1849
|
+
orderedModifiers: [],
|
|
1850
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
1851
|
+
modifiersData: {},
|
|
1852
|
+
elements: {
|
|
1853
|
+
reference: reference,
|
|
1854
|
+
popper: popper
|
|
1855
|
+
},
|
|
1856
|
+
attributes: {},
|
|
1857
|
+
styles: {}
|
|
1858
|
+
};
|
|
1859
|
+
var effectCleanupFns = [];
|
|
1860
|
+
var isDestroyed = false;
|
|
1861
|
+
var instance = {
|
|
1862
|
+
state: state,
|
|
1863
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
1864
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
|
1865
|
+
cleanupModifierEffects();
|
|
1866
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
1867
|
+
state.scrollParents = {
|
|
1868
|
+
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
1869
|
+
popper: listScrollParents(popper)
|
|
1870
|
+
}; // Orders the modifiers based on their dependencies and `phase`
|
|
1871
|
+
// properties
|
|
1872
|
+
|
|
1873
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
|
1874
|
+
|
|
1875
|
+
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
|
1876
|
+
return m.enabled;
|
|
1877
|
+
}); // Validate the provided modifiers so that the consumer will get warned
|
|
1878
|
+
// if one of the modifiers is invalid for any reason
|
|
1879
|
+
|
|
1880
|
+
if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; }
|
|
1881
|
+
|
|
1882
|
+
runModifierEffects();
|
|
1883
|
+
return instance.update();
|
|
1884
|
+
},
|
|
1885
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
1886
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
1887
|
+
// logic.
|
|
1888
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
1889
|
+
// prefer the async Popper#update method
|
|
1890
|
+
forceUpdate: function forceUpdate() {
|
|
1891
|
+
if (isDestroyed) {
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
var _state$elements = state.elements,
|
|
1896
|
+
reference = _state$elements.reference,
|
|
1897
|
+
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
|
1898
|
+
// anymore
|
|
1899
|
+
|
|
1900
|
+
if (!areValidElements(reference, popper)) {
|
|
1901
|
+
if (false) {}
|
|
1902
|
+
|
|
1903
|
+
return;
|
|
1904
|
+
} // Store the reference and popper rects to be read by modifiers
|
|
1905
|
+
|
|
1906
|
+
|
|
1907
|
+
state.rects = {
|
|
1908
|
+
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
|
1909
|
+
popper: getLayoutRect(popper)
|
|
1910
|
+
}; // Modifiers have the ability to reset the current update cycle. The
|
|
1911
|
+
// most common use case for this is the `flip` modifier changing the
|
|
1912
|
+
// placement, which then needs to re-run all the modifiers, because the
|
|
1913
|
+
// logic was previously ran for the previous placement and is therefore
|
|
1914
|
+
// stale/incorrect
|
|
1915
|
+
|
|
1916
|
+
state.reset = false;
|
|
1917
|
+
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
|
1918
|
+
// is filled with the initial data specified by the modifier. This means
|
|
1919
|
+
// it doesn't persist and is fresh on each update.
|
|
1920
|
+
// To ensure persistent data, use `${name}#persistent`
|
|
1921
|
+
|
|
1922
|
+
state.orderedModifiers.forEach(function (modifier) {
|
|
1923
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
1924
|
+
});
|
|
1925
|
+
var __debug_loops__ = 0;
|
|
1926
|
+
|
|
1927
|
+
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
1928
|
+
if (false) {}
|
|
1929
|
+
|
|
1930
|
+
if (state.reset === true) {
|
|
1931
|
+
state.reset = false;
|
|
1932
|
+
index = -1;
|
|
1933
|
+
continue;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
var _state$orderedModifie = state.orderedModifiers[index],
|
|
1937
|
+
fn = _state$orderedModifie.fn,
|
|
1938
|
+
_state$orderedModifie2 = _state$orderedModifie.options,
|
|
1939
|
+
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
|
1940
|
+
name = _state$orderedModifie.name;
|
|
1941
|
+
|
|
1942
|
+
if (typeof fn === 'function') {
|
|
1943
|
+
state = fn({
|
|
1944
|
+
state: state,
|
|
1945
|
+
options: _options,
|
|
1946
|
+
name: name,
|
|
1947
|
+
instance: instance
|
|
1948
|
+
}) || state;
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
},
|
|
1952
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
1953
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
1954
|
+
update: debounce(function () {
|
|
1955
|
+
return new Promise(function (resolve) {
|
|
1956
|
+
instance.forceUpdate();
|
|
1957
|
+
resolve(state);
|
|
1958
|
+
});
|
|
1959
|
+
}),
|
|
1960
|
+
destroy: function destroy() {
|
|
1961
|
+
cleanupModifierEffects();
|
|
1962
|
+
isDestroyed = true;
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
|
|
1966
|
+
if (!areValidElements(reference, popper)) {
|
|
1967
|
+
if (false) {}
|
|
1968
|
+
|
|
1969
|
+
return instance;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
instance.setOptions(options).then(function (state) {
|
|
1973
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
|
1974
|
+
options.onFirstUpdate(state);
|
|
1975
|
+
}
|
|
1976
|
+
}); // Modifiers have the ability to execute arbitrary code before the first
|
|
1977
|
+
// update cycle runs. They will be executed in the same order as the update
|
|
1978
|
+
// cycle. This is useful when a modifier adds some persistent data that
|
|
1979
|
+
// other modifiers need to use, but the modifier is run after the dependent
|
|
1980
|
+
// one.
|
|
1981
|
+
|
|
1982
|
+
function runModifierEffects() {
|
|
1983
|
+
state.orderedModifiers.forEach(function (_ref3) {
|
|
1984
|
+
var name = _ref3.name,
|
|
1985
|
+
_ref3$options = _ref3.options,
|
|
1986
|
+
options = _ref3$options === void 0 ? {} : _ref3$options,
|
|
1987
|
+
effect = _ref3.effect;
|
|
1988
|
+
|
|
1989
|
+
if (typeof effect === 'function') {
|
|
1990
|
+
var cleanupFn = effect({
|
|
1991
|
+
state: state,
|
|
1992
|
+
name: name,
|
|
1993
|
+
instance: instance,
|
|
1994
|
+
options: options
|
|
1995
|
+
});
|
|
1996
|
+
|
|
1997
|
+
var noopFn = function noopFn() {};
|
|
1998
|
+
|
|
1999
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
|
2000
|
+
}
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
function cleanupModifierEffects() {
|
|
2005
|
+
effectCleanupFns.forEach(function (fn) {
|
|
2006
|
+
return fn();
|
|
2007
|
+
});
|
|
2008
|
+
effectCleanupFns = [];
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
return instance;
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
2016
|
+
var createPopper = /*#__PURE__*/popperGenerator({
|
|
2017
|
+
defaultModifiers: defaultModifiers
|
|
2018
|
+
}); // eslint-disable-next-line import/no-unused-modules
|
|
2019
|
+
|
|
2020
|
+
function _setPrototypeOf(o, p) {
|
|
2021
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
2022
|
+
o.__proto__ = p;
|
|
2023
|
+
return o;
|
|
2024
|
+
};
|
|
2025
|
+
|
|
2026
|
+
return _setPrototypeOf(o, p);
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
function _inheritsLoose(subClass, superClass) {
|
|
2030
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
2031
|
+
subClass.prototype.constructor = subClass;
|
|
2032
|
+
|
|
2033
|
+
_setPrototypeOf(subClass, superClass);
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
var ManagerReferenceNodeContext = react__WEBPACK_IMPORTED_MODULE_34__.createContext();
|
|
2037
|
+
var ManagerReferenceNodeSetterContext = react__WEBPACK_IMPORTED_MODULE_34__.createContext();
|
|
2038
|
+
|
|
2039
|
+
function Manager(_ref) {
|
|
2040
|
+
var children = _ref.children;
|
|
2041
|
+
|
|
2042
|
+
var _React$useState = react__WEBPACK_IMPORTED_MODULE_34__.useState(null),
|
|
2043
|
+
referenceNode = _React$useState[0],
|
|
2044
|
+
setReferenceNode = _React$useState[1];
|
|
2045
|
+
|
|
2046
|
+
var hasUnmounted = react__WEBPACK_IMPORTED_MODULE_34__.useRef(false);
|
|
2047
|
+
react__WEBPACK_IMPORTED_MODULE_34__.useEffect(function () {
|
|
2048
|
+
return function () {
|
|
2049
|
+
hasUnmounted.current = true;
|
|
2050
|
+
};
|
|
2051
|
+
}, []);
|
|
2052
|
+
var handleSetReferenceNode = react__WEBPACK_IMPORTED_MODULE_34__.useCallback(function (node) {
|
|
2053
|
+
if (!hasUnmounted.current) {
|
|
2054
|
+
setReferenceNode(node);
|
|
2055
|
+
}
|
|
2056
|
+
}, []);
|
|
2057
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(ManagerReferenceNodeContext.Provider, {
|
|
2058
|
+
value: referenceNode
|
|
2059
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(ManagerReferenceNodeSetterContext.Provider, {
|
|
2060
|
+
value: handleSetReferenceNode
|
|
2061
|
+
}, children));
|
|
2062
|
+
}
|
|
2063
|
+
/**
|
|
2064
|
+
* Takes an argument and if it's an array, returns the first item in the array,
|
|
2065
|
+
* otherwise returns the argument. Used for Preact compatibility.
|
|
2066
|
+
*/
|
|
2067
|
+
|
|
2068
|
+
|
|
2069
|
+
var unwrapArray = function unwrapArray(arg) {
|
|
2070
|
+
return Array.isArray(arg) ? arg[0] : arg;
|
|
2071
|
+
};
|
|
2072
|
+
/**
|
|
2073
|
+
* Takes a maybe-undefined function and arbitrary args and invokes the function
|
|
2074
|
+
* only if it is defined.
|
|
2075
|
+
*/
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
var safeInvoke = function safeInvoke(fn) {
|
|
2079
|
+
if (typeof fn === 'function') {
|
|
2080
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2081
|
+
args[_key - 1] = arguments[_key];
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
return fn.apply(void 0, args);
|
|
2085
|
+
}
|
|
2086
|
+
};
|
|
2087
|
+
/**
|
|
2088
|
+
* Sets a ref using either a ref callback or a ref object
|
|
2089
|
+
*/
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
var setRef$1 = function setRef(ref, node) {
|
|
2093
|
+
// if its a function call it
|
|
2094
|
+
if (typeof ref === 'function') {
|
|
2095
|
+
return safeInvoke(ref, node);
|
|
2096
|
+
} // otherwise we should treat it as a ref object
|
|
2097
|
+
else if (ref != null) {
|
|
2098
|
+
ref.current = node;
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
/**
|
|
2102
|
+
* Simple ponyfill for Object.fromEntries
|
|
2103
|
+
*/
|
|
2104
|
+
|
|
2105
|
+
|
|
2106
|
+
var fromEntries = function fromEntries(entries) {
|
|
2107
|
+
return entries.reduce(function (acc, _ref) {
|
|
2108
|
+
var key = _ref[0],
|
|
2109
|
+
value = _ref[1];
|
|
2110
|
+
acc[key] = value;
|
|
2111
|
+
return acc;
|
|
2112
|
+
}, {});
|
|
2113
|
+
};
|
|
2114
|
+
/**
|
|
2115
|
+
* Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
|
|
2116
|
+
*/
|
|
2117
|
+
|
|
2118
|
+
|
|
2119
|
+
var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? react__WEBPACK_IMPORTED_MODULE_34__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_34__.useEffect;
|
|
2120
|
+
/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */
|
|
2121
|
+
|
|
2122
|
+
var hasElementType = typeof Element !== 'undefined';
|
|
2123
|
+
var hasMap = typeof Map === 'function';
|
|
2124
|
+
var hasSet = typeof Set === 'function';
|
|
2125
|
+
var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView; // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
|
|
2126
|
+
|
|
2127
|
+
function equal(a, b) {
|
|
2128
|
+
// START: fast-deep-equal es6/index.js 3.1.1
|
|
2129
|
+
if (a === b) return true;
|
|
2130
|
+
|
|
2131
|
+
if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {
|
|
2132
|
+
if (a.constructor !== b.constructor) return false;
|
|
2133
|
+
var length, i, keys;
|
|
2134
|
+
|
|
2135
|
+
if (Array.isArray(a)) {
|
|
2136
|
+
length = a.length;
|
|
2137
|
+
if (length != b.length) return false;
|
|
2138
|
+
|
|
2139
|
+
for (i = length; i-- !== 0;) {
|
|
2140
|
+
if (!equal(a[i], b[i])) return false;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
return true;
|
|
2144
|
+
} // START: Modifications:
|
|
2145
|
+
// 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
|
|
2146
|
+
// to co-exist with es5.
|
|
2147
|
+
// 2. Replace `for of` with es5 compliant iteration using `for`.
|
|
2148
|
+
// Basically, take:
|
|
2149
|
+
//
|
|
2150
|
+
// ```js
|
|
2151
|
+
// for (i of a.entries())
|
|
2152
|
+
// if (!b.has(i[0])) return false;
|
|
2153
|
+
// ```
|
|
2154
|
+
//
|
|
2155
|
+
// ... and convert to:
|
|
2156
|
+
//
|
|
2157
|
+
// ```js
|
|
2158
|
+
// it = a.entries();
|
|
2159
|
+
// while (!(i = it.next()).done)
|
|
2160
|
+
// if (!b.has(i.value[0])) return false;
|
|
2161
|
+
// ```
|
|
2162
|
+
//
|
|
2163
|
+
// **Note**: `i` access switches to `i.value`.
|
|
2164
|
+
|
|
2165
|
+
|
|
2166
|
+
var it;
|
|
2167
|
+
|
|
2168
|
+
if (hasMap && a instanceof Map && b instanceof Map) {
|
|
2169
|
+
if (a.size !== b.size) return false;
|
|
2170
|
+
it = a.entries();
|
|
2171
|
+
|
|
2172
|
+
while (!(i = it.next()).done) {
|
|
2173
|
+
if (!b.has(i.value[0])) return false;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
it = a.entries();
|
|
2177
|
+
|
|
2178
|
+
while (!(i = it.next()).done) {
|
|
2179
|
+
if (!equal(i.value[1], b.get(i.value[0]))) return false;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
return true;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
if (hasSet && a instanceof Set && b instanceof Set) {
|
|
2186
|
+
if (a.size !== b.size) return false;
|
|
2187
|
+
it = a.entries();
|
|
2188
|
+
|
|
2189
|
+
while (!(i = it.next()).done) {
|
|
2190
|
+
if (!b.has(i.value[0])) return false;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
return true;
|
|
2194
|
+
} // END: Modifications
|
|
2195
|
+
|
|
2196
|
+
|
|
2197
|
+
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
2198
|
+
length = a.length;
|
|
2199
|
+
if (length != b.length) return false;
|
|
2200
|
+
|
|
2201
|
+
for (i = length; i-- !== 0;) {
|
|
2202
|
+
if (a[i] !== b[i]) return false;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
return true;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
2209
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
2210
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
2211
|
+
keys = Object.keys(a);
|
|
2212
|
+
length = keys.length;
|
|
2213
|
+
if (length !== Object.keys(b).length) return false;
|
|
2214
|
+
|
|
2215
|
+
for (i = length; i-- !== 0;) {
|
|
2216
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
2217
|
+
} // END: fast-deep-equal
|
|
2218
|
+
// START: react-fast-compare
|
|
2219
|
+
// custom handling for DOM elements
|
|
2220
|
+
|
|
2221
|
+
|
|
2222
|
+
if (hasElementType && a instanceof Element) return false; // custom handling for React/Preact
|
|
2223
|
+
|
|
2224
|
+
for (i = length; i-- !== 0;) {
|
|
2225
|
+
if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {
|
|
2226
|
+
// React-specific: avoid traversing React elements' _owner
|
|
2227
|
+
// Preact-specific: avoid traversing Preact elements' __v and __o
|
|
2228
|
+
// __v = $_original / $_vnode
|
|
2229
|
+
// __o = $_owner
|
|
2230
|
+
// These properties contain circular references and are not needed when
|
|
2231
|
+
// comparing the actual elements (and not their owners)
|
|
2232
|
+
// .$$typeof and ._store on just reasonable markers of elements
|
|
2233
|
+
continue;
|
|
2234
|
+
} // all other properties should be traversed as usual
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
if (!equal(a[keys[i]], b[keys[i]])) return false;
|
|
2238
|
+
} // END: react-fast-compare
|
|
2239
|
+
// START: fast-deep-equal
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
return true;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
return a !== a && b !== b;
|
|
2246
|
+
} // end fast-deep-equal
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
var reactFastCompare = function isEqual(a, b) {
|
|
2250
|
+
try {
|
|
2251
|
+
return equal(a, b);
|
|
2252
|
+
} catch (error) {
|
|
2253
|
+
if ((error.message || '').match(/stack|recursion/i)) {
|
|
2254
|
+
// warn on circular references, don't crash
|
|
2255
|
+
// browsers give this different errors name and messages:
|
|
2256
|
+
// chrome/safari: "RangeError", "Maximum call stack size exceeded"
|
|
2257
|
+
// firefox: "InternalError", too much recursion"
|
|
2258
|
+
// edge: "Error", "Out of stack space"
|
|
2259
|
+
console.warn('react-fast-compare cannot handle circular refs');
|
|
2260
|
+
return false;
|
|
2261
|
+
} // some other error. we should definitely know about these
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
throw error;
|
|
2265
|
+
}
|
|
2266
|
+
};
|
|
2267
|
+
|
|
2268
|
+
var EMPTY_MODIFIERS$1 = [];
|
|
2269
|
+
|
|
2270
|
+
var usePopper = function usePopper(referenceElement, popperElement, options) {
|
|
2271
|
+
if (options === void 0) {
|
|
2272
|
+
options = {};
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
var prevOptions = react__WEBPACK_IMPORTED_MODULE_34__.useRef(null);
|
|
2276
|
+
var optionsWithDefaults = {
|
|
2277
|
+
onFirstUpdate: options.onFirstUpdate,
|
|
2278
|
+
placement: options.placement || 'bottom',
|
|
2279
|
+
strategy: options.strategy || 'absolute',
|
|
2280
|
+
modifiers: options.modifiers || EMPTY_MODIFIERS$1
|
|
2281
|
+
};
|
|
2282
|
+
|
|
2283
|
+
var _React$useState = react__WEBPACK_IMPORTED_MODULE_34__.useState({
|
|
2284
|
+
styles: {
|
|
2285
|
+
popper: {
|
|
2286
|
+
position: optionsWithDefaults.strategy,
|
|
2287
|
+
left: '0',
|
|
2288
|
+
top: '0'
|
|
2289
|
+
},
|
|
2290
|
+
arrow: {
|
|
2291
|
+
position: 'absolute'
|
|
2292
|
+
}
|
|
2293
|
+
},
|
|
2294
|
+
attributes: {}
|
|
2295
|
+
}),
|
|
2296
|
+
state = _React$useState[0],
|
|
2297
|
+
setState = _React$useState[1];
|
|
2298
|
+
|
|
2299
|
+
var updateStateModifier = react__WEBPACK_IMPORTED_MODULE_34__.useMemo(function () {
|
|
2300
|
+
return {
|
|
2301
|
+
name: 'updateState',
|
|
2302
|
+
enabled: true,
|
|
2303
|
+
phase: 'write',
|
|
2304
|
+
fn: function fn(_ref) {
|
|
2305
|
+
var state = _ref.state;
|
|
2306
|
+
var elements = Object.keys(state.elements);
|
|
2307
|
+
setState({
|
|
2308
|
+
styles: fromEntries(elements.map(function (element) {
|
|
2309
|
+
return [element, state.styles[element] || {}];
|
|
2310
|
+
})),
|
|
2311
|
+
attributes: fromEntries(elements.map(function (element) {
|
|
2312
|
+
return [element, state.attributes[element]];
|
|
2313
|
+
}))
|
|
2314
|
+
});
|
|
2315
|
+
},
|
|
2316
|
+
requires: ['computeStyles']
|
|
2317
|
+
};
|
|
2318
|
+
}, []);
|
|
2319
|
+
var popperOptions = react__WEBPACK_IMPORTED_MODULE_34__.useMemo(function () {
|
|
2320
|
+
var newOptions = {
|
|
2321
|
+
onFirstUpdate: optionsWithDefaults.onFirstUpdate,
|
|
2322
|
+
placement: optionsWithDefaults.placement,
|
|
2323
|
+
strategy: optionsWithDefaults.strategy,
|
|
2324
|
+
modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
|
|
2325
|
+
name: 'applyStyles',
|
|
2326
|
+
enabled: false
|
|
2327
|
+
}])
|
|
2328
|
+
};
|
|
2329
|
+
|
|
2330
|
+
if (reactFastCompare(prevOptions.current, newOptions)) {
|
|
2331
|
+
return prevOptions.current || newOptions;
|
|
2332
|
+
} else {
|
|
2333
|
+
prevOptions.current = newOptions;
|
|
2334
|
+
return newOptions;
|
|
2335
|
+
}
|
|
2336
|
+
}, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
|
|
2337
|
+
var popperInstanceRef = react__WEBPACK_IMPORTED_MODULE_34__.useRef();
|
|
2338
|
+
useIsomorphicLayoutEffect(function () {
|
|
2339
|
+
if (popperInstanceRef.current) {
|
|
2340
|
+
popperInstanceRef.current.setOptions(popperOptions);
|
|
2341
|
+
}
|
|
2342
|
+
}, [popperOptions]);
|
|
2343
|
+
useIsomorphicLayoutEffect(function () {
|
|
2344
|
+
if (referenceElement == null || popperElement == null) {
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
var createPopper$1 = options.createPopper || createPopper;
|
|
2349
|
+
var popperInstance = createPopper$1(referenceElement, popperElement, popperOptions);
|
|
2350
|
+
popperInstanceRef.current = popperInstance;
|
|
2351
|
+
return function () {
|
|
2352
|
+
popperInstance.destroy();
|
|
2353
|
+
popperInstanceRef.current = null;
|
|
2354
|
+
};
|
|
2355
|
+
}, [referenceElement, popperElement, options.createPopper]);
|
|
2356
|
+
return {
|
|
2357
|
+
state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
|
|
2358
|
+
styles: state.styles,
|
|
2359
|
+
attributes: state.attributes,
|
|
2360
|
+
update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
|
|
2361
|
+
forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
|
|
2362
|
+
};
|
|
2363
|
+
};
|
|
2364
|
+
|
|
2365
|
+
var NOOP = function NOOP() {
|
|
2366
|
+
return void 0;
|
|
2367
|
+
};
|
|
2368
|
+
|
|
2369
|
+
var NOOP_PROMISE = function NOOP_PROMISE() {
|
|
2370
|
+
return Promise.resolve(null);
|
|
2371
|
+
};
|
|
2372
|
+
|
|
2373
|
+
var EMPTY_MODIFIERS = [];
|
|
2374
|
+
|
|
2375
|
+
function Popper(_ref) {
|
|
2376
|
+
var _ref$placement = _ref.placement,
|
|
2377
|
+
placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
|
|
2378
|
+
_ref$strategy = _ref.strategy,
|
|
2379
|
+
strategy = _ref$strategy === void 0 ? 'absolute' : _ref$strategy,
|
|
2380
|
+
_ref$modifiers = _ref.modifiers,
|
|
2381
|
+
modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS : _ref$modifiers,
|
|
2382
|
+
referenceElement = _ref.referenceElement,
|
|
2383
|
+
onFirstUpdate = _ref.onFirstUpdate,
|
|
2384
|
+
innerRef = _ref.innerRef,
|
|
2385
|
+
children = _ref.children;
|
|
2386
|
+
var referenceNode = react__WEBPACK_IMPORTED_MODULE_34__.useContext(ManagerReferenceNodeContext);
|
|
2387
|
+
|
|
2388
|
+
var _React$useState = react__WEBPACK_IMPORTED_MODULE_34__.useState(null),
|
|
2389
|
+
popperElement = _React$useState[0],
|
|
2390
|
+
setPopperElement = _React$useState[1];
|
|
2391
|
+
|
|
2392
|
+
var _React$useState2 = react__WEBPACK_IMPORTED_MODULE_34__.useState(null),
|
|
2393
|
+
arrowElement = _React$useState2[0],
|
|
2394
|
+
setArrowElement = _React$useState2[1];
|
|
2395
|
+
|
|
2396
|
+
react__WEBPACK_IMPORTED_MODULE_34__.useEffect(function () {
|
|
2397
|
+
setRef$1(innerRef, popperElement);
|
|
2398
|
+
}, [innerRef, popperElement]);
|
|
2399
|
+
var options = react__WEBPACK_IMPORTED_MODULE_34__.useMemo(function () {
|
|
2400
|
+
return {
|
|
2401
|
+
placement: placement,
|
|
2402
|
+
strategy: strategy,
|
|
2403
|
+
onFirstUpdate: onFirstUpdate,
|
|
2404
|
+
modifiers: [].concat(modifiers, [{
|
|
2405
|
+
name: 'arrow',
|
|
2406
|
+
enabled: arrowElement != null,
|
|
2407
|
+
options: {
|
|
2408
|
+
element: arrowElement
|
|
2409
|
+
}
|
|
2410
|
+
}])
|
|
2411
|
+
};
|
|
2412
|
+
}, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
|
|
2413
|
+
|
|
2414
|
+
var _usePopper = usePopper(referenceElement || referenceNode, popperElement, options),
|
|
2415
|
+
state = _usePopper.state,
|
|
2416
|
+
styles = _usePopper.styles,
|
|
2417
|
+
forceUpdate = _usePopper.forceUpdate,
|
|
2418
|
+
update = _usePopper.update;
|
|
2419
|
+
|
|
2420
|
+
var childrenProps = react__WEBPACK_IMPORTED_MODULE_34__.useMemo(function () {
|
|
2421
|
+
return {
|
|
2422
|
+
ref: setPopperElement,
|
|
2423
|
+
style: styles.popper,
|
|
2424
|
+
placement: state ? state.placement : placement,
|
|
2425
|
+
hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
|
|
2426
|
+
isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
|
|
2427
|
+
arrowProps: {
|
|
2428
|
+
style: styles.arrow,
|
|
2429
|
+
ref: setArrowElement
|
|
2430
|
+
},
|
|
2431
|
+
forceUpdate: forceUpdate || NOOP,
|
|
2432
|
+
update: update || NOOP_PROMISE
|
|
2433
|
+
};
|
|
2434
|
+
}, [setPopperElement, setArrowElement, placement, state, styles, update, forceUpdate]);
|
|
2435
|
+
return unwrapArray(children)(childrenProps);
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
2439
|
+
*
|
|
2440
|
+
* This source code is licensed under the MIT license found in the
|
|
2441
|
+
* LICENSE file in the root directory of this source tree.
|
|
2442
|
+
*/
|
|
2443
|
+
|
|
2444
|
+
/**
|
|
2445
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
2446
|
+
* This can be used to log issues in development environments in critical
|
|
2447
|
+
* paths. Removing the logging code for production environments will keep the
|
|
2448
|
+
* same logic and follow the same code paths.
|
|
2449
|
+
*/
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
var __DEV__ = "production" !== 'production';
|
|
2453
|
+
|
|
2454
|
+
var warning = function warning() {};
|
|
2455
|
+
|
|
2456
|
+
if (__DEV__) {
|
|
2457
|
+
var printWarning = function printWarning(format, args) {
|
|
2458
|
+
var len = arguments.length;
|
|
2459
|
+
args = new Array(len > 1 ? len - 1 : 0);
|
|
2460
|
+
|
|
2461
|
+
for (var key = 1; key < len; key++) {
|
|
2462
|
+
args[key - 1] = arguments[key];
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
var argIndex = 0;
|
|
2466
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
2467
|
+
return args[argIndex++];
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
if (typeof console !== 'undefined') {
|
|
2471
|
+
console.error(message);
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
try {
|
|
2475
|
+
// --- Welcome to debugging React ---
|
|
2476
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
2477
|
+
// to find the callsite that caused this warning to fire.
|
|
2478
|
+
throw new Error(message);
|
|
2479
|
+
} catch (x) {}
|
|
2480
|
+
};
|
|
2481
|
+
|
|
2482
|
+
warning = function warning(condition, format, args) {
|
|
2483
|
+
var len = arguments.length;
|
|
2484
|
+
args = new Array(len > 2 ? len - 2 : 0);
|
|
2485
|
+
|
|
2486
|
+
for (var key = 2; key < len; key++) {
|
|
2487
|
+
args[key - 2] = arguments[key];
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
if (format === undefined) {
|
|
2491
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
if (!condition) {
|
|
2495
|
+
printWarning.apply(null, [format].concat(args));
|
|
2496
|
+
}
|
|
2497
|
+
};
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
var warning_1 = warning;
|
|
2501
|
+
|
|
2502
|
+
function Reference(_ref) {
|
|
2503
|
+
var children = _ref.children,
|
|
2504
|
+
innerRef = _ref.innerRef;
|
|
2505
|
+
var setReferenceNode = react__WEBPACK_IMPORTED_MODULE_34__.useContext(ManagerReferenceNodeSetterContext);
|
|
2506
|
+
var refHandler = react__WEBPACK_IMPORTED_MODULE_34__.useCallback(function (node) {
|
|
2507
|
+
setRef$1(innerRef, node);
|
|
2508
|
+
safeInvoke(setReferenceNode, node);
|
|
2509
|
+
}, [innerRef, setReferenceNode]); // ran on unmount
|
|
2510
|
+
|
|
2511
|
+
react__WEBPACK_IMPORTED_MODULE_34__.useEffect(function () {
|
|
2512
|
+
return function () {
|
|
2513
|
+
return setRef$1(innerRef, null);
|
|
2514
|
+
};
|
|
2515
|
+
});
|
|
2516
|
+
react__WEBPACK_IMPORTED_MODULE_34__.useEffect(function () {
|
|
2517
|
+
warning_1(Boolean(setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
|
|
2518
|
+
}, [setReferenceNode]);
|
|
2519
|
+
return unwrapArray(children)({
|
|
2520
|
+
ref: refHandler
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
var TooltipContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createContext({}); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2525
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2526
|
+
|
|
2527
|
+
var callAll = function callAll() {
|
|
2528
|
+
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2529
|
+
fns[_key] = arguments[_key];
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
return function () {
|
|
2533
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2534
|
+
args[_key2] = arguments[_key2];
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
return fns.forEach(function (fn) {
|
|
2538
|
+
return fn && fn.apply(void 0, args);
|
|
2539
|
+
});
|
|
2540
|
+
};
|
|
2541
|
+
};
|
|
2542
|
+
|
|
2543
|
+
var noop = function noop() {// do nothing
|
|
2544
|
+
};
|
|
2545
|
+
|
|
2546
|
+
var canUseDOM = function canUseDOM() {
|
|
2547
|
+
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2550
|
+
var setRef = function setRef(ref, node) {
|
|
2551
|
+
if (typeof ref === 'function') {
|
|
2552
|
+
return ref(node);
|
|
2553
|
+
} else if (ref != null) {
|
|
2554
|
+
ref.current = node;
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2557
|
+
|
|
2558
|
+
var Tooltip$1 = /*#__PURE__*/function (_Component) {
|
|
2559
|
+
_inheritsLoose(Tooltip, _Component);
|
|
2560
|
+
|
|
2561
|
+
function Tooltip() {
|
|
2562
|
+
var _this;
|
|
2563
|
+
|
|
2564
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2565
|
+
args[_key] = arguments[_key];
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
2569
|
+
_this.observer = void 0;
|
|
2570
|
+
_this.tooltipRef = void 0;
|
|
2571
|
+
|
|
2572
|
+
_this.handleOutsideClick = function (event) {
|
|
2573
|
+
if (_this.tooltipRef && !_this.tooltipRef.contains(event.target)) {
|
|
2574
|
+
var parentOutsideClickHandler = _this.context.parentOutsideClickHandler;
|
|
2575
|
+
var _this$props = _this.props,
|
|
2576
|
+
hideTooltip = _this$props.hideTooltip,
|
|
2577
|
+
clearScheduled = _this$props.clearScheduled;
|
|
2578
|
+
clearScheduled();
|
|
2579
|
+
hideTooltip();
|
|
2580
|
+
|
|
2581
|
+
if (parentOutsideClickHandler) {
|
|
2582
|
+
parentOutsideClickHandler(event);
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
};
|
|
2586
|
+
|
|
2587
|
+
_this.handleOutsideRightClick = function (event) {
|
|
2588
|
+
if (_this.tooltipRef && !_this.tooltipRef.contains(event.target)) {
|
|
2589
|
+
var parentOutsideRightClickHandler = _this.context.parentOutsideRightClickHandler;
|
|
2590
|
+
var _this$props2 = _this.props,
|
|
2591
|
+
hideTooltip = _this$props2.hideTooltip,
|
|
2592
|
+
clearScheduled = _this$props2.clearScheduled;
|
|
2593
|
+
clearScheduled();
|
|
2594
|
+
hideTooltip();
|
|
2595
|
+
|
|
2596
|
+
if (parentOutsideRightClickHandler) {
|
|
2597
|
+
parentOutsideRightClickHandler(event);
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
};
|
|
2601
|
+
|
|
2602
|
+
_this.addOutsideClickHandler = function () {
|
|
2603
|
+
document.body.addEventListener('touchend', _this.handleOutsideClick);
|
|
2604
|
+
document.body.addEventListener('click', _this.handleOutsideClick);
|
|
2605
|
+
};
|
|
2606
|
+
|
|
2607
|
+
_this.removeOutsideClickHandler = function () {
|
|
2608
|
+
document.body.removeEventListener('touchend', _this.handleOutsideClick);
|
|
2609
|
+
document.body.removeEventListener('click', _this.handleOutsideClick);
|
|
2610
|
+
};
|
|
2611
|
+
|
|
2612
|
+
_this.addOutsideRightClickHandler = function () {
|
|
2613
|
+
return document.body.addEventListener('contextmenu', _this.handleOutsideRightClick);
|
|
2614
|
+
};
|
|
2615
|
+
|
|
2616
|
+
_this.removeOutsideRightClickHandler = function () {
|
|
2617
|
+
return document.body.removeEventListener('contextmenu', _this.handleOutsideRightClick);
|
|
2618
|
+
};
|
|
2619
|
+
|
|
2620
|
+
_this.getTooltipRef = function (node) {
|
|
2621
|
+
_this.tooltipRef = node;
|
|
2622
|
+
setRef(_this.props.innerRef, node);
|
|
2623
|
+
};
|
|
2624
|
+
|
|
2625
|
+
_this.getArrowProps = function (props) {
|
|
2626
|
+
if (props === void 0) {
|
|
2627
|
+
props = {};
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
return (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({}, props, {
|
|
2631
|
+
style: (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({}, props.style, _this.props.arrowProps.style)
|
|
2632
|
+
});
|
|
2633
|
+
};
|
|
2634
|
+
|
|
2635
|
+
_this.getTooltipProps = function (props) {
|
|
2636
|
+
if (props === void 0) {
|
|
2637
|
+
props = {};
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
return (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({}, props, _this.isTriggeredBy('hover') && {
|
|
2641
|
+
onMouseEnter: callAll(_this.props.clearScheduled, props.onMouseEnter),
|
|
2642
|
+
onMouseLeave: callAll(_this.props.hideTooltip, props.onMouseLeave)
|
|
2643
|
+
}, {
|
|
2644
|
+
style: (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({}, props.style, _this.props.style)
|
|
2645
|
+
});
|
|
2646
|
+
};
|
|
2647
|
+
|
|
2648
|
+
_this.contextValue = {
|
|
2649
|
+
isParentNoneTriggered: _this.props.trigger === 'none',
|
|
2650
|
+
addParentOutsideClickHandler: _this.addOutsideClickHandler,
|
|
2651
|
+
addParentOutsideRightClickHandler: _this.addOutsideRightClickHandler,
|
|
2652
|
+
parentOutsideClickHandler: _this.handleOutsideClick,
|
|
2653
|
+
parentOutsideRightClickHandler: _this.handleOutsideRightClick,
|
|
2654
|
+
removeParentOutsideClickHandler: _this.removeOutsideClickHandler,
|
|
2655
|
+
removeParentOutsideRightClickHandler: _this.removeOutsideRightClickHandler
|
|
2656
|
+
};
|
|
2657
|
+
return _this;
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
var _proto = Tooltip.prototype;
|
|
2661
|
+
|
|
2662
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
2663
|
+
var _this2 = this;
|
|
2664
|
+
|
|
2665
|
+
var observer = this.observer = new MutationObserver(function () {
|
|
2666
|
+
_this2.props.update();
|
|
2667
|
+
});
|
|
2668
|
+
observer.observe(this.tooltipRef, this.props.mutationObserverOptions);
|
|
2669
|
+
|
|
2670
|
+
if (this.isTriggeredBy('hover') || this.isTriggeredBy('click') || this.isTriggeredBy('right-click')) {
|
|
2671
|
+
var _this$context = this.context,
|
|
2672
|
+
removeParentOutsideClickHandler = _this$context.removeParentOutsideClickHandler,
|
|
2673
|
+
removeParentOutsideRightClickHandler = _this$context.removeParentOutsideRightClickHandler;
|
|
2674
|
+
this.addOutsideClickHandler();
|
|
2675
|
+
this.addOutsideRightClickHandler();
|
|
2676
|
+
|
|
2677
|
+
if (removeParentOutsideClickHandler) {
|
|
2678
|
+
removeParentOutsideClickHandler();
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
if (removeParentOutsideRightClickHandler) {
|
|
2682
|
+
removeParentOutsideRightClickHandler();
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
};
|
|
2686
|
+
|
|
2687
|
+
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
2688
|
+
if (this.props.closeOnReferenceHidden && this.props.isReferenceHidden) {
|
|
2689
|
+
this.props.hideTooltip();
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
|
|
2693
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2694
|
+
if (this.observer) {
|
|
2695
|
+
this.observer.disconnect();
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
if (this.isTriggeredBy('hover') || this.isTriggeredBy('click') || this.isTriggeredBy('right-click')) {
|
|
2699
|
+
var _this$context2 = this.context,
|
|
2700
|
+
isParentNoneTriggered = _this$context2.isParentNoneTriggered,
|
|
2701
|
+
addParentOutsideClickHandler = _this$context2.addParentOutsideClickHandler,
|
|
2702
|
+
addParentOutsideRightClickHandler = _this$context2.addParentOutsideRightClickHandler;
|
|
2703
|
+
this.removeOutsideClickHandler();
|
|
2704
|
+
this.removeOutsideRightClickHandler();
|
|
2705
|
+
this.handleOutsideClick = undefined;
|
|
2706
|
+
this.handleOutsideRightClick = undefined;
|
|
2707
|
+
|
|
2708
|
+
if (!isParentNoneTriggered && addParentOutsideClickHandler) {
|
|
2709
|
+
addParentOutsideClickHandler();
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
if (!isParentNoneTriggered && addParentOutsideRightClickHandler) {
|
|
2713
|
+
addParentOutsideRightClickHandler();
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
};
|
|
2717
|
+
|
|
2718
|
+
_proto.render = function render() {
|
|
2719
|
+
var _this$props3 = this.props,
|
|
2720
|
+
arrowProps = _this$props3.arrowProps,
|
|
2721
|
+
placement = _this$props3.placement,
|
|
2722
|
+
tooltip = _this$props3.tooltip;
|
|
2723
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(TooltipContext.Provider, {
|
|
2724
|
+
value: this.contextValue
|
|
2725
|
+
}, tooltip({
|
|
2726
|
+
arrowRef: arrowProps.ref,
|
|
2727
|
+
getArrowProps: this.getArrowProps,
|
|
2728
|
+
getTooltipProps: this.getTooltipProps,
|
|
2729
|
+
placement: placement,
|
|
2730
|
+
tooltipRef: this.getTooltipRef
|
|
2731
|
+
}));
|
|
2732
|
+
};
|
|
2733
|
+
|
|
2734
|
+
_proto.isTriggeredBy = function isTriggeredBy(event) {
|
|
2735
|
+
var trigger = this.props.trigger;
|
|
2736
|
+
return trigger === event || Array.isArray(trigger) && trigger.includes(event);
|
|
2737
|
+
};
|
|
2738
|
+
|
|
2739
|
+
return Tooltip;
|
|
2740
|
+
}(react__WEBPACK_IMPORTED_MODULE_34__.Component);
|
|
2741
|
+
|
|
2742
|
+
Tooltip$1.contextType = TooltipContext;
|
|
2743
|
+
var DEFAULT_MUTATION_OBSERVER_CONFIG = {
|
|
2744
|
+
childList: true,
|
|
2745
|
+
subtree: true
|
|
2746
|
+
};
|
|
2747
|
+
|
|
2748
|
+
var TooltipTrigger = /*#__PURE__*/function (_Component) {
|
|
2749
|
+
_inheritsLoose(TooltipTrigger, _Component);
|
|
2750
|
+
|
|
2751
|
+
function TooltipTrigger() {
|
|
2752
|
+
var _this;
|
|
2753
|
+
|
|
2754
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2755
|
+
args[_key] = arguments[_key];
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
2759
|
+
_this.state = {
|
|
2760
|
+
tooltipShown: _this.props.defaultTooltipShown
|
|
2761
|
+
};
|
|
2762
|
+
_this.hideTimeout = void 0;
|
|
2763
|
+
_this.showTimeout = void 0;
|
|
2764
|
+
_this.popperOffset = void 0;
|
|
2765
|
+
|
|
2766
|
+
_this.setTooltipState = function (state) {
|
|
2767
|
+
var cb = function cb() {
|
|
2768
|
+
return _this.props.onVisibilityChange(state.tooltipShown);
|
|
2769
|
+
};
|
|
2770
|
+
|
|
2771
|
+
_this.isControlled() ? cb() : _this.setState(state, cb);
|
|
2772
|
+
};
|
|
2773
|
+
|
|
2774
|
+
_this.clearScheduled = function () {
|
|
2775
|
+
clearTimeout(_this.hideTimeout);
|
|
2776
|
+
clearTimeout(_this.showTimeout);
|
|
2777
|
+
};
|
|
2778
|
+
|
|
2779
|
+
_this.showTooltip = function (_ref) {
|
|
2780
|
+
var pageX = _ref.pageX,
|
|
2781
|
+
pageY = _ref.pageY;
|
|
2782
|
+
|
|
2783
|
+
_this.clearScheduled();
|
|
2784
|
+
|
|
2785
|
+
var state = {
|
|
2786
|
+
tooltipShown: true
|
|
2787
|
+
};
|
|
2788
|
+
|
|
2789
|
+
if (_this.props.followCursor) {
|
|
2790
|
+
state = (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({}, state, {
|
|
2791
|
+
pageX: pageX,
|
|
2792
|
+
pageY: pageY
|
|
2793
|
+
});
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
_this.showTimeout = window.setTimeout(function () {
|
|
2797
|
+
return _this.setTooltipState(state);
|
|
2798
|
+
}, _this.props.delayShow);
|
|
2799
|
+
};
|
|
2800
|
+
|
|
2801
|
+
_this.hideTooltip = function () {
|
|
2802
|
+
_this.clearScheduled();
|
|
2803
|
+
|
|
2804
|
+
_this.hideTimeout = window.setTimeout(function () {
|
|
2805
|
+
return _this.setTooltipState({
|
|
2806
|
+
tooltipShown: false
|
|
2807
|
+
});
|
|
2808
|
+
}, _this.props.delayHide);
|
|
2809
|
+
};
|
|
2810
|
+
|
|
2811
|
+
_this.toggleTooltip = function (_ref2) {
|
|
2812
|
+
var pageX = _ref2.pageX,
|
|
2813
|
+
pageY = _ref2.pageY;
|
|
2814
|
+
var action = _this.getState() ? 'hideTooltip' : 'showTooltip';
|
|
2815
|
+
|
|
2816
|
+
_this[action]({
|
|
2817
|
+
pageX: pageX,
|
|
2818
|
+
pageY: pageY
|
|
2819
|
+
});
|
|
2820
|
+
};
|
|
2821
|
+
|
|
2822
|
+
_this.clickToggle = function (event) {
|
|
2823
|
+
event.preventDefault();
|
|
2824
|
+
var pageX = event.pageX,
|
|
2825
|
+
pageY = event.pageY;
|
|
2826
|
+
var action = _this.props.followCursor ? 'showTooltip' : 'toggleTooltip';
|
|
2827
|
+
|
|
2828
|
+
_this[action]({
|
|
2829
|
+
pageX: pageX,
|
|
2830
|
+
pageY: pageY
|
|
2831
|
+
});
|
|
2832
|
+
};
|
|
2833
|
+
|
|
2834
|
+
_this.contextMenuToggle = function (event) {
|
|
2835
|
+
event.preventDefault();
|
|
2836
|
+
var pageX = event.pageX,
|
|
2837
|
+
pageY = event.pageY;
|
|
2838
|
+
var action = _this.props.followCursor ? 'showTooltip' : 'toggleTooltip';
|
|
2839
|
+
|
|
2840
|
+
_this[action]({
|
|
2841
|
+
pageX: pageX,
|
|
2842
|
+
pageY: pageY
|
|
2843
|
+
});
|
|
2844
|
+
};
|
|
2845
|
+
|
|
2846
|
+
_this.getTriggerProps = function (props) {
|
|
2847
|
+
if (props === void 0) {
|
|
2848
|
+
props = {};
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
return (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({}, props, _this.isTriggeredBy('click') && {
|
|
2852
|
+
onClick: callAll(_this.clickToggle, props.onClick),
|
|
2853
|
+
onTouchEnd: callAll(_this.clickToggle, props.onTouchEnd)
|
|
2854
|
+
}, _this.isTriggeredBy('right-click') && {
|
|
2855
|
+
onContextMenu: callAll(_this.contextMenuToggle, props.onContextMenu)
|
|
2856
|
+
}, _this.isTriggeredBy('hover') && (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({
|
|
2857
|
+
onMouseEnter: callAll(_this.showTooltip, props.onMouseEnter),
|
|
2858
|
+
onMouseLeave: callAll(_this.hideTooltip, props.onMouseLeave)
|
|
2859
|
+
}, _this.props.followCursor && {
|
|
2860
|
+
onMouseMove: callAll(_this.showTooltip, props.onMouseMove)
|
|
2861
|
+
}), _this.isTriggeredBy('focus') && {
|
|
2862
|
+
onFocus: callAll(_this.showTooltip, props.onFocus),
|
|
2863
|
+
onBlur: callAll(_this.hideTooltip, props.onBlur)
|
|
2864
|
+
});
|
|
2865
|
+
};
|
|
2866
|
+
|
|
2867
|
+
return _this;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
var _proto = TooltipTrigger.prototype;
|
|
2871
|
+
|
|
2872
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2873
|
+
this.clearScheduled();
|
|
2874
|
+
};
|
|
2875
|
+
|
|
2876
|
+
_proto.render = function render() {
|
|
2877
|
+
var _this2 = this;
|
|
2878
|
+
|
|
2879
|
+
var _this$props = this.props,
|
|
2880
|
+
children = _this$props.children,
|
|
2881
|
+
tooltip = _this$props.tooltip,
|
|
2882
|
+
placement = _this$props.placement,
|
|
2883
|
+
trigger = _this$props.trigger,
|
|
2884
|
+
getTriggerRef = _this$props.getTriggerRef,
|
|
2885
|
+
modifiers = _this$props.modifiers,
|
|
2886
|
+
closeOnReferenceHidden = _this$props.closeOnReferenceHidden,
|
|
2887
|
+
usePortal = _this$props.usePortal,
|
|
2888
|
+
portalContainer = _this$props.portalContainer,
|
|
2889
|
+
followCursor = _this$props.followCursor,
|
|
2890
|
+
getTooltipRef = _this$props.getTooltipRef,
|
|
2891
|
+
mutationObserverOptions = _this$props.mutationObserverOptions,
|
|
2892
|
+
restProps = (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__._)(_this$props, ["children", "tooltip", "placement", "trigger", "getTriggerRef", "modifiers", "closeOnReferenceHidden", "usePortal", "portalContainer", "followCursor", "getTooltipRef", "mutationObserverOptions"]);
|
|
2893
|
+
|
|
2894
|
+
var popper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(Popper, (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({
|
|
2895
|
+
innerRef: getTooltipRef,
|
|
2896
|
+
placement: placement,
|
|
2897
|
+
modifiers: [{
|
|
2898
|
+
name: 'followCursor',
|
|
2899
|
+
enabled: followCursor,
|
|
2900
|
+
phase: 'main',
|
|
2901
|
+
fn: function fn(data) {
|
|
2902
|
+
_this2.popperOffset = data.state.rects.popper;
|
|
2903
|
+
}
|
|
2904
|
+
}].concat(modifiers)
|
|
2905
|
+
}, restProps), function (_ref3) {
|
|
2906
|
+
var ref = _ref3.ref,
|
|
2907
|
+
style = _ref3.style,
|
|
2908
|
+
placement = _ref3.placement,
|
|
2909
|
+
arrowProps = _ref3.arrowProps,
|
|
2910
|
+
isReferenceHidden = _ref3.isReferenceHidden,
|
|
2911
|
+
update = _ref3.update;
|
|
2912
|
+
|
|
2913
|
+
if (followCursor && _this2.popperOffset) {
|
|
2914
|
+
var _this2$state = _this2.state,
|
|
2915
|
+
pageX = _this2$state.pageX,
|
|
2916
|
+
pageY = _this2$state.pageY;
|
|
2917
|
+
var _this2$popperOffset = _this2.popperOffset,
|
|
2918
|
+
width = _this2$popperOffset.width,
|
|
2919
|
+
height = _this2$popperOffset.height;
|
|
2920
|
+
var x = pageX + width > window.pageXOffset + document.body.offsetWidth ? pageX - width : pageX;
|
|
2921
|
+
var y = pageY + height > window.pageYOffset + document.body.offsetHeight ? pageY - height : pageY;
|
|
2922
|
+
style.transform = "translate3d(" + x + "px, " + y + "px, 0";
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(Tooltip$1, (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.a)({
|
|
2926
|
+
arrowProps: arrowProps,
|
|
2927
|
+
closeOnReferenceHidden: closeOnReferenceHidden,
|
|
2928
|
+
isReferenceHidden: isReferenceHidden,
|
|
2929
|
+
placement: placement,
|
|
2930
|
+
update: update,
|
|
2931
|
+
style: style,
|
|
2932
|
+
tooltip: tooltip,
|
|
2933
|
+
trigger: trigger,
|
|
2934
|
+
mutationObserverOptions: mutationObserverOptions
|
|
2935
|
+
}, {
|
|
2936
|
+
clearScheduled: _this2.clearScheduled,
|
|
2937
|
+
hideTooltip: _this2.hideTooltip,
|
|
2938
|
+
innerRef: ref
|
|
2939
|
+
}));
|
|
2940
|
+
});
|
|
2941
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(Manager, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_34__.createElement(Reference, {
|
|
2942
|
+
innerRef: getTriggerRef
|
|
2943
|
+
}, function (_ref4) {
|
|
2944
|
+
var ref = _ref4.ref;
|
|
2945
|
+
return children({
|
|
2946
|
+
getTriggerProps: _this2.getTriggerProps,
|
|
2947
|
+
triggerRef: ref
|
|
2948
|
+
});
|
|
2949
|
+
}), this.getState() && (usePortal ? /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_35__.createPortal)(popper, portalContainer) : popper));
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
_proto.isControlled = function isControlled() {
|
|
2953
|
+
return this.props.tooltipShown !== undefined;
|
|
2954
|
+
};
|
|
2955
|
+
|
|
2956
|
+
_proto.getState = function getState() {
|
|
2957
|
+
return this.isControlled() ? this.props.tooltipShown : this.state.tooltipShown;
|
|
2958
|
+
};
|
|
2959
|
+
|
|
2960
|
+
_proto.isTriggeredBy = function isTriggeredBy(event) {
|
|
2961
|
+
var trigger = this.props.trigger;
|
|
2962
|
+
return trigger === event || Array.isArray(trigger) && trigger.includes(event);
|
|
2963
|
+
};
|
|
2964
|
+
|
|
2965
|
+
return TooltipTrigger;
|
|
2966
|
+
}(react__WEBPACK_IMPORTED_MODULE_34__.Component);
|
|
2967
|
+
|
|
2968
|
+
TooltipTrigger.defaultProps = {
|
|
2969
|
+
closeOnReferenceHidden: true,
|
|
2970
|
+
defaultTooltipShown: false,
|
|
2971
|
+
delayHide: 0,
|
|
2972
|
+
delayShow: 0,
|
|
2973
|
+
followCursor: false,
|
|
2974
|
+
onVisibilityChange: noop,
|
|
2975
|
+
placement: 'right',
|
|
2976
|
+
portalContainer: canUseDOM() ? document.body : null,
|
|
2977
|
+
trigger: 'hover',
|
|
2978
|
+
usePortal: canUseDOM(),
|
|
2979
|
+
mutationObserverOptions: DEFAULT_MUTATION_OBSERVER_CONFIG,
|
|
2980
|
+
modifiers: []
|
|
2981
|
+
};
|
|
2982
|
+
var TooltipTrigger$1 = TooltipTrigger;
|
|
2983
|
+
var match = memoizerific__WEBPACK_IMPORTED_MODULE_36___default()(1000)(function (requests, actual, value) {
|
|
2984
|
+
var fallback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2985
|
+
return actual.split('-')[0] === requests ? value : fallback;
|
|
2986
|
+
});
|
|
2987
|
+
var ArrowSpacing = 8;
|
|
2988
|
+
var Arrow = _storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .styled */ .I4.div({
|
|
2989
|
+
position: 'absolute',
|
|
2990
|
+
borderStyle: 'solid'
|
|
2991
|
+
}, function (_ref6) {
|
|
2992
|
+
var placement = _ref6.placement;
|
|
2993
|
+
var x = 0;
|
|
2994
|
+
var y = 0;
|
|
2995
|
+
|
|
2996
|
+
switch (true) {
|
|
2997
|
+
case placement.startsWith('left') || placement.startsWith('right'):
|
|
2998
|
+
{
|
|
2999
|
+
y = 8;
|
|
3000
|
+
break;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
case placement.startsWith('top') || placement.startsWith('bottom'):
|
|
3004
|
+
{
|
|
3005
|
+
x = 8;
|
|
3006
|
+
break;
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
var transform = "translate3d(".concat(x, "px, ").concat(y, "px, 0px)");
|
|
3011
|
+
return {
|
|
3012
|
+
transform: transform
|
|
3013
|
+
};
|
|
3014
|
+
}, function (_ref7) {
|
|
3015
|
+
var theme = _ref7.theme,
|
|
3016
|
+
color = _ref7.color,
|
|
3017
|
+
placement = _ref7.placement;
|
|
3018
|
+
return {
|
|
3019
|
+
bottom: "".concat(match('top', placement, ArrowSpacing * -1, 'auto'), "px"),
|
|
3020
|
+
top: "".concat(match('bottom', placement, ArrowSpacing * -1, 'auto'), "px"),
|
|
3021
|
+
right: "".concat(match('left', placement, ArrowSpacing * -1, 'auto'), "px"),
|
|
3022
|
+
left: "".concat(match('right', placement, ArrowSpacing * -1, 'auto'), "px"),
|
|
3023
|
+
borderBottomWidth: "".concat(match('top', placement, '0', ArrowSpacing), "px"),
|
|
3024
|
+
borderTopWidth: "".concat(match('bottom', placement, '0', ArrowSpacing), "px"),
|
|
3025
|
+
borderRightWidth: "".concat(match('left', placement, '0', ArrowSpacing), "px"),
|
|
3026
|
+
borderLeftWidth: "".concat(match('right', placement, '0', ArrowSpacing), "px"),
|
|
3027
|
+
borderTopColor: match('top', placement, theme.color[color] || color || theme.base === 'light' ? (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .lighten */ .a)(theme.background.app) : (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .darken */ .e$)(theme.background.app), 'transparent'),
|
|
3028
|
+
borderBottomColor: match('bottom', placement, theme.color[color] || color || theme.base === 'light' ? (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .lighten */ .a)(theme.background.app) : (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .darken */ .e$)(theme.background.app), 'transparent'),
|
|
3029
|
+
borderLeftColor: match('left', placement, theme.color[color] || color || theme.base === 'light' ? (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .lighten */ .a)(theme.background.app) : (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .darken */ .e$)(theme.background.app), 'transparent'),
|
|
3030
|
+
borderRightColor: match('right', placement, theme.color[color] || color || theme.base === 'light' ? (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .lighten */ .a)(theme.background.app) : (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .darken */ .e$)(theme.background.app), 'transparent')
|
|
3031
|
+
};
|
|
3032
|
+
});
|
|
3033
|
+
var Wrapper = _storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .styled */ .I4.div(function (_ref8) {
|
|
3034
|
+
var hidden = _ref8.hidden;
|
|
3035
|
+
return {
|
|
3036
|
+
display: hidden ? 'none' : 'inline-block',
|
|
3037
|
+
zIndex: 2147483647
|
|
3038
|
+
};
|
|
3039
|
+
}, function (_ref9) {
|
|
3040
|
+
var theme = _ref9.theme,
|
|
3041
|
+
color = _ref9.color,
|
|
3042
|
+
hasChrome = _ref9.hasChrome;
|
|
3043
|
+
return hasChrome ? {
|
|
3044
|
+
background: theme.color[color] || color || theme.base === 'light' ? (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .lighten */ .a)(theme.background.app) : (0,_storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .darken */ .e$)(theme.background.app),
|
|
3045
|
+
filter: "\n drop-shadow(0px 5px 5px rgba(0,0,0,0.05))\n drop-shadow(0 1px 3px rgba(0,0,0,0.1))\n ",
|
|
3046
|
+
borderRadius: theme.appBorderRadius * 2,
|
|
3047
|
+
fontSize: theme.typography.size.s1
|
|
3048
|
+
} : {};
|
|
3049
|
+
});
|
|
3050
|
+
|
|
3051
|
+
var Tooltip = function Tooltip(_a) {
|
|
3052
|
+
var placement = _a.placement,
|
|
3053
|
+
hasChrome = _a.hasChrome,
|
|
3054
|
+
children = _a.children,
|
|
3055
|
+
arrowProps = _a.arrowProps,
|
|
3056
|
+
tooltipRef = _a.tooltipRef,
|
|
3057
|
+
arrowRef = _a.arrowRef,
|
|
3058
|
+
color = _a.color,
|
|
3059
|
+
props = (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.d)(_a, ["placement", "hasChrome", "children", "arrowProps", "tooltipRef", "arrowRef", "color"]);
|
|
3060
|
+
|
|
3061
|
+
return react__WEBPACK_IMPORTED_MODULE_34__.createElement(Wrapper, Object.assign({
|
|
3062
|
+
hasChrome: hasChrome,
|
|
3063
|
+
placement: placement,
|
|
3064
|
+
ref: tooltipRef
|
|
3065
|
+
}, props, {
|
|
3066
|
+
color: color
|
|
3067
|
+
}), hasChrome && react__WEBPACK_IMPORTED_MODULE_34__.createElement(Arrow, Object.assign({
|
|
3068
|
+
placement: placement,
|
|
3069
|
+
ref: arrowRef
|
|
3070
|
+
}, arrowProps, {
|
|
3071
|
+
color: color
|
|
3072
|
+
})), children);
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
Tooltip.defaultProps = {
|
|
3076
|
+
color: undefined,
|
|
3077
|
+
arrowRef: undefined,
|
|
3078
|
+
tooltipRef: undefined,
|
|
3079
|
+
hasChrome: true,
|
|
3080
|
+
placement: 'top',
|
|
3081
|
+
arrowProps: {}
|
|
3082
|
+
};
|
|
3083
|
+
var document$1 = _index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.w.document; // A target that doesn't speak popper
|
|
3084
|
+
|
|
3085
|
+
var TargetContainer = _storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .styled */ .I4.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n cursor: ", ";\n"])), function (props) {
|
|
3086
|
+
return props.mode === 'hover' ? 'default' : 'pointer';
|
|
3087
|
+
});
|
|
3088
|
+
var TargetSvgContainer = _storybook_theming__WEBPACK_IMPORTED_MODULE_39__/* .styled */ .I4.g(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: ", ";\n"])), function (props) {
|
|
3089
|
+
return props.mode === 'hover' ? 'default' : 'pointer';
|
|
3090
|
+
}); // Pure, does not bind to the body
|
|
3091
|
+
|
|
3092
|
+
var WithTooltipPure = function WithTooltipPure(_a) {
|
|
3093
|
+
var svg = _a.svg,
|
|
3094
|
+
trigger = _a.trigger,
|
|
3095
|
+
closeOnClick = _a.closeOnClick,
|
|
3096
|
+
placement = _a.placement,
|
|
3097
|
+
modifiers = _a.modifiers,
|
|
3098
|
+
hasChrome = _a.hasChrome,
|
|
3099
|
+
_tooltip = _a.tooltip,
|
|
3100
|
+
children = _a.children,
|
|
3101
|
+
tooltipShown = _a.tooltipShown,
|
|
3102
|
+
onVisibilityChange = _a.onVisibilityChange,
|
|
3103
|
+
props = (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.d)(_a, ["svg", "trigger", "closeOnClick", "placement", "modifiers", "hasChrome", "tooltip", "children", "tooltipShown", "onVisibilityChange"]);
|
|
3104
|
+
|
|
3105
|
+
var Container = svg ? TargetSvgContainer : TargetContainer;
|
|
3106
|
+
return react__WEBPACK_IMPORTED_MODULE_34__.createElement(TooltipTrigger$1, {
|
|
3107
|
+
placement: placement,
|
|
3108
|
+
trigger: trigger,
|
|
3109
|
+
modifiers: modifiers,
|
|
3110
|
+
tooltipShown: tooltipShown,
|
|
3111
|
+
onVisibilityChange: onVisibilityChange,
|
|
3112
|
+
tooltip: function tooltip(_ref10) {
|
|
3113
|
+
var getTooltipProps = _ref10.getTooltipProps,
|
|
3114
|
+
getArrowProps = _ref10.getArrowProps,
|
|
3115
|
+
tooltipRef = _ref10.tooltipRef,
|
|
3116
|
+
arrowRef = _ref10.arrowRef,
|
|
3117
|
+
tooltipPlacement = _ref10.placement;
|
|
3118
|
+
return react__WEBPACK_IMPORTED_MODULE_34__.createElement(Tooltip, Object.assign({
|
|
3119
|
+
hasChrome: hasChrome,
|
|
3120
|
+
placement: tooltipPlacement,
|
|
3121
|
+
tooltipRef: tooltipRef,
|
|
3122
|
+
arrowRef: arrowRef,
|
|
3123
|
+
arrowProps: getArrowProps()
|
|
3124
|
+
}, getTooltipProps()), typeof _tooltip === 'function' ? _tooltip({
|
|
3125
|
+
onHide: function onHide() {
|
|
3126
|
+
return onVisibilityChange(false);
|
|
3127
|
+
}
|
|
3128
|
+
}) : _tooltip);
|
|
3129
|
+
}
|
|
3130
|
+
}, function (_ref11) {
|
|
3131
|
+
var getTriggerProps = _ref11.getTriggerProps,
|
|
3132
|
+
triggerRef = _ref11.triggerRef;
|
|
3133
|
+
return (// @ts-ignore
|
|
3134
|
+
react__WEBPACK_IMPORTED_MODULE_34__.createElement(Container, Object.assign({
|
|
3135
|
+
ref: triggerRef
|
|
3136
|
+
}, getTriggerProps(), props), children)
|
|
3137
|
+
);
|
|
3138
|
+
});
|
|
3139
|
+
};
|
|
3140
|
+
|
|
3141
|
+
WithTooltipPure.defaultProps = {
|
|
3142
|
+
svg: false,
|
|
3143
|
+
trigger: 'hover',
|
|
3144
|
+
closeOnClick: false,
|
|
3145
|
+
placement: 'top',
|
|
3146
|
+
modifiers: [{
|
|
3147
|
+
name: 'preventOverflow',
|
|
3148
|
+
options: {
|
|
3149
|
+
padding: 8
|
|
3150
|
+
}
|
|
3151
|
+
}, {
|
|
3152
|
+
name: 'offset',
|
|
3153
|
+
options: {
|
|
3154
|
+
offset: [8, 8]
|
|
3155
|
+
}
|
|
3156
|
+
}, {
|
|
3157
|
+
name: 'arrow',
|
|
3158
|
+
options: {
|
|
3159
|
+
padding: 8
|
|
3160
|
+
}
|
|
3161
|
+
}],
|
|
3162
|
+
hasChrome: true,
|
|
3163
|
+
tooltipShown: false
|
|
3164
|
+
};
|
|
3165
|
+
|
|
3166
|
+
var WithToolTipState = function WithToolTipState(_a) {
|
|
3167
|
+
var startOpen = _a.startOpen,
|
|
3168
|
+
onChange = _a.onVisibilityChange,
|
|
3169
|
+
rest = (0,_index_681e4b07_js__WEBPACK_IMPORTED_MODULE_38__.d)(_a, ["startOpen", "onVisibilityChange"]);
|
|
3170
|
+
|
|
3171
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_34__.useState)(startOpen || false),
|
|
3172
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3173
|
+
tooltipShown = _useState2[0],
|
|
3174
|
+
setTooltipShown = _useState2[1];
|
|
3175
|
+
|
|
3176
|
+
var onVisibilityChange = (0,react__WEBPACK_IMPORTED_MODULE_34__.useCallback)(function (visibility) {
|
|
3177
|
+
if (onChange && onChange(visibility) === false) return;
|
|
3178
|
+
setTooltipShown(visibility);
|
|
3179
|
+
}, [onChange]);
|
|
3180
|
+
(0,react__WEBPACK_IMPORTED_MODULE_34__.useEffect)(function () {
|
|
3181
|
+
var hide = function hide() {
|
|
3182
|
+
return onVisibilityChange(false);
|
|
3183
|
+
};
|
|
3184
|
+
|
|
3185
|
+
document$1.addEventListener('keydown', hide, false); // Find all iframes on the screen and bind to clicks inside them (waiting until the iframe is ready)
|
|
3186
|
+
|
|
3187
|
+
var iframes = Array.from(document$1.getElementsByTagName('iframe'));
|
|
3188
|
+
var unbinders = [];
|
|
3189
|
+
iframes.forEach(function (iframe) {
|
|
3190
|
+
var bind = function bind() {
|
|
3191
|
+
try {
|
|
3192
|
+
if (iframe.contentWindow.document) {
|
|
3193
|
+
iframe.contentWindow.document.addEventListener('click', hide);
|
|
3194
|
+
unbinders.push(function () {
|
|
3195
|
+
try {
|
|
3196
|
+
iframe.contentWindow.document.removeEventListener('click', hide);
|
|
3197
|
+
} catch (e) {// logger.debug('Removing a click listener from iframe failed: ', e);
|
|
3198
|
+
}
|
|
3199
|
+
});
|
|
3200
|
+
}
|
|
3201
|
+
} catch (e) {// logger.debug('Adding a click listener to iframe failed: ', e);
|
|
3202
|
+
}
|
|
3203
|
+
};
|
|
3204
|
+
|
|
3205
|
+
bind(); // I don't know how to find out if it's already loaded so I potentially will bind twice
|
|
3206
|
+
|
|
3207
|
+
iframe.addEventListener('load', bind);
|
|
3208
|
+
unbinders.push(function () {
|
|
3209
|
+
iframe.removeEventListener('load', bind);
|
|
3210
|
+
});
|
|
3211
|
+
});
|
|
3212
|
+
return function () {
|
|
3213
|
+
document$1.removeEventListener('keydown', hide);
|
|
3214
|
+
unbinders.forEach(function (unbind) {
|
|
3215
|
+
unbind();
|
|
3216
|
+
});
|
|
3217
|
+
};
|
|
3218
|
+
});
|
|
3219
|
+
return react__WEBPACK_IMPORTED_MODULE_34__.createElement(WithTooltipPure, Object.assign({}, rest, {
|
|
3220
|
+
tooltipShown: tooltipShown,
|
|
3221
|
+
onVisibilityChange: onVisibilityChange
|
|
3222
|
+
}));
|
|
3223
|
+
};
|
|
3224
|
+
|
|
3225
|
+
|
|
3226
|
+
|
|
3227
|
+
|
|
3228
|
+
/***/ }),
|
|
3229
|
+
|
|
3230
|
+
/***/ 47146:
|
|
3231
|
+
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
3232
|
+
|
|
3233
|
+
|
|
3234
|
+
var globalThis = __webpack_require__(79117);
|
|
3235
|
+
var DESCRIPTORS = __webpack_require__(96893);
|
|
3236
|
+
var defineBuiltInAccessor = __webpack_require__(10997);
|
|
3237
|
+
var regExpFlags = __webpack_require__(34932);
|
|
3238
|
+
var fails = __webpack_require__(5234);
|
|
3239
|
+
|
|
3240
|
+
// babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError
|
|
3241
|
+
var RegExp = globalThis.RegExp;
|
|
3242
|
+
var RegExpPrototype = RegExp.prototype;
|
|
3243
|
+
|
|
3244
|
+
var FORCED = DESCRIPTORS && fails(function () {
|
|
3245
|
+
var INDICES_SUPPORT = true;
|
|
3246
|
+
try {
|
|
3247
|
+
RegExp('.', 'd');
|
|
3248
|
+
} catch (error) {
|
|
3249
|
+
INDICES_SUPPORT = false;
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
var O = {};
|
|
3253
|
+
// modern V8 bug
|
|
3254
|
+
var calls = '';
|
|
3255
|
+
var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy';
|
|
3256
|
+
|
|
3257
|
+
var addGetter = function (key, chr) {
|
|
3258
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
3259
|
+
Object.defineProperty(O, key, { get: function () {
|
|
3260
|
+
calls += chr;
|
|
3261
|
+
return true;
|
|
3262
|
+
} });
|
|
3263
|
+
};
|
|
3264
|
+
|
|
3265
|
+
var pairs = {
|
|
3266
|
+
dotAll: 's',
|
|
3267
|
+
global: 'g',
|
|
3268
|
+
ignoreCase: 'i',
|
|
3269
|
+
multiline: 'm',
|
|
3270
|
+
sticky: 'y'
|
|
3271
|
+
};
|
|
3272
|
+
|
|
3273
|
+
if (INDICES_SUPPORT) pairs.hasIndices = 'd';
|
|
3274
|
+
|
|
3275
|
+
for (var key in pairs) addGetter(key, pairs[key]);
|
|
3276
|
+
|
|
3277
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
3278
|
+
var result = Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call(O);
|
|
3279
|
+
|
|
3280
|
+
return result !== expected || calls !== expected;
|
|
3281
|
+
});
|
|
3282
|
+
|
|
3283
|
+
// `RegExp.prototype.flags` getter
|
|
3284
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
3285
|
+
if (FORCED) defineBuiltInAccessor(RegExpPrototype, 'flags', {
|
|
3286
|
+
configurable: true,
|
|
3287
|
+
get: regExpFlags
|
|
3288
|
+
});
|
|
3289
|
+
|
|
3290
|
+
|
|
3291
|
+
/***/ })
|
|
3292
|
+
|
|
3293
|
+
}]);
|
|
3294
|
+
//# sourceMappingURL=599.37d4aa34.iframe.bundle.js.map
|