cleek 2.3.53 → 2.3.54
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/cleek.es.js +285 -69
- package/dist/cleek.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/cleek.es.js
CHANGED
|
@@ -1187,6 +1187,19 @@ function getThemeClasses(theme) {
|
|
|
1187
1187
|
} while (themeConfig);
|
|
1188
1188
|
return result.map((c) => `v-popper--theme-${c}`);
|
|
1189
1189
|
}
|
|
1190
|
+
function getAllParentThemes(theme) {
|
|
1191
|
+
const result = [theme];
|
|
1192
|
+
let themeConfig = config$2.themes[theme] || {};
|
|
1193
|
+
do {
|
|
1194
|
+
if (themeConfig.$extend) {
|
|
1195
|
+
result.push(themeConfig.$extend);
|
|
1196
|
+
themeConfig = config$2.themes[themeConfig.$extend] || {};
|
|
1197
|
+
} else {
|
|
1198
|
+
themeConfig = null;
|
|
1199
|
+
}
|
|
1200
|
+
} while (themeConfig);
|
|
1201
|
+
return result;
|
|
1202
|
+
}
|
|
1190
1203
|
let supportsPassive = false;
|
|
1191
1204
|
if (typeof window !== "undefined") {
|
|
1192
1205
|
supportsPassive = false;
|
|
@@ -1234,6 +1247,14 @@ function nextFrame() {
|
|
|
1234
1247
|
}
|
|
1235
1248
|
const shownPoppers = [];
|
|
1236
1249
|
let hidingPopper = null;
|
|
1250
|
+
const shownPoppersByTheme = {};
|
|
1251
|
+
function getShownPoppersByTheme(theme) {
|
|
1252
|
+
let list = shownPoppersByTheme[theme];
|
|
1253
|
+
if (!list) {
|
|
1254
|
+
list = shownPoppersByTheme[theme] = [];
|
|
1255
|
+
}
|
|
1256
|
+
return list;
|
|
1257
|
+
}
|
|
1237
1258
|
let Element$1 = function() {
|
|
1238
1259
|
};
|
|
1239
1260
|
if (typeof window !== "undefined") {
|
|
@@ -1244,8 +1265,19 @@ function defaultPropFactory(prop) {
|
|
|
1244
1265
|
return getDefaultConfig(props.theme, prop);
|
|
1245
1266
|
};
|
|
1246
1267
|
}
|
|
1268
|
+
const PROVIDE_KEY = "__floating-vue__popper";
|
|
1247
1269
|
var PrivatePopper = () => defineComponent({
|
|
1248
1270
|
name: "VPopper",
|
|
1271
|
+
provide() {
|
|
1272
|
+
return {
|
|
1273
|
+
[PROVIDE_KEY]: {
|
|
1274
|
+
parentPopper: this
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
},
|
|
1278
|
+
inject: {
|
|
1279
|
+
[PROVIDE_KEY]: { default: null }
|
|
1280
|
+
},
|
|
1249
1281
|
props: {
|
|
1250
1282
|
theme: {
|
|
1251
1283
|
type: String,
|
|
@@ -1337,7 +1369,7 @@ var PrivatePopper = () => defineComponent({
|
|
|
1337
1369
|
default: defaultPropFactory("strategy")
|
|
1338
1370
|
},
|
|
1339
1371
|
autoHide: {
|
|
1340
|
-
type: Boolean,
|
|
1372
|
+
type: [Boolean, Function],
|
|
1341
1373
|
default: defaultPropFactory("autoHide")
|
|
1342
1374
|
},
|
|
1343
1375
|
handleResize: {
|
|
@@ -1364,10 +1396,18 @@ var PrivatePopper = () => defineComponent({
|
|
|
1364
1396
|
type: Boolean,
|
|
1365
1397
|
default: defaultPropFactory("autoMinSize")
|
|
1366
1398
|
},
|
|
1399
|
+
autoSize: {
|
|
1400
|
+
type: [Boolean, String],
|
|
1401
|
+
default: defaultPropFactory("autoSize")
|
|
1402
|
+
},
|
|
1367
1403
|
autoMaxSize: {
|
|
1368
1404
|
type: Boolean,
|
|
1369
1405
|
default: defaultPropFactory("autoMaxSize")
|
|
1370
1406
|
},
|
|
1407
|
+
autoBoundaryMaxSize: {
|
|
1408
|
+
type: Boolean,
|
|
1409
|
+
default: defaultPropFactory("autoBoundaryMaxSize")
|
|
1410
|
+
},
|
|
1371
1411
|
preventOverflow: {
|
|
1372
1412
|
type: Boolean,
|
|
1373
1413
|
default: defaultPropFactory("preventOverflow")
|
|
@@ -1431,7 +1471,9 @@ var PrivatePopper = () => defineComponent({
|
|
|
1431
1471
|
centerOffset: 0
|
|
1432
1472
|
},
|
|
1433
1473
|
transformOrigin: null
|
|
1434
|
-
}
|
|
1474
|
+
},
|
|
1475
|
+
shownChildren: new Set(),
|
|
1476
|
+
lastAutoHide: true
|
|
1435
1477
|
};
|
|
1436
1478
|
},
|
|
1437
1479
|
computed: {
|
|
@@ -1447,7 +1489,7 @@ var PrivatePopper = () => defineComponent({
|
|
|
1447
1489
|
isShown: this.isShown,
|
|
1448
1490
|
shouldMountContent: this.shouldMountContent,
|
|
1449
1491
|
skipTransition: this.skipTransition,
|
|
1450
|
-
autoHide: this.autoHide,
|
|
1492
|
+
autoHide: typeof this.autoHide === "function" ? this.lastAutoHide : this.autoHide,
|
|
1451
1493
|
show: this.show,
|
|
1452
1494
|
hide: this.hide,
|
|
1453
1495
|
handleResize: this.handleResize,
|
|
@@ -1455,8 +1497,17 @@ var PrivatePopper = () => defineComponent({
|
|
|
1455
1497
|
classes: __spreadProps2(__spreadValues2({}, this.classes), {
|
|
1456
1498
|
popperClass: this.popperClass
|
|
1457
1499
|
}),
|
|
1458
|
-
result: this.positioningDisabled ? null : this.result
|
|
1500
|
+
result: this.positioningDisabled ? null : this.result,
|
|
1501
|
+
attrs: this.$attrs
|
|
1459
1502
|
};
|
|
1503
|
+
},
|
|
1504
|
+
parentPopper() {
|
|
1505
|
+
var _a;
|
|
1506
|
+
return (_a = this[PROVIDE_KEY]) == null ? void 0 : _a.parentPopper;
|
|
1507
|
+
},
|
|
1508
|
+
hasPopperShowTriggerHover() {
|
|
1509
|
+
var _a, _b;
|
|
1510
|
+
return ((_a = this.popperTriggers) == null ? void 0 : _a.includes("hover")) || ((_b = this.popperShowTriggers) == null ? void 0 : _b.includes("hover"));
|
|
1460
1511
|
}
|
|
1461
1512
|
},
|
|
1462
1513
|
watch: __spreadValues2(__spreadValues2({
|
|
@@ -1499,6 +1550,12 @@ var PrivatePopper = () => defineComponent({
|
|
|
1499
1550
|
created() {
|
|
1500
1551
|
this.$_isDisposed = true;
|
|
1501
1552
|
this.randomId = `popper_${[Math.random(), Date.now()].map((n) => n.toString(36).substring(2, 10)).join("_")}`;
|
|
1553
|
+
if (this.autoMinSize) {
|
|
1554
|
+
console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.');
|
|
1555
|
+
}
|
|
1556
|
+
if (this.autoMaxSize) {
|
|
1557
|
+
console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.");
|
|
1558
|
+
}
|
|
1502
1559
|
},
|
|
1503
1560
|
mounted() {
|
|
1504
1561
|
this.init();
|
|
@@ -1515,7 +1572,14 @@ var PrivatePopper = () => defineComponent({
|
|
|
1515
1572
|
},
|
|
1516
1573
|
methods: {
|
|
1517
1574
|
show({ event = null, skipDelay = false, force = false } = {}) {
|
|
1575
|
+
var _a, _b;
|
|
1576
|
+
if (((_a = this.parentPopper) == null ? void 0 : _a.lockedChild) && this.parentPopper.lockedChild !== this)
|
|
1577
|
+
return;
|
|
1578
|
+
this.$_pendingHide = false;
|
|
1518
1579
|
if (force || !this.disabled) {
|
|
1580
|
+
if (((_b = this.parentPopper) == null ? void 0 : _b.lockedChild) === this) {
|
|
1581
|
+
this.parentPopper.lockedChild = null;
|
|
1582
|
+
}
|
|
1519
1583
|
this.$_scheduleShow(event, skipDelay);
|
|
1520
1584
|
this.$emit("show");
|
|
1521
1585
|
this.$_showFrameLocked = true;
|
|
@@ -1526,6 +1590,30 @@ var PrivatePopper = () => defineComponent({
|
|
|
1526
1590
|
this.$emit("update:shown", true);
|
|
1527
1591
|
},
|
|
1528
1592
|
hide({ event = null, skipDelay = false } = {}) {
|
|
1593
|
+
var _a;
|
|
1594
|
+
if (this.$_hideInProgress)
|
|
1595
|
+
return;
|
|
1596
|
+
if (this.shownChildren.size > 0) {
|
|
1597
|
+
this.$_pendingHide = true;
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
if (this.hasPopperShowTriggerHover && this.$_isAimingPopper()) {
|
|
1601
|
+
if (this.parentPopper) {
|
|
1602
|
+
this.parentPopper.lockedChild = this;
|
|
1603
|
+
clearTimeout(this.parentPopper.lockedChildTimer);
|
|
1604
|
+
this.parentPopper.lockedChildTimer = setTimeout(() => {
|
|
1605
|
+
if (this.parentPopper.lockedChild === this) {
|
|
1606
|
+
this.parentPopper.lockedChild.hide({ skipDelay });
|
|
1607
|
+
this.parentPopper.lockedChild = null;
|
|
1608
|
+
}
|
|
1609
|
+
}, 1e3);
|
|
1610
|
+
}
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
if (((_a = this.parentPopper) == null ? void 0 : _a.lockedChild) === this) {
|
|
1614
|
+
this.parentPopper.lockedChild = null;
|
|
1615
|
+
}
|
|
1616
|
+
this.$_pendingHide = false;
|
|
1529
1617
|
this.$_scheduleHide(event, skipDelay);
|
|
1530
1618
|
this.$emit("hide");
|
|
1531
1619
|
this.$emit("update:shown", false);
|
|
@@ -1560,6 +1648,7 @@ var PrivatePopper = () => defineComponent({
|
|
|
1560
1648
|
this.$_detachPopperNode();
|
|
1561
1649
|
this.isMounted = false;
|
|
1562
1650
|
this.isShown = false;
|
|
1651
|
+
this.$_updateParentShownChildren(false);
|
|
1563
1652
|
this.$_swapTargetAttrs("data-original-title", "title");
|
|
1564
1653
|
this.$emit("dispose");
|
|
1565
1654
|
},
|
|
@@ -1629,12 +1718,13 @@ var PrivatePopper = () => defineComponent({
|
|
|
1629
1718
|
}
|
|
1630
1719
|
});
|
|
1631
1720
|
}
|
|
1632
|
-
if (this.autoMinSize) {
|
|
1721
|
+
if (this.autoMinSize || this.autoSize) {
|
|
1722
|
+
const autoSize = this.autoSize ? this.autoSize : this.autoMinSize ? "min" : null;
|
|
1633
1723
|
options2.middleware.push({
|
|
1634
|
-
name: "
|
|
1724
|
+
name: "autoSize",
|
|
1635
1725
|
fn: ({ rects, placement, middlewareData }) => {
|
|
1636
1726
|
var _a2;
|
|
1637
|
-
if ((_a2 = middlewareData.
|
|
1727
|
+
if ((_a2 = middlewareData.autoSize) == null ? void 0 : _a2.skip) {
|
|
1638
1728
|
return {};
|
|
1639
1729
|
}
|
|
1640
1730
|
let width;
|
|
@@ -1644,8 +1734,8 @@ var PrivatePopper = () => defineComponent({
|
|
|
1644
1734
|
} else {
|
|
1645
1735
|
height = rects.reference.height;
|
|
1646
1736
|
}
|
|
1647
|
-
this.$_innerNode.style
|
|
1648
|
-
this.$_innerNode.style
|
|
1737
|
+
this.$_innerNode.style[autoSize === "min" ? "minWidth" : autoSize === "max" ? "maxWidth" : "width"] = width != null ? `${width}px` : null;
|
|
1738
|
+
this.$_innerNode.style[autoSize === "min" ? "minHeight" : autoSize === "max" ? "maxHeight" : "height"] = height != null ? `${height}px` : null;
|
|
1649
1739
|
return {
|
|
1650
1740
|
data: {
|
|
1651
1741
|
skip: true
|
|
@@ -1657,7 +1747,7 @@ var PrivatePopper = () => defineComponent({
|
|
|
1657
1747
|
}
|
|
1658
1748
|
});
|
|
1659
1749
|
}
|
|
1660
|
-
if (this.autoMaxSize) {
|
|
1750
|
+
if (this.autoMaxSize || this.autoBoundaryMaxSize) {
|
|
1661
1751
|
this.$_innerNode.style.maxWidth = null;
|
|
1662
1752
|
this.$_innerNode.style.maxHeight = null;
|
|
1663
1753
|
options2.middleware.push(size({
|
|
@@ -1679,9 +1769,10 @@ var PrivatePopper = () => defineComponent({
|
|
|
1679
1769
|
});
|
|
1680
1770
|
},
|
|
1681
1771
|
$_scheduleShow(event = null, skipDelay = false) {
|
|
1772
|
+
this.$_updateParentShownChildren(true);
|
|
1682
1773
|
this.$_hideInProgress = false;
|
|
1683
1774
|
clearTimeout(this.$_scheduleTimer);
|
|
1684
|
-
if (hidingPopper && this.instantMove && hidingPopper.instantMove) {
|
|
1775
|
+
if (hidingPopper && this.instantMove && hidingPopper.instantMove && hidingPopper !== this.parentPopper) {
|
|
1685
1776
|
hidingPopper.$_applyHide(true);
|
|
1686
1777
|
this.$_applyShow(true);
|
|
1687
1778
|
return;
|
|
@@ -1693,6 +1784,11 @@ var PrivatePopper = () => defineComponent({
|
|
|
1693
1784
|
}
|
|
1694
1785
|
},
|
|
1695
1786
|
$_scheduleHide(event = null, skipDelay = false) {
|
|
1787
|
+
if (this.shownChildren.size > 0) {
|
|
1788
|
+
this.$_pendingHide = true;
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
this.$_updateParentShownChildren(false);
|
|
1696
1792
|
this.$_hideInProgress = true;
|
|
1697
1793
|
clearTimeout(this.$_scheduleTimer);
|
|
1698
1794
|
if (this.isShown) {
|
|
@@ -1719,6 +1815,14 @@ var PrivatePopper = () => defineComponent({
|
|
|
1719
1815
|
await nextFrame();
|
|
1720
1816
|
await this.$_computePosition();
|
|
1721
1817
|
await this.$_applyShowEffect();
|
|
1818
|
+
if (!this.positioningDisabled) {
|
|
1819
|
+
this.$_registerEventListeners([
|
|
1820
|
+
...getScrollParents(this.$_referenceNode),
|
|
1821
|
+
...getScrollParents(this.$_popperNode)
|
|
1822
|
+
], "scroll", () => {
|
|
1823
|
+
this.$_computePosition();
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1722
1826
|
},
|
|
1723
1827
|
async $_applyShowEffect() {
|
|
1724
1828
|
if (this.$_hideInProgress)
|
|
@@ -1748,6 +1852,11 @@ var PrivatePopper = () => defineComponent({
|
|
|
1748
1852
|
}
|
|
1749
1853
|
}
|
|
1750
1854
|
shownPoppers.push(this);
|
|
1855
|
+
document.body.classList.add("v-popper--some-open");
|
|
1856
|
+
for (const theme of getAllParentThemes(this.theme)) {
|
|
1857
|
+
getShownPoppersByTheme(theme).push(this);
|
|
1858
|
+
document.body.classList.add(`v-popper--some-open--${theme}`);
|
|
1859
|
+
}
|
|
1751
1860
|
this.$emit("apply-show");
|
|
1752
1861
|
this.classes.showFrom = true;
|
|
1753
1862
|
this.classes.showTo = false;
|
|
@@ -1756,14 +1865,30 @@ var PrivatePopper = () => defineComponent({
|
|
|
1756
1865
|
await nextFrame();
|
|
1757
1866
|
this.classes.showFrom = false;
|
|
1758
1867
|
this.classes.showTo = true;
|
|
1868
|
+
this.$_popperNode.focus();
|
|
1759
1869
|
},
|
|
1760
1870
|
async $_applyHide(skipTransition = false) {
|
|
1871
|
+
if (this.shownChildren.size > 0) {
|
|
1872
|
+
this.$_pendingHide = true;
|
|
1873
|
+
this.$_hideInProgress = false;
|
|
1874
|
+
return;
|
|
1875
|
+
}
|
|
1761
1876
|
clearTimeout(this.$_scheduleTimer);
|
|
1762
1877
|
if (!this.isShown) {
|
|
1763
1878
|
return;
|
|
1764
1879
|
}
|
|
1765
1880
|
this.skipTransition = skipTransition;
|
|
1766
1881
|
removeFromArray(shownPoppers, this);
|
|
1882
|
+
if (shownPoppers.length === 0) {
|
|
1883
|
+
document.body.classList.remove("v-popper--some-open");
|
|
1884
|
+
}
|
|
1885
|
+
for (const theme of getAllParentThemes(this.theme)) {
|
|
1886
|
+
const list = getShownPoppersByTheme(theme);
|
|
1887
|
+
removeFromArray(list, this);
|
|
1888
|
+
if (list.length === 0) {
|
|
1889
|
+
document.body.classList.remove(`v-popper--some-open--${theme}`);
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1767
1892
|
if (hidingPopper === this) {
|
|
1768
1893
|
hidingPopper = null;
|
|
1769
1894
|
}
|
|
@@ -1782,6 +1907,7 @@ var PrivatePopper = () => defineComponent({
|
|
|
1782
1907
|
}
|
|
1783
1908
|
}, disposeTime);
|
|
1784
1909
|
}
|
|
1910
|
+
this.$_removeEventListeners("scroll");
|
|
1785
1911
|
this.$emit("apply-hide");
|
|
1786
1912
|
this.classes.showFrom = false;
|
|
1787
1913
|
this.classes.showTo = false;
|
|
@@ -1814,24 +1940,6 @@ var PrivatePopper = () => defineComponent({
|
|
|
1814
1940
|
this.isMounted = true;
|
|
1815
1941
|
},
|
|
1816
1942
|
$_addEventListeners() {
|
|
1817
|
-
const addListeners2 = (targetNodes, eventType, handler) => {
|
|
1818
|
-
this.$_events.push({ targetNodes, eventType, handler });
|
|
1819
|
-
targetNodes.forEach((node) => node.addEventListener(eventType, handler, supportsPassive ? {
|
|
1820
|
-
passive: true
|
|
1821
|
-
} : void 0));
|
|
1822
|
-
};
|
|
1823
|
-
const addEvents = (targetNodes, eventMap, commonTriggers, customTrigger, handler) => {
|
|
1824
|
-
let triggers = commonTriggers;
|
|
1825
|
-
if (customTrigger != null) {
|
|
1826
|
-
triggers = typeof customTrigger === "function" ? customTrigger(triggers) : customTrigger;
|
|
1827
|
-
}
|
|
1828
|
-
triggers.forEach((trigger) => {
|
|
1829
|
-
const eventType = eventMap[trigger];
|
|
1830
|
-
if (eventType) {
|
|
1831
|
-
addListeners2(targetNodes, eventType, handler);
|
|
1832
|
-
}
|
|
1833
|
-
});
|
|
1834
|
-
};
|
|
1835
1943
|
const handleShow = (event) => {
|
|
1836
1944
|
if (this.isShown && !this.$_hideInProgress) {
|
|
1837
1945
|
return;
|
|
@@ -1839,30 +1947,46 @@ var PrivatePopper = () => defineComponent({
|
|
|
1839
1947
|
event.usedByTooltip = true;
|
|
1840
1948
|
!this.$_preventShow && this.show({ event });
|
|
1841
1949
|
};
|
|
1842
|
-
|
|
1843
|
-
|
|
1950
|
+
this.$_registerTriggerListeners(this.$_targetNodes, SHOW_EVENT_MAP, this.triggers, this.showTriggers, handleShow);
|
|
1951
|
+
this.$_registerTriggerListeners([this.$_popperNode], SHOW_EVENT_MAP, this.popperTriggers, this.popperShowTriggers, handleShow);
|
|
1844
1952
|
const handleHide = (event) => {
|
|
1845
1953
|
if (event.usedByTooltip) {
|
|
1846
1954
|
return;
|
|
1847
1955
|
}
|
|
1848
1956
|
this.hide({ event });
|
|
1849
1957
|
};
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1958
|
+
this.$_registerTriggerListeners(this.$_targetNodes, HIDE_EVENT_MAP, this.triggers, this.hideTriggers, handleHide);
|
|
1959
|
+
this.$_registerTriggerListeners([this.$_popperNode], HIDE_EVENT_MAP, this.popperTriggers, this.popperHideTriggers, handleHide);
|
|
1960
|
+
},
|
|
1961
|
+
$_registerEventListeners(targetNodes, eventType, handler) {
|
|
1962
|
+
this.$_events.push({ targetNodes, eventType, handler });
|
|
1963
|
+
targetNodes.forEach((node) => node.addEventListener(eventType, handler, supportsPassive ? {
|
|
1964
|
+
passive: true
|
|
1965
|
+
} : void 0));
|
|
1966
|
+
},
|
|
1967
|
+
$_registerTriggerListeners(targetNodes, eventMap, commonTriggers, customTrigger, handler) {
|
|
1968
|
+
let triggers = commonTriggers;
|
|
1969
|
+
if (customTrigger != null) {
|
|
1970
|
+
triggers = typeof customTrigger === "function" ? customTrigger(triggers) : customTrigger;
|
|
1859
1971
|
}
|
|
1972
|
+
triggers.forEach((trigger) => {
|
|
1973
|
+
const eventType = eventMap[trigger];
|
|
1974
|
+
if (eventType) {
|
|
1975
|
+
this.$_registerEventListeners(targetNodes, eventType, handler);
|
|
1976
|
+
}
|
|
1977
|
+
});
|
|
1860
1978
|
},
|
|
1861
|
-
$_removeEventListeners() {
|
|
1862
|
-
|
|
1863
|
-
|
|
1979
|
+
$_removeEventListeners(filterEventType) {
|
|
1980
|
+
const newList = [];
|
|
1981
|
+
this.$_events.forEach((listener3) => {
|
|
1982
|
+
const { targetNodes, eventType, handler } = listener3;
|
|
1983
|
+
if (!filterEventType || filterEventType === eventType) {
|
|
1984
|
+
targetNodes.forEach((node) => node.removeEventListener(eventType, handler));
|
|
1985
|
+
} else {
|
|
1986
|
+
newList.push(listener3);
|
|
1987
|
+
}
|
|
1864
1988
|
});
|
|
1865
|
-
this.$_events =
|
|
1989
|
+
this.$_events = newList;
|
|
1866
1990
|
},
|
|
1867
1991
|
$_refreshListeners() {
|
|
1868
1992
|
if (!this.$_isDisposed) {
|
|
@@ -1909,6 +2033,34 @@ var PrivatePopper = () => defineComponent({
|
|
|
1909
2033
|
}
|
|
1910
2034
|
}
|
|
1911
2035
|
}
|
|
2036
|
+
},
|
|
2037
|
+
$_updateParentShownChildren(value) {
|
|
2038
|
+
let parent = this.parentPopper;
|
|
2039
|
+
while (parent) {
|
|
2040
|
+
if (value) {
|
|
2041
|
+
parent.shownChildren.add(this.randomId);
|
|
2042
|
+
} else {
|
|
2043
|
+
parent.shownChildren.delete(this.randomId);
|
|
2044
|
+
if (parent.$_pendingHide) {
|
|
2045
|
+
parent.hide();
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
parent = parent.parentPopper;
|
|
2049
|
+
}
|
|
2050
|
+
},
|
|
2051
|
+
$_isAimingPopper() {
|
|
2052
|
+
const referenceBounds = this.$_referenceNode.getBoundingClientRect();
|
|
2053
|
+
if (mouseX >= referenceBounds.left && mouseX <= referenceBounds.right && mouseY >= referenceBounds.top && mouseY <= referenceBounds.bottom) {
|
|
2054
|
+
const popperBounds = this.$_popperNode.getBoundingClientRect();
|
|
2055
|
+
const vectorX = mouseX - mousePreviousX;
|
|
2056
|
+
const vectorY = mouseY - mousePreviousY;
|
|
2057
|
+
const distance = popperBounds.left + popperBounds.width / 2 - mousePreviousX + (popperBounds.top + popperBounds.height / 2) - mousePreviousY;
|
|
2058
|
+
const newVectorLength = distance + popperBounds.width + popperBounds.height;
|
|
2059
|
+
const edgeX = mousePreviousX + vectorX * newVectorLength;
|
|
2060
|
+
const edgeY = mousePreviousY + vectorY * newVectorLength;
|
|
2061
|
+
return lineIntersectsLine(mousePreviousX, mousePreviousY, edgeX, edgeY, popperBounds.left, popperBounds.top, popperBounds.left, popperBounds.bottom) || lineIntersectsLine(mousePreviousX, mousePreviousY, edgeX, edgeY, popperBounds.left, popperBounds.top, popperBounds.right, popperBounds.top) || lineIntersectsLine(mousePreviousX, mousePreviousY, edgeX, edgeY, popperBounds.right, popperBounds.top, popperBounds.right, popperBounds.bottom) || lineIntersectsLine(mousePreviousX, mousePreviousY, edgeX, edgeY, popperBounds.left, popperBounds.bottom, popperBounds.right, popperBounds.bottom);
|
|
2062
|
+
}
|
|
2063
|
+
return false;
|
|
1912
2064
|
}
|
|
1913
2065
|
},
|
|
1914
2066
|
render() {
|
|
@@ -1934,8 +2086,11 @@ if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
|
1934
2086
|
function handleGlobalMousedown(event) {
|
|
1935
2087
|
for (let i = 0; i < shownPoppers.length; i++) {
|
|
1936
2088
|
const popper2 = shownPoppers[i];
|
|
1937
|
-
|
|
1938
|
-
|
|
2089
|
+
try {
|
|
2090
|
+
const popperContent = popper2.popperNode();
|
|
2091
|
+
popper2.$_mouseDownContains = popperContent.contains(event.target);
|
|
2092
|
+
} catch (e) {
|
|
2093
|
+
}
|
|
1939
2094
|
}
|
|
1940
2095
|
}
|
|
1941
2096
|
function handleGlobalClick(event) {
|
|
@@ -1945,23 +2100,81 @@ function handleGlobalTouchend(event) {
|
|
|
1945
2100
|
handleGlobalClose(event, true);
|
|
1946
2101
|
}
|
|
1947
2102
|
function handleGlobalClose(event, touch = false) {
|
|
1948
|
-
|
|
2103
|
+
const preventClose = {};
|
|
2104
|
+
for (let i = shownPoppers.length - 1; i >= 0; i--) {
|
|
1949
2105
|
const popper2 = shownPoppers[i];
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
popper2.$
|
|
1955
|
-
|
|
1956
|
-
|
|
2106
|
+
try {
|
|
2107
|
+
const contains2 = popper2.$_containsGlobalTarget = isContainingEventTarget(popper2, event);
|
|
2108
|
+
popper2.$_pendingHide = false;
|
|
2109
|
+
requestAnimationFrame(() => {
|
|
2110
|
+
popper2.$_pendingHide = false;
|
|
2111
|
+
if (preventClose[popper2.randomId])
|
|
2112
|
+
return;
|
|
2113
|
+
if (shouldAutoHide(popper2, contains2, event)) {
|
|
2114
|
+
popper2.$_handleGlobalClose(event, touch);
|
|
2115
|
+
if (!event.closeAllPopover && event.closePopover && contains2) {
|
|
2116
|
+
let parent2 = popper2.parentPopper;
|
|
2117
|
+
while (parent2) {
|
|
2118
|
+
preventClose[parent2.randomId] = true;
|
|
2119
|
+
parent2 = parent2.parentPopper;
|
|
2120
|
+
}
|
|
2121
|
+
return;
|
|
2122
|
+
}
|
|
2123
|
+
let parent = popper2.parentPopper;
|
|
2124
|
+
while (parent) {
|
|
2125
|
+
if (shouldAutoHide(parent, parent.$_containsGlobalTarget, event)) {
|
|
2126
|
+
parent.$_handleGlobalClose(event, touch);
|
|
2127
|
+
} else {
|
|
2128
|
+
break;
|
|
2129
|
+
}
|
|
2130
|
+
parent = parent.parentPopper;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
});
|
|
2134
|
+
} catch (e) {
|
|
2135
|
+
}
|
|
1957
2136
|
}
|
|
1958
2137
|
}
|
|
2138
|
+
function isContainingEventTarget(popper2, event) {
|
|
2139
|
+
const popperContent = popper2.popperNode();
|
|
2140
|
+
return popper2.$_mouseDownContains || popperContent.contains(event.target);
|
|
2141
|
+
}
|
|
2142
|
+
function shouldAutoHide(popper2, contains2, event) {
|
|
2143
|
+
return event.closeAllPopover || event.closePopover && contains2 || getAutoHideResult(popper2, event) && !contains2;
|
|
2144
|
+
}
|
|
2145
|
+
function getAutoHideResult(popper2, event) {
|
|
2146
|
+
if (typeof popper2.autoHide === "function") {
|
|
2147
|
+
const result = popper2.autoHide(event);
|
|
2148
|
+
popper2.lastAutoHide = result;
|
|
2149
|
+
return result;
|
|
2150
|
+
}
|
|
2151
|
+
return popper2.autoHide;
|
|
2152
|
+
}
|
|
1959
2153
|
function computePositionAllShownPoppers(event) {
|
|
1960
2154
|
for (let i = 0; i < shownPoppers.length; i++) {
|
|
1961
2155
|
const popper2 = shownPoppers[i];
|
|
1962
2156
|
popper2.$_computePosition(event);
|
|
1963
2157
|
}
|
|
1964
2158
|
}
|
|
2159
|
+
let mousePreviousX = 0;
|
|
2160
|
+
let mousePreviousY = 0;
|
|
2161
|
+
let mouseX = 0;
|
|
2162
|
+
let mouseY = 0;
|
|
2163
|
+
if (typeof window !== "undefined") {
|
|
2164
|
+
window.addEventListener("mousemove", (event) => {
|
|
2165
|
+
mousePreviousX = mouseX;
|
|
2166
|
+
mousePreviousY = mouseY;
|
|
2167
|
+
mouseX = event.clientX;
|
|
2168
|
+
mouseY = event.clientY;
|
|
2169
|
+
}, supportsPassive ? {
|
|
2170
|
+
passive: true
|
|
2171
|
+
} : void 0);
|
|
2172
|
+
}
|
|
2173
|
+
function lineIntersectsLine(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
2174
|
+
const uA = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));
|
|
2175
|
+
const uB = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));
|
|
2176
|
+
return uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1;
|
|
2177
|
+
}
|
|
1965
2178
|
function getInternetExplorerVersion() {
|
|
1966
2179
|
var ua = window.navigator.userAgent;
|
|
1967
2180
|
var msie = ua.indexOf("MSIE ");
|
|
@@ -2074,13 +2287,13 @@ const render$3 = /* @__PURE__ */ _withId((_ctx, _cache, $props, $setup, $data, $
|
|
|
2074
2287
|
script.render = render$3;
|
|
2075
2288
|
script.__scopeId = "data-v-b329ee4c";
|
|
2076
2289
|
script.__file = "src/components/ResizeObserver.vue";
|
|
2077
|
-
var PrivateThemeClass = {
|
|
2290
|
+
var PrivateThemeClass = (prop = "theme") => ({
|
|
2078
2291
|
computed: {
|
|
2079
2292
|
themeClass() {
|
|
2080
|
-
return getThemeClasses(this
|
|
2293
|
+
return getThemeClasses(this[prop]);
|
|
2081
2294
|
}
|
|
2082
2295
|
}
|
|
2083
|
-
};
|
|
2296
|
+
});
|
|
2084
2297
|
var _export_sfc$1 = (sfc, props) => {
|
|
2085
2298
|
const target = sfc.__vccOpts || sfc;
|
|
2086
2299
|
for (const [key, val] of props) {
|
|
@@ -2094,7 +2307,7 @@ const _sfc_main$5$1 = defineComponent({
|
|
|
2094
2307
|
ResizeObserver: script
|
|
2095
2308
|
},
|
|
2096
2309
|
mixins: [
|
|
2097
|
-
PrivateThemeClass
|
|
2310
|
+
PrivateThemeClass()
|
|
2098
2311
|
],
|
|
2099
2312
|
props: {
|
|
2100
2313
|
popperId: String,
|
|
@@ -2217,7 +2430,7 @@ const _sfc_main$4$1 = defineComponent({
|
|
|
2217
2430
|
},
|
|
2218
2431
|
mixins: [
|
|
2219
2432
|
PrivatePopperMethods,
|
|
2220
|
-
PrivateThemeClass
|
|
2433
|
+
PrivateThemeClass("finalTheme")
|
|
2221
2434
|
],
|
|
2222
2435
|
inheritAttrs: false,
|
|
2223
2436
|
props: {
|
|
@@ -2264,19 +2477,22 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2264
2477
|
handleResize,
|
|
2265
2478
|
onResize,
|
|
2266
2479
|
classes,
|
|
2267
|
-
result
|
|
2480
|
+
result,
|
|
2481
|
+
attrs
|
|
2268
2482
|
}) => [
|
|
2269
|
-
createElementVNode("div", {
|
|
2483
|
+
createElementVNode("div", mergeProps({
|
|
2270
2484
|
ref: "reference",
|
|
2271
|
-
class:
|
|
2485
|
+
class: "v-popper"
|
|
2486
|
+
}, attrs, {
|
|
2487
|
+
class: [
|
|
2272
2488
|
_ctx.$attrs.class,
|
|
2273
2489
|
_ctx.themeClass,
|
|
2274
2490
|
{
|
|
2275
2491
|
"v-popper--shown": isShown
|
|
2276
2492
|
}
|
|
2277
|
-
]
|
|
2278
|
-
style:
|
|
2279
|
-
}, [
|
|
2493
|
+
],
|
|
2494
|
+
style: _ctx.$attrs.style
|
|
2495
|
+
}), [
|
|
2280
2496
|
renderSlot(_ctx.$slots, "default", {
|
|
2281
2497
|
shown: isShown,
|
|
2282
2498
|
show,
|
|
@@ -2304,7 +2520,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2304
2520
|
]),
|
|
2305
2521
|
_: 2
|
|
2306
2522
|
}, 1032, ["popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
|
|
2307
|
-
],
|
|
2523
|
+
], 16)
|
|
2308
2524
|
]),
|
|
2309
2525
|
_: 3
|
|
2310
2526
|
}, 16, ["theme", "target-nodes", "reference-node", "popper-node"]);
|
|
@@ -2516,7 +2732,7 @@ function ensureDirectiveApp() {
|
|
|
2516
2732
|
render() {
|
|
2517
2733
|
return this.directives.map((directive) => {
|
|
2518
2734
|
return h(PrivateTooltipDirective, __spreadProps2(__spreadValues2({}, directive.options), {
|
|
2519
|
-
shown: directive.shown
|
|
2735
|
+
shown: directive.shown || directive.options.shown,
|
|
2520
2736
|
key: directive.id
|
|
2521
2737
|
}));
|
|
2522
2738
|
});
|
|
@@ -2567,7 +2783,7 @@ function destroyTooltip(el) {
|
|
|
2567
2783
|
el.classList.remove(TARGET_CLASS);
|
|
2568
2784
|
}
|
|
2569
2785
|
}
|
|
2570
|
-
function bind(el, { value,
|
|
2786
|
+
function bind(el, { value, modifiers }) {
|
|
2571
2787
|
const options2 = getOptions(el, value, modifiers);
|
|
2572
2788
|
if (!options2.content || getDefaultConfig(options2.theme || "tooltip", "disabled")) {
|
|
2573
2789
|
destroyTooltip(el);
|
|
@@ -2669,7 +2885,7 @@ function install$1(app, options2 = {}) {
|
|
|
2669
2885
|
app.component("VMenu", _sfc_main$2$1);
|
|
2670
2886
|
}
|
|
2671
2887
|
const plugin = {
|
|
2672
|
-
version: "2.0.0-beta.
|
|
2888
|
+
version: "2.0.0-beta.16",
|
|
2673
2889
|
install: install$1,
|
|
2674
2890
|
options: config$2
|
|
2675
2891
|
};
|