snail.vue 2.0.23 → 2.0.25

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.
@@ -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 flex-1"
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[1] || (_cache[1] = vue.withModifiers($event => {
1616
+ onClick: _cache[3] || (_cache[3] = vue.withModifiers($event => {
1454
1617
  __props.options.closeOnMask && vue.unref(closePopup)();
1455
1618
  }, ["self"]))
1456
- }, [vue.createVNode(_sfc_main$u, vue.mergeProps({
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"])], 6);
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$s = vue.defineComponent({
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$r = vue.defineComponent({
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$q = vue.defineComponent({
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$r, options);
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$t, options, extOptions);
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$s, options, extOptions);
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$q, {
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$r, options, extOptions);
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$p = vue.defineComponent({
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$o = vue.defineComponent({
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$n = vue.defineComponent({
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$o, {
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$p, {
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$n);
2448
+ type == "popup" && app.component("SelectPopup", _sfc_main$l);
2265
2449
  });
2266
- var _sfc_main$m = vue.defineComponent({
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$l = vue.defineComponent({
2601
+ var _sfc_main$j = vue.defineComponent({
2418
2602
  ...{
2419
2603
  name: "Switch",
2420
2604
  inheritAttrs: true
@@ -2423,7 +2607,8 @@
2423
2607
  props: vue.mergeModels({
2424
2608
  readonly: {
2425
2609
  type: Boolean
2426
- }
2610
+ },
2611
+ type: {}
2427
2612
  }, {
2428
2613
  "modelValue": {
2429
2614
  type: Boolean,
@@ -2450,21 +2635,30 @@
2450
2635
  }
2451
2636
  return (_ctx, _cache) => {
2452
2637
  return vue.openBlock(), vue.createElementBlock("div", {
2453
- class: vue.normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", __props.readonly ? "readonly" : ""]]),
2638
+ class: vue.normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", __props.readonly ? "readonly" : ""], __props.type || "switch"]),
2454
2639
  onClick: onSwitchChange
2455
- }, [...(_cache[0] || (_cache[0] = [vue.createElementVNode("div", {
2456
- class: "on"
2457
- }, null, -1), vue.createElementVNode("div", {
2458
- class: "off"
2459
- }, null, -1), vue.createElementVNode("div", {
2640
+ }, [__props.type == "checkbox" || __props.type == "radio" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2641
+ key: 0
2642
+ }, [switchModel.value ? (vue.openBlock(), vue.createBlock(_sfc_main$E, {
2643
+ key: 0,
2644
+ type: "success",
2645
+ color: "white",
2646
+ size: 16
2647
+ })) : vue.createCommentVNode("", true)], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2648
+ key: 1
2649
+ }, [_cache[0] || (_cache[0] = vue.createElementVNode("div", {
2650
+ class: "wh-fill on"
2651
+ }, null, -1)), _cache[1] || (_cache[1] = vue.createElementVNode("div", {
2652
+ class: "wh-fill off"
2653
+ }, null, -1)), _cache[2] || (_cache[2] = vue.createElementVNode("div", {
2460
2654
  class: "status"
2461
- }, null, -1)]))], 2);
2655
+ }, null, -1))], 64))], 2);
2462
2656
  };
2463
2657
  }
2464
2658
  });
2465
2659
 
2466
2660
  const _hoisted_1$c = ["readonly", "placeholder", "rows"];
2467
- var _sfc_main$k = vue.defineComponent({
2661
+ var _sfc_main$i = vue.defineComponent({
2468
2662
  ...{
2469
2663
  name: "Textarea",
2470
2664
  inheritAttrs: true
@@ -2531,7 +2725,7 @@
2531
2725
 
2532
2726
  const _hoisted_1$b = ["onClick"];
2533
2727
  const _hoisted_2$6 = ["textContent"];
2534
- var _sfc_main$j = vue.defineComponent({
2728
+ var _sfc_main$h = vue.defineComponent({
2535
2729
  __name: "action-items",
2536
2730
  props: {
2537
2731
  mode: {},
@@ -2591,7 +2785,7 @@
2591
2785
  const _hoisted_2$5 = {
2592
2786
  class: "action-slot flex-cross-center"
2593
2787
  };
2594
- var _sfc_main$i = vue.defineComponent({
2788
+ var _sfc_main$g = vue.defineComponent({
2595
2789
  __name: "action",
2596
2790
  props: {
2597
2791
  disabled: {
@@ -2623,7 +2817,7 @@
2623
2817
  }
2624
2818
  if (props.disabled != true) {
2625
2819
  popupScope = follow(rootDom.value, {
2626
- component: _sfc_main$j,
2820
+ component: _sfc_main$h,
2627
2821
  closeOnEscape: true,
2628
2822
  closeOnMask: true,
2629
2823
  closeOnResize: true,
@@ -2688,65 +2882,7 @@
2688
2882
  }
2689
2883
  });
2690
2884
 
2691
- function monitScroll(manager, root, options, emiter, classStyleRef) {
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({
2885
+ var _sfc_main$f = vue.defineComponent({
2750
2886
  ...{
2751
2887
  name: "Elastic",
2752
2888
  inheritAttrs: false
@@ -2952,7 +3088,7 @@
2952
3088
  }
2953
3089
  });
2954
3090
 
2955
- var _sfc_main$g = vue.defineComponent({
3091
+ var _sfc_main$e = vue.defineComponent({
2956
3092
  ...{
2957
3093
  name: "Flex",
2958
3094
  inheritAttrs: false
@@ -3053,7 +3189,7 @@
3053
3189
  key: 1,
3054
3190
  class: "status"
3055
3191
  };
3056
- var _sfc_main$f = vue.defineComponent({
3192
+ var _sfc_main$d = vue.defineComponent({
3057
3193
  ...{
3058
3194
  name: "Fold",
3059
3195
  inheritAttrs: true
@@ -3163,54 +3299,10 @@
3163
3299
  }
3164
3300
  });
3165
3301
 
3166
- var _sfc_main$e = vue.defineComponent({
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({
3302
+ var _sfc_main$c = vue.defineComponent({
3211
3303
  __name: "layout",
3212
3304
  props: {
3213
- mode: {},
3305
+ direction: {},
3214
3306
  main: {},
3215
3307
  left: {},
3216
3308
  right: {},
@@ -3226,7 +3318,7 @@
3226
3318
  class: buildAreaClass("main-area", props.main),
3227
3319
  style: void 0
3228
3320
  };
3229
- if (props.mode == "vertical") {
3321
+ if (props.direction == "vertical") {
3230
3322
  map.top = {
3231
3323
  scrollable: props.top && props.top.scroll != void 0,
3232
3324
  class: buildAreaClass("top-area", props.top),
@@ -3278,13 +3370,13 @@
3278
3370
  }
3279
3371
  return (_ctx, _cache) => {
3280
3372
  return vue.openBlock(), vue.createElementBlock("div", {
3281
- class: vue.normalizeClass(["snail-layout", __props.mode])
3373
+ class: vue.normalizeClass(["snail-layout", __props.direction || "horizontal"])
3282
3374
  }, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["top", "left", "main", "right", "bottom"], item => {
3283
3375
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3284
3376
  key: item
3285
3377
  }, [areaMap.value[item] && _ctx.$slots[item] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3286
3378
  key: 0
3287
- }, [areaMap.value[item].scrollable ? (vue.openBlock(), vue.createBlock(_sfc_main$e, vue.mergeProps({
3379
+ }, [areaMap.value[item].scrollable ? (vue.openBlock(), vue.createBlock(_sfc_main$t, vue.mergeProps({
3288
3380
  key: 0,
3289
3381
  class: areaMap.value[item].class,
3290
3382
  style: areaMap.value[item].style
@@ -3303,7 +3395,7 @@
3303
3395
  }
3304
3396
  });
3305
3397
 
3306
- var _sfc_main$c = vue.defineComponent({
3398
+ var _sfc_main$b = vue.defineComponent({
3307
3399
  ...{
3308
3400
  name: "Sort",
3309
3401
  inheritAttrs: true
@@ -3407,7 +3499,7 @@
3407
3499
  const _hoisted_1$8 = {
3408
3500
  class: "table-body"
3409
3501
  };
3410
- var _sfc_main$b = vue.defineComponent({
3502
+ var _sfc_main$a = vue.defineComponent({
3411
3503
  ...{
3412
3504
  name: "Table",
3413
3505
  inheritAttrs: true
@@ -3427,7 +3519,7 @@
3427
3519
  const hStyleRef = vue.computed(() => snail_view.css.buildStyle(props.headerStyle));
3428
3520
  const fStyleRef = vue.computed(() => snail_view.css.buildStyle(props.footerStyle));
3429
3521
  return (_ctx, _cache) => {
3430
- return vue.openBlock(), vue.createBlock(_sfc_main$e, {
3522
+ return vue.openBlock(), vue.createBlock(_sfc_main$t, {
3431
3523
  class: vue.normalizeClass(["snail-table", {
3432
3524
  "start-border": __props.border == true
3433
3525
  }]),
@@ -3447,7 +3539,7 @@
3447
3539
  }
3448
3540
  });
3449
3541
 
3450
- var _sfc_main$a = vue.defineComponent({
3542
+ var _sfc_main$9 = vue.defineComponent({
3451
3543
  ...{
3452
3544
  name: "TableRow",
3453
3545
  inheritAttrs: true
@@ -3470,7 +3562,7 @@
3470
3562
  }
3471
3563
  });
3472
3564
 
3473
- var _sfc_main$9 = vue.defineComponent({
3565
+ var _sfc_main$8 = vue.defineComponent({
3474
3566
  ...{
3475
3567
  name: "TableCol",
3476
3568
  inheritAttrs: true
@@ -3528,7 +3620,7 @@
3528
3620
  class: "snail-tree-children",
3529
3621
  ref: "children"
3530
3622
  };
3531
- var _sfc_main$8 = vue.defineComponent({
3623
+ var _sfc_main$7 = vue.defineComponent({
3532
3624
  ...{
3533
3625
  name: "TreeNode",
3534
3626
  inheritAttrs: true
@@ -3674,7 +3766,7 @@
3674
3766
  const _hoisted_1$6 = {
3675
3767
  class: "snail-tree"
3676
3768
  };
3677
- var _sfc_main$7 = vue.defineComponent({
3769
+ var _sfc_main$6 = vue.defineComponent({
3678
3770
  ...{
3679
3771
  name: "Tree",
3680
3772
  inheritAttrs: true
@@ -3712,11 +3804,11 @@
3712
3804
  key: 0
3713
3805
  }, __props.search, {
3714
3806
  onSearch
3715
- }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$e, {
3807
+ }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$t, {
3716
3808
  scroll: "y"
3717
3809
  }, {
3718
3810
  default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.nodes || [], node => {
3719
- return vue.openBlock(), vue.createBlock(_sfc_main$8, {
3811
+ return vue.openBlock(), vue.createBlock(_sfc_main$7, {
3720
3812
  key: vue.unref(context).getKey(node),
3721
3813
  node,
3722
3814
  parent: void 0,
@@ -3737,52 +3829,6 @@
3737
3829
  }
3738
3830
  });
3739
3831
 
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
3832
  function mount(target, options, onDestroyed) {
3787
3833
  snail_core.mustObject(options, "options");
3788
3834
  target instanceof HTMLElement || snail_core.throwError("target must be a HTMLElement");
@@ -4077,11 +4123,11 @@
4077
4123
  }
4078
4124
  vue.onMounted(rebuildItems);
4079
4125
  return (_ctx, _cache) => {
4080
- return vue.openBlock(), vue.createBlock(_sfc_main$d, {
4126
+ return vue.openBlock(), vue.createBlock(_sfc_main$c, {
4081
4127
  class: vue.normalizeClass(["time-picker pc", {
4082
4128
  "second-disabled": vue.unref(format) != "HH:mm:ss"
4083
4129
  }]),
4084
- mode: "vertical"
4130
+ direction: "vertical"
4085
4131
  }, vue.createSlots({
4086
4132
  main: vue.withCtx(() => [vue.createVNode(_sfc_main$w, {
4087
4133
  multiple: "",
@@ -4377,11 +4423,11 @@
4377
4423
  dateRef.value == void 0 && (dateRef.value = electDateValue());
4378
4424
  buildPickerItems(stepRef.value, 0);
4379
4425
  return (_ctx, _cache) => {
4380
- return vue.openBlock(), vue.createBlock(_sfc_main$d, {
4426
+ return vue.openBlock(), vue.createBlock(_sfc_main$c, {
4381
4427
  class: vue.normalizeClass(["date-picker pc", {
4382
4428
  "time-now": __props.pinned && __props.pinned.value == true
4383
4429
  }]),
4384
- mode: "vertical",
4430
+ direction: "vertical",
4385
4431
  top: {
4386
4432
  height: "40px"
4387
4433
  },
@@ -4827,7 +4873,7 @@
4827
4873
  });
4828
4874
 
4829
4875
  const components = {
4830
- Action: _sfc_main$i,
4876
+ Action: _sfc_main$g,
4831
4877
  Button: _sfc_main$F,
4832
4878
  Choose: _sfc_main$D,
4833
4879
  Footer: _sfc_main$C,
@@ -4836,27 +4882,27 @@
4836
4882
  Input: _sfc_main$A,
4837
4883
  Number: _sfc_main$z,
4838
4884
  Search: _sfc_main$y,
4839
- Select: _sfc_main$m,
4840
- Switch: _sfc_main$l,
4841
- Textarea: _sfc_main$k,
4885
+ Select: _sfc_main$k,
4886
+ Switch: _sfc_main$j,
4887
+ Textarea: _sfc_main$i,
4842
4888
  Dynamic: _sfc_main$u,
4843
- Elastic: _sfc_main$h,
4844
- Flex: _sfc_main$g,
4845
- Fold: _sfc_main$f,
4889
+ Elastic: _sfc_main$f,
4890
+ Flex: _sfc_main$e,
4891
+ Fold: _sfc_main$d,
4846
4892
  Motion: _sfc_main$w,
4847
- Layout: _sfc_main$d,
4848
- Scroll: _sfc_main$e,
4849
- Sort: _sfc_main$c,
4850
- Table: _sfc_main$b,
4851
- TableRow: _sfc_main$a,
4852
- TableCol: _sfc_main$9,
4853
- Tree: _sfc_main$7,
4854
- Wrapper: _sfc_main$6,
4893
+ Layout: _sfc_main$c,
4894
+ Scroll: _sfc_main$t,
4895
+ Sort: _sfc_main$b,
4896
+ Table: _sfc_main$a,
4897
+ TableRow: _sfc_main$9,
4898
+ TableCol: _sfc_main$8,
4899
+ Tree: _sfc_main$6,
4900
+ Wrapper: _sfc_main$s,
4855
4901
  FlashNumber: _sfc_main$5,
4856
4902
  DatePicker: _sfc_main$2,
4857
4903
  TimePicker: _sfc_main$1,
4858
4904
  DragVerify: _sfc_main,
4859
- Empty: _sfc_main$p,
4905
+ Empty: _sfc_main$n,
4860
4906
  Loading: _sfc_main$v
4861
4907
  };
4862
4908