eoss 0.1.0-alpha.25 → 0.1.0-alpha.26
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 +1000 -971
- package/lib/alert.js +2 -2
- package/lib/aside.js +2 -2
- package/lib/audit-trajectory.js +75 -71
- package/lib/autocomplete.js +2136 -1951
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +2 -2
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +4 -4
- package/lib/button-group.js +12 -12
- package/lib/button.js +2 -2
- package/lib/ca-login.js +913 -888
- package/lib/calendar.js +872 -847
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +905 -880
- package/lib/carousel.js +1042 -1017
- package/lib/cascader-panel.js +926 -901
- package/lib/cascader.js +2022 -1837
- package/lib/checkbox-button.js +2 -2
- package/lib/checkbox-group.js +1000 -971
- package/lib/checkbox.js +2 -2
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +2174 -1980
- package/lib/collapse.js +2175 -1980
- package/lib/color-picker.js +1112 -952
- package/lib/config/api.js +3 -0
- package/lib/container.js +2 -2
- package/lib/cron.js +2 -2
- package/lib/data-table.js +1007 -978
- package/lib/date-picker.js +2142 -1957
- package/lib/dialog.js +910 -885
- package/lib/divider.js +2 -2
- package/lib/drawer.js +2 -2
- package/lib/dropdown-item.js +4 -4
- package/lib/dropdown-menu.js +1104 -944
- package/lib/dropdown.js +925 -900
- package/lib/email-login.js +999 -970
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +8751 -4166
- package/lib/flip.js +2 -2
- package/lib/flow-group.js +906 -881
- package/lib/flow.js +1112 -1083
- package/lib/flows.js +1010 -981
- package/lib/footer.js +2 -2
- package/lib/form-item.js +909 -884
- package/lib/form.js +2185 -1986
- package/lib/guide.js +620 -0
- package/lib/header.js +2 -2
- package/lib/icon.js +981 -952
- package/lib/icons.js +2 -2
- package/lib/image-viewer.js +907 -882
- package/lib/image.js +4 -4
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +2 -2
- package/lib/input-number.js +4 -4
- package/lib/input.js +910 -885
- package/lib/link.js +2 -2
- package/lib/loading.js +2 -2
- package/lib/login.js +1027 -998
- package/lib/lowcode.js +17336 -13510
- package/lib/main.js +14933 -14625
- package/lib/marquee.js +907 -882
- package/lib/menu-item-group.js +2 -2
- package/lib/menu-item.js +2 -2
- package/lib/menu.js +2011 -1826
- package/lib/message-box.js +923 -898
- package/lib/message.js +911 -886
- package/lib/notification.js +911 -886
- package/lib/option-group.js +2 -2
- package/lib/option.js +907 -882
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +910 -885
- package/lib/phone-login.js +998 -969
- package/lib/popconfirm.js +12 -12
- package/lib/popover.js +2009 -1824
- package/lib/process-config.js +1015 -986
- package/lib/process-module.js +1001 -972
- package/lib/process-rule.js +1019 -990
- package/lib/progress.js +5 -5
- package/lib/qr-code.js +4 -4
- package/lib/qrcode-login.js +1057 -1028
- package/lib/radio-button.js +2 -2
- package/lib/radio-group.js +998 -969
- package/lib/radio.js +2 -2
- package/lib/rate.js +907 -882
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +904 -879
- package/lib/select.js +2135 -1945
- package/lib/selector-panel.js +1009 -980
- package/lib/selector.js +1001 -972
- package/lib/slider.js +2 -2
- package/lib/step.js +2172 -1977
- package/lib/steps.js +907 -882
- package/lib/submenu.js +1119 -959
- package/lib/switch.js +907 -882
- package/lib/tab-pane.js +2 -2
- package/lib/table-column.js +906 -881
- package/lib/table.js +2236 -2047
- package/lib/tabs.js +911 -886
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/guide.css +1 -0
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/lowcode-view.css +1 -0
- package/lib/theme-chalk/lowcode.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/select-dropdown.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/wujie.css +1 -0
- package/lib/time-picker.js +1977 -1792
- package/lib/time-select.js +1978 -1793
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tips.js +998 -969
- package/lib/toolbar.js +2 -2
- package/lib/tooltip.js +2006 -1821
- package/lib/transfer.js +916 -891
- package/lib/tree-group.js +978 -949
- package/lib/tree.js +999 -970
- package/lib/update-history.js +76 -72
- package/lib/upload.js +1028 -999
- package/lib/utils/frame.js +133 -0
- package/lib/wujie.js +5037 -0
- package/package.json +3 -2
- package/packages/cascader/src/cascader.vue +1 -1
- package/packages/date-picker/src/picker.vue +1 -1
- package/packages/form/src/form-item-render.vue +10 -6
- package/packages/guide/index.js +8 -0
- package/packages/guide/src/directive.js +47 -0
- package/packages/guide/src/guide.vue +89 -0
- package/packages/guide/src/manager.js +133 -0
- package/packages/input/src/input.vue +1 -1
- package/packages/lowcode/src/aside.vue +41 -8
- package/packages/lowcode/src/attribute/bind.vue +2 -4
- package/packages/lowcode/src/attribute/dependency.vue +3 -16
- package/packages/lowcode/src/attribute/function.vue +2 -4
- package/packages/lowcode/src/attribute/property.vue +3 -15
- package/packages/lowcode/src/attribute/styles.vue +105 -11
- package/packages/lowcode/src/attribute.vue +5 -35
- package/packages/lowcode/src/canvas.vue +223 -97
- package/packages/lowcode/src/iframe.vue +60 -0
- package/packages/lowcode/src/lowcode.vue +32 -8
- package/packages/lowcode/src/pages.vue +1 -1
- package/packages/lowcode/src/render.vue +312 -70
- package/packages/lowcode/src/util/source-generator.js +7 -11
- package/packages/lowcode/src/util/source-parser.js +1 -1
- package/packages/lowcode-view/index.js +1 -1
- package/packages/lowcode-view/src/Iframe.vue +55 -0
- package/packages/lowcode-view/src/Modulels.vue +239 -0
- package/packages/lowcode-view/src/render.vue +337 -0
- package/packages/lowcode-view/src/view.vue +763 -0
- package/packages/main/src/components/pages.vue +11 -2
- package/packages/main/src/event-center.js +160 -0
- package/packages/main/src/minxs.js +60 -90
- package/packages/progress/src/progress.vue +1 -1
- package/packages/select/src/select.vue +2 -1
- package/packages/theme-chalk/src/common/var.scss +34 -10
- package/packages/theme-chalk/src/guide.scss +93 -0
- package/packages/theme-chalk/src/icon.scss +425 -426
- package/packages/theme-chalk/src/index.scss +2 -0
- package/packages/theme-chalk/src/lowcode-view.scss +288 -0
- package/packages/theme-chalk/src/lowcode.scss +11 -1
- package/packages/theme-chalk/src/select-dropdown.scss +1 -1
- package/packages/theme-chalk/src/wujie.scss +5 -0
- package/packages/wujie/index.js +10 -0
- package/packages/wujie/src/wujie.vue +205 -0
- package/src/config/api.js +3 -0
- package/src/index.js +325 -319
- package/src/utils/frame.js +102 -0
- package/packages/lowcode/src/view.vue +0 -187
package/lib/submenu.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 = 163);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -543,23 +543,6 @@ function scrollMove(wrap) {
|
|
|
543
543
|
|
|
544
544
|
/***/ }),
|
|
545
545
|
|
|
546
|
-
/***/ 158:
|
|
547
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
548
|
-
|
|
549
|
-
"use strict";
|
|
550
|
-
__webpack_require__.r(__webpack_exports__);
|
|
551
|
-
/* harmony import */ var _menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91);
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
/* istanbul ignore next */
|
|
555
|
-
_menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = function (Vue) {
|
|
556
|
-
Vue.component(_menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].name, _menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
/* harmony default export */ __webpack_exports__["default"] = (_menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
|
|
560
|
-
|
|
561
|
-
/***/ }),
|
|
562
|
-
|
|
563
546
|
/***/ 16:
|
|
564
547
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
565
548
|
|
|
@@ -582,6 +565,23 @@ _menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = func
|
|
|
582
565
|
|
|
583
566
|
/***/ }),
|
|
584
567
|
|
|
568
|
+
/***/ 163:
|
|
569
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
570
|
+
|
|
571
|
+
"use strict";
|
|
572
|
+
__webpack_require__.r(__webpack_exports__);
|
|
573
|
+
/* harmony import */ var _menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92);
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
/* istanbul ignore next */
|
|
577
|
+
_menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = function (Vue) {
|
|
578
|
+
Vue.component(_menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].name, _menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
/* harmony default export */ __webpack_exports__["default"] = (_menu_src_submenu__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
|
|
582
|
+
|
|
583
|
+
/***/ }),
|
|
584
|
+
|
|
585
585
|
/***/ 26:
|
|
586
586
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
587
587
|
|
|
@@ -1159,9 +1159,7 @@ module.exports = require("vue");
|
|
|
1159
1159
|
/***/ 42:
|
|
1160
1160
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1161
1161
|
|
|
1162
|
-
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__
|
|
1163
|
-
|
|
1164
|
-
/**
|
|
1162
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
1165
1163
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
1166
1164
|
* @version {{version}}
|
|
1167
1165
|
* @license
|
|
@@ -1184,60 +1182,68 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1184
1182
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1185
1183
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1186
1184
|
* SOFTWARE.
|
|
1187
|
-
*/
|
|
1188
|
-
|
|
1189
|
-
//
|
|
1190
|
-
// Cross module loader
|
|
1191
|
-
// Supported: Node, AMD, Browser globals
|
|
1192
|
-
//
|
|
1193
|
-
(function (root, factory) {
|
|
1194
|
-
if (true) {
|
|
1195
|
-
// AMD. Register as an anonymous module.
|
|
1185
|
+
*/
|
|
1186
|
+
|
|
1187
|
+
//
|
|
1188
|
+
// Cross module loader
|
|
1189
|
+
// Supported: Node, AMD, Browser globals
|
|
1190
|
+
//
|
|
1191
|
+
(function (root, factory) {
|
|
1192
|
+
if (true) {
|
|
1193
|
+
// AMD. Register as an anonymous module.
|
|
1196
1194
|
!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
1197
1195
|
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
1198
1196
|
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
|
|
1199
1197
|
__WEBPACK_AMD_DEFINE_FACTORY__),
|
|
1200
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
1201
|
-
} else {}
|
|
1202
|
-
})(this, function () {
|
|
1203
|
-
'use strict';
|
|
1204
|
-
|
|
1205
|
-
var root =
|
|
1206
|
-
// default options
|
|
1207
|
-
var DEFAULTS = {
|
|
1208
|
-
// placement of the popper
|
|
1209
|
-
placement: 'bottom',
|
|
1210
|
-
|
|
1211
|
-
gpuAcceleration: true,
|
|
1212
|
-
|
|
1213
|
-
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
1214
|
-
offset: 0,
|
|
1215
|
-
|
|
1216
|
-
// the element which will act as boundary of the popper
|
|
1217
|
-
boundariesElement: 'viewport',
|
|
1218
|
-
|
|
1219
|
-
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
1220
|
-
boundariesPadding: 5,
|
|
1221
|
-
|
|
1222
|
-
// popper will try to prevent overflow following this order,
|
|
1223
|
-
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
1224
|
-
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
1225
|
-
|
|
1226
|
-
// the behavior used by flip to change the placement of the popper
|
|
1227
|
-
flipBehavior: 'flip',
|
|
1228
|
-
|
|
1229
|
-
arrowElement: '[x-arrow]',
|
|
1230
|
-
|
|
1231
|
-
arrowOffset: 0,
|
|
1232
|
-
|
|
1233
|
-
// list of functions used to modify the offsets before they are applied to the popper
|
|
1234
|
-
modifiers: [
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1198
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
1199
|
+
} else {}
|
|
1200
|
+
})(this, function () {
|
|
1201
|
+
'use strict';
|
|
1202
|
+
|
|
1203
|
+
var root = window;
|
|
1204
|
+
// default options
|
|
1205
|
+
var DEFAULTS = {
|
|
1206
|
+
// placement of the popper
|
|
1207
|
+
placement: 'bottom',
|
|
1208
|
+
|
|
1209
|
+
gpuAcceleration: true,
|
|
1210
|
+
|
|
1211
|
+
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
1212
|
+
offset: 0,
|
|
1213
|
+
|
|
1214
|
+
// the element which will act as boundary of the popper
|
|
1215
|
+
boundariesElement: 'viewport',
|
|
1216
|
+
|
|
1217
|
+
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
1218
|
+
boundariesPadding: 5,
|
|
1219
|
+
|
|
1220
|
+
// popper will try to prevent overflow following this order,
|
|
1221
|
+
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
1222
|
+
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
1223
|
+
|
|
1224
|
+
// the behavior used by flip to change the placement of the popper
|
|
1225
|
+
flipBehavior: 'flip',
|
|
1226
|
+
|
|
1227
|
+
arrowElement: '[x-arrow]',
|
|
1228
|
+
|
|
1229
|
+
arrowOffset: 0,
|
|
1230
|
+
|
|
1231
|
+
// list of functions used to modify the offsets before they are applied to the popper
|
|
1232
|
+
modifiers: [
|
|
1233
|
+
'shift',
|
|
1234
|
+
'offset',
|
|
1235
|
+
'preventOverflow',
|
|
1236
|
+
'keepTogether',
|
|
1237
|
+
'arrow',
|
|
1238
|
+
'flip',
|
|
1239
|
+
'applyStyle'
|
|
1240
|
+
],
|
|
1241
|
+
|
|
1242
|
+
modifiersIgnored: [],
|
|
1243
|
+
|
|
1244
|
+
forceAbsolute: false
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1241
1247
|
/**
|
|
1242
1248
|
* Create a new Popper.js instance
|
|
1243
1249
|
* @constructor Popper
|
|
@@ -1302,114 +1308,125 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1302
1308
|
*
|
|
1303
1309
|
* @param {Boolean} [options.removeOnDestroy=false]
|
|
1304
1310
|
* Set to true if you want to automatically remove the popper when you call the `destroy` method.
|
|
1305
|
-
*/
|
|
1306
|
-
function Popper(reference, popper, options) {
|
|
1307
|
-
this._reference = reference.jquery ? reference[0] : reference;
|
|
1308
|
-
this.state = {};
|
|
1309
|
-
|
|
1310
|
-
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
1311
|
-
// generate a default popper if is not defined
|
|
1312
|
-
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
1313
|
-
var isConfig =
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
this.
|
|
1346
|
-
|
|
1347
|
-
//
|
|
1348
|
-
this.
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1311
|
+
*/
|
|
1312
|
+
function Popper(reference, popper, options) {
|
|
1313
|
+
this._reference = reference.jquery ? reference[0] : reference;
|
|
1314
|
+
this.state = {};
|
|
1315
|
+
|
|
1316
|
+
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
1317
|
+
// generate a default popper if is not defined
|
|
1318
|
+
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
1319
|
+
var isConfig =
|
|
1320
|
+
popper && Object.prototype.toString.call(popper) === '[object Object]';
|
|
1321
|
+
if (isNotDefined || isConfig) {
|
|
1322
|
+
this._popper = this.parse(isConfig ? popper : {});
|
|
1323
|
+
}
|
|
1324
|
+
// otherwise, use the given HTMLElement as popper
|
|
1325
|
+
else {
|
|
1326
|
+
this._popper = popper.jquery ? popper[0] : popper;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
// with {} we create a new object with the options inside it
|
|
1330
|
+
this._options = Object.assign({}, DEFAULTS, options);
|
|
1331
|
+
|
|
1332
|
+
// refactoring modifiers' list
|
|
1333
|
+
this._options.modifiers = this._options.modifiers.map(
|
|
1334
|
+
function (modifier) {
|
|
1335
|
+
// remove ignored modifiers
|
|
1336
|
+
if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
|
1337
|
+
|
|
1338
|
+
// set the x-placement attribute before everything else because it could be used to add margins to the popper
|
|
1339
|
+
// margins needs to be calculated to get the correct popper offsets
|
|
1340
|
+
if (modifier === 'applyStyle') {
|
|
1341
|
+
this._popper.setAttribute('x-placement', this._options.placement);
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
// return predefined modifier identified by string or keep the custom one
|
|
1345
|
+
return this.modifiers[modifier] || modifier;
|
|
1346
|
+
}.bind(this)
|
|
1347
|
+
);
|
|
1348
|
+
|
|
1349
|
+
// make sure to apply the popper position before any computation
|
|
1350
|
+
this.state.position = this._getPosition(this._popper, this._reference);
|
|
1351
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
1352
|
+
|
|
1353
|
+
// fire the first update to position the popper in the right place
|
|
1354
|
+
this.update();
|
|
1355
|
+
|
|
1356
|
+
// setup event listeners, they will take care of update the position in specific situations
|
|
1357
|
+
this._setupEventListeners();
|
|
1358
|
+
return this;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
//
|
|
1362
|
+
// Methods
|
|
1363
|
+
//
|
|
1355
1364
|
/**
|
|
1356
1365
|
* Destroy the popper
|
|
1357
1366
|
* @method
|
|
1358
1367
|
* @memberof Popper
|
|
1359
|
-
*/
|
|
1360
|
-
Popper.prototype.destroy = function () {
|
|
1361
|
-
this._popper.removeAttribute('x-placement');
|
|
1362
|
-
this._popper.style.left = '';
|
|
1363
|
-
this._popper.style.position = '';
|
|
1364
|
-
this._popper.style.top = '';
|
|
1365
|
-
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
1366
|
-
this._removeEventListeners();
|
|
1367
|
-
|
|
1368
|
-
// remove the popper if user explicity asked for the deletion on destroy
|
|
1369
|
-
if (this._options.removeOnDestroy) {
|
|
1370
|
-
this._popper.remove();
|
|
1371
|
-
}
|
|
1372
|
-
return this;
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1368
|
+
*/
|
|
1369
|
+
Popper.prototype.destroy = function () {
|
|
1370
|
+
this._popper.removeAttribute('x-placement');
|
|
1371
|
+
this._popper.style.left = '';
|
|
1372
|
+
this._popper.style.position = '';
|
|
1373
|
+
this._popper.style.top = '';
|
|
1374
|
+
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
1375
|
+
this._removeEventListeners();
|
|
1376
|
+
|
|
1377
|
+
// remove the popper if user explicity asked for the deletion on destroy
|
|
1378
|
+
if (this._options.removeOnDestroy) {
|
|
1379
|
+
this._popper.remove();
|
|
1380
|
+
}
|
|
1381
|
+
return this;
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1375
1384
|
/**
|
|
1376
1385
|
* Updates the position of the popper, computing the new offsets and applying the new style
|
|
1377
1386
|
* @method
|
|
1378
1387
|
* @memberof Popper
|
|
1379
|
-
*/
|
|
1380
|
-
Popper.prototype.update = function () {
|
|
1381
|
-
var data = { instance: this, styles: {} };
|
|
1382
|
-
|
|
1383
|
-
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
1384
|
-
// and refer to _originalPlacement to know the original value
|
|
1385
|
-
data.placement = this._options.placement;
|
|
1386
|
-
data._originalPlacement = this._options.placement;
|
|
1387
|
-
|
|
1388
|
-
// compute the popper and reference offsets and put them inside data.offsets
|
|
1389
|
-
data.offsets = this._getOffsets(
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1388
|
+
*/
|
|
1389
|
+
Popper.prototype.update = function () {
|
|
1390
|
+
var data = { instance: this, styles: {} };
|
|
1391
|
+
|
|
1392
|
+
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
1393
|
+
// and refer to _originalPlacement to know the original value
|
|
1394
|
+
data.placement = this._options.placement;
|
|
1395
|
+
data._originalPlacement = this._options.placement;
|
|
1396
|
+
|
|
1397
|
+
// compute the popper and reference offsets and put them inside data.offsets
|
|
1398
|
+
data.offsets = this._getOffsets(
|
|
1399
|
+
this._popper,
|
|
1400
|
+
this._reference,
|
|
1401
|
+
data.placement
|
|
1402
|
+
);
|
|
1403
|
+
|
|
1404
|
+
// get boundaries
|
|
1405
|
+
data.boundaries = this._getBoundaries(
|
|
1406
|
+
data,
|
|
1407
|
+
this._options.boundariesPadding,
|
|
1408
|
+
this._options.boundariesElement
|
|
1409
|
+
);
|
|
1410
|
+
|
|
1411
|
+
data = this.runModifiers(data, this._options.modifiers);
|
|
1412
|
+
|
|
1413
|
+
if (typeof this.state.updateCallback === 'function') {
|
|
1414
|
+
this.state.updateCallback(data);
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1401
1418
|
/**
|
|
1402
1419
|
* If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
|
|
1403
1420
|
* @method
|
|
1404
1421
|
* @memberof Popper
|
|
1405
1422
|
* @param {Function} callback
|
|
1406
|
-
*/
|
|
1407
|
-
Popper.prototype.onCreate = function (callback) {
|
|
1408
|
-
// the createCallbacks return as first argument the popper instance
|
|
1409
|
-
callback(this);
|
|
1410
|
-
return this;
|
|
1411
|
-
};
|
|
1412
|
-
|
|
1423
|
+
*/
|
|
1424
|
+
Popper.prototype.onCreate = function (callback) {
|
|
1425
|
+
// the createCallbacks return as first argument the popper instance
|
|
1426
|
+
callback(this);
|
|
1427
|
+
return this;
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1413
1430
|
/**
|
|
1414
1431
|
* If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
|
|
1415
1432
|
* used to style popper and its arrow.
|
|
@@ -1417,93 +1434,101 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1417
1434
|
* @method
|
|
1418
1435
|
* @memberof Popper
|
|
1419
1436
|
* @param {Function} callback
|
|
1420
|
-
*/
|
|
1421
|
-
Popper.prototype.onUpdate = function (callback) {
|
|
1422
|
-
this.state.updateCallback = callback;
|
|
1423
|
-
return this;
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1437
|
+
*/
|
|
1438
|
+
Popper.prototype.onUpdate = function (callback) {
|
|
1439
|
+
this.state.updateCallback = callback;
|
|
1440
|
+
return this;
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1426
1443
|
/**
|
|
1427
1444
|
* Helper used to generate poppers from a configuration file
|
|
1428
1445
|
* @method
|
|
1429
1446
|
* @memberof Popper
|
|
1430
1447
|
* @param config {Object} configuration
|
|
1431
1448
|
* @returns {HTMLElement} popper
|
|
1432
|
-
*/
|
|
1433
|
-
Popper.prototype.parse = function (config) {
|
|
1434
|
-
var defaultConfig = {
|
|
1435
|
-
tagName: 'div',
|
|
1436
|
-
classNames: ['popper'],
|
|
1437
|
-
attributes: [],
|
|
1438
|
-
parent: root.document.body,
|
|
1439
|
-
content: '',
|
|
1440
|
-
contentType: 'text',
|
|
1441
|
-
arrowTagName: 'div',
|
|
1442
|
-
arrowClassNames: ['popper__arrow'],
|
|
1443
|
-
arrowAttributes: ['x-arrow']
|
|
1444
|
-
};
|
|
1445
|
-
config = Object.assign({}, defaultConfig, config);
|
|
1446
|
-
|
|
1447
|
-
var d = root.document;
|
|
1448
|
-
|
|
1449
|
-
var popper = d.createElement(config.tagName);
|
|
1450
|
-
addClassNames(popper, config.classNames);
|
|
1451
|
-
addAttributes(popper, config.attributes);
|
|
1452
|
-
if (config.contentType === 'node') {
|
|
1453
|
-
popper.appendChild(
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
} else {
|
|
1457
|
-
popper.
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
// if
|
|
1472
|
-
if
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
parent = parent[0];
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
//
|
|
1490
|
-
parent.
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1449
|
+
*/
|
|
1450
|
+
Popper.prototype.parse = function (config) {
|
|
1451
|
+
var defaultConfig = {
|
|
1452
|
+
tagName: 'div',
|
|
1453
|
+
classNames: ['popper'],
|
|
1454
|
+
attributes: [],
|
|
1455
|
+
parent: root.document.body,
|
|
1456
|
+
content: '',
|
|
1457
|
+
contentType: 'text',
|
|
1458
|
+
arrowTagName: 'div',
|
|
1459
|
+
arrowClassNames: ['popper__arrow'],
|
|
1460
|
+
arrowAttributes: ['x-arrow']
|
|
1461
|
+
};
|
|
1462
|
+
config = Object.assign({}, defaultConfig, config);
|
|
1463
|
+
|
|
1464
|
+
var d = root.document;
|
|
1465
|
+
|
|
1466
|
+
var popper = d.createElement(config.tagName);
|
|
1467
|
+
addClassNames(popper, config.classNames);
|
|
1468
|
+
addAttributes(popper, config.attributes);
|
|
1469
|
+
if (config.contentType === 'node') {
|
|
1470
|
+
popper.appendChild(
|
|
1471
|
+
config.content.jquery ? config.content[0] : config.content
|
|
1472
|
+
);
|
|
1473
|
+
} else if (config.contentType === 'html') {
|
|
1474
|
+
popper.innerHTML = config.content;
|
|
1475
|
+
} else {
|
|
1476
|
+
popper.textContent = config.content;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
if (config.arrowTagName) {
|
|
1480
|
+
var arrow = d.createElement(config.arrowTagName);
|
|
1481
|
+
addClassNames(arrow, config.arrowClassNames);
|
|
1482
|
+
addAttributes(arrow, config.arrowAttributes);
|
|
1483
|
+
popper.appendChild(arrow);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
var parent = config.parent.jquery ? config.parent[0] : config.parent;
|
|
1487
|
+
|
|
1488
|
+
// if the given parent is a string, use it to match an element
|
|
1489
|
+
// if more than one element is matched, the first one will be used as parent
|
|
1490
|
+
// if no elements are matched, the script will throw an error
|
|
1491
|
+
if (typeof parent === 'string') {
|
|
1492
|
+
parent = d.querySelectorAll(config.parent);
|
|
1493
|
+
if (parent.length > 1) {
|
|
1494
|
+
console.warn(
|
|
1495
|
+
'WARNING: the given `parent` query(' +
|
|
1496
|
+
config.parent +
|
|
1497
|
+
') matched more than one element, the first one will be used'
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
if (parent.length === 0) {
|
|
1501
|
+
throw "ERROR: the given `parent` doesn't exists!";
|
|
1502
|
+
}
|
|
1503
|
+
parent = parent[0];
|
|
1504
|
+
}
|
|
1505
|
+
// if the given parent is a DOM nodes list or an array of nodes with more than one element,
|
|
1506
|
+
// the first one will be used as parent
|
|
1507
|
+
if (parent.length > 1 && parent instanceof Element === false) {
|
|
1508
|
+
console.warn(
|
|
1509
|
+
'WARNING: you have passed as parent a list of elements, the first one will be used'
|
|
1510
|
+
);
|
|
1511
|
+
parent = parent[0];
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
// append the generated popper to its parent
|
|
1515
|
+
parent.appendChild(popper);
|
|
1516
|
+
|
|
1517
|
+
return popper;
|
|
1518
|
+
|
|
1494
1519
|
/**
|
|
1495
1520
|
* Adds class names to the given element
|
|
1496
1521
|
* @function
|
|
1497
1522
|
* @ignore
|
|
1498
1523
|
* @param {HTMLElement} target
|
|
1499
1524
|
* @param {Array} classes
|
|
1500
|
-
*/
|
|
1501
|
-
function addClassNames(element, classNames) {
|
|
1502
|
-
classNames.forEach(function (className) {
|
|
1503
|
-
element.classList.add(className);
|
|
1504
|
-
});
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1525
|
+
*/
|
|
1526
|
+
function addClassNames(element, classNames) {
|
|
1527
|
+
classNames.forEach(function (className) {
|
|
1528
|
+
element.classList.add(className);
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1507
1532
|
/**
|
|
1508
1533
|
* Adds attributes to the given element
|
|
1509
1534
|
* @function
|
|
@@ -1512,14 +1537,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1512
1537
|
* @param {Array} attributes
|
|
1513
1538
|
* @example
|
|
1514
1539
|
* addAttributes(element, [ 'data-info:foobar' ]);
|
|
1515
|
-
*/
|
|
1516
|
-
function addAttributes(element, attributes) {
|
|
1517
|
-
attributes.forEach(function (attribute) {
|
|
1518
|
-
element.setAttribute(
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1540
|
+
*/
|
|
1541
|
+
function addAttributes(element, attributes) {
|
|
1542
|
+
attributes.forEach(function (attribute) {
|
|
1543
|
+
element.setAttribute(
|
|
1544
|
+
attribute.split(':')[0],
|
|
1545
|
+
attribute.split(':')[1] || ''
|
|
1546
|
+
);
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1523
1551
|
/**
|
|
1524
1552
|
* Helper used to get the position which will be applied to the popper
|
|
1525
1553
|
* @method
|
|
@@ -1527,20 +1555,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1527
1555
|
* @param config {HTMLElement} popper element
|
|
1528
1556
|
* @param reference {HTMLElement} reference element
|
|
1529
1557
|
* @returns {String} position
|
|
1530
|
-
*/
|
|
1531
|
-
Popper.prototype._getPosition = function (popper, reference) {
|
|
1532
|
-
var container = getOffsetParent(reference);
|
|
1533
|
-
|
|
1534
|
-
if (this._options.forceAbsolute) {
|
|
1535
|
-
return 'absolute';
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
// Decide if the popper will be fixed
|
|
1539
|
-
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
1540
|
-
var isParentFixed = isFixed(reference, container);
|
|
1541
|
-
return isParentFixed ? 'fixed' : 'absolute';
|
|
1542
|
-
};
|
|
1543
|
-
|
|
1558
|
+
*/
|
|
1559
|
+
Popper.prototype._getPosition = function (popper, reference) {
|
|
1560
|
+
var container = getOffsetParent(reference);
|
|
1561
|
+
|
|
1562
|
+
if (this._options.forceAbsolute) {
|
|
1563
|
+
return 'absolute';
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
// Decide if the popper will be fixed
|
|
1567
|
+
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
1568
|
+
var isParentFixed = isFixed(reference, container);
|
|
1569
|
+
return isParentFixed ? 'fixed' : 'absolute';
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1544
1572
|
/**
|
|
1545
1573
|
* Get offsets to the popper
|
|
1546
1574
|
* @method
|
|
@@ -1549,93 +1577,112 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1549
1577
|
* @param {Element} popper - the popper element
|
|
1550
1578
|
* @param {Element} reference - the reference element (the popper will be relative to this)
|
|
1551
1579
|
* @returns {Object} An object containing the offsets which will be applied to the popper
|
|
1552
|
-
*/
|
|
1553
|
-
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
1554
|
-
placement = placement.split('-')[0];
|
|
1555
|
-
var popperOffsets = {};
|
|
1556
|
-
|
|
1557
|
-
popperOffsets.position = this.state.position;
|
|
1558
|
-
var isParentFixed = popperOffsets.position === 'fixed';
|
|
1559
|
-
|
|
1560
|
-
//
|
|
1561
|
-
// Get reference element position
|
|
1562
|
-
//
|
|
1563
|
-
var referenceOffsets = getOffsetRectRelativeToCustomParent(
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
//
|
|
1571
|
-
//
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
//
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
if (placement === '
|
|
1585
|
-
popperOffsets.
|
|
1586
|
-
} else {
|
|
1587
|
-
popperOffsets.
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1580
|
+
*/
|
|
1581
|
+
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
1582
|
+
placement = placement.split('-')[0];
|
|
1583
|
+
var popperOffsets = {};
|
|
1584
|
+
|
|
1585
|
+
popperOffsets.position = this.state.position;
|
|
1586
|
+
var isParentFixed = popperOffsets.position === 'fixed';
|
|
1587
|
+
|
|
1588
|
+
//
|
|
1589
|
+
// Get reference element position
|
|
1590
|
+
//
|
|
1591
|
+
var referenceOffsets = getOffsetRectRelativeToCustomParent(
|
|
1592
|
+
reference,
|
|
1593
|
+
getOffsetParent(popper),
|
|
1594
|
+
isParentFixed
|
|
1595
|
+
);
|
|
1596
|
+
|
|
1597
|
+
//
|
|
1598
|
+
// Get popper sizes
|
|
1599
|
+
//
|
|
1600
|
+
var popperRect = getOuterSizes(popper);
|
|
1601
|
+
|
|
1602
|
+
//
|
|
1603
|
+
// Compute offsets of popper
|
|
1604
|
+
//
|
|
1605
|
+
|
|
1606
|
+
// depending by the popper placement we have to compute its offsets slightly differently
|
|
1607
|
+
if (['right', 'left'].indexOf(placement) !== -1) {
|
|
1608
|
+
popperOffsets.top =
|
|
1609
|
+
referenceOffsets.top +
|
|
1610
|
+
referenceOffsets.height / 2 -
|
|
1611
|
+
popperRect.height / 2;
|
|
1612
|
+
if (placement === 'left') {
|
|
1613
|
+
popperOffsets.left = referenceOffsets.left - popperRect.width;
|
|
1614
|
+
} else {
|
|
1615
|
+
popperOffsets.left = referenceOffsets.right;
|
|
1616
|
+
}
|
|
1617
|
+
} else {
|
|
1618
|
+
popperOffsets.left =
|
|
1619
|
+
referenceOffsets.left +
|
|
1620
|
+
referenceOffsets.width / 2 -
|
|
1621
|
+
popperRect.width / 2;
|
|
1622
|
+
if (placement === 'top') {
|
|
1623
|
+
popperOffsets.top = referenceOffsets.top - popperRect.height;
|
|
1624
|
+
} else {
|
|
1625
|
+
popperOffsets.top = referenceOffsets.bottom;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
// Add width and height to our offsets object
|
|
1630
|
+
popperOffsets.width = popperRect.width;
|
|
1631
|
+
popperOffsets.height = popperRect.height;
|
|
1632
|
+
|
|
1633
|
+
return {
|
|
1634
|
+
popper: popperOffsets,
|
|
1635
|
+
reference: referenceOffsets
|
|
1636
|
+
};
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1601
1639
|
/**
|
|
1602
1640
|
* Setup needed event listeners used to update the popper position
|
|
1603
1641
|
* @method
|
|
1604
1642
|
* @memberof Popper
|
|
1605
1643
|
* @access private
|
|
1606
|
-
*/
|
|
1607
|
-
Popper.prototype._setupEventListeners = function () {
|
|
1608
|
-
// NOTE: 1 DOM access here
|
|
1609
|
-
this.state.updateBound = this.update.bind(this);
|
|
1610
|
-
root.addEventListener('resize', this.state.updateBound);
|
|
1611
|
-
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
1612
|
-
if (this._options.boundariesElement !== 'window') {
|
|
1613
|
-
var target = getScrollParent(this._reference);
|
|
1614
|
-
// here it could be both `body` or `documentElement` thanks to Firefox, we then check both
|
|
1615
|
-
if (
|
|
1616
|
-
target
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1644
|
+
*/
|
|
1645
|
+
Popper.prototype._setupEventListeners = function () {
|
|
1646
|
+
// NOTE: 1 DOM access here
|
|
1647
|
+
this.state.updateBound = this.update.bind(this);
|
|
1648
|
+
root.addEventListener('resize', this.state.updateBound);
|
|
1649
|
+
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
1650
|
+
if (this._options.boundariesElement !== 'window') {
|
|
1651
|
+
var target = getScrollParent(this._reference);
|
|
1652
|
+
// here it could be both `body` or `documentElement` thanks to Firefox, we then check both
|
|
1653
|
+
if (
|
|
1654
|
+
target === root.document.body ||
|
|
1655
|
+
target === root.document.documentElement
|
|
1656
|
+
) {
|
|
1657
|
+
target = root;
|
|
1658
|
+
}
|
|
1659
|
+
target.addEventListener('scroll', this.state.updateBound);
|
|
1660
|
+
this.state.scrollTarget = target;
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1623
1664
|
/**
|
|
1624
1665
|
* Remove event listeners used to update the popper position
|
|
1625
1666
|
* @method
|
|
1626
1667
|
* @memberof Popper
|
|
1627
1668
|
* @access private
|
|
1628
|
-
*/
|
|
1629
|
-
Popper.prototype._removeEventListeners = function () {
|
|
1630
|
-
// NOTE: 1 DOM access here
|
|
1631
|
-
root.removeEventListener('resize', this.state.updateBound);
|
|
1632
|
-
if (
|
|
1633
|
-
this.
|
|
1634
|
-
this.state.scrollTarget
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1669
|
+
*/
|
|
1670
|
+
Popper.prototype._removeEventListeners = function () {
|
|
1671
|
+
// NOTE: 1 DOM access here
|
|
1672
|
+
root.removeEventListener('resize', this.state.updateBound);
|
|
1673
|
+
if (
|
|
1674
|
+
this._options.boundariesElement !== 'window' &&
|
|
1675
|
+
this.state.scrollTarget
|
|
1676
|
+
) {
|
|
1677
|
+
this.state.scrollTarget.removeEventListener(
|
|
1678
|
+
'scroll',
|
|
1679
|
+
this.state.updateBound
|
|
1680
|
+
);
|
|
1681
|
+
this.state.scrollTarget = null;
|
|
1682
|
+
}
|
|
1683
|
+
this.state.updateBound = null;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1639
1686
|
/**
|
|
1640
1687
|
* Computed the boundaries limits and return them
|
|
1641
1688
|
* @method
|
|
@@ -1645,66 +1692,98 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1645
1692
|
* @param {Number} padding - Boundaries padding
|
|
1646
1693
|
* @param {Element} boundariesElement - Element used to define the boundaries
|
|
1647
1694
|
* @returns {Object} Coordinates of the boundaries
|
|
1648
|
-
*/
|
|
1649
|
-
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
1650
|
-
// NOTE: 1 DOM access here
|
|
1651
|
-
var boundaries = {};
|
|
1652
|
-
var width, height;
|
|
1653
|
-
if (boundariesElement === 'window') {
|
|
1654
|
-
var body = root.document.body,
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
height = Math.max(
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
};
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
var
|
|
1681
|
-
var
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1695
|
+
*/
|
|
1696
|
+
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
1697
|
+
// NOTE: 1 DOM access here
|
|
1698
|
+
var boundaries = {};
|
|
1699
|
+
var width, height;
|
|
1700
|
+
if (boundariesElement === 'window') {
|
|
1701
|
+
var body = root.document.body,
|
|
1702
|
+
html = root.document.documentElement;
|
|
1703
|
+
|
|
1704
|
+
height = Math.max(
|
|
1705
|
+
body.scrollHeight,
|
|
1706
|
+
body.offsetHeight,
|
|
1707
|
+
html.clientHeight,
|
|
1708
|
+
html.scrollHeight,
|
|
1709
|
+
html.offsetHeight
|
|
1710
|
+
);
|
|
1711
|
+
width = Math.max(
|
|
1712
|
+
body.scrollWidth,
|
|
1713
|
+
body.offsetWidth,
|
|
1714
|
+
html.clientWidth,
|
|
1715
|
+
html.scrollWidth,
|
|
1716
|
+
html.offsetWidth
|
|
1717
|
+
);
|
|
1718
|
+
|
|
1719
|
+
boundaries = {
|
|
1720
|
+
top: 0,
|
|
1721
|
+
right: width,
|
|
1722
|
+
bottom: height,
|
|
1723
|
+
left: 0
|
|
1724
|
+
};
|
|
1725
|
+
} else if (boundariesElement === 'viewport') {
|
|
1726
|
+
var offsetParent = getOffsetParent(this._popper);
|
|
1727
|
+
var scrollParent = getScrollParent(this._popper);
|
|
1728
|
+
var offsetParentRect = getOffsetRect(offsetParent);
|
|
1729
|
+
|
|
1730
|
+
// Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
|
|
1731
|
+
var getScrollTopValue = function (element) {
|
|
1732
|
+
return element == document.body
|
|
1733
|
+
? Math.max(
|
|
1734
|
+
document.documentElement.scrollTop,
|
|
1735
|
+
document.body.scrollTop
|
|
1736
|
+
)
|
|
1737
|
+
: element.scrollTop;
|
|
1738
|
+
};
|
|
1739
|
+
var getScrollLeftValue = function (element) {
|
|
1740
|
+
return element == document.body
|
|
1741
|
+
? Math.max(
|
|
1742
|
+
document.documentElement.scrollLeft,
|
|
1743
|
+
document.body.scrollLeft
|
|
1744
|
+
)
|
|
1745
|
+
: element.scrollLeft;
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1748
|
+
// if the popper is fixed we don't have to substract scrolling from the boundaries
|
|
1749
|
+
var scrollTop =
|
|
1750
|
+
data.offsets.popper.position === 'fixed'
|
|
1751
|
+
? 0
|
|
1752
|
+
: getScrollTopValue(scrollParent);
|
|
1753
|
+
var scrollLeft =
|
|
1754
|
+
data.offsets.popper.position === 'fixed'
|
|
1755
|
+
? 0
|
|
1756
|
+
: getScrollLeftValue(scrollParent);
|
|
1757
|
+
|
|
1758
|
+
boundaries = {
|
|
1759
|
+
top: 0 - (offsetParentRect.top - scrollTop),
|
|
1760
|
+
right:
|
|
1761
|
+
root.document.documentElement.clientWidth -
|
|
1762
|
+
(offsetParentRect.left - scrollLeft),
|
|
1763
|
+
bottom:
|
|
1764
|
+
root.document.documentElement.clientHeight -
|
|
1765
|
+
(offsetParentRect.top - scrollTop),
|
|
1766
|
+
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
1767
|
+
};
|
|
1768
|
+
} else {
|
|
1769
|
+
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
1770
|
+
boundaries = {
|
|
1771
|
+
top: 0,
|
|
1772
|
+
left: 0,
|
|
1773
|
+
right: boundariesElement.clientWidth,
|
|
1774
|
+
bottom: boundariesElement.clientHeight
|
|
1775
|
+
};
|
|
1776
|
+
} else {
|
|
1777
|
+
boundaries = getOffsetRect(boundariesElement);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
boundaries.left += padding;
|
|
1781
|
+
boundaries.right -= padding;
|
|
1782
|
+
boundaries.top = boundaries.top + padding;
|
|
1783
|
+
boundaries.bottom = boundaries.bottom - padding;
|
|
1784
|
+
return boundaries;
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1708
1787
|
/**
|
|
1709
1788
|
* Loop trough the list of modifiers and run them in order, each of them will then edit the data object
|
|
1710
1789
|
* @method
|
|
@@ -1713,22 +1792,27 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1713
1792
|
* @param {Object} data
|
|
1714
1793
|
* @param {Array} modifiers
|
|
1715
1794
|
* @param {Function} ends
|
|
1716
|
-
*/
|
|
1717
|
-
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
1718
|
-
var modifiersToRun = modifiers.slice();
|
|
1719
|
-
if (ends !== undefined) {
|
|
1720
|
-
modifiersToRun = this._options.modifiers.slice(
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1795
|
+
*/
|
|
1796
|
+
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
1797
|
+
var modifiersToRun = modifiers.slice();
|
|
1798
|
+
if (ends !== undefined) {
|
|
1799
|
+
modifiersToRun = this._options.modifiers.slice(
|
|
1800
|
+
0,
|
|
1801
|
+
getArrayKeyIndex(this._options.modifiers, ends)
|
|
1802
|
+
);
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
modifiersToRun.forEach(
|
|
1806
|
+
function (modifier) {
|
|
1807
|
+
if (isFunction(modifier)) {
|
|
1808
|
+
data = modifier.call(this, data);
|
|
1809
|
+
}
|
|
1810
|
+
}.bind(this)
|
|
1811
|
+
);
|
|
1812
|
+
|
|
1813
|
+
return data;
|
|
1814
|
+
};
|
|
1815
|
+
|
|
1732
1816
|
/**
|
|
1733
1817
|
* Helper used to know if the given modifier depends from another one.
|
|
1734
1818
|
* @method
|
|
@@ -1736,191 +1820,204 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1736
1820
|
* @param {String} requesting - name of requesting modifier
|
|
1737
1821
|
* @param {String} requested - name of requested modifier
|
|
1738
1822
|
* @returns {Boolean}
|
|
1739
|
-
*/
|
|
1740
|
-
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
1741
|
-
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
1742
|
-
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
1743
|
-
return modifier === requested;
|
|
1744
|
-
}).length;
|
|
1745
|
-
};
|
|
1746
|
-
|
|
1747
|
-
//
|
|
1748
|
-
// Modifiers
|
|
1749
|
-
//
|
|
1750
|
-
|
|
1823
|
+
*/
|
|
1824
|
+
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
1825
|
+
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
1826
|
+
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
1827
|
+
return modifier === requested;
|
|
1828
|
+
}).length;
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
//
|
|
1832
|
+
// Modifiers
|
|
1833
|
+
//
|
|
1834
|
+
|
|
1751
1835
|
/**
|
|
1752
1836
|
* Modifiers list
|
|
1753
1837
|
* @namespace Popper.modifiers
|
|
1754
1838
|
* @memberof Popper
|
|
1755
1839
|
* @type {Object}
|
|
1756
|
-
*/
|
|
1757
|
-
Popper.prototype.modifiers = {};
|
|
1758
|
-
|
|
1840
|
+
*/
|
|
1841
|
+
Popper.prototype.modifiers = {};
|
|
1842
|
+
|
|
1759
1843
|
/**
|
|
1760
1844
|
* Apply the computed styles to the popper element
|
|
1761
1845
|
* @method
|
|
1762
1846
|
* @memberof Popper.modifiers
|
|
1763
1847
|
* @argument {Object} data - The data object generated by `update` method
|
|
1764
1848
|
* @returns {Object} The same data object
|
|
1765
|
-
*/
|
|
1766
|
-
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
1767
|
-
// apply the final offsets to the popper
|
|
1768
|
-
// NOTE: 1 DOM access here
|
|
1769
|
-
var styles = {
|
|
1770
|
-
position: data.offsets.popper.position
|
|
1771
|
-
};
|
|
1772
|
-
|
|
1773
|
-
// round top and left to avoid blurry text
|
|
1774
|
-
var left = Math.round(data.offsets.popper.left);
|
|
1775
|
-
var top = Math.round(data.offsets.popper.top);
|
|
1776
|
-
|
|
1777
|
-
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
1778
|
-
// we automatically use the supported prefixed version if needed
|
|
1779
|
-
var prefixedProperty;
|
|
1780
|
-
if (
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
this._popper
|
|
1802
|
-
|
|
1803
|
-
//
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1849
|
+
*/
|
|
1850
|
+
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
1851
|
+
// apply the final offsets to the popper
|
|
1852
|
+
// NOTE: 1 DOM access here
|
|
1853
|
+
var styles = {
|
|
1854
|
+
position: data.offsets.popper.position
|
|
1855
|
+
};
|
|
1856
|
+
|
|
1857
|
+
// round top and left to avoid blurry text
|
|
1858
|
+
var left = Math.round(data.offsets.popper.left);
|
|
1859
|
+
var top = Math.round(data.offsets.popper.top);
|
|
1860
|
+
|
|
1861
|
+
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
1862
|
+
// we automatically use the supported prefixed version if needed
|
|
1863
|
+
var prefixedProperty;
|
|
1864
|
+
if (
|
|
1865
|
+
this._options.gpuAcceleration &&
|
|
1866
|
+
(prefixedProperty = getSupportedPropertyName('transform'))
|
|
1867
|
+
) {
|
|
1868
|
+
styles[prefixedProperty] =
|
|
1869
|
+
'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
1870
|
+
styles.top = 0;
|
|
1871
|
+
styles.left = 0;
|
|
1872
|
+
}
|
|
1873
|
+
// othwerise, we use the standard `left` and `top` properties
|
|
1874
|
+
else {
|
|
1875
|
+
styles.left = left;
|
|
1876
|
+
styles.top = top;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
// any property present in `data.styles` will be applied to the popper,
|
|
1880
|
+
// in this way we can make the 3rd party modifiers add custom styles to it
|
|
1881
|
+
// Be aware, modifiers could override the properties defined in the previous
|
|
1882
|
+
// lines of this modifier!
|
|
1883
|
+
Object.assign(styles, data.styles);
|
|
1884
|
+
|
|
1885
|
+
setStyle(this._popper, styles);
|
|
1886
|
+
|
|
1887
|
+
// set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
|
|
1888
|
+
// NOTE: 1 DOM access here
|
|
1889
|
+
this._popper.setAttribute('x-placement', data.placement);
|
|
1890
|
+
|
|
1891
|
+
// if the arrow modifier is required and the arrow style has been computed, apply the arrow style
|
|
1892
|
+
if (
|
|
1893
|
+
this.isModifierRequired(
|
|
1894
|
+
this.modifiers.applyStyle,
|
|
1895
|
+
this.modifiers.arrow
|
|
1896
|
+
) &&
|
|
1897
|
+
data.offsets.arrow
|
|
1898
|
+
) {
|
|
1899
|
+
setStyle(data.arrowElement, data.offsets.arrow);
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
return data;
|
|
1903
|
+
};
|
|
1904
|
+
|
|
1811
1905
|
/**
|
|
1812
1906
|
* Modifier used to shift the popper on the start or end of its reference element side
|
|
1813
1907
|
* @method
|
|
1814
1908
|
* @memberof Popper.modifiers
|
|
1815
1909
|
* @argument {Object} data - The data object generated by `update` method
|
|
1816
1910
|
* @returns {Object} The data object, properly modified
|
|
1817
|
-
*/
|
|
1818
|
-
Popper.prototype.modifiers.shift = function (data) {
|
|
1819
|
-
var placement = data.placement;
|
|
1820
|
-
var basePlacement = placement.split('-')[0];
|
|
1821
|
-
var shiftVariation = placement.split('-')[1];
|
|
1822
|
-
|
|
1823
|
-
// if shift shiftVariation is specified, run the modifier
|
|
1824
|
-
if (shiftVariation) {
|
|
1825
|
-
var reference = data.offsets.reference;
|
|
1826
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
1827
|
-
|
|
1828
|
-
var shiftOffsets = {
|
|
1829
|
-
y: {
|
|
1830
|
-
start: { top: reference.top },
|
|
1831
|
-
end: { top: reference.top + reference.height - popper.height }
|
|
1832
|
-
},
|
|
1833
|
-
x: {
|
|
1834
|
-
start: { left: reference.left },
|
|
1835
|
-
end: { left: reference.left + reference.width - popper.width }
|
|
1836
|
-
}
|
|
1837
|
-
};
|
|
1838
|
-
|
|
1839
|
-
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
1840
|
-
|
|
1841
|
-
data.offsets.popper = Object.assign(
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1911
|
+
*/
|
|
1912
|
+
Popper.prototype.modifiers.shift = function (data) {
|
|
1913
|
+
var placement = data.placement;
|
|
1914
|
+
var basePlacement = placement.split('-')[0];
|
|
1915
|
+
var shiftVariation = placement.split('-')[1];
|
|
1916
|
+
|
|
1917
|
+
// if shift shiftVariation is specified, run the modifier
|
|
1918
|
+
if (shiftVariation) {
|
|
1919
|
+
var reference = data.offsets.reference;
|
|
1920
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1921
|
+
|
|
1922
|
+
var shiftOffsets = {
|
|
1923
|
+
y: {
|
|
1924
|
+
start: { top: reference.top },
|
|
1925
|
+
end: { top: reference.top + reference.height - popper.height }
|
|
1926
|
+
},
|
|
1927
|
+
x: {
|
|
1928
|
+
start: { left: reference.left },
|
|
1929
|
+
end: { left: reference.left + reference.width - popper.width }
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
1934
|
+
|
|
1935
|
+
data.offsets.popper = Object.assign(
|
|
1936
|
+
popper,
|
|
1937
|
+
shiftOffsets[axis][shiftVariation]
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
return data;
|
|
1942
|
+
};
|
|
1943
|
+
|
|
1847
1944
|
/**
|
|
1848
1945
|
* Modifier used to make sure the popper does not overflows from it's boundaries
|
|
1849
1946
|
* @method
|
|
1850
1947
|
* @memberof Popper.modifiers
|
|
1851
1948
|
* @argument {Object} data - The data object generated by `update` method
|
|
1852
1949
|
* @returns {Object} The data object, properly modified
|
|
1853
|
-
*/
|
|
1854
|
-
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
1855
|
-
var order = this._options.preventOverflowOrder;
|
|
1856
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
1857
|
-
|
|
1858
|
-
var check = {
|
|
1859
|
-
left: function
|
|
1860
|
-
var left = popper.left;
|
|
1861
|
-
if (popper.left < data.boundaries.left) {
|
|
1862
|
-
left = Math.max(popper.left, data.boundaries.left);
|
|
1863
|
-
}
|
|
1864
|
-
return { left: left };
|
|
1865
|
-
},
|
|
1866
|
-
right: function
|
|
1867
|
-
var left = popper.left;
|
|
1868
|
-
if (popper.right > data.boundaries.right) {
|
|
1869
|
-
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
1870
|
-
}
|
|
1871
|
-
return { left: left };
|
|
1872
|
-
},
|
|
1873
|
-
top: function
|
|
1874
|
-
var top = popper.top;
|
|
1875
|
-
if (popper.top < data.boundaries.top) {
|
|
1876
|
-
top = Math.max(popper.top, data.boundaries.top);
|
|
1877
|
-
}
|
|
1878
|
-
return { top: top };
|
|
1879
|
-
},
|
|
1880
|
-
bottom: function
|
|
1881
|
-
var top = popper.top;
|
|
1882
|
-
if (popper.bottom > data.boundaries.bottom) {
|
|
1883
|
-
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
1884
|
-
}
|
|
1885
|
-
return { top: top };
|
|
1886
|
-
}
|
|
1887
|
-
};
|
|
1888
|
-
|
|
1889
|
-
order.forEach(function (direction) {
|
|
1890
|
-
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
1891
|
-
});
|
|
1892
|
-
|
|
1893
|
-
return data;
|
|
1894
|
-
};
|
|
1895
|
-
|
|
1950
|
+
*/
|
|
1951
|
+
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
1952
|
+
var order = this._options.preventOverflowOrder;
|
|
1953
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1954
|
+
|
|
1955
|
+
var check = {
|
|
1956
|
+
left: function () {
|
|
1957
|
+
var left = popper.left;
|
|
1958
|
+
if (popper.left < data.boundaries.left) {
|
|
1959
|
+
left = Math.max(popper.left, data.boundaries.left);
|
|
1960
|
+
}
|
|
1961
|
+
return { left: left };
|
|
1962
|
+
},
|
|
1963
|
+
right: function () {
|
|
1964
|
+
var left = popper.left;
|
|
1965
|
+
if (popper.right > data.boundaries.right) {
|
|
1966
|
+
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
1967
|
+
}
|
|
1968
|
+
return { left: left };
|
|
1969
|
+
},
|
|
1970
|
+
top: function () {
|
|
1971
|
+
var top = popper.top;
|
|
1972
|
+
if (popper.top < data.boundaries.top) {
|
|
1973
|
+
top = Math.max(popper.top, data.boundaries.top);
|
|
1974
|
+
}
|
|
1975
|
+
return { top: top };
|
|
1976
|
+
},
|
|
1977
|
+
bottom: function () {
|
|
1978
|
+
var top = popper.top;
|
|
1979
|
+
if (popper.bottom > data.boundaries.bottom) {
|
|
1980
|
+
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
1981
|
+
}
|
|
1982
|
+
return { top: top };
|
|
1983
|
+
}
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1986
|
+
order.forEach(function (direction) {
|
|
1987
|
+
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
1988
|
+
});
|
|
1989
|
+
|
|
1990
|
+
return data;
|
|
1991
|
+
};
|
|
1992
|
+
|
|
1896
1993
|
/**
|
|
1897
1994
|
* Modifier used to make sure the popper is always near its reference
|
|
1898
1995
|
* @method
|
|
1899
1996
|
* @memberof Popper.modifiers
|
|
1900
1997
|
* @argument {Object} data - The data object generated by _update method
|
|
1901
1998
|
* @returns {Object} The data object, properly modified
|
|
1902
|
-
*/
|
|
1903
|
-
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
1904
|
-
var popper = getPopperClientRect(data.offsets.popper);
|
|
1905
|
-
var reference = data.offsets.reference;
|
|
1906
|
-
var f = Math.floor;
|
|
1907
|
-
|
|
1908
|
-
if (popper.right < f(reference.left)) {
|
|
1909
|
-
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
1910
|
-
}
|
|
1911
|
-
if (popper.left > f(reference.right)) {
|
|
1912
|
-
data.offsets.popper.left = f(reference.right);
|
|
1913
|
-
}
|
|
1914
|
-
if (popper.bottom < f(reference.top)) {
|
|
1915
|
-
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
1916
|
-
}
|
|
1917
|
-
if (popper.top > f(reference.bottom)) {
|
|
1918
|
-
data.offsets.popper.top = f(reference.bottom);
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
return data;
|
|
1922
|
-
};
|
|
1923
|
-
|
|
1999
|
+
*/
|
|
2000
|
+
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
2001
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
2002
|
+
var reference = data.offsets.reference;
|
|
2003
|
+
var f = Math.floor;
|
|
2004
|
+
|
|
2005
|
+
if (popper.right < f(reference.left)) {
|
|
2006
|
+
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
2007
|
+
}
|
|
2008
|
+
if (popper.left > f(reference.right)) {
|
|
2009
|
+
data.offsets.popper.left = f(reference.right);
|
|
2010
|
+
}
|
|
2011
|
+
if (popper.bottom < f(reference.top)) {
|
|
2012
|
+
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
2013
|
+
}
|
|
2014
|
+
if (popper.top > f(reference.bottom)) {
|
|
2015
|
+
data.offsets.popper.top = f(reference.bottom);
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
return data;
|
|
2019
|
+
};
|
|
2020
|
+
|
|
1924
2021
|
/**
|
|
1925
2022
|
* Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
|
|
1926
2023
|
* Requires the `preventOverflow` modifier before it in order to work.
|
|
@@ -1929,61 +2026,81 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1929
2026
|
* @memberof Popper.modifiers
|
|
1930
2027
|
* @argument {Object} data - The data object generated by _update method
|
|
1931
2028
|
* @returns {Object} The data object, properly modified
|
|
1932
|
-
*/
|
|
1933
|
-
Popper.prototype.modifiers.flip = function (data) {
|
|
1934
|
-
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
1935
|
-
// otherwise flip would not work as expected.
|
|
1936
|
-
if (
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
flipOrder
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2029
|
+
*/
|
|
2030
|
+
Popper.prototype.modifiers.flip = function (data) {
|
|
2031
|
+
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
2032
|
+
// otherwise flip would not work as expected.
|
|
2033
|
+
if (
|
|
2034
|
+
!this.isModifierRequired(
|
|
2035
|
+
this.modifiers.flip,
|
|
2036
|
+
this.modifiers.preventOverflow
|
|
2037
|
+
)
|
|
2038
|
+
) {
|
|
2039
|
+
console.warn(
|
|
2040
|
+
'WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!'
|
|
2041
|
+
);
|
|
2042
|
+
return data;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
if (data.flipped && data.placement === data._originalPlacement) {
|
|
2046
|
+
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
|
2047
|
+
return data;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
var placement = data.placement.split('-')[0];
|
|
2051
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
2052
|
+
var variation = data.placement.split('-')[1] || '';
|
|
2053
|
+
|
|
2054
|
+
var flipOrder = [];
|
|
2055
|
+
if (this._options.flipBehavior === 'flip') {
|
|
2056
|
+
flipOrder = [placement, placementOpposite];
|
|
2057
|
+
} else {
|
|
2058
|
+
flipOrder = this._options.flipBehavior;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
flipOrder.forEach(
|
|
2062
|
+
function (step, index) {
|
|
2063
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
2064
|
+
return;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
placement = data.placement.split('-')[0];
|
|
2068
|
+
placementOpposite = getOppositePlacement(placement);
|
|
2069
|
+
|
|
2070
|
+
var popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
2071
|
+
|
|
2072
|
+
// this boolean is used to distinguish right and bottom from top and left
|
|
2073
|
+
// they need different computations to get flipped
|
|
2074
|
+
var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
|
2075
|
+
|
|
2076
|
+
// using Math.floor because the reference offsets may contain decimals we are not going to consider here
|
|
2077
|
+
if (
|
|
2078
|
+
(a &&
|
|
2079
|
+
Math.floor(data.offsets.reference[placement]) >
|
|
2080
|
+
Math.floor(popperOffsets[placementOpposite])) ||
|
|
2081
|
+
(!a &&
|
|
2082
|
+
Math.floor(data.offsets.reference[placement]) <
|
|
2083
|
+
Math.floor(popperOffsets[placementOpposite]))
|
|
2084
|
+
) {
|
|
2085
|
+
// we'll use this boolean to detect any flip loop
|
|
2086
|
+
data.flipped = true;
|
|
2087
|
+
data.placement = flipOrder[index + 1];
|
|
2088
|
+
if (variation) {
|
|
2089
|
+
data.placement += '-' + variation;
|
|
2090
|
+
}
|
|
2091
|
+
data.offsets.popper = this._getOffsets(
|
|
2092
|
+
this._popper,
|
|
2093
|
+
this._reference,
|
|
2094
|
+
data.placement
|
|
2095
|
+
).popper;
|
|
2096
|
+
|
|
2097
|
+
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
2098
|
+
}
|
|
2099
|
+
}.bind(this)
|
|
2100
|
+
);
|
|
2101
|
+
return data;
|
|
2102
|
+
};
|
|
2103
|
+
|
|
1987
2104
|
/**
|
|
1988
2105
|
* Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
|
|
1989
2106
|
* The offsets will shift the popper on the side of its reference element.
|
|
@@ -1991,23 +2108,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
1991
2108
|
* @memberof Popper.modifiers
|
|
1992
2109
|
* @argument {Object} data - The data object generated by _update method
|
|
1993
2110
|
* @returns {Object} The data object, properly modified
|
|
1994
|
-
*/
|
|
1995
|
-
Popper.prototype.modifiers.offset = function (data) {
|
|
1996
|
-
var offset = this._options.offset;
|
|
1997
|
-
var popper = data.offsets.popper;
|
|
1998
|
-
|
|
1999
|
-
if (data.placement.indexOf('left') !== -1) {
|
|
2000
|
-
popper.top -= offset;
|
|
2001
|
-
} else if (data.placement.indexOf('right') !== -1) {
|
|
2002
|
-
popper.top += offset;
|
|
2003
|
-
} else if (data.placement.indexOf('top') !== -1) {
|
|
2004
|
-
popper.left -= offset;
|
|
2005
|
-
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
2006
|
-
popper.left += offset;
|
|
2007
|
-
}
|
|
2008
|
-
return data;
|
|
2009
|
-
};
|
|
2010
|
-
|
|
2111
|
+
*/
|
|
2112
|
+
Popper.prototype.modifiers.offset = function (data) {
|
|
2113
|
+
var offset = this._options.offset;
|
|
2114
|
+
var popper = data.offsets.popper;
|
|
2115
|
+
|
|
2116
|
+
if (data.placement.indexOf('left') !== -1) {
|
|
2117
|
+
popper.top -= offset;
|
|
2118
|
+
} else if (data.placement.indexOf('right') !== -1) {
|
|
2119
|
+
popper.top += offset;
|
|
2120
|
+
} else if (data.placement.indexOf('top') !== -1) {
|
|
2121
|
+
popper.left -= offset;
|
|
2122
|
+
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
2123
|
+
popper.left += offset;
|
|
2124
|
+
}
|
|
2125
|
+
return data;
|
|
2126
|
+
};
|
|
2127
|
+
|
|
2011
2128
|
/**
|
|
2012
2129
|
* 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
|
|
2013
2130
|
* It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
|
|
@@ -2015,136 +2132,147 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2015
2132
|
* @memberof Popper.modifiers
|
|
2016
2133
|
* @argument {Object} data - The data object generated by _update method
|
|
2017
2134
|
* @returns {Object} The data object, properly modified
|
|
2018
|
-
*/
|
|
2019
|
-
Popper.prototype.modifiers.arrow = function (data) {
|
|
2020
|
-
var arrow = this._options.arrowElement;
|
|
2021
|
-
var arrowOffset = this._options.arrowOffset;
|
|
2022
|
-
|
|
2023
|
-
// if the arrowElement is a string, suppose it's a CSS selector
|
|
2024
|
-
if (typeof arrow === 'string') {
|
|
2025
|
-
arrow = this._popper.querySelector(arrow);
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
// if arrow element is not found, don't run the modifier
|
|
2029
|
-
if (!arrow) {
|
|
2030
|
-
return data;
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
// the arrow element must be child of its popper
|
|
2034
|
-
if (!this._popper.contains(arrow)) {
|
|
2035
|
-
console.warn(
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
var
|
|
2055
|
-
var
|
|
2056
|
-
var
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
//
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
//
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2135
|
+
*/
|
|
2136
|
+
Popper.prototype.modifiers.arrow = function (data) {
|
|
2137
|
+
var arrow = this._options.arrowElement;
|
|
2138
|
+
var arrowOffset = this._options.arrowOffset;
|
|
2139
|
+
|
|
2140
|
+
// if the arrowElement is a string, suppose it's a CSS selector
|
|
2141
|
+
if (typeof arrow === 'string') {
|
|
2142
|
+
arrow = this._popper.querySelector(arrow);
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
// if arrow element is not found, don't run the modifier
|
|
2146
|
+
if (!arrow) {
|
|
2147
|
+
return data;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
// the arrow element must be child of its popper
|
|
2151
|
+
if (!this._popper.contains(arrow)) {
|
|
2152
|
+
console.warn(
|
|
2153
|
+
'WARNING: `arrowElement` must be child of its popper element!'
|
|
2154
|
+
);
|
|
2155
|
+
return data;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
// arrow depends on keepTogether in order to work
|
|
2159
|
+
if (
|
|
2160
|
+
!this.isModifierRequired(
|
|
2161
|
+
this.modifiers.arrow,
|
|
2162
|
+
this.modifiers.keepTogether
|
|
2163
|
+
)
|
|
2164
|
+
) {
|
|
2165
|
+
console.warn(
|
|
2166
|
+
'WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!'
|
|
2167
|
+
);
|
|
2168
|
+
return data;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
var arrowStyle = {};
|
|
2172
|
+
var placement = data.placement.split('-')[0];
|
|
2173
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
2174
|
+
var reference = data.offsets.reference;
|
|
2175
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
2176
|
+
|
|
2177
|
+
var len = isVertical ? 'height' : 'width';
|
|
2178
|
+
var side = isVertical ? 'top' : 'left';
|
|
2179
|
+
var translate = isVertical ? 'translateY' : 'translateX';
|
|
2180
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
2181
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
2182
|
+
var arrowSize = getOuterSizes(arrow)[len];
|
|
2183
|
+
|
|
2184
|
+
//
|
|
2185
|
+
// extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
|
|
2186
|
+
//
|
|
2187
|
+
|
|
2188
|
+
// top/left side
|
|
2189
|
+
if (reference[opSide] - arrowSize < popper[side]) {
|
|
2190
|
+
data.offsets.popper[side] -=
|
|
2191
|
+
popper[side] - (reference[opSide] - arrowSize);
|
|
2192
|
+
}
|
|
2193
|
+
// bottom/right side
|
|
2194
|
+
if (reference[side] + arrowSize > popper[opSide]) {
|
|
2195
|
+
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
// compute center of the popper
|
|
2199
|
+
var center =
|
|
2200
|
+
reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
|
2201
|
+
|
|
2202
|
+
var sideValue = center - popper[side];
|
|
2203
|
+
|
|
2204
|
+
// prevent arrow from being placed not contiguously to its popper
|
|
2205
|
+
sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
|
2206
|
+
arrowStyle[side] = sideValue;
|
|
2207
|
+
arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
|
|
2208
|
+
|
|
2209
|
+
data.offsets.arrow = arrowStyle;
|
|
2210
|
+
data.arrowElement = arrow;
|
|
2211
|
+
|
|
2212
|
+
return data;
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
//
|
|
2216
|
+
// Helpers
|
|
2217
|
+
//
|
|
2218
|
+
|
|
2091
2219
|
/**
|
|
2092
2220
|
* Get the outer sizes of the given element (offset size + margins)
|
|
2093
2221
|
* @function
|
|
2094
2222
|
* @ignore
|
|
2095
2223
|
* @argument {Element} element
|
|
2096
2224
|
* @returns {Object} object containing width and height properties
|
|
2097
|
-
*/
|
|
2098
|
-
function getOuterSizes(element) {
|
|
2099
|
-
// NOTE: 1 DOM access here
|
|
2100
|
-
var _display = element.style.display,
|
|
2101
|
-
|
|
2102
|
-
element.style.display = 'block';
|
|
2103
|
-
element.style.visibility = 'hidden';
|
|
2104
|
-
var calcWidthToForceRepaint = element.offsetWidth;
|
|
2105
|
-
// original method
|
|
2106
|
-
var styles = root.getComputedStyle(element);
|
|
2107
|
-
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
2108
|
-
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
2109
|
-
var result = {
|
|
2110
|
-
width: element.offsetWidth + y,
|
|
2111
|
-
height: element.offsetHeight + x
|
|
2112
|
-
};
|
|
2113
|
-
|
|
2114
|
-
// reset element styles
|
|
2115
|
-
element.style.display = _display;
|
|
2116
|
-
element.style.visibility = _visibility;
|
|
2117
|
-
return result;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2225
|
+
*/
|
|
2226
|
+
function getOuterSizes(element) {
|
|
2227
|
+
// NOTE: 1 DOM access here
|
|
2228
|
+
var _display = element.style.display,
|
|
2229
|
+
_visibility = element.style.visibility;
|
|
2230
|
+
element.style.display = 'block';
|
|
2231
|
+
element.style.visibility = 'hidden';
|
|
2232
|
+
var calcWidthToForceRepaint = element.offsetWidth;
|
|
2233
|
+
// original method
|
|
2234
|
+
var styles = root.getComputedStyle(element);
|
|
2235
|
+
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
2236
|
+
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
2237
|
+
var result = {
|
|
2238
|
+
width: element.offsetWidth + y,
|
|
2239
|
+
height: element.offsetHeight + x
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2242
|
+
// reset element styles
|
|
2243
|
+
element.style.display = _display;
|
|
2244
|
+
element.style.visibility = _visibility;
|
|
2245
|
+
return result;
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2120
2248
|
/**
|
|
2121
2249
|
* Get the opposite placement of the given one/
|
|
2122
2250
|
* @function
|
|
2123
2251
|
* @ignore
|
|
2124
2252
|
* @argument {String} placement
|
|
2125
2253
|
* @returns {String} flipped placement
|
|
2126
|
-
*/
|
|
2127
|
-
function getOppositePlacement(placement) {
|
|
2128
|
-
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
2129
|
-
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
2130
|
-
return hash[matched];
|
|
2131
|
-
});
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2254
|
+
*/
|
|
2255
|
+
function getOppositePlacement(placement) {
|
|
2256
|
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
2257
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
2258
|
+
return hash[matched];
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2134
2262
|
/**
|
|
2135
2263
|
* Given the popper offsets, generate an output similar to getBoundingClientRect
|
|
2136
2264
|
* @function
|
|
2137
2265
|
* @ignore
|
|
2138
2266
|
* @argument {Object} popperOffsets
|
|
2139
2267
|
* @returns {Object} ClientRect like output
|
|
2140
|
-
*/
|
|
2141
|
-
function getPopperClientRect(popperOffsets) {
|
|
2142
|
-
var offsets = Object.assign({}, popperOffsets);
|
|
2143
|
-
offsets.right = offsets.left + offsets.width;
|
|
2144
|
-
offsets.bottom = offsets.top + offsets.height;
|
|
2145
|
-
return offsets;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2268
|
+
*/
|
|
2269
|
+
function getPopperClientRect(popperOffsets) {
|
|
2270
|
+
var offsets = Object.assign({}, popperOffsets);
|
|
2271
|
+
offsets.right = offsets.left + offsets.width;
|
|
2272
|
+
offsets.bottom = offsets.top + offsets.height;
|
|
2273
|
+
return offsets;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2148
2276
|
/**
|
|
2149
2277
|
* Given an array and the key to find, returns its index
|
|
2150
2278
|
* @function
|
|
@@ -2152,76 +2280,88 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2152
2280
|
* @argument {Array} arr
|
|
2153
2281
|
* @argument keyToFind
|
|
2154
2282
|
* @returns index or null
|
|
2155
|
-
*/
|
|
2156
|
-
function getArrayKeyIndex(arr, keyToFind) {
|
|
2157
|
-
var i = 0,
|
|
2158
|
-
|
|
2159
|
-
for (key in arr) {
|
|
2160
|
-
if (arr[key] === keyToFind) {
|
|
2161
|
-
return i;
|
|
2162
|
-
}
|
|
2163
|
-
i++;
|
|
2164
|
-
}
|
|
2165
|
-
return null;
|
|
2166
|
-
}
|
|
2167
|
-
|
|
2283
|
+
*/
|
|
2284
|
+
function getArrayKeyIndex(arr, keyToFind) {
|
|
2285
|
+
var i = 0,
|
|
2286
|
+
key;
|
|
2287
|
+
for (key in arr) {
|
|
2288
|
+
if (arr[key] === keyToFind) {
|
|
2289
|
+
return i;
|
|
2290
|
+
}
|
|
2291
|
+
i++;
|
|
2292
|
+
}
|
|
2293
|
+
return null;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2168
2296
|
/**
|
|
2169
2297
|
* Get CSS computed property of the given element
|
|
2170
2298
|
* @function
|
|
2171
2299
|
* @ignore
|
|
2172
2300
|
* @argument {Eement} element
|
|
2173
2301
|
* @argument {String} property
|
|
2174
|
-
*/
|
|
2175
|
-
function getStyleComputedProperty(element, property) {
|
|
2176
|
-
// NOTE: 1 DOM access here
|
|
2177
|
-
var css = root.getComputedStyle(element, null);
|
|
2178
|
-
return css[property];
|
|
2179
|
-
}
|
|
2302
|
+
*/
|
|
2303
|
+
function getStyleComputedProperty(element, property) {
|
|
2304
|
+
// NOTE: 1 DOM access here
|
|
2305
|
+
var css = root.getComputedStyle(element, null);
|
|
2306
|
+
return css[property];
|
|
2307
|
+
}
|
|
2180
2308
|
/**
|
|
2181
2309
|
* Returns the offset parent of the given element
|
|
2182
2310
|
* @function
|
|
2183
2311
|
* @ignore
|
|
2184
2312
|
* @argument {Element} element
|
|
2185
2313
|
* @returns {Element} offset parent
|
|
2186
|
-
*/
|
|
2187
|
-
function getOffsetParent(element) {
|
|
2188
|
-
var offsetParent = element.offsetParent;
|
|
2189
|
-
return offsetParent === root.document.body || !offsetParent
|
|
2190
|
-
|
|
2191
|
-
|
|
2314
|
+
*/
|
|
2315
|
+
function getOffsetParent(element) {
|
|
2316
|
+
var offsetParent = element.offsetParent;
|
|
2317
|
+
return offsetParent === root.document.body || !offsetParent
|
|
2318
|
+
? root.document.documentElement
|
|
2319
|
+
: offsetParent;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2192
2322
|
/**
|
|
2193
2323
|
* Returns the scrolling parent of the given element
|
|
2194
2324
|
* @function
|
|
2195
2325
|
* @ignore
|
|
2196
2326
|
* @argument {Element} element
|
|
2197
2327
|
* @returns {Element} offset parent
|
|
2198
|
-
*/
|
|
2199
|
-
function getScrollParent(element) {
|
|
2200
|
-
var parent = element.parentNode;
|
|
2201
|
-
if (!parent || parent.nodeType !== 1) {
|
|
2202
|
-
return element;
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
if (parent === root.document) {
|
|
2206
|
-
// Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
|
|
2207
|
-
// greater than 0 and return the proper element
|
|
2208
|
-
if (root.document.body.scrollTop || root.document.body.scrollLeft) {
|
|
2209
|
-
return root.document.body;
|
|
2210
|
-
} else {
|
|
2211
|
-
return root.document.documentElement;
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
// Firefox want us to check `-x` and `-y` variations as well
|
|
2216
|
-
if (
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2328
|
+
*/
|
|
2329
|
+
function getScrollParent(element) {
|
|
2330
|
+
var parent = element.parentNode;
|
|
2331
|
+
if (!parent || parent.nodeType !== 1) {
|
|
2332
|
+
return element;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
if (parent === root.document) {
|
|
2336
|
+
// Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
|
|
2337
|
+
// greater than 0 and return the proper element
|
|
2338
|
+
if (root.document.body.scrollTop || root.document.body.scrollLeft) {
|
|
2339
|
+
return root.document.body;
|
|
2340
|
+
} else {
|
|
2341
|
+
return root.document.documentElement;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
// Firefox want us to check `-x` and `-y` variations as well
|
|
2346
|
+
if (
|
|
2347
|
+
['scroll', 'auto'].indexOf(
|
|
2348
|
+
getStyleComputedProperty(parent, 'overflow')
|
|
2349
|
+
) !== -1 ||
|
|
2350
|
+
['scroll', 'auto'].indexOf(
|
|
2351
|
+
getStyleComputedProperty(parent, 'overflow-x')
|
|
2352
|
+
) !== -1 ||
|
|
2353
|
+
['scroll', 'auto'].indexOf(
|
|
2354
|
+
getStyleComputedProperty(parent, 'overflow-y')
|
|
2355
|
+
) !== -1
|
|
2356
|
+
) {
|
|
2357
|
+
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
|
2358
|
+
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
|
2359
|
+
// fixes issue #65
|
|
2360
|
+
return parent;
|
|
2361
|
+
}
|
|
2362
|
+
return getScrollParent(element.parentNode);
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2225
2365
|
/**
|
|
2226
2366
|
* Check if the given element is fixed or is inside a fixed parent
|
|
2227
2367
|
* @function
|
|
@@ -2229,109 +2369,122 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2229
2369
|
* @argument {Element} element
|
|
2230
2370
|
* @argument {Element} customContainer
|
|
2231
2371
|
* @returns {Boolean} answer to "isFixed?"
|
|
2232
|
-
*/
|
|
2233
|
-
function isFixed(element) {
|
|
2234
|
-
if (element === root.document.body) {
|
|
2235
|
-
return false;
|
|
2236
|
-
}
|
|
2237
|
-
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
2238
|
-
return true;
|
|
2239
|
-
}
|
|
2240
|
-
return element.parentNode && element.parentNode.nodeType === 1
|
|
2241
|
-
|
|
2242
|
-
|
|
2372
|
+
*/
|
|
2373
|
+
function isFixed(element) {
|
|
2374
|
+
if (element === root.document.body) {
|
|
2375
|
+
return false;
|
|
2376
|
+
}
|
|
2377
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
2378
|
+
return true;
|
|
2379
|
+
}
|
|
2380
|
+
return element.parentNode && element.parentNode.nodeType === 1
|
|
2381
|
+
? isFixed(element.parentNode)
|
|
2382
|
+
: element;
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2243
2385
|
/**
|
|
2244
2386
|
* Set the style to the given popper
|
|
2245
2387
|
* @function
|
|
2246
2388
|
* @ignore
|
|
2247
2389
|
* @argument {Element} element - Element to apply the style to
|
|
2248
2390
|
* @argument {Object} styles - Object with a list of properties and values which will be applied to the element
|
|
2249
|
-
*/
|
|
2250
|
-
function setStyle(element, styles) {
|
|
2251
|
-
function is_numeric(n) {
|
|
2252
|
-
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
2253
|
-
}
|
|
2254
|
-
Object.keys(styles).forEach(function (prop) {
|
|
2255
|
-
var unit = '';
|
|
2256
|
-
// add unit if the value is numeric and is one of the following
|
|
2257
|
-
if (
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2391
|
+
*/
|
|
2392
|
+
function setStyle(element, styles) {
|
|
2393
|
+
function is_numeric(n) {
|
|
2394
|
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
2395
|
+
}
|
|
2396
|
+
Object.keys(styles).forEach(function (prop) {
|
|
2397
|
+
var unit = '';
|
|
2398
|
+
// add unit if the value is numeric and is one of the following
|
|
2399
|
+
if (
|
|
2400
|
+
['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==
|
|
2401
|
+
-1 &&
|
|
2402
|
+
is_numeric(styles[prop])
|
|
2403
|
+
) {
|
|
2404
|
+
unit = 'px';
|
|
2405
|
+
}
|
|
2406
|
+
element.style[prop] = styles[prop] + unit;
|
|
2407
|
+
});
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2264
2410
|
/**
|
|
2265
2411
|
* Check if the given variable is a function
|
|
2266
2412
|
* @function
|
|
2267
2413
|
* @ignore
|
|
2268
2414
|
* @argument {*} functionToCheck - variable to check
|
|
2269
2415
|
* @returns {Boolean} answer to: is a function?
|
|
2270
|
-
*/
|
|
2271
|
-
function isFunction(functionToCheck) {
|
|
2272
|
-
var getType = {};
|
|
2273
|
-
return
|
|
2274
|
-
|
|
2275
|
-
|
|
2416
|
+
*/
|
|
2417
|
+
function isFunction(functionToCheck) {
|
|
2418
|
+
var getType = {};
|
|
2419
|
+
return (
|
|
2420
|
+
functionToCheck &&
|
|
2421
|
+
getType.toString.call(functionToCheck) === '[object Function]'
|
|
2422
|
+
);
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2276
2425
|
/**
|
|
2277
2426
|
* Get the position of the given element, relative to its offset parent
|
|
2278
2427
|
* @function
|
|
2279
2428
|
* @ignore
|
|
2280
2429
|
* @param {Element} element
|
|
2281
2430
|
* @return {Object} position - Coordinates of the element and its `scrollTop`
|
|
2282
|
-
*/
|
|
2283
|
-
function getOffsetRect(element) {
|
|
2284
|
-
var transform = getStyle(element, 'transform')
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2431
|
+
*/
|
|
2432
|
+
function getOffsetRect(element) {
|
|
2433
|
+
var transform = getStyle(element, 'transform')
|
|
2434
|
+
.replace(/[^0-9\-,]/g, '')
|
|
2435
|
+
.split(',');
|
|
2436
|
+
var elementRect = {
|
|
2437
|
+
width: element.offsetWidth,
|
|
2438
|
+
height: element.offsetHeight,
|
|
2439
|
+
left:
|
|
2440
|
+
element.offsetLeft + (transform[4] ? parseInt(transform[4], 10) : 0),
|
|
2441
|
+
top: element.offsetTop + (transform[5] ? parseInt(transform[5], 10) : 0)
|
|
2442
|
+
};
|
|
2443
|
+
|
|
2444
|
+
elementRect.right = elementRect.left + elementRect.width;
|
|
2445
|
+
elementRect.bottom = elementRect.top + elementRect.height;
|
|
2446
|
+
|
|
2447
|
+
// position
|
|
2448
|
+
return elementRect;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2299
2451
|
/**
|
|
2300
2452
|
* Get bounding client rect of given element
|
|
2301
2453
|
* @function
|
|
2302
2454
|
* @ignore
|
|
2303
2455
|
* @param {HTMLElement} element
|
|
2304
2456
|
* @return {Object} client rect
|
|
2305
|
-
*/
|
|
2306
|
-
function getBoundingClientRect(element) {
|
|
2307
|
-
var rect = element.getBoundingClientRect();
|
|
2308
|
-
|
|
2309
|
-
// whether the IE version is lower than 11
|
|
2310
|
-
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
2311
|
-
|
|
2312
|
-
// fix ie document bounding top always 0 bug
|
|
2313
|
-
var rectTop =
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2457
|
+
*/
|
|
2458
|
+
function getBoundingClientRect(element) {
|
|
2459
|
+
var rect = element.getBoundingClientRect();
|
|
2460
|
+
|
|
2461
|
+
// whether the IE version is lower than 11
|
|
2462
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
2463
|
+
|
|
2464
|
+
// fix ie document bounding top always 0 bug
|
|
2465
|
+
var rectTop =
|
|
2466
|
+
isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
|
|
2467
|
+
|
|
2468
|
+
return {
|
|
2469
|
+
left: rect.left,
|
|
2470
|
+
top: rectTop,
|
|
2471
|
+
right: rect.right,
|
|
2472
|
+
bottom: rect.bottom,
|
|
2473
|
+
width: rect.right - rect.left,
|
|
2474
|
+
height: rect.bottom - rectTop
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
function getStyle(dom, attr) {
|
|
2479
|
+
if (dom.style[attr]) {
|
|
2480
|
+
return dom.style[attr];
|
|
2481
|
+
}
|
|
2482
|
+
if (window.getComputedStyle) {
|
|
2483
|
+
return getComputedStyle(dom, null)[attr];
|
|
2484
|
+
}
|
|
2485
|
+
return dom.currentStyle[attr];
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2335
2488
|
/**
|
|
2336
2489
|
* Given an element and one of its parents, return the offset
|
|
2337
2490
|
* @function
|
|
@@ -2339,49 +2492,51 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2339
2492
|
* @param {HTMLElement} element
|
|
2340
2493
|
* @param {HTMLElement} parent
|
|
2341
2494
|
* @return {Object} rect
|
|
2342
|
-
*/
|
|
2343
|
-
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
2344
|
-
var elementRect = getBoundingClientRect(element);
|
|
2345
|
-
var parentRect = getBoundingClientRect(parent);
|
|
2346
|
-
|
|
2347
|
-
if (fixed) {
|
|
2348
|
-
var scrollParent = getScrollParent(parent);
|
|
2349
|
-
parentRect.top += scrollParent.scrollTop;
|
|
2350
|
-
parentRect.bottom += scrollParent.scrollTop;
|
|
2351
|
-
parentRect.left += scrollParent.scrollLeft;
|
|
2352
|
-
parentRect.right += scrollParent.scrollLeft;
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
var rect = {
|
|
2356
|
-
top: elementRect.top - parentRect.top,
|
|
2357
|
-
left: elementRect.left - parentRect.left,
|
|
2358
|
-
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
2359
|
-
right: elementRect.left - parentRect.left + elementRect.width,
|
|
2360
|
-
width: elementRect.width,
|
|
2361
|
-
height: elementRect.height
|
|
2362
|
-
};
|
|
2363
|
-
return rect;
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2495
|
+
*/
|
|
2496
|
+
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
2497
|
+
var elementRect = getBoundingClientRect(element);
|
|
2498
|
+
var parentRect = getBoundingClientRect(parent);
|
|
2499
|
+
|
|
2500
|
+
if (fixed) {
|
|
2501
|
+
var scrollParent = getScrollParent(parent);
|
|
2502
|
+
parentRect.top += scrollParent.scrollTop;
|
|
2503
|
+
parentRect.bottom += scrollParent.scrollTop;
|
|
2504
|
+
parentRect.left += scrollParent.scrollLeft;
|
|
2505
|
+
parentRect.right += scrollParent.scrollLeft;
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
var rect = {
|
|
2509
|
+
top: elementRect.top - parentRect.top,
|
|
2510
|
+
left: elementRect.left - parentRect.left,
|
|
2511
|
+
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
2512
|
+
right: elementRect.left - parentRect.left + elementRect.width,
|
|
2513
|
+
width: elementRect.width,
|
|
2514
|
+
height: elementRect.height
|
|
2515
|
+
};
|
|
2516
|
+
return rect;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2366
2519
|
/**
|
|
2367
2520
|
* Get the prefixed supported property name
|
|
2368
2521
|
* @function
|
|
2369
2522
|
* @ignore
|
|
2370
2523
|
* @argument {String} property (camelCase)
|
|
2371
2524
|
* @returns {String} prefixed property (camelCase)
|
|
2372
|
-
*/
|
|
2373
|
-
function getSupportedPropertyName(property) {
|
|
2374
|
-
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
2375
|
-
|
|
2376
|
-
for (var i = 0; i < prefixes.length; i++) {
|
|
2377
|
-
var toCheck = prefixes[i]
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2525
|
+
*/
|
|
2526
|
+
function getSupportedPropertyName(property) {
|
|
2527
|
+
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
2528
|
+
|
|
2529
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
2530
|
+
var toCheck = prefixes[i]
|
|
2531
|
+
? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1)
|
|
2532
|
+
: property;
|
|
2533
|
+
if (typeof root.document.body.style[toCheck] !== 'undefined') {
|
|
2534
|
+
return toCheck;
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
return null;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2385
2540
|
/**
|
|
2386
2541
|
* The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
|
|
2387
2542
|
* objects to a target object. It will return the target object.
|
|
@@ -2389,41 +2544,46 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof =
|
|
|
2389
2544
|
* Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
2390
2545
|
* @function
|
|
2391
2546
|
* @ignore
|
|
2392
|
-
*/
|
|
2393
|
-
if (!Object.assign) {
|
|
2394
|
-
Object.defineProperty(Object, 'assign', {
|
|
2395
|
-
enumerable: false,
|
|
2396
|
-
configurable: true,
|
|
2397
|
-
writable: true,
|
|
2398
|
-
value: function
|
|
2399
|
-
if (target === undefined || target === null) {
|
|
2400
|
-
throw new TypeError('Cannot convert first argument to object');
|
|
2401
|
-
}
|
|
2547
|
+
*/
|
|
2548
|
+
if (!Object.assign) {
|
|
2549
|
+
Object.defineProperty(Object, 'assign', {
|
|
2550
|
+
enumerable: false,
|
|
2551
|
+
configurable: true,
|
|
2552
|
+
writable: true,
|
|
2553
|
+
value: function (target) {
|
|
2554
|
+
if (target === undefined || target === null) {
|
|
2555
|
+
throw new TypeError('Cannot convert first argument to object');
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
var to = Object(target);
|
|
2559
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2560
|
+
var nextSource = arguments[i];
|
|
2561
|
+
if (nextSource === undefined || nextSource === null) {
|
|
2562
|
+
continue;
|
|
2563
|
+
}
|
|
2564
|
+
nextSource = Object(nextSource);
|
|
2565
|
+
|
|
2566
|
+
var keysArray = Object.keys(nextSource);
|
|
2567
|
+
for (
|
|
2568
|
+
var nextIndex = 0, len = keysArray.length;
|
|
2569
|
+
nextIndex < len;
|
|
2570
|
+
nextIndex++
|
|
2571
|
+
) {
|
|
2572
|
+
var nextKey = keysArray[nextIndex];
|
|
2573
|
+
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
2574
|
+
if (desc !== undefined && desc.enumerable) {
|
|
2575
|
+
to[nextKey] = nextSource[nextKey];
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
return to;
|
|
2580
|
+
}
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
return Popper;
|
|
2585
|
+
});
|
|
2402
2586
|
|
|
2403
|
-
var to = Object(target);
|
|
2404
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2405
|
-
var nextSource = arguments[i];
|
|
2406
|
-
if (nextSource === undefined || nextSource === null) {
|
|
2407
|
-
continue;
|
|
2408
|
-
}
|
|
2409
|
-
nextSource = Object(nextSource);
|
|
2410
|
-
|
|
2411
|
-
var keysArray = Object.keys(nextSource);
|
|
2412
|
-
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
|
2413
|
-
var nextKey = keysArray[nextIndex];
|
|
2414
|
-
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
2415
|
-
if (desc !== undefined && desc.enumerable) {
|
|
2416
|
-
to[nextKey] = nextSource[nextKey];
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
return to;
|
|
2421
|
-
}
|
|
2422
|
-
});
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
return Popper;
|
|
2426
|
-
});
|
|
2427
2587
|
|
|
2428
2588
|
/***/ }),
|
|
2429
2589
|
|
|
@@ -3537,7 +3697,7 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
3537
3697
|
|
|
3538
3698
|
/***/ }),
|
|
3539
3699
|
|
|
3540
|
-
/***/
|
|
3700
|
+
/***/ 92:
|
|
3541
3701
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3542
3702
|
|
|
3543
3703
|
"use strict";
|