snail.vue 2.0.23 → 2.0.24
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/snail.vue.d.ts +25 -8
- package/dist/snail.vue.js +240 -204
- package/dist/snail.vue.umd.js +240 -204
- package/dist/styles/snail.vue.vue.css +1 -1
- package/package.json +1 -1
package/dist/snail.vue.js
CHANGED
|
@@ -1406,7 +1406,153 @@ var _sfc_main$u = defineComponent({
|
|
|
1406
1406
|
}
|
|
1407
1407
|
});
|
|
1408
1408
|
|
|
1409
|
+
function monitScroll(manager, root, options, emiter, classStyleRef) {
|
|
1410
|
+
const scope = useScope();
|
|
1411
|
+
let preStatus = void 0;
|
|
1412
|
+
const observer = useObserver();
|
|
1413
|
+
const timer = useTimer();
|
|
1414
|
+
const reactive = useReactive();
|
|
1415
|
+
function buildClassStyle() {
|
|
1416
|
+
const array = (classStyleRef.value ? [...classStyleRef.value] : []).filter(item => item == "x-bar" || item == "y-bar");
|
|
1417
|
+
array.push(...manager.buildClassStyle(options));
|
|
1418
|
+
classStyleRef.value = array;
|
|
1419
|
+
}
|
|
1420
|
+
function refreshScrollInfo() {
|
|
1421
|
+
const status = Object.freeze(manager.getStatus(root));
|
|
1422
|
+
const events = Object.create(null);
|
|
1423
|
+
if (preStatus != void 0) {
|
|
1424
|
+
preStatus.xbar != status.xbar && (events.xbar = [status.xbar]);
|
|
1425
|
+
preStatus.ybar != status.ybar && (events.ybar = [status.ybar]);
|
|
1426
|
+
if (preStatus.xbar == true && status.xbar == true) {
|
|
1427
|
+
status.left && preStatus.left !== status.left && (events.left = []);
|
|
1428
|
+
status.right && preStatus.right !== status.right && (events.right = []);
|
|
1429
|
+
}
|
|
1430
|
+
if (preStatus.ybar == true && status.ybar == true) {
|
|
1431
|
+
status.top && preStatus.top !== status.top && (events.top = []);
|
|
1432
|
+
status.bottom && preStatus.bottom !== status.bottom && (events.bottom = []);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
preStatus = status;
|
|
1436
|
+
events.xbar && emiter("xbar", ...events.xbar);
|
|
1437
|
+
events.left && emiter("left");
|
|
1438
|
+
events.right && emiter("right");
|
|
1439
|
+
events.ybar && emiter("ybar", ...events.ybar);
|
|
1440
|
+
events.top && emiter("top");
|
|
1441
|
+
events.bottom && emiter("bottom");
|
|
1442
|
+
{
|
|
1443
|
+
const array = (classStyleRef.value ? [...classStyleRef.value] : []).filter(item => item != "x-bar" && item != "y-bar");
|
|
1444
|
+
status.xbar && array.push("x-bar");
|
|
1445
|
+
status.ybar && array.push("y-bar");
|
|
1446
|
+
classStyleRef.value = array;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
buildClassStyle();
|
|
1450
|
+
refreshScrollInfo();
|
|
1451
|
+
reactive.watcher(() => options.scroll, buildClassStyle);
|
|
1452
|
+
reactive.watcher(() => options.barSize, buildClassStyle);
|
|
1453
|
+
observer.onSize(root, refreshScrollInfo);
|
|
1454
|
+
observer.onEvent(root, "scroll", refreshScrollInfo);
|
|
1455
|
+
timer.onInterval(() => {
|
|
1456
|
+
const isChange = preStatus.scrollWidth != root.scrollWidth || preStatus.scrollHeight != root.scrollHeight;
|
|
1457
|
+
isChange && refreshScrollInfo();
|
|
1458
|
+
}, 100);
|
|
1459
|
+
scope.onDestroy(() => {
|
|
1460
|
+
observer.destroyed || observer.destroy();
|
|
1461
|
+
timer.destroyed || timer.destroy();
|
|
1462
|
+
reactive.destroyed || reactive.destroy();
|
|
1463
|
+
});
|
|
1464
|
+
return scope;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1409
1467
|
var _sfc_main$t = defineComponent({
|
|
1468
|
+
...{
|
|
1469
|
+
name: "Scroll",
|
|
1470
|
+
inheritAttrs: false
|
|
1471
|
+
},
|
|
1472
|
+
__name: "scroll",
|
|
1473
|
+
props: {
|
|
1474
|
+
scroll: {},
|
|
1475
|
+
barSize: {}
|
|
1476
|
+
},
|
|
1477
|
+
emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
|
|
1478
|
+
setup(__props, _ref) {
|
|
1479
|
+
let {
|
|
1480
|
+
expose: __expose,
|
|
1481
|
+
emit: __emit
|
|
1482
|
+
} = _ref;
|
|
1483
|
+
const props = __props;
|
|
1484
|
+
const emits = __emit;
|
|
1485
|
+
const rootDom = useTemplateRef("scroll-root");
|
|
1486
|
+
const manager = useScroll();
|
|
1487
|
+
const classStyleRef = shallowRef();
|
|
1488
|
+
__expose({
|
|
1489
|
+
getStatus() {
|
|
1490
|
+
return manager.getStatus(rootDom.value);
|
|
1491
|
+
},
|
|
1492
|
+
scroll(left, top) {
|
|
1493
|
+
left == void 0 || (rootDom.value.scrollLeft += left);
|
|
1494
|
+
top == void 0 || (rootDom.value.scrollTop += top);
|
|
1495
|
+
},
|
|
1496
|
+
scrollTo(left, top) {
|
|
1497
|
+
left == void 0 || (rootDom.value.scrollLeft = left);
|
|
1498
|
+
top == void 0 || (rootDom.value.scrollTop = top);
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
onMounted(() => monitScroll(manager, rootDom.value, props, emits, classStyleRef));
|
|
1502
|
+
return (_ctx, _cache) => {
|
|
1503
|
+
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
|
|
1504
|
+
class: ["snail-scroll", classStyleRef.value],
|
|
1505
|
+
ref: "scroll-root"
|
|
1506
|
+
}), [renderSlot(_ctx.$slots, "default")], 16);
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
|
|
1511
|
+
var _sfc_main$s = defineComponent({
|
|
1512
|
+
__name: "wrapper",
|
|
1513
|
+
props: {
|
|
1514
|
+
inPopup: {
|
|
1515
|
+
type: Boolean
|
|
1516
|
+
},
|
|
1517
|
+
header: {},
|
|
1518
|
+
content: {},
|
|
1519
|
+
footer: {}
|
|
1520
|
+
},
|
|
1521
|
+
emits: ["cancel", "confirm"],
|
|
1522
|
+
setup(__props, _ref) {
|
|
1523
|
+
let {
|
|
1524
|
+
emit: __emit
|
|
1525
|
+
} = _ref;
|
|
1526
|
+
const emits = __emit;
|
|
1527
|
+
return (_ctx, _cache) => {
|
|
1528
|
+
return openBlock(), createElementBlock("div", {
|
|
1529
|
+
class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
|
|
1530
|
+
}, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$B, mergeProps({
|
|
1531
|
+
key: 0
|
|
1532
|
+
}, __props.header || {
|
|
1533
|
+
useTo: "dialog",
|
|
1534
|
+
title: "对话框"
|
|
1535
|
+
}, {
|
|
1536
|
+
"use-to": (__props.header ? __props.header.useTo : void 0) || (__props.inPopup ? "dialog" : "page"),
|
|
1537
|
+
onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
|
|
1538
|
+
}), null, 16, ["use-to"])) : createCommentVNode("", true), createVNode(_sfc_main$t, mergeProps({
|
|
1539
|
+
class: "wrapper-body"
|
|
1540
|
+
}, __props.content || {
|
|
1541
|
+
scroll: "none"
|
|
1542
|
+
}), {
|
|
1543
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1544
|
+
_: 3
|
|
1545
|
+
}, 16), __props.footer && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$C, mergeProps({
|
|
1546
|
+
key: 1
|
|
1547
|
+
}, __props.footer || {}, {
|
|
1548
|
+
onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
|
|
1549
|
+
onConfirm: _cache[2] || (_cache[2] = $event => emits("confirm"))
|
|
1550
|
+
}), null, 16)) : createCommentVNode("", true)], 2);
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
|
|
1555
|
+
var _sfc_main$r = defineComponent({
|
|
1410
1556
|
...{
|
|
1411
1557
|
name: "DialogContainer",
|
|
1412
1558
|
inheritAttrs: true
|
|
@@ -1437,6 +1583,23 @@ var _sfc_main$t = defineComponent({
|
|
|
1437
1583
|
closePopup,
|
|
1438
1584
|
onBeforeClose
|
|
1439
1585
|
});
|
|
1586
|
+
let fn_onBuildData = void 0;
|
|
1587
|
+
const registerBuildDataFunc = fn => {
|
|
1588
|
+
mustFunction(fn, "fn");
|
|
1589
|
+
fn_onBuildData = fn;
|
|
1590
|
+
};
|
|
1591
|
+
async function onWrapperConfirm() {
|
|
1592
|
+
if (fn_onBuildData != void 0) {
|
|
1593
|
+
const rt = (await wait(fn_onBuildData())) || {
|
|
1594
|
+
success: true,
|
|
1595
|
+
data: void 0
|
|
1596
|
+
};
|
|
1597
|
+
console.log("onBuildData result:", rt);
|
|
1598
|
+
rt.success !== false && closePopup(rt.data);
|
|
1599
|
+
} else {
|
|
1600
|
+
closePopup();
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1440
1603
|
onMounted(() => {
|
|
1441
1604
|
onEvent(window, "keyup", event => {
|
|
1442
1605
|
event.key === "Escape" && __props.popupStatus.value == "active" && __props.options.closeOnEscape && closePopup();
|
|
@@ -1448,10 +1611,11 @@ var _sfc_main$t = defineComponent({
|
|
|
1448
1611
|
style: normalizeStyle({
|
|
1449
1612
|
"z-index": __props.zIndex
|
|
1450
1613
|
}),
|
|
1451
|
-
onClick: _cache[
|
|
1614
|
+
onClick: _cache[3] || (_cache[3] = withModifiers($event => {
|
|
1452
1615
|
__props.options.closeOnMask && unref(closePopup)();
|
|
1453
1616
|
}, ["self"]))
|
|
1454
|
-
}, [
|
|
1617
|
+
}, [__props.options.wrapper == void 0 ? (openBlock(), createBlock(_sfc_main$u, mergeProps({
|
|
1618
|
+
key: 0,
|
|
1455
1619
|
class: "dialog-body",
|
|
1456
1620
|
name: __props.options.name,
|
|
1457
1621
|
component: __props.options.component,
|
|
@@ -1461,12 +1625,32 @@ var _sfc_main$t = defineComponent({
|
|
|
1461
1625
|
"popup-status": __props.popupStatus.value,
|
|
1462
1626
|
modelValue: unref(model),
|
|
1463
1627
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => isRef(model) ? model.value = $event : null)
|
|
1464
|
-
}), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])
|
|
1628
|
+
}), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])) : (openBlock(), createBlock(_sfc_main$s, mergeProps({
|
|
1629
|
+
key: 1,
|
|
1630
|
+
class: "dialog-body",
|
|
1631
|
+
"in-popup": true
|
|
1632
|
+
}, __props.options.wrapper, {
|
|
1633
|
+
onCancel: _cache[2] || (_cache[2] = $event => unref(closePopup)()),
|
|
1634
|
+
onConfirm: onWrapperConfirm
|
|
1635
|
+
}), {
|
|
1636
|
+
default: withCtx(() => [createVNode(_sfc_main$u, mergeProps({
|
|
1637
|
+
name: __props.options.name,
|
|
1638
|
+
component: __props.options.component,
|
|
1639
|
+
url: __props.options.url,
|
|
1640
|
+
props: unref(props)
|
|
1641
|
+
}, unref(dialogExtend), {
|
|
1642
|
+
"popup-status": __props.popupStatus.value,
|
|
1643
|
+
modelValue: unref(model),
|
|
1644
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => isRef(model) ? model.value = $event : null),
|
|
1645
|
+
"on-build-data": registerBuildDataFunc
|
|
1646
|
+
}), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])]),
|
|
1647
|
+
_: 1
|
|
1648
|
+
}, 16))], 6);
|
|
1465
1649
|
};
|
|
1466
1650
|
}
|
|
1467
1651
|
});
|
|
1468
1652
|
|
|
1469
|
-
var _sfc_main$
|
|
1653
|
+
var _sfc_main$q = defineComponent({
|
|
1470
1654
|
...{
|
|
1471
1655
|
name: "FollowContainer",
|
|
1472
1656
|
inheritAttrs: true
|
|
@@ -1604,7 +1788,7 @@ var _sfc_main$s = defineComponent({
|
|
|
1604
1788
|
}
|
|
1605
1789
|
});
|
|
1606
1790
|
|
|
1607
|
-
var _sfc_main$
|
|
1791
|
+
var _sfc_main$p = defineComponent({
|
|
1608
1792
|
...{
|
|
1609
1793
|
name: "PopupContainer",
|
|
1610
1794
|
inheritAttrs: true
|
|
@@ -1647,7 +1831,7 @@ const _hoisted_1$g = {
|
|
|
1647
1831
|
class: "icon"
|
|
1648
1832
|
};
|
|
1649
1833
|
const _hoisted_2$a = ["innerHTML"];
|
|
1650
|
-
var _sfc_main$
|
|
1834
|
+
var _sfc_main$o = defineComponent({
|
|
1651
1835
|
...{
|
|
1652
1836
|
name: "ToastContainer",
|
|
1653
1837
|
inheritAttrs: true
|
|
@@ -1709,7 +1893,7 @@ var _sfc_main$q = defineComponent({
|
|
|
1709
1893
|
|
|
1710
1894
|
function usePopup() {
|
|
1711
1895
|
function popup(options) {
|
|
1712
|
-
const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$
|
|
1896
|
+
const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$p, options);
|
|
1713
1897
|
return addScope2Scopes(scope);
|
|
1714
1898
|
}
|
|
1715
1899
|
function dialog(options) {
|
|
@@ -1730,7 +1914,7 @@ function usePopup() {
|
|
|
1730
1914
|
const rt = await hook.runHookAsync("onBeforeClose", {
|
|
1731
1915
|
mode: "one",
|
|
1732
1916
|
order: "desc"
|
|
1733
|
-
});
|
|
1917
|
+
}, data);
|
|
1734
1918
|
isClosing = false;
|
|
1735
1919
|
if (rt.success != true) {
|
|
1736
1920
|
console.warn("run onBeforeClose failed", rt.reason, rt.ex);
|
|
@@ -1742,7 +1926,7 @@ function usePopup() {
|
|
|
1742
1926
|
},
|
|
1743
1927
|
onBeforeClose: fn => hook.register("onBeforeClose", fn)
|
|
1744
1928
|
});
|
|
1745
|
-
const descriptor = openPopup(_sfc_main$
|
|
1929
|
+
const descriptor = openPopup(_sfc_main$r, options, extOptions);
|
|
1746
1930
|
scope = useAsyncScope(deferred.promise);
|
|
1747
1931
|
monitorDialog(descriptor, scope, deferred);
|
|
1748
1932
|
}
|
|
@@ -1760,7 +1944,7 @@ function usePopup() {
|
|
|
1760
1944
|
inPopup: "follow",
|
|
1761
1945
|
target
|
|
1762
1946
|
};
|
|
1763
|
-
scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$
|
|
1947
|
+
scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$q, options, extOptions);
|
|
1764
1948
|
}
|
|
1765
1949
|
return addScope2Scopes(scope);
|
|
1766
1950
|
}
|
|
@@ -1777,7 +1961,7 @@ function usePopup() {
|
|
|
1777
1961
|
});
|
|
1778
1962
|
}
|
|
1779
1963
|
function toast(type, message, options) {
|
|
1780
|
-
return popupInCustomContainer(_sfc_main$
|
|
1964
|
+
return popupInCustomContainer(_sfc_main$o, {
|
|
1781
1965
|
url: "#ToastContainer",
|
|
1782
1966
|
props: {
|
|
1783
1967
|
...(options || Object.create(null)),
|
|
@@ -1810,7 +1994,7 @@ function usePopup() {
|
|
|
1810
1994
|
},
|
|
1811
1995
|
...extOptions
|
|
1812
1996
|
});
|
|
1813
|
-
const descriptor = openPopup(container || _sfc_main$
|
|
1997
|
+
const descriptor = openPopup(container || _sfc_main$p, options, extOptions);
|
|
1814
1998
|
const scope = useAsyncScope(deferred.promise);
|
|
1815
1999
|
scope.onDestroy(() => destroyPopup(descriptor, deferred));
|
|
1816
2000
|
return scope;
|
|
@@ -1950,7 +2134,7 @@ const _hoisted_1$f = {
|
|
|
1950
2134
|
};
|
|
1951
2135
|
const _hoisted_2$9 = ["src"];
|
|
1952
2136
|
const _hoisted_3$6 = ["textContent"];
|
|
1953
|
-
var _sfc_main$
|
|
2137
|
+
var _sfc_main$n = defineComponent({
|
|
1954
2138
|
...{
|
|
1955
2139
|
name: "Empty",
|
|
1956
2140
|
inheritAttrs: true
|
|
@@ -1979,7 +2163,7 @@ const _hoisted_3$5 = {
|
|
|
1979
2163
|
key: 1,
|
|
1980
2164
|
class: "select-status"
|
|
1981
2165
|
};
|
|
1982
|
-
var _sfc_main$
|
|
2166
|
+
var _sfc_main$m = defineComponent({
|
|
1983
2167
|
...{
|
|
1984
2168
|
name: "SelectNode",
|
|
1985
2169
|
inheritAttrs: true
|
|
@@ -2049,7 +2233,7 @@ var _sfc_main$o = defineComponent({
|
|
|
2049
2233
|
}
|
|
2050
2234
|
});
|
|
2051
2235
|
|
|
2052
|
-
var _sfc_main$
|
|
2236
|
+
var _sfc_main$l = defineComponent({
|
|
2053
2237
|
...{
|
|
2054
2238
|
name: "Select2Popup",
|
|
2055
2239
|
inheritAttrs: true
|
|
@@ -2227,7 +2411,7 @@ var _sfc_main$n = defineComponent({
|
|
|
2227
2411
|
onSearch,
|
|
2228
2412
|
key: "select-search"
|
|
2229
2413
|
}), null, 16)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
|
|
2230
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2414
|
+
return openBlock(), createBlock(_sfc_main$m, {
|
|
2231
2415
|
key: unref(context).getKey(item),
|
|
2232
2416
|
multiple: __props.multiple,
|
|
2233
2417
|
item,
|
|
@@ -2236,7 +2420,7 @@ var _sfc_main$n = defineComponent({
|
|
|
2236
2420
|
onEnter: onEnterSelectNode,
|
|
2237
2421
|
onClick: onClickSelectNode
|
|
2238
2422
|
}, null, 8, ["multiple", "item", "context"]);
|
|
2239
|
-
}), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$
|
|
2423
|
+
}), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$n, {
|
|
2240
2424
|
key: 1,
|
|
2241
2425
|
message: "无结果"
|
|
2242
2426
|
})) : createCommentVNode("", true), showClearButtonRef.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -2259,9 +2443,9 @@ const _hoisted_4$3 = {
|
|
|
2259
2443
|
class: "placeholder"
|
|
2260
2444
|
};
|
|
2261
2445
|
onAppCreated((app, type) => {
|
|
2262
|
-
type == "popup" && app.component("SelectPopup", _sfc_main$
|
|
2446
|
+
type == "popup" && app.component("SelectPopup", _sfc_main$l);
|
|
2263
2447
|
});
|
|
2264
|
-
var _sfc_main$
|
|
2448
|
+
var _sfc_main$k = defineComponent({
|
|
2265
2449
|
...{
|
|
2266
2450
|
name: "Select",
|
|
2267
2451
|
inheritAttrs: true
|
|
@@ -2412,7 +2596,7 @@ var _sfc_main$m = defineComponent({
|
|
|
2412
2596
|
}
|
|
2413
2597
|
});
|
|
2414
2598
|
|
|
2415
|
-
var _sfc_main$
|
|
2599
|
+
var _sfc_main$j = defineComponent({
|
|
2416
2600
|
...{
|
|
2417
2601
|
name: "Switch",
|
|
2418
2602
|
inheritAttrs: true
|
|
@@ -2462,7 +2646,7 @@ var _sfc_main$l = defineComponent({
|
|
|
2462
2646
|
});
|
|
2463
2647
|
|
|
2464
2648
|
const _hoisted_1$c = ["readonly", "placeholder", "rows"];
|
|
2465
|
-
var _sfc_main$
|
|
2649
|
+
var _sfc_main$i = defineComponent({
|
|
2466
2650
|
...{
|
|
2467
2651
|
name: "Textarea",
|
|
2468
2652
|
inheritAttrs: true
|
|
@@ -2529,7 +2713,7 @@ var _sfc_main$k = defineComponent({
|
|
|
2529
2713
|
|
|
2530
2714
|
const _hoisted_1$b = ["onClick"];
|
|
2531
2715
|
const _hoisted_2$6 = ["textContent"];
|
|
2532
|
-
var _sfc_main$
|
|
2716
|
+
var _sfc_main$h = defineComponent({
|
|
2533
2717
|
__name: "action-items",
|
|
2534
2718
|
props: {
|
|
2535
2719
|
mode: {},
|
|
@@ -2589,7 +2773,7 @@ const _hoisted_1$a = {
|
|
|
2589
2773
|
const _hoisted_2$5 = {
|
|
2590
2774
|
class: "action-slot flex-cross-center"
|
|
2591
2775
|
};
|
|
2592
|
-
var _sfc_main$
|
|
2776
|
+
var _sfc_main$g = defineComponent({
|
|
2593
2777
|
__name: "action",
|
|
2594
2778
|
props: {
|
|
2595
2779
|
disabled: {
|
|
@@ -2621,7 +2805,7 @@ var _sfc_main$i = defineComponent({
|
|
|
2621
2805
|
}
|
|
2622
2806
|
if (props.disabled != true) {
|
|
2623
2807
|
popupScope = follow(rootDom.value, {
|
|
2624
|
-
component: _sfc_main$
|
|
2808
|
+
component: _sfc_main$h,
|
|
2625
2809
|
closeOnEscape: true,
|
|
2626
2810
|
closeOnMask: true,
|
|
2627
2811
|
closeOnResize: true,
|
|
@@ -2686,65 +2870,7 @@ var _sfc_main$i = defineComponent({
|
|
|
2686
2870
|
}
|
|
2687
2871
|
});
|
|
2688
2872
|
|
|
2689
|
-
|
|
2690
|
-
const scope = useScope();
|
|
2691
|
-
let preStatus = void 0;
|
|
2692
|
-
const observer = useObserver();
|
|
2693
|
-
const timer = useTimer();
|
|
2694
|
-
const reactive = useReactive();
|
|
2695
|
-
function buildClassStyle() {
|
|
2696
|
-
const array = (classStyleRef.value ? [...classStyleRef.value] : []).filter(item => item == "x-bar" || item == "y-bar");
|
|
2697
|
-
array.push(...manager.buildClassStyle(options));
|
|
2698
|
-
classStyleRef.value = array;
|
|
2699
|
-
}
|
|
2700
|
-
function refreshScrollInfo() {
|
|
2701
|
-
const status = Object.freeze(manager.getStatus(root));
|
|
2702
|
-
const events = Object.create(null);
|
|
2703
|
-
if (preStatus != void 0) {
|
|
2704
|
-
preStatus.xbar != status.xbar && (events.xbar = [status.xbar]);
|
|
2705
|
-
preStatus.ybar != status.ybar && (events.ybar = [status.ybar]);
|
|
2706
|
-
if (preStatus.xbar == true && status.xbar == true) {
|
|
2707
|
-
status.left && preStatus.left !== status.left && (events.left = []);
|
|
2708
|
-
status.right && preStatus.right !== status.right && (events.right = []);
|
|
2709
|
-
}
|
|
2710
|
-
if (preStatus.ybar == true && status.ybar == true) {
|
|
2711
|
-
status.top && preStatus.top !== status.top && (events.top = []);
|
|
2712
|
-
status.bottom && preStatus.bottom !== status.bottom && (events.bottom = []);
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
preStatus = status;
|
|
2716
|
-
events.xbar && emiter("xbar", ...events.xbar);
|
|
2717
|
-
events.left && emiter("left");
|
|
2718
|
-
events.right && emiter("right");
|
|
2719
|
-
events.ybar && emiter("ybar", ...events.ybar);
|
|
2720
|
-
events.top && emiter("top");
|
|
2721
|
-
events.bottom && emiter("bottom");
|
|
2722
|
-
{
|
|
2723
|
-
const array = (classStyleRef.value ? [...classStyleRef.value] : []).filter(item => item != "x-bar" && item != "y-bar");
|
|
2724
|
-
status.xbar && array.push("x-bar");
|
|
2725
|
-
status.ybar && array.push("y-bar");
|
|
2726
|
-
classStyleRef.value = array;
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
buildClassStyle();
|
|
2730
|
-
refreshScrollInfo();
|
|
2731
|
-
reactive.watcher(() => options.scroll, buildClassStyle);
|
|
2732
|
-
reactive.watcher(() => options.barSize, buildClassStyle);
|
|
2733
|
-
observer.onSize(root, refreshScrollInfo);
|
|
2734
|
-
observer.onEvent(root, "scroll", refreshScrollInfo);
|
|
2735
|
-
timer.onInterval(() => {
|
|
2736
|
-
const isChange = preStatus.scrollWidth != root.scrollWidth || preStatus.scrollHeight != root.scrollHeight;
|
|
2737
|
-
isChange && refreshScrollInfo();
|
|
2738
|
-
}, 100);
|
|
2739
|
-
scope.onDestroy(() => {
|
|
2740
|
-
observer.destroyed || observer.destroy();
|
|
2741
|
-
timer.destroyed || timer.destroy();
|
|
2742
|
-
reactive.destroyed || reactive.destroy();
|
|
2743
|
-
});
|
|
2744
|
-
return scope;
|
|
2745
|
-
}
|
|
2746
|
-
|
|
2747
|
-
var _sfc_main$h = defineComponent({
|
|
2873
|
+
var _sfc_main$f = defineComponent({
|
|
2748
2874
|
...{
|
|
2749
2875
|
name: "Elastic",
|
|
2750
2876
|
inheritAttrs: false
|
|
@@ -2950,7 +3076,7 @@ var _sfc_main$h = defineComponent({
|
|
|
2950
3076
|
}
|
|
2951
3077
|
});
|
|
2952
3078
|
|
|
2953
|
-
var _sfc_main$
|
|
3079
|
+
var _sfc_main$e = defineComponent({
|
|
2954
3080
|
...{
|
|
2955
3081
|
name: "Flex",
|
|
2956
3082
|
inheritAttrs: false
|
|
@@ -3051,7 +3177,7 @@ const _hoisted_3$3 = {
|
|
|
3051
3177
|
key: 1,
|
|
3052
3178
|
class: "status"
|
|
3053
3179
|
};
|
|
3054
|
-
var _sfc_main$
|
|
3180
|
+
var _sfc_main$d = defineComponent({
|
|
3055
3181
|
...{
|
|
3056
3182
|
name: "Fold",
|
|
3057
3183
|
inheritAttrs: true
|
|
@@ -3161,51 +3287,7 @@ var _sfc_main$f = defineComponent({
|
|
|
3161
3287
|
}
|
|
3162
3288
|
});
|
|
3163
3289
|
|
|
3164
|
-
var _sfc_main$
|
|
3165
|
-
...{
|
|
3166
|
-
name: "Scroll",
|
|
3167
|
-
inheritAttrs: false
|
|
3168
|
-
},
|
|
3169
|
-
__name: "scroll",
|
|
3170
|
-
props: {
|
|
3171
|
-
scroll: {},
|
|
3172
|
-
barSize: {}
|
|
3173
|
-
},
|
|
3174
|
-
emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
|
|
3175
|
-
setup(__props, _ref) {
|
|
3176
|
-
let {
|
|
3177
|
-
expose: __expose,
|
|
3178
|
-
emit: __emit
|
|
3179
|
-
} = _ref;
|
|
3180
|
-
const props = __props;
|
|
3181
|
-
const emits = __emit;
|
|
3182
|
-
const rootDom = useTemplateRef("scroll-root");
|
|
3183
|
-
const manager = useScroll();
|
|
3184
|
-
const classStyleRef = shallowRef();
|
|
3185
|
-
__expose({
|
|
3186
|
-
getStatus() {
|
|
3187
|
-
return manager.getStatus(rootDom.value);
|
|
3188
|
-
},
|
|
3189
|
-
scroll(left, top) {
|
|
3190
|
-
left == void 0 || (rootDom.value.scrollLeft += left);
|
|
3191
|
-
top == void 0 || (rootDom.value.scrollTop += top);
|
|
3192
|
-
},
|
|
3193
|
-
scrollTo(left, top) {
|
|
3194
|
-
left == void 0 || (rootDom.value.scrollLeft = left);
|
|
3195
|
-
top == void 0 || (rootDom.value.scrollTop = top);
|
|
3196
|
-
}
|
|
3197
|
-
});
|
|
3198
|
-
onMounted(() => monitScroll(manager, rootDom.value, props, emits, classStyleRef));
|
|
3199
|
-
return (_ctx, _cache) => {
|
|
3200
|
-
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
|
|
3201
|
-
class: ["snail-scroll", classStyleRef.value],
|
|
3202
|
-
ref: "scroll-root"
|
|
3203
|
-
}), [renderSlot(_ctx.$slots, "default")], 16);
|
|
3204
|
-
};
|
|
3205
|
-
}
|
|
3206
|
-
});
|
|
3207
|
-
|
|
3208
|
-
var _sfc_main$d = defineComponent({
|
|
3290
|
+
var _sfc_main$c = defineComponent({
|
|
3209
3291
|
__name: "layout",
|
|
3210
3292
|
props: {
|
|
3211
3293
|
mode: {},
|
|
@@ -3282,7 +3364,7 @@ var _sfc_main$d = defineComponent({
|
|
|
3282
3364
|
key: item
|
|
3283
3365
|
}, [areaMap.value[item] && _ctx.$slots[item] ? (openBlock(), createElementBlock(Fragment, {
|
|
3284
3366
|
key: 0
|
|
3285
|
-
}, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$
|
|
3367
|
+
}, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
|
|
3286
3368
|
key: 0,
|
|
3287
3369
|
class: areaMap.value[item].class,
|
|
3288
3370
|
style: areaMap.value[item].style
|
|
@@ -3301,7 +3383,7 @@ var _sfc_main$d = defineComponent({
|
|
|
3301
3383
|
}
|
|
3302
3384
|
});
|
|
3303
3385
|
|
|
3304
|
-
var _sfc_main$
|
|
3386
|
+
var _sfc_main$b = defineComponent({
|
|
3305
3387
|
...{
|
|
3306
3388
|
name: "Sort",
|
|
3307
3389
|
inheritAttrs: true
|
|
@@ -3405,7 +3487,7 @@ var _sfc_main$c = defineComponent({
|
|
|
3405
3487
|
const _hoisted_1$8 = {
|
|
3406
3488
|
class: "table-body"
|
|
3407
3489
|
};
|
|
3408
|
-
var _sfc_main$
|
|
3490
|
+
var _sfc_main$a = defineComponent({
|
|
3409
3491
|
...{
|
|
3410
3492
|
name: "Table",
|
|
3411
3493
|
inheritAttrs: true
|
|
@@ -3425,7 +3507,7 @@ var _sfc_main$b = defineComponent({
|
|
|
3425
3507
|
const hStyleRef = computed(() => css.buildStyle(props.headerStyle));
|
|
3426
3508
|
const fStyleRef = computed(() => css.buildStyle(props.footerStyle));
|
|
3427
3509
|
return (_ctx, _cache) => {
|
|
3428
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3510
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
3429
3511
|
class: normalizeClass(["snail-table", {
|
|
3430
3512
|
"start-border": __props.border == true
|
|
3431
3513
|
}]),
|
|
@@ -3445,7 +3527,7 @@ var _sfc_main$b = defineComponent({
|
|
|
3445
3527
|
}
|
|
3446
3528
|
});
|
|
3447
3529
|
|
|
3448
|
-
var _sfc_main$
|
|
3530
|
+
var _sfc_main$9 = defineComponent({
|
|
3449
3531
|
...{
|
|
3450
3532
|
name: "TableRow",
|
|
3451
3533
|
inheritAttrs: true
|
|
@@ -3468,7 +3550,7 @@ var _sfc_main$a = defineComponent({
|
|
|
3468
3550
|
}
|
|
3469
3551
|
});
|
|
3470
3552
|
|
|
3471
|
-
var _sfc_main$
|
|
3553
|
+
var _sfc_main$8 = defineComponent({
|
|
3472
3554
|
...{
|
|
3473
3555
|
name: "TableCol",
|
|
3474
3556
|
inheritAttrs: true
|
|
@@ -3526,7 +3608,7 @@ const _hoisted_4$2 = {
|
|
|
3526
3608
|
class: "snail-tree-children",
|
|
3527
3609
|
ref: "children"
|
|
3528
3610
|
};
|
|
3529
|
-
var _sfc_main$
|
|
3611
|
+
var _sfc_main$7 = defineComponent({
|
|
3530
3612
|
...{
|
|
3531
3613
|
name: "TreeNode",
|
|
3532
3614
|
inheritAttrs: true
|
|
@@ -3672,7 +3754,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
3672
3754
|
const _hoisted_1$6 = {
|
|
3673
3755
|
class: "snail-tree"
|
|
3674
3756
|
};
|
|
3675
|
-
var _sfc_main$
|
|
3757
|
+
var _sfc_main$6 = defineComponent({
|
|
3676
3758
|
...{
|
|
3677
3759
|
name: "Tree",
|
|
3678
3760
|
inheritAttrs: true
|
|
@@ -3710,11 +3792,11 @@ var _sfc_main$7 = defineComponent({
|
|
|
3710
3792
|
key: 0
|
|
3711
3793
|
}, __props.search, {
|
|
3712
3794
|
onSearch
|
|
3713
|
-
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$
|
|
3795
|
+
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$t, {
|
|
3714
3796
|
scroll: "y"
|
|
3715
3797
|
}, {
|
|
3716
3798
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
|
|
3717
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3799
|
+
return openBlock(), createBlock(_sfc_main$7, {
|
|
3718
3800
|
key: unref(context).getKey(node),
|
|
3719
3801
|
node,
|
|
3720
3802
|
parent: void 0,
|
|
@@ -3735,52 +3817,6 @@ var _sfc_main$7 = defineComponent({
|
|
|
3735
3817
|
}
|
|
3736
3818
|
});
|
|
3737
3819
|
|
|
3738
|
-
var _sfc_main$6 = defineComponent({
|
|
3739
|
-
__name: "wrapper",
|
|
3740
|
-
props: {
|
|
3741
|
-
readonly: {
|
|
3742
|
-
type: Boolean
|
|
3743
|
-
},
|
|
3744
|
-
inPopup: {
|
|
3745
|
-
type: Boolean
|
|
3746
|
-
},
|
|
3747
|
-
header: {},
|
|
3748
|
-
content: {},
|
|
3749
|
-
footer: {}
|
|
3750
|
-
},
|
|
3751
|
-
emits: ["cancel", "confirm"],
|
|
3752
|
-
setup(__props, _ref) {
|
|
3753
|
-
let {
|
|
3754
|
-
emit: __emit
|
|
3755
|
-
} = _ref;
|
|
3756
|
-
const emits = __emit;
|
|
3757
|
-
return (_ctx, _cache) => {
|
|
3758
|
-
return openBlock(), createElementBlock("div", {
|
|
3759
|
-
class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
|
|
3760
|
-
}, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$B, mergeProps({
|
|
3761
|
-
key: 0
|
|
3762
|
-
}, __props.header || {
|
|
3763
|
-
useTo: "dialog",
|
|
3764
|
-
title: "对话框"
|
|
3765
|
-
}, {
|
|
3766
|
-
onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
|
|
3767
|
-
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$e, mergeProps({
|
|
3768
|
-
class: "wrapper-body"
|
|
3769
|
-
}, __props.content || {
|
|
3770
|
-
scroll: "none"
|
|
3771
|
-
}), {
|
|
3772
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
3773
|
-
_: 3
|
|
3774
|
-
}, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$C, mergeProps({
|
|
3775
|
-
key: 1
|
|
3776
|
-
}, __props.footer || {}, {
|
|
3777
|
-
onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
|
|
3778
|
-
onConfirm: _cache[2] || (_cache[2] = $event => emits("confirm"))
|
|
3779
|
-
}), null, 16)) : createCommentVNode("", true)], 2);
|
|
3780
|
-
};
|
|
3781
|
-
}
|
|
3782
|
-
});
|
|
3783
|
-
|
|
3784
3820
|
function mount(target, options, onDestroyed) {
|
|
3785
3821
|
mustObject(options, "options");
|
|
3786
3822
|
target instanceof HTMLElement || throwError("target must be a HTMLElement");
|
|
@@ -4075,7 +4111,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
4075
4111
|
}
|
|
4076
4112
|
onMounted(rebuildItems);
|
|
4077
4113
|
return (_ctx, _cache) => {
|
|
4078
|
-
return openBlock(), createBlock(_sfc_main$
|
|
4114
|
+
return openBlock(), createBlock(_sfc_main$c, {
|
|
4079
4115
|
class: normalizeClass(["time-picker pc", {
|
|
4080
4116
|
"second-disabled": unref(format) != "HH:mm:ss"
|
|
4081
4117
|
}]),
|
|
@@ -4375,7 +4411,7 @@ var _sfc_main$3 = defineComponent({
|
|
|
4375
4411
|
dateRef.value == void 0 && (dateRef.value = electDateValue());
|
|
4376
4412
|
buildPickerItems(stepRef.value, 0);
|
|
4377
4413
|
return (_ctx, _cache) => {
|
|
4378
|
-
return openBlock(), createBlock(_sfc_main$
|
|
4414
|
+
return openBlock(), createBlock(_sfc_main$c, {
|
|
4379
4415
|
class: normalizeClass(["date-picker pc", {
|
|
4380
4416
|
"time-now": __props.pinned && __props.pinned.value == true
|
|
4381
4417
|
}]),
|
|
@@ -4825,7 +4861,7 @@ var _sfc_main = defineComponent({
|
|
|
4825
4861
|
});
|
|
4826
4862
|
|
|
4827
4863
|
const components = {
|
|
4828
|
-
Action: _sfc_main$
|
|
4864
|
+
Action: _sfc_main$g,
|
|
4829
4865
|
Button: _sfc_main$F,
|
|
4830
4866
|
Choose: _sfc_main$D,
|
|
4831
4867
|
Footer: _sfc_main$C,
|
|
@@ -4834,27 +4870,27 @@ const components = {
|
|
|
4834
4870
|
Input: _sfc_main$A,
|
|
4835
4871
|
Number: _sfc_main$z,
|
|
4836
4872
|
Search: _sfc_main$y,
|
|
4837
|
-
Select: _sfc_main$
|
|
4838
|
-
Switch: _sfc_main$
|
|
4839
|
-
Textarea: _sfc_main$
|
|
4873
|
+
Select: _sfc_main$k,
|
|
4874
|
+
Switch: _sfc_main$j,
|
|
4875
|
+
Textarea: _sfc_main$i,
|
|
4840
4876
|
Dynamic: _sfc_main$u,
|
|
4841
|
-
Elastic: _sfc_main$
|
|
4842
|
-
Flex: _sfc_main$
|
|
4843
|
-
Fold: _sfc_main$
|
|
4877
|
+
Elastic: _sfc_main$f,
|
|
4878
|
+
Flex: _sfc_main$e,
|
|
4879
|
+
Fold: _sfc_main$d,
|
|
4844
4880
|
Motion: _sfc_main$w,
|
|
4845
|
-
Layout: _sfc_main$
|
|
4846
|
-
Scroll: _sfc_main$
|
|
4847
|
-
Sort: _sfc_main$
|
|
4848
|
-
Table: _sfc_main$
|
|
4849
|
-
TableRow: _sfc_main$
|
|
4850
|
-
TableCol: _sfc_main$
|
|
4851
|
-
Tree: _sfc_main$
|
|
4852
|
-
Wrapper: _sfc_main$
|
|
4881
|
+
Layout: _sfc_main$c,
|
|
4882
|
+
Scroll: _sfc_main$t,
|
|
4883
|
+
Sort: _sfc_main$b,
|
|
4884
|
+
Table: _sfc_main$a,
|
|
4885
|
+
TableRow: _sfc_main$9,
|
|
4886
|
+
TableCol: _sfc_main$8,
|
|
4887
|
+
Tree: _sfc_main$6,
|
|
4888
|
+
Wrapper: _sfc_main$s,
|
|
4853
4889
|
FlashNumber: _sfc_main$5,
|
|
4854
4890
|
DatePicker: _sfc_main$2,
|
|
4855
4891
|
TimePicker: _sfc_main$1,
|
|
4856
4892
|
DragVerify: _sfc_main,
|
|
4857
|
-
Empty: _sfc_main$
|
|
4893
|
+
Empty: _sfc_main$n,
|
|
4858
4894
|
Loading: _sfc_main$v
|
|
4859
4895
|
};
|
|
4860
4896
|
|