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