bkui-vue 0.0.1-beta.392 → 0.0.1-beta.393
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 +35 -35
- package/dist/index.esm.js +856 -857
- package/dist/index.umd.js +9 -9
- package/lib/plugin-popover/index.js +154 -20
- package/lib/popover/index.js +154 -20
- package/package.json +1 -1
@@ -1,13 +1,13 @@
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
-
module.exports = factory(require("vue"), require("../
|
3
|
+
module.exports = factory(require("vue"), require("../shared"), require("vue-types"));
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
5
|
-
define(["vue", "../
|
5
|
+
define(["vue", "../shared", "vue-types"], factory);
|
6
6
|
else {
|
7
|
-
var a = typeof exports === 'object' ? factory(require("vue"), require("../
|
7
|
+
var a = typeof exports === 'object' ? factory(require("vue"), require("../shared"), require("vue-types")) : factory(root["vue"], root["../shared"], root["vue-types"]);
|
8
8
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
9
9
|
}
|
10
|
-
})(self, (__WEBPACK_EXTERNAL_MODULE__748__,
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__210__) => {
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
12
12
|
/******/ var __webpack_modules__ = ({
|
13
13
|
|
@@ -250,14 +250,6 @@ function v4(options, buf, offset) {
|
|
250
250
|
module.exports = v4;
|
251
251
|
|
252
252
|
|
253
|
-
/***/ }),
|
254
|
-
|
255
|
-
/***/ 4061:
|
256
|
-
/***/ ((module) => {
|
257
|
-
|
258
|
-
"use strict";
|
259
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__4061__;
|
260
|
-
|
261
253
|
/***/ }),
|
262
254
|
|
263
255
|
/***/ 4212:
|
@@ -369,10 +361,152 @@ function _defineProperty(obj, key, value) {
|
|
369
361
|
}
|
370
362
|
// EXTERNAL MODULE: external "vue"
|
371
363
|
var external_vue_ = __webpack_require__(748);
|
372
|
-
// EXTERNAL MODULE: external "../directives"
|
373
|
-
var external_directives_ = __webpack_require__(4061);
|
374
364
|
// EXTERNAL MODULE: external "../shared"
|
375
365
|
var external_shared_ = __webpack_require__(4212);
|
366
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
|
367
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
368
|
+
|
369
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
370
|
+
|
371
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
372
|
+
|
373
|
+
/*
|
374
|
+
* Tencent is pleased to support the open source community by making
|
375
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
376
|
+
*
|
377
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
378
|
+
*
|
379
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
380
|
+
*
|
381
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
382
|
+
*
|
383
|
+
* ---------------------------------------------------
|
384
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
385
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
386
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
387
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
388
|
+
*
|
389
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
390
|
+
* the Software.
|
391
|
+
*
|
392
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
393
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
394
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
395
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
396
|
+
* IN THE SOFTWARE.
|
397
|
+
*/
|
398
|
+
var isElement = function isElement(e) {
|
399
|
+
if (typeof Element === 'undefined') return false;
|
400
|
+
return e instanceof Element;
|
401
|
+
};
|
402
|
+
|
403
|
+
var nodeList = new Map();
|
404
|
+
var startClick;
|
405
|
+
document.addEventListener('mousedown', function (e) {
|
406
|
+
return startClick = e;
|
407
|
+
});
|
408
|
+
document.addEventListener('mouseup', function (e) {
|
409
|
+
var _iterator = _createForOfIteratorHelper(nodeList.values()),
|
410
|
+
_step;
|
411
|
+
|
412
|
+
try {
|
413
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
414
|
+
var handlers = _step.value;
|
415
|
+
|
416
|
+
var _iterator2 = _createForOfIteratorHelper(handlers),
|
417
|
+
_step2;
|
418
|
+
|
419
|
+
try {
|
420
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
421
|
+
var documentHandler = _step2.value.documentHandler;
|
422
|
+
documentHandler(e, startClick);
|
423
|
+
}
|
424
|
+
} catch (err) {
|
425
|
+
_iterator2.e(err);
|
426
|
+
} finally {
|
427
|
+
_iterator2.f();
|
428
|
+
}
|
429
|
+
}
|
430
|
+
} catch (err) {
|
431
|
+
_iterator.e(err);
|
432
|
+
} finally {
|
433
|
+
_iterator.f();
|
434
|
+
}
|
435
|
+
});
|
436
|
+
|
437
|
+
function createDocumentHandler(el, binding) {
|
438
|
+
var excludes = [];
|
439
|
+
|
440
|
+
if (Array.isArray(binding.arg)) {
|
441
|
+
excludes = binding.arg;
|
442
|
+
} else if (isElement(binding.arg)) {
|
443
|
+
excludes.push(binding.arg);
|
444
|
+
}
|
445
|
+
|
446
|
+
return function (mouseup, mousedown) {
|
447
|
+
var popperRef = binding.instance.popperRef;
|
448
|
+
var mouseUpTarget = mouseup.target;
|
449
|
+
var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
|
450
|
+
var isBound = !binding || !binding.instance;
|
451
|
+
var isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
452
|
+
var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
453
|
+
var isSelf = el === mouseUpTarget;
|
454
|
+
var isTargetExcluded = excludes.length && excludes.some(function (item) {
|
455
|
+
return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
|
456
|
+
}) || excludes.length && excludes.includes(mouseDownTarget);
|
457
|
+
var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
458
|
+
|
459
|
+
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
460
|
+
return;
|
461
|
+
}
|
462
|
+
|
463
|
+
binding.value(mouseup, mousedown);
|
464
|
+
};
|
465
|
+
}
|
466
|
+
|
467
|
+
var ClickOutside = {
|
468
|
+
beforeMount: function beforeMount(el, binding) {
|
469
|
+
if (!nodeList.has(el)) {
|
470
|
+
nodeList.set(el, []);
|
471
|
+
}
|
472
|
+
|
473
|
+
nodeList.get(el).push({
|
474
|
+
documentHandler: createDocumentHandler(el, binding),
|
475
|
+
bindingFn: binding.value
|
476
|
+
});
|
477
|
+
},
|
478
|
+
updated: function updated(el, binding) {
|
479
|
+
if (!nodeList.has(el)) {
|
480
|
+
nodeList.set(el, []);
|
481
|
+
}
|
482
|
+
|
483
|
+
var handlers = nodeList.get(el);
|
484
|
+
var oldHandlerIndex = handlers.findIndex(function (item) {
|
485
|
+
return item.bindingFn === binding.oldValue;
|
486
|
+
});
|
487
|
+
var newHandler = {
|
488
|
+
documentHandler: createDocumentHandler(el, binding),
|
489
|
+
bindingFn: binding.value
|
490
|
+
};
|
491
|
+
|
492
|
+
if (oldHandlerIndex >= 0) {
|
493
|
+
// replace the old handler to the new handler
|
494
|
+
handlers.splice(oldHandlerIndex, 1, newHandler);
|
495
|
+
} else {
|
496
|
+
handlers.push(newHandler);
|
497
|
+
}
|
498
|
+
},
|
499
|
+
unmounted: function unmounted(el) {
|
500
|
+
// remove all listeners when a component unmounted
|
501
|
+
nodeList["delete"](el);
|
502
|
+
}
|
503
|
+
};
|
504
|
+
|
505
|
+
ClickOutside.install = function (app) {
|
506
|
+
app.directive('bkTooltips', ClickOutside);
|
507
|
+
};
|
508
|
+
|
509
|
+
/* harmony default export */ const clickoutside = (ClickOutside);
|
376
510
|
;// CONCATENATED MODULE: ../../packages/popover/src/arrow.tsx
|
377
511
|
|
378
512
|
|
@@ -991,7 +1125,7 @@ function _iterableToArrayLimit(arr, i) {
|
|
991
1125
|
return _arr;
|
992
1126
|
}
|
993
1127
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
994
|
-
function
|
1128
|
+
function arrayLikeToArray_arrayLikeToArray(arr, len) {
|
995
1129
|
if (len == null || len > arr.length) len = arr.length;
|
996
1130
|
|
997
1131
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
@@ -1002,13 +1136,13 @@ function _arrayLikeToArray(arr, len) {
|
|
1002
1136
|
}
|
1003
1137
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
1004
1138
|
|
1005
|
-
function
|
1139
|
+
function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
|
1006
1140
|
if (!o) return;
|
1007
|
-
if (typeof o === "string") return
|
1141
|
+
if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
1008
1142
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1009
1143
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1010
1144
|
if (n === "Map" || n === "Set") return Array.from(o);
|
1011
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
1145
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
1012
1146
|
}
|
1013
1147
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
1014
1148
|
function _nonIterableRest() {
|
@@ -1020,7 +1154,7 @@ function _nonIterableRest() {
|
|
1020
1154
|
|
1021
1155
|
|
1022
1156
|
function _slicedToArray(arr, i) {
|
1023
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) ||
|
1157
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
1024
1158
|
}
|
1025
1159
|
;// CONCATENATED MODULE: ../../node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
|
1026
1160
|
function t(t){return t.split("-")[0]}function e(t){return t.split("-")[1]}function n(e){return["top","bottom"].includes(t(e))?"x":"y"}function r(t){return"y"===t?"height":"width"}function i(i,o,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,u=n(o),m=r(u),g=l[m]/2-s[m]/2,d="x"===u;let p;switch(t(o)){case"top":p={x:c,y:l.y-s.height};break;case"bottom":p={x:c,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:f};break;case"left":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y}}switch(e(o)){case"start":p[u]-=g*(a&&d?-1:1);break;case"end":p[u]+=g*(a&&d?-1:1)}return p}const floating_ui_core_browser_min_o=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,s=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=i(c,r,s),m=r,g={};for(let n=0;n<a.length;n++){const{name:d,fn:p}=a[n],{x:h,y:y,data:x,reset:w}=await p({x:f,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=h?h:f,u=null!=y?y:u,g={...g,[d]:{...g[d],...x}},w&&("object"==typeof w&&(w.placement&&(m=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):w.rects),({x:f,y:u}=i(c,m,s))),n=-1)}return{x:f,y:u,placement:m,strategy:o,middlewareData:g}};function a(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function l(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function s(t,e){var n;void 0===e&&(e={});const{x:r,y:i,platform:o,rects:s,elements:c,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:d=!1,padding:p=0}=e,h=a(p),y=c[d?"floating"===g?"reference":"floating":g],x=l(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(y)))||n?y:y.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(c.floating)),boundary:u,rootBoundary:m,strategy:f})),w=l(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===g?{...s.floating,x:r,y:i}:s.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(c.floating)),strategy:f}):s[g]);return{top:x.top-w.top+h.top,bottom:w.bottom-x.bottom+h.bottom,left:x.left-w.left+h.left,right:w.right-x.right+h.right}}const c=Math.min,f=Math.max;function u(t,e,n){return f(t,c(e,n))}const m=t=>({name:"arrow",options:t,async fn(i){const{element:o,padding:l=0}=null!=t?t:{},{x:s,y:c,placement:f,rects:m,platform:g}=i;if(null==o)return{};const d=a(l),p={x:s,y:c},h=n(f),y=e(f),x=r(h),w=await g.getDimensions(o),v="y"===h?"top":"left",b="y"===h?"bottom":"right",R=m.reference[x]+m.reference[h]-p[h]-m.floating[x],A=p[h]-m.reference[h],P=await(null==g.getOffsetParent?void 0:g.getOffsetParent(o));let T=P?"y"===h?P.clientHeight||0:P.clientWidth||0:0;0===T&&(T=m.floating[x]);const O=R/2-A/2,D=d[v],L=T-w[x]-d[b],k=T/2-w[x]/2+O,E=u(D,k,L),C=("start"===y?d[v]:d[b])>0&&k!==E&&m.reference[x]<=m.floating[x];return{[h]:p[h]-(C?k<D?D-k:L-k:0),data:{[h]:E,centerOffset:k-E}}}}),g={left:"right",right:"left",bottom:"top",top:"bottom"};function d(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function p(t,i,o){void 0===o&&(o=!1);const a=e(t),l=n(t),s=r(l);let c="x"===l?a===(o?"end":"start")?"right":"left":"start"===a?"bottom":"top";return i.reference[s]>i.floating[s]&&(c=d(c)),{main:c,cross:d(c)}}const h={start:"end",end:"start"};function y(t){return t.replace(/start|end/g,(t=>h[t]))}const x=["top","right","bottom","left"],w=x.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]);const v=function(n){return void 0===n&&(n={}),{name:"autoPlacement",options:n,async fn(r){var i,o,a,l,c;const{x:f,y:u,rects:m,middlewareData:g,placement:d,platform:h,elements:x}=r,{alignment:v=null,allowedPlacements:b=w,autoAlignment:R=!0,...A}=n,P=function(n,r,i){return(n?[...i.filter((t=>e(t)===n)),...i.filter((t=>e(t)!==n))]:i.filter((e=>t(e)===e))).filter((t=>!n||e(t)===n||!!r&&y(t)!==t))}(v,R,b),T=await s(r,A),O=null!=(i=null==(o=g.autoPlacement)?void 0:o.index)?i:0,D=P[O];if(null==D)return{};const{main:L,cross:k}=p(D,m,await(null==h.isRTL?void 0:h.isRTL(x.floating)));if(d!==D)return{x:f,y:u,reset:{placement:P[0]}};const E=[T[t(D)],T[L],T[k]],C=[...null!=(a=null==(l=g.autoPlacement)?void 0:l.overflows)?a:[],{placement:D,overflows:E}],H=P[O+1];if(H)return{data:{index:O+1,overflows:C},reset:{placement:H}};const B=C.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),V=null==(c=B.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:c.placement,F=null!=V?V:B[0].placement;return F!==d?{data:{index:O+1,overflows:C},reset:{placement:F}}:{}}}};const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(n){var r;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:f}=n,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",flipAlignment:x=!0,...w}=e,v=t(i),b=g||(v===l||!x?[d(l)]:function(t){const e=d(t);return[y(t),e,y(e)]}(l)),R=[l,...b],A=await s(n,w),P=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&P.push(A[v]),m){const{main:t,cross:e}=p(i,a,await(null==c.isRTL?void 0:c.isRTL(f.floating)));P.push(A[t],A[e])}if(T=[...T,{placement:i,overflows:P}],!P.every((t=>t<=0))){var O,D;const t=(null!=(O=null==(D=o.flip)?void 0:D.index)?O:0)+1,e=R[t];if(e)return{data:{index:t,overflows:T},reset:{placement:e}};let n="bottom";switch(h){case"bestFit":{var L;const t=null==(L=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:L[0].placement;t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}};function R(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A(t){return x.some((e=>t[e]>=0))}const P=function(t){let{strategy:e="referenceHidden",...n}=void 0===t?{}:t;return{name:"hide",async fn(t){const{rects:r}=t;switch(e){case"referenceHidden":{const e=R(await s(t,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:A(e)}}}case"escaped":{const e=R(await s(t,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:A(e)}}}default:return{}}}}};const T=function(r){return void 0===r&&(r=0),{name:"offset",options:r,async fn(i){const{x:o,y:a}=i,l=await async function(r,i){const{placement:o,platform:a,elements:l}=r,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=t(o),f=e(o),u="x"===n(o),m=["left","top"].includes(c)?-1:1,g=s&&u?-1:1,d="function"==typeof i?i(r):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&"number"==typeof y&&(h="end"===f?-1*y:y),u?{x:h*g,y:p*m}:{x:p*m,y:h*g}}(i,r);return{x:o+l.x,y:a+l.y,data:l}}}};function O(t){return"x"===t?"y":"x"}const D=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(r){const{x:i,y:o,placement:a}=r,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=e,g={x:i,y:o},d=await s(r,m),p=n(t(a)),h=O(p);let y=g[p],x=g[h];if(l){const t="y"===p?"bottom":"right";y=u(y+d["y"===p?"top":"left"],y,y-d[t])}if(c){const t="y"===h?"bottom":"right";x=u(x+d["y"===h?"top":"left"],x,x-d[t])}const w=f.fn({...r,[p]:y,[h]:x});return{...w,data:{x:w.x-i,y:w.y-o}}}}},L=function(e){return void 0===e&&(e={}),{options:e,fn(r){const{x:i,y:o,placement:a,rects:l,middlewareData:s}=r,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=e,m={x:i,y:o},g=n(a),d=O(g);let p=m[g],h=m[d];const y="function"==typeof c?c({...l,placement:a}):c,x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t="y"===g?"height":"width",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n)}if(u){var w,v,b,R;const e="y"===g?"width":"height",n=["top","left"].includes(t(a)),r=l.reference[d]-l.floating[e]+(n&&null!=(w=null==(v=s.offset)?void 0:v[d])?w:0)+(n?0:x.crossAxis),i=l.reference[d]+l.reference[e]+(n?0:null!=(b=null==(R=s.offset)?void 0:R[d])?b:0)-(n?x.crossAxis:0);h<r?h=r:h>i&&(h=i)}return{[g]:p,[d]:h}}}},k=function(n){return void 0===n&&(n={}),{name:"size",options:n,async fn(r){const{placement:i,rects:o,platform:a,elements:l}=r,{apply:c,...u}=n,m=await s(r,u),g=t(i),d=e(i);let p,h;"top"===g||"bottom"===g?(p=g,h=d===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(h=g,p="end"===d?"top":"bottom");const y=f(m.left,0),x=f(m.right,0),w=f(m.top,0),v=f(m.bottom,0),b={availableHeight:o.floating.height-(["left","right"].includes(i)?2*(0!==w||0!==v?w+v:f(m.top,m.bottom)):m[p]),availableWidth:o.floating.width-(["top","bottom"].includes(i)?2*(0!==y||0!==x?y+x:f(m.left,m.right)):m[h])},R=await a.getDimensions(l.floating);null==c||c({...r,...b});const A=await a.getDimensions(l.floating);return R.width!==A.width||R.height!==A.height?{reset:{rects:!0}}:{}}}},E=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(r){var i;const{placement:o,elements:s,rects:u,platform:m,strategy:g}=r,{padding:d=2,x:p,y:h}=e,y=l(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({rect:u.reference,offsetParent:await(null==m.getOffsetParent?void 0:m.getOffsetParent(s.floating)),strategy:g}):u.reference),x=null!=(i=await(null==m.getClientRects?void 0:m.getClientRects(s.reference)))?i:[],w=a(d);const v=await m.getElementRects({reference:{getBoundingClientRect:function(){var e;if(2===x.length&&x[0].left>x[1].right&&null!=p&&null!=h)return null!=(e=x.find((t=>p>t.left-w.left&&p<t.right+w.right&&h>t.top-w.top&&h<t.bottom+w.bottom)))?e:y;if(x.length>=2){if("x"===n(o)){const e=x[0],n=x[x.length-1],r="top"===t(o),i=e.top,a=n.bottom,l=r?e.left:n.left,s=r?e.right:n.right;return{top:i,bottom:a,left:l,right:s,width:s-l,height:a-i,x:l,y:i}}const e="left"===t(o),r=f(...x.map((t=>t.right))),i=c(...x.map((t=>t.left))),a=x.filter((t=>e?t.left===i:t.right===r)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:i,right:r,width:r-i,height:s-l,x:i,y:l}}return y}},floating:s.floating,strategy:g});return u.reference.x!==v.reference.x||u.reference.y!==v.reference.y||u.reference.width!==v.reference.width||u.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};
|
@@ -2027,7 +2161,7 @@ var parentNodeReferId = null;
|
|
2027
2161
|
Root: root
|
2028
2162
|
},
|
2029
2163
|
directives: {
|
2030
|
-
clickoutside:
|
2164
|
+
clickoutside: clickoutside
|
2031
2165
|
},
|
2032
2166
|
props: PopoverProps,
|
2033
2167
|
emits: EMIT_EVENT_TYPES,
|
package/lib/popover/index.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
-
module.exports = factory(require("../shared"), require("vue"), require("
|
3
|
+
module.exports = factory(require("../shared"), require("vue"), require("vue-types"));
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
5
|
-
define(["../shared", "vue", "
|
5
|
+
define(["../shared", "vue", "vue-types"], factory);
|
6
6
|
else {
|
7
|
-
var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("
|
7
|
+
var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("vue-types")) : factory(root["../shared"], root["vue"], root["vue-types"]);
|
8
8
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
9
9
|
}
|
10
|
-
})(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__,
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__210__) => {
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
12
12
|
/******/ var __webpack_modules__ = ({
|
13
13
|
|
@@ -250,14 +250,6 @@ function v4(options, buf, offset) {
|
|
250
250
|
module.exports = v4;
|
251
251
|
|
252
252
|
|
253
|
-
/***/ }),
|
254
|
-
|
255
|
-
/***/ 4061:
|
256
|
-
/***/ ((module) => {
|
257
|
-
|
258
|
-
"use strict";
|
259
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__4061__;
|
260
|
-
|
261
253
|
/***/ }),
|
262
254
|
|
263
255
|
/***/ 4212:
|
@@ -358,8 +350,150 @@ __webpack_require__.d(__webpack_exports__, {
|
|
358
350
|
var external_shared_ = __webpack_require__(4212);
|
359
351
|
// EXTERNAL MODULE: external "vue"
|
360
352
|
var external_vue_ = __webpack_require__(748);
|
361
|
-
|
362
|
-
var
|
353
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
|
354
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
355
|
+
|
356
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
357
|
+
|
358
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
359
|
+
|
360
|
+
/*
|
361
|
+
* Tencent is pleased to support the open source community by making
|
362
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
363
|
+
*
|
364
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
365
|
+
*
|
366
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
367
|
+
*
|
368
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
369
|
+
*
|
370
|
+
* ---------------------------------------------------
|
371
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
372
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
373
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
374
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
375
|
+
*
|
376
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
377
|
+
* the Software.
|
378
|
+
*
|
379
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
380
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
381
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
382
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
383
|
+
* IN THE SOFTWARE.
|
384
|
+
*/
|
385
|
+
var isElement = function isElement(e) {
|
386
|
+
if (typeof Element === 'undefined') return false;
|
387
|
+
return e instanceof Element;
|
388
|
+
};
|
389
|
+
|
390
|
+
var nodeList = new Map();
|
391
|
+
var startClick;
|
392
|
+
document.addEventListener('mousedown', function (e) {
|
393
|
+
return startClick = e;
|
394
|
+
});
|
395
|
+
document.addEventListener('mouseup', function (e) {
|
396
|
+
var _iterator = _createForOfIteratorHelper(nodeList.values()),
|
397
|
+
_step;
|
398
|
+
|
399
|
+
try {
|
400
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
401
|
+
var handlers = _step.value;
|
402
|
+
|
403
|
+
var _iterator2 = _createForOfIteratorHelper(handlers),
|
404
|
+
_step2;
|
405
|
+
|
406
|
+
try {
|
407
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
408
|
+
var documentHandler = _step2.value.documentHandler;
|
409
|
+
documentHandler(e, startClick);
|
410
|
+
}
|
411
|
+
} catch (err) {
|
412
|
+
_iterator2.e(err);
|
413
|
+
} finally {
|
414
|
+
_iterator2.f();
|
415
|
+
}
|
416
|
+
}
|
417
|
+
} catch (err) {
|
418
|
+
_iterator.e(err);
|
419
|
+
} finally {
|
420
|
+
_iterator.f();
|
421
|
+
}
|
422
|
+
});
|
423
|
+
|
424
|
+
function createDocumentHandler(el, binding) {
|
425
|
+
var excludes = [];
|
426
|
+
|
427
|
+
if (Array.isArray(binding.arg)) {
|
428
|
+
excludes = binding.arg;
|
429
|
+
} else if (isElement(binding.arg)) {
|
430
|
+
excludes.push(binding.arg);
|
431
|
+
}
|
432
|
+
|
433
|
+
return function (mouseup, mousedown) {
|
434
|
+
var popperRef = binding.instance.popperRef;
|
435
|
+
var mouseUpTarget = mouseup.target;
|
436
|
+
var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
|
437
|
+
var isBound = !binding || !binding.instance;
|
438
|
+
var isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
439
|
+
var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
440
|
+
var isSelf = el === mouseUpTarget;
|
441
|
+
var isTargetExcluded = excludes.length && excludes.some(function (item) {
|
442
|
+
return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
|
443
|
+
}) || excludes.length && excludes.includes(mouseDownTarget);
|
444
|
+
var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
445
|
+
|
446
|
+
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
447
|
+
return;
|
448
|
+
}
|
449
|
+
|
450
|
+
binding.value(mouseup, mousedown);
|
451
|
+
};
|
452
|
+
}
|
453
|
+
|
454
|
+
var ClickOutside = {
|
455
|
+
beforeMount: function beforeMount(el, binding) {
|
456
|
+
if (!nodeList.has(el)) {
|
457
|
+
nodeList.set(el, []);
|
458
|
+
}
|
459
|
+
|
460
|
+
nodeList.get(el).push({
|
461
|
+
documentHandler: createDocumentHandler(el, binding),
|
462
|
+
bindingFn: binding.value
|
463
|
+
});
|
464
|
+
},
|
465
|
+
updated: function updated(el, binding) {
|
466
|
+
if (!nodeList.has(el)) {
|
467
|
+
nodeList.set(el, []);
|
468
|
+
}
|
469
|
+
|
470
|
+
var handlers = nodeList.get(el);
|
471
|
+
var oldHandlerIndex = handlers.findIndex(function (item) {
|
472
|
+
return item.bindingFn === binding.oldValue;
|
473
|
+
});
|
474
|
+
var newHandler = {
|
475
|
+
documentHandler: createDocumentHandler(el, binding),
|
476
|
+
bindingFn: binding.value
|
477
|
+
};
|
478
|
+
|
479
|
+
if (oldHandlerIndex >= 0) {
|
480
|
+
// replace the old handler to the new handler
|
481
|
+
handlers.splice(oldHandlerIndex, 1, newHandler);
|
482
|
+
} else {
|
483
|
+
handlers.push(newHandler);
|
484
|
+
}
|
485
|
+
},
|
486
|
+
unmounted: function unmounted(el) {
|
487
|
+
// remove all listeners when a component unmounted
|
488
|
+
nodeList["delete"](el);
|
489
|
+
}
|
490
|
+
};
|
491
|
+
|
492
|
+
ClickOutside.install = function (app) {
|
493
|
+
app.directive('bkTooltips', ClickOutside);
|
494
|
+
};
|
495
|
+
|
496
|
+
/* harmony default export */ const clickoutside = (ClickOutside);
|
363
497
|
;// CONCATENATED MODULE: ../../packages/popover/src/arrow.tsx
|
364
498
|
|
365
499
|
|
@@ -993,7 +1127,7 @@ function _iterableToArrayLimit(arr, i) {
|
|
993
1127
|
return _arr;
|
994
1128
|
}
|
995
1129
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
996
|
-
function
|
1130
|
+
function arrayLikeToArray_arrayLikeToArray(arr, len) {
|
997
1131
|
if (len == null || len > arr.length) len = arr.length;
|
998
1132
|
|
999
1133
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
@@ -1004,13 +1138,13 @@ function _arrayLikeToArray(arr, len) {
|
|
1004
1138
|
}
|
1005
1139
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
1006
1140
|
|
1007
|
-
function
|
1141
|
+
function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
|
1008
1142
|
if (!o) return;
|
1009
|
-
if (typeof o === "string") return
|
1143
|
+
if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
1010
1144
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1011
1145
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1012
1146
|
if (n === "Map" || n === "Set") return Array.from(o);
|
1013
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
1147
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
1014
1148
|
}
|
1015
1149
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
1016
1150
|
function _nonIterableRest() {
|
@@ -1022,7 +1156,7 @@ function _nonIterableRest() {
|
|
1022
1156
|
|
1023
1157
|
|
1024
1158
|
function _slicedToArray(arr, i) {
|
1025
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) ||
|
1159
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
1026
1160
|
}
|
1027
1161
|
;// CONCATENATED MODULE: ../../node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs
|
1028
1162
|
function t(t){return t.split("-")[0]}function e(t){return t.split("-")[1]}function n(e){return["top","bottom"].includes(t(e))?"x":"y"}function r(t){return"y"===t?"height":"width"}function i(i,o,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,u=n(o),m=r(u),g=l[m]/2-s[m]/2,d="x"===u;let p;switch(t(o)){case"top":p={x:c,y:l.y-s.height};break;case"bottom":p={x:c,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:f};break;case"left":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y}}switch(e(o)){case"start":p[u]-=g*(a&&d?-1:1);break;case"end":p[u]+=g*(a&&d?-1:1)}return p}const floating_ui_core_browser_min_o=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,s=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=i(c,r,s),m=r,g={};for(let n=0;n<a.length;n++){const{name:d,fn:p}=a[n],{x:h,y:y,data:x,reset:w}=await p({x:f,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=h?h:f,u=null!=y?y:u,g={...g,[d]:{...g[d],...x}},w&&("object"==typeof w&&(w.placement&&(m=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):w.rects),({x:f,y:u}=i(c,m,s))),n=-1)}return{x:f,y:u,placement:m,strategy:o,middlewareData:g}};function a(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function l(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function s(t,e){var n;void 0===e&&(e={});const{x:r,y:i,platform:o,rects:s,elements:c,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:d=!1,padding:p=0}=e,h=a(p),y=c[d?"floating"===g?"reference":"floating":g],x=l(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(y)))||n?y:y.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(c.floating)),boundary:u,rootBoundary:m,strategy:f})),w=l(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===g?{...s.floating,x:r,y:i}:s.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(c.floating)),strategy:f}):s[g]);return{top:x.top-w.top+h.top,bottom:w.bottom-x.bottom+h.bottom,left:x.left-w.left+h.left,right:w.right-x.right+h.right}}const c=Math.min,f=Math.max;function u(t,e,n){return f(t,c(e,n))}const m=t=>({name:"arrow",options:t,async fn(i){const{element:o,padding:l=0}=null!=t?t:{},{x:s,y:c,placement:f,rects:m,platform:g}=i;if(null==o)return{};const d=a(l),p={x:s,y:c},h=n(f),y=e(f),x=r(h),w=await g.getDimensions(o),v="y"===h?"top":"left",b="y"===h?"bottom":"right",R=m.reference[x]+m.reference[h]-p[h]-m.floating[x],A=p[h]-m.reference[h],P=await(null==g.getOffsetParent?void 0:g.getOffsetParent(o));let T=P?"y"===h?P.clientHeight||0:P.clientWidth||0:0;0===T&&(T=m.floating[x]);const O=R/2-A/2,D=d[v],L=T-w[x]-d[b],k=T/2-w[x]/2+O,E=u(D,k,L),C=("start"===y?d[v]:d[b])>0&&k!==E&&m.reference[x]<=m.floating[x];return{[h]:p[h]-(C?k<D?D-k:L-k:0),data:{[h]:E,centerOffset:k-E}}}}),g={left:"right",right:"left",bottom:"top",top:"bottom"};function d(t){return t.replace(/left|right|bottom|top/g,(t=>g[t]))}function p(t,i,o){void 0===o&&(o=!1);const a=e(t),l=n(t),s=r(l);let c="x"===l?a===(o?"end":"start")?"right":"left":"start"===a?"bottom":"top";return i.reference[s]>i.floating[s]&&(c=d(c)),{main:c,cross:d(c)}}const h={start:"end",end:"start"};function y(t){return t.replace(/start|end/g,(t=>h[t]))}const x=["top","right","bottom","left"],w=x.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]);const v=function(n){return void 0===n&&(n={}),{name:"autoPlacement",options:n,async fn(r){var i,o,a,l,c;const{x:f,y:u,rects:m,middlewareData:g,placement:d,platform:h,elements:x}=r,{alignment:v=null,allowedPlacements:b=w,autoAlignment:R=!0,...A}=n,P=function(n,r,i){return(n?[...i.filter((t=>e(t)===n)),...i.filter((t=>e(t)!==n))]:i.filter((e=>t(e)===e))).filter((t=>!n||e(t)===n||!!r&&y(t)!==t))}(v,R,b),T=await s(r,A),O=null!=(i=null==(o=g.autoPlacement)?void 0:o.index)?i:0,D=P[O];if(null==D)return{};const{main:L,cross:k}=p(D,m,await(null==h.isRTL?void 0:h.isRTL(x.floating)));if(d!==D)return{x:f,y:u,reset:{placement:P[0]}};const E=[T[t(D)],T[L],T[k]],C=[...null!=(a=null==(l=g.autoPlacement)?void 0:l.overflows)?a:[],{placement:D,overflows:E}],H=P[O+1];if(H)return{data:{index:O+1,overflows:C},reset:{placement:H}};const B=C.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),V=null==(c=B.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:c.placement,F=null!=V?V:B[0].placement;return F!==d?{data:{index:O+1,overflows:C},reset:{placement:F}}:{}}}};const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(n){var r;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:f}=n,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",flipAlignment:x=!0,...w}=e,v=t(i),b=g||(v===l||!x?[d(l)]:function(t){const e=d(t);return[y(t),e,y(e)]}(l)),R=[l,...b],A=await s(n,w),P=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&P.push(A[v]),m){const{main:t,cross:e}=p(i,a,await(null==c.isRTL?void 0:c.isRTL(f.floating)));P.push(A[t],A[e])}if(T=[...T,{placement:i,overflows:P}],!P.every((t=>t<=0))){var O,D;const t=(null!=(O=null==(D=o.flip)?void 0:D.index)?O:0)+1,e=R[t];if(e)return{data:{index:t,overflows:T},reset:{placement:e}};let n="bottom";switch(h){case"bestFit":{var L;const t=null==(L=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:L[0].placement;t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}};function R(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A(t){return x.some((e=>t[e]>=0))}const P=function(t){let{strategy:e="referenceHidden",...n}=void 0===t?{}:t;return{name:"hide",async fn(t){const{rects:r}=t;switch(e){case"referenceHidden":{const e=R(await s(t,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:A(e)}}}case"escaped":{const e=R(await s(t,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:A(e)}}}default:return{}}}}};const T=function(r){return void 0===r&&(r=0),{name:"offset",options:r,async fn(i){const{x:o,y:a}=i,l=await async function(r,i){const{placement:o,platform:a,elements:l}=r,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=t(o),f=e(o),u="x"===n(o),m=["left","top"].includes(c)?-1:1,g=s&&u?-1:1,d="function"==typeof i?i(r):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&"number"==typeof y&&(h="end"===f?-1*y:y),u?{x:h*g,y:p*m}:{x:p*m,y:h*g}}(i,r);return{x:o+l.x,y:a+l.y,data:l}}}};function O(t){return"x"===t?"y":"x"}const D=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(r){const{x:i,y:o,placement:a}=r,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=e,g={x:i,y:o},d=await s(r,m),p=n(t(a)),h=O(p);let y=g[p],x=g[h];if(l){const t="y"===p?"bottom":"right";y=u(y+d["y"===p?"top":"left"],y,y-d[t])}if(c){const t="y"===h?"bottom":"right";x=u(x+d["y"===h?"top":"left"],x,x-d[t])}const w=f.fn({...r,[p]:y,[h]:x});return{...w,data:{x:w.x-i,y:w.y-o}}}}},L=function(e){return void 0===e&&(e={}),{options:e,fn(r){const{x:i,y:o,placement:a,rects:l,middlewareData:s}=r,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=e,m={x:i,y:o},g=n(a),d=O(g);let p=m[g],h=m[d];const y="function"==typeof c?c({...l,placement:a}):c,x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t="y"===g?"height":"width",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n)}if(u){var w,v,b,R;const e="y"===g?"width":"height",n=["top","left"].includes(t(a)),r=l.reference[d]-l.floating[e]+(n&&null!=(w=null==(v=s.offset)?void 0:v[d])?w:0)+(n?0:x.crossAxis),i=l.reference[d]+l.reference[e]+(n?0:null!=(b=null==(R=s.offset)?void 0:R[d])?b:0)-(n?x.crossAxis:0);h<r?h=r:h>i&&(h=i)}return{[g]:p,[d]:h}}}},k=function(n){return void 0===n&&(n={}),{name:"size",options:n,async fn(r){const{placement:i,rects:o,platform:a,elements:l}=r,{apply:c,...u}=n,m=await s(r,u),g=t(i),d=e(i);let p,h;"top"===g||"bottom"===g?(p=g,h=d===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(h=g,p="end"===d?"top":"bottom");const y=f(m.left,0),x=f(m.right,0),w=f(m.top,0),v=f(m.bottom,0),b={availableHeight:o.floating.height-(["left","right"].includes(i)?2*(0!==w||0!==v?w+v:f(m.top,m.bottom)):m[p]),availableWidth:o.floating.width-(["top","bottom"].includes(i)?2*(0!==y||0!==x?y+x:f(m.left,m.right)):m[h])},R=await a.getDimensions(l.floating);null==c||c({...r,...b});const A=await a.getDimensions(l.floating);return R.width!==A.width||R.height!==A.height?{reset:{rects:!0}}:{}}}},E=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(r){var i;const{placement:o,elements:s,rects:u,platform:m,strategy:g}=r,{padding:d=2,x:p,y:h}=e,y=l(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({rect:u.reference,offsetParent:await(null==m.getOffsetParent?void 0:m.getOffsetParent(s.floating)),strategy:g}):u.reference),x=null!=(i=await(null==m.getClientRects?void 0:m.getClientRects(s.reference)))?i:[],w=a(d);const v=await m.getElementRects({reference:{getBoundingClientRect:function(){var e;if(2===x.length&&x[0].left>x[1].right&&null!=p&&null!=h)return null!=(e=x.find((t=>p>t.left-w.left&&p<t.right+w.right&&h>t.top-w.top&&h<t.bottom+w.bottom)))?e:y;if(x.length>=2){if("x"===n(o)){const e=x[0],n=x[x.length-1],r="top"===t(o),i=e.top,a=n.bottom,l=r?e.left:n.left,s=r?e.right:n.right;return{top:i,bottom:a,left:l,right:s,width:s-l,height:a-i,x:l,y:i}}const e="left"===t(o),r=f(...x.map((t=>t.right))),i=c(...x.map((t=>t.left))),a=x.filter((t=>e?t.left===i:t.right===r)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:i,right:r,width:r-i,height:s-l,x:i,y:l}}return y}},floating:s.floating,strategy:g});return u.reference.x!==v.reference.x||u.reference.y!==v.reference.y||u.reference.width!==v.reference.width||u.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};
|
@@ -2029,7 +2163,7 @@ var parentNodeReferId = null;
|
|
2029
2163
|
Root: root
|
2030
2164
|
},
|
2031
2165
|
directives: {
|
2032
|
-
clickoutside:
|
2166
|
+
clickoutside: clickoutside
|
2033
2167
|
},
|
2034
2168
|
props: PopoverProps,
|
2035
2169
|
emits: EMIT_EVENT_TYPES,
|