bkui-vue 2.0.1-beta.110 → 2.0.1-beta.111
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/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/lib/index.js +1 -1
- package/lib/plugin-popover/index.js +21 -142
- package/lib/popover/index.js +21 -142
- package/package.json +1 -1
package/lib/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import "../styles/reset.css";
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__ from "../directives";
|
4
5
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
6
7
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__ from "lodash/isElement";
|
@@ -87,132 +88,10 @@ const external_vue_namespaceObject = x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_
|
|
87
88
|
var shared_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
88
89
|
var shared_y = x => () => x
|
89
90
|
const shared_namespaceObject = shared_x({ ["PlacementEnum"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PlacementEnum, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.RenderType, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["placementType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.placementType, ["renderDirectiveType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.renderDirectiveType, ["renderType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.renderType, ["triggerType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.triggerType });
|
90
|
-
;// CONCATENATED MODULE:
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
/*
|
95
|
-
* Tencent is pleased to support the open source community by making
|
96
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
97
|
-
*
|
98
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
99
|
-
*
|
100
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
101
|
-
*
|
102
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
103
|
-
*
|
104
|
-
* ---------------------------------------------------
|
105
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
106
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
107
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
108
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
109
|
-
*
|
110
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
111
|
-
* the Software.
|
112
|
-
*
|
113
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
114
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
115
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
116
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
117
|
-
* IN THE SOFTWARE.
|
118
|
-
*/
|
119
|
-
var isElement = function isElement(e) {
|
120
|
-
if (typeof Element === 'undefined') return false;
|
121
|
-
return e instanceof Element;
|
122
|
-
};
|
123
|
-
var nodeList = new Map();
|
124
|
-
var startClick;
|
125
|
-
document.addEventListener('mousedown', function (e) {
|
126
|
-
return startClick = e;
|
127
|
-
});
|
128
|
-
document.addEventListener('mouseup', function (e) {
|
129
|
-
var _iterator = _createForOfIteratorHelper(nodeList.values()),
|
130
|
-
_step;
|
131
|
-
try {
|
132
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
133
|
-
var handlers = _step.value;
|
134
|
-
var _iterator2 = _createForOfIteratorHelper(handlers),
|
135
|
-
_step2;
|
136
|
-
try {
|
137
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
138
|
-
var documentHandler = _step2.value.documentHandler;
|
139
|
-
documentHandler(e, startClick);
|
140
|
-
}
|
141
|
-
} catch (err) {
|
142
|
-
_iterator2.e(err);
|
143
|
-
} finally {
|
144
|
-
_iterator2.f();
|
145
|
-
}
|
146
|
-
}
|
147
|
-
} catch (err) {
|
148
|
-
_iterator.e(err);
|
149
|
-
} finally {
|
150
|
-
_iterator.f();
|
151
|
-
}
|
152
|
-
});
|
153
|
-
function createDocumentHandler(el, binding) {
|
154
|
-
var excludes = [];
|
155
|
-
if (Array.isArray(binding.arg)) {
|
156
|
-
excludes = binding.arg;
|
157
|
-
} else if (isElement(binding.arg)) {
|
158
|
-
excludes.push(binding.arg);
|
159
|
-
}
|
160
|
-
return function (mouseup, mousedown) {
|
161
|
-
var popperRef = binding.instance.popperRef;
|
162
|
-
var mouseUpTarget = mouseup.target;
|
163
|
-
var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
|
164
|
-
var isBound = !binding || !binding.instance;
|
165
|
-
var isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
166
|
-
var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
167
|
-
var isSelf = el === mouseUpTarget;
|
168
|
-
var isTargetExcluded = excludes.length && excludes.some(function (item) {
|
169
|
-
return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
|
170
|
-
}) || excludes.length && excludes.includes(mouseDownTarget);
|
171
|
-
var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
172
|
-
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
173
|
-
return;
|
174
|
-
}
|
175
|
-
binding.value(mouseup, mousedown);
|
176
|
-
};
|
177
|
-
}
|
178
|
-
var ClickOutside = {
|
179
|
-
beforeMount: function beforeMount(el, binding) {
|
180
|
-
if (!nodeList.has(el)) {
|
181
|
-
nodeList.set(el, []);
|
182
|
-
}
|
183
|
-
nodeList.get(el).push({
|
184
|
-
documentHandler: createDocumentHandler(el, binding),
|
185
|
-
bindingFn: binding.value
|
186
|
-
});
|
187
|
-
},
|
188
|
-
updated: function updated(el, binding) {
|
189
|
-
if (!nodeList.has(el)) {
|
190
|
-
nodeList.set(el, []);
|
191
|
-
}
|
192
|
-
var handlers = nodeList.get(el);
|
193
|
-
var oldHandlerIndex = handlers.findIndex(function (item) {
|
194
|
-
return item.bindingFn === binding.oldValue;
|
195
|
-
});
|
196
|
-
var newHandler = {
|
197
|
-
documentHandler: createDocumentHandler(el, binding),
|
198
|
-
bindingFn: binding.value
|
199
|
-
};
|
200
|
-
if (oldHandlerIndex >= 0) {
|
201
|
-
// replace the old handler to the new handler
|
202
|
-
handlers.splice(oldHandlerIndex, 1, newHandler);
|
203
|
-
} else {
|
204
|
-
handlers.push(newHandler);
|
205
|
-
}
|
206
|
-
},
|
207
|
-
unmounted: function unmounted(el) {
|
208
|
-
// remove all listeners when a component unmounted
|
209
|
-
nodeList["delete"](el);
|
210
|
-
}
|
211
|
-
};
|
212
|
-
ClickOutside.install = function (app) {
|
213
|
-
app.directive('bkTooltips', ClickOutside);
|
214
|
-
};
|
215
|
-
/* harmony default export */ const clickoutside = (ClickOutside);
|
91
|
+
;// CONCATENATED MODULE: external "../directives"
|
92
|
+
var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
93
|
+
var directives_y = x => () => x
|
94
|
+
const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.clickoutside });
|
216
95
|
;// CONCATENATED MODULE: external "../config-provider"
|
217
96
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
218
97
|
var config_provider_y = x => () => x
|
@@ -638,20 +517,20 @@ function _iterableToArrayLimit(arr, i) {
|
|
638
517
|
}
|
639
518
|
}
|
640
519
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
641
|
-
function
|
520
|
+
function _arrayLikeToArray(arr, len) {
|
642
521
|
if (len == null || len > arr.length) len = arr.length;
|
643
522
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
644
523
|
return arr2;
|
645
524
|
}
|
646
525
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
647
526
|
|
648
|
-
function
|
527
|
+
function _unsupportedIterableToArray(o, minLen) {
|
649
528
|
if (!o) return;
|
650
|
-
if (typeof o === "string") return
|
529
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
651
530
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
652
531
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
653
532
|
if (n === "Map" || n === "Set") return Array.from(o);
|
654
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
533
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
655
534
|
}
|
656
535
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
657
536
|
function _nonIterableRest() {
|
@@ -663,7 +542,7 @@ function _nonIterableRest() {
|
|
663
542
|
|
664
543
|
|
665
544
|
function _slicedToArray(arr, i) {
|
666
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) ||
|
545
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
667
546
|
}
|
668
547
|
;// CONCATENATED MODULE: ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
669
548
|
const sides = ['top', 'right', 'bottom', 'left'];
|
@@ -1812,7 +1691,7 @@ function getDocumentElement(node) {
|
|
1812
1691
|
function isNode(value) {
|
1813
1692
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
1814
1693
|
}
|
1815
|
-
function
|
1694
|
+
function isElement(value) {
|
1816
1695
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
1817
1696
|
}
|
1818
1697
|
function isHTMLElement(value) {
|
@@ -1855,7 +1734,7 @@ function getComputedStyle(element) {
|
|
1855
1734
|
return getWindow(element).getComputedStyle(element);
|
1856
1735
|
}
|
1857
1736
|
function getNodeScroll(element) {
|
1858
|
-
if (
|
1737
|
+
if (isElement(element)) {
|
1859
1738
|
return {
|
1860
1739
|
scrollLeft: element.scrollLeft,
|
1861
1740
|
scrollTop: element.scrollTop
|
@@ -1936,7 +1815,7 @@ function getCssDimensions(element) {
|
|
1936
1815
|
}
|
1937
1816
|
|
1938
1817
|
function unwrapElement(element) {
|
1939
|
-
return !
|
1818
|
+
return !isElement(element) ? element.contextElement : element;
|
1940
1819
|
}
|
1941
1820
|
|
1942
1821
|
function getScale(element) {
|
@@ -2000,7 +1879,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
2000
1879
|
let scale = createCoords(1);
|
2001
1880
|
if (includeScale) {
|
2002
1881
|
if (offsetParent) {
|
2003
|
-
if (
|
1882
|
+
if (isElement(offsetParent)) {
|
2004
1883
|
scale = getScale(offsetParent);
|
2005
1884
|
}
|
2006
1885
|
} else {
|
@@ -2014,7 +1893,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
2014
1893
|
let height = clientRect.height / scale.y;
|
2015
1894
|
if (domElement) {
|
2016
1895
|
const win = getWindow(domElement);
|
2017
|
-
const offsetWin = offsetParent &&
|
1896
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
2018
1897
|
let currentIFrame = win.frameElement;
|
2019
1898
|
while (currentIFrame && offsetParent && offsetWin !== win) {
|
2020
1899
|
const iframeScale = getScale(currentIFrame);
|
@@ -2154,7 +2033,7 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
2154
2033
|
rect = getViewportRect(element, strategy);
|
2155
2034
|
} else if (clippingAncestor === 'document') {
|
2156
2035
|
rect = getDocumentRect(getDocumentElement(element));
|
2157
|
-
} else if (
|
2036
|
+
} else if (isElement(clippingAncestor)) {
|
2158
2037
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
2159
2038
|
} else {
|
2160
2039
|
const visualOffsets = getVisualOffsets(element);
|
@@ -2168,7 +2047,7 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
2168
2047
|
}
|
2169
2048
|
function hasFixedPositionAncestor(element, stopNode) {
|
2170
2049
|
const parentNode = getParentNode(element);
|
2171
|
-
if (parentNode === stopNode || !
|
2050
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
2172
2051
|
return false;
|
2173
2052
|
}
|
2174
2053
|
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
@@ -2182,13 +2061,13 @@ function getClippingElementAncestors(element, cache) {
|
|
2182
2061
|
if (cachedResult) {
|
2183
2062
|
return cachedResult;
|
2184
2063
|
}
|
2185
|
-
let result = getOverflowAncestors(element).filter(el =>
|
2064
|
+
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
2186
2065
|
let currentContainingBlockComputedStyle = null;
|
2187
2066
|
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
2188
2067
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
2189
2068
|
|
2190
2069
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
2191
|
-
while (
|
2070
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
2192
2071
|
const computedStyle = getComputedStyle(currentNode);
|
2193
2072
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
2194
2073
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
@@ -2339,7 +2218,7 @@ const platform = {
|
|
2339
2218
|
getClientRects,
|
2340
2219
|
getDimensions,
|
2341
2220
|
getScale,
|
2342
|
-
isElement:
|
2221
|
+
isElement: isElement,
|
2343
2222
|
isRTL
|
2344
2223
|
};
|
2345
2224
|
|
@@ -3548,7 +3427,7 @@ function _isSlot(s) {
|
|
3548
3427
|
Root: root
|
3549
3428
|
},
|
3550
3429
|
directives: {
|
3551
|
-
clickoutside: clickoutside
|
3430
|
+
clickoutside: directives_namespaceObject.clickoutside
|
3552
3431
|
},
|
3553
3432
|
props: PopoverProps,
|
3554
3433
|
emits: EMIT_EVENT_TYPES,
|
package/lib/popover/index.js
CHANGED
@@ -2,6 +2,7 @@ import "../styles/reset.css";
|
|
2
2
|
import "./popover.less";
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__ from "../directives";
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
6
7
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
7
8
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__ from "lodash/isElement";
|
@@ -45,132 +46,10 @@ const shared_namespaceObject = x({ ["PlacementEnum"]: () => __WEBPACK_EXTERNAL_M
|
|
45
46
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
46
47
|
var external_vue_y = x => () => x
|
47
48
|
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
48
|
-
;// CONCATENATED MODULE:
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
/*
|
53
|
-
* Tencent is pleased to support the open source community by making
|
54
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
55
|
-
*
|
56
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
57
|
-
*
|
58
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
59
|
-
*
|
60
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
61
|
-
*
|
62
|
-
* ---------------------------------------------------
|
63
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
64
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
65
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
66
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
67
|
-
*
|
68
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
69
|
-
* the Software.
|
70
|
-
*
|
71
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
72
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
73
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
74
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
75
|
-
* IN THE SOFTWARE.
|
76
|
-
*/
|
77
|
-
var isElement = function isElement(e) {
|
78
|
-
if (typeof Element === 'undefined') return false;
|
79
|
-
return e instanceof Element;
|
80
|
-
};
|
81
|
-
var nodeList = new Map();
|
82
|
-
var startClick;
|
83
|
-
document.addEventListener('mousedown', function (e) {
|
84
|
-
return startClick = e;
|
85
|
-
});
|
86
|
-
document.addEventListener('mouseup', function (e) {
|
87
|
-
var _iterator = _createForOfIteratorHelper(nodeList.values()),
|
88
|
-
_step;
|
89
|
-
try {
|
90
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
91
|
-
var handlers = _step.value;
|
92
|
-
var _iterator2 = _createForOfIteratorHelper(handlers),
|
93
|
-
_step2;
|
94
|
-
try {
|
95
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
96
|
-
var documentHandler = _step2.value.documentHandler;
|
97
|
-
documentHandler(e, startClick);
|
98
|
-
}
|
99
|
-
} catch (err) {
|
100
|
-
_iterator2.e(err);
|
101
|
-
} finally {
|
102
|
-
_iterator2.f();
|
103
|
-
}
|
104
|
-
}
|
105
|
-
} catch (err) {
|
106
|
-
_iterator.e(err);
|
107
|
-
} finally {
|
108
|
-
_iterator.f();
|
109
|
-
}
|
110
|
-
});
|
111
|
-
function createDocumentHandler(el, binding) {
|
112
|
-
var excludes = [];
|
113
|
-
if (Array.isArray(binding.arg)) {
|
114
|
-
excludes = binding.arg;
|
115
|
-
} else if (isElement(binding.arg)) {
|
116
|
-
excludes.push(binding.arg);
|
117
|
-
}
|
118
|
-
return function (mouseup, mousedown) {
|
119
|
-
var popperRef = binding.instance.popperRef;
|
120
|
-
var mouseUpTarget = mouseup.target;
|
121
|
-
var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
|
122
|
-
var isBound = !binding || !binding.instance;
|
123
|
-
var isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
124
|
-
var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
125
|
-
var isSelf = el === mouseUpTarget;
|
126
|
-
var isTargetExcluded = excludes.length && excludes.some(function (item) {
|
127
|
-
return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
|
128
|
-
}) || excludes.length && excludes.includes(mouseDownTarget);
|
129
|
-
var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
130
|
-
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
131
|
-
return;
|
132
|
-
}
|
133
|
-
binding.value(mouseup, mousedown);
|
134
|
-
};
|
135
|
-
}
|
136
|
-
var ClickOutside = {
|
137
|
-
beforeMount: function beforeMount(el, binding) {
|
138
|
-
if (!nodeList.has(el)) {
|
139
|
-
nodeList.set(el, []);
|
140
|
-
}
|
141
|
-
nodeList.get(el).push({
|
142
|
-
documentHandler: createDocumentHandler(el, binding),
|
143
|
-
bindingFn: binding.value
|
144
|
-
});
|
145
|
-
},
|
146
|
-
updated: function updated(el, binding) {
|
147
|
-
if (!nodeList.has(el)) {
|
148
|
-
nodeList.set(el, []);
|
149
|
-
}
|
150
|
-
var handlers = nodeList.get(el);
|
151
|
-
var oldHandlerIndex = handlers.findIndex(function (item) {
|
152
|
-
return item.bindingFn === binding.oldValue;
|
153
|
-
});
|
154
|
-
var newHandler = {
|
155
|
-
documentHandler: createDocumentHandler(el, binding),
|
156
|
-
bindingFn: binding.value
|
157
|
-
};
|
158
|
-
if (oldHandlerIndex >= 0) {
|
159
|
-
// replace the old handler to the new handler
|
160
|
-
handlers.splice(oldHandlerIndex, 1, newHandler);
|
161
|
-
} else {
|
162
|
-
handlers.push(newHandler);
|
163
|
-
}
|
164
|
-
},
|
165
|
-
unmounted: function unmounted(el) {
|
166
|
-
// remove all listeners when a component unmounted
|
167
|
-
nodeList["delete"](el);
|
168
|
-
}
|
169
|
-
};
|
170
|
-
ClickOutside.install = function (app) {
|
171
|
-
app.directive('bkTooltips', ClickOutside);
|
172
|
-
};
|
173
|
-
/* harmony default export */ const clickoutside = (ClickOutside);
|
49
|
+
;// CONCATENATED MODULE: external "../directives"
|
50
|
+
var directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
51
|
+
var directives_y = x => () => x
|
52
|
+
const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__.clickoutside });
|
174
53
|
;// CONCATENATED MODULE: external "../config-provider"
|
175
54
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
176
55
|
var config_provider_y = x => () => x
|
@@ -641,20 +520,20 @@ function _iterableToArrayLimit(arr, i) {
|
|
641
520
|
}
|
642
521
|
}
|
643
522
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
644
|
-
function
|
523
|
+
function _arrayLikeToArray(arr, len) {
|
645
524
|
if (len == null || len > arr.length) len = arr.length;
|
646
525
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
647
526
|
return arr2;
|
648
527
|
}
|
649
528
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
650
529
|
|
651
|
-
function
|
530
|
+
function _unsupportedIterableToArray(o, minLen) {
|
652
531
|
if (!o) return;
|
653
|
-
if (typeof o === "string") return
|
532
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
654
533
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
655
534
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
656
535
|
if (n === "Map" || n === "Set") return Array.from(o);
|
657
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
536
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
658
537
|
}
|
659
538
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
660
539
|
function _nonIterableRest() {
|
@@ -666,7 +545,7 @@ function _nonIterableRest() {
|
|
666
545
|
|
667
546
|
|
668
547
|
function _slicedToArray(arr, i) {
|
669
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) ||
|
548
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
670
549
|
}
|
671
550
|
;// CONCATENATED MODULE: ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
672
551
|
const sides = ['top', 'right', 'bottom', 'left'];
|
@@ -1815,7 +1694,7 @@ function getDocumentElement(node) {
|
|
1815
1694
|
function isNode(value) {
|
1816
1695
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
1817
1696
|
}
|
1818
|
-
function
|
1697
|
+
function isElement(value) {
|
1819
1698
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
1820
1699
|
}
|
1821
1700
|
function isHTMLElement(value) {
|
@@ -1858,7 +1737,7 @@ function getComputedStyle(element) {
|
|
1858
1737
|
return getWindow(element).getComputedStyle(element);
|
1859
1738
|
}
|
1860
1739
|
function getNodeScroll(element) {
|
1861
|
-
if (
|
1740
|
+
if (isElement(element)) {
|
1862
1741
|
return {
|
1863
1742
|
scrollLeft: element.scrollLeft,
|
1864
1743
|
scrollTop: element.scrollTop
|
@@ -1939,7 +1818,7 @@ function getCssDimensions(element) {
|
|
1939
1818
|
}
|
1940
1819
|
|
1941
1820
|
function unwrapElement(element) {
|
1942
|
-
return !
|
1821
|
+
return !isElement(element) ? element.contextElement : element;
|
1943
1822
|
}
|
1944
1823
|
|
1945
1824
|
function getScale(element) {
|
@@ -2003,7 +1882,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
2003
1882
|
let scale = createCoords(1);
|
2004
1883
|
if (includeScale) {
|
2005
1884
|
if (offsetParent) {
|
2006
|
-
if (
|
1885
|
+
if (isElement(offsetParent)) {
|
2007
1886
|
scale = getScale(offsetParent);
|
2008
1887
|
}
|
2009
1888
|
} else {
|
@@ -2017,7 +1896,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
2017
1896
|
let height = clientRect.height / scale.y;
|
2018
1897
|
if (domElement) {
|
2019
1898
|
const win = getWindow(domElement);
|
2020
|
-
const offsetWin = offsetParent &&
|
1899
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
2021
1900
|
let currentIFrame = win.frameElement;
|
2022
1901
|
while (currentIFrame && offsetParent && offsetWin !== win) {
|
2023
1902
|
const iframeScale = getScale(currentIFrame);
|
@@ -2157,7 +2036,7 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
2157
2036
|
rect = getViewportRect(element, strategy);
|
2158
2037
|
} else if (clippingAncestor === 'document') {
|
2159
2038
|
rect = getDocumentRect(getDocumentElement(element));
|
2160
|
-
} else if (
|
2039
|
+
} else if (isElement(clippingAncestor)) {
|
2161
2040
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
2162
2041
|
} else {
|
2163
2042
|
const visualOffsets = getVisualOffsets(element);
|
@@ -2171,7 +2050,7 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
2171
2050
|
}
|
2172
2051
|
function hasFixedPositionAncestor(element, stopNode) {
|
2173
2052
|
const parentNode = getParentNode(element);
|
2174
|
-
if (parentNode === stopNode || !
|
2053
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
2175
2054
|
return false;
|
2176
2055
|
}
|
2177
2056
|
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
@@ -2185,13 +2064,13 @@ function getClippingElementAncestors(element, cache) {
|
|
2185
2064
|
if (cachedResult) {
|
2186
2065
|
return cachedResult;
|
2187
2066
|
}
|
2188
|
-
let result = getOverflowAncestors(element).filter(el =>
|
2067
|
+
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
2189
2068
|
let currentContainingBlockComputedStyle = null;
|
2190
2069
|
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
2191
2070
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
2192
2071
|
|
2193
2072
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
2194
|
-
while (
|
2073
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
2195
2074
|
const computedStyle = getComputedStyle(currentNode);
|
2196
2075
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
2197
2076
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
@@ -2342,7 +2221,7 @@ const platform = {
|
|
2342
2221
|
getClientRects,
|
2343
2222
|
getDimensions,
|
2344
2223
|
getScale,
|
2345
|
-
isElement:
|
2224
|
+
isElement: isElement,
|
2346
2225
|
isRTL
|
2347
2226
|
};
|
2348
2227
|
|
@@ -3551,7 +3430,7 @@ function _isSlot(s) {
|
|
3551
3430
|
Root: root
|
3552
3431
|
},
|
3553
3432
|
directives: {
|
3554
|
-
clickoutside: clickoutside
|
3433
|
+
clickoutside: directives_namespaceObject.clickoutside
|
3555
3434
|
},
|
3556
3435
|
props: PopoverProps,
|
3557
3436
|
emits: EMIT_EVENT_TYPES,
|