bk-magic-vue 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bk-magic-vue.css +113 -24
- package/dist/bk-magic-vue.js +1091 -839
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/lib/alert.js +472 -472
- package/lib/back-top.js +1 -1
- package/lib/big-tree.js +3 -3
- package/lib/breadcrumb-item.js +426 -426
- package/lib/breadcrumb.js +438 -438
- package/lib/button.js +509 -509
- package/lib/cascade.js +36 -2
- package/lib/checkbox-group.js +16 -9
- package/lib/checkbox.js +9 -1
- package/lib/container.js +454 -454
- package/lib/date-picker.js +5 -8
- package/lib/dialog.js +8 -9
- package/lib/directives/clickoutside.js +61 -61
- package/lib/directives/copy.js +51 -51
- package/lib/divider.js +446 -446
- package/lib/dropdown-menu.js +1747 -1747
- package/lib/form-item.js +1 -1
- package/lib/image-viewer.js +67 -2
- package/lib/image.js +73 -3
- package/lib/info-box.js +8 -9
- package/lib/link.js +430 -430
- package/lib/locale/lang/en-US.js +153 -143
- package/lib/locale/lang/zh-CN.js +151 -143
- package/lib/message.js +1 -1
- package/lib/mixins/emitter.js +18 -18
- package/lib/navigation-menu-group.js +412 -412
- package/lib/navigation-menu-item.js +722 -722
- package/lib/navigation.js +668 -668
- package/lib/notify.js +1 -1
- package/lib/option-group.js +9 -1
- package/lib/option.js +1 -1
- package/lib/pagination.js +13 -13
- package/lib/process.js +233 -51
- package/lib/progress.js +499 -499
- package/lib/radio-button.js +541 -541
- package/lib/radio.js +555 -555
- package/lib/rate.js +607 -607
- package/lib/round-progress.js +502 -502
- package/lib/search-select.js +5 -5
- package/lib/select.js +6 -6
- package/lib/sideslider.js +1 -1
- package/lib/slider.js +5 -5
- package/lib/spin.js +500 -500
- package/lib/star.js +496 -496
- package/lib/steps.js +3 -3
- package/lib/switcher.js +538 -538
- package/lib/tab-panel.js +456 -456
- package/lib/table-setting-content.js +35 -20
- package/lib/table.js +764 -575
- package/lib/tag.js +459 -459
- package/lib/time-picker.js +2 -2
- package/lib/transfer.js +6 -6
- package/lib/ui/bk-magic-vue.css +113 -24
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/image-viewer.css +38 -17
- package/lib/ui/image-viewer.min.css +1 -1
- package/lib/ui/image-viewer.min.css.map +1 -1
- package/lib/ui/process.css +76 -0
- package/lib/ui/process.min.css +1 -1
- package/lib/ui/process.min.css.map +1 -1
- package/lib/ui/slider.css +4 -2
- package/lib/ui/slider.min.css +1 -1
- package/lib/ui/slider.min.css.map +1 -1
- package/lib/ui/spin.css +5 -1
- package/lib/ui/spin.min.css +1 -1
- package/lib/ui/spin.min.css.map +1 -1
- package/lib/ui/table.css +16 -5
- package/lib/ui/table.min.css +1 -1
- package/lib/ui/table.min.css.map +1 -1
- package/lib/upload.js +2 -2
- package/lib/version-detail.js +9 -10
- package/lib/virtual-scroll.js +805 -805
- package/lib/zoom-image.js +502 -502
- package/package.json +1 -1
package/lib/dropdown-menu.js
CHANGED
|
@@ -1,1896 +1,1896 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = global || self, factory(global.library = {}));
|
|
5
5
|
}(this, function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
var nodeList = [];
|
|
8
|
+
var clickctx = '$clickoutsideCtx';
|
|
9
|
+
var beginClick;
|
|
10
|
+
document.addEventListener('mousedown', function (event) {
|
|
11
|
+
return beginClick = event;
|
|
12
|
+
});
|
|
13
|
+
document.addEventListener('mouseup', function (event) {
|
|
14
|
+
nodeList.forEach(function (node) {
|
|
15
|
+
node[clickctx].clickoutsideHandler(event, beginClick);
|
|
12
16
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|| vnode.context.popup
|
|
29
|
-
&& (vnode.context.popup.contains(mouseup.target)
|
|
30
|
-
|| vnode.context.popup.contains(mousedown.target)
|
|
31
|
-
)) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (binding.expression
|
|
35
|
-
&& el[clickctx].callbackName
|
|
36
|
-
&& vnode.context[el[clickctx].callbackName]
|
|
37
|
-
) {
|
|
38
|
-
vnode.context[el[clickctx].callbackName](mouseup, mousedown, el);
|
|
39
|
-
} else {
|
|
40
|
-
el[clickctx].bindingFn && el[clickctx].bindingFn(mouseup, mousedown, el);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
el[clickctx] = {
|
|
44
|
-
id: id,
|
|
45
|
-
clickoutsideHandler: clickoutsideHandler,
|
|
46
|
-
callbackName: binding.expression,
|
|
47
|
-
callbackFn: binding.value
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
update: function update(el, binding) {
|
|
51
|
-
el[clickctx].callbackName = binding.expression;
|
|
52
|
-
el[clickctx].callbackFn = binding.value;
|
|
53
|
-
},
|
|
54
|
-
unbind: function unbind(el) {
|
|
55
|
-
for (var i = 0, len = nodeList.length; i < len; i++) {
|
|
56
|
-
if (nodeList[i][clickctx].id === el[clickctx].id) {
|
|
57
|
-
nodeList.splice(i, 1);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
bkClickoutside.install = function (Vue) {
|
|
64
|
-
Vue.directive('bkClickoutside', bkClickoutside);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
68
|
-
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
|
|
69
|
-
var timeoutDuration = 0;
|
|
70
|
-
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
|
71
|
-
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
|
72
|
-
timeoutDuration = 1;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function microtaskDebounce(fn) {
|
|
77
|
-
var called = false;
|
|
78
|
-
return function () {
|
|
79
|
-
if (called) {
|
|
17
|
+
});
|
|
18
|
+
var bkClickoutside = {
|
|
19
|
+
bind: function bind(el, binding, vnode) {
|
|
20
|
+
var id = nodeList.push(el) - 1;
|
|
21
|
+
var clickoutsideHandler = function clickoutsideHandler() {
|
|
22
|
+
var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23
|
+
var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
24
|
+
if (!vnode.context
|
|
25
|
+
|| !mouseup.target || !mousedown.target || el.contains(mouseup.target)
|
|
26
|
+
|| el.contains(mousedown.target)
|
|
27
|
+
|| el === mouseup.target
|
|
28
|
+
|| vnode.context.popup
|
|
29
|
+
&& (vnode.context.popup.contains(mouseup.target)
|
|
30
|
+
|| vnode.context.popup.contains(mousedown.target)
|
|
31
|
+
)) {
|
|
80
32
|
return;
|
|
81
33
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
function taskDebounce(fn) {
|
|
90
|
-
var scheduled = false;
|
|
91
|
-
return function () {
|
|
92
|
-
if (!scheduled) {
|
|
93
|
-
scheduled = true;
|
|
94
|
-
setTimeout(function () {
|
|
95
|
-
scheduled = false;
|
|
96
|
-
fn();
|
|
97
|
-
}, timeoutDuration);
|
|
34
|
+
if (binding.expression
|
|
35
|
+
&& el[clickctx].callbackName
|
|
36
|
+
&& vnode.context[el[clickctx].callbackName]
|
|
37
|
+
) {
|
|
38
|
+
vnode.context[el[clickctx].callbackName](mouseup, mousedown, el);
|
|
39
|
+
} else {
|
|
40
|
+
el[clickctx].bindingFn && el[clickctx].bindingFn(mouseup, mousedown, el);
|
|
98
41
|
}
|
|
99
42
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (element.nodeName === 'HTML') {
|
|
117
|
-
return element;
|
|
118
|
-
}
|
|
119
|
-
return element.parentNode || element.host;
|
|
120
|
-
}
|
|
121
|
-
function getScrollParent(element) {
|
|
122
|
-
if (!element) {
|
|
123
|
-
return document.body;
|
|
124
|
-
}
|
|
125
|
-
switch (element.nodeName) {
|
|
126
|
-
case 'HTML':
|
|
127
|
-
case 'BODY':
|
|
128
|
-
return element.ownerDocument.body;
|
|
129
|
-
case '#document':
|
|
130
|
-
return element.body;
|
|
131
|
-
}
|
|
132
|
-
var _getStyleComputedProp = getStyleComputedProperty(element),
|
|
133
|
-
overflow = _getStyleComputedProp.overflow,
|
|
134
|
-
overflowX = _getStyleComputedProp.overflowX,
|
|
135
|
-
overflowY = _getStyleComputedProp.overflowY;
|
|
136
|
-
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
|
|
137
|
-
return element;
|
|
138
|
-
}
|
|
139
|
-
return getScrollParent(getParentNode(element));
|
|
140
|
-
}
|
|
141
|
-
var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
|
|
142
|
-
var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
|
|
143
|
-
function isIE(version) {
|
|
144
|
-
if (version === 11) {
|
|
145
|
-
return isIE11;
|
|
146
|
-
}
|
|
147
|
-
if (version === 10) {
|
|
148
|
-
return isIE10;
|
|
149
|
-
}
|
|
150
|
-
return isIE11 || isIE10;
|
|
151
|
-
}
|
|
152
|
-
function getOffsetParent(element) {
|
|
153
|
-
if (!element) {
|
|
154
|
-
return document.documentElement;
|
|
155
|
-
}
|
|
156
|
-
var noOffsetParent = isIE(10) ? document.body : null;
|
|
157
|
-
var offsetParent = element.offsetParent || null;
|
|
158
|
-
while (offsetParent === noOffsetParent && element.nextElementSibling) {
|
|
159
|
-
offsetParent = (element = element.nextElementSibling).offsetParent;
|
|
160
|
-
}
|
|
161
|
-
var nodeName = offsetParent && offsetParent.nodeName;
|
|
162
|
-
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
|
|
163
|
-
return element ? element.ownerDocument.documentElement : document.documentElement;
|
|
164
|
-
}
|
|
165
|
-
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
|
|
166
|
-
return getOffsetParent(offsetParent);
|
|
167
|
-
}
|
|
168
|
-
return offsetParent;
|
|
169
|
-
}
|
|
170
|
-
function isOffsetContainer(element) {
|
|
171
|
-
var nodeName = element.nodeName;
|
|
172
|
-
if (nodeName === 'BODY') {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
|
|
176
|
-
}
|
|
177
|
-
function getRoot(node) {
|
|
178
|
-
if (node.parentNode !== null) {
|
|
179
|
-
return getRoot(node.parentNode);
|
|
180
|
-
}
|
|
181
|
-
return node;
|
|
182
|
-
}
|
|
183
|
-
function findCommonOffsetParent(element1, element2) {
|
|
184
|
-
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
|
|
185
|
-
return document.documentElement;
|
|
186
|
-
}
|
|
187
|
-
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
|
|
188
|
-
var start = order ? element1 : element2;
|
|
189
|
-
var end = order ? element2 : element1;
|
|
190
|
-
var range = document.createRange();
|
|
191
|
-
range.setStart(start, 0);
|
|
192
|
-
range.setEnd(end, 0);
|
|
193
|
-
var commonAncestorContainer = range.commonAncestorContainer;
|
|
194
|
-
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
|
|
195
|
-
if (isOffsetContainer(commonAncestorContainer)) {
|
|
196
|
-
return commonAncestorContainer;
|
|
43
|
+
el[clickctx] = {
|
|
44
|
+
id: id,
|
|
45
|
+
clickoutsideHandler: clickoutsideHandler,
|
|
46
|
+
callbackName: binding.expression,
|
|
47
|
+
callbackFn: binding.value
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
update: function update(el, binding) {
|
|
51
|
+
el[clickctx].callbackName = binding.expression;
|
|
52
|
+
el[clickctx].callbackFn = binding.value;
|
|
53
|
+
},
|
|
54
|
+
unbind: function unbind(el) {
|
|
55
|
+
for (var i = 0, len = nodeList.length; i < len; i++) {
|
|
56
|
+
if (nodeList[i][clickctx].id === el[clickctx].id) {
|
|
57
|
+
nodeList.splice(i, 1);
|
|
58
|
+
break;
|
|
197
59
|
}
|
|
198
|
-
return getOffsetParent(commonAncestorContainer);
|
|
199
|
-
}
|
|
200
|
-
var element1root = getRoot(element1);
|
|
201
|
-
if (element1root.host) {
|
|
202
|
-
return findCommonOffsetParent(element1root.host, element2);
|
|
203
|
-
} else {
|
|
204
|
-
return findCommonOffsetParent(element1, getRoot(element2).host);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function getScroll(element) {
|
|
208
|
-
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
|
209
|
-
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
|
|
210
|
-
var nodeName = element.nodeName;
|
|
211
|
-
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
|
212
|
-
var html = element.ownerDocument.documentElement;
|
|
213
|
-
var scrollingElement = element.ownerDocument.scrollingElement || html;
|
|
214
|
-
return scrollingElement[upperSide];
|
|
215
60
|
}
|
|
216
|
-
return element[upperSide];
|
|
217
|
-
}
|
|
218
|
-
function includeScroll(rect, element) {
|
|
219
|
-
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
220
|
-
var scrollTop = getScroll(element, 'top');
|
|
221
|
-
var scrollLeft = getScroll(element, 'left');
|
|
222
|
-
var modifier = subtract ? -1 : 1;
|
|
223
|
-
rect.top += scrollTop * modifier;
|
|
224
|
-
rect.bottom += scrollTop * modifier;
|
|
225
|
-
rect.left += scrollLeft * modifier;
|
|
226
|
-
rect.right += scrollLeft * modifier;
|
|
227
|
-
return rect;
|
|
228
|
-
}
|
|
229
|
-
function getBordersSize(styles, axis) {
|
|
230
|
-
var sideA = axis === 'x' ? 'Left' : 'Top';
|
|
231
|
-
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
|
|
232
|
-
return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
|
|
233
|
-
}
|
|
234
|
-
function getSize(axis, body, html, computedStyle) {
|
|
235
|
-
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
|
|
236
|
-
}
|
|
237
|
-
function getWindowSizes(document) {
|
|
238
|
-
var body = document.body;
|
|
239
|
-
var html = document.documentElement;
|
|
240
|
-
var computedStyle = isIE(10) && getComputedStyle(html);
|
|
241
|
-
return {
|
|
242
|
-
height: getSize('Height', body, html, computedStyle),
|
|
243
|
-
width: getSize('Width', body, html, computedStyle)
|
|
244
|
-
};
|
|
245
61
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
62
|
+
};
|
|
63
|
+
bkClickoutside.install = function (Vue) {
|
|
64
|
+
Vue.directive('bkClickoutside', bkClickoutside);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
68
|
+
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
|
|
69
|
+
var timeoutDuration = 0;
|
|
70
|
+
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
|
71
|
+
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
|
72
|
+
timeoutDuration = 1;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function microtaskDebounce(fn) {
|
|
77
|
+
var called = false;
|
|
78
|
+
return function () {
|
|
79
|
+
if (called) {
|
|
80
|
+
return;
|
|
249
81
|
}
|
|
82
|
+
called = true;
|
|
83
|
+
window.Promise.resolve().then(function () {
|
|
84
|
+
called = false;
|
|
85
|
+
fn();
|
|
86
|
+
});
|
|
250
87
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
return function (Constructor, protoProps, staticProps) {
|
|
262
|
-
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
263
|
-
if (staticProps) defineProperties(Constructor, staticProps);
|
|
264
|
-
return Constructor;
|
|
265
|
-
};
|
|
266
|
-
}();
|
|
267
|
-
var defineProperty = function (obj, key, value) {
|
|
268
|
-
if (key in obj) {
|
|
269
|
-
Object.defineProperty(obj, key, {
|
|
270
|
-
value: value,
|
|
271
|
-
enumerable: true,
|
|
272
|
-
configurable: true,
|
|
273
|
-
writable: true
|
|
274
|
-
});
|
|
275
|
-
} else {
|
|
276
|
-
obj[key] = value;
|
|
88
|
+
}
|
|
89
|
+
function taskDebounce(fn) {
|
|
90
|
+
var scheduled = false;
|
|
91
|
+
return function () {
|
|
92
|
+
if (!scheduled) {
|
|
93
|
+
scheduled = true;
|
|
94
|
+
setTimeout(function () {
|
|
95
|
+
scheduled = false;
|
|
96
|
+
fn();
|
|
97
|
+
}, timeoutDuration);
|
|
277
98
|
}
|
|
278
|
-
return obj;
|
|
279
99
|
};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return
|
|
100
|
+
}
|
|
101
|
+
var supportsMicroTasks = isBrowser && window.Promise;
|
|
102
|
+
var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
|
|
103
|
+
function isFunction(functionToCheck) {
|
|
104
|
+
var getType = {};
|
|
105
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
106
|
+
}
|
|
107
|
+
function getStyleComputedProperty(element, property) {
|
|
108
|
+
if (element.nodeType !== 1) {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
var window = element.ownerDocument.defaultView;
|
|
112
|
+
var css = window.getComputedStyle(element, null);
|
|
113
|
+
return property ? css[property] : css;
|
|
114
|
+
}
|
|
115
|
+
function getParentNode(element) {
|
|
116
|
+
if (element.nodeName === 'HTML') {
|
|
117
|
+
return element;
|
|
118
|
+
}
|
|
119
|
+
return element.parentNode || element.host;
|
|
120
|
+
}
|
|
121
|
+
function getScrollParent(element) {
|
|
122
|
+
if (!element) {
|
|
123
|
+
return document.body;
|
|
124
|
+
}
|
|
125
|
+
switch (element.nodeName) {
|
|
126
|
+
case 'HTML':
|
|
127
|
+
case 'BODY':
|
|
128
|
+
return element.ownerDocument.body;
|
|
129
|
+
case '#document':
|
|
130
|
+
return element.body;
|
|
131
|
+
}
|
|
132
|
+
var _getStyleComputedProp = getStyleComputedProperty(element),
|
|
133
|
+
overflow = _getStyleComputedProp.overflow,
|
|
134
|
+
overflowX = _getStyleComputedProp.overflowX,
|
|
135
|
+
overflowY = _getStyleComputedProp.overflowY;
|
|
136
|
+
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
|
|
137
|
+
return element;
|
|
138
|
+
}
|
|
139
|
+
return getScrollParent(getParentNode(element));
|
|
140
|
+
}
|
|
141
|
+
var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
|
|
142
|
+
var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
|
|
143
|
+
function isIE(version) {
|
|
144
|
+
if (version === 11) {
|
|
145
|
+
return isIE11;
|
|
146
|
+
}
|
|
147
|
+
if (version === 10) {
|
|
148
|
+
return isIE10;
|
|
149
|
+
}
|
|
150
|
+
return isIE11 || isIE10;
|
|
151
|
+
}
|
|
152
|
+
function getOffsetParent(element) {
|
|
153
|
+
if (!element) {
|
|
154
|
+
return document.documentElement;
|
|
155
|
+
}
|
|
156
|
+
var noOffsetParent = isIE(10) ? document.body : null;
|
|
157
|
+
var offsetParent = element.offsetParent || null;
|
|
158
|
+
while (offsetParent === noOffsetParent && element.nextElementSibling) {
|
|
159
|
+
offsetParent = (element = element.nextElementSibling).offsetParent;
|
|
160
|
+
}
|
|
161
|
+
var nodeName = offsetParent && offsetParent.nodeName;
|
|
162
|
+
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
|
|
163
|
+
return element ? element.ownerDocument.documentElement : document.documentElement;
|
|
164
|
+
}
|
|
165
|
+
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
|
|
166
|
+
return getOffsetParent(offsetParent);
|
|
167
|
+
}
|
|
168
|
+
return offsetParent;
|
|
169
|
+
}
|
|
170
|
+
function isOffsetContainer(element) {
|
|
171
|
+
var nodeName = element.nodeName;
|
|
172
|
+
if (nodeName === 'BODY') {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
|
|
176
|
+
}
|
|
177
|
+
function getRoot(node) {
|
|
178
|
+
if (node.parentNode !== null) {
|
|
179
|
+
return getRoot(node.parentNode);
|
|
180
|
+
}
|
|
181
|
+
return node;
|
|
182
|
+
}
|
|
183
|
+
function findCommonOffsetParent(element1, element2) {
|
|
184
|
+
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
|
|
185
|
+
return document.documentElement;
|
|
186
|
+
}
|
|
187
|
+
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
|
|
188
|
+
var start = order ? element1 : element2;
|
|
189
|
+
var end = order ? element2 : element1;
|
|
190
|
+
var range = document.createRange();
|
|
191
|
+
range.setStart(start, 0);
|
|
192
|
+
range.setEnd(end, 0);
|
|
193
|
+
var commonAncestorContainer = range.commonAncestorContainer;
|
|
194
|
+
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
|
|
195
|
+
if (isOffsetContainer(commonAncestorContainer)) {
|
|
196
|
+
return commonAncestorContainer;
|
|
197
|
+
}
|
|
198
|
+
return getOffsetParent(commonAncestorContainer);
|
|
199
|
+
}
|
|
200
|
+
var element1root = getRoot(element1);
|
|
201
|
+
if (element1root.host) {
|
|
202
|
+
return findCommonOffsetParent(element1root.host, element2);
|
|
203
|
+
} else {
|
|
204
|
+
return findCommonOffsetParent(element1, getRoot(element2).host);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function getScroll(element) {
|
|
208
|
+
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
|
209
|
+
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
|
|
210
|
+
var nodeName = element.nodeName;
|
|
211
|
+
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
|
212
|
+
var html = element.ownerDocument.documentElement;
|
|
213
|
+
var scrollingElement = element.ownerDocument.scrollingElement || html;
|
|
214
|
+
return scrollingElement[upperSide];
|
|
215
|
+
}
|
|
216
|
+
return element[upperSide];
|
|
217
|
+
}
|
|
218
|
+
function includeScroll(rect, element) {
|
|
219
|
+
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
220
|
+
var scrollTop = getScroll(element, 'top');
|
|
221
|
+
var scrollLeft = getScroll(element, 'left');
|
|
222
|
+
var modifier = subtract ? -1 : 1;
|
|
223
|
+
rect.top += scrollTop * modifier;
|
|
224
|
+
rect.bottom += scrollTop * modifier;
|
|
225
|
+
rect.left += scrollLeft * modifier;
|
|
226
|
+
rect.right += scrollLeft * modifier;
|
|
227
|
+
return rect;
|
|
228
|
+
}
|
|
229
|
+
function getBordersSize(styles, axis) {
|
|
230
|
+
var sideA = axis === 'x' ? 'Left' : 'Top';
|
|
231
|
+
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
|
|
232
|
+
return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
|
|
233
|
+
}
|
|
234
|
+
function getSize(axis, body, html, computedStyle) {
|
|
235
|
+
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
|
|
236
|
+
}
|
|
237
|
+
function getWindowSizes(document) {
|
|
238
|
+
var body = document.body;
|
|
239
|
+
var html = document.documentElement;
|
|
240
|
+
var computedStyle = isIE(10) && getComputedStyle(html);
|
|
241
|
+
return {
|
|
242
|
+
height: getSize('Height', body, html, computedStyle),
|
|
243
|
+
width: getSize('Width', body, html, computedStyle)
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
var classCallCheck = function (instance, Constructor) {
|
|
247
|
+
if (!(instance instanceof Constructor)) {
|
|
248
|
+
throw new TypeError("Cannot call a class as a function");
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
var createClass = function () {
|
|
252
|
+
function defineProperties(target, props) {
|
|
253
|
+
for (var i = 0; i < props.length; i++) {
|
|
254
|
+
var descriptor = props[i];
|
|
255
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
256
|
+
descriptor.configurable = true;
|
|
257
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
258
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return function (Constructor, protoProps, staticProps) {
|
|
262
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
263
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
264
|
+
return Constructor;
|
|
290
265
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
266
|
+
}();
|
|
267
|
+
var defineProperty = function (obj, key, value) {
|
|
268
|
+
if (key in obj) {
|
|
269
|
+
Object.defineProperty(obj, key, {
|
|
270
|
+
value: value,
|
|
271
|
+
enumerable: true,
|
|
272
|
+
configurable: true,
|
|
273
|
+
writable: true
|
|
295
274
|
});
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
rect.right += scrollLeft;
|
|
308
|
-
} else {
|
|
309
|
-
rect = element.getBoundingClientRect();
|
|
275
|
+
} else {
|
|
276
|
+
obj[key] = value;
|
|
277
|
+
}
|
|
278
|
+
return obj;
|
|
279
|
+
};
|
|
280
|
+
var _extends = Object.assign || function (target) {
|
|
281
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
282
|
+
var source = arguments[i];
|
|
283
|
+
for (var key in source) {
|
|
284
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
285
|
+
target[key] = source[key];
|
|
310
286
|
}
|
|
311
|
-
} catch (e) {}
|
|
312
|
-
var result = {
|
|
313
|
-
left: rect.left,
|
|
314
|
-
top: rect.top,
|
|
315
|
-
width: rect.right - rect.left,
|
|
316
|
-
height: rect.bottom - rect.top
|
|
317
|
-
};
|
|
318
|
-
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
|
|
319
|
-
var width = sizes.width || element.clientWidth || result.right - result.left;
|
|
320
|
-
var height = sizes.height || element.clientHeight || result.bottom - result.top;
|
|
321
|
-
var horizScrollbar = element.offsetWidth - width;
|
|
322
|
-
var vertScrollbar = element.offsetHeight - height;
|
|
323
|
-
if (horizScrollbar || vertScrollbar) {
|
|
324
|
-
var styles = getStyleComputedProperty(element);
|
|
325
|
-
horizScrollbar -= getBordersSize(styles, 'x');
|
|
326
|
-
vertScrollbar -= getBordersSize(styles, 'y');
|
|
327
|
-
result.width -= horizScrollbar;
|
|
328
|
-
result.height -= vertScrollbar;
|
|
329
|
-
}
|
|
330
|
-
return getClientRect(result);
|
|
331
|
-
}
|
|
332
|
-
function getOffsetRectRelativeToArbitraryNode(children, parent) {
|
|
333
|
-
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
334
|
-
var isIE10 = isIE(10);
|
|
335
|
-
var isHTML = parent.nodeName === 'HTML';
|
|
336
|
-
var childrenRect = getBoundingClientRect(children);
|
|
337
|
-
var parentRect = getBoundingClientRect(parent);
|
|
338
|
-
var scrollParent = getScrollParent(children);
|
|
339
|
-
var styles = getStyleComputedProperty(parent);
|
|
340
|
-
var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
|
|
341
|
-
var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
|
|
342
|
-
if (fixedPosition && isHTML) {
|
|
343
|
-
parentRect.top = Math.max(parentRect.top, 0);
|
|
344
|
-
parentRect.left = Math.max(parentRect.left, 0);
|
|
345
|
-
}
|
|
346
|
-
var offsets = getClientRect({
|
|
347
|
-
top: childrenRect.top - parentRect.top - borderTopWidth,
|
|
348
|
-
left: childrenRect.left - parentRect.left - borderLeftWidth,
|
|
349
|
-
width: childrenRect.width,
|
|
350
|
-
height: childrenRect.height
|
|
351
|
-
});
|
|
352
|
-
offsets.marginTop = 0;
|
|
353
|
-
offsets.marginLeft = 0;
|
|
354
|
-
if (!isIE10 && isHTML) {
|
|
355
|
-
var marginTop = parseFloat(styles.marginTop, 10);
|
|
356
|
-
var marginLeft = parseFloat(styles.marginLeft, 10);
|
|
357
|
-
offsets.top -= borderTopWidth - marginTop;
|
|
358
|
-
offsets.bottom -= borderTopWidth - marginTop;
|
|
359
|
-
offsets.left -= borderLeftWidth - marginLeft;
|
|
360
|
-
offsets.right -= borderLeftWidth - marginLeft;
|
|
361
|
-
offsets.marginTop = marginTop;
|
|
362
|
-
offsets.marginLeft = marginLeft;
|
|
363
287
|
}
|
|
364
|
-
if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
|
|
365
|
-
offsets = includeScroll(offsets, parent);
|
|
366
|
-
}
|
|
367
|
-
return offsets;
|
|
368
|
-
}
|
|
369
|
-
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
|
|
370
|
-
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
371
|
-
var html = element.ownerDocument.documentElement;
|
|
372
|
-
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
|
|
373
|
-
var width = Math.max(html.clientWidth, window.innerWidth || 0);
|
|
374
|
-
var height = Math.max(html.clientHeight, window.innerHeight || 0);
|
|
375
|
-
var scrollTop = !excludeScroll ? getScroll(html) : 0;
|
|
376
|
-
var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
|
|
377
|
-
var offset = {
|
|
378
|
-
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
|
|
379
|
-
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
|
|
380
|
-
width: width,
|
|
381
|
-
height: height
|
|
382
|
-
};
|
|
383
|
-
return getClientRect(offset);
|
|
384
|
-
}
|
|
385
|
-
function isFixed(element) {
|
|
386
|
-
var nodeName = element.nodeName;
|
|
387
|
-
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
|
388
|
-
return false;
|
|
389
|
-
}
|
|
390
|
-
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
391
|
-
return true;
|
|
392
|
-
}
|
|
393
|
-
var parentNode = getParentNode(element);
|
|
394
|
-
if (!parentNode) {
|
|
395
|
-
return false;
|
|
396
|
-
}
|
|
397
|
-
return isFixed(parentNode);
|
|
398
288
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
289
|
+
return target;
|
|
290
|
+
};
|
|
291
|
+
function getClientRect(offsets) {
|
|
292
|
+
return _extends({}, offsets, {
|
|
293
|
+
right: offsets.left + offsets.width,
|
|
294
|
+
bottom: offsets.top + offsets.height
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
function getBoundingClientRect(element) {
|
|
298
|
+
var rect = {};
|
|
299
|
+
try {
|
|
300
|
+
if (isIE(10)) {
|
|
301
|
+
rect = element.getBoundingClientRect();
|
|
302
|
+
var scrollTop = getScroll(element, 'top');
|
|
303
|
+
var scrollLeft = getScroll(element, 'left');
|
|
304
|
+
rect.top += scrollTop;
|
|
305
|
+
rect.left += scrollLeft;
|
|
306
|
+
rect.bottom += scrollTop;
|
|
307
|
+
rect.right += scrollLeft;
|
|
415
308
|
} else {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
309
|
+
rect = element.getBoundingClientRect();
|
|
310
|
+
}
|
|
311
|
+
} catch (e) {}
|
|
312
|
+
var result = {
|
|
313
|
+
left: rect.left,
|
|
314
|
+
top: rect.top,
|
|
315
|
+
width: rect.right - rect.left,
|
|
316
|
+
height: rect.bottom - rect.top
|
|
317
|
+
};
|
|
318
|
+
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
|
|
319
|
+
var width = sizes.width || element.clientWidth || result.right - result.left;
|
|
320
|
+
var height = sizes.height || element.clientHeight || result.bottom - result.top;
|
|
321
|
+
var horizScrollbar = element.offsetWidth - width;
|
|
322
|
+
var vertScrollbar = element.offsetHeight - height;
|
|
323
|
+
if (horizScrollbar || vertScrollbar) {
|
|
324
|
+
var styles = getStyleComputedProperty(element);
|
|
325
|
+
horizScrollbar -= getBordersSize(styles, 'x');
|
|
326
|
+
vertScrollbar -= getBordersSize(styles, 'y');
|
|
327
|
+
result.width -= horizScrollbar;
|
|
328
|
+
result.height -= vertScrollbar;
|
|
329
|
+
}
|
|
330
|
+
return getClientRect(result);
|
|
331
|
+
}
|
|
332
|
+
function getOffsetRectRelativeToArbitraryNode(children, parent) {
|
|
333
|
+
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
334
|
+
var isIE10 = isIE(10);
|
|
335
|
+
var isHTML = parent.nodeName === 'HTML';
|
|
336
|
+
var childrenRect = getBoundingClientRect(children);
|
|
337
|
+
var parentRect = getBoundingClientRect(parent);
|
|
338
|
+
var scrollParent = getScrollParent(children);
|
|
339
|
+
var styles = getStyleComputedProperty(parent);
|
|
340
|
+
var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
|
|
341
|
+
var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
|
|
342
|
+
if (fixedPosition && isHTML) {
|
|
343
|
+
parentRect.top = Math.max(parentRect.top, 0);
|
|
344
|
+
parentRect.left = Math.max(parentRect.left, 0);
|
|
345
|
+
}
|
|
346
|
+
var offsets = getClientRect({
|
|
347
|
+
top: childrenRect.top - parentRect.top - borderTopWidth,
|
|
348
|
+
left: childrenRect.left - parentRect.left - borderLeftWidth,
|
|
349
|
+
width: childrenRect.width,
|
|
350
|
+
height: childrenRect.height
|
|
351
|
+
});
|
|
352
|
+
offsets.marginTop = 0;
|
|
353
|
+
offsets.marginLeft = 0;
|
|
354
|
+
if (!isIE10 && isHTML) {
|
|
355
|
+
var marginTop = parseFloat(styles.marginTop, 10);
|
|
356
|
+
var marginLeft = parseFloat(styles.marginLeft, 10);
|
|
357
|
+
offsets.top -= borderTopWidth - marginTop;
|
|
358
|
+
offsets.bottom -= borderTopWidth - marginTop;
|
|
359
|
+
offsets.left -= borderLeftWidth - marginLeft;
|
|
360
|
+
offsets.right -= borderLeftWidth - marginLeft;
|
|
361
|
+
offsets.marginTop = marginTop;
|
|
362
|
+
offsets.marginLeft = marginLeft;
|
|
363
|
+
}
|
|
364
|
+
if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
|
|
365
|
+
offsets = includeScroll(offsets, parent);
|
|
366
|
+
}
|
|
367
|
+
return offsets;
|
|
368
|
+
}
|
|
369
|
+
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
|
|
370
|
+
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
371
|
+
var html = element.ownerDocument.documentElement;
|
|
372
|
+
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
|
|
373
|
+
var width = Math.max(html.clientWidth, window.innerWidth || 0);
|
|
374
|
+
var height = Math.max(html.clientHeight, window.innerHeight || 0);
|
|
375
|
+
var scrollTop = !excludeScroll ? getScroll(html) : 0;
|
|
376
|
+
var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
|
|
377
|
+
var offset = {
|
|
378
|
+
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
|
|
379
|
+
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
|
|
380
|
+
width: width,
|
|
381
|
+
height: height
|
|
382
|
+
};
|
|
383
|
+
return getClientRect(offset);
|
|
384
|
+
}
|
|
385
|
+
function isFixed(element) {
|
|
386
|
+
var nodeName = element.nodeName;
|
|
387
|
+
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
var parentNode = getParentNode(element);
|
|
394
|
+
if (!parentNode) {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
return isFixed(parentNode);
|
|
398
|
+
}
|
|
399
|
+
function getFixedPositionOffsetParent(element) {
|
|
400
|
+
if (!element || !element.parentElement || isIE()) {
|
|
401
|
+
return document.documentElement;
|
|
402
|
+
}
|
|
403
|
+
var el = element.parentElement;
|
|
404
|
+
while (el && getStyleComputedProperty(el, 'transform') === 'none') {
|
|
405
|
+
el = el.parentElement;
|
|
406
|
+
}
|
|
407
|
+
return el || document.documentElement;
|
|
408
|
+
}
|
|
409
|
+
function getBoundaries(popper, reference, padding, boundariesElement) {
|
|
410
|
+
var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
411
|
+
var boundaries = { top: 0, left: 0 };
|
|
412
|
+
var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
|
|
413
|
+
if (boundariesElement === 'viewport') {
|
|
414
|
+
boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
|
|
415
|
+
} else {
|
|
416
|
+
var boundariesNode = void 0;
|
|
417
|
+
if (boundariesElement === 'scrollParent') {
|
|
418
|
+
boundariesNode = getScrollParent(getParentNode(reference));
|
|
419
|
+
if (boundariesNode.nodeName === 'BODY') {
|
|
423
420
|
boundariesNode = popper.ownerDocument.documentElement;
|
|
424
|
-
} else {
|
|
425
|
-
boundariesNode = boundariesElement;
|
|
426
|
-
}
|
|
427
|
-
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
|
|
428
|
-
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
|
|
429
|
-
var _getWindowSizes = getWindowSizes(popper.ownerDocument),
|
|
430
|
-
height = _getWindowSizes.height,
|
|
431
|
-
width = _getWindowSizes.width;
|
|
432
|
-
boundaries.top += offsets.top - offsets.marginTop;
|
|
433
|
-
boundaries.bottom = height + offsets.top;
|
|
434
|
-
boundaries.left += offsets.left - offsets.marginLeft;
|
|
435
|
-
boundaries.right = width + offsets.left;
|
|
436
|
-
} else {
|
|
437
|
-
boundaries = offsets;
|
|
438
421
|
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
var isPaddingNumber = typeof padding === 'number';
|
|
442
|
-
boundaries.left += isPaddingNumber ? padding : padding.left || 0;
|
|
443
|
-
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
|
|
444
|
-
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
|
|
445
|
-
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
|
|
446
|
-
return boundaries;
|
|
447
|
-
}
|
|
448
|
-
function getArea(_ref) {
|
|
449
|
-
var width = _ref.width,
|
|
450
|
-
height = _ref.height;
|
|
451
|
-
return width * height;
|
|
452
|
-
}
|
|
453
|
-
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
|
|
454
|
-
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
455
|
-
if (placement.indexOf('auto') === -1) {
|
|
456
|
-
return placement;
|
|
457
|
-
}
|
|
458
|
-
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
|
|
459
|
-
var rects = {
|
|
460
|
-
top: {
|
|
461
|
-
width: boundaries.width,
|
|
462
|
-
height: refRect.top - boundaries.top
|
|
463
|
-
},
|
|
464
|
-
right: {
|
|
465
|
-
width: boundaries.right - refRect.right,
|
|
466
|
-
height: boundaries.height
|
|
467
|
-
},
|
|
468
|
-
bottom: {
|
|
469
|
-
width: boundaries.width,
|
|
470
|
-
height: boundaries.bottom - refRect.bottom
|
|
471
|
-
},
|
|
472
|
-
left: {
|
|
473
|
-
width: refRect.left - boundaries.left,
|
|
474
|
-
height: boundaries.height
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
var sortedAreas = Object.keys(rects).map(function (key) {
|
|
478
|
-
return _extends({
|
|
479
|
-
key: key
|
|
480
|
-
}, rects[key], {
|
|
481
|
-
area: getArea(rects[key])
|
|
482
|
-
});
|
|
483
|
-
}).sort(function (a, b) {
|
|
484
|
-
return b.area - a.area;
|
|
485
|
-
});
|
|
486
|
-
var filteredAreas = sortedAreas.filter(function (_ref2) {
|
|
487
|
-
var width = _ref2.width,
|
|
488
|
-
height = _ref2.height;
|
|
489
|
-
return width >= popper.clientWidth && height >= popper.clientHeight;
|
|
490
|
-
});
|
|
491
|
-
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
|
|
492
|
-
var variation = placement.split('-')[1];
|
|
493
|
-
return computedPlacement + (variation ? '-' + variation : '');
|
|
494
|
-
}
|
|
495
|
-
function getReferenceOffsets(state, popper, reference) {
|
|
496
|
-
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
497
|
-
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
|
|
498
|
-
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
|
|
499
|
-
}
|
|
500
|
-
function getOuterSizes(element) {
|
|
501
|
-
var window = element.ownerDocument.defaultView;
|
|
502
|
-
var styles = window.getComputedStyle(element);
|
|
503
|
-
var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
|
|
504
|
-
var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
|
|
505
|
-
var result = {
|
|
506
|
-
width: element.offsetWidth + y,
|
|
507
|
-
height: element.offsetHeight + x
|
|
508
|
-
};
|
|
509
|
-
return result;
|
|
510
|
-
}
|
|
511
|
-
function getOppositePlacement(placement) {
|
|
512
|
-
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
513
|
-
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
514
|
-
return hash[matched];
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
function getPopperOffsets(popper, referenceOffsets, placement) {
|
|
518
|
-
placement = placement.split('-')[0];
|
|
519
|
-
var popperRect = getOuterSizes(popper);
|
|
520
|
-
var popperOffsets = {
|
|
521
|
-
width: popperRect.width,
|
|
522
|
-
height: popperRect.height
|
|
523
|
-
};
|
|
524
|
-
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
|
|
525
|
-
var mainSide = isHoriz ? 'top' : 'left';
|
|
526
|
-
var secondarySide = isHoriz ? 'left' : 'top';
|
|
527
|
-
var measurement = isHoriz ? 'height' : 'width';
|
|
528
|
-
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
|
|
529
|
-
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
|
|
530
|
-
if (placement === secondarySide) {
|
|
531
|
-
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
|
|
422
|
+
} else if (boundariesElement === 'window') {
|
|
423
|
+
boundariesNode = popper.ownerDocument.documentElement;
|
|
532
424
|
} else {
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
425
|
+
boundariesNode = boundariesElement;
|
|
426
|
+
}
|
|
427
|
+
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
|
|
428
|
+
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
|
|
429
|
+
var _getWindowSizes = getWindowSizes(popper.ownerDocument),
|
|
430
|
+
height = _getWindowSizes.height,
|
|
431
|
+
width = _getWindowSizes.width;
|
|
432
|
+
boundaries.top += offsets.top - offsets.marginTop;
|
|
433
|
+
boundaries.bottom = height + offsets.top;
|
|
434
|
+
boundaries.left += offsets.left - offsets.marginLeft;
|
|
435
|
+
boundaries.right = width + offsets.left;
|
|
436
|
+
} else {
|
|
437
|
+
boundaries = offsets;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
padding = padding || 0;
|
|
441
|
+
var isPaddingNumber = typeof padding === 'number';
|
|
442
|
+
boundaries.left += isPaddingNumber ? padding : padding.left || 0;
|
|
443
|
+
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
|
|
444
|
+
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
|
|
445
|
+
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
|
|
446
|
+
return boundaries;
|
|
447
|
+
}
|
|
448
|
+
function getArea(_ref) {
|
|
449
|
+
var width = _ref.width,
|
|
450
|
+
height = _ref.height;
|
|
451
|
+
return width * height;
|
|
452
|
+
}
|
|
453
|
+
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
|
|
454
|
+
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
455
|
+
if (placement.indexOf('auto') === -1) {
|
|
456
|
+
return placement;
|
|
457
|
+
}
|
|
458
|
+
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
|
|
459
|
+
var rects = {
|
|
460
|
+
top: {
|
|
461
|
+
width: boundaries.width,
|
|
462
|
+
height: refRect.top - boundaries.top
|
|
463
|
+
},
|
|
464
|
+
right: {
|
|
465
|
+
width: boundaries.right - refRect.right,
|
|
466
|
+
height: boundaries.height
|
|
467
|
+
},
|
|
468
|
+
bottom: {
|
|
469
|
+
width: boundaries.width,
|
|
470
|
+
height: boundaries.bottom - refRect.bottom
|
|
471
|
+
},
|
|
472
|
+
left: {
|
|
473
|
+
width: refRect.left - boundaries.left,
|
|
474
|
+
height: boundaries.height
|
|
548
475
|
}
|
|
549
|
-
|
|
550
|
-
|
|
476
|
+
};
|
|
477
|
+
var sortedAreas = Object.keys(rects).map(function (key) {
|
|
478
|
+
return _extends({
|
|
479
|
+
key: key
|
|
480
|
+
}, rects[key], {
|
|
481
|
+
area: getArea(rects[key])
|
|
551
482
|
});
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
483
|
+
}).sort(function (a, b) {
|
|
484
|
+
return b.area - a.area;
|
|
485
|
+
});
|
|
486
|
+
var filteredAreas = sortedAreas.filter(function (_ref2) {
|
|
487
|
+
var width = _ref2.width,
|
|
488
|
+
height = _ref2.height;
|
|
489
|
+
return width >= popper.clientWidth && height >= popper.clientHeight;
|
|
490
|
+
});
|
|
491
|
+
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
|
|
492
|
+
var variation = placement.split('-')[1];
|
|
493
|
+
return computedPlacement + (variation ? '-' + variation : '');
|
|
494
|
+
}
|
|
495
|
+
function getReferenceOffsets(state, popper, reference) {
|
|
496
|
+
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
497
|
+
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
|
|
498
|
+
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
|
|
499
|
+
}
|
|
500
|
+
function getOuterSizes(element) {
|
|
501
|
+
var window = element.ownerDocument.defaultView;
|
|
502
|
+
var styles = window.getComputedStyle(element);
|
|
503
|
+
var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
|
|
504
|
+
var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
|
|
505
|
+
var result = {
|
|
506
|
+
width: element.offsetWidth + y,
|
|
507
|
+
height: element.offsetHeight + x
|
|
508
|
+
};
|
|
509
|
+
return result;
|
|
510
|
+
}
|
|
511
|
+
function getOppositePlacement(placement) {
|
|
512
|
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
513
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
514
|
+
return hash[matched];
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
function getPopperOffsets(popper, referenceOffsets, placement) {
|
|
518
|
+
placement = placement.split('-')[0];
|
|
519
|
+
var popperRect = getOuterSizes(popper);
|
|
520
|
+
var popperOffsets = {
|
|
521
|
+
width: popperRect.width,
|
|
522
|
+
height: popperRect.height
|
|
523
|
+
};
|
|
524
|
+
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
|
|
525
|
+
var mainSide = isHoriz ? 'top' : 'left';
|
|
526
|
+
var secondarySide = isHoriz ? 'left' : 'top';
|
|
527
|
+
var measurement = isHoriz ? 'height' : 'width';
|
|
528
|
+
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
|
|
529
|
+
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
|
|
530
|
+
if (placement === secondarySide) {
|
|
531
|
+
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
|
|
532
|
+
} else {
|
|
533
|
+
popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
|
|
534
|
+
}
|
|
535
|
+
return popperOffsets;
|
|
536
|
+
}
|
|
537
|
+
function find(arr, check) {
|
|
538
|
+
if (Array.prototype.find) {
|
|
539
|
+
return arr.find(check);
|
|
540
|
+
}
|
|
541
|
+
return arr.filter(check)[0];
|
|
542
|
+
}
|
|
543
|
+
function findIndex(arr, prop, value) {
|
|
544
|
+
if (Array.prototype.findIndex) {
|
|
545
|
+
return arr.findIndex(function (cur) {
|
|
546
|
+
return cur[prop] === value;
|
|
566
547
|
});
|
|
567
|
-
return data;
|
|
568
548
|
}
|
|
569
|
-
function
|
|
570
|
-
|
|
571
|
-
|
|
549
|
+
var match = find(arr, function (obj) {
|
|
550
|
+
return obj[prop] === value;
|
|
551
|
+
});
|
|
552
|
+
return arr.indexOf(match);
|
|
553
|
+
}
|
|
554
|
+
function runModifiers(modifiers, data, ends) {
|
|
555
|
+
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
|
|
556
|
+
modifiersToRun.forEach(function (modifier) {
|
|
557
|
+
if (modifier['function']) {
|
|
558
|
+
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
|
559
|
+
}
|
|
560
|
+
var fn = modifier['function'] || modifier.fn;
|
|
561
|
+
if (modifier.enabled && isFunction(fn)) {
|
|
562
|
+
data.offsets.popper = getClientRect(data.offsets.popper);
|
|
563
|
+
data.offsets.reference = getClientRect(data.offsets.reference);
|
|
564
|
+
data = fn(data, modifier);
|
|
572
565
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
566
|
+
});
|
|
567
|
+
return data;
|
|
568
|
+
}
|
|
569
|
+
function update() {
|
|
570
|
+
if (this.state.isDestroyed) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
var data = {
|
|
574
|
+
instance: this,
|
|
575
|
+
styles: {},
|
|
576
|
+
arrowStyles: {},
|
|
577
|
+
attributes: {},
|
|
578
|
+
flipped: false,
|
|
579
|
+
offsets: {}
|
|
580
|
+
};
|
|
581
|
+
data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
|
|
582
|
+
data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
|
|
583
|
+
data.originalPlacement = data.placement;
|
|
584
|
+
data.positionFixed = this.options.positionFixed;
|
|
585
|
+
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
|
|
586
|
+
data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
|
|
587
|
+
data = runModifiers(this.modifiers, data);
|
|
588
|
+
if (!this.state.isCreated) {
|
|
589
|
+
this.state.isCreated = true;
|
|
590
|
+
this.options.onCreate(data);
|
|
591
|
+
} else {
|
|
592
|
+
this.options.onUpdate(data);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function isModifierEnabled(modifiers, modifierName) {
|
|
596
|
+
return modifiers.some(function (_ref) {
|
|
597
|
+
var name = _ref.name,
|
|
598
|
+
enabled = _ref.enabled;
|
|
599
|
+
return enabled && name === modifierName;
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
function getSupportedPropertyName(property) {
|
|
603
|
+
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
|
|
604
|
+
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
|
|
605
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
606
|
+
var prefix = prefixes[i];
|
|
607
|
+
var toCheck = prefix ? '' + prefix + upperProp : property;
|
|
608
|
+
if (typeof document.body.style[toCheck] !== 'undefined') {
|
|
609
|
+
return toCheck;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
function destroy() {
|
|
615
|
+
this.state.isDestroyed = true;
|
|
616
|
+
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
|
|
617
|
+
this.popper.removeAttribute('x-placement');
|
|
618
|
+
this.popper.style.position = '';
|
|
619
|
+
this.popper.style.top = '';
|
|
620
|
+
this.popper.style.left = '';
|
|
621
|
+
this.popper.style.right = '';
|
|
622
|
+
this.popper.style.bottom = '';
|
|
623
|
+
this.popper.style.willChange = '';
|
|
624
|
+
this.popper.style[getSupportedPropertyName('transform')] = '';
|
|
625
|
+
}
|
|
626
|
+
this.disableEventListeners();
|
|
627
|
+
if (this.options.removeOnDestroy) {
|
|
628
|
+
this.popper.parentNode.removeChild(this.popper);
|
|
629
|
+
}
|
|
630
|
+
return this;
|
|
631
|
+
}
|
|
632
|
+
function getWindow(element) {
|
|
633
|
+
var ownerDocument = element.ownerDocument;
|
|
634
|
+
return ownerDocument ? ownerDocument.defaultView : window;
|
|
635
|
+
}
|
|
636
|
+
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
|
|
637
|
+
var isBody = scrollParent.nodeName === 'BODY';
|
|
638
|
+
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
|
|
639
|
+
target.addEventListener(event, callback, { passive: true });
|
|
640
|
+
if (!isBody) {
|
|
641
|
+
attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
|
|
642
|
+
}
|
|
643
|
+
scrollParents.push(target);
|
|
644
|
+
}
|
|
645
|
+
function setupEventListeners(reference, options, state, updateBound) {
|
|
646
|
+
state.updateBound = updateBound;
|
|
647
|
+
getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
|
|
648
|
+
var scrollElement = getScrollParent(reference);
|
|
649
|
+
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
|
|
650
|
+
state.scrollElement = scrollElement;
|
|
651
|
+
state.eventsEnabled = true;
|
|
652
|
+
return state;
|
|
653
|
+
}
|
|
654
|
+
function enableEventListeners() {
|
|
655
|
+
if (!this.state.eventsEnabled) {
|
|
656
|
+
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
function removeEventListeners(reference, state) {
|
|
660
|
+
getWindow(reference).removeEventListener('resize', state.updateBound);
|
|
661
|
+
state.scrollParents.forEach(function (target) {
|
|
662
|
+
target.removeEventListener('scroll', state.updateBound);
|
|
663
|
+
});
|
|
664
|
+
state.updateBound = null;
|
|
665
|
+
state.scrollParents = [];
|
|
666
|
+
state.scrollElement = null;
|
|
667
|
+
state.eventsEnabled = false;
|
|
668
|
+
return state;
|
|
669
|
+
}
|
|
670
|
+
function disableEventListeners() {
|
|
671
|
+
if (this.state.eventsEnabled) {
|
|
672
|
+
cancelAnimationFrame(this.scheduleUpdate);
|
|
673
|
+
this.state = removeEventListeners(this.reference, this.state);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function isNumeric(n) {
|
|
677
|
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
678
|
+
}
|
|
679
|
+
function setStyles(element, styles) {
|
|
680
|
+
Object.keys(styles).forEach(function (prop) {
|
|
681
|
+
var unit = '';
|
|
682
|
+
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
|
|
683
|
+
unit = 'px';
|
|
684
|
+
}
|
|
685
|
+
element.style[prop] = styles[prop] + unit;
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
function setAttributes(element, attributes) {
|
|
689
|
+
Object.keys(attributes).forEach(function (prop) {
|
|
690
|
+
var value = attributes[prop];
|
|
691
|
+
if (value !== false) {
|
|
692
|
+
element.setAttribute(prop, attributes[prop]);
|
|
693
|
+
} else {
|
|
694
|
+
element.removeAttribute(prop);
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
function applyStyle(data) {
|
|
699
|
+
setStyles(data.instance.popper, data.styles);
|
|
700
|
+
setAttributes(data.instance.popper, data.attributes);
|
|
701
|
+
if (data.arrowElement && Object.keys(data.arrowStyles).length) {
|
|
702
|
+
setStyles(data.arrowElement, data.arrowStyles);
|
|
703
|
+
}
|
|
704
|
+
return data;
|
|
705
|
+
}
|
|
706
|
+
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
|
|
707
|
+
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
|
|
708
|
+
var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
|
|
709
|
+
popper.setAttribute('x-placement', placement);
|
|
710
|
+
setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
|
|
711
|
+
return options;
|
|
712
|
+
}
|
|
713
|
+
function getRoundedOffsets(data, shouldRound) {
|
|
714
|
+
var _data$offsets = data.offsets,
|
|
715
|
+
popper = _data$offsets.popper,
|
|
716
|
+
reference = _data$offsets.reference;
|
|
717
|
+
var round = Math.round,
|
|
718
|
+
floor = Math.floor;
|
|
719
|
+
var noRound = function noRound(v) {
|
|
720
|
+
return v;
|
|
721
|
+
};
|
|
722
|
+
var referenceWidth = round(reference.width);
|
|
723
|
+
var popperWidth = round(popper.width);
|
|
724
|
+
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
|
725
|
+
var isVariation = data.placement.indexOf('-') !== -1;
|
|
726
|
+
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
|
727
|
+
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
|
728
|
+
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
|
|
729
|
+
var verticalToInteger = !shouldRound ? noRound : round;
|
|
730
|
+
return {
|
|
731
|
+
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
|
732
|
+
top: verticalToInteger(popper.top),
|
|
733
|
+
bottom: verticalToInteger(popper.bottom),
|
|
734
|
+
right: horizontalToInteger(popper.right)
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
|
|
738
|
+
function computeStyle(data, options) {
|
|
739
|
+
var x = options.x,
|
|
740
|
+
y = options.y;
|
|
741
|
+
var popper = data.offsets.popper;
|
|
742
|
+
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
|
|
743
|
+
return modifier.name === 'applyStyle';
|
|
744
|
+
}).gpuAcceleration;
|
|
745
|
+
if (legacyGpuAccelerationOption !== undefined) {
|
|
746
|
+
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
|
747
|
+
}
|
|
748
|
+
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
|
|
749
|
+
var offsetParent = getOffsetParent(data.instance.popper);
|
|
750
|
+
var offsetParentRect = getBoundingClientRect(offsetParent);
|
|
751
|
+
var styles = {
|
|
752
|
+
position: popper.position
|
|
753
|
+
};
|
|
754
|
+
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
|
|
755
|
+
var sideA = x === 'bottom' ? 'top' : 'bottom';
|
|
756
|
+
var sideB = y === 'right' ? 'left' : 'right';
|
|
757
|
+
var prefixedProperty = getSupportedPropertyName('transform');
|
|
758
|
+
var left = void 0,
|
|
759
|
+
top = void 0;
|
|
760
|
+
if (sideA === 'bottom') {
|
|
761
|
+
if (offsetParent.nodeName === 'HTML') {
|
|
762
|
+
top = -offsetParent.clientHeight + offsets.bottom;
|
|
591
763
|
} else {
|
|
592
|
-
|
|
764
|
+
top = -offsetParentRect.height + offsets.bottom;
|
|
593
765
|
}
|
|
766
|
+
} else {
|
|
767
|
+
top = offsets.top;
|
|
594
768
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}
|
|
769
|
+
if (sideB === 'right') {
|
|
770
|
+
if (offsetParent.nodeName === 'HTML') {
|
|
771
|
+
left = -offsetParent.clientWidth + offsets.right;
|
|
772
|
+
} else {
|
|
773
|
+
left = -offsetParentRect.width + offsets.right;
|
|
774
|
+
}
|
|
775
|
+
} else {
|
|
776
|
+
left = offsets.left;
|
|
777
|
+
}
|
|
778
|
+
if (gpuAcceleration && prefixedProperty) {
|
|
779
|
+
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
780
|
+
styles[sideA] = 0;
|
|
781
|
+
styles[sideB] = 0;
|
|
782
|
+
styles.willChange = 'transform';
|
|
783
|
+
} else {
|
|
784
|
+
var invertTop = sideA === 'bottom' ? -1 : 1;
|
|
785
|
+
var invertLeft = sideB === 'right' ? -1 : 1;
|
|
786
|
+
styles[sideA] = top * invertTop;
|
|
787
|
+
styles[sideB] = left * invertLeft;
|
|
788
|
+
styles.willChange = sideA + ', ' + sideB;
|
|
789
|
+
}
|
|
790
|
+
var attributes = {
|
|
791
|
+
'x-placement': data.placement
|
|
792
|
+
};
|
|
793
|
+
data.attributes = _extends({}, attributes, data.attributes);
|
|
794
|
+
data.styles = _extends({}, styles, data.styles);
|
|
795
|
+
data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
|
|
796
|
+
return data;
|
|
797
|
+
}
|
|
798
|
+
function isModifierRequired(modifiers, requestingName, requestedName) {
|
|
799
|
+
var requesting = find(modifiers, function (_ref) {
|
|
800
|
+
var name = _ref.name;
|
|
801
|
+
return name === requestingName;
|
|
802
|
+
});
|
|
803
|
+
var isRequired = !!requesting && modifiers.some(function (modifier) {
|
|
804
|
+
return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
|
|
805
|
+
});
|
|
806
|
+
if (!isRequired) {
|
|
807
|
+
var _requesting = '`' + requestingName + '`';
|
|
808
|
+
var requested = '`' + requestedName + '`';
|
|
809
|
+
console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
|
|
810
|
+
}
|
|
811
|
+
return isRequired;
|
|
812
|
+
}
|
|
813
|
+
function arrow(data, options) {
|
|
814
|
+
var _data$offsets$arrow;
|
|
815
|
+
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
|
|
816
|
+
return data;
|
|
601
817
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
var toCheck = prefix ? '' + prefix + upperProp : property;
|
|
608
|
-
if (typeof document.body.style[toCheck] !== 'undefined') {
|
|
609
|
-
return toCheck;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
return null;
|
|
613
|
-
}
|
|
614
|
-
function destroy() {
|
|
615
|
-
this.state.isDestroyed = true;
|
|
616
|
-
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
|
|
617
|
-
this.popper.removeAttribute('x-placement');
|
|
618
|
-
this.popper.style.position = '';
|
|
619
|
-
this.popper.style.top = '';
|
|
620
|
-
this.popper.style.left = '';
|
|
621
|
-
this.popper.style.right = '';
|
|
622
|
-
this.popper.style.bottom = '';
|
|
623
|
-
this.popper.style.willChange = '';
|
|
624
|
-
this.popper.style[getSupportedPropertyName('transform')] = '';
|
|
625
|
-
}
|
|
626
|
-
this.disableEventListeners();
|
|
627
|
-
if (this.options.removeOnDestroy) {
|
|
628
|
-
this.popper.parentNode.removeChild(this.popper);
|
|
629
|
-
}
|
|
630
|
-
return this;
|
|
631
|
-
}
|
|
632
|
-
function getWindow(element) {
|
|
633
|
-
var ownerDocument = element.ownerDocument;
|
|
634
|
-
return ownerDocument ? ownerDocument.defaultView : window;
|
|
635
|
-
}
|
|
636
|
-
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
|
|
637
|
-
var isBody = scrollParent.nodeName === 'BODY';
|
|
638
|
-
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
|
|
639
|
-
target.addEventListener(event, callback, { passive: true });
|
|
640
|
-
if (!isBody) {
|
|
641
|
-
attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
|
|
642
|
-
}
|
|
643
|
-
scrollParents.push(target);
|
|
644
|
-
}
|
|
645
|
-
function setupEventListeners(reference, options, state, updateBound) {
|
|
646
|
-
state.updateBound = updateBound;
|
|
647
|
-
getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
|
|
648
|
-
var scrollElement = getScrollParent(reference);
|
|
649
|
-
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
|
|
650
|
-
state.scrollElement = scrollElement;
|
|
651
|
-
state.eventsEnabled = true;
|
|
652
|
-
return state;
|
|
653
|
-
}
|
|
654
|
-
function enableEventListeners() {
|
|
655
|
-
if (!this.state.eventsEnabled) {
|
|
656
|
-
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
|
|
818
|
+
var arrowElement = options.element;
|
|
819
|
+
if (typeof arrowElement === 'string') {
|
|
820
|
+
arrowElement = data.instance.popper.querySelector(arrowElement);
|
|
821
|
+
if (!arrowElement) {
|
|
822
|
+
return data;
|
|
657
823
|
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
target.removeEventListener('scroll', state.updateBound);
|
|
663
|
-
});
|
|
664
|
-
state.updateBound = null;
|
|
665
|
-
state.scrollParents = [];
|
|
666
|
-
state.scrollElement = null;
|
|
667
|
-
state.eventsEnabled = false;
|
|
668
|
-
return state;
|
|
669
|
-
}
|
|
670
|
-
function disableEventListeners() {
|
|
671
|
-
if (this.state.eventsEnabled) {
|
|
672
|
-
cancelAnimationFrame(this.scheduleUpdate);
|
|
673
|
-
this.state = removeEventListeners(this.reference, this.state);
|
|
824
|
+
} else {
|
|
825
|
+
if (!data.instance.popper.contains(arrowElement)) {
|
|
826
|
+
console.warn('WARNING: `arrow.element` must be child of its popper element!');
|
|
827
|
+
return data;
|
|
674
828
|
}
|
|
675
829
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
830
|
+
var placement = data.placement.split('-')[0];
|
|
831
|
+
var _data$offsets = data.offsets,
|
|
832
|
+
popper = _data$offsets.popper,
|
|
833
|
+
reference = _data$offsets.reference;
|
|
834
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
835
|
+
var len = isVertical ? 'height' : 'width';
|
|
836
|
+
var sideCapitalized = isVertical ? 'Top' : 'Left';
|
|
837
|
+
var side = sideCapitalized.toLowerCase();
|
|
838
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
839
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
840
|
+
var arrowElementSize = getOuterSizes(arrowElement)[len];
|
|
841
|
+
if (reference[opSide] - arrowElementSize < popper[side]) {
|
|
842
|
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
|
|
843
|
+
}
|
|
844
|
+
if (reference[side] + arrowElementSize > popper[opSide]) {
|
|
845
|
+
data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
|
|
846
|
+
}
|
|
847
|
+
data.offsets.popper = getClientRect(data.offsets.popper);
|
|
848
|
+
var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
|
|
849
|
+
var css = getStyleComputedProperty(data.instance.popper);
|
|
850
|
+
var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
|
|
851
|
+
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
|
|
852
|
+
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
|
|
853
|
+
sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
|
|
854
|
+
data.arrowElement = arrowElement;
|
|
855
|
+
data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
|
|
856
|
+
return data;
|
|
857
|
+
}
|
|
858
|
+
function getOppositeVariation(variation) {
|
|
859
|
+
if (variation === 'end') {
|
|
860
|
+
return 'start';
|
|
861
|
+
} else if (variation === 'start') {
|
|
862
|
+
return 'end';
|
|
863
|
+
}
|
|
864
|
+
return variation;
|
|
865
|
+
}
|
|
866
|
+
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
|
867
|
+
var validPlacements = placements.slice(3);
|
|
868
|
+
function clockwise(placement) {
|
|
869
|
+
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
870
|
+
var index = validPlacements.indexOf(placement);
|
|
871
|
+
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
|
|
872
|
+
return counter ? arr.reverse() : arr;
|
|
873
|
+
}
|
|
874
|
+
var BEHAVIORS = {
|
|
875
|
+
FLIP: 'flip',
|
|
876
|
+
CLOCKWISE: 'clockwise',
|
|
877
|
+
COUNTERCLOCKWISE: 'counterclockwise'
|
|
878
|
+
};
|
|
879
|
+
function flip(data, options) {
|
|
880
|
+
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
|
|
704
881
|
return data;
|
|
705
882
|
}
|
|
706
|
-
|
|
707
|
-
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
|
|
708
|
-
var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
|
|
709
|
-
popper.setAttribute('x-placement', placement);
|
|
710
|
-
setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
|
|
711
|
-
return options;
|
|
712
|
-
}
|
|
713
|
-
function getRoundedOffsets(data, shouldRound) {
|
|
714
|
-
var _data$offsets = data.offsets,
|
|
715
|
-
popper = _data$offsets.popper,
|
|
716
|
-
reference = _data$offsets.reference;
|
|
717
|
-
var round = Math.round,
|
|
718
|
-
floor = Math.floor;
|
|
719
|
-
var noRound = function noRound(v) {
|
|
720
|
-
return v;
|
|
721
|
-
};
|
|
722
|
-
var referenceWidth = round(reference.width);
|
|
723
|
-
var popperWidth = round(popper.width);
|
|
724
|
-
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
|
725
|
-
var isVariation = data.placement.indexOf('-') !== -1;
|
|
726
|
-
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
|
727
|
-
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
|
728
|
-
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
|
|
729
|
-
var verticalToInteger = !shouldRound ? noRound : round;
|
|
730
|
-
return {
|
|
731
|
-
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
|
732
|
-
top: verticalToInteger(popper.top),
|
|
733
|
-
bottom: verticalToInteger(popper.bottom),
|
|
734
|
-
right: horizontalToInteger(popper.right)
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
|
|
738
|
-
function computeStyle(data, options) {
|
|
739
|
-
var x = options.x,
|
|
740
|
-
y = options.y;
|
|
741
|
-
var popper = data.offsets.popper;
|
|
742
|
-
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
|
|
743
|
-
return modifier.name === 'applyStyle';
|
|
744
|
-
}).gpuAcceleration;
|
|
745
|
-
if (legacyGpuAccelerationOption !== undefined) {
|
|
746
|
-
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
|
747
|
-
}
|
|
748
|
-
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
|
|
749
|
-
var offsetParent = getOffsetParent(data.instance.popper);
|
|
750
|
-
var offsetParentRect = getBoundingClientRect(offsetParent);
|
|
751
|
-
var styles = {
|
|
752
|
-
position: popper.position
|
|
753
|
-
};
|
|
754
|
-
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
|
|
755
|
-
var sideA = x === 'bottom' ? 'top' : 'bottom';
|
|
756
|
-
var sideB = y === 'right' ? 'left' : 'right';
|
|
757
|
-
var prefixedProperty = getSupportedPropertyName('transform');
|
|
758
|
-
var left = void 0,
|
|
759
|
-
top = void 0;
|
|
760
|
-
if (sideA === 'bottom') {
|
|
761
|
-
if (offsetParent.nodeName === 'HTML') {
|
|
762
|
-
top = -offsetParent.clientHeight + offsets.bottom;
|
|
763
|
-
} else {
|
|
764
|
-
top = -offsetParentRect.height + offsets.bottom;
|
|
765
|
-
}
|
|
766
|
-
} else {
|
|
767
|
-
top = offsets.top;
|
|
768
|
-
}
|
|
769
|
-
if (sideB === 'right') {
|
|
770
|
-
if (offsetParent.nodeName === 'HTML') {
|
|
771
|
-
left = -offsetParent.clientWidth + offsets.right;
|
|
772
|
-
} else {
|
|
773
|
-
left = -offsetParentRect.width + offsets.right;
|
|
774
|
-
}
|
|
775
|
-
} else {
|
|
776
|
-
left = offsets.left;
|
|
777
|
-
}
|
|
778
|
-
if (gpuAcceleration && prefixedProperty) {
|
|
779
|
-
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
780
|
-
styles[sideA] = 0;
|
|
781
|
-
styles[sideB] = 0;
|
|
782
|
-
styles.willChange = 'transform';
|
|
783
|
-
} else {
|
|
784
|
-
var invertTop = sideA === 'bottom' ? -1 : 1;
|
|
785
|
-
var invertLeft = sideB === 'right' ? -1 : 1;
|
|
786
|
-
styles[sideA] = top * invertTop;
|
|
787
|
-
styles[sideB] = left * invertLeft;
|
|
788
|
-
styles.willChange = sideA + ', ' + sideB;
|
|
789
|
-
}
|
|
790
|
-
var attributes = {
|
|
791
|
-
'x-placement': data.placement
|
|
792
|
-
};
|
|
793
|
-
data.attributes = _extends({}, attributes, data.attributes);
|
|
794
|
-
data.styles = _extends({}, styles, data.styles);
|
|
795
|
-
data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
|
|
883
|
+
if (data.flipped && data.placement === data.originalPlacement) {
|
|
796
884
|
return data;
|
|
797
885
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
886
|
+
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
|
|
887
|
+
var placement = data.placement.split('-')[0];
|
|
888
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
889
|
+
var variation = data.placement.split('-')[1] || '';
|
|
890
|
+
var flipOrder = [];
|
|
891
|
+
switch (options.behavior) {
|
|
892
|
+
case BEHAVIORS.FLIP:
|
|
893
|
+
flipOrder = [placement, placementOpposite];
|
|
894
|
+
break;
|
|
895
|
+
case BEHAVIORS.CLOCKWISE:
|
|
896
|
+
flipOrder = clockwise(placement);
|
|
897
|
+
break;
|
|
898
|
+
case BEHAVIORS.COUNTERCLOCKWISE:
|
|
899
|
+
flipOrder = clockwise(placement, true);
|
|
900
|
+
break;
|
|
901
|
+
default:
|
|
902
|
+
flipOrder = options.behavior;
|
|
812
903
|
}
|
|
813
|
-
function
|
|
814
|
-
|
|
815
|
-
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
|
|
904
|
+
flipOrder.forEach(function (step, index) {
|
|
905
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
816
906
|
return data;
|
|
817
907
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
908
|
+
placement = data.placement.split('-')[0];
|
|
909
|
+
placementOpposite = getOppositePlacement(placement);
|
|
910
|
+
var popperOffsets = data.offsets.popper;
|
|
911
|
+
var refOffsets = data.offsets.reference;
|
|
912
|
+
var floor = Math.floor;
|
|
913
|
+
var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
|
|
914
|
+
var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
|
|
915
|
+
var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
|
|
916
|
+
var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
|
|
917
|
+
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
|
|
918
|
+
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
|
|
919
|
+
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
|
920
|
+
var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
|
|
921
|
+
var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
|
|
922
|
+
var flippedVariation = flippedVariationByRef || flippedVariationByContent;
|
|
923
|
+
if (overlapsRef || overflowsBoundaries || flippedVariation) {
|
|
924
|
+
data.flipped = true;
|
|
925
|
+
if (overlapsRef || overflowsBoundaries) {
|
|
926
|
+
placement = flipOrder[index + 1];
|
|
823
927
|
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
console.warn('WARNING: `arrow.element` must be child of its popper element!');
|
|
827
|
-
return data;
|
|
928
|
+
if (flippedVariation) {
|
|
929
|
+
variation = getOppositeVariation(variation);
|
|
828
930
|
}
|
|
931
|
+
data.placement = placement + (variation ? '-' + variation : '');
|
|
932
|
+
data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
|
933
|
+
data = runModifiers(data.instance.modifiers, data, 'flip');
|
|
829
934
|
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
data.offsets.popper =
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
return
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
864
|
-
return variation;
|
|
865
|
-
}
|
|
866
|
-
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
|
867
|
-
var validPlacements = placements.slice(3);
|
|
868
|
-
function clockwise(placement) {
|
|
869
|
-
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
870
|
-
var index = validPlacements.indexOf(placement);
|
|
871
|
-
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
|
|
872
|
-
return counter ? arr.reverse() : arr;
|
|
873
|
-
}
|
|
874
|
-
var BEHAVIORS = {
|
|
875
|
-
FLIP: 'flip',
|
|
876
|
-
CLOCKWISE: 'clockwise',
|
|
877
|
-
COUNTERCLOCKWISE: 'counterclockwise'
|
|
878
|
-
};
|
|
879
|
-
function flip(data, options) {
|
|
880
|
-
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
|
|
881
|
-
return data;
|
|
882
|
-
}
|
|
883
|
-
if (data.flipped && data.placement === data.originalPlacement) {
|
|
884
|
-
return data;
|
|
885
|
-
}
|
|
886
|
-
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
|
|
887
|
-
var placement = data.placement.split('-')[0];
|
|
888
|
-
var placementOpposite = getOppositePlacement(placement);
|
|
889
|
-
var variation = data.placement.split('-')[1] || '';
|
|
890
|
-
var flipOrder = [];
|
|
891
|
-
switch (options.behavior) {
|
|
892
|
-
case BEHAVIORS.FLIP:
|
|
893
|
-
flipOrder = [placement, placementOpposite];
|
|
894
|
-
break;
|
|
895
|
-
case BEHAVIORS.CLOCKWISE:
|
|
896
|
-
flipOrder = clockwise(placement);
|
|
897
|
-
break;
|
|
898
|
-
case BEHAVIORS.COUNTERCLOCKWISE:
|
|
899
|
-
flipOrder = clockwise(placement, true);
|
|
935
|
+
});
|
|
936
|
+
return data;
|
|
937
|
+
}
|
|
938
|
+
function keepTogether(data) {
|
|
939
|
+
var _data$offsets = data.offsets,
|
|
940
|
+
popper = _data$offsets.popper,
|
|
941
|
+
reference = _data$offsets.reference;
|
|
942
|
+
var placement = data.placement.split('-')[0];
|
|
943
|
+
var floor = Math.floor;
|
|
944
|
+
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
|
945
|
+
var side = isVertical ? 'right' : 'bottom';
|
|
946
|
+
var opSide = isVertical ? 'left' : 'top';
|
|
947
|
+
var measurement = isVertical ? 'width' : 'height';
|
|
948
|
+
if (popper[side] < floor(reference[opSide])) {
|
|
949
|
+
data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
|
|
950
|
+
}
|
|
951
|
+
if (popper[opSide] > floor(reference[side])) {
|
|
952
|
+
data.offsets.popper[opSide] = floor(reference[side]);
|
|
953
|
+
}
|
|
954
|
+
return data;
|
|
955
|
+
}
|
|
956
|
+
function toValue(str, measurement, popperOffsets, referenceOffsets) {
|
|
957
|
+
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
|
|
958
|
+
var value = +split[1];
|
|
959
|
+
var unit = split[2];
|
|
960
|
+
if (!value) {
|
|
961
|
+
return str;
|
|
962
|
+
}
|
|
963
|
+
if (unit.indexOf('%') === 0) {
|
|
964
|
+
var element = void 0;
|
|
965
|
+
switch (unit) {
|
|
966
|
+
case '%p':
|
|
967
|
+
element = popperOffsets;
|
|
900
968
|
break;
|
|
969
|
+
case '%':
|
|
970
|
+
case '%r':
|
|
901
971
|
default:
|
|
902
|
-
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
972
|
+
element = referenceOffsets;
|
|
973
|
+
}
|
|
974
|
+
var rect = getClientRect(element);
|
|
975
|
+
return rect[measurement] / 100 * value;
|
|
976
|
+
} else if (unit === 'vh' || unit === 'vw') {
|
|
977
|
+
var size = void 0;
|
|
978
|
+
if (unit === 'vh') {
|
|
979
|
+
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
980
|
+
} else {
|
|
981
|
+
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
982
|
+
}
|
|
983
|
+
return size / 100 * value;
|
|
984
|
+
} else {
|
|
985
|
+
return value;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
|
|
989
|
+
var offsets = [0, 0];
|
|
990
|
+
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
|
|
991
|
+
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
|
|
992
|
+
return frag.trim();
|
|
993
|
+
});
|
|
994
|
+
var divider = fragments.indexOf(find(fragments, function (frag) {
|
|
995
|
+
return frag.search(/,|\s/) !== -1;
|
|
996
|
+
}));
|
|
997
|
+
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
|
|
998
|
+
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
|
|
999
|
+
}
|
|
1000
|
+
var splitRegex = /\s*,\s*|\s+/;
|
|
1001
|
+
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
|
|
1002
|
+
ops = ops.map(function (op, index) {
|
|
1003
|
+
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
|
|
1004
|
+
var mergeWithPrevious = false;
|
|
1005
|
+
return op
|
|
1006
|
+
.reduce(function (a, b) {
|
|
1007
|
+
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
|
|
1008
|
+
a[a.length - 1] = b;
|
|
1009
|
+
mergeWithPrevious = true;
|
|
1010
|
+
return a;
|
|
1011
|
+
} else if (mergeWithPrevious) {
|
|
1012
|
+
a[a.length - 1] += b;
|
|
1013
|
+
mergeWithPrevious = false;
|
|
1014
|
+
return a;
|
|
1015
|
+
} else {
|
|
1016
|
+
return a.concat(b);
|
|
907
1017
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
|
|
918
|
-
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
|
|
919
|
-
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
|
920
|
-
var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
|
|
921
|
-
var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
|
|
922
|
-
var flippedVariation = flippedVariationByRef || flippedVariationByContent;
|
|
923
|
-
if (overlapsRef || overflowsBoundaries || flippedVariation) {
|
|
924
|
-
data.flipped = true;
|
|
925
|
-
if (overlapsRef || overflowsBoundaries) {
|
|
926
|
-
placement = flipOrder[index + 1];
|
|
927
|
-
}
|
|
928
|
-
if (flippedVariation) {
|
|
929
|
-
variation = getOppositeVariation(variation);
|
|
930
|
-
}
|
|
931
|
-
data.placement = placement + (variation ? '-' + variation : '');
|
|
932
|
-
data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
|
933
|
-
data = runModifiers(data.instance.modifiers, data, 'flip');
|
|
1018
|
+
}, [])
|
|
1019
|
+
.map(function (str) {
|
|
1020
|
+
return toValue(str, measurement, popperOffsets, referenceOffsets);
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
ops.forEach(function (op, index) {
|
|
1024
|
+
op.forEach(function (frag, index2) {
|
|
1025
|
+
if (isNumeric(frag)) {
|
|
1026
|
+
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
|
|
934
1027
|
}
|
|
935
1028
|
});
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1029
|
+
});
|
|
1030
|
+
return offsets;
|
|
1031
|
+
}
|
|
1032
|
+
function offset(data, _ref) {
|
|
1033
|
+
var offset = _ref.offset;
|
|
1034
|
+
var placement = data.placement,
|
|
1035
|
+
_data$offsets = data.offsets,
|
|
1036
|
+
popper = _data$offsets.popper,
|
|
1037
|
+
reference = _data$offsets.reference;
|
|
1038
|
+
var basePlacement = placement.split('-')[0];
|
|
1039
|
+
var offsets = void 0;
|
|
1040
|
+
if (isNumeric(+offset)) {
|
|
1041
|
+
offsets = [+offset, 0];
|
|
1042
|
+
} else {
|
|
1043
|
+
offsets = parseOffset(offset, popper, reference, basePlacement);
|
|
1044
|
+
}
|
|
1045
|
+
if (basePlacement === 'left') {
|
|
1046
|
+
popper.top += offsets[0];
|
|
1047
|
+
popper.left -= offsets[1];
|
|
1048
|
+
} else if (basePlacement === 'right') {
|
|
1049
|
+
popper.top += offsets[0];
|
|
1050
|
+
popper.left += offsets[1];
|
|
1051
|
+
} else if (basePlacement === 'top') {
|
|
1052
|
+
popper.left += offsets[0];
|
|
1053
|
+
popper.top -= offsets[1];
|
|
1054
|
+
} else if (basePlacement === 'bottom') {
|
|
1055
|
+
popper.left += offsets[0];
|
|
1056
|
+
popper.top += offsets[1];
|
|
1057
|
+
}
|
|
1058
|
+
data.popper = popper;
|
|
1059
|
+
return data;
|
|
1060
|
+
}
|
|
1061
|
+
function preventOverflow(data, options) {
|
|
1062
|
+
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
|
|
1063
|
+
if (data.instance.reference === boundariesElement) {
|
|
1064
|
+
boundariesElement = getOffsetParent(boundariesElement);
|
|
1065
|
+
}
|
|
1066
|
+
var transformProp = getSupportedPropertyName('transform');
|
|
1067
|
+
var popperStyles = data.instance.popper.style;
|
|
1068
|
+
var top = popperStyles.top,
|
|
1069
|
+
left = popperStyles.left,
|
|
1070
|
+
transform = popperStyles[transformProp];
|
|
1071
|
+
popperStyles.top = '';
|
|
1072
|
+
popperStyles.left = '';
|
|
1073
|
+
popperStyles[transformProp] = '';
|
|
1074
|
+
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
|
|
1075
|
+
popperStyles.top = top;
|
|
1076
|
+
popperStyles.left = left;
|
|
1077
|
+
popperStyles[transformProp] = transform;
|
|
1078
|
+
options.boundaries = boundaries;
|
|
1079
|
+
var order = options.priority;
|
|
1080
|
+
var popper = data.offsets.popper;
|
|
1081
|
+
var check = {
|
|
1082
|
+
primary: function primary(placement) {
|
|
1083
|
+
var value = popper[placement];
|
|
1084
|
+
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
|
|
1085
|
+
value = Math.max(popper[placement], boundaries[placement]);
|
|
973
1086
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
var
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
1087
|
+
return defineProperty({}, placement, value);
|
|
1088
|
+
},
|
|
1089
|
+
secondary: function secondary(placement) {
|
|
1090
|
+
var mainSide = placement === 'right' ? 'left' : 'top';
|
|
1091
|
+
var value = popper[mainSide];
|
|
1092
|
+
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
|
|
1093
|
+
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
|
|
982
1094
|
}
|
|
983
|
-
return
|
|
984
|
-
} else {
|
|
985
|
-
return value;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
|
|
989
|
-
var offsets = [0, 0];
|
|
990
|
-
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
|
|
991
|
-
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
|
|
992
|
-
return frag.trim();
|
|
993
|
-
});
|
|
994
|
-
var divider = fragments.indexOf(find(fragments, function (frag) {
|
|
995
|
-
return frag.search(/,|\s/) !== -1;
|
|
996
|
-
}));
|
|
997
|
-
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
|
|
998
|
-
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
|
|
1095
|
+
return defineProperty({}, mainSide, value);
|
|
999
1096
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
})
|
|
1022
|
-
});
|
|
1023
|
-
ops.forEach(function (op, index) {
|
|
1024
|
-
op.forEach(function (frag, index2) {
|
|
1025
|
-
if (isNumeric(frag)) {
|
|
1026
|
-
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
|
|
1027
|
-
}
|
|
1028
|
-
});
|
|
1029
|
-
});
|
|
1030
|
-
return offsets;
|
|
1031
|
-
}
|
|
1032
|
-
function offset(data, _ref) {
|
|
1033
|
-
var offset = _ref.offset;
|
|
1034
|
-
var placement = data.placement,
|
|
1035
|
-
_data$offsets = data.offsets,
|
|
1036
|
-
popper = _data$offsets.popper,
|
|
1037
|
-
reference = _data$offsets.reference;
|
|
1038
|
-
var basePlacement = placement.split('-')[0];
|
|
1039
|
-
var offsets = void 0;
|
|
1040
|
-
if (isNumeric(+offset)) {
|
|
1041
|
-
offsets = [+offset, 0];
|
|
1042
|
-
} else {
|
|
1043
|
-
offsets = parseOffset(offset, popper, reference, basePlacement);
|
|
1044
|
-
}
|
|
1045
|
-
if (basePlacement === 'left') {
|
|
1046
|
-
popper.top += offsets[0];
|
|
1047
|
-
popper.left -= offsets[1];
|
|
1048
|
-
} else if (basePlacement === 'right') {
|
|
1049
|
-
popper.top += offsets[0];
|
|
1050
|
-
popper.left += offsets[1];
|
|
1051
|
-
} else if (basePlacement === 'top') {
|
|
1052
|
-
popper.left += offsets[0];
|
|
1053
|
-
popper.top -= offsets[1];
|
|
1054
|
-
} else if (basePlacement === 'bottom') {
|
|
1055
|
-
popper.left += offsets[0];
|
|
1056
|
-
popper.top += offsets[1];
|
|
1057
|
-
}
|
|
1058
|
-
data.popper = popper;
|
|
1059
|
-
return data;
|
|
1060
|
-
}
|
|
1061
|
-
function preventOverflow(data, options) {
|
|
1062
|
-
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
|
|
1063
|
-
if (data.instance.reference === boundariesElement) {
|
|
1064
|
-
boundariesElement = getOffsetParent(boundariesElement);
|
|
1065
|
-
}
|
|
1066
|
-
var transformProp = getSupportedPropertyName('transform');
|
|
1067
|
-
var popperStyles = data.instance.popper.style;
|
|
1068
|
-
var top = popperStyles.top,
|
|
1069
|
-
left = popperStyles.left,
|
|
1070
|
-
transform = popperStyles[transformProp];
|
|
1071
|
-
popperStyles.top = '';
|
|
1072
|
-
popperStyles.left = '';
|
|
1073
|
-
popperStyles[transformProp] = '';
|
|
1074
|
-
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
|
|
1075
|
-
popperStyles.top = top;
|
|
1076
|
-
popperStyles.left = left;
|
|
1077
|
-
popperStyles[transformProp] = transform;
|
|
1078
|
-
options.boundaries = boundaries;
|
|
1079
|
-
var order = options.priority;
|
|
1080
|
-
var popper = data.offsets.popper;
|
|
1081
|
-
var check = {
|
|
1082
|
-
primary: function primary(placement) {
|
|
1083
|
-
var value = popper[placement];
|
|
1084
|
-
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
|
|
1085
|
-
value = Math.max(popper[placement], boundaries[placement]);
|
|
1086
|
-
}
|
|
1087
|
-
return defineProperty({}, placement, value);
|
|
1088
|
-
},
|
|
1089
|
-
secondary: function secondary(placement) {
|
|
1090
|
-
var mainSide = placement === 'right' ? 'left' : 'top';
|
|
1091
|
-
var value = popper[mainSide];
|
|
1092
|
-
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
|
|
1093
|
-
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
|
|
1094
|
-
}
|
|
1095
|
-
return defineProperty({}, mainSide, value);
|
|
1096
|
-
}
|
|
1097
|
+
};
|
|
1098
|
+
order.forEach(function (placement) {
|
|
1099
|
+
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
|
1100
|
+
popper = _extends({}, popper, check[side](placement));
|
|
1101
|
+
});
|
|
1102
|
+
data.offsets.popper = popper;
|
|
1103
|
+
return data;
|
|
1104
|
+
}
|
|
1105
|
+
function shift(data) {
|
|
1106
|
+
var placement = data.placement;
|
|
1107
|
+
var basePlacement = placement.split('-')[0];
|
|
1108
|
+
var shiftvariation = placement.split('-')[1];
|
|
1109
|
+
if (shiftvariation) {
|
|
1110
|
+
var _data$offsets = data.offsets,
|
|
1111
|
+
reference = _data$offsets.reference,
|
|
1112
|
+
popper = _data$offsets.popper;
|
|
1113
|
+
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
|
|
1114
|
+
var side = isVertical ? 'left' : 'top';
|
|
1115
|
+
var measurement = isVertical ? 'width' : 'height';
|
|
1116
|
+
var shiftOffsets = {
|
|
1117
|
+
start: defineProperty({}, side, reference[side]),
|
|
1118
|
+
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
|
1097
1119
|
};
|
|
1098
|
-
|
|
1099
|
-
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
|
1100
|
-
popper = _extends({}, popper, check[side](placement));
|
|
1101
|
-
});
|
|
1102
|
-
data.offsets.popper = popper;
|
|
1103
|
-
return data;
|
|
1120
|
+
data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
|
|
1104
1121
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
if (shiftvariation) {
|
|
1110
|
-
var _data$offsets = data.offsets,
|
|
1111
|
-
reference = _data$offsets.reference,
|
|
1112
|
-
popper = _data$offsets.popper;
|
|
1113
|
-
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
|
|
1114
|
-
var side = isVertical ? 'left' : 'top';
|
|
1115
|
-
var measurement = isVertical ? 'width' : 'height';
|
|
1116
|
-
var shiftOffsets = {
|
|
1117
|
-
start: defineProperty({}, side, reference[side]),
|
|
1118
|
-
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
|
1119
|
-
};
|
|
1120
|
-
data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
|
|
1121
|
-
}
|
|
1122
|
+
return data;
|
|
1123
|
+
}
|
|
1124
|
+
function hide(data) {
|
|
1125
|
+
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
|
|
1122
1126
|
return data;
|
|
1123
1127
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1128
|
+
var refRect = data.offsets.reference;
|
|
1129
|
+
var bound = find(data.instance.modifiers, function (modifier) {
|
|
1130
|
+
return modifier.name === 'preventOverflow';
|
|
1131
|
+
}).boundaries;
|
|
1132
|
+
if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
|
|
1133
|
+
if (data.hide === true) {
|
|
1134
|
+
return data;
|
|
1135
|
+
}
|
|
1136
|
+
data.hide = true;
|
|
1137
|
+
data.attributes['x-out-of-boundaries'] = '';
|
|
1138
|
+
} else {
|
|
1139
|
+
if (data.hide === false) {
|
|
1126
1140
|
return data;
|
|
1127
1141
|
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1142
|
+
data.hide = false;
|
|
1143
|
+
data.attributes['x-out-of-boundaries'] = false;
|
|
1144
|
+
}
|
|
1145
|
+
return data;
|
|
1146
|
+
}
|
|
1147
|
+
function inner(data) {
|
|
1148
|
+
var placement = data.placement;
|
|
1149
|
+
var basePlacement = placement.split('-')[0];
|
|
1150
|
+
var _data$offsets = data.offsets,
|
|
1151
|
+
popper = _data$offsets.popper,
|
|
1152
|
+
reference = _data$offsets.reference;
|
|
1153
|
+
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
|
|
1154
|
+
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
|
|
1155
|
+
popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
|
|
1156
|
+
data.placement = getOppositePlacement(placement);
|
|
1157
|
+
data.offsets.popper = getClientRect(popper);
|
|
1158
|
+
return data;
|
|
1159
|
+
}
|
|
1160
|
+
var modifiers = {
|
|
1161
|
+
shift: {
|
|
1162
|
+
order: 100,
|
|
1163
|
+
enabled: true,
|
|
1164
|
+
fn: shift
|
|
1165
|
+
},
|
|
1166
|
+
offset: {
|
|
1167
|
+
order: 200,
|
|
1168
|
+
enabled: true,
|
|
1169
|
+
fn: offset,
|
|
1170
|
+
offset: 0
|
|
1171
|
+
},
|
|
1172
|
+
preventOverflow: {
|
|
1173
|
+
order: 300,
|
|
1174
|
+
enabled: true,
|
|
1175
|
+
fn: preventOverflow,
|
|
1176
|
+
priority: ['left', 'right', 'top', 'bottom'],
|
|
1177
|
+
padding: 5,
|
|
1178
|
+
boundariesElement: 'scrollParent'
|
|
1179
|
+
},
|
|
1180
|
+
keepTogether: {
|
|
1181
|
+
order: 400,
|
|
1182
|
+
enabled: true,
|
|
1183
|
+
fn: keepTogether
|
|
1184
|
+
},
|
|
1185
|
+
arrow: {
|
|
1186
|
+
order: 500,
|
|
1187
|
+
enabled: true,
|
|
1188
|
+
fn: arrow,
|
|
1189
|
+
element: '[x-arrow]'
|
|
1190
|
+
},
|
|
1191
|
+
flip: {
|
|
1192
|
+
order: 600,
|
|
1193
|
+
enabled: true,
|
|
1194
|
+
fn: flip,
|
|
1195
|
+
behavior: 'flip',
|
|
1196
|
+
padding: 5,
|
|
1197
|
+
boundariesElement: 'viewport',
|
|
1198
|
+
flipVariations: false,
|
|
1199
|
+
flipVariationsByContent: false
|
|
1200
|
+
},
|
|
1201
|
+
inner: {
|
|
1202
|
+
order: 700,
|
|
1203
|
+
enabled: false,
|
|
1204
|
+
fn: inner
|
|
1205
|
+
},
|
|
1206
|
+
hide: {
|
|
1207
|
+
order: 800,
|
|
1208
|
+
enabled: true,
|
|
1209
|
+
fn: hide
|
|
1210
|
+
},
|
|
1211
|
+
computeStyle: {
|
|
1212
|
+
order: 850,
|
|
1213
|
+
enabled: true,
|
|
1214
|
+
fn: computeStyle,
|
|
1215
|
+
gpuAcceleration: true,
|
|
1216
|
+
x: 'bottom',
|
|
1217
|
+
y: 'right'
|
|
1218
|
+
},
|
|
1219
|
+
applyStyle: {
|
|
1220
|
+
order: 900,
|
|
1221
|
+
enabled: true,
|
|
1222
|
+
fn: applyStyle,
|
|
1223
|
+
onLoad: applyStyleOnLoad,
|
|
1224
|
+
gpuAcceleration: undefined
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
var Defaults = {
|
|
1228
|
+
placement: 'bottom',
|
|
1229
|
+
positionFixed: false,
|
|
1230
|
+
eventsEnabled: true,
|
|
1231
|
+
removeOnDestroy: false,
|
|
1232
|
+
onCreate: function onCreate() {},
|
|
1233
|
+
onUpdate: function onUpdate() {},
|
|
1234
|
+
modifiers: modifiers
|
|
1235
|
+
};
|
|
1236
|
+
var Popper = function () {
|
|
1237
|
+
function Popper(reference, popper) {
|
|
1238
|
+
var _this = this;
|
|
1239
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1240
|
+
classCallCheck(this, Popper);
|
|
1241
|
+
this.scheduleUpdate = function () {
|
|
1242
|
+
return requestAnimationFrame(_this.update);
|
|
1243
|
+
};
|
|
1244
|
+
this.update = debounce(this.update.bind(this));
|
|
1245
|
+
this.options = _extends({}, Popper.Defaults, options);
|
|
1246
|
+
this.state = {
|
|
1247
|
+
isDestroyed: false,
|
|
1248
|
+
isCreated: false,
|
|
1249
|
+
scrollParents: []
|
|
1250
|
+
};
|
|
1251
|
+
this.reference = reference && reference.jquery ? reference[0] : reference;
|
|
1252
|
+
this.popper = popper && popper.jquery ? popper[0] : popper;
|
|
1253
|
+
this.options.modifiers = {};
|
|
1254
|
+
Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
|
1255
|
+
_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
|
1256
|
+
});
|
|
1257
|
+
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
|
|
1258
|
+
return _extends({
|
|
1259
|
+
name: name
|
|
1260
|
+
}, _this.options.modifiers[name]);
|
|
1261
|
+
})
|
|
1262
|
+
.sort(function (a, b) {
|
|
1263
|
+
return a.order - b.order;
|
|
1264
|
+
});
|
|
1265
|
+
this.modifiers.forEach(function (modifierOptions) {
|
|
1266
|
+
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
|
|
1267
|
+
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
|
|
1135
1268
|
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1269
|
+
});
|
|
1270
|
+
this.update();
|
|
1271
|
+
var eventsEnabled = this.options.eventsEnabled;
|
|
1272
|
+
if (eventsEnabled) {
|
|
1273
|
+
this.enableEventListeners();
|
|
1274
|
+
}
|
|
1275
|
+
this.state.eventsEnabled = eventsEnabled;
|
|
1276
|
+
}
|
|
1277
|
+
createClass(Popper, [{
|
|
1278
|
+
key: 'update',
|
|
1279
|
+
value: function update$$1() {
|
|
1280
|
+
return update.call(this);
|
|
1281
|
+
}
|
|
1282
|
+
}, {
|
|
1283
|
+
key: 'destroy',
|
|
1284
|
+
value: function destroy$$1() {
|
|
1285
|
+
return destroy.call(this);
|
|
1286
|
+
}
|
|
1287
|
+
}, {
|
|
1288
|
+
key: 'enableEventListeners',
|
|
1289
|
+
value: function enableEventListeners$$1() {
|
|
1290
|
+
return enableEventListeners.call(this);
|
|
1291
|
+
}
|
|
1292
|
+
}, {
|
|
1293
|
+
key: 'disableEventListeners',
|
|
1294
|
+
value: function disableEventListeners$$1() {
|
|
1295
|
+
return disableEventListeners.call(this);
|
|
1296
|
+
}
|
|
1297
|
+
}]);
|
|
1298
|
+
return Popper;
|
|
1299
|
+
}();
|
|
1300
|
+
Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
|
|
1301
|
+
Popper.placements = placements;
|
|
1302
|
+
Popper.Defaults = Defaults;
|
|
1303
|
+
|
|
1304
|
+
var variable = {
|
|
1305
|
+
dropdownMarginBottom: '4px'
|
|
1306
|
+
};
|
|
1307
|
+
var variable_1 = variable.dropdownMarginBottom;
|
|
1308
|
+
|
|
1309
|
+
var script = {
|
|
1310
|
+
name: 'bk-dropdown-menu',
|
|
1311
|
+
directives: {
|
|
1312
|
+
clickoutside: bkClickoutside
|
|
1313
|
+
},
|
|
1314
|
+
props: {
|
|
1315
|
+
trigger: {
|
|
1316
|
+
type: String,
|
|
1317
|
+
default: 'mouseover',
|
|
1318
|
+
validator: function validator(event) {
|
|
1319
|
+
return ['click', 'mouseover'].includes(event);
|
|
1141
1320
|
}
|
|
1142
|
-
data.hide = false;
|
|
1143
|
-
data.attributes['x-out-of-boundaries'] = false;
|
|
1144
|
-
}
|
|
1145
|
-
return data;
|
|
1146
|
-
}
|
|
1147
|
-
function inner(data) {
|
|
1148
|
-
var placement = data.placement;
|
|
1149
|
-
var basePlacement = placement.split('-')[0];
|
|
1150
|
-
var _data$offsets = data.offsets,
|
|
1151
|
-
popper = _data$offsets.popper,
|
|
1152
|
-
reference = _data$offsets.reference;
|
|
1153
|
-
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
|
|
1154
|
-
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
|
|
1155
|
-
popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
|
|
1156
|
-
data.placement = getOppositePlacement(placement);
|
|
1157
|
-
data.offsets.popper = getClientRect(popper);
|
|
1158
|
-
return data;
|
|
1159
|
-
}
|
|
1160
|
-
var modifiers = {
|
|
1161
|
-
shift: {
|
|
1162
|
-
order: 100,
|
|
1163
|
-
enabled: true,
|
|
1164
|
-
fn: shift
|
|
1165
1321
|
},
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
fn: offset,
|
|
1170
|
-
offset: 0
|
|
1322
|
+
align: {
|
|
1323
|
+
type: String,
|
|
1324
|
+
default: 'left'
|
|
1171
1325
|
},
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
fn: preventOverflow,
|
|
1176
|
-
priority: ['left', 'right', 'top', 'bottom'],
|
|
1177
|
-
padding: 5,
|
|
1178
|
-
boundariesElement: 'scrollParent'
|
|
1326
|
+
disabled: {
|
|
1327
|
+
type: Boolean,
|
|
1328
|
+
default: false
|
|
1179
1329
|
},
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
fn: keepTogether
|
|
1330
|
+
positionFixed: {
|
|
1331
|
+
type: Boolean,
|
|
1332
|
+
default: false
|
|
1184
1333
|
},
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
fn: arrow,
|
|
1189
|
-
element: '[x-arrow]'
|
|
1334
|
+
fontSize: {
|
|
1335
|
+
type: String,
|
|
1336
|
+
default: 'normal'
|
|
1190
1337
|
},
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
fn: flip,
|
|
1195
|
-
behavior: 'flip',
|
|
1196
|
-
padding: 5,
|
|
1197
|
-
boundariesElement: 'viewport',
|
|
1198
|
-
flipVariations: false,
|
|
1199
|
-
flipVariationsByContent: false
|
|
1338
|
+
extCls: {
|
|
1339
|
+
type: String,
|
|
1340
|
+
default: ''
|
|
1200
1341
|
},
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
fn: inner
|
|
1342
|
+
openDelay: {
|
|
1343
|
+
type: Number,
|
|
1344
|
+
default: 0
|
|
1205
1345
|
},
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
fn: hide
|
|
1210
|
-
},
|
|
1211
|
-
computeStyle: {
|
|
1212
|
-
order: 850,
|
|
1213
|
-
enabled: true,
|
|
1214
|
-
fn: computeStyle,
|
|
1215
|
-
gpuAcceleration: true,
|
|
1216
|
-
x: 'bottom',
|
|
1217
|
-
y: 'right'
|
|
1218
|
-
},
|
|
1219
|
-
applyStyle: {
|
|
1220
|
-
order: 900,
|
|
1221
|
-
enabled: true,
|
|
1222
|
-
fn: applyStyle,
|
|
1223
|
-
onLoad: applyStyleOnLoad,
|
|
1224
|
-
gpuAcceleration: undefined
|
|
1346
|
+
closeDelay: {
|
|
1347
|
+
type: Number,
|
|
1348
|
+
default: 100
|
|
1225
1349
|
}
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
return requestAnimationFrame(_this.update);
|
|
1243
|
-
};
|
|
1244
|
-
this.update = debounce(this.update.bind(this));
|
|
1245
|
-
this.options = _extends({}, Popper.Defaults, options);
|
|
1246
|
-
this.state = {
|
|
1247
|
-
isDestroyed: false,
|
|
1248
|
-
isCreated: false,
|
|
1249
|
-
scrollParents: []
|
|
1250
|
-
};
|
|
1251
|
-
this.reference = reference && reference.jquery ? reference[0] : reference;
|
|
1252
|
-
this.popper = popper && popper.jquery ? popper[0] : popper;
|
|
1253
|
-
this.options.modifiers = {};
|
|
1254
|
-
Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
|
1255
|
-
_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
|
1256
|
-
});
|
|
1257
|
-
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
|
|
1258
|
-
return _extends({
|
|
1259
|
-
name: name
|
|
1260
|
-
}, _this.options.modifiers[name]);
|
|
1261
|
-
})
|
|
1262
|
-
.sort(function (a, b) {
|
|
1263
|
-
return a.order - b.order;
|
|
1264
|
-
});
|
|
1265
|
-
this.modifiers.forEach(function (modifierOptions) {
|
|
1266
|
-
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
|
|
1267
|
-
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
|
|
1268
|
-
}
|
|
1269
|
-
});
|
|
1270
|
-
this.update();
|
|
1271
|
-
var eventsEnabled = this.options.eventsEnabled;
|
|
1272
|
-
if (eventsEnabled) {
|
|
1273
|
-
this.enableEventListeners();
|
|
1274
|
-
}
|
|
1275
|
-
this.state.eventsEnabled = eventsEnabled;
|
|
1276
|
-
}
|
|
1277
|
-
createClass(Popper, [{
|
|
1278
|
-
key: 'update',
|
|
1279
|
-
value: function update$$1() {
|
|
1280
|
-
return update.call(this);
|
|
1281
|
-
}
|
|
1282
|
-
}, {
|
|
1283
|
-
key: 'destroy',
|
|
1284
|
-
value: function destroy$$1() {
|
|
1285
|
-
return destroy.call(this);
|
|
1350
|
+
},
|
|
1351
|
+
data: function data() {
|
|
1352
|
+
return {
|
|
1353
|
+
menuStyle: null,
|
|
1354
|
+
timer: 0,
|
|
1355
|
+
isShow: false,
|
|
1356
|
+
popInstance: null
|
|
1357
|
+
};
|
|
1358
|
+
},
|
|
1359
|
+
computed: {
|
|
1360
|
+
fontSizeCls: function fontSizeCls() {
|
|
1361
|
+
var cls = '';
|
|
1362
|
+
if (this.fontSize === 'medium') {
|
|
1363
|
+
cls = 'medium-font';
|
|
1364
|
+
} else if (this.fontSize === 'large') {
|
|
1365
|
+
cls = 'large-font';
|
|
1286
1366
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1367
|
+
return cls;
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
mounted: function mounted() {
|
|
1371
|
+
var placement = "bottom".concat(this.getPlacementFix());
|
|
1372
|
+
this.popInstance = new Popper(this.$refs.refDropTrigger, this.$refs.refDropContent, {
|
|
1373
|
+
placement: placement,
|
|
1374
|
+
positionFixed: this.positionFixed,
|
|
1375
|
+
modifiers: {
|
|
1376
|
+
offset: {
|
|
1377
|
+
offset: "0, ".concat(variable_1)
|
|
1378
|
+
},
|
|
1379
|
+
keepTogether: {}
|
|
1291
1380
|
}
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1381
|
+
});
|
|
1382
|
+
},
|
|
1383
|
+
beforeDestroy: function beforeDestroy() {
|
|
1384
|
+
if (this.popInstance) {
|
|
1385
|
+
this.popInstance.destroy();
|
|
1386
|
+
this.popInstance = null;
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
methods: {
|
|
1390
|
+
getPlacementFix: function getPlacementFix() {
|
|
1391
|
+
var placementFix = {
|
|
1392
|
+
'left': '-start',
|
|
1393
|
+
'right': '-end',
|
|
1394
|
+
'center': ''
|
|
1395
|
+
};
|
|
1396
|
+
var fixAppend = placementFix[this.align];
|
|
1397
|
+
if (fixAppend !== undefined) {
|
|
1398
|
+
return fixAppend;
|
|
1296
1399
|
}
|
|
1297
|
-
|
|
1298
|
-
return Popper;
|
|
1299
|
-
}();
|
|
1300
|
-
Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
|
|
1301
|
-
Popper.placements = placements;
|
|
1302
|
-
Popper.Defaults = Defaults;
|
|
1303
|
-
|
|
1304
|
-
var variable = {
|
|
1305
|
-
dropdownMarginBottom: '4px'
|
|
1306
|
-
};
|
|
1307
|
-
var variable_1 = variable.dropdownMarginBottom;
|
|
1308
|
-
|
|
1309
|
-
var script = {
|
|
1310
|
-
name: 'bk-dropdown-menu',
|
|
1311
|
-
directives: {
|
|
1312
|
-
clickoutside: bkClickoutside
|
|
1400
|
+
return '';
|
|
1313
1401
|
},
|
|
1314
|
-
|
|
1315
|
-
trigger
|
|
1316
|
-
|
|
1317
|
-
default: 'mouseover',
|
|
1318
|
-
validator: function validator(event) {
|
|
1319
|
-
return ['click', 'mouseover'].includes(event);
|
|
1320
|
-
}
|
|
1321
|
-
},
|
|
1322
|
-
align: {
|
|
1323
|
-
type: String,
|
|
1324
|
-
default: 'left'
|
|
1325
|
-
},
|
|
1326
|
-
disabled: {
|
|
1327
|
-
type: Boolean,
|
|
1328
|
-
default: false
|
|
1329
|
-
},
|
|
1330
|
-
positionFixed: {
|
|
1331
|
-
type: Boolean,
|
|
1332
|
-
default: false
|
|
1333
|
-
},
|
|
1334
|
-
fontSize: {
|
|
1335
|
-
type: String,
|
|
1336
|
-
default: 'normal'
|
|
1337
|
-
},
|
|
1338
|
-
extCls: {
|
|
1339
|
-
type: String,
|
|
1340
|
-
default: ''
|
|
1341
|
-
},
|
|
1342
|
-
openDelay: {
|
|
1343
|
-
type: Number,
|
|
1344
|
-
default: 0
|
|
1345
|
-
},
|
|
1346
|
-
closeDelay: {
|
|
1347
|
-
type: Number,
|
|
1348
|
-
default: 100
|
|
1402
|
+
handleClick: function handleClick() {
|
|
1403
|
+
if (this.disabled || this.trigger !== 'click') {
|
|
1404
|
+
return;
|
|
1349
1405
|
}
|
|
1406
|
+
this.isShow ? this.hide() : this.show();
|
|
1350
1407
|
},
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
timer: 0,
|
|
1355
|
-
isShow: false,
|
|
1356
|
-
popInstance: null
|
|
1357
|
-
};
|
|
1358
|
-
},
|
|
1359
|
-
computed: {
|
|
1360
|
-
fontSizeCls: function fontSizeCls() {
|
|
1361
|
-
var cls = '';
|
|
1362
|
-
if (this.fontSize === 'medium') {
|
|
1363
|
-
cls = 'medium-font';
|
|
1364
|
-
} else if (this.fontSize === 'large') {
|
|
1365
|
-
cls = 'large-font';
|
|
1366
|
-
}
|
|
1367
|
-
return cls;
|
|
1408
|
+
handleMouseover: function handleMouseover() {
|
|
1409
|
+
if (this.trigger === 'mouseover' && !this.disabled) {
|
|
1410
|
+
this.show();
|
|
1368
1411
|
}
|
|
1369
1412
|
},
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
placement: placement,
|
|
1374
|
-
positionFixed: this.positionFixed,
|
|
1375
|
-
modifiers: {
|
|
1376
|
-
offset: {
|
|
1377
|
-
offset: "0, ".concat(variable_1)
|
|
1378
|
-
},
|
|
1379
|
-
keepTogether: {}
|
|
1380
|
-
}
|
|
1381
|
-
});
|
|
1382
|
-
},
|
|
1383
|
-
beforeDestroy: function beforeDestroy() {
|
|
1384
|
-
if (this.popInstance) {
|
|
1385
|
-
this.popInstance.destroy();
|
|
1386
|
-
this.popInstance = null;
|
|
1413
|
+
handleMouseout: function handleMouseout() {
|
|
1414
|
+
if (this.trigger === 'mouseover' && !this.disabled) {
|
|
1415
|
+
this.hide();
|
|
1387
1416
|
}
|
|
1388
1417
|
},
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
'left': '-start',
|
|
1393
|
-
'right': '-end',
|
|
1394
|
-
'center': ''
|
|
1395
|
-
};
|
|
1396
|
-
var fixAppend = placementFix[this.align];
|
|
1397
|
-
if (fixAppend !== undefined) {
|
|
1398
|
-
return fixAppend;
|
|
1399
|
-
}
|
|
1400
|
-
return '';
|
|
1401
|
-
},
|
|
1402
|
-
handleClick: function handleClick() {
|
|
1403
|
-
if (this.disabled || this.trigger !== 'click') {
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
this.isShow ? this.hide() : this.show();
|
|
1407
|
-
},
|
|
1408
|
-
handleMouseover: function handleMouseover() {
|
|
1409
|
-
if (this.trigger === 'mouseover' && !this.disabled) {
|
|
1410
|
-
this.show();
|
|
1411
|
-
}
|
|
1412
|
-
},
|
|
1413
|
-
handleMouseout: function handleMouseout() {
|
|
1414
|
-
if (this.trigger === 'mouseover' && !this.disabled) {
|
|
1415
|
-
this.hide();
|
|
1416
|
-
}
|
|
1417
|
-
},
|
|
1418
|
-
handleClickoutside: function handleClickoutside() {
|
|
1419
|
-
if (this.isShow) {
|
|
1420
|
-
this.hide();
|
|
1421
|
-
}
|
|
1422
|
-
},
|
|
1423
|
-
show: function show() {
|
|
1424
|
-
var _this = this;
|
|
1425
|
-
clearTimeout(this.openTimer);
|
|
1426
|
-
clearTimeout(this.closeTimer);
|
|
1427
|
-
this.openTimer = setTimeout(function () {
|
|
1428
|
-
_this.isShow = true;
|
|
1429
|
-
}, this.openDelay);
|
|
1430
|
-
this.popInstance.scheduleUpdate();
|
|
1431
|
-
},
|
|
1432
|
-
hide: function hide() {
|
|
1433
|
-
var _this2 = this;
|
|
1434
|
-
clearTimeout(this.closeTimer);
|
|
1435
|
-
clearTimeout(this.openTimer);
|
|
1436
|
-
this.closeTimer = setTimeout(function () {
|
|
1437
|
-
_this2.isShow = false;
|
|
1438
|
-
}, this.closeDelay);
|
|
1439
|
-
this.popInstance.scheduleUpdate();
|
|
1418
|
+
handleClickoutside: function handleClickoutside() {
|
|
1419
|
+
if (this.isShow) {
|
|
1420
|
+
this.hide();
|
|
1440
1421
|
}
|
|
1422
|
+
},
|
|
1423
|
+
show: function show() {
|
|
1424
|
+
var _this = this;
|
|
1425
|
+
clearTimeout(this.openTimer);
|
|
1426
|
+
clearTimeout(this.closeTimer);
|
|
1427
|
+
this.openTimer = setTimeout(function () {
|
|
1428
|
+
_this.isShow = true;
|
|
1429
|
+
}, this.openDelay);
|
|
1430
|
+
this.popInstance.scheduleUpdate();
|
|
1431
|
+
},
|
|
1432
|
+
hide: function hide() {
|
|
1433
|
+
var _this2 = this;
|
|
1434
|
+
clearTimeout(this.closeTimer);
|
|
1435
|
+
clearTimeout(this.openTimer);
|
|
1436
|
+
this.closeTimer = setTimeout(function () {
|
|
1437
|
+
_this2.isShow = false;
|
|
1438
|
+
}, this.closeDelay);
|
|
1439
|
+
this.popInstance.scheduleUpdate();
|
|
1441
1440
|
}
|
|
1442
|
-
}
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
1443
|
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1444
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
|
1445
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
1446
|
+
if (typeof shadowMode !== 'boolean') {
|
|
1447
|
+
createInjectorSSR = createInjector;
|
|
1448
|
+
createInjector = shadowMode;
|
|
1449
|
+
shadowMode = false;
|
|
1450
|
+
}
|
|
1451
|
+
var options = typeof script === 'function' ? script.options : script;
|
|
1452
|
+
if (template && template.render) {
|
|
1453
|
+
options.render = template.render;
|
|
1454
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
1455
|
+
options._compiled = true;
|
|
1456
|
+
if (isFunctionalTemplate) {
|
|
1457
|
+
options.functional = true;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
if (scopeId) {
|
|
1461
|
+
options._scopeId = scopeId;
|
|
1462
|
+
}
|
|
1463
|
+
var hook;
|
|
1464
|
+
if (moduleIdentifier) {
|
|
1465
|
+
hook = function hook(context) {
|
|
1466
|
+
context = context ||
|
|
1467
|
+
this.$vnode && this.$vnode.ssrContext ||
|
|
1468
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
1469
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
1470
|
+
context = __VUE_SSR_CONTEXT__;
|
|
1458
1471
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
if (moduleIdentifier) {
|
|
1465
|
-
hook = function hook(context) {
|
|
1466
|
-
context = context ||
|
|
1467
|
-
this.$vnode && this.$vnode.ssrContext ||
|
|
1468
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
1469
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
1470
|
-
context = __VUE_SSR_CONTEXT__;
|
|
1471
|
-
}
|
|
1472
|
-
if (style) {
|
|
1473
|
-
style.call(this, createInjectorSSR(context));
|
|
1474
|
-
}
|
|
1475
|
-
if (context && context._registeredComponents) {
|
|
1476
|
-
context._registeredComponents.add(moduleIdentifier);
|
|
1477
|
-
}
|
|
1478
|
-
};
|
|
1479
|
-
options._ssrRegister = hook;
|
|
1480
|
-
} else if (style) {
|
|
1481
|
-
hook = shadowMode ? function () {
|
|
1482
|
-
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
1483
|
-
} : function (context) {
|
|
1484
|
-
style.call(this, createInjector(context));
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
if (hook) {
|
|
1488
|
-
if (options.functional) {
|
|
1489
|
-
var originalRender = options.render;
|
|
1490
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
1491
|
-
hook.call(context);
|
|
1492
|
-
return originalRender(h, context);
|
|
1493
|
-
};
|
|
1494
|
-
} else {
|
|
1495
|
-
var existing = options.beforeCreate;
|
|
1496
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
1472
|
+
if (style) {
|
|
1473
|
+
style.call(this, createInjectorSSR(context));
|
|
1474
|
+
}
|
|
1475
|
+
if (context && context._registeredComponents) {
|
|
1476
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
1497
1477
|
}
|
|
1478
|
+
};
|
|
1479
|
+
options._ssrRegister = hook;
|
|
1480
|
+
} else if (style) {
|
|
1481
|
+
hook = shadowMode ? function () {
|
|
1482
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
1483
|
+
} : function (context) {
|
|
1484
|
+
style.call(this, createInjector(context));
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
if (hook) {
|
|
1488
|
+
if (options.functional) {
|
|
1489
|
+
var originalRender = options.render;
|
|
1490
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
1491
|
+
hook.call(context);
|
|
1492
|
+
return originalRender(h, context);
|
|
1493
|
+
};
|
|
1494
|
+
} else {
|
|
1495
|
+
var existing = options.beforeCreate;
|
|
1496
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
1498
1497
|
}
|
|
1499
|
-
return script;
|
|
1500
1498
|
}
|
|
1501
|
-
|
|
1499
|
+
return script;
|
|
1500
|
+
}
|
|
1501
|
+
var normalizeComponent_1 = normalizeComponent;
|
|
1502
1502
|
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1503
|
+
/* script */
|
|
1504
|
+
var __vue_script__ = script;
|
|
1505
|
+
/* template */
|
|
1506
1506
|
|
|
1507
|
-
|
|
1508
|
-
|
|
1507
|
+
var __vue_render__ = function __vue_render__() {
|
|
1508
|
+
var _vm = this;
|
|
1509
1509
|
|
|
1510
|
-
|
|
1510
|
+
var _h = _vm.$createElement;
|
|
1511
1511
|
|
|
1512
|
-
|
|
1512
|
+
var _c = _vm._self._c || _h;
|
|
1513
1513
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1514
|
+
return _c('div', {
|
|
1515
|
+
directives: [{
|
|
1516
|
+
name: "clickoutside",
|
|
1517
|
+
rawName: "v-clickoutside",
|
|
1518
|
+
value: _vm.handleClickoutside,
|
|
1519
|
+
expression: "handleClickoutside"
|
|
1520
|
+
}],
|
|
1521
|
+
staticClass: "bk-dropdown-menu",
|
|
1522
|
+
class: [_vm.disabled ? 'disabled' : '', _vm.positionFixed ? '' : 'bk-dropdown-full-width', _vm.fontSizeCls, _vm.extCls],
|
|
1523
|
+
attrs: {
|
|
1524
|
+
"tabindex": "0"
|
|
1525
|
+
},
|
|
1526
|
+
on: {
|
|
1527
|
+
"keydown": [function ($event) {
|
|
1528
|
+
if (!('button' in $event) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
|
|
1529
|
+
return null;
|
|
1530
|
+
}
|
|
1531
1531
|
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1532
|
+
$event.preventDefault();
|
|
1533
|
+
return _vm.handleMouseover($event);
|
|
1534
|
+
}, function ($event) {
|
|
1535
|
+
if (!('button' in $event) && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
|
|
1536
|
+
return null;
|
|
1537
|
+
}
|
|
1538
1538
|
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1539
|
+
$event.stopPropagation();
|
|
1540
|
+
$event.preventDefault();
|
|
1541
|
+
return _vm.handleMouseout($event);
|
|
1542
|
+
}],
|
|
1543
|
+
"click": _vm.handleClick,
|
|
1544
|
+
"mouseover": _vm.handleMouseover,
|
|
1545
|
+
"mouseout": _vm.handleMouseout
|
|
1546
|
+
}
|
|
1547
|
+
}, [_c('div', {
|
|
1548
|
+
ref: "refDropTrigger",
|
|
1549
|
+
staticClass: "bk-dropdown-trigger"
|
|
1550
|
+
}, [_vm._t("dropdown-trigger")], 2), _c('div', {
|
|
1551
|
+
ref: "refDropContent",
|
|
1552
|
+
class: ['bk-dropdown-content', {
|
|
1553
|
+
'is-show': _vm.isShow,
|
|
1554
|
+
'right-align': _vm.align === 'right',
|
|
1555
|
+
'center-align': _vm.align === 'center',
|
|
1556
|
+
'left-align': _vm.align === 'left'
|
|
1557
|
+
}]
|
|
1558
|
+
}, [_vm._t("dropdown-content")], 2)]);
|
|
1559
|
+
};
|
|
1560
1560
|
|
|
1561
|
-
|
|
1562
|
-
|
|
1561
|
+
var __vue_staticRenderFns__ = [];
|
|
1562
|
+
/* style */
|
|
1563
1563
|
|
|
1564
|
-
|
|
1565
|
-
|
|
1564
|
+
var __vue_inject_styles__ = undefined;
|
|
1565
|
+
/* scoped */
|
|
1566
1566
|
|
|
1567
|
-
|
|
1568
|
-
|
|
1567
|
+
var __vue_scope_id__ = undefined;
|
|
1568
|
+
/* module identifier */
|
|
1569
1569
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1570
|
+
var __vue_module_identifier__ = undefined;
|
|
1571
|
+
/* functional template */
|
|
1572
1572
|
|
|
1573
|
-
|
|
1574
|
-
|
|
1573
|
+
var __vue_is_functional_template__ = false;
|
|
1574
|
+
/* style inject */
|
|
1575
1575
|
|
|
1576
|
-
|
|
1576
|
+
/* style inject SSR */
|
|
1577
1577
|
|
|
1578
|
-
|
|
1578
|
+
/* style inject shadow dom */
|
|
1579
1579
|
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1580
|
+
var __vue_component__ = /*#__PURE__*/normalizeComponent_1({
|
|
1581
|
+
render: __vue_render__,
|
|
1582
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
1583
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
1584
1584
|
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1585
|
+
var _defined = function (it) {
|
|
1586
|
+
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
1587
|
+
return it;
|
|
1588
|
+
};
|
|
1589
1589
|
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1590
|
+
var _toObject = function (it) {
|
|
1591
|
+
return Object(_defined(it));
|
|
1592
|
+
};
|
|
1593
1593
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1594
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
1595
|
+
var _has = function (it, key) {
|
|
1596
|
+
return hasOwnProperty.call(it, key);
|
|
1597
|
+
};
|
|
1598
1598
|
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1599
|
+
var toString = {}.toString;
|
|
1600
|
+
var _cof = function (it) {
|
|
1601
|
+
return toString.call(it).slice(8, -1);
|
|
1602
|
+
};
|
|
1603
1603
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1604
|
+
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
1605
|
+
return _cof(it) == 'String' ? it.split('') : Object(it);
|
|
1606
|
+
};
|
|
1607
1607
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1608
|
+
var _toIobject = function (it) {
|
|
1609
|
+
return _iobject(_defined(it));
|
|
1610
|
+
};
|
|
1611
1611
|
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1612
|
+
var ceil = Math.ceil;
|
|
1613
|
+
var floor = Math.floor;
|
|
1614
|
+
var _toInteger = function (it) {
|
|
1615
|
+
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
|
1616
|
+
};
|
|
1617
1617
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1618
|
+
var min = Math.min;
|
|
1619
|
+
var _toLength = function (it) {
|
|
1620
|
+
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
|
|
1621
|
+
};
|
|
1622
1622
|
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1623
|
+
var max = Math.max;
|
|
1624
|
+
var min$1 = Math.min;
|
|
1625
|
+
var _toAbsoluteIndex = function (index, length) {
|
|
1626
|
+
index = _toInteger(index);
|
|
1627
|
+
return index < 0 ? max(index + length, 0) : min$1(index, length);
|
|
1628
|
+
};
|
|
1629
1629
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
};
|
|
1630
|
+
var _arrayIncludes = function (IS_INCLUDES) {
|
|
1631
|
+
return function ($this, el, fromIndex) {
|
|
1632
|
+
var O = _toIobject($this);
|
|
1633
|
+
var length = _toLength(O.length);
|
|
1634
|
+
var index = _toAbsoluteIndex(fromIndex, length);
|
|
1635
|
+
var value;
|
|
1636
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
1637
|
+
value = O[index++];
|
|
1638
|
+
if (value != value) return true;
|
|
1639
|
+
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
|
1640
|
+
if (O[index] === el) return IS_INCLUDES || index || 0;
|
|
1641
|
+
} return !IS_INCLUDES && -1;
|
|
1643
1642
|
};
|
|
1643
|
+
};
|
|
1644
1644
|
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1645
|
+
function createCommonjsModule(fn, module) {
|
|
1646
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
1647
|
+
}
|
|
1648
1648
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1649
|
+
var _core = createCommonjsModule(function (module) {
|
|
1650
|
+
var core = module.exports = { version: '2.6.12' };
|
|
1651
|
+
if (typeof __e == 'number') __e = core;
|
|
1652
|
+
});
|
|
1653
|
+
var _core_1 = _core.version;
|
|
1654
1654
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1655
|
+
var _global = createCommonjsModule(function (module) {
|
|
1656
|
+
var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
|
1657
|
+
? window : typeof self != 'undefined' && self.Math == Math ? self
|
|
1658
|
+
: Function('return this')();
|
|
1659
|
+
if (typeof __g == 'number') __g = global;
|
|
1660
|
+
});
|
|
1661
1661
|
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1662
|
+
var _shared = createCommonjsModule(function (module) {
|
|
1663
|
+
var SHARED = '__core-js_shared__';
|
|
1664
|
+
var store = _global[SHARED] || (_global[SHARED] = {});
|
|
1665
|
+
(module.exports = function (key, value) {
|
|
1666
|
+
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
1667
|
+
})('versions', []).push({
|
|
1668
|
+
version: _core.version,
|
|
1669
|
+
mode: 'pure' ,
|
|
1670
|
+
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
|
1671
|
+
});
|
|
1672
|
+
});
|
|
1673
1673
|
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1674
|
+
var id = 0;
|
|
1675
|
+
var px = Math.random();
|
|
1676
|
+
var _uid = function (key) {
|
|
1677
|
+
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
|
1678
|
+
};
|
|
1679
1679
|
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1680
|
+
var shared = _shared('keys');
|
|
1681
|
+
var _sharedKey = function (key) {
|
|
1682
|
+
return shared[key] || (shared[key] = _uid(key));
|
|
1683
|
+
};
|
|
1684
1684
|
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1685
|
+
var arrayIndexOf = _arrayIncludes(false);
|
|
1686
|
+
var IE_PROTO = _sharedKey('IE_PROTO');
|
|
1687
|
+
var _objectKeysInternal = function (object, names) {
|
|
1688
|
+
var O = _toIobject(object);
|
|
1689
|
+
var i = 0;
|
|
1690
|
+
var result = [];
|
|
1691
|
+
var key;
|
|
1692
|
+
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
|
|
1693
|
+
while (names.length > i) if (_has(O, key = names[i++])) {
|
|
1694
|
+
~arrayIndexOf(result, key) || result.push(key);
|
|
1695
|
+
}
|
|
1696
|
+
return result;
|
|
1697
|
+
};
|
|
1698
1698
|
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1699
|
+
var _enumBugKeys = (
|
|
1700
|
+
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
|
1701
|
+
).split(',');
|
|
1702
1702
|
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1703
|
+
var _objectKeys = Object.keys || function keys(O) {
|
|
1704
|
+
return _objectKeysInternal(O, _enumBugKeys);
|
|
1705
|
+
};
|
|
1706
1706
|
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1707
|
+
var _aFunction = function (it) {
|
|
1708
|
+
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
|
1709
|
+
return it;
|
|
1710
|
+
};
|
|
1711
1711
|
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
};
|
|
1725
|
-
}
|
|
1726
|
-
return function () {
|
|
1727
|
-
return fn.apply(that, arguments);
|
|
1712
|
+
var _ctx = function (fn, that, length) {
|
|
1713
|
+
_aFunction(fn);
|
|
1714
|
+
if (that === undefined) return fn;
|
|
1715
|
+
switch (length) {
|
|
1716
|
+
case 1: return function (a) {
|
|
1717
|
+
return fn.call(that, a);
|
|
1718
|
+
};
|
|
1719
|
+
case 2: return function (a, b) {
|
|
1720
|
+
return fn.call(that, a, b);
|
|
1721
|
+
};
|
|
1722
|
+
case 3: return function (a, b, c) {
|
|
1723
|
+
return fn.call(that, a, b, c);
|
|
1728
1724
|
};
|
|
1725
|
+
}
|
|
1726
|
+
return function () {
|
|
1727
|
+
return fn.apply(that, arguments);
|
|
1729
1728
|
};
|
|
1729
|
+
};
|
|
1730
1730
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1731
|
+
var _isObject = function (it) {
|
|
1732
|
+
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
1733
|
+
};
|
|
1734
1734
|
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1735
|
+
var _anObject = function (it) {
|
|
1736
|
+
if (!_isObject(it)) throw TypeError(it + ' is not an object!');
|
|
1737
|
+
return it;
|
|
1738
|
+
};
|
|
1739
1739
|
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1740
|
+
var _fails = function (exec) {
|
|
1741
|
+
try {
|
|
1742
|
+
return !!exec();
|
|
1743
|
+
} catch (e) {
|
|
1744
|
+
return true;
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1747
1747
|
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1748
|
+
var _descriptors = !_fails(function () {
|
|
1749
|
+
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
|
1750
|
+
});
|
|
1751
1751
|
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1752
|
+
var document$1 = _global.document;
|
|
1753
|
+
var is = _isObject(document$1) && _isObject(document$1.createElement);
|
|
1754
|
+
var _domCreate = function (it) {
|
|
1755
|
+
return is ? document$1.createElement(it) : {};
|
|
1756
|
+
};
|
|
1757
1757
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1758
|
+
var _ie8DomDefine = !_descriptors && !_fails(function () {
|
|
1759
|
+
return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
|
|
1760
|
+
});
|
|
1761
1761
|
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1762
|
+
var _toPrimitive = function (it, S) {
|
|
1763
|
+
if (!_isObject(it)) return it;
|
|
1764
|
+
var fn, val;
|
|
1765
|
+
if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
1766
|
+
if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
1767
|
+
if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
1768
|
+
throw TypeError("Can't convert object to primitive value");
|
|
1769
|
+
};
|
|
1770
1770
|
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1771
|
+
var dP = Object.defineProperty;
|
|
1772
|
+
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
|
1773
|
+
_anObject(O);
|
|
1774
|
+
P = _toPrimitive(P, true);
|
|
1775
|
+
_anObject(Attributes);
|
|
1776
|
+
if (_ie8DomDefine) try {
|
|
1777
|
+
return dP(O, P, Attributes);
|
|
1778
|
+
} catch (e) { }
|
|
1779
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
|
1780
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
1781
|
+
return O;
|
|
1782
|
+
};
|
|
1783
|
+
var _objectDp = {
|
|
1784
|
+
f: f
|
|
1785
|
+
};
|
|
1786
1786
|
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
};
|
|
1787
|
+
var _propertyDesc = function (bitmap, value) {
|
|
1788
|
+
return {
|
|
1789
|
+
enumerable: !(bitmap & 1),
|
|
1790
|
+
configurable: !(bitmap & 2),
|
|
1791
|
+
writable: !(bitmap & 4),
|
|
1792
|
+
value: value
|
|
1794
1793
|
};
|
|
1794
|
+
};
|
|
1795
1795
|
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1796
|
+
var _hide = _descriptors ? function (object, key, value) {
|
|
1797
|
+
return _objectDp.f(object, key, _propertyDesc(1, value));
|
|
1798
|
+
} : function (object, key, value) {
|
|
1799
|
+
object[key] = value;
|
|
1800
|
+
return object;
|
|
1801
|
+
};
|
|
1802
1802
|
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1803
|
+
var PROTOTYPE = 'prototype';
|
|
1804
|
+
var $export = function (type, name, source) {
|
|
1805
|
+
var IS_FORCED = type & $export.F;
|
|
1806
|
+
var IS_GLOBAL = type & $export.G;
|
|
1807
|
+
var IS_STATIC = type & $export.S;
|
|
1808
|
+
var IS_PROTO = type & $export.P;
|
|
1809
|
+
var IS_BIND = type & $export.B;
|
|
1810
|
+
var IS_WRAP = type & $export.W;
|
|
1811
|
+
var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
|
|
1812
|
+
var expProto = exports[PROTOTYPE];
|
|
1813
|
+
var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
|
|
1814
|
+
var key, own, out;
|
|
1815
|
+
if (IS_GLOBAL) source = name;
|
|
1816
|
+
for (key in source) {
|
|
1817
|
+
own = !IS_FORCED && target && target[key] !== undefined;
|
|
1818
|
+
if (own && _has(exports, key)) continue;
|
|
1819
|
+
out = own ? target[key] : source[key];
|
|
1820
|
+
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
|
|
1821
|
+
: IS_BIND && own ? _ctx(out, _global)
|
|
1822
|
+
: IS_WRAP && target[key] == out ? (function (C) {
|
|
1823
|
+
var F = function (a, b, c) {
|
|
1824
|
+
if (this instanceof C) {
|
|
1825
|
+
switch (arguments.length) {
|
|
1826
|
+
case 0: return new C();
|
|
1827
|
+
case 1: return new C(a);
|
|
1828
|
+
case 2: return new C(a, b);
|
|
1829
|
+
} return new C(a, b, c);
|
|
1830
|
+
} return C.apply(this, arguments);
|
|
1831
|
+
};
|
|
1832
|
+
F[PROTOTYPE] = C[PROTOTYPE];
|
|
1833
|
+
return F;
|
|
1834
|
+
})(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
|
|
1835
|
+
if (IS_PROTO) {
|
|
1836
|
+
(exports.virtual || (exports.virtual = {}))[key] = out;
|
|
1837
|
+
if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
$export.F = 1;
|
|
1842
|
+
$export.G = 2;
|
|
1843
|
+
$export.S = 4;
|
|
1844
|
+
$export.P = 8;
|
|
1845
|
+
$export.B = 16;
|
|
1846
|
+
$export.W = 32;
|
|
1847
|
+
$export.U = 64;
|
|
1848
|
+
$export.R = 128;
|
|
1849
|
+
var _export = $export;
|
|
1850
1850
|
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1851
|
+
var _objectSap = function (KEY, exec) {
|
|
1852
|
+
var fn = (_core.Object || {})[KEY] || Object[KEY];
|
|
1853
|
+
var exp = {};
|
|
1854
|
+
exp[KEY] = exec(fn);
|
|
1855
|
+
_export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
|
|
1856
|
+
};
|
|
1857
1857
|
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1858
|
+
_objectSap('keys', function () {
|
|
1859
|
+
return function keys(it) {
|
|
1860
|
+
return _objectKeys(_toObject(it));
|
|
1861
|
+
};
|
|
1862
|
+
});
|
|
1863
1863
|
|
|
1864
|
-
|
|
1864
|
+
var keys = _core.Object.keys;
|
|
1865
1865
|
|
|
1866
|
-
|
|
1866
|
+
var keys$1 = keys;
|
|
1867
1867
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
}
|
|
1868
|
+
function setInstaller (component, afterInstall) {
|
|
1869
|
+
component.install = function (Vue) {
|
|
1870
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1871
|
+
var props = component.props || {};
|
|
1872
|
+
keys$1(options).forEach(function (key) {
|
|
1873
|
+
if (props.hasOwnProperty(key)) {
|
|
1874
|
+
if (typeof props[key] === 'function' || props[key] instanceof Array) {
|
|
1875
|
+
props[key] = {
|
|
1876
|
+
type: props[key],
|
|
1877
|
+
default: options[key]
|
|
1878
|
+
};
|
|
1879
|
+
} else {
|
|
1880
|
+
props[key].default = options[key];
|
|
1882
1881
|
}
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
}
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
component.name = options.namespace ? component.name.replace('bk', options.namespace) : component.name;
|
|
1885
|
+
Vue.component(component.name, component);
|
|
1886
|
+
typeof afterInstall === 'function' && afterInstall(Vue, options);
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
1889
|
|
|
1890
|
-
|
|
1890
|
+
setInstaller(__vue_component__);
|
|
1891
1891
|
|
|
1892
|
-
|
|
1892
|
+
exports.default = __vue_component__;
|
|
1893
1893
|
|
|
1894
|
-
|
|
1894
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1895
1895
|
|
|
1896
1896
|
}));
|