eoss 0.1.0-alpha.41 → 0.1.0-alpha.43
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/lib/0.js +1 -1
- package/lib/1.js +1 -1
- package/lib/10.js +1 -1
- package/lib/11.js +1 -1
- package/lib/12.js +1 -1
- package/lib/13.js +1 -1
- package/lib/14.js +1 -1
- package/lib/15.js +1 -1
- package/lib/16.js +1 -1
- package/lib/17.js +1 -1
- package/lib/18.js +1 -1
- package/lib/19.js +1 -1
- package/lib/20.js +1 -1
- package/lib/21.js +1 -1
- package/lib/22.js +1 -1
- package/lib/23.js +1 -1
- package/lib/24.js +1 -1
- package/lib/25.js +1 -1
- package/lib/26.js +1 -1
- package/lib/27.js +1 -1
- package/lib/28.js +1 -1
- package/lib/29.js +1 -1
- package/lib/3.js +1 -1
- package/lib/30.js +1 -1
- package/lib/31.js +1 -1
- package/lib/32.js +1 -1
- package/lib/33.js +1 -1
- package/lib/34.js +1 -1
- package/lib/35.js +1 -1
- package/lib/36.js +1 -1
- package/lib/37.js +1 -1
- package/lib/38.js +1 -1
- package/lib/39.js +1 -1
- package/lib/4.js +1 -1
- package/lib/40.js +1 -1
- package/lib/41.js +1 -1
- package/lib/42.js +1 -1
- package/lib/43.js +1 -1
- package/lib/44.js +1 -1
- package/lib/45.js +1 -1
- package/lib/46.js +1 -1
- package/lib/47.js +1 -1
- package/lib/48.js +1 -1
- package/lib/49.js +1 -1
- package/lib/5.js +1 -1
- package/lib/50.js +1 -1
- package/lib/51.js +1 -1
- package/lib/52.js +1 -1
- package/lib/53.js +1 -1
- package/lib/54.js +1 -1
- package/lib/55.js +1 -1
- package/lib/56.js +1 -1
- package/lib/57.js +1 -1
- package/lib/58.js +1 -1
- package/lib/59.js +1 -1
- package/lib/6.js +1 -1
- package/lib/60.js +1 -1
- package/lib/61.js +1 -1
- package/lib/62.js +1 -1
- package/lib/63.js +1 -1
- package/lib/64.js +1 -1
- package/lib/65.js +1 -1
- package/lib/66.js +1 -1
- package/lib/67.js +1 -1
- package/lib/68.js +1 -1
- package/lib/69.js +1 -1
- package/lib/7.js +1 -1
- package/lib/70.js +1 -1
- package/lib/71.js +1 -1
- package/lib/72.js +1 -1
- package/lib/73.js +1 -1
- package/lib/74.js +1 -1
- package/lib/75.js +1 -1
- package/lib/76.js +1 -1
- package/lib/77.js +1 -1
- package/lib/78.js +1 -1
- package/lib/79.js +1 -1
- package/lib/8.js +1 -1
- package/lib/80.js +1 -1
- package/lib/81.js +1 -1
- package/lib/9.js +1 -1
- package/lib/account-login.js +1446 -1354
- package/lib/alert.js +2 -2
- package/lib/aside.js +2 -2
- package/lib/audit-trajectory.js +183 -160
- package/lib/autocomplete.js +2852 -2583
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +4 -4
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +4 -4
- package/lib/button-group.js +4 -4
- package/lib/button.js +2 -2
- package/lib/ca-login.js +1216 -1147
- package/lib/calendar.js +864 -839
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +1199 -1130
- package/lib/carousel.js +1201 -1132
- package/lib/cascader-panel.js +1286 -1170
- package/lib/cascader.js +3309 -2976
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +1670 -1388
- package/lib/checkbox.js +9 -7
- package/lib/code-editor.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +1258 -1191
- package/lib/collapse.js +1251 -1184
- package/lib/color-picker.js +1506 -1329
- package/lib/config/api.js +17 -1
- package/lib/container.js +2 -2
- package/lib/cron.js +22 -22
- package/lib/data-table.js +1677 -1359
- package/lib/date-picker.js +2707 -2466
- package/lib/descriptions-item.js +4 -4
- package/lib/descriptions.js +4 -4
- package/lib/dialog.js +1213 -1144
- package/lib/divider.js +2 -2
- package/lib/drawer.js +9 -9
- package/lib/dropdown-item.js +6 -6
- package/lib/dropdown-menu.js +1415 -1265
- package/lib/dropdown.js +1219 -1150
- package/lib/email-login.js +1446 -1354
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +31462 -18205
- package/lib/flip.js +2 -2
- package/lib/flow-group.js +4578 -3381
- package/lib/flow-list.js +9566 -0
- package/lib/flow.js +19284 -10275
- package/lib/flows.js +1483 -1391
- package/lib/footer.js +2 -2
- package/lib/form-editor.js +2825 -2035
- package/lib/form-item.js +1368 -1192
- package/lib/form.js +2297 -2036
- package/lib/guide.js +2 -2
- package/lib/header.js +2 -2
- package/lib/icon.js +1384 -1292
- package/lib/icons.js +145 -99
- package/lib/image-viewer.js +1204 -1135
- package/lib/image.js +6 -6
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +4 -4
- package/lib/input-number.js +169 -122
- package/lib/input.js +1399 -1325
- package/lib/link.js +2 -2
- package/lib/loading.js +11 -11
- package/lib/login.js +1486 -1389
- package/lib/lowcode-view.js +1618 -1526
- package/lib/lowcode.js +1620 -1586
- package/lib/main.js +2062 -1982
- package/lib/marquee.js +1202 -1133
- package/lib/menu-item-group.js +8 -8
- package/lib/menu-item.js +6 -6
- package/lib/menu.js +2698 -2479
- package/lib/message-box.js +1893 -1824
- package/lib/message.js +1782 -1713
- package/lib/notification.js +1783 -1714
- package/lib/option-group.js +16 -7
- package/lib/option.js +1223 -1146
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +1207 -1138
- package/lib/phone-login.js +1441 -1352
- package/lib/popconfirm.js +7 -7
- package/lib/popover.js +2668 -2449
- package/lib/process-config.js +1508 -1416
- package/lib/process-module.js +1453 -1361
- package/lib/process-rule.js +1473 -1381
- package/lib/progress.js +2 -2
- package/lib/qr-code.js +4 -4
- package/lib/qrcode-login.js +1434 -1342
- package/lib/radio-button.js +14 -7
- package/lib/radio-group.js +1696 -1383
- package/lib/radio.js +31 -9
- package/lib/rate.js +1286 -1182
- package/lib/retrial-auth.js +1444 -1352
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +1205 -1136
- package/lib/select.js +4176 -3717
- package/lib/selector-panel.js +2081 -1623
- package/lib/selector.js +2582 -2468
- package/lib/slider.js +149 -109
- package/lib/step.js +28 -30
- package/lib/steps.js +2353 -2278
- package/lib/submenu.js +1399 -1249
- package/lib/switch.js +1337 -1217
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +1208 -1139
- package/lib/table.js +3791 -3476
- package/lib/tabs.js +1202 -1133
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/checkbox-group.css +1 -1
- package/lib/theme-chalk/collapse.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/flow copy.css +1 -0
- package/lib/theme-chalk/flow-group.css +1 -1
- package/lib/theme-chalk/flow-list.css +1 -0
- package/lib/theme-chalk/flow.css +1 -1
- package/lib/theme-chalk/form-editor.css +1 -1
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/icons.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/radio-group.css +1 -1
- package/lib/theme-chalk/retrial-auth.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/selector.css +1 -1
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/switch.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/time-picker.js +2294 -2097
- package/lib/time-select.js +2286 -2089
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tips.js +1429 -1337
- package/lib/toolbar.js +71 -48
- package/lib/tooltip.js +3277 -3058
- package/lib/transfer.js +1351 -1230
- package/lib/tree-group.js +1405 -1313
- package/lib/tree.js +2214 -2122
- package/lib/update-history.js +184 -161
- package/lib/upload.js +2432 -2384
- package/lib/utils/label.js +56 -0
- package/lib/utils/util.js +43 -1
- package/lib/wujie.js +1204 -1135
- package/package.json +5 -1
- package/packages/autocomplete/src/autocomplete.vue +88 -55
- package/packages/cascader/src/cascader.vue +166 -99
- package/packages/cascader-panel/src/node.js +31 -16
- package/packages/cascader-panel/src/store.js +26 -12
- package/packages/checkbox/src/checkbox-group.vue +93 -1
- package/packages/checkbox/src/checkbox.vue +4 -1
- package/packages/color-picker/src/color-picker.vue +279 -261
- package/packages/data-table/src/data-table.vue +104 -12
- package/packages/data-table/src/mixins/table-methods.js +118 -0
- package/packages/date-picker/src/picker.vue +17 -1
- package/packages/dialog/src/dialog.vue +2 -2
- package/packages/flow/src/component/Circulate.vue +59 -93
- package/packages/flow/src/component/CommonOpinions.vue +390 -0
- package/packages/flow/src/component/CustomPreset.vue +18 -25
- package/packages/flow/src/component/FileList.vue +11 -28
- package/packages/flow/src/component/FreeCirculation.vue +48 -59
- package/packages/flow/src/component/Preset.vue +10 -25
- package/packages/flow/src/component/SendMsg.vue +22 -71
- package/packages/flow/src/component/SortFlow.vue +115 -0
- package/packages/flow/src/component/TimeLimit.vue +20 -36
- package/packages/flow/src/component/opinions.vue +160 -108
- package/packages/flow/src/component/taskUnionExamine.vue +143 -145
- package/packages/flow/src/flow.vue +4598 -0
- package/packages/flow/src/form.vue +14 -20
- package/packages/flow/src/freeStartFlow.vue +196 -222
- package/packages/flow/src/main.vue +877 -618
- package/packages/flow/src/processForm.vue +789 -177
- package/packages/flow/src/processReject.vue +87 -83
- package/packages/flow/src/reset.vue +71 -70
- package/packages/flow/src/selectUser.vue +94 -85
- package/packages/flow/src/startTaskRead.vue +150 -156
- package/packages/flow/src/supervise.vue +44 -64
- package/packages/flow/src/table.vue +2 -10
- package/packages/flow-group/src/attachment.js +78 -0
- package/packages/flow-group/src/flow-item.vue +250 -0
- package/packages/flow-group/src/main.vue +151 -416
- package/packages/flow-list/index.js +5 -0
- package/packages/flow-list/src/main.vue +2432 -0
- package/packages/flowOld/index.js +7 -0
- package/packages/flowOld/src/component/Circulate.vue +464 -0
- package/packages/flowOld/src/component/CustomPreset.vue +343 -0
- package/packages/flowOld/src/component/FileList.vue +117 -0
- package/packages/flowOld/src/component/FreeCirculation.vue +278 -0
- package/packages/flowOld/src/component/Preset.vue +283 -0
- package/packages/flowOld/src/component/SendMsg.vue +309 -0
- package/packages/flowOld/src/component/TimeLimit.vue +223 -0
- package/packages/flowOld/src/component/opinions-file.vue +126 -0
- package/packages/flowOld/src/component/opinions.vue +429 -0
- package/packages/flowOld/src/component/taskUnionExamine.vue +832 -0
- package/packages/flowOld/src/form.vue +134 -0
- package/packages/flowOld/src/freeStartFlow.vue +2945 -0
- package/packages/flowOld/src/main.vue +4141 -0
- package/packages/flowOld/src/processForm.vue +1431 -0
- package/packages/flowOld/src/processReject.vue +338 -0
- package/packages/flowOld/src/reset.vue +964 -0
- package/packages/flowOld/src/selectUser.vue +520 -0
- package/packages/flowOld/src/startTaskRead.vue +737 -0
- package/packages/flowOld/src/supervise.vue +197 -0
- package/packages/flowOld/src/table.vue +71 -0
- package/packages/form/src/collapse.vue +40 -59
- package/packages/form/src/form-item-render.vue +117 -13
- package/packages/form/src/form-item.vue +121 -22
- package/packages/form/src/form.vue +62 -59
- package/packages/form/src/label-wrap.vue +5 -4
- package/packages/form/src/steps.vue +5 -8
- package/packages/form-editor/src/components.js +1077 -145
- package/packages/form-editor/src/form-editor.vue +94 -80
- package/packages/form-editor/src/props-panel.vue +59 -12
- package/packages/icons/src/icons.vue +91 -51
- package/packages/input/src/input.vue +787 -783
- package/packages/input-number/src/input-number.vue +58 -39
- package/packages/login/src/login.vue +9 -1
- package/packages/lowcode/src/util/components.js +64 -149
- package/packages/main/src/components/pages.vue +6 -42
- package/packages/main/src/minxs.js +26 -14
- package/packages/pagination/src/pagination.js +4 -4
- package/packages/phone-login/src/phone-login.vue +1 -4
- package/packages/process-rule/src/main.vue +10 -10
- package/packages/radio/src/radio-button.vue +10 -1
- package/packages/radio/src/radio-group.vue +110 -1
- package/packages/radio/src/radio.vue +32 -4
- package/packages/rate/src/rate.vue +49 -26
- package/packages/retrial-auth/src/main.vue +12 -12
- package/packages/select/src/option-group.vue +9 -1
- package/packages/select/src/option.vue +9 -1
- package/packages/select/src/select.vue +286 -224
- package/packages/selector/src/selector.vue +93 -85
- package/packages/selector-panel/src/mixin.js +0 -1
- package/packages/selector-panel/src/selection.vue +16 -8
- package/packages/selector-panel/src/selector-panel.vue +30 -19
- package/packages/slider/src/slider.vue +90 -64
- package/packages/steps/src/steps.vue +8 -6
- package/packages/switch/src/switch.vue +81 -56
- package/packages/table/src/store/index.js +3 -3
- package/packages/table/src/table.vue +69 -6
- package/packages/theme-chalk/src/autocomplete.scss +1 -1
- package/packages/theme-chalk/src/base.scss +16 -0
- package/packages/theme-chalk/src/cascader.scss +2 -0
- package/packages/theme-chalk/src/checkbox-group.scss +2 -0
- package/packages/theme-chalk/src/collapse.scss +2 -6
- package/packages/theme-chalk/src/common/var.scss +2 -2
- package/packages/theme-chalk/src/flow copy.scss +664 -0
- package/packages/theme-chalk/src/flow-group.scss +9 -14
- package/packages/theme-chalk/src/flow-list.scss +61 -0
- package/packages/theme-chalk/src/flow.scss +244 -360
- package/packages/theme-chalk/src/form-editor.scss +14 -5
- package/packages/theme-chalk/src/form.scss +26 -2
- package/packages/theme-chalk/src/icons.scss +30 -24
- package/packages/theme-chalk/src/index.scss +1 -0
- package/packages/theme-chalk/src/input.scss +6 -0
- package/packages/theme-chalk/src/radio-group.scss +3 -2
- package/packages/theme-chalk/src/retrial-auth.scss +3 -3
- package/packages/theme-chalk/src/selector.scss +14 -1
- package/packages/theme-chalk/src/switch.scss +1 -1
- package/packages/theme-chalk/src/tabs.scss +2 -5
- package/packages/toolbar/src/toolbar.vue +51 -18
- package/packages/transfer/src/transfer.vue +79 -40
- package/packages/upload/src/index.vue +1531 -1572
- package/packages/upload/src/upload.vue +0 -1
- package/src/components/field-render.vue +10 -7
- package/src/config/api.js +19 -0
- package/src/index.js +345 -342
- package/src/utils/label.js +53 -0
- package/src/utils/util.js +39 -0
package/lib/dropdown-menu.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 251);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -93,7 +93,7 @@ module.exports =
|
|
|
93
93
|
"use strict";
|
|
94
94
|
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
95
95
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
96
|
-
/* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
96
|
+
/* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
@@ -314,7 +314,7 @@ module.exports = require("vue");
|
|
|
314
314
|
|
|
315
315
|
/***/ }),
|
|
316
316
|
|
|
317
|
-
/***/
|
|
317
|
+
/***/ 23:
|
|
318
318
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
319
319
|
|
|
320
320
|
"use strict";
|
|
@@ -481,7 +481,7 @@ function scrollMove(wrap) {
|
|
|
481
481
|
|
|
482
482
|
/***/ }),
|
|
483
483
|
|
|
484
|
-
/***/
|
|
484
|
+
/***/ 251:
|
|
485
485
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
486
486
|
|
|
487
487
|
"use strict";
|
|
@@ -552,14 +552,14 @@ render._withStripped = true
|
|
|
552
552
|
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=d43a2ffc&
|
|
553
553
|
|
|
554
554
|
// EXTERNAL MODULE: ./src/utils/vue-popper.js
|
|
555
|
-
var vue_popper = __webpack_require__(
|
|
555
|
+
var vue_popper = __webpack_require__(34);
|
|
556
556
|
|
|
557
557
|
// EXTERNAL MODULE: external "eoss/lib/dropdown-item"
|
|
558
|
-
var dropdown_item_ = __webpack_require__(
|
|
558
|
+
var dropdown_item_ = __webpack_require__(61);
|
|
559
559
|
var dropdown_item_default = /*#__PURE__*/__webpack_require__.n(dropdown_item_);
|
|
560
560
|
|
|
561
561
|
// EXTERNAL MODULE: external "eoss/lib/scrollbar"
|
|
562
|
-
var scrollbar_ = __webpack_require__(
|
|
562
|
+
var scrollbar_ = __webpack_require__(30);
|
|
563
563
|
var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
|
|
564
564
|
|
|
565
565
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
|
|
@@ -852,24 +852,24 @@ dropdown_menu.install = function (Vue) {
|
|
|
852
852
|
|
|
853
853
|
/***/ }),
|
|
854
854
|
|
|
855
|
-
/***/
|
|
855
|
+
/***/ 30:
|
|
856
856
|
/***/ (function(module, exports) {
|
|
857
857
|
|
|
858
858
|
module.exports = require("eoss/lib/scrollbar");
|
|
859
859
|
|
|
860
860
|
/***/ }),
|
|
861
861
|
|
|
862
|
-
/***/
|
|
862
|
+
/***/ 34:
|
|
863
863
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
864
864
|
|
|
865
865
|
"use strict";
|
|
866
866
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
867
867
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
868
|
-
/* harmony import */ var eoss_src_utils_popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
868
|
+
/* harmony import */ var eoss_src_utils_popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
|
|
869
869
|
|
|
870
870
|
|
|
871
871
|
|
|
872
|
-
var PopperJS = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer ? function () {} : __webpack_require__(
|
|
872
|
+
var PopperJS = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer ? function () {} : __webpack_require__(57);
|
|
873
873
|
var stopPropagation = function stopPropagation(e) {
|
|
874
874
|
return e.stopPropagation();
|
|
875
875
|
};
|
|
@@ -1130,18 +1130,18 @@ var stopPropagation = function stopPropagation(e) {
|
|
|
1130
1130
|
|
|
1131
1131
|
/***/ }),
|
|
1132
1132
|
|
|
1133
|
-
/***/
|
|
1133
|
+
/***/ 35:
|
|
1134
1134
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1135
1135
|
|
|
1136
1136
|
"use strict";
|
|
1137
1137
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
1138
1138
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
1139
|
-
/* harmony import */ var eoss_src_utils_merge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
1139
|
+
/* harmony import */ var eoss_src_utils_merge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
|
|
1140
1140
|
/* harmony import */ var eoss_src_utils_popup_popup_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11);
|
|
1141
1141
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return eoss_src_utils_popup_popup_manager__WEBPACK_IMPORTED_MODULE_2__["a"]; });
|
|
1142
1142
|
|
|
1143
1143
|
/* harmony import */ var _scrollbar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24);
|
|
1144
|
-
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
1144
|
+
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
|
|
1145
1145
|
|
|
1146
1146
|
|
|
1147
1147
|
|
|
@@ -1503,271 +1503,10 @@ module.exports = g;
|
|
|
1503
1503
|
|
|
1504
1504
|
/***/ }),
|
|
1505
1505
|
|
|
1506
|
-
/***/
|
|
1507
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1508
|
-
|
|
1509
|
-
"use strict";
|
|
1510
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
|
|
1511
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
|
|
1512
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
|
|
1513
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
|
|
1514
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
|
|
1515
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
|
|
1516
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
|
|
1517
|
-
/* unused harmony export setStyle */
|
|
1518
|
-
/* unused harmony export isScroll */
|
|
1519
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
|
|
1520
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
|
|
1521
|
-
/* unused harmony export insertAfter */
|
|
1522
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
1523
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
1524
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
1525
|
-
|
|
1526
|
-
/* istanbul ignore next */
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
|
|
1531
|
-
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
1532
|
-
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
1533
|
-
var ieVersion = isServer ? 0 : Number(document.documentMode);
|
|
1534
|
-
|
|
1535
|
-
/* istanbul ignore next */
|
|
1536
|
-
var trim = function trim(string) {
|
|
1537
|
-
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
|
1538
|
-
};
|
|
1539
|
-
/* istanbul ignore next */
|
|
1540
|
-
var camelCase = function camelCase(name) {
|
|
1541
|
-
return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
|
1542
|
-
return offset ? letter.toUpperCase() : letter;
|
|
1543
|
-
}).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
|
1544
|
-
};
|
|
1545
|
-
|
|
1546
|
-
/* istanbul ignore next */
|
|
1547
|
-
var on = function () {
|
|
1548
|
-
if (!isServer && document.addEventListener) {
|
|
1549
|
-
return function (element, event, handler) {
|
|
1550
|
-
if (element && event && handler) {
|
|
1551
|
-
element.addEventListener(event, handler, false);
|
|
1552
|
-
}
|
|
1553
|
-
};
|
|
1554
|
-
} else {
|
|
1555
|
-
return function (element, event, handler) {
|
|
1556
|
-
if (element && event && handler) {
|
|
1557
|
-
element.attachEvent('on' + event, handler);
|
|
1558
|
-
}
|
|
1559
|
-
};
|
|
1560
|
-
}
|
|
1561
|
-
}();
|
|
1562
|
-
|
|
1563
|
-
/* istanbul ignore next */
|
|
1564
|
-
var off = function () {
|
|
1565
|
-
if (!isServer && document.removeEventListener) {
|
|
1566
|
-
return function (element, event, handler) {
|
|
1567
|
-
if (element && event) {
|
|
1568
|
-
element.removeEventListener(event, handler, false);
|
|
1569
|
-
}
|
|
1570
|
-
};
|
|
1571
|
-
} else {
|
|
1572
|
-
return function (element, event, handler) {
|
|
1573
|
-
if (element && event) {
|
|
1574
|
-
element.detachEvent('on' + event, handler);
|
|
1575
|
-
}
|
|
1576
|
-
};
|
|
1577
|
-
}
|
|
1578
|
-
}();
|
|
1579
|
-
|
|
1580
|
-
/* istanbul ignore next */
|
|
1581
|
-
var once = function once(el, event, fn) {
|
|
1582
|
-
var listener = function listener() {
|
|
1583
|
-
if (fn) {
|
|
1584
|
-
fn.apply(this, arguments);
|
|
1585
|
-
}
|
|
1586
|
-
off(el, event, listener);
|
|
1587
|
-
};
|
|
1588
|
-
on(el, event, listener);
|
|
1589
|
-
};
|
|
1590
|
-
|
|
1591
|
-
/* istanbul ignore next */
|
|
1592
|
-
function hasClass(el, cls) {
|
|
1593
|
-
if (!el || !cls) return false;
|
|
1594
|
-
if (cls.indexOf(' ') !== -1) {
|
|
1595
|
-
throw new Error('className should not contain space.');
|
|
1596
|
-
}
|
|
1597
|
-
if (el.classList) {
|
|
1598
|
-
return el.classList.contains(cls);
|
|
1599
|
-
} else {
|
|
1600
|
-
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
/* istanbul ignore next */
|
|
1605
|
-
function addClass(el, cls) {
|
|
1606
|
-
if (!el) return;
|
|
1607
|
-
var curClass = el.className;
|
|
1608
|
-
var classes = (cls || '').split(' ');
|
|
1609
|
-
|
|
1610
|
-
for (var i = 0, j = classes.length; i < j; i++) {
|
|
1611
|
-
var clsName = classes[i];
|
|
1612
|
-
if (!clsName) continue;
|
|
1613
|
-
|
|
1614
|
-
if (el.classList) {
|
|
1615
|
-
el.classList.add(clsName);
|
|
1616
|
-
} else if (!hasClass(el, clsName)) {
|
|
1617
|
-
curClass += ' ' + clsName;
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
if (!el.classList) {
|
|
1621
|
-
el.className = curClass;
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
/* istanbul ignore next */
|
|
1626
|
-
function removeClass(el, cls) {
|
|
1627
|
-
if (!el || !cls) return;
|
|
1628
|
-
var classes = cls.split(' ');
|
|
1629
|
-
var curClass = ' ' + el.className + ' ';
|
|
1630
|
-
|
|
1631
|
-
for (var i = 0, j = classes.length; i < j; i++) {
|
|
1632
|
-
var clsName = classes[i];
|
|
1633
|
-
if (!clsName) continue;
|
|
1634
|
-
|
|
1635
|
-
if (el.classList) {
|
|
1636
|
-
el.classList.remove(clsName);
|
|
1637
|
-
} else if (hasClass(el, clsName)) {
|
|
1638
|
-
curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
if (!el.classList) {
|
|
1642
|
-
el.className = trim(curClass);
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
/* istanbul ignore next */
|
|
1647
|
-
var getStyle = ieVersion < 9 ? function (element, styleName) {
|
|
1648
|
-
if (isServer) return;
|
|
1649
|
-
if (!element || !styleName) return null;
|
|
1650
|
-
styleName = camelCase(styleName);
|
|
1651
|
-
if (styleName === 'float') {
|
|
1652
|
-
styleName = 'styleFloat';
|
|
1653
|
-
}
|
|
1654
|
-
try {
|
|
1655
|
-
switch (styleName) {
|
|
1656
|
-
case 'opacity':
|
|
1657
|
-
try {
|
|
1658
|
-
return element.filters.item('alpha').opacity / 100;
|
|
1659
|
-
} catch (e) {
|
|
1660
|
-
return 1.0;
|
|
1661
|
-
}
|
|
1662
|
-
default:
|
|
1663
|
-
return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
|
1664
|
-
}
|
|
1665
|
-
} catch (e) {
|
|
1666
|
-
return element.style[styleName];
|
|
1667
|
-
}
|
|
1668
|
-
} : function (element, styleName) {
|
|
1669
|
-
if (isServer) return;
|
|
1670
|
-
if (!element || !styleName) return null;
|
|
1671
|
-
styleName = camelCase(styleName);
|
|
1672
|
-
if (styleName === 'float') {
|
|
1673
|
-
styleName = 'cssFloat';
|
|
1674
|
-
}
|
|
1675
|
-
try {
|
|
1676
|
-
var computed = document.defaultView.getComputedStyle(element, '');
|
|
1677
|
-
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
1678
|
-
} catch (e) {
|
|
1679
|
-
return element.style[styleName];
|
|
1680
|
-
}
|
|
1681
|
-
};
|
|
1682
|
-
|
|
1683
|
-
/* istanbul ignore next */
|
|
1684
|
-
function setStyle(element, styleName, value) {
|
|
1685
|
-
if (!element || !styleName) return;
|
|
1686
|
-
|
|
1687
|
-
if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
|
|
1688
|
-
for (var prop in styleName) {
|
|
1689
|
-
if (styleName.hasOwnProperty(prop)) {
|
|
1690
|
-
setStyle(element, prop, styleName[prop]);
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
} else {
|
|
1694
|
-
styleName = camelCase(styleName);
|
|
1695
|
-
if (styleName === 'opacity' && ieVersion < 9) {
|
|
1696
|
-
element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
|
|
1697
|
-
} else {
|
|
1698
|
-
element.style[styleName] = value;
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
var isScroll = function isScroll(el, vertical) {
|
|
1704
|
-
if (isServer) return;
|
|
1705
|
-
|
|
1706
|
-
var determinedDirection = vertical !== null || vertical !== undefined;
|
|
1707
|
-
var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
|
|
1708
|
-
|
|
1709
|
-
return overflow.match(/(scroll|auto)/);
|
|
1710
|
-
};
|
|
1711
|
-
|
|
1712
|
-
var getScrollContainer = function getScrollContainer(el, vertical) {
|
|
1713
|
-
if (isServer) return;
|
|
1714
|
-
|
|
1715
|
-
var parent = el;
|
|
1716
|
-
while (parent) {
|
|
1717
|
-
if ([window, document, document.documentElement].includes(parent)) {
|
|
1718
|
-
return window;
|
|
1719
|
-
}
|
|
1720
|
-
if (isScroll(parent, vertical)) {
|
|
1721
|
-
return parent;
|
|
1722
|
-
}
|
|
1723
|
-
parent = parent.parentNode;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
return parent;
|
|
1727
|
-
};
|
|
1728
|
-
|
|
1729
|
-
var isInContainer = function isInContainer(el, container) {
|
|
1730
|
-
if (isServer || !el || !container) return false;
|
|
1731
|
-
|
|
1732
|
-
var elRect = el.getBoundingClientRect();
|
|
1733
|
-
var containerRect = void 0;
|
|
1734
|
-
|
|
1735
|
-
if ([window, document, document.documentElement, null, undefined].includes(container)) {
|
|
1736
|
-
containerRect = {
|
|
1737
|
-
top: 0,
|
|
1738
|
-
right: window.innerWidth,
|
|
1739
|
-
bottom: window.innerHeight,
|
|
1740
|
-
left: 0
|
|
1741
|
-
};
|
|
1742
|
-
} else {
|
|
1743
|
-
containerRect = container.getBoundingClientRect();
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
|
1747
|
-
};
|
|
1748
|
-
|
|
1749
|
-
/**
|
|
1750
|
-
* 在元素前插入元素
|
|
1751
|
-
* @param {HTMLElement} newEl 新DOM元素
|
|
1752
|
-
* @param {HTMLElement} targetEl 在指定目标DOM元素前插入
|
|
1753
|
-
*/
|
|
1754
|
-
function insertAfter(newEl, targetEl) {
|
|
1755
|
-
var parentEl = targetEl.parentNode;
|
|
1756
|
-
if (parentEl.lastChild === targetEl) {
|
|
1757
|
-
parentEl.appendChild(newEl);
|
|
1758
|
-
} else {
|
|
1759
|
-
parentEl.insertBefore(newEl, targetEl.nextSibling);
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
/***/ }),
|
|
1764
|
-
|
|
1765
|
-
/***/ 55:
|
|
1506
|
+
/***/ 57:
|
|
1766
1507
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1767
1508
|
|
|
1768
|
-
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__
|
|
1769
|
-
|
|
1770
|
-
/**
|
|
1509
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
1771
1510
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
1772
1511
|
* @version {{version}}
|
|
1773
1512
|
* @license
|
|
@@ -1790,60 +1529,68 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1790
1529
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1791
1530
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1792
1531
|
* SOFTWARE.
|
|
1793
|
-
*/
|
|
1794
|
-
|
|
1795
|
-
//
|
|
1796
|
-
// Cross module loader
|
|
1797
|
-
// Supported: Node, AMD, Browser globals
|
|
1798
|
-
//
|
|
1799
|
-
(function (root, factory) {
|
|
1800
|
-
if (true) {
|
|
1801
|
-
// AMD. Register as an anonymous module.
|
|
1532
|
+
*/
|
|
1533
|
+
|
|
1534
|
+
//
|
|
1535
|
+
// Cross module loader
|
|
1536
|
+
// Supported: Node, AMD, Browser globals
|
|
1537
|
+
//
|
|
1538
|
+
(function (root, factory) {
|
|
1539
|
+
if (true) {
|
|
1540
|
+
// AMD. Register as an anonymous module.
|
|
1802
1541
|
!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
1803
1542
|
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
1804
1543
|
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
|
|
1805
1544
|
__WEBPACK_AMD_DEFINE_FACTORY__),
|
|
1806
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
1807
|
-
} else {}
|
|
1808
|
-
})(this, function () {
|
|
1809
|
-
'use strict';
|
|
1810
|
-
|
|
1811
|
-
var root =
|
|
1812
|
-
// default options
|
|
1813
|
-
var DEFAULTS = {
|
|
1814
|
-
// placement of the popper
|
|
1815
|
-
placement: 'bottom',
|
|
1816
|
-
|
|
1817
|
-
gpuAcceleration: true,
|
|
1818
|
-
|
|
1819
|
-
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
1820
|
-
offset: 0,
|
|
1821
|
-
|
|
1822
|
-
// the element which will act as boundary of the popper
|
|
1823
|
-
boundariesElement: 'viewport',
|
|
1824
|
-
|
|
1825
|
-
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
1826
|
-
boundariesPadding: 5,
|
|
1827
|
-
|
|
1828
|
-
// popper will try to prevent overflow following this order,
|
|
1829
|
-
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
1830
|
-
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
1831
|
-
|
|
1832
|
-
// the behavior used by flip to change the placement of the popper
|
|
1833
|
-
flipBehavior: 'flip',
|
|
1834
|
-
|
|
1835
|
-
arrowElement: '[x-arrow]',
|
|
1836
|
-
|
|
1837
|
-
arrowOffset: 0,
|
|
1838
|
-
|
|
1839
|
-
// list of functions used to modify the offsets before they are applied to the popper
|
|
1840
|
-
modifiers: [
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1545
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
1546
|
+
} else {}
|
|
1547
|
+
})(this, function () {
|
|
1548
|
+
'use strict';
|
|
1549
|
+
|
|
1550
|
+
var root = window;
|
|
1551
|
+
// default options
|
|
1552
|
+
var DEFAULTS = {
|
|
1553
|
+
// placement of the popper
|
|
1554
|
+
placement: 'bottom',
|
|
1555
|
+
|
|
1556
|
+
gpuAcceleration: true,
|
|
1557
|
+
|
|
1558
|
+
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
1559
|
+
offset: 0,
|
|
1560
|
+
|
|
1561
|
+
// the element which will act as boundary of the popper
|
|
1562
|
+
boundariesElement: 'viewport',
|
|
1563
|
+
|
|
1564
|
+
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
1565
|
+
boundariesPadding: 5,
|
|
1566
|
+
|
|
1567
|
+
// popper will try to prevent overflow following this order,
|
|
1568
|
+
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
1569
|
+
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
1570
|
+
|
|
1571
|
+
// the behavior used by flip to change the placement of the popper
|
|
1572
|
+
flipBehavior: 'flip',
|
|
1573
|
+
|
|
1574
|
+
arrowElement: '[x-arrow]',
|
|
1575
|
+
|
|
1576
|
+
arrowOffset: 0,
|
|
1577
|
+
|
|
1578
|
+
// list of functions used to modify the offsets before they are applied to the popper
|
|
1579
|
+
modifiers: [
|
|
1580
|
+
'shift',
|
|
1581
|
+
'offset',
|
|
1582
|
+
'preventOverflow',
|
|
1583
|
+
'keepTogether',
|
|
1584
|
+
'arrow',
|
|
1585
|
+
'flip',
|
|
1586
|
+
'applyStyle'
|
|
1587
|
+
],
|
|
1588
|
+
|
|
1589
|
+
modifiersIgnored: [],
|
|
1590
|
+
|
|
1591
|
+
forceAbsolute: false
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1847
1594
|
/**
|
|
1848
1595
|
* Create a new Popper.js instance
|
|
1849
1596
|
* @constructor Popper
|
|
@@ -1908,114 +1655,125 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1908
1655
|
*
|
|
1909
1656
|
* @param {Boolean} [options.removeOnDestroy=false]
|
|
1910
1657
|
* Set to true if you want to automatically remove the popper when you call the `destroy` method.
|
|
1911
|
-
*/
|
|
1912
|
-
function Popper(reference, popper, options) {
|
|
1913
|
-
this._reference = reference.jquery ? reference[0] : reference;
|
|
1914
|
-
this.state = {};
|
|
1915
|
-
|
|
1916
|
-
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
1917
|
-
// generate a default popper if is not defined
|
|
1918
|
-
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
1919
|
-
var isConfig =
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
this.
|
|
1952
|
-
|
|
1953
|
-
//
|
|
1954
|
-
this.
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1658
|
+
*/
|
|
1659
|
+
function Popper(reference, popper, options) {
|
|
1660
|
+
this._reference = reference.jquery ? reference[0] : reference;
|
|
1661
|
+
this.state = {};
|
|
1662
|
+
|
|
1663
|
+
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
1664
|
+
// generate a default popper if is not defined
|
|
1665
|
+
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
1666
|
+
var isConfig =
|
|
1667
|
+
popper && Object.prototype.toString.call(popper) === '[object Object]';
|
|
1668
|
+
if (isNotDefined || isConfig) {
|
|
1669
|
+
this._popper = this.parse(isConfig ? popper : {});
|
|
1670
|
+
}
|
|
1671
|
+
// otherwise, use the given HTMLElement as popper
|
|
1672
|
+
else {
|
|
1673
|
+
this._popper = popper.jquery ? popper[0] : popper;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
// with {} we create a new object with the options inside it
|
|
1677
|
+
this._options = Object.assign({}, DEFAULTS, options);
|
|
1678
|
+
|
|
1679
|
+
// refactoring modifiers' list
|
|
1680
|
+
this._options.modifiers = this._options.modifiers.map(
|
|
1681
|
+
function (modifier) {
|
|
1682
|
+
// remove ignored modifiers
|
|
1683
|
+
if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
|
1684
|
+
|
|
1685
|
+
// set the x-placement attribute before everything else because it could be used to add margins to the popper
|
|
1686
|
+
// margins needs to be calculated to get the correct popper offsets
|
|
1687
|
+
if (modifier === 'applyStyle') {
|
|
1688
|
+
this._popper.setAttribute('x-placement', this._options.placement);
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
// return predefined modifier identified by string or keep the custom one
|
|
1692
|
+
return this.modifiers[modifier] || modifier;
|
|
1693
|
+
}.bind(this)
|
|
1694
|
+
);
|
|
1695
|
+
|
|
1696
|
+
// make sure to apply the popper position before any computation
|
|
1697
|
+
this.state.position = this._getPosition(this._popper, this._reference);
|
|
1698
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
1699
|
+
|
|
1700
|
+
// fire the first update to position the popper in the right place
|
|
1701
|
+
this.update();
|
|
1702
|
+
|
|
1703
|
+
// setup event listeners, they will take care of update the position in specific situations
|
|
1704
|
+
this._setupEventListeners();
|
|
1705
|
+
return this;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
//
|
|
1709
|
+
// Methods
|
|
1710
|
+
//
|
|
1961
1711
|
/**
|
|
1962
1712
|
* Destroy the popper
|
|
1963
1713
|
* @method
|
|
1964
1714
|
* @memberof Popper
|
|
1965
|
-
*/
|
|
1966
|
-
Popper.prototype.destroy = function () {
|
|
1967
|
-
this._popper.removeAttribute('x-placement');
|
|
1968
|
-
this._popper.style.left = '';
|
|
1969
|
-
this._popper.style.position = '';
|
|
1970
|
-
this._popper.style.top = '';
|
|
1971
|
-
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
1972
|
-
this._removeEventListeners();
|
|
1973
|
-
|
|
1974
|
-
// remove the popper if user explicity asked for the deletion on destroy
|
|
1975
|
-
if (this._options.removeOnDestroy) {
|
|
1976
|
-
this._popper.remove();
|
|
1977
|
-
}
|
|
1978
|
-
return this;
|
|
1979
|
-
};
|
|
1980
|
-
|
|
1715
|
+
*/
|
|
1716
|
+
Popper.prototype.destroy = function () {
|
|
1717
|
+
this._popper.removeAttribute('x-placement');
|
|
1718
|
+
this._popper.style.left = '';
|
|
1719
|
+
this._popper.style.position = '';
|
|
1720
|
+
this._popper.style.top = '';
|
|
1721
|
+
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
1722
|
+
this._removeEventListeners();
|
|
1723
|
+
|
|
1724
|
+
// remove the popper if user explicity asked for the deletion on destroy
|
|
1725
|
+
if (this._options.removeOnDestroy) {
|
|
1726
|
+
this._popper.remove();
|
|
1727
|
+
}
|
|
1728
|
+
return this;
|
|
1729
|
+
};
|
|
1730
|
+
|
|
1981
1731
|
/**
|
|
1982
1732
|
* Updates the position of the popper, computing the new offsets and applying the new style
|
|
1983
1733
|
* @method
|
|
1984
1734
|
* @memberof Popper
|
|
1985
|
-
*/
|
|
1986
|
-
Popper.prototype.update = function () {
|
|
1987
|
-
var data = { instance: this, styles: {} };
|
|
1988
|
-
|
|
1989
|
-
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
1990
|
-
// and refer to _originalPlacement to know the original value
|
|
1991
|
-
data.placement = this._options.placement;
|
|
1992
|
-
data._originalPlacement = this._options.placement;
|
|
1993
|
-
|
|
1994
|
-
// compute the popper and reference offsets and put them inside data.offsets
|
|
1995
|
-
data.offsets = this._getOffsets(
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1735
|
+
*/
|
|
1736
|
+
Popper.prototype.update = function () {
|
|
1737
|
+
var data = { instance: this, styles: {} };
|
|
1738
|
+
|
|
1739
|
+
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
1740
|
+
// and refer to _originalPlacement to know the original value
|
|
1741
|
+
data.placement = this._options.placement;
|
|
1742
|
+
data._originalPlacement = this._options.placement;
|
|
1743
|
+
|
|
1744
|
+
// compute the popper and reference offsets and put them inside data.offsets
|
|
1745
|
+
data.offsets = this._getOffsets(
|
|
1746
|
+
this._popper,
|
|
1747
|
+
this._reference,
|
|
1748
|
+
data.placement
|
|
1749
|
+
);
|
|
1750
|
+
|
|
1751
|
+
// get boundaries
|
|
1752
|
+
data.boundaries = this._getBoundaries(
|
|
1753
|
+
data,
|
|
1754
|
+
this._options.boundariesPadding,
|
|
1755
|
+
this._options.boundariesElement
|
|
1756
|
+
);
|
|
1757
|
+
|
|
1758
|
+
data = this.runModifiers(data, this._options.modifiers);
|
|
1759
|
+
|
|
1760
|
+
if (typeof this.state.updateCallback === 'function') {
|
|
1761
|
+
this.state.updateCallback(data);
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
|
|
2007
1765
|
/**
|
|
2008
1766
|
* If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
|
|
2009
1767
|
* @method
|
|
2010
1768
|
* @memberof Popper
|
|
2011
1769
|
* @param {Function} callback
|
|
2012
|
-
*/
|
|
2013
|
-
Popper.prototype.onCreate = function (callback) {
|
|
2014
|
-
// the createCallbacks return as first argument the popper instance
|
|
2015
|
-
callback(this);
|
|
2016
|
-
return this;
|
|
2017
|
-
};
|
|
2018
|
-
|
|
1770
|
+
*/
|
|
1771
|
+
Popper.prototype.onCreate = function (callback) {
|
|
1772
|
+
// the createCallbacks return as first argument the popper instance
|
|
1773
|
+
callback(this);
|
|
1774
|
+
return this;
|
|
1775
|
+
};
|
|
1776
|
+
|
|
2019
1777
|
/**
|
|
2020
1778
|
* If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
|
|
2021
1779
|
* used to style popper and its arrow.
|
|
@@ -2023,93 +1781,101 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2023
1781
|
* @method
|
|
2024
1782
|
* @memberof Popper
|
|
2025
1783
|
* @param {Function} callback
|
|
2026
|
-
*/
|
|
2027
|
-
Popper.prototype.onUpdate = function (callback) {
|
|
2028
|
-
this.state.updateCallback = callback;
|
|
2029
|
-
return this;
|
|
2030
|
-
};
|
|
2031
|
-
|
|
1784
|
+
*/
|
|
1785
|
+
Popper.prototype.onUpdate = function (callback) {
|
|
1786
|
+
this.state.updateCallback = callback;
|
|
1787
|
+
return this;
|
|
1788
|
+
};
|
|
1789
|
+
|
|
2032
1790
|
/**
|
|
2033
1791
|
* Helper used to generate poppers from a configuration file
|
|
2034
1792
|
* @method
|
|
2035
1793
|
* @memberof Popper
|
|
2036
1794
|
* @param config {Object} configuration
|
|
2037
1795
|
* @returns {HTMLElement} popper
|
|
2038
|
-
*/
|
|
2039
|
-
Popper.prototype.parse = function (config) {
|
|
2040
|
-
var defaultConfig = {
|
|
2041
|
-
tagName: 'div',
|
|
2042
|
-
classNames: ['popper'],
|
|
2043
|
-
attributes: [],
|
|
2044
|
-
parent: root.document.body,
|
|
2045
|
-
content: '',
|
|
2046
|
-
contentType: 'text',
|
|
2047
|
-
arrowTagName: 'div',
|
|
2048
|
-
arrowClassNames: ['popper__arrow'],
|
|
2049
|
-
arrowAttributes: ['x-arrow']
|
|
2050
|
-
};
|
|
2051
|
-
config = Object.assign({}, defaultConfig, config);
|
|
2052
|
-
|
|
2053
|
-
var d = root.document;
|
|
2054
|
-
|
|
2055
|
-
var popper = d.createElement(config.tagName);
|
|
2056
|
-
addClassNames(popper, config.classNames);
|
|
2057
|
-
addAttributes(popper, config.attributes);
|
|
2058
|
-
if (config.contentType === 'node') {
|
|
2059
|
-
popper.appendChild(
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
} else {
|
|
2063
|
-
popper.
|
|
2064
|
-
}
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
// if
|
|
2078
|
-
if
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
parent = parent[0];
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
//
|
|
2096
|
-
parent.
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
1796
|
+
*/
|
|
1797
|
+
Popper.prototype.parse = function (config) {
|
|
1798
|
+
var defaultConfig = {
|
|
1799
|
+
tagName: 'div',
|
|
1800
|
+
classNames: ['popper'],
|
|
1801
|
+
attributes: [],
|
|
1802
|
+
parent: root.document.body,
|
|
1803
|
+
content: '',
|
|
1804
|
+
contentType: 'text',
|
|
1805
|
+
arrowTagName: 'div',
|
|
1806
|
+
arrowClassNames: ['popper__arrow'],
|
|
1807
|
+
arrowAttributes: ['x-arrow']
|
|
1808
|
+
};
|
|
1809
|
+
config = Object.assign({}, defaultConfig, config);
|
|
1810
|
+
|
|
1811
|
+
var d = root.document;
|
|
1812
|
+
|
|
1813
|
+
var popper = d.createElement(config.tagName);
|
|
1814
|
+
addClassNames(popper, config.classNames);
|
|
1815
|
+
addAttributes(popper, config.attributes);
|
|
1816
|
+
if (config.contentType === 'node') {
|
|
1817
|
+
popper.appendChild(
|
|
1818
|
+
config.content.jquery ? config.content[0] : config.content
|
|
1819
|
+
);
|
|
1820
|
+
} else if (config.contentType === 'html') {
|
|
1821
|
+
popper.innerHTML = config.content;
|
|
1822
|
+
} else {
|
|
1823
|
+
popper.textContent = config.content;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
if (config.arrowTagName) {
|
|
1827
|
+
var arrow = d.createElement(config.arrowTagName);
|
|
1828
|
+
addClassNames(arrow, config.arrowClassNames);
|
|
1829
|
+
addAttributes(arrow, config.arrowAttributes);
|
|
1830
|
+
popper.appendChild(arrow);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
var parent = config.parent.jquery ? config.parent[0] : config.parent;
|
|
1834
|
+
|
|
1835
|
+
// if the given parent is a string, use it to match an element
|
|
1836
|
+
// if more than one element is matched, the first one will be used as parent
|
|
1837
|
+
// if no elements are matched, the script will throw an error
|
|
1838
|
+
if (typeof parent === 'string') {
|
|
1839
|
+
parent = d.querySelectorAll(config.parent);
|
|
1840
|
+
if (parent.length > 1) {
|
|
1841
|
+
console.warn(
|
|
1842
|
+
'WARNING: the given `parent` query(' +
|
|
1843
|
+
config.parent +
|
|
1844
|
+
') matched more than one element, the first one will be used'
|
|
1845
|
+
);
|
|
1846
|
+
}
|
|
1847
|
+
if (parent.length === 0) {
|
|
1848
|
+
throw "ERROR: the given `parent` doesn't exists!";
|
|
1849
|
+
}
|
|
1850
|
+
parent = parent[0];
|
|
1851
|
+
}
|
|
1852
|
+
// if the given parent is a DOM nodes list or an array of nodes with more than one element,
|
|
1853
|
+
// the first one will be used as parent
|
|
1854
|
+
if (parent.length > 1 && parent instanceof Element === false) {
|
|
1855
|
+
console.warn(
|
|
1856
|
+
'WARNING: you have passed as parent a list of elements, the first one will be used'
|
|
1857
|
+
);
|
|
1858
|
+
parent = parent[0];
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
// append the generated popper to its parent
|
|
1862
|
+
parent.appendChild(popper);
|
|
1863
|
+
|
|
1864
|
+
return popper;
|
|
1865
|
+
|
|
2100
1866
|
/**
|
|
2101
1867
|
* Adds class names to the given element
|
|
2102
1868
|
* @function
|
|
2103
1869
|
* @ignore
|
|
2104
1870
|
* @param {HTMLElement} target
|
|
2105
1871
|
* @param {Array} classes
|
|
2106
|
-
*/
|
|
2107
|
-
function addClassNames(element, classNames) {
|
|
2108
|
-
classNames.forEach(function (className) {
|
|
2109
|
-
element.classList.add(className);
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
|
|
1872
|
+
*/
|
|
1873
|
+
function addClassNames(element, classNames) {
|
|
1874
|
+
classNames.forEach(function (className) {
|
|
1875
|
+
element.classList.add(className);
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
|
|
2113
1879
|
/**
|
|
2114
1880
|
* Adds attributes to the given element
|
|
2115
1881
|
* @function
|
|
@@ -2118,14 +1884,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2118
1884
|
* @param {Array} attributes
|
|
2119
1885
|
* @example
|
|
2120
1886
|
* addAttributes(element, [ 'data-info:foobar' ]);
|
|
2121
|
-
*/
|
|
2122
|
-
function addAttributes(element, attributes) {
|
|
2123
|
-
attributes.forEach(function (attribute) {
|
|
2124
|
-
element.setAttribute(
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
1887
|
+
*/
|
|
1888
|
+
function addAttributes(element, attributes) {
|
|
1889
|
+
attributes.forEach(function (attribute) {
|
|
1890
|
+
element.setAttribute(
|
|
1891
|
+
attribute.split(':')[0],
|
|
1892
|
+
attribute.split(':')[1] || ''
|
|
1893
|
+
);
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
|
|
2129
1898
|
/**
|
|
2130
1899
|
* Helper used to get the position which will be applied to the popper
|
|
2131
1900
|
* @method
|
|
@@ -2133,20 +1902,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2133
1902
|
* @param config {HTMLElement} popper element
|
|
2134
1903
|
* @param reference {HTMLElement} reference element
|
|
2135
1904
|
* @returns {String} position
|
|
2136
|
-
*/
|
|
2137
|
-
Popper.prototype._getPosition = function (popper, reference) {
|
|
2138
|
-
var container = getOffsetParent(reference);
|
|
2139
|
-
|
|
2140
|
-
if (this._options.forceAbsolute) {
|
|
2141
|
-
return 'absolute';
|
|
2142
|
-
}
|
|
2143
|
-
|
|
2144
|
-
// Decide if the popper will be fixed
|
|
2145
|
-
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
2146
|
-
var isParentFixed = isFixed(reference, container);
|
|
2147
|
-
return isParentFixed ? 'fixed' : 'absolute';
|
|
2148
|
-
};
|
|
2149
|
-
|
|
1905
|
+
*/
|
|
1906
|
+
Popper.prototype._getPosition = function (popper, reference) {
|
|
1907
|
+
var container = getOffsetParent(reference);
|
|
1908
|
+
|
|
1909
|
+
if (this._options.forceAbsolute) {
|
|
1910
|
+
return 'absolute';
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
// Decide if the popper will be fixed
|
|
1914
|
+
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
1915
|
+
var isParentFixed = isFixed(reference, container);
|
|
1916
|
+
return isParentFixed ? 'fixed' : 'absolute';
|
|
1917
|
+
};
|
|
1918
|
+
|
|
2150
1919
|
/**
|
|
2151
1920
|
* Get offsets to the popper
|
|
2152
1921
|
* @method
|
|
@@ -2155,91 +1924,110 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2155
1924
|
* @param {Element} popper - the popper element
|
|
2156
1925
|
* @param {Element} reference - the reference element (the popper will be relative to this)
|
|
2157
1926
|
* @returns {Object} An object containing the offsets which will be applied to the popper
|
|
2158
|
-
*/
|
|
2159
|
-
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
2160
|
-
placement = placement.split('-')[0];
|
|
2161
|
-
var popperOffsets = {};
|
|
2162
|
-
|
|
2163
|
-
popperOffsets.position = this.state.position;
|
|
2164
|
-
var isParentFixed = popperOffsets.position === 'fixed';
|
|
2165
|
-
|
|
2166
|
-
//
|
|
2167
|
-
// Get reference element position
|
|
2168
|
-
//
|
|
2169
|
-
var referenceOffsets = getOffsetRectRelativeToCustomParent(
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
//
|
|
2177
|
-
//
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
//
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
if (placement === '
|
|
2191
|
-
popperOffsets.
|
|
2192
|
-
} else {
|
|
2193
|
-
popperOffsets.
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
1927
|
+
*/
|
|
1928
|
+
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
1929
|
+
placement = placement.split('-')[0];
|
|
1930
|
+
var popperOffsets = {};
|
|
1931
|
+
|
|
1932
|
+
popperOffsets.position = this.state.position;
|
|
1933
|
+
var isParentFixed = popperOffsets.position === 'fixed';
|
|
1934
|
+
|
|
1935
|
+
//
|
|
1936
|
+
// Get reference element position
|
|
1937
|
+
//
|
|
1938
|
+
var referenceOffsets = getOffsetRectRelativeToCustomParent(
|
|
1939
|
+
reference,
|
|
1940
|
+
popper,
|
|
1941
|
+
isParentFixed
|
|
1942
|
+
);
|
|
1943
|
+
|
|
1944
|
+
//
|
|
1945
|
+
// Get popper sizes
|
|
1946
|
+
//
|
|
1947
|
+
var popperRect = getOuterSizes(popper);
|
|
1948
|
+
|
|
1949
|
+
//
|
|
1950
|
+
// Compute offsets of popper
|
|
1951
|
+
//
|
|
1952
|
+
|
|
1953
|
+
// depending by the popper placement we have to compute its offsets slightly differently
|
|
1954
|
+
if (['right', 'left'].indexOf(placement) !== -1) {
|
|
1955
|
+
popperOffsets.top =
|
|
1956
|
+
referenceOffsets.top +
|
|
1957
|
+
referenceOffsets.height / 2 -
|
|
1958
|
+
popperRect.height / 2;
|
|
1959
|
+
if (placement === 'left') {
|
|
1960
|
+
popperOffsets.left = referenceOffsets.left - popperRect.width;
|
|
1961
|
+
} else {
|
|
1962
|
+
popperOffsets.left = referenceOffsets.right;
|
|
1963
|
+
}
|
|
1964
|
+
} else {
|
|
1965
|
+
popperOffsets.left =
|
|
1966
|
+
referenceOffsets.left +
|
|
1967
|
+
referenceOffsets.width / 2 -
|
|
1968
|
+
popperRect.width / 2;
|
|
1969
|
+
if (placement === 'top') {
|
|
1970
|
+
popperOffsets.top = referenceOffsets.top - popperRect.height;
|
|
1971
|
+
} else {
|
|
1972
|
+
popperOffsets.top = referenceOffsets.bottom;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
// Add width and height to our offsets object
|
|
1977
|
+
popperOffsets.width = popperRect.width;
|
|
1978
|
+
popperOffsets.height = popperRect.height;
|
|
1979
|
+
|
|
1980
|
+
return {
|
|
1981
|
+
popper: popperOffsets,
|
|
1982
|
+
reference: referenceOffsets
|
|
1983
|
+
};
|
|
1984
|
+
};
|
|
1985
|
+
|
|
2207
1986
|
/**
|
|
2208
1987
|
* Setup needed event listeners used to update the popper position
|
|
2209
1988
|
* @method
|
|
2210
1989
|
* @memberof Popper
|
|
2211
1990
|
* @access private
|
|
2212
|
-
*/
|
|
2213
|
-
Popper.prototype._setupEventListeners = function () {
|
|
2214
|
-
// NOTE: 1 DOM access here
|
|
2215
|
-
this.state.updateBound = this.update.bind(this);
|
|
2216
|
-
// 无界等微前端场景下沙箱 window 不会触发 resize,需监听真实 window
|
|
2217
|
-
this.state.realWindow = getRealWindow(this._popper);
|
|
2218
|
-
this.state.realWindow.addEventListener('resize', this.state.updateBound);
|
|
2219
|
-
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
2220
|
-
if (this._options.boundariesElement !== 'window') {
|
|
2221
|
-
var target = getScrollParent(this._reference);
|
|
2222
|
-
target.addEventListener('scroll', this.state.updateBound);
|
|
2223
|
-
this.state.scrollTarget = target;
|
|
2224
|
-
}
|
|
2225
|
-
};
|
|
2226
|
-
|
|
1991
|
+
*/
|
|
1992
|
+
Popper.prototype._setupEventListeners = function () {
|
|
1993
|
+
// NOTE: 1 DOM access here
|
|
1994
|
+
this.state.updateBound = this.update.bind(this);
|
|
1995
|
+
// 无界等微前端场景下沙箱 window 不会触发 resize,需监听真实 window
|
|
1996
|
+
this.state.realWindow = getRealWindow(this._popper);
|
|
1997
|
+
this.state.realWindow.addEventListener('resize', this.state.updateBound);
|
|
1998
|
+
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
1999
|
+
if (this._options.boundariesElement !== 'window') {
|
|
2000
|
+
var target = getScrollParent(this._reference);
|
|
2001
|
+
target.addEventListener('scroll', this.state.updateBound);
|
|
2002
|
+
this.state.scrollTarget = target;
|
|
2003
|
+
}
|
|
2004
|
+
};
|
|
2005
|
+
|
|
2227
2006
|
/**
|
|
2228
2007
|
* Remove event listeners used to update the popper position
|
|
2229
2008
|
* @method
|
|
2230
2009
|
* @memberof Popper
|
|
2231
2010
|
* @access private
|
|
2232
|
-
*/
|
|
2233
|
-
Popper.prototype._removeEventListeners = function () {
|
|
2234
|
-
// NOTE: 1 DOM access here
|
|
2235
|
-
(this.state.realWindow || root).removeEventListener(
|
|
2236
|
-
|
|
2237
|
-
this.state.
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2011
|
+
*/
|
|
2012
|
+
Popper.prototype._removeEventListeners = function () {
|
|
2013
|
+
// NOTE: 1 DOM access here
|
|
2014
|
+
(this.state.realWindow || root).removeEventListener(
|
|
2015
|
+
'resize',
|
|
2016
|
+
this.state.updateBound
|
|
2017
|
+
);
|
|
2018
|
+
if (
|
|
2019
|
+
this._options.boundariesElement !== 'window' &&
|
|
2020
|
+
this.state.scrollTarget
|
|
2021
|
+
) {
|
|
2022
|
+
this.state.scrollTarget.removeEventListener(
|
|
2023
|
+
'scroll',
|
|
2024
|
+
this.state.updateBound
|
|
2025
|
+
);
|
|
2026
|
+
this.state.scrollTarget = null;
|
|
2027
|
+
}
|
|
2028
|
+
this.state.updateBound = null;
|
|
2029
|
+
};
|
|
2030
|
+
|
|
2243
2031
|
/**
|
|
2244
2032
|
* Computed the boundaries limits and return them
|
|
2245
2033
|
* @method
|
|
@@ -2249,56 +2037,75 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2249
2037
|
* @param {Number} padding - Boundaries padding
|
|
2250
2038
|
* @param {Element} boundariesElement - Element used to define the boundaries
|
|
2251
2039
|
* @returns {Object} Coordinates of the boundaries
|
|
2252
|
-
*/
|
|
2253
|
-
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
2254
|
-
// NOTE: 1 DOM access here
|
|
2255
|
-
var boundaries = {};
|
|
2256
|
-
var width, height;
|
|
2257
|
-
if (boundariesElement === 'window') {
|
|
2258
|
-
var body = root.document.body,
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
height = Math.max(
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2040
|
+
*/
|
|
2041
|
+
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
2042
|
+
// NOTE: 1 DOM access here
|
|
2043
|
+
var boundaries = {};
|
|
2044
|
+
var width, height;
|
|
2045
|
+
if (boundariesElement === 'window') {
|
|
2046
|
+
var body = root.document.body,
|
|
2047
|
+
html = root.document.documentElement;
|
|
2048
|
+
|
|
2049
|
+
height = Math.max(
|
|
2050
|
+
body.scrollHeight,
|
|
2051
|
+
body.offsetHeight,
|
|
2052
|
+
html.clientHeight,
|
|
2053
|
+
html.scrollHeight,
|
|
2054
|
+
html.offsetHeight
|
|
2055
|
+
);
|
|
2056
|
+
width = Math.max(
|
|
2057
|
+
body.scrollWidth,
|
|
2058
|
+
body.offsetWidth,
|
|
2059
|
+
html.clientWidth,
|
|
2060
|
+
html.scrollWidth,
|
|
2061
|
+
html.offsetWidth
|
|
2062
|
+
);
|
|
2063
|
+
|
|
2064
|
+
boundaries = {
|
|
2065
|
+
top: 0,
|
|
2066
|
+
right: width,
|
|
2067
|
+
bottom: height,
|
|
2068
|
+
left: 0
|
|
2069
|
+
};
|
|
2070
|
+
} else if (boundariesElement === 'viewport') {
|
|
2071
|
+
// 将真实 window 的视口换算到 popper 所在包含块的坐标系。
|
|
2072
|
+
// 无界等场景下沙箱 window 的尺寸、shadowRoot 内元素的 scrollTop 均不可靠,
|
|
2073
|
+
// 统一从元素自身的 view 与真实包含块获取
|
|
2074
|
+
var realWindow = getRealWindow(this._popper);
|
|
2075
|
+
var containingBlockRect = getContainingBlockRect(
|
|
2076
|
+
this._popper,
|
|
2077
|
+
data.offsets.popper.position === 'fixed'
|
|
2078
|
+
);
|
|
2079
|
+
|
|
2080
|
+
boundaries = {
|
|
2081
|
+
top: 0 - containingBlockRect.top,
|
|
2082
|
+
right:
|
|
2083
|
+
realWindow.document.documentElement.clientWidth -
|
|
2084
|
+
containingBlockRect.left,
|
|
2085
|
+
bottom:
|
|
2086
|
+
realWindow.document.documentElement.clientHeight -
|
|
2087
|
+
containingBlockRect.top,
|
|
2088
|
+
left: 0 - containingBlockRect.left
|
|
2089
|
+
};
|
|
2090
|
+
} else {
|
|
2091
|
+
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
2092
|
+
boundaries = {
|
|
2093
|
+
top: 0,
|
|
2094
|
+
left: 0,
|
|
2095
|
+
right: boundariesElement.clientWidth,
|
|
2096
|
+
bottom: boundariesElement.clientHeight
|
|
2097
|
+
};
|
|
2098
|
+
} else {
|
|
2099
|
+
boundaries = getOffsetRect(boundariesElement);
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
boundaries.left += padding;
|
|
2103
|
+
boundaries.right -= padding;
|
|
2104
|
+
boundaries.top = boundaries.top + padding;
|
|
2105
|
+
boundaries.bottom = boundaries.bottom - padding;
|
|
2106
|
+
return boundaries;
|
|
2107
|
+
};
|
|
2108
|
+
|
|
2302
2109
|
/**
|
|
2303
2110
|
* Loop trough the list of modifiers and run them in order, each of them will then edit the data object
|
|
2304
2111
|
* @method
|
|
@@ -2307,22 +2114,27 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2307
2114
|
* @param {Object} data
|
|
2308
2115
|
* @param {Array} modifiers
|
|
2309
2116
|
* @param {Function} ends
|
|
2310
|
-
*/
|
|
2311
|
-
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
2312
|
-
var modifiersToRun = modifiers.slice();
|
|
2313
|
-
if (ends !== undefined) {
|
|
2314
|
-
modifiersToRun = this._options.modifiers.slice(
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2117
|
+
*/
|
|
2118
|
+
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
2119
|
+
var modifiersToRun = modifiers.slice();
|
|
2120
|
+
if (ends !== undefined) {
|
|
2121
|
+
modifiersToRun = this._options.modifiers.slice(
|
|
2122
|
+
0,
|
|
2123
|
+
getArrayKeyIndex(this._options.modifiers, ends)
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
modifiersToRun.forEach(
|
|
2128
|
+
function (modifier) {
|
|
2129
|
+
if (isFunction(modifier)) {
|
|
2130
|
+
data = modifier.call(this, data);
|
|
2131
|
+
}
|
|
2132
|
+
}.bind(this)
|
|
2133
|
+
);
|
|
2134
|
+
|
|
2135
|
+
return data;
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2326
2138
|
/**
|
|
2327
2139
|
* Helper used to know if the given modifier depends from another one.
|
|
2328
2140
|
* @method
|
|
@@ -2330,191 +2142,204 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2330
2142
|
* @param {String} requesting - name of requesting modifier
|
|
2331
2143
|
* @param {String} requested - name of requested modifier
|
|
2332
2144
|
* @returns {Boolean}
|
|
2333
|
-
*/
|
|
2334
|
-
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
2335
|
-
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
2336
|
-
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
2337
|
-
return modifier === requested;
|
|
2338
|
-
}).length;
|
|
2339
|
-
};
|
|
2340
|
-
|
|
2341
|
-
//
|
|
2342
|
-
// Modifiers
|
|
2343
|
-
//
|
|
2344
|
-
|
|
2145
|
+
*/
|
|
2146
|
+
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
2147
|
+
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
2148
|
+
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
2149
|
+
return modifier === requested;
|
|
2150
|
+
}).length;
|
|
2151
|
+
};
|
|
2152
|
+
|
|
2153
|
+
//
|
|
2154
|
+
// Modifiers
|
|
2155
|
+
//
|
|
2156
|
+
|
|
2345
2157
|
/**
|
|
2346
2158
|
* Modifiers list
|
|
2347
2159
|
* @namespace Popper.modifiers
|
|
2348
2160
|
* @memberof Popper
|
|
2349
2161
|
* @type {Object}
|
|
2350
|
-
*/
|
|
2351
|
-
Popper.prototype.modifiers = {};
|
|
2352
|
-
|
|
2162
|
+
*/
|
|
2163
|
+
Popper.prototype.modifiers = {};
|
|
2164
|
+
|
|
2353
2165
|
/**
|
|
2354
2166
|
* Apply the computed styles to the popper element
|
|
2355
2167
|
* @method
|
|
2356
2168
|
* @memberof Popper.modifiers
|
|
2357
2169
|
* @argument {Object} data - The data object generated by `update` method
|
|
2358
2170
|
* @returns {Object} The same data object
|
|
2359
|
-
*/
|
|
2360
|
-
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
2361
|
-
// apply the final offsets to the popper
|
|
2362
|
-
// NOTE: 1 DOM access here
|
|
2363
|
-
var styles = {
|
|
2364
|
-
position: data.offsets.popper.position
|
|
2365
|
-
};
|
|
2366
|
-
|
|
2367
|
-
// round top and left to avoid blurry text
|
|
2368
|
-
var left = Math.round(data.offsets.popper.left);
|
|
2369
|
-
var top = Math.round(data.offsets.popper.top);
|
|
2370
|
-
|
|
2371
|
-
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
2372
|
-
// we automatically use the supported prefixed version if needed
|
|
2373
|
-
var prefixedProperty;
|
|
2374
|
-
if (
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
this._popper
|
|
2396
|
-
|
|
2397
|
-
//
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2171
|
+
*/
|
|
2172
|
+
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
2173
|
+
// apply the final offsets to the popper
|
|
2174
|
+
// NOTE: 1 DOM access here
|
|
2175
|
+
var styles = {
|
|
2176
|
+
position: data.offsets.popper.position
|
|
2177
|
+
};
|
|
2178
|
+
|
|
2179
|
+
// round top and left to avoid blurry text
|
|
2180
|
+
var left = Math.round(data.offsets.popper.left);
|
|
2181
|
+
var top = Math.round(data.offsets.popper.top);
|
|
2182
|
+
|
|
2183
|
+
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
2184
|
+
// we automatically use the supported prefixed version if needed
|
|
2185
|
+
var prefixedProperty;
|
|
2186
|
+
if (
|
|
2187
|
+
this._options.gpuAcceleration &&
|
|
2188
|
+
(prefixedProperty = getSupportedPropertyName('transform'))
|
|
2189
|
+
) {
|
|
2190
|
+
styles[prefixedProperty] =
|
|
2191
|
+
'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
2192
|
+
styles.top = 0;
|
|
2193
|
+
styles.left = 0;
|
|
2194
|
+
}
|
|
2195
|
+
// othwerise, we use the standard `left` and `top` properties
|
|
2196
|
+
else {
|
|
2197
|
+
styles.left = left;
|
|
2198
|
+
styles.top = top;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
// any property present in `data.styles` will be applied to the popper,
|
|
2202
|
+
// in this way we can make the 3rd party modifiers add custom styles to it
|
|
2203
|
+
// Be aware, modifiers could override the properties defined in the previous
|
|
2204
|
+
// lines of this modifier!
|
|
2205
|
+
Object.assign(styles, data.styles);
|
|
2206
|
+
|
|
2207
|
+
setStyle(this._popper, styles);
|
|
2208
|
+
|
|
2209
|
+
// set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
|
|
2210
|
+
// NOTE: 1 DOM access here
|
|
2211
|
+
this._popper.setAttribute('x-placement', data.placement);
|
|
2212
|
+
|
|
2213
|
+
// if the arrow modifier is required and the arrow style has been computed, apply the arrow style
|
|
2214
|
+
if (
|
|
2215
|
+
this.isModifierRequired(
|
|
2216
|
+
this.modifiers.applyStyle,
|
|
2217
|
+
this.modifiers.arrow
|
|
2218
|
+
) &&
|
|
2219
|
+
data.offsets.arrow
|
|
2220
|
+
) {
|
|
2221
|
+
setStyle(data.arrowElement, data.offsets.arrow);
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
return data;
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2405
2227
|
/**
|
|
2406
2228
|
* Modifier used to shift the popper on the start or end of its reference element side
|
|
2407
2229
|
* @method
|
|
2408
2230
|
* @memberof Popper.modifiers
|
|
2409
2231
|
* @argument {Object} data - The data object generated by `update` method
|
|
2410
2232
|
* @returns {Object} The data object, properly modified
|
|
2411
|
-
*/
|
|
2412
|
-
Popper.prototype.modifiers.shift = function (data) {
|
|
2413
|
-
var placement = data.placement;
|
|
2414
|
-
var basePlacement = placement.split('-')[0];
|
|
2415
|
-
var shiftVariation = placement.split('-')[1];
|
|
2416
|
-
|
|
2417
|
-
// if shift shiftVariation is specified, run the modifier
|
|
2418
|
-
if (shiftVariation) {
|
|
2419
|
-
var reference = data.offsets.reference;
|
|
2420
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
2421
|
-
|
|
2422
|
-
var shiftOffsets = {
|
|
2423
|
-
y: {
|
|
2424
|
-
start: { top: reference.top },
|
|
2425
|
-
end: { top: reference.top + reference.height - popper.height }
|
|
2426
|
-
},
|
|
2427
|
-
x: {
|
|
2428
|
-
start: { left: reference.left },
|
|
2429
|
-
end: { left: reference.left + reference.width - popper.width }
|
|
2430
|
-
}
|
|
2431
|
-
};
|
|
2432
|
-
|
|
2433
|
-
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
2434
|
-
|
|
2435
|
-
data.offsets.popper = Object.assign(
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2233
|
+
*/
|
|
2234
|
+
Popper.prototype.modifiers.shift = function (data) {
|
|
2235
|
+
var placement = data.placement;
|
|
2236
|
+
var basePlacement = placement.split('-')[0];
|
|
2237
|
+
var shiftVariation = placement.split('-')[1];
|
|
2238
|
+
|
|
2239
|
+
// if shift shiftVariation is specified, run the modifier
|
|
2240
|
+
if (shiftVariation) {
|
|
2241
|
+
var reference = data.offsets.reference;
|
|
2242
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
2243
|
+
|
|
2244
|
+
var shiftOffsets = {
|
|
2245
|
+
y: {
|
|
2246
|
+
start: { top: reference.top },
|
|
2247
|
+
end: { top: reference.top + reference.height - popper.height }
|
|
2248
|
+
},
|
|
2249
|
+
x: {
|
|
2250
|
+
start: { left: reference.left },
|
|
2251
|
+
end: { left: reference.left + reference.width - popper.width }
|
|
2252
|
+
}
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2255
|
+
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
2256
|
+
|
|
2257
|
+
data.offsets.popper = Object.assign(
|
|
2258
|
+
popper,
|
|
2259
|
+
shiftOffsets[axis][shiftVariation]
|
|
2260
|
+
);
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
return data;
|
|
2264
|
+
};
|
|
2265
|
+
|
|
2441
2266
|
/**
|
|
2442
2267
|
* Modifier used to make sure the popper does not overflows from it's boundaries
|
|
2443
2268
|
* @method
|
|
2444
2269
|
* @memberof Popper.modifiers
|
|
2445
2270
|
* @argument {Object} data - The data object generated by `update` method
|
|
2446
2271
|
* @returns {Object} The data object, properly modified
|
|
2447
|
-
*/
|
|
2448
|
-
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
2449
|
-
var order = this._options.preventOverflowOrder;
|
|
2450
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
2451
|
-
|
|
2452
|
-
var check = {
|
|
2453
|
-
left: function
|
|
2454
|
-
var left = popper.left;
|
|
2455
|
-
if (popper.left < data.boundaries.left) {
|
|
2456
|
-
left = Math.max(popper.left, data.boundaries.left);
|
|
2457
|
-
}
|
|
2458
|
-
return { left: left };
|
|
2459
|
-
},
|
|
2460
|
-
right: function
|
|
2461
|
-
var left = popper.left;
|
|
2462
|
-
if (popper.right > data.boundaries.right) {
|
|
2463
|
-
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
2464
|
-
}
|
|
2465
|
-
return { left: left };
|
|
2466
|
-
},
|
|
2467
|
-
top: function
|
|
2468
|
-
var top = popper.top;
|
|
2469
|
-
if (popper.top < data.boundaries.top) {
|
|
2470
|
-
top = Math.max(popper.top, data.boundaries.top);
|
|
2471
|
-
}
|
|
2472
|
-
return { top: top };
|
|
2473
|
-
},
|
|
2474
|
-
bottom: function
|
|
2475
|
-
var top = popper.top;
|
|
2476
|
-
if (popper.bottom > data.boundaries.bottom) {
|
|
2477
|
-
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
2478
|
-
}
|
|
2479
|
-
return { top: top };
|
|
2480
|
-
}
|
|
2481
|
-
};
|
|
2482
|
-
|
|
2483
|
-
order.forEach(function (direction) {
|
|
2484
|
-
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
2485
|
-
});
|
|
2486
|
-
|
|
2487
|
-
return data;
|
|
2488
|
-
};
|
|
2489
|
-
|
|
2272
|
+
*/
|
|
2273
|
+
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
2274
|
+
var order = this._options.preventOverflowOrder;
|
|
2275
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
2276
|
+
|
|
2277
|
+
var check = {
|
|
2278
|
+
left: function () {
|
|
2279
|
+
var left = popper.left;
|
|
2280
|
+
if (popper.left < data.boundaries.left) {
|
|
2281
|
+
left = Math.max(popper.left, data.boundaries.left);
|
|
2282
|
+
}
|
|
2283
|
+
return { left: left };
|
|
2284
|
+
},
|
|
2285
|
+
right: function () {
|
|
2286
|
+
var left = popper.left;
|
|
2287
|
+
if (popper.right > data.boundaries.right) {
|
|
2288
|
+
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
2289
|
+
}
|
|
2290
|
+
return { left: left };
|
|
2291
|
+
},
|
|
2292
|
+
top: function () {
|
|
2293
|
+
var top = popper.top;
|
|
2294
|
+
if (popper.top < data.boundaries.top) {
|
|
2295
|
+
top = Math.max(popper.top, data.boundaries.top);
|
|
2296
|
+
}
|
|
2297
|
+
return { top: top };
|
|
2298
|
+
},
|
|
2299
|
+
bottom: function () {
|
|
2300
|
+
var top = popper.top;
|
|
2301
|
+
if (popper.bottom > data.boundaries.bottom) {
|
|
2302
|
+
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
2303
|
+
}
|
|
2304
|
+
return { top: top };
|
|
2305
|
+
}
|
|
2306
|
+
};
|
|
2307
|
+
|
|
2308
|
+
order.forEach(function (direction) {
|
|
2309
|
+
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
2310
|
+
});
|
|
2311
|
+
|
|
2312
|
+
return data;
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2490
2315
|
/**
|
|
2491
2316
|
* Modifier used to make sure the popper is always near its reference
|
|
2492
2317
|
* @method
|
|
2493
2318
|
* @memberof Popper.modifiers
|
|
2494
2319
|
* @argument {Object} data - The data object generated by _update method
|
|
2495
2320
|
* @returns {Object} The data object, properly modified
|
|
2496
|
-
*/
|
|
2497
|
-
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
2498
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
2499
|
-
var reference = data.offsets.reference;
|
|
2500
|
-
var f = Math.floor;
|
|
2501
|
-
|
|
2502
|
-
if (popper.right < f(reference.left)) {
|
|
2503
|
-
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
2504
|
-
}
|
|
2505
|
-
if (popper.left > f(reference.right)) {
|
|
2506
|
-
data.offsets.popper.left = f(reference.right);
|
|
2507
|
-
}
|
|
2508
|
-
if (popper.bottom < f(reference.top)) {
|
|
2509
|
-
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
2510
|
-
}
|
|
2511
|
-
if (popper.top > f(reference.bottom)) {
|
|
2512
|
-
data.offsets.popper.top = f(reference.bottom);
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
return data;
|
|
2516
|
-
};
|
|
2517
|
-
|
|
2321
|
+
*/
|
|
2322
|
+
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
2323
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
2324
|
+
var reference = data.offsets.reference;
|
|
2325
|
+
var f = Math.floor;
|
|
2326
|
+
|
|
2327
|
+
if (popper.right < f(reference.left)) {
|
|
2328
|
+
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
2329
|
+
}
|
|
2330
|
+
if (popper.left > f(reference.right)) {
|
|
2331
|
+
data.offsets.popper.left = f(reference.right);
|
|
2332
|
+
}
|
|
2333
|
+
if (popper.bottom < f(reference.top)) {
|
|
2334
|
+
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
2335
|
+
}
|
|
2336
|
+
if (popper.top > f(reference.bottom)) {
|
|
2337
|
+
data.offsets.popper.top = f(reference.bottom);
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
return data;
|
|
2341
|
+
};
|
|
2342
|
+
|
|
2518
2343
|
/**
|
|
2519
2344
|
* Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
|
|
2520
2345
|
* Requires the `preventOverflow` modifier before it in order to work.
|
|
@@ -2523,61 +2348,81 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2523
2348
|
* @memberof Popper.modifiers
|
|
2524
2349
|
* @argument {Object} data - The data object generated by _update method
|
|
2525
2350
|
* @returns {Object} The data object, properly modified
|
|
2526
|
-
*/
|
|
2527
|
-
Popper.prototype.modifiers.flip = function (data) {
|
|
2528
|
-
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
2529
|
-
// otherwise flip would not work as expected.
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
flipOrder
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2351
|
+
*/
|
|
2352
|
+
Popper.prototype.modifiers.flip = function (data) {
|
|
2353
|
+
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
2354
|
+
// otherwise flip would not work as expected.
|
|
2355
|
+
if (
|
|
2356
|
+
!this.isModifierRequired(
|
|
2357
|
+
this.modifiers.flip,
|
|
2358
|
+
this.modifiers.preventOverflow
|
|
2359
|
+
)
|
|
2360
|
+
) {
|
|
2361
|
+
console.warn(
|
|
2362
|
+
'WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!'
|
|
2363
|
+
);
|
|
2364
|
+
return data;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
if (data.flipped && data.placement === data._originalPlacement) {
|
|
2368
|
+
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
|
2369
|
+
return data;
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
var placement = data.placement.split('-')[0];
|
|
2373
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
2374
|
+
var variation = data.placement.split('-')[1] || '';
|
|
2375
|
+
|
|
2376
|
+
var flipOrder = [];
|
|
2377
|
+
if (this._options.flipBehavior === 'flip') {
|
|
2378
|
+
flipOrder = [placement, placementOpposite];
|
|
2379
|
+
} else {
|
|
2380
|
+
flipOrder = this._options.flipBehavior;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
flipOrder.forEach(
|
|
2384
|
+
function (step, index) {
|
|
2385
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
2386
|
+
return;
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
placement = data.placement.split('-')[0];
|
|
2390
|
+
placementOpposite = getOppositePlacement(placement);
|
|
2391
|
+
|
|
2392
|
+
var popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
2393
|
+
|
|
2394
|
+
// this boolean is used to distinguish right and bottom from top and left
|
|
2395
|
+
// they need different computations to get flipped
|
|
2396
|
+
var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
|
2397
|
+
|
|
2398
|
+
// using Math.floor because the reference offsets may contain decimals we are not going to consider here
|
|
2399
|
+
if (
|
|
2400
|
+
(a &&
|
|
2401
|
+
Math.floor(data.offsets.reference[placement]) >
|
|
2402
|
+
Math.floor(popperOffsets[placementOpposite])) ||
|
|
2403
|
+
(!a &&
|
|
2404
|
+
Math.floor(data.offsets.reference[placement]) <
|
|
2405
|
+
Math.floor(popperOffsets[placementOpposite]))
|
|
2406
|
+
) {
|
|
2407
|
+
// we'll use this boolean to detect any flip loop
|
|
2408
|
+
data.flipped = true;
|
|
2409
|
+
data.placement = flipOrder[index + 1];
|
|
2410
|
+
if (variation) {
|
|
2411
|
+
data.placement += '-' + variation;
|
|
2412
|
+
}
|
|
2413
|
+
data.offsets.popper = this._getOffsets(
|
|
2414
|
+
this._popper,
|
|
2415
|
+
this._reference,
|
|
2416
|
+
data.placement
|
|
2417
|
+
).popper;
|
|
2418
|
+
|
|
2419
|
+
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
2420
|
+
}
|
|
2421
|
+
}.bind(this)
|
|
2422
|
+
);
|
|
2423
|
+
return data;
|
|
2424
|
+
};
|
|
2425
|
+
|
|
2581
2426
|
/**
|
|
2582
2427
|
* Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
|
|
2583
2428
|
* The offsets will shift the popper on the side of its reference element.
|
|
@@ -2585,23 +2430,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2585
2430
|
* @memberof Popper.modifiers
|
|
2586
2431
|
* @argument {Object} data - The data object generated by _update method
|
|
2587
2432
|
* @returns {Object} The data object, properly modified
|
|
2588
|
-
*/
|
|
2589
|
-
Popper.prototype.modifiers.offset = function (data) {
|
|
2590
|
-
var offset = this._options.offset;
|
|
2591
|
-
var popper = data.offsets.popper;
|
|
2592
|
-
|
|
2593
|
-
if (data.placement.indexOf('left') !== -1) {
|
|
2594
|
-
popper.top -= offset;
|
|
2595
|
-
} else if (data.placement.indexOf('right') !== -1) {
|
|
2596
|
-
popper.top += offset;
|
|
2597
|
-
} else if (data.placement.indexOf('top') !== -1) {
|
|
2598
|
-
popper.left -= offset;
|
|
2599
|
-
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
2600
|
-
popper.left += offset;
|
|
2601
|
-
}
|
|
2602
|
-
return data;
|
|
2603
|
-
};
|
|
2604
|
-
|
|
2433
|
+
*/
|
|
2434
|
+
Popper.prototype.modifiers.offset = function (data) {
|
|
2435
|
+
var offset = this._options.offset;
|
|
2436
|
+
var popper = data.offsets.popper;
|
|
2437
|
+
|
|
2438
|
+
if (data.placement.indexOf('left') !== -1) {
|
|
2439
|
+
popper.top -= offset;
|
|
2440
|
+
} else if (data.placement.indexOf('right') !== -1) {
|
|
2441
|
+
popper.top += offset;
|
|
2442
|
+
} else if (data.placement.indexOf('top') !== -1) {
|
|
2443
|
+
popper.left -= offset;
|
|
2444
|
+
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
2445
|
+
popper.left += offset;
|
|
2446
|
+
}
|
|
2447
|
+
return data;
|
|
2448
|
+
};
|
|
2449
|
+
|
|
2605
2450
|
/**
|
|
2606
2451
|
* Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
|
|
2607
2452
|
* It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
|
|
@@ -2609,136 +2454,147 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2609
2454
|
* @memberof Popper.modifiers
|
|
2610
2455
|
* @argument {Object} data - The data object generated by _update method
|
|
2611
2456
|
* @returns {Object} The data object, properly modified
|
|
2612
|
-
*/
|
|
2613
|
-
Popper.prototype.modifiers.arrow = function (data) {
|
|
2614
|
-
var arrow = this._options.arrowElement;
|
|
2615
|
-
var arrowOffset = this._options.arrowOffset;
|
|
2616
|
-
|
|
2617
|
-
// if the arrowElement is a string, suppose it's a CSS selector
|
|
2618
|
-
if (typeof arrow === 'string') {
|
|
2619
|
-
arrow = this._popper.querySelector(arrow);
|
|
2620
|
-
}
|
|
2621
|
-
|
|
2622
|
-
// if arrow element is not found, don't run the modifier
|
|
2623
|
-
if (!arrow) {
|
|
2624
|
-
return data;
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
// the arrow element must be child of its popper
|
|
2628
|
-
if (!this._popper.contains(arrow)) {
|
|
2629
|
-
console.warn(
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
var
|
|
2649
|
-
var
|
|
2650
|
-
var
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
//
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
//
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2457
|
+
*/
|
|
2458
|
+
Popper.prototype.modifiers.arrow = function (data) {
|
|
2459
|
+
var arrow = this._options.arrowElement;
|
|
2460
|
+
var arrowOffset = this._options.arrowOffset;
|
|
2461
|
+
|
|
2462
|
+
// if the arrowElement is a string, suppose it's a CSS selector
|
|
2463
|
+
if (typeof arrow === 'string') {
|
|
2464
|
+
arrow = this._popper.querySelector(arrow);
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
// if arrow element is not found, don't run the modifier
|
|
2468
|
+
if (!arrow) {
|
|
2469
|
+
return data;
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
// the arrow element must be child of its popper
|
|
2473
|
+
if (!this._popper.contains(arrow)) {
|
|
2474
|
+
console.warn(
|
|
2475
|
+
'WARNING: `arrowElement` must be child of its popper element!'
|
|
2476
|
+
);
|
|
2477
|
+
return data;
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
// arrow depends on keepTogether in order to work
|
|
2481
|
+
if (
|
|
2482
|
+
!this.isModifierRequired(
|
|
2483
|
+
this.modifiers.arrow,
|
|
2484
|
+
this.modifiers.keepTogether
|
|
2485
|
+
)
|
|
2486
|
+
) {
|
|
2487
|
+
console.warn(
|
|
2488
|
+
'WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!'
|
|
2489
|
+
);
|
|
2490
|
+
return data;
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
var arrowStyle = {};
|
|
2494
|
+
var placement = data.placement.split('-')[0];
|
|
2495
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
2496
|
+
var reference = data.offsets.reference;
|
|
2497
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
2498
|
+
|
|
2499
|
+
var len = isVertical ? 'height' : 'width';
|
|
2500
|
+
var side = isVertical ? 'top' : 'left';
|
|
2501
|
+
var translate = isVertical ? 'translateY' : 'translateX';
|
|
2502
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
2503
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
2504
|
+
var arrowSize = getOuterSizes(arrow)[len];
|
|
2505
|
+
|
|
2506
|
+
//
|
|
2507
|
+
// extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
|
|
2508
|
+
//
|
|
2509
|
+
|
|
2510
|
+
// top/left side
|
|
2511
|
+
if (reference[opSide] - arrowSize < popper[side]) {
|
|
2512
|
+
data.offsets.popper[side] -=
|
|
2513
|
+
popper[side] - (reference[opSide] - arrowSize);
|
|
2514
|
+
}
|
|
2515
|
+
// bottom/right side
|
|
2516
|
+
if (reference[side] + arrowSize > popper[opSide]) {
|
|
2517
|
+
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
// compute center of the popper
|
|
2521
|
+
var center =
|
|
2522
|
+
reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
|
2523
|
+
|
|
2524
|
+
var sideValue = center - popper[side];
|
|
2525
|
+
|
|
2526
|
+
// prevent arrow from being placed not contiguously to its popper
|
|
2527
|
+
sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
|
2528
|
+
arrowStyle[side] = sideValue;
|
|
2529
|
+
arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
|
|
2530
|
+
|
|
2531
|
+
data.offsets.arrow = arrowStyle;
|
|
2532
|
+
data.arrowElement = arrow;
|
|
2533
|
+
|
|
2534
|
+
return data;
|
|
2535
|
+
};
|
|
2536
|
+
|
|
2537
|
+
//
|
|
2538
|
+
// Helpers
|
|
2539
|
+
//
|
|
2540
|
+
|
|
2685
2541
|
/**
|
|
2686
2542
|
* Get the outer sizes of the given element (offset size + margins)
|
|
2687
2543
|
* @function
|
|
2688
2544
|
* @ignore
|
|
2689
2545
|
* @argument {Element} element
|
|
2690
2546
|
* @returns {Object} object containing width and height properties
|
|
2691
|
-
*/
|
|
2692
|
-
function getOuterSizes(element) {
|
|
2693
|
-
// NOTE: 1 DOM access here
|
|
2694
|
-
var _display = element.style.display,
|
|
2695
|
-
|
|
2696
|
-
element.style.display = 'block';
|
|
2697
|
-
element.style.visibility = 'hidden';
|
|
2698
|
-
var calcWidthToForceRepaint = element.offsetWidth;
|
|
2699
|
-
// original method
|
|
2700
|
-
var styles = getRealWindow(element).getComputedStyle(element);
|
|
2701
|
-
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
2702
|
-
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
2703
|
-
var result = {
|
|
2704
|
-
width: element.offsetWidth + y,
|
|
2705
|
-
height: element.offsetHeight + x
|
|
2706
|
-
};
|
|
2707
|
-
|
|
2708
|
-
// reset element styles
|
|
2709
|
-
element.style.display = _display;
|
|
2710
|
-
element.style.visibility = _visibility;
|
|
2711
|
-
return result;
|
|
2712
|
-
}
|
|
2713
|
-
|
|
2547
|
+
*/
|
|
2548
|
+
function getOuterSizes(element) {
|
|
2549
|
+
// NOTE: 1 DOM access here
|
|
2550
|
+
var _display = element.style.display,
|
|
2551
|
+
_visibility = element.style.visibility;
|
|
2552
|
+
element.style.display = 'block';
|
|
2553
|
+
element.style.visibility = 'hidden';
|
|
2554
|
+
var calcWidthToForceRepaint = element.offsetWidth;
|
|
2555
|
+
// original method
|
|
2556
|
+
var styles = getRealWindow(element).getComputedStyle(element);
|
|
2557
|
+
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
2558
|
+
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
2559
|
+
var result = {
|
|
2560
|
+
width: element.offsetWidth + y,
|
|
2561
|
+
height: element.offsetHeight + x
|
|
2562
|
+
};
|
|
2563
|
+
|
|
2564
|
+
// reset element styles
|
|
2565
|
+
element.style.display = _display;
|
|
2566
|
+
element.style.visibility = _visibility;
|
|
2567
|
+
return result;
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2714
2570
|
/**
|
|
2715
2571
|
* Get the opposite placement of the given one/
|
|
2716
2572
|
* @function
|
|
2717
2573
|
* @ignore
|
|
2718
2574
|
* @argument {String} placement
|
|
2719
2575
|
* @returns {String} flipped placement
|
|
2720
|
-
*/
|
|
2721
|
-
function getOppositePlacement(placement) {
|
|
2722
|
-
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
2723
|
-
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
2724
|
-
return hash[matched];
|
|
2725
|
-
});
|
|
2726
|
-
}
|
|
2727
|
-
|
|
2576
|
+
*/
|
|
2577
|
+
function getOppositePlacement(placement) {
|
|
2578
|
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
2579
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
2580
|
+
return hash[matched];
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2728
2584
|
/**
|
|
2729
2585
|
* Given the popper offsets, generate an output similar to getBoundingClientRect
|
|
2730
2586
|
* @function
|
|
2731
2587
|
* @ignore
|
|
2732
2588
|
* @argument {Object} popperOffsets
|
|
2733
2589
|
* @returns {Object} ClientRect like output
|
|
2734
|
-
*/
|
|
2735
|
-
function getPopperClientRect(popperOffsets) {
|
|
2736
|
-
var offsets = Object.assign({}, popperOffsets);
|
|
2737
|
-
offsets.right = offsets.left + offsets.width;
|
|
2738
|
-
offsets.bottom = offsets.top + offsets.height;
|
|
2739
|
-
return offsets;
|
|
2740
|
-
}
|
|
2741
|
-
|
|
2590
|
+
*/
|
|
2591
|
+
function getPopperClientRect(popperOffsets) {
|
|
2592
|
+
var offsets = Object.assign({}, popperOffsets);
|
|
2593
|
+
offsets.right = offsets.left + offsets.width;
|
|
2594
|
+
offsets.bottom = offsets.top + offsets.height;
|
|
2595
|
+
return offsets;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2742
2598
|
/**
|
|
2743
2599
|
* Given an array and the key to find, returns its index
|
|
2744
2600
|
* @function
|
|
@@ -2746,46 +2602,48 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2746
2602
|
* @argument {Array} arr
|
|
2747
2603
|
* @argument keyToFind
|
|
2748
2604
|
* @returns index or null
|
|
2749
|
-
*/
|
|
2750
|
-
function getArrayKeyIndex(arr, keyToFind) {
|
|
2751
|
-
var i = 0,
|
|
2752
|
-
|
|
2753
|
-
for (key in arr) {
|
|
2754
|
-
if (arr[key] === keyToFind) {
|
|
2755
|
-
return i;
|
|
2756
|
-
}
|
|
2757
|
-
i++;
|
|
2758
|
-
}
|
|
2759
|
-
return null;
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2605
|
+
*/
|
|
2606
|
+
function getArrayKeyIndex(arr, keyToFind) {
|
|
2607
|
+
var i = 0,
|
|
2608
|
+
key;
|
|
2609
|
+
for (key in arr) {
|
|
2610
|
+
if (arr[key] === keyToFind) {
|
|
2611
|
+
return i;
|
|
2612
|
+
}
|
|
2613
|
+
i++;
|
|
2614
|
+
}
|
|
2615
|
+
return null;
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2762
2618
|
/**
|
|
2763
2619
|
* Get CSS computed property of the given element
|
|
2764
2620
|
* @function
|
|
2765
2621
|
* @ignore
|
|
2766
2622
|
* @argument {Eement} element
|
|
2767
2623
|
* @argument {String} property
|
|
2768
|
-
*/
|
|
2769
|
-
function getStyleComputedProperty(element, property) {
|
|
2770
|
-
// NOTE: 1 DOM access here
|
|
2771
|
-
// 无界等微前端场景下沙箱 window 与元素实际渲染所在 window 可能不一致,
|
|
2772
|
-
// 需使用元素自身的 view 读取计算样式,避免跨 document 读取到空值
|
|
2773
|
-
var css = getRealWindow(element).getComputedStyle(element, null);
|
|
2774
|
-
return css[property];
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2624
|
+
*/
|
|
2625
|
+
function getStyleComputedProperty(element, property) {
|
|
2626
|
+
// NOTE: 1 DOM access here
|
|
2627
|
+
// 无界等微前端场景下沙箱 window 与元素实际渲染所在 window 可能不一致,
|
|
2628
|
+
// 需使用元素自身的 view 读取计算样式,避免跨 document 读取到空值
|
|
2629
|
+
var css = getRealWindow(element).getComputedStyle(element, null);
|
|
2630
|
+
return css[property];
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2777
2633
|
/**
|
|
2778
2634
|
* Returns the offset parent of the given element
|
|
2779
2635
|
* @function
|
|
2780
2636
|
* @ignore
|
|
2781
2637
|
* @argument {Element} element
|
|
2782
2638
|
* @returns {Element} offset parent
|
|
2783
|
-
*/
|
|
2784
|
-
function getOffsetParent(element) {
|
|
2785
|
-
var offsetParent = element.offsetParent;
|
|
2786
|
-
return offsetParent === root.document.body || !offsetParent
|
|
2787
|
-
|
|
2788
|
-
|
|
2639
|
+
*/
|
|
2640
|
+
function getOffsetParent(element) {
|
|
2641
|
+
var offsetParent = element.offsetParent;
|
|
2642
|
+
return offsetParent === root.document.body || !offsetParent
|
|
2643
|
+
? root.document.documentElement
|
|
2644
|
+
: offsetParent;
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2789
2647
|
/**
|
|
2790
2648
|
* Returns the window the given element actually renders in.
|
|
2791
2649
|
* 无界等微前端场景下组件代码运行在沙箱 window 中,而 DOM 实际渲染在
|
|
@@ -2794,11 +2652,16 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2794
2652
|
* @ignore
|
|
2795
2653
|
* @argument {Element} element
|
|
2796
2654
|
* @returns {Window} window
|
|
2797
|
-
*/
|
|
2798
|
-
function getRealWindow(element) {
|
|
2799
|
-
return
|
|
2800
|
-
|
|
2801
|
-
|
|
2655
|
+
*/
|
|
2656
|
+
function getRealWindow(element) {
|
|
2657
|
+
return (
|
|
2658
|
+
(element &&
|
|
2659
|
+
element.ownerDocument &&
|
|
2660
|
+
element.ownerDocument.defaultView) ||
|
|
2661
|
+
root
|
|
2662
|
+
);
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2802
2665
|
/**
|
|
2803
2666
|
* Returns the viewport rect of the containing block actually used to position the popper.
|
|
2804
2667
|
* 无界微前端等场景下 popper 被挂载进子应用的 shadowRoot,offsetParent 的兜底值
|
|
@@ -2812,277 +2675,564 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2812
2675
|
* @argument {Element} element - popper element
|
|
2813
2676
|
* @argument {Boolean} fixed - whether the popper is fixed positioned
|
|
2814
2677
|
* @returns {Object} rect
|
|
2815
|
-
*/
|
|
2816
|
-
function getContainingBlockRect(element, fixed) {
|
|
2817
|
-
if (fixed) {
|
|
2818
|
-
return { top: 0, left: 0, right: 0, bottom: 0 };
|
|
2819
|
-
}
|
|
2678
|
+
*/
|
|
2679
|
+
function getContainingBlockRect(element, fixed) {
|
|
2680
|
+
if (fixed) {
|
|
2681
|
+
return { top: 0, left: 0, right: 0, bottom: 0 };
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
var node = element.parentNode;
|
|
2685
|
+
while (node) {
|
|
2686
|
+
if (node.nodeType === 1) {
|
|
2687
|
+
if (getStyleComputedProperty(node, 'position') !== 'static') {
|
|
2688
|
+
return getBoundingClientRect(node);
|
|
2689
|
+
}
|
|
2690
|
+
} else if (node.nodeType === 11) {
|
|
2691
|
+
// 遇到 shadowRoot,跨边界从宿主元素继续向上查找
|
|
2692
|
+
node = node.host;
|
|
2693
|
+
continue;
|
|
2694
|
+
} else {
|
|
2695
|
+
break;
|
|
2696
|
+
}
|
|
2697
|
+
node = node.parentNode;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
var win = getRealWindow(element);
|
|
2701
|
+
return {
|
|
2702
|
+
top: -(win.pageYOffset || 0),
|
|
2703
|
+
left: -(win.pageXOffset || 0),
|
|
2704
|
+
right: 0,
|
|
2705
|
+
bottom: 0
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
/**
|
|
2710
|
+
* Returns the scrolling parent of the given element
|
|
2711
|
+
* @function
|
|
2712
|
+
* @ignore
|
|
2713
|
+
* @argument {Element} element
|
|
2714
|
+
* @returns {Element} offset parent
|
|
2715
|
+
*/
|
|
2716
|
+
function getScrollParent(element) {
|
|
2717
|
+
var parent = element.parentNode;
|
|
2718
|
+
if (!parent) {
|
|
2719
|
+
return element;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
if (parent.nodeType === 11) {
|
|
2723
|
+
// 无界等微前端场景 DOM 位于 shadowRoot 内,需跨边界从宿主元素继续向上查找,
|
|
2724
|
+
// 否则查找到 shadowRoot 即终止,滚动事件无法被监听
|
|
2725
|
+
return getScrollParent(parent.host);
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
if (parent.nodeType !== 1) {
|
|
2729
|
+
// 到达 document,返回元素实际渲染所在的真实 window,
|
|
2730
|
+
// 保证 window 滚动时能触发位置更新
|
|
2731
|
+
return getRealWindow(element);
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
// Firefox want us to check `-x` and `-y` variations as well
|
|
2735
|
+
if (
|
|
2736
|
+
['scroll', 'auto'].indexOf(
|
|
2737
|
+
getStyleComputedProperty(parent, 'overflow')
|
|
2738
|
+
) !== -1 ||
|
|
2739
|
+
['scroll', 'auto'].indexOf(
|
|
2740
|
+
getStyleComputedProperty(parent, 'overflow-x')
|
|
2741
|
+
) !== -1 ||
|
|
2742
|
+
['scroll', 'auto'].indexOf(
|
|
2743
|
+
getStyleComputedProperty(parent, 'overflow-y')
|
|
2744
|
+
) !== -1
|
|
2745
|
+
) {
|
|
2746
|
+
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
|
2747
|
+
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
|
2748
|
+
// fixes issue #65
|
|
2749
|
+
return parent;
|
|
2750
|
+
}
|
|
2751
|
+
return getScrollParent(parent);
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
/**
|
|
2755
|
+
* Check if the given element is fixed or is inside a fixed parent
|
|
2756
|
+
* @function
|
|
2757
|
+
* @ignore
|
|
2758
|
+
* @argument {Element} element
|
|
2759
|
+
* @argument {Element} customContainer
|
|
2760
|
+
* @returns {Boolean} answer to "isFixed?"
|
|
2761
|
+
*/
|
|
2762
|
+
function isFixed(element) {
|
|
2763
|
+
if (element === root.document.body) {
|
|
2764
|
+
return false;
|
|
2765
|
+
}
|
|
2766
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
2767
|
+
return true;
|
|
2768
|
+
}
|
|
2769
|
+
var parent = element.parentNode;
|
|
2770
|
+
if (parent && parent.nodeType === 11) {
|
|
2771
|
+
// 跨 shadowRoot 边界,从宿主元素继续向上判断
|
|
2772
|
+
parent = parent.host;
|
|
2773
|
+
}
|
|
2774
|
+
return parent && parent.nodeType === 1 ? isFixed(parent) : false;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
/**
|
|
2778
|
+
* Set the style to the given popper
|
|
2779
|
+
* @function
|
|
2780
|
+
* @ignore
|
|
2781
|
+
* @argument {Element} element - Element to apply the style to
|
|
2782
|
+
* @argument {Object} styles - Object with a list of properties and values which will be applied to the element
|
|
2783
|
+
*/
|
|
2784
|
+
function setStyle(element, styles) {
|
|
2785
|
+
function is_numeric(n) {
|
|
2786
|
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
2787
|
+
}
|
|
2788
|
+
Object.keys(styles).forEach(function (prop) {
|
|
2789
|
+
var unit = '';
|
|
2790
|
+
// add unit if the value is numeric and is one of the following
|
|
2791
|
+
if (
|
|
2792
|
+
['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==
|
|
2793
|
+
-1 &&
|
|
2794
|
+
is_numeric(styles[prop])
|
|
2795
|
+
) {
|
|
2796
|
+
unit = 'px';
|
|
2797
|
+
}
|
|
2798
|
+
element.style[prop] = styles[prop] + unit;
|
|
2799
|
+
});
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
/**
|
|
2803
|
+
* Check if the given variable is a function
|
|
2804
|
+
* @function
|
|
2805
|
+
* @ignore
|
|
2806
|
+
* @argument {*} functionToCheck - variable to check
|
|
2807
|
+
* @returns {Boolean} answer to: is a function?
|
|
2808
|
+
*/
|
|
2809
|
+
function isFunction(functionToCheck) {
|
|
2810
|
+
var getType = {};
|
|
2811
|
+
return (
|
|
2812
|
+
functionToCheck &&
|
|
2813
|
+
getType.toString.call(functionToCheck) === '[object Function]'
|
|
2814
|
+
);
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
/**
|
|
2818
|
+
* Get the position of the given element, relative to its offset parent
|
|
2819
|
+
* @function
|
|
2820
|
+
* @ignore
|
|
2821
|
+
* @param {Element} element
|
|
2822
|
+
* @return {Object} position - Coordinates of the element and its `scrollTop`
|
|
2823
|
+
*/
|
|
2824
|
+
function getOffsetRect(element) {
|
|
2825
|
+
var transform = getStyle(element, 'transform')
|
|
2826
|
+
.replace(/[^0-9\-,]/g, '')
|
|
2827
|
+
.split(',');
|
|
2828
|
+
var elementRect = {
|
|
2829
|
+
width: element.offsetWidth,
|
|
2830
|
+
height: element.offsetHeight,
|
|
2831
|
+
left:
|
|
2832
|
+
element.offsetLeft + (transform[4] ? parseInt(transform[4], 10) : 0),
|
|
2833
|
+
top: element.offsetTop + (transform[5] ? parseInt(transform[5], 10) : 0)
|
|
2834
|
+
};
|
|
2835
|
+
|
|
2836
|
+
elementRect.right = elementRect.left + elementRect.width;
|
|
2837
|
+
elementRect.bottom = elementRect.top + elementRect.height;
|
|
2838
|
+
|
|
2839
|
+
// position
|
|
2840
|
+
return elementRect;
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
/**
|
|
2844
|
+
* Get bounding client rect of given element
|
|
2845
|
+
* @function
|
|
2846
|
+
* @ignore
|
|
2847
|
+
* @param {HTMLElement} element
|
|
2848
|
+
* @return {Object} client rect
|
|
2849
|
+
*/
|
|
2850
|
+
function getBoundingClientRect(element) {
|
|
2851
|
+
var rect = element.getBoundingClientRect();
|
|
2852
|
+
|
|
2853
|
+
// whether the IE version is lower than 11
|
|
2854
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
2855
|
+
|
|
2856
|
+
// fix ie document bounding top always 0 bug
|
|
2857
|
+
var rectTop =
|
|
2858
|
+
isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
|
|
2859
|
+
|
|
2860
|
+
return {
|
|
2861
|
+
left: rect.left,
|
|
2862
|
+
top: rectTop,
|
|
2863
|
+
right: rect.right,
|
|
2864
|
+
bottom: rect.bottom,
|
|
2865
|
+
width: rect.right - rect.left,
|
|
2866
|
+
height: rect.bottom - rectTop
|
|
2867
|
+
};
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
function getStyle(dom, attr) {
|
|
2871
|
+
if (dom.style[attr]) {
|
|
2872
|
+
return dom.style[attr];
|
|
2873
|
+
}
|
|
2874
|
+
if (window.getComputedStyle) {
|
|
2875
|
+
return getComputedStyle(dom, null)[attr];
|
|
2876
|
+
}
|
|
2877
|
+
return dom.currentStyle[attr];
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* Given an element and one of its parents, return the offset
|
|
2882
|
+
* @function
|
|
2883
|
+
* @ignore
|
|
2884
|
+
* @param {HTMLElement} element
|
|
2885
|
+
* @param {HTMLElement} parent
|
|
2886
|
+
* @return {Object} rect
|
|
2887
|
+
*/
|
|
2888
|
+
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
2889
|
+
var elementRect = getBoundingClientRect(element);
|
|
2890
|
+
// parent 为 popper 元素:取其真实包含块的视口 rect,
|
|
2891
|
+
// 避免无界 shadowRoot 等场景下包含块假设错误导致的整体偏移
|
|
2892
|
+
var parentRect = getContainingBlockRect(parent, fixed);
|
|
2893
|
+
|
|
2894
|
+
var rect = {
|
|
2895
|
+
top: elementRect.top - parentRect.top,
|
|
2896
|
+
left: elementRect.left - parentRect.left,
|
|
2897
|
+
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
2898
|
+
right: elementRect.left - parentRect.left + elementRect.width,
|
|
2899
|
+
width: elementRect.width,
|
|
2900
|
+
height: elementRect.height
|
|
2901
|
+
};
|
|
2902
|
+
return rect;
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
/**
|
|
2906
|
+
* Get the prefixed supported property name
|
|
2907
|
+
* @function
|
|
2908
|
+
* @ignore
|
|
2909
|
+
* @argument {String} property (camelCase)
|
|
2910
|
+
* @returns {String} prefixed property (camelCase)
|
|
2911
|
+
*/
|
|
2912
|
+
function getSupportedPropertyName(property) {
|
|
2913
|
+
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
2914
|
+
|
|
2915
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
2916
|
+
var toCheck = prefixes[i]
|
|
2917
|
+
? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1)
|
|
2918
|
+
: property;
|
|
2919
|
+
if (typeof root.document.body.style[toCheck] !== 'undefined') {
|
|
2920
|
+
return toCheck;
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
return null;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
/**
|
|
2927
|
+
* The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
|
|
2928
|
+
* objects to a target object. It will return the target object.
|
|
2929
|
+
* This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
|
|
2930
|
+
* Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
2931
|
+
* @function
|
|
2932
|
+
* @ignore
|
|
2933
|
+
*/
|
|
2934
|
+
if (!Object.assign) {
|
|
2935
|
+
Object.defineProperty(Object, 'assign', {
|
|
2936
|
+
enumerable: false,
|
|
2937
|
+
configurable: true,
|
|
2938
|
+
writable: true,
|
|
2939
|
+
value: function (target) {
|
|
2940
|
+
if (target === undefined || target === null) {
|
|
2941
|
+
throw new TypeError('Cannot convert first argument to object');
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
var to = Object(target);
|
|
2945
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2946
|
+
var nextSource = arguments[i];
|
|
2947
|
+
if (nextSource === undefined || nextSource === null) {
|
|
2948
|
+
continue;
|
|
2949
|
+
}
|
|
2950
|
+
nextSource = Object(nextSource);
|
|
2951
|
+
|
|
2952
|
+
var keysArray = Object.keys(nextSource);
|
|
2953
|
+
for (
|
|
2954
|
+
var nextIndex = 0, len = keysArray.length;
|
|
2955
|
+
nextIndex < len;
|
|
2956
|
+
nextIndex++
|
|
2957
|
+
) {
|
|
2958
|
+
var nextKey = keysArray[nextIndex];
|
|
2959
|
+
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
2960
|
+
if (desc !== undefined && desc.enumerable) {
|
|
2961
|
+
to[nextKey] = nextSource[nextKey];
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
return to;
|
|
2966
|
+
}
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
|
|
2970
|
+
return Popper;
|
|
2971
|
+
});
|
|
2820
2972
|
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2973
|
+
|
|
2974
|
+
/***/ }),
|
|
2975
|
+
|
|
2976
|
+
/***/ 6:
|
|
2977
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2978
|
+
|
|
2979
|
+
"use strict";
|
|
2980
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
|
|
2981
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
|
|
2982
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
|
|
2983
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
|
|
2984
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
|
|
2985
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
|
|
2986
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
|
|
2987
|
+
/* unused harmony export setStyle */
|
|
2988
|
+
/* unused harmony export isScroll */
|
|
2989
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
|
|
2990
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
|
|
2991
|
+
/* unused harmony export insertAfter */
|
|
2992
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
2993
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
2994
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2995
|
+
|
|
2996
|
+
/* istanbul ignore next */
|
|
2997
|
+
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
|
|
3001
|
+
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
3002
|
+
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
3003
|
+
var ieVersion = isServer ? 0 : Number(document.documentMode);
|
|
3004
|
+
|
|
3005
|
+
/* istanbul ignore next */
|
|
3006
|
+
var trim = function trim(string) {
|
|
3007
|
+
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
|
3008
|
+
};
|
|
3009
|
+
/* istanbul ignore next */
|
|
3010
|
+
var camelCase = function camelCase(name) {
|
|
3011
|
+
return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
|
3012
|
+
return offset ? letter.toUpperCase() : letter;
|
|
3013
|
+
}).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
|
3014
|
+
};
|
|
3015
|
+
|
|
3016
|
+
/* istanbul ignore next */
|
|
3017
|
+
var on = function () {
|
|
3018
|
+
if (!isServer && document.addEventListener) {
|
|
3019
|
+
return function (element, event, handler) {
|
|
3020
|
+
if (element && event && handler) {
|
|
3021
|
+
element.addEventListener(event, handler, false);
|
|
3022
|
+
}
|
|
3023
|
+
};
|
|
3024
|
+
} else {
|
|
3025
|
+
return function (element, event, handler) {
|
|
3026
|
+
if (element && event && handler) {
|
|
3027
|
+
element.attachEvent('on' + event, handler);
|
|
2833
3028
|
}
|
|
2834
|
-
|
|
2835
|
-
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
}();
|
|
2836
3032
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
3033
|
+
/* istanbul ignore next */
|
|
3034
|
+
var off = function () {
|
|
3035
|
+
if (!isServer && document.removeEventListener) {
|
|
3036
|
+
return function (element, event, handler) {
|
|
3037
|
+
if (element && event) {
|
|
3038
|
+
element.removeEventListener(event, handler, false);
|
|
3039
|
+
}
|
|
3040
|
+
};
|
|
3041
|
+
} else {
|
|
3042
|
+
return function (element, event, handler) {
|
|
3043
|
+
if (element && event) {
|
|
3044
|
+
element.detachEvent('on' + event, handler);
|
|
3045
|
+
}
|
|
2843
3046
|
};
|
|
2844
3047
|
}
|
|
3048
|
+
}();
|
|
2845
3049
|
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
* @returns {Element} offset parent
|
|
2852
|
-
*/
|
|
2853
|
-
function getScrollParent(element) {
|
|
2854
|
-
var parent = element.parentNode;
|
|
2855
|
-
if (!parent) {
|
|
2856
|
-
return element;
|
|
3050
|
+
/* istanbul ignore next */
|
|
3051
|
+
var once = function once(el, event, fn) {
|
|
3052
|
+
var listener = function listener() {
|
|
3053
|
+
if (fn) {
|
|
3054
|
+
fn.apply(this, arguments);
|
|
2857
3055
|
}
|
|
3056
|
+
off(el, event, listener);
|
|
3057
|
+
};
|
|
3058
|
+
on(el, event, listener);
|
|
3059
|
+
};
|
|
2858
3060
|
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
3061
|
+
/* istanbul ignore next */
|
|
3062
|
+
function hasClass(el, cls) {
|
|
3063
|
+
if (!el || !cls) return false;
|
|
3064
|
+
if (cls.indexOf(' ') !== -1) {
|
|
3065
|
+
throw new Error('className should not contain space.');
|
|
3066
|
+
}
|
|
3067
|
+
if (el.classList) {
|
|
3068
|
+
return el.classList.contains(cls);
|
|
3069
|
+
} else {
|
|
3070
|
+
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
2864
3073
|
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
3074
|
+
/* istanbul ignore next */
|
|
3075
|
+
function addClass(el, cls) {
|
|
3076
|
+
if (!el) return;
|
|
3077
|
+
var curClass = el.className;
|
|
3078
|
+
var classes = (cls || '').split(' ');
|
|
2870
3079
|
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
3080
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
3081
|
+
var clsName = classes[i];
|
|
3082
|
+
if (!clsName) continue;
|
|
3083
|
+
|
|
3084
|
+
if (el.classList) {
|
|
3085
|
+
el.classList.add(clsName);
|
|
3086
|
+
} else if (!hasClass(el, clsName)) {
|
|
3087
|
+
curClass += ' ' + clsName;
|
|
2877
3088
|
}
|
|
2878
|
-
return getScrollParent(parent);
|
|
2879
3089
|
}
|
|
3090
|
+
if (!el.classList) {
|
|
3091
|
+
el.className = curClass;
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
2880
3094
|
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
if (
|
|
2894
|
-
|
|
2895
|
-
}
|
|
2896
|
-
var parent = element.parentNode;
|
|
2897
|
-
if (parent && parent.nodeType === 11) {
|
|
2898
|
-
// 跨 shadowRoot 边界,从宿主元素继续向上判断
|
|
2899
|
-
parent = parent.host;
|
|
3095
|
+
/* istanbul ignore next */
|
|
3096
|
+
function removeClass(el, cls) {
|
|
3097
|
+
if (!el || !cls) return;
|
|
3098
|
+
var classes = cls.split(' ');
|
|
3099
|
+
var curClass = ' ' + el.className + ' ';
|
|
3100
|
+
|
|
3101
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
3102
|
+
var clsName = classes[i];
|
|
3103
|
+
if (!clsName) continue;
|
|
3104
|
+
|
|
3105
|
+
if (el.classList) {
|
|
3106
|
+
el.classList.remove(clsName);
|
|
3107
|
+
} else if (hasClass(el, clsName)) {
|
|
3108
|
+
curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
|
2900
3109
|
}
|
|
2901
|
-
return parent && parent.nodeType === 1 ? isFixed(parent) : false;
|
|
2902
3110
|
}
|
|
3111
|
+
if (!el.classList) {
|
|
3112
|
+
el.className = trim(curClass);
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
2903
3115
|
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
3116
|
+
/* istanbul ignore next */
|
|
3117
|
+
var getStyle = ieVersion < 9 ? function (element, styleName) {
|
|
3118
|
+
if (isServer) return;
|
|
3119
|
+
if (!element || !styleName) return null;
|
|
3120
|
+
styleName = camelCase(styleName);
|
|
3121
|
+
if (styleName === 'float') {
|
|
3122
|
+
styleName = 'styleFloat';
|
|
3123
|
+
}
|
|
3124
|
+
try {
|
|
3125
|
+
switch (styleName) {
|
|
3126
|
+
case 'opacity':
|
|
3127
|
+
try {
|
|
3128
|
+
return element.filters.item('alpha').opacity / 100;
|
|
3129
|
+
} catch (e) {
|
|
3130
|
+
return 1.0;
|
|
3131
|
+
}
|
|
3132
|
+
default:
|
|
3133
|
+
return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
|
2914
3134
|
}
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
// add unit if the value is numeric and is one of the following
|
|
2918
|
-
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
|
|
2919
|
-
unit = 'px';
|
|
2920
|
-
}
|
|
2921
|
-
element.style[prop] = styles[prop] + unit;
|
|
2922
|
-
});
|
|
3135
|
+
} catch (e) {
|
|
3136
|
+
return element.style[styleName];
|
|
2923
3137
|
}
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
* @returns {Boolean} answer to: is a function?
|
|
2931
|
-
*/
|
|
2932
|
-
function isFunction(functionToCheck) {
|
|
2933
|
-
var getType = {};
|
|
2934
|
-
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
3138
|
+
} : function (element, styleName) {
|
|
3139
|
+
if (isServer) return;
|
|
3140
|
+
if (!element || !styleName) return null;
|
|
3141
|
+
styleName = camelCase(styleName);
|
|
3142
|
+
if (styleName === 'float') {
|
|
3143
|
+
styleName = 'cssFloat';
|
|
2935
3144
|
}
|
|
3145
|
+
try {
|
|
3146
|
+
var computed = document.defaultView.getComputedStyle(element, '');
|
|
3147
|
+
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
3148
|
+
} catch (e) {
|
|
3149
|
+
return element.style[styleName];
|
|
3150
|
+
}
|
|
3151
|
+
};
|
|
2936
3152
|
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
* @ignore
|
|
2941
|
-
* @param {Element} element
|
|
2942
|
-
* @return {Object} position - Coordinates of the element and its `scrollTop`
|
|
2943
|
-
*/
|
|
2944
|
-
function getOffsetRect(element) {
|
|
2945
|
-
var transform = getStyle(element, 'transform').replace(/[^0-9\-,]/g, '').split(',');
|
|
2946
|
-
var elementRect = {
|
|
2947
|
-
width: element.offsetWidth,
|
|
2948
|
-
height: element.offsetHeight,
|
|
2949
|
-
left: element.offsetLeft + (transform[4] ? parseInt(transform[4], 10) : 0),
|
|
2950
|
-
top: element.offsetTop + (transform[5] ? parseInt(transform[5], 10) : 0)
|
|
2951
|
-
};
|
|
2952
|
-
|
|
2953
|
-
elementRect.right = elementRect.left + elementRect.width;
|
|
2954
|
-
elementRect.bottom = elementRect.top + elementRect.height;
|
|
3153
|
+
/* istanbul ignore next */
|
|
3154
|
+
function setStyle(element, styleName, value) {
|
|
3155
|
+
if (!element || !styleName) return;
|
|
2955
3156
|
|
|
2956
|
-
|
|
2957
|
-
|
|
3157
|
+
if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
|
|
3158
|
+
for (var prop in styleName) {
|
|
3159
|
+
if (styleName.hasOwnProperty(prop)) {
|
|
3160
|
+
setStyle(element, prop, styleName[prop]);
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
} else {
|
|
3164
|
+
styleName = camelCase(styleName);
|
|
3165
|
+
if (styleName === 'opacity' && ieVersion < 9) {
|
|
3166
|
+
element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
|
|
3167
|
+
} else {
|
|
3168
|
+
element.style[styleName] = value;
|
|
3169
|
+
}
|
|
2958
3170
|
}
|
|
3171
|
+
}
|
|
2959
3172
|
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
* @function
|
|
2963
|
-
* @ignore
|
|
2964
|
-
* @param {HTMLElement} element
|
|
2965
|
-
* @return {Object} client rect
|
|
2966
|
-
*/
|
|
2967
|
-
function getBoundingClientRect(element) {
|
|
2968
|
-
var rect = element.getBoundingClientRect();
|
|
3173
|
+
var isScroll = function isScroll(el, vertical) {
|
|
3174
|
+
if (isServer) return;
|
|
2969
3175
|
|
|
2970
|
-
|
|
2971
|
-
|
|
3176
|
+
var determinedDirection = vertical !== null || vertical !== undefined;
|
|
3177
|
+
var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
|
|
2972
3178
|
|
|
2973
|
-
|
|
2974
|
-
|
|
3179
|
+
return overflow.match(/(scroll|auto)/);
|
|
3180
|
+
};
|
|
2975
3181
|
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
top: rectTop,
|
|
2979
|
-
right: rect.right,
|
|
2980
|
-
bottom: rect.bottom,
|
|
2981
|
-
width: rect.right - rect.left,
|
|
2982
|
-
height: rect.bottom - rectTop
|
|
2983
|
-
};
|
|
2984
|
-
}
|
|
3182
|
+
var getScrollContainer = function getScrollContainer(el, vertical) {
|
|
3183
|
+
if (isServer) return;
|
|
2985
3184
|
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
3185
|
+
var parent = el;
|
|
3186
|
+
while (parent) {
|
|
3187
|
+
if ([window, document, document.documentElement].includes(parent)) {
|
|
3188
|
+
return window;
|
|
2989
3189
|
}
|
|
2990
|
-
if (
|
|
2991
|
-
return
|
|
3190
|
+
if (isScroll(parent, vertical)) {
|
|
3191
|
+
return parent;
|
|
2992
3192
|
}
|
|
2993
|
-
|
|
3193
|
+
parent = parent.parentNode;
|
|
2994
3194
|
}
|
|
2995
3195
|
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
* @function
|
|
2999
|
-
* @ignore
|
|
3000
|
-
* @param {HTMLElement} element
|
|
3001
|
-
* @param {HTMLElement} parent
|
|
3002
|
-
* @return {Object} rect
|
|
3003
|
-
*/
|
|
3004
|
-
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
3005
|
-
var elementRect = getBoundingClientRect(element);
|
|
3006
|
-
// parent 为 popper 元素:取其真实包含块的视口 rect,
|
|
3007
|
-
// 避免无界 shadowRoot 等场景下包含块假设错误导致的整体偏移
|
|
3008
|
-
var parentRect = getContainingBlockRect(parent, fixed);
|
|
3009
|
-
|
|
3010
|
-
var rect = {
|
|
3011
|
-
top: elementRect.top - parentRect.top,
|
|
3012
|
-
left: elementRect.left - parentRect.left,
|
|
3013
|
-
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
3014
|
-
right: elementRect.left - parentRect.left + elementRect.width,
|
|
3015
|
-
width: elementRect.width,
|
|
3016
|
-
height: elementRect.height
|
|
3017
|
-
};
|
|
3018
|
-
return rect;
|
|
3019
|
-
}
|
|
3196
|
+
return parent;
|
|
3197
|
+
};
|
|
3020
3198
|
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
* @function
|
|
3024
|
-
* @ignore
|
|
3025
|
-
* @argument {String} property (camelCase)
|
|
3026
|
-
* @returns {String} prefixed property (camelCase)
|
|
3027
|
-
*/
|
|
3028
|
-
function getSupportedPropertyName(property) {
|
|
3029
|
-
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
3030
|
-
|
|
3031
|
-
for (var i = 0; i < prefixes.length; i++) {
|
|
3032
|
-
var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
|
|
3033
|
-
if (typeof root.document.body.style[toCheck] !== 'undefined') {
|
|
3034
|
-
return toCheck;
|
|
3035
|
-
}
|
|
3036
|
-
}
|
|
3037
|
-
return null;
|
|
3038
|
-
}
|
|
3199
|
+
var isInContainer = function isInContainer(el, container) {
|
|
3200
|
+
if (isServer || !el || !container) return false;
|
|
3039
3201
|
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
* objects to a target object. It will return the target object.
|
|
3043
|
-
* This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
|
|
3044
|
-
* Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
3045
|
-
* @function
|
|
3046
|
-
* @ignore
|
|
3047
|
-
*/
|
|
3048
|
-
if (!Object.assign) {
|
|
3049
|
-
Object.defineProperty(Object, 'assign', {
|
|
3050
|
-
enumerable: false,
|
|
3051
|
-
configurable: true,
|
|
3052
|
-
writable: true,
|
|
3053
|
-
value: function value(target) {
|
|
3054
|
-
if (target === undefined || target === null) {
|
|
3055
|
-
throw new TypeError('Cannot convert first argument to object');
|
|
3056
|
-
}
|
|
3202
|
+
var elRect = el.getBoundingClientRect();
|
|
3203
|
+
var containerRect = void 0;
|
|
3057
3204
|
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
|
3068
|
-
var nextKey = keysArray[nextIndex];
|
|
3069
|
-
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
3070
|
-
if (desc !== undefined && desc.enumerable) {
|
|
3071
|
-
to[nextKey] = nextSource[nextKey];
|
|
3072
|
-
}
|
|
3073
|
-
}
|
|
3074
|
-
}
|
|
3075
|
-
return to;
|
|
3076
|
-
}
|
|
3077
|
-
});
|
|
3205
|
+
if ([window, document, document.documentElement, null, undefined].includes(container)) {
|
|
3206
|
+
containerRect = {
|
|
3207
|
+
top: 0,
|
|
3208
|
+
right: window.innerWidth,
|
|
3209
|
+
bottom: window.innerHeight,
|
|
3210
|
+
left: 0
|
|
3211
|
+
};
|
|
3212
|
+
} else {
|
|
3213
|
+
containerRect = container.getBoundingClientRect();
|
|
3078
3214
|
}
|
|
3079
3215
|
|
|
3080
|
-
return
|
|
3081
|
-
}
|
|
3216
|
+
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
|
3217
|
+
};
|
|
3218
|
+
|
|
3219
|
+
/**
|
|
3220
|
+
* 在元素前插入元素
|
|
3221
|
+
* @param {HTMLElement} newEl 新DOM元素
|
|
3222
|
+
* @param {HTMLElement} targetEl 在指定目标DOM元素前插入
|
|
3223
|
+
*/
|
|
3224
|
+
function insertAfter(newEl, targetEl) {
|
|
3225
|
+
var parentEl = targetEl.parentNode;
|
|
3226
|
+
if (parentEl.lastChild === targetEl) {
|
|
3227
|
+
parentEl.appendChild(newEl);
|
|
3228
|
+
} else {
|
|
3229
|
+
parentEl.insertBefore(newEl, targetEl.nextSibling);
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3082
3232
|
|
|
3083
3233
|
/***/ }),
|
|
3084
3234
|
|
|
3085
|
-
/***/
|
|
3235
|
+
/***/ 61:
|
|
3086
3236
|
/***/ (function(module, exports) {
|
|
3087
3237
|
|
|
3088
3238
|
module.exports = require("eoss/lib/dropdown-item");
|