snail.vue 2.0.9 → 2.0.11

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.
@@ -6,7 +6,7 @@
6
6
  })(this, (function (exports, vue, snail_core, snail_view) { 'use strict';
7
7
 
8
8
  const _hoisted_1$j = ["title"];
9
- var _sfc_main$x = vue.defineComponent({
9
+ var _sfc_main$y = vue.defineComponent({
10
10
  ...{
11
11
  name: "Button",
12
12
  inheritAttrs: true
@@ -71,8 +71,8 @@
71
71
 
72
72
  const _hoisted_1$i = ["width", "height"];
73
73
  const _hoisted_2$b = ["textContent"];
74
- const _hoisted_3$8 = ["fill", "stroke", "stroke-width", "d"];
75
- var _sfc_main$w = vue.defineComponent({
74
+ const _hoisted_3$9 = ["fill", "stroke", "stroke-width", "d"];
75
+ var _sfc_main$x = vue.defineComponent({
76
76
  ...{
77
77
  name: "Icon",
78
78
  inheritAttrs: true
@@ -108,7 +108,7 @@
108
108
  stroke: __props.stroke,
109
109
  "stroke-width": __props.strokeWidth,
110
110
  d
111
- }, null, 8, _hoisted_3$8);
111
+ }, null, 8, _hoisted_3$9);
112
112
  }), 256))], 46, _hoisted_1$i);
113
113
  };
114
114
  }
@@ -116,9 +116,9 @@
116
116
 
117
117
  const _hoisted_1$h = ["title", "onClick"];
118
118
  const _hoisted_2$a = ["type", "checked"];
119
- const _hoisted_3$7 = ["textContent"];
120
- const _hoisted_4$5 = ["textContent"];
121
- var _sfc_main$v = vue.defineComponent({
119
+ const _hoisted_3$8 = ["textContent"];
120
+ const _hoisted_4$6 = ["textContent"];
121
+ var _sfc_main$w = vue.defineComponent({
122
122
  ...{
123
123
  name: "Choose",
124
124
  inheritAttrs: true
@@ -197,7 +197,7 @@
197
197
  }, null, 8, _hoisted_2$a)) : vue.unref(mode) == "beautiful" ? (vue.openBlock(), vue.createElementBlock("div", {
198
198
  key: 1,
199
199
  class: vue.normalizeClass(["status", [node.selected ? "selected" : ""]])
200
- }, [node.selected ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
200
+ }, [node.selected ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
201
201
  key: 0,
202
202
  type: "success",
203
203
  size: 12,
@@ -206,18 +206,18 @@
206
206
  key: 2,
207
207
  class: "item-text",
208
208
  textContent: vue.toDisplayString(node.item.text)
209
- }, null, 8, _hoisted_3$7)) : vue.createCommentVNode("", true), node.item.description ? (vue.openBlock(), vue.createElementBlock("span", {
209
+ }, null, 8, _hoisted_3$8)) : vue.createCommentVNode("", true), node.item.description ? (vue.openBlock(), vue.createElementBlock("span", {
210
210
  key: 3,
211
211
  class: "item-des",
212
212
  textContent: vue.toDisplayString(node.item.description)
213
- }, null, 8, _hoisted_4$5)) : vue.createCommentVNode("", true)], 14, _hoisted_1$h);
213
+ }, null, 8, _hoisted_4$6)) : vue.createCommentVNode("", true)], 14, _hoisted_1$h);
214
214
  }), 128))], 2);
215
215
  };
216
216
  }
217
217
  });
218
218
 
219
219
  const _hoisted_1$g = ["id"];
220
- var _sfc_main$u = vue.defineComponent({
220
+ var _sfc_main$v = vue.defineComponent({
221
221
  __name: "datepicker",
222
222
  props: {
223
223
  type: {},
@@ -373,7 +373,7 @@
373
373
  }
374
374
  });
375
375
 
376
- var _sfc_main$t = vue.defineComponent({
376
+ var _sfc_main$u = vue.defineComponent({
377
377
  ...{
378
378
  name: "Footer",
379
379
  inheritAttrs: true
@@ -404,13 +404,13 @@
404
404
  class: vue.normalizeClass(["snail-footer", {
405
405
  "start-divider": __props.divider
406
406
  }, __props.align || "right"])
407
- }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
407
+ }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
408
408
  key: 0,
409
409
  size: "max",
410
410
  type: "default",
411
411
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
412
412
  textContent: vue.toDisplayString(__props.cancelName || "取消")
413
- }, null, 8, ["textContent"])) : vue.createCommentVNode("", true), __props.confirmDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
413
+ }, null, 8, ["textContent"])) : vue.createCommentVNode("", true), __props.confirmDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
414
414
  key: 1,
415
415
  size: "max",
416
416
  type: "primary",
@@ -422,7 +422,7 @@
422
422
  });
423
423
 
424
424
  const _hoisted_1$f = ["textContent"];
425
- var _sfc_main$s = vue.defineComponent({
425
+ var _sfc_main$t = vue.defineComponent({
426
426
  ...{
427
427
  name: "Header",
428
428
  inheritAttrs: true
@@ -461,7 +461,7 @@
461
461
  key: 0,
462
462
  textContent: vue.toDisplayString(__props.title),
463
463
  class: vue.normalizeClass(["header-title", __props.titleAlign])
464
- }, null, 10, _hoisted_1$f)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
464
+ }, null, 10, _hoisted_1$f)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
465
465
  key: 1,
466
466
  type: "close",
467
467
  size: 22,
@@ -479,12 +479,12 @@
479
479
  class: "required",
480
480
  textContent: "*"
481
481
  };
482
- const _hoisted_3$6 = {
482
+ const _hoisted_3$7 = {
483
483
  class: "input-body"
484
484
  };
485
- const _hoisted_4$4 = ["type", "value", "readonly", "placeholder", "title"];
486
- const _hoisted_5$2 = ["title"];
487
- var _sfc_main$r = vue.defineComponent({
485
+ const _hoisted_4$5 = ["type", "value", "readonly", "placeholder", "title"];
486
+ const _hoisted_5$3 = ["title"];
487
+ var _sfc_main$s = vue.defineComponent({
488
488
  ...{
489
489
  name: "Input",
490
490
  inheritAttrs: true
@@ -536,7 +536,7 @@
536
536
  }, [vue.createElementVNode("span", {
537
537
  class: "text",
538
538
  textContent: vue.toDisplayString(__props.title)
539
- }, null, 8, _hoisted_1$e), __props.readonly != true && __props.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$9)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3$6, [vue.createElementVNode("input", {
539
+ }, null, 8, _hoisted_1$e), __props.readonly != true && __props.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$9)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3$7, [vue.createElementVNode("input", {
540
540
  ref: "input-el",
541
541
  type: __props.type || "text",
542
542
  value: inputModel.value,
@@ -545,15 +545,15 @@
545
545
  title: inputModel.value,
546
546
  onChange: onValueChange,
547
547
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
548
- }, null, 40, _hoisted_4$4), !!validateRef.value ? (vue.openBlock(), vue.createElementBlock("span", {
548
+ }, null, 40, _hoisted_4$5), !!validateRef.value ? (vue.openBlock(), vue.createElementBlock("span", {
549
549
  key: 0,
550
550
  class: "validate",
551
551
  title: validateRef.value
552
- }, [vue.createVNode(_sfc_main$w, {
552
+ }, [vue.createVNode(_sfc_main$x, {
553
553
  type: "error",
554
554
  size: 16,
555
555
  color: "red"
556
- })], 8, _hoisted_5$2)) : vue.createCommentVNode("", true)])], 2);
556
+ })], 8, _hoisted_5$3)) : vue.createCommentVNode("", true)])], 2);
557
557
  };
558
558
  }
559
559
  });
@@ -763,15 +763,15 @@
763
763
  class: "number-prefix"
764
764
  };
765
765
  const _hoisted_2$8 = ["textContent"];
766
- const _hoisted_3$5 = ["inputmode", "placeholder", "title"];
767
- const _hoisted_4$3 = {
766
+ const _hoisted_3$6 = ["inputmode", "placeholder", "title"];
767
+ const _hoisted_4$4 = {
768
768
  key: 1,
769
769
  class: "number-suffix"
770
770
  };
771
- const _hoisted_5$1 = ["textContent"];
772
- const _hoisted_6 = ["title", "textContent"];
771
+ const _hoisted_5$2 = ["textContent"];
772
+ const _hoisted_6$1 = ["title", "textContent"];
773
773
  const _hoisted_7 = ["title", "textContent"];
774
- var _sfc_main$q = vue.defineComponent({
774
+ var _sfc_main$r = vue.defineComponent({
775
775
  __name: "number",
776
776
  props: vue.mergeModels({
777
777
  placeholder: {},
@@ -933,18 +933,18 @@
933
933
  onFocus: _cache[1] || (_cache[1] = $event => vue.isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
934
934
  onPaste: _cache[2] || (_cache[2] = $event => vue.isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
935
935
  onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
936
- }, null, 40, _hoisted_3$5), [[vue.vModelText, displayValueRef.value]]), vue.unref(controls) == "default" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
936
+ }, null, 40, _hoisted_3$6), [[vue.vModelText, displayValueRef.value]]), vue.unref(controls) == "default" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
937
937
  key: 0
938
938
  }, [vue.createElementVNode("div", {
939
939
  class: "controls default subtract",
940
940
  onClick: _cache[4] || (_cache[4] = $event => onStepClick(false))
941
- }, [vue.createVNode(_sfc_main$w, {
941
+ }, [vue.createVNode(_sfc_main$x, {
942
942
  type: "subtract",
943
943
  size: 20
944
944
  })]), vue.createElementVNode("div", {
945
945
  class: "controls default plus",
946
946
  onClick: _cache[5] || (_cache[5] = $event => onStepClick(true))
947
- }, [vue.createVNode(_sfc_main$w, {
947
+ }, [vue.createVNode(_sfc_main$x, {
948
948
  type: "plus",
949
949
  size: 20
950
950
  })])], 64)) : vue.unref(controls) == "right" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
@@ -952,26 +952,26 @@
952
952
  }, [vue.createElementVNode("div", {
953
953
  class: "controls right plus",
954
954
  onClick: _cache[6] || (_cache[6] = $event => onStepClick(true))
955
- }, [vue.createVNode(_sfc_main$w, {
955
+ }, [vue.createVNode(_sfc_main$x, {
956
956
  type: "arrow",
957
957
  size: 20,
958
958
  rotate: 270
959
959
  })]), vue.createElementVNode("div", {
960
960
  class: "controls right subtract",
961
961
  onClick: _cache[7] || (_cache[7] = $event => onStepClick(false))
962
- }, [vue.createVNode(_sfc_main$w, {
962
+ }, [vue.createVNode(_sfc_main$x, {
963
963
  type: "arrow",
964
964
  size: 20,
965
965
  rotate: 90
966
- })])], 64)) : vue.createCommentVNode("", true)], 2), vue.unref(hasSuffix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [vue.createElementVNode("span", {
966
+ })])], 64)) : vue.createCommentVNode("", true)], 2), vue.unref(hasSuffix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [vue.createElementVNode("span", {
967
967
  class: "ellipsis",
968
968
  textContent: vue.toDisplayString(vue.unref(suffix))
969
- }, null, 8, _hoisted_5$1)])) : vue.createCommentVNode("", true), vue.unref(upper) ? (vue.openBlock(), vue.createElementBlock("div", {
969
+ }, null, 8, _hoisted_5$2)])) : vue.createCommentVNode("", true), vue.unref(upper) ? (vue.openBlock(), vue.createElementBlock("div", {
970
970
  key: 2,
971
971
  class: "number-util ellipsis",
972
972
  title: upperTextRef.value,
973
973
  textContent: vue.toDisplayString(`大写:${upperTextRef.value || ""}`)
974
- }, null, 8, _hoisted_6)) : vue.createCommentVNode("", true), vue.unref(thousands) == "below" ? (vue.openBlock(), vue.createElementBlock("div", {
974
+ }, null, 8, _hoisted_6$1)) : vue.createCommentVNode("", true), vue.unref(thousands) == "below" ? (vue.openBlock(), vue.createElementBlock("div", {
975
975
  key: 3,
976
976
  class: "number-util ellipsis",
977
977
  title: thousandsTextRef.value,
@@ -983,7 +983,7 @@
983
983
 
984
984
  const _hoisted_1$c = ["placeholder", "readonly"];
985
985
  const searchIon = "M 860.16 824.32 l -163.84 -163.84 c 102.4 -120.32 97.28 -302.08 -17.92 -414.72 c -120.32 -120.32 -314.88 -120.32 -435.2 0 c -120.32 120.32 -120.32 314.88 0 435.2 c 112.64 112.64 294.4 120.32 414.72 17.92 l 163.84 163.84 c 10.24 10.24 25.6 10.24 35.84 0 c 12.8 -12.8 12.8 -28.16 2.56 -38.4 Z M 281.6 642.56 C 181.76 542.72 181.76 381.44 281.6 281.6 c 99.84 -99.84 261.12 -99.84 360.96 0 c 99.84 99.84 99.84 261.12 0 360.96 c -99.84 102.4 -261.12 102.4 -360.96 0 Z";
986
- var _sfc_main$p = vue.defineComponent({
986
+ var _sfc_main$q = vue.defineComponent({
987
987
  ...{
988
988
  name: "Search",
989
989
  inheritAttrs: true
@@ -1030,7 +1030,7 @@
1030
1030
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
1031
1031
  }, null, 40, _hoisted_1$c), [[vue.vModelText, textModel.value, void 0, {
1032
1032
  trim: true
1033
- }]]), vue.createElementVNode("div", null, [vue.createVNode(_sfc_main$w, {
1033
+ }]]), vue.createElementVNode("div", null, [vue.createVNode(_sfc_main$x, {
1034
1034
  class: "search-button",
1035
1035
  type: "custom",
1036
1036
  draw: searchIon,
@@ -1255,7 +1255,7 @@
1255
1255
  class: "snail-confirm flex-column"
1256
1256
  };
1257
1257
  const _hoisted_2$7 = ["innerHTML"];
1258
- var _sfc_main$o = vue.defineComponent({
1258
+ var _sfc_main$p = vue.defineComponent({
1259
1259
  ...{
1260
1260
  name: "ConfirmContainer",
1261
1261
  inheritAttrs: true
@@ -1283,14 +1283,14 @@
1283
1283
  },
1284
1284
  setup(__props) {
1285
1285
  return (_ctx, _cache) => {
1286
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [vue.createVNode(_sfc_main$s, {
1286
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [vue.createVNode(_sfc_main$t, {
1287
1287
  "use-to": "dialog",
1288
1288
  title: __props.title || "提示",
1289
1289
  onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
1290
1290
  }, null, 8, ["title"]), vue.createElementVNode("div", {
1291
1291
  class: "confirm-body",
1292
1292
  innerHTML: __props.message || "请确认?"
1293
- }, null, 8, _hoisted_2$7), vue.createVNode(_sfc_main$t, {
1293
+ }, null, 8, _hoisted_2$7), vue.createVNode(_sfc_main$u, {
1294
1294
  align: "right",
1295
1295
  "cancel-name": __props.cancelName,
1296
1296
  "cancel-disabled": __props.cancelDisabled,
@@ -1303,7 +1303,7 @@
1303
1303
  }
1304
1304
  });
1305
1305
 
1306
- var _sfc_main$n = vue.defineComponent({
1306
+ var _sfc_main$o = vue.defineComponent({
1307
1307
  ...{
1308
1308
  name: "Loading",
1309
1309
  inheritAttrs: true
@@ -1342,7 +1342,7 @@
1342
1342
  }
1343
1343
  });
1344
1344
 
1345
- var _sfc_main$m = vue.defineComponent({
1345
+ var _sfc_main$n = vue.defineComponent({
1346
1346
  ...{
1347
1347
  name: "Dynamic",
1348
1348
  inheritAttrs: false
@@ -1366,7 +1366,7 @@
1366
1366
  const loadingComponent = vue.defineComponent({
1367
1367
  inheritAttrs: false,
1368
1368
  components: {
1369
- Loading: _sfc_main$n
1369
+ Loading: _sfc_main$o
1370
1370
  },
1371
1371
  template: "<Loading :mask-disabled='true' />"
1372
1372
  });
@@ -1433,7 +1433,7 @@
1433
1433
  }
1434
1434
  });
1435
1435
 
1436
- var _sfc_main$l = vue.defineComponent({
1436
+ var _sfc_main$m = vue.defineComponent({
1437
1437
  ...{
1438
1438
  name: "DialogContainer",
1439
1439
  inheritAttrs: true
@@ -1478,7 +1478,7 @@
1478
1478
  onClick: _cache[1] || (_cache[1] = vue.withModifiers($event => {
1479
1479
  __props.options.closeOnMask && vue.unref(closePopup)();
1480
1480
  }, ["self"]))
1481
- }, [vue.createVNode(_sfc_main$m, vue.mergeProps({
1481
+ }, [vue.createVNode(_sfc_main$n, vue.mergeProps({
1482
1482
  class: "dialog-body",
1483
1483
  name: __props.options.name,
1484
1484
  component: __props.options.component,
@@ -1493,7 +1493,7 @@
1493
1493
  }
1494
1494
  });
1495
1495
 
1496
- var _sfc_main$k = vue.defineComponent({
1496
+ var _sfc_main$l = vue.defineComponent({
1497
1497
  ...{
1498
1498
  name: "FollowContainer",
1499
1499
  inheritAttrs: true
@@ -1595,7 +1595,15 @@
1595
1595
  onEvent(window, "resize", () => __props.options.closeOnResize ? closePopup(void 0) : rootDom.value && buildFollow());
1596
1596
  onEvent(window, "keyup", evet => __props.options.closeOnEscape && evet.key === "Escape" && followExt.pinned.value != true && closePopup(void 0));
1597
1597
  onEvent(window, "click", event => {
1598
- __props.options.closeOnMask && followExt.pinned.value != true && rootDom.value != event.target && rootDom.value.contains(event.target) == false && closePopup(void 0);
1598
+ if (__props.options.closeOnMask != true || followExt.pinned.value == true) {
1599
+ return;
1600
+ }
1601
+ const isClickInContainer = rootDom.value === event.target || rootDom.value.contains(event.target);
1602
+ const isClickInTarget = __props.extOptions.target == event.target || __props.extOptions.target.contains(event.target);
1603
+ if (isClickInContainer || isClickInTarget && __props.options.closeOnTarget != true) {
1604
+ return;
1605
+ }
1606
+ closePopup(void 0);
1599
1607
  });
1600
1608
  onMutation(rootDom.value, {
1601
1609
  childList: true,
@@ -1606,7 +1614,7 @@
1606
1614
  });
1607
1615
  });
1608
1616
  return (_ctx, _cache) => {
1609
- return vue.openBlock(), vue.createBlock(_sfc_main$m, vue.mergeProps({
1617
+ return vue.openBlock(), vue.createBlock(_sfc_main$n, vue.mergeProps({
1610
1618
  class: ["snail-follow initial", [__props.popupStatus.value, __props.popupTransition.value]],
1611
1619
  style: {
1612
1620
  "z-index": __props.zIndex
@@ -1623,7 +1631,7 @@
1623
1631
  }
1624
1632
  });
1625
1633
 
1626
- var _sfc_main$j = vue.defineComponent({
1634
+ var _sfc_main$k = vue.defineComponent({
1627
1635
  ...{
1628
1636
  name: "PopupContainer",
1629
1637
  inheritAttrs: true
@@ -1643,7 +1651,7 @@
1643
1651
  model = vue.shallowRef(void 0)
1644
1652
  } = __props.options;
1645
1653
  return (_ctx, _cache) => {
1646
- return vue.openBlock(), vue.createBlock(_sfc_main$m, vue.mergeProps({
1654
+ return vue.openBlock(), vue.createBlock(_sfc_main$n, vue.mergeProps({
1647
1655
  class: ["snail-popup", [__props.popupStatus.value, __props.popupTransition.value]],
1648
1656
  style: {
1649
1657
  "z-index": __props.zIndex
@@ -1666,7 +1674,7 @@
1666
1674
  class: "icon"
1667
1675
  };
1668
1676
  const _hoisted_2$6 = ["innerHTML"];
1669
- var _sfc_main$i = vue.defineComponent({
1677
+ var _sfc_main$j = vue.defineComponent({
1670
1678
  ...{
1671
1679
  name: "ToastContainer",
1672
1680
  inheritAttrs: true
@@ -1704,7 +1712,7 @@
1704
1712
  }),
1705
1713
  onMouseenter: _cache[3] || (_cache[3] = $event => onMouseEvent(false)),
1706
1714
  onMouseleave: _cache[4] || (_cache[4] = $event => onMouseEvent(true))
1707
- }, [vue.unref(props).closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
1715
+ }, [vue.unref(props).closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
1708
1716
  key: 0,
1709
1717
  class: "close-icon",
1710
1718
  type: "close",
@@ -1715,7 +1723,7 @@
1715
1723
  onClick: _cache[2] || (_cache[2] = $event => {
1716
1724
  vue.unref(closePopup)();
1717
1725
  })
1718
- }, null, 8, ["fill"])) : vue.createCommentVNode("", true), vue.unref(props).type ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [vue.createVNode(_sfc_main$w, {
1726
+ }, null, 8, ["fill"])) : vue.createCommentVNode("", true), vue.unref(props).type ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [vue.createVNode(_sfc_main$x, {
1719
1727
  type: vue.unref(props).type,
1720
1728
  fill: "#707070",
1721
1729
  size: 20
@@ -1729,7 +1737,7 @@
1729
1737
 
1730
1738
  function usePopup() {
1731
1739
  function popup(options) {
1732
- const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$j, options);
1740
+ const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$k, options);
1733
1741
  return addScope2Scopes(scope);
1734
1742
  }
1735
1743
  function dialog(options) {
@@ -1762,7 +1770,7 @@
1762
1770
  },
1763
1771
  onBeforeClose: fn => hook.register("onBeforeClose", fn)
1764
1772
  });
1765
- const descriptor = openPopup(_sfc_main$l, options, extOptions);
1773
+ const descriptor = openPopup(_sfc_main$m, options, extOptions);
1766
1774
  scope = snail_core.useAsyncScope(deferred.promise);
1767
1775
  monitorDialog(descriptor, scope, deferred);
1768
1776
  }
@@ -1780,14 +1788,14 @@
1780
1788
  inPopup: "follow",
1781
1789
  target
1782
1790
  };
1783
- scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$k, options, extOptions);
1791
+ scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$l, options, extOptions);
1784
1792
  }
1785
1793
  return addScope2Scopes(scope);
1786
1794
  }
1787
1795
  function confirm(title, message, options) {
1788
1796
  options = options || Object.create(null);
1789
1797
  return dialog({
1790
- component: _sfc_main$o,
1798
+ component: _sfc_main$p,
1791
1799
  closeOnEscape: true,
1792
1800
  props: {
1793
1801
  ...options,
@@ -1797,7 +1805,7 @@
1797
1805
  });
1798
1806
  }
1799
1807
  function toast(type, message, options) {
1800
- return popupInCustomContainer(_sfc_main$i, {
1808
+ return popupInCustomContainer(_sfc_main$j, {
1801
1809
  url: "#ToastContainer",
1802
1810
  props: {
1803
1811
  ...(options || Object.create(null)),
@@ -1830,7 +1838,7 @@
1830
1838
  },
1831
1839
  ...extOptions
1832
1840
  });
1833
- const descriptor = openPopup(container || _sfc_main$j, options, extOptions);
1841
+ const descriptor = openPopup(container || _sfc_main$k, options, extOptions);
1834
1842
  const scope = snail_core.useAsyncScope(deferred.promise);
1835
1843
  scope.onDestroy(() => destroyPopup(descriptor, deferred));
1836
1844
  return scope;
@@ -1972,8 +1980,8 @@
1972
1980
  class: "snail-empty"
1973
1981
  };
1974
1982
  const _hoisted_2$5 = ["src"];
1975
- const _hoisted_3$4 = ["textContent"];
1976
- var _sfc_main$h = vue.defineComponent({
1983
+ const _hoisted_3$5 = ["textContent"];
1984
+ var _sfc_main$i = vue.defineComponent({
1977
1985
  ...{
1978
1986
  name: "Empty",
1979
1987
  inheritAttrs: true
@@ -1991,18 +1999,18 @@
1991
1999
  }, null, 8, _hoisted_2$5), vue.renderSlot(_ctx.$slots, "default", {}, () => [vue.createElementVNode("div", {
1992
2000
  class: "message",
1993
2001
  textContent: vue.toDisplayString(__props.message || "无数据")
1994
- }, null, 8, _hoisted_3$4)])]);
2002
+ }, null, 8, _hoisted_3$5)])]);
1995
2003
  };
1996
2004
  }
1997
2005
  });
1998
2006
 
1999
2007
  const _hoisted_1$8 = ["title"];
2000
2008
  const _hoisted_2$4 = ["textContent"];
2001
- const _hoisted_3$3 = {
2009
+ const _hoisted_3$4 = {
2002
2010
  key: 1,
2003
2011
  class: "select-status"
2004
2012
  };
2005
- var _sfc_main$g = vue.defineComponent({
2013
+ var _sfc_main$h = vue.defineComponent({
2006
2014
  ...{
2007
2015
  name: "SelectNode",
2008
2016
  inheritAttrs: true
@@ -2047,11 +2055,11 @@
2047
2055
  }, [vue.createElementVNode("div", {
2048
2056
  class: "item-text ellipsis",
2049
2057
  textContent: vue.toDisplayString(__props.item.text)
2050
- }, null, 8, _hoisted_2$4), __props.item.type == "group" ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
2058
+ }, null, 8, _hoisted_2$4), __props.item.type == "group" ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
2051
2059
  key: 0,
2052
2060
  type: "arrow",
2053
2061
  color: "#8a9099"
2054
- })) : __props.multiple == true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [vue.createVNode(_sfc_main$w, {
2062
+ })) : __props.multiple == true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, [vue.createVNode(_sfc_main$x, {
2055
2063
  type: "success",
2056
2064
  color: "white",
2057
2065
  size: 12
@@ -2072,7 +2080,7 @@
2072
2080
  }
2073
2081
  });
2074
2082
 
2075
- var _sfc_main$f = vue.defineComponent({
2083
+ var _sfc_main$g = vue.defineComponent({
2076
2084
  ...{
2077
2085
  name: "Select2Popup",
2078
2086
  inheritAttrs: true
@@ -2244,13 +2252,13 @@
2244
2252
  key: 0
2245
2253
  }, [vue.createTextVNode(" 暂无选项 ")], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2246
2254
  key: 1
2247
- }, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$p, vue.mergeProps({
2255
+ }, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$q, vue.mergeProps({
2248
2256
  key: 0
2249
2257
  }, __props.search, {
2250
2258
  onSearch,
2251
2259
  key: "select-search"
2252
2260
  }), null, 16)) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(itemsRef.value, item => {
2253
- return vue.openBlock(), vue.createBlock(_sfc_main$g, {
2261
+ return vue.openBlock(), vue.createBlock(_sfc_main$h, {
2254
2262
  key: vue.unref(context).getKey(item),
2255
2263
  multiple: __props.multiple,
2256
2264
  item,
@@ -2259,7 +2267,7 @@
2259
2267
  onEnter: onEnterSelectNode,
2260
2268
  onClick: onClickSelectNode
2261
2269
  }, null, 8, ["multiple", "item", "context"]);
2262
- }), 128)), itemsRef.value.length == 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$h, {
2270
+ }), 128)), itemsRef.value.length == 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
2263
2271
  key: 1,
2264
2272
  message: "无结果"
2265
2273
  })) : vue.createCommentVNode("", true), showClearButtonRef.value ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -2276,15 +2284,15 @@
2276
2284
  class: "select-result"
2277
2285
  };
2278
2286
  const _hoisted_2$3 = ["title", "textContent"];
2279
- const _hoisted_3$2 = ["textContent"];
2280
- const _hoisted_4$2 = {
2287
+ const _hoisted_3$3 = ["textContent"];
2288
+ const _hoisted_4$3 = {
2281
2289
  key: 1,
2282
2290
  class: "placeholder"
2283
2291
  };
2284
2292
  onAppCreated((app, type) => {
2285
- type == "popup" && app.component("SelectPopup", _sfc_main$f);
2293
+ type == "popup" && app.component("SelectPopup", _sfc_main$g);
2286
2294
  });
2287
- var _sfc_main$e = vue.defineComponent({
2295
+ var _sfc_main$f = vue.defineComponent({
2288
2296
  ...{
2289
2297
  name: "Select",
2290
2298
  inheritAttrs: true
@@ -2424,7 +2432,7 @@
2424
2432
  key: 1,
2425
2433
  class: "placeholder",
2426
2434
  textContent: vue.toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
2427
- }, null, 8, _hoisted_3$2)), __props.readonly != true ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
2435
+ }, null, 8, _hoisted_3$3)), __props.readonly != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
2428
2436
  key: 2,
2429
2437
  type: "arrow",
2430
2438
  size: 24,
@@ -2432,12 +2440,12 @@
2432
2440
  style: {
2433
2441
  "transform": "rotate(90deg)"
2434
2442
  }
2435
- })) : vue.createCommentVNode("", true)], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, "暂无可选项"))], 2);
2443
+ })) : vue.createCommentVNode("", true)], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, "暂无可选项"))], 2);
2436
2444
  };
2437
2445
  }
2438
2446
  });
2439
2447
 
2440
- var _sfc_main$d = vue.defineComponent({
2448
+ var _sfc_main$e = vue.defineComponent({
2441
2449
  ...{
2442
2450
  name: "Switch",
2443
2451
  inheritAttrs: true
@@ -2487,7 +2495,7 @@
2487
2495
  });
2488
2496
 
2489
2497
  const _hoisted_1$6 = ["readonly", "placeholder", "rows"];
2490
- var _sfc_main$c = vue.defineComponent({
2498
+ var _sfc_main$d = vue.defineComponent({
2491
2499
  ...{
2492
2500
  name: "Textarea"
2493
2501
  },
@@ -2556,16 +2564,16 @@
2556
2564
  class: "fold-header"
2557
2565
  };
2558
2566
  const _hoisted_2$2 = ["textContent"];
2559
- const _hoisted_3$1 = ["textContent"];
2560
- const _hoisted_4$1 = {
2567
+ const _hoisted_3$2 = ["textContent"];
2568
+ const _hoisted_4$2 = {
2561
2569
  key: 1,
2562
2570
  class: "status"
2563
2571
  };
2564
- const _hoisted_5 = {
2572
+ const _hoisted_5$1 = {
2565
2573
  class: "fold-body",
2566
2574
  ref: "foldBody"
2567
2575
  };
2568
- var _sfc_main$b = vue.defineComponent({
2576
+ var _sfc_main$c = vue.defineComponent({
2569
2577
  ...{
2570
2578
  name: "Fold",
2571
2579
  inheritAttrs: true
@@ -2642,16 +2650,16 @@
2642
2650
  key: 0,
2643
2651
  class: "subtitle ellipsis",
2644
2652
  textContent: vue.toDisplayString(__props.subtitle)
2645
- }, null, 8, _hoisted_3$1)) : vue.createCommentVNode("", true), __props.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [vue.createVNode(_sfc_main$w, {
2653
+ }, null, 8, _hoisted_3$2)) : vue.createCommentVNode("", true), __props.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [vue.createVNode(_sfc_main$x, {
2646
2654
  type: "arrow",
2647
2655
  title: statusModel.value == "expand" ? "收起" : "展开",
2648
2656
  onClick: onStatusClick
2649
- }, null, 8, ["title"])])) : vue.createCommentVNode("", true)])]), vue.createElementVNode("div", _hoisted_5, [vue.renderSlot(_ctx.$slots, "default")], 512)], 2);
2657
+ }, null, 8, ["title"])])) : vue.createCommentVNode("", true)])]), vue.createElementVNode("div", _hoisted_5$1, [vue.renderSlot(_ctx.$slots, "default")], 512)], 2);
2650
2658
  };
2651
2659
  }
2652
2660
  });
2653
2661
 
2654
- var _sfc_main$a = vue.defineComponent({
2662
+ var _sfc_main$b = vue.defineComponent({
2655
2663
  ...{
2656
2664
  name: "Scroll",
2657
2665
  inheritAttrs: true
@@ -2663,7 +2671,8 @@
2663
2671
  },
2664
2672
  scrollY: {
2665
2673
  type: Boolean
2666
- }
2674
+ },
2675
+ barSize: {}
2667
2676
  },
2668
2677
  emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
2669
2678
  setup(__props, _ref) {
@@ -2680,10 +2689,27 @@
2680
2689
  const {
2681
2690
  onInterval
2682
2691
  } = snail_core.useTimer();
2683
- const classRef = vue.computed(() => ({
2684
- "scroll-x": props.scrollX == true,
2685
- "scroll-y": props.scrollY == true
2686
- }));
2692
+ const styleRef = vue.computed(() => {
2693
+ const style = Object.create(null);
2694
+ (props.scrollX || props.scrollY) && (style["--scroll-overflow"] = `${props.scrollX == true ? "auto" : "hidden"} ${props.scrollY == true ? "auto" : "hidden"}`);
2695
+ if (props.barSize) {
2696
+ switch (props.barSize) {
2697
+ case "normal":
2698
+ style["--scroll-bar-size"] = "10px";
2699
+ break;
2700
+ case "small":
2701
+ style["--scroll-bar-size"] = "6px";
2702
+ break;
2703
+ case "mini":
2704
+ style["--scroll-bar-size"] = "4px";
2705
+ break;
2706
+ case "none":
2707
+ style["--scroll-bar-size"] = "0";
2708
+ break;
2709
+ }
2710
+ }
2711
+ return style;
2712
+ });
2687
2713
  var preStatus = void 0;
2688
2714
  __expose({
2689
2715
  scroll,
@@ -2739,15 +2765,9 @@
2739
2765
  events.top && emits("top");
2740
2766
  events.bottom && emits("bottom");
2741
2767
  if (rootDom.value) {
2742
- rootDom.value.classList.remove("x-bar", "y-bar", "left", "right", "top", "bottom");
2743
- const classes = [];
2744
- status.xbar && classes.push("x-bar");
2745
- status.ybar && classes.push("y-bar");
2746
- status.left && classes.push("left");
2747
- status.right && classes.push("right");
2748
- status.top && classes.push("top");
2749
- status.bottom && classes.push("bottom");
2750
- classes.length && rootDom.value.classList.add(...classes);
2768
+ rootDom.value.classList.remove("x-bar", "y-bar");
2769
+ status.xbar && rootDom.value.classList.add("x-bar");
2770
+ status.ybar && rootDom.value.classList.add("y-bar");
2751
2771
  }
2752
2772
  }
2753
2773
  vue.onMounted(() => {
@@ -2760,43 +2780,101 @@
2760
2780
  });
2761
2781
  return (_ctx, _cache) => {
2762
2782
  return vue.openBlock(), vue.createElementBlock("div", {
2763
- class: vue.normalizeClass(["snail-scroll", classRef.value]),
2783
+ class: "snail-scroll",
2764
2784
  ref: "scroll-root",
2785
+ style: vue.normalizeStyle(styleRef.value),
2765
2786
  onScroll: refreshScrollInfo
2766
- }, [vue.renderSlot(_ctx.$slots, "default")], 34);
2787
+ }, [vue.renderSlot(_ctx.$slots, "default")], 36);
2767
2788
  };
2768
2789
  }
2769
2790
  });
2770
2791
 
2771
- const _hoisted_1$4 = {
2772
- key: 0,
2773
- class: "layout-start"
2774
- };
2775
- const _hoisted_2$1 = {
2776
- key: 1,
2777
- class: "layout-end"
2778
- };
2779
- var _sfc_main$9 = vue.defineComponent({
2792
+ var _sfc_main$a = vue.defineComponent({
2780
2793
  __name: "layout",
2781
2794
  props: {
2782
2795
  mode: {},
2783
- scroll: {}
2796
+ default: {},
2797
+ left: {},
2798
+ right: {},
2799
+ top: {},
2800
+ bottom: {}
2784
2801
  },
2785
2802
  setup(__props) {
2803
+ const props = __props;
2804
+ const areaMap = vue.computed(() => {
2805
+ const map = Object.create(null);
2806
+ map.default = {
2807
+ scrollable: props.default && props.default.scroll != void 0,
2808
+ class: "main-area",
2809
+ style: void 0
2810
+ };
2811
+ if (props.mode == "vertical") {
2812
+ map.top = {
2813
+ scrollable: props.top && props.top.scroll != void 0,
2814
+ class: "top-area",
2815
+ style: buildHeightStyle(props.top)
2816
+ };
2817
+ map.bottom = {
2818
+ scrollable: props.bottom && props.bottom.scroll != void 0,
2819
+ class: "bottom-area",
2820
+ style: buildHeightStyle(props.bottom)
2821
+ };
2822
+ } else {
2823
+ map.left = {
2824
+ scrollable: props.left && props.left.scroll != void 0,
2825
+ class: "left-area",
2826
+ style: buildWidthStyle(props.left)
2827
+ };
2828
+ map.right = {
2829
+ scrollable: props.right && props.right.scroll != void 0,
2830
+ class: "right-area",
2831
+ style: buildWidthStyle(props.right)
2832
+ };
2833
+ }
2834
+ return map;
2835
+ });
2836
+ function buildWidthStyle(style) {
2837
+ return style ? snail_view.css.buildStyle({
2838
+ minWidth: style.minWidth,
2839
+ width: style.width,
2840
+ maxWidth: style.maxWidth
2841
+ }) : void 0;
2842
+ }
2843
+ function buildHeightStyle(style) {
2844
+ return style ? snail_view.css.buildStyle({
2845
+ minHeight: style.minHeight,
2846
+ height: style.height,
2847
+ maxHeight: style.maxHeight
2848
+ }) : void 0;
2849
+ }
2786
2850
  return (_ctx, _cache) => {
2787
2851
  return vue.openBlock(), vue.createElementBlock("div", {
2788
2852
  class: vue.normalizeClass(["snail-layout", __props.mode])
2789
- }, [_ctx.$slots.start ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [vue.renderSlot(_ctx.$slots, "start")])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$a, vue.mergeProps({
2790
- class: "layout-body"
2791
- }, __props.scroll), {
2792
- default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]),
2793
- _: 3
2794
- }, 16), _ctx.$slots.end ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [vue.renderSlot(_ctx.$slots, "end")])) : vue.createCommentVNode("", true)], 2);
2853
+ }, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["top", "left", "default", "right", "bottom"], item => {
2854
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2855
+ key: item
2856
+ }, [areaMap.value[item] && _ctx.$slots[item] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2857
+ key: 0
2858
+ }, [areaMap.value[item].scrollable ? (vue.openBlock(), vue.createBlock(_sfc_main$b, vue.mergeProps({
2859
+ key: 0,
2860
+ class: areaMap.value[item].class,
2861
+ style: areaMap.value[item].style
2862
+ }, {
2863
+ ref_for: true
2864
+ }, props[item].scroll), {
2865
+ default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, item)]),
2866
+ _: 2
2867
+ }, 1040, ["class", "style"])) : (vue.openBlock(), vue.createElementBlock("div", {
2868
+ key: 1,
2869
+ class: vue.normalizeClass(areaMap.value[item].class),
2870
+ style: vue.normalizeStyle(areaMap.value[item].style)
2871
+ }, [vue.renderSlot(_ctx.$slots, item)], 6))], 64)) : vue.createCommentVNode("", true)], 64);
2872
+ }), 64))], 2);
2795
2873
  };
2796
2874
  }
2797
2875
  });
2798
2876
 
2799
- var _sfc_main$8 = vue.defineComponent({
2877
+ var _sfc_main$9 = vue.defineComponent({
2800
2878
  ...{
2801
2879
  name: "Sort",
2802
2880
  inheritAttrs: true
@@ -2897,10 +2975,10 @@
2897
2975
  }
2898
2976
  });
2899
2977
 
2900
- const _hoisted_1$3 = {
2978
+ const _hoisted_1$4 = {
2901
2979
  class: "table-body"
2902
2980
  };
2903
- var _sfc_main$7 = vue.defineComponent({
2981
+ var _sfc_main$8 = vue.defineComponent({
2904
2982
  ...{
2905
2983
  name: "Table",
2906
2984
  inheritAttrs: true
@@ -2913,6 +2991,7 @@
2913
2991
  scrollY: {
2914
2992
  type: Boolean
2915
2993
  },
2994
+ barSize: {},
2916
2995
  border: {
2917
2996
  type: Boolean
2918
2997
  },
@@ -2924,7 +3003,7 @@
2924
3003
  const hStyleRef = vue.computed(() => snail_view.css.buildStyle(props.headerStyle));
2925
3004
  const fStyleRef = vue.computed(() => snail_view.css.buildStyle(props.footerStyle));
2926
3005
  return (_ctx, _cache) => {
2927
- return vue.openBlock(), vue.createBlock(_sfc_main$a, {
3006
+ return vue.openBlock(), vue.createBlock(_sfc_main$b, {
2928
3007
  class: vue.normalizeClass(["snail-table", {
2929
3008
  "start-border": __props.border == true
2930
3009
  }]),
@@ -2934,7 +3013,7 @@
2934
3013
  default: vue.withCtx(() => [vue.createElementVNode("div", {
2935
3014
  class: "table-header",
2936
3015
  style: vue.normalizeStyle(hStyleRef.value)
2937
- }, [vue.renderSlot(_ctx.$slots, "header")], 4), vue.createElementVNode("div", _hoisted_1$3, [vue.renderSlot(_ctx.$slots, "default")]), vue.createElementVNode("div", {
3016
+ }, [vue.renderSlot(_ctx.$slots, "header")], 4), vue.createElementVNode("div", _hoisted_1$4, [vue.renderSlot(_ctx.$slots, "default")]), vue.createElementVNode("div", {
2938
3017
  class: "table-footer",
2939
3018
  style: vue.normalizeStyle(fStyleRef.value)
2940
3019
  }, [vue.renderSlot(_ctx.$slots, "footer")], 4)]),
@@ -2944,7 +3023,7 @@
2944
3023
  }
2945
3024
  });
2946
3025
 
2947
- var _sfc_main$6 = vue.defineComponent({
3026
+ var _sfc_main$7 = vue.defineComponent({
2948
3027
  ...{
2949
3028
  name: "TableRow",
2950
3029
  inheritAttrs: true
@@ -2967,7 +3046,7 @@
2967
3046
  }
2968
3047
  });
2969
3048
 
2970
- var _sfc_main$5 = vue.defineComponent({
3049
+ var _sfc_main$6 = vue.defineComponent({
2971
3050
  ...{
2972
3051
  name: "TableCol",
2973
3052
  inheritAttrs: true
@@ -3013,14 +3092,15 @@
3013
3092
  }
3014
3093
  });
3015
3094
 
3016
- var _sfc_main$4 = vue.defineComponent({
3095
+ var _sfc_main$5 = vue.defineComponent({
3017
3096
  __name: "transitions",
3018
3097
  props: {
3019
- customClass: {},
3020
- effect: {},
3021
3098
  group: {
3022
3099
  type: Boolean
3023
- }
3100
+ },
3101
+ duration: {},
3102
+ customClass: {},
3103
+ effect: {}
3024
3104
  },
3025
3105
  setup(__props) {
3026
3106
  const props = __props;
@@ -3031,11 +3111,13 @@
3031
3111
  } else {
3032
3112
  array.push(props.effect || "fade");
3033
3113
  }
3114
+ console.log(array);
3034
3115
  return array.join(" ");
3035
3116
  });
3036
3117
  return (_ctx, _cache) => {
3037
3118
  return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.group ? vue.TransitionGroup : vue.Transition), vue.mergeProps(_ctx.$attrs, {
3038
3119
  appear: "",
3120
+ duration: __props.duration,
3039
3121
  "enter-active-class": `${classNames.value} enter-active`,
3040
3122
  "enter-from-class": `${classNames.value} enter-from`,
3041
3123
  "enter-to-class": `${classNames.value} enter-to`,
@@ -3045,25 +3127,25 @@
3045
3127
  }), {
3046
3128
  default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]),
3047
3129
  _: 3
3048
- }, 16, ["enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
3130
+ }, 16, ["duration", "enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
3049
3131
  };
3050
3132
  }
3051
3133
  });
3052
3134
 
3053
- const _hoisted_1$2 = {
3135
+ const _hoisted_1$3 = {
3054
3136
  key: 0,
3055
3137
  class: "node-fold"
3056
3138
  };
3057
- const _hoisted_2 = ["title", "textContent"];
3058
- const _hoisted_3 = {
3139
+ const _hoisted_2$1 = ["title", "textContent"];
3140
+ const _hoisted_3$1 = {
3059
3141
  class: "node-slot ellipsis"
3060
3142
  };
3061
- const _hoisted_4 = {
3143
+ const _hoisted_4$1 = {
3062
3144
  key: 1,
3063
3145
  class: "snail-tree-children hidden",
3064
3146
  ref: "children"
3065
3147
  };
3066
- var _sfc_main$3 = vue.defineComponent({
3148
+ var _sfc_main$4 = vue.defineComponent({
3067
3149
  ...{
3068
3150
  name: "TreeNode",
3069
3151
  inheritAttrs: true
@@ -3181,7 +3263,7 @@
3181
3263
  key: 1
3182
3264
  }, [_cache[4] || (_cache[4] = vue.createElementVNode("div", {
3183
3265
  class: "indent"
3184
- }, null, -1)), __props.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [showChildrenRef.value ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
3266
+ }, null, -1)), __props.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [showChildrenRef.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
3185
3267
  key: 0,
3186
3268
  class: vue.normalizeClass(statusRef.value),
3187
3269
  type: "custom",
@@ -3193,7 +3275,7 @@
3193
3275
  class: "node-text ellipsis",
3194
3276
  title: __props.node.text,
3195
3277
  textContent: vue.toDisplayString(__props.node.text)
3196
- }, null, 8, _hoisted_2), vue.createElementVNode("div", _hoisted_3, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))))])], 64))], 34)) : vue.createCommentVNode("", true), showRef.value && showChildrenRef.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.node.children, child => {
3278
+ }, null, 8, _hoisted_2$1), vue.createElementVNode("div", _hoisted_3$1, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))))])], 64))], 34)) : vue.createCommentVNode("", true), showRef.value && showChildrenRef.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.node.children, child => {
3197
3279
  return vue.openBlock(), vue.createBlock(_component_TreeNode, {
3198
3280
  key: __props.context.getKey(child),
3199
3281
  node: child,
@@ -3213,10 +3295,10 @@
3213
3295
  }
3214
3296
  });
3215
3297
 
3216
- const _hoisted_1$1 = {
3298
+ const _hoisted_1$2 = {
3217
3299
  class: "snail-tree"
3218
3300
  };
3219
- var _sfc_main$2 = vue.defineComponent({
3301
+ var _sfc_main$3 = vue.defineComponent({
3220
3302
  ...{
3221
3303
  name: "Tree",
3222
3304
  inheritAttrs: true
@@ -3250,15 +3332,15 @@
3250
3332
  emits("click", node, parents);
3251
3333
  }
3252
3334
  return (_ctx, _cache) => {
3253
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$p, vue.mergeProps({
3335
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$q, vue.mergeProps({
3254
3336
  key: 0
3255
3337
  }, __props.search, {
3256
3338
  onSearch
3257
- }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$a, {
3339
+ }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$b, {
3258
3340
  "scroll-y": true
3259
3341
  }, {
3260
3342
  default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.nodes || [], node => {
3261
- return vue.openBlock(), vue.createBlock(_sfc_main$3, {
3343
+ return vue.openBlock(), vue.createBlock(_sfc_main$4, {
3262
3344
  key: vue.unref(context).getKey(node),
3263
3345
  node,
3264
3346
  parent: void 0,
@@ -3279,7 +3361,7 @@
3279
3361
  }
3280
3362
  });
3281
3363
 
3282
- var _sfc_main$1 = vue.defineComponent({
3364
+ var _sfc_main$2 = vue.defineComponent({
3283
3365
  __name: "wrapper",
3284
3366
  props: {
3285
3367
  readonly: {
@@ -3301,14 +3383,14 @@
3301
3383
  return (_ctx, _cache) => {
3302
3384
  return vue.openBlock(), vue.createElementBlock("div", {
3303
3385
  class: vue.normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
3304
- }, [__props.header && __props.header.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$s, vue.mergeProps({
3386
+ }, [__props.header && __props.header.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, vue.mergeProps({
3305
3387
  key: 0
3306
3388
  }, __props.header || {
3307
3389
  useTo: "dialog",
3308
3390
  title: "对话框"
3309
3391
  }, {
3310
3392
  onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
3311
- }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$a, vue.mergeProps({
3393
+ }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$b, vue.mergeProps({
3312
3394
  class: "wrapper-body"
3313
3395
  }, __props.content || {
3314
3396
  scrollX: false,
@@ -3316,7 +3398,7 @@
3316
3398
  }), {
3317
3399
  default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]),
3318
3400
  _: 3
3319
- }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, vue.mergeProps({
3401
+ }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$u, vue.mergeProps({
3320
3402
  key: 1
3321
3403
  }, __props.footer || {}, {
3322
3404
  onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
@@ -3330,7 +3412,7 @@
3330
3412
  snail_core.mustObject(options, "options");
3331
3413
  target instanceof HTMLElement || snail_core.throwError("target must be a HTMLElement");
3332
3414
  target.classList.add("snail-app");
3333
- const app = vue.createApp(_sfc_main$m, options);
3415
+ const app = vue.createApp(_sfc_main$n, options);
3334
3416
  triggerAppCreated(app);
3335
3417
  app.mount(target);
3336
3418
  const scope = snail_core.useScope().onDestroy(() => app.unmount());
@@ -3338,6 +3420,252 @@
3338
3420
  return scope;
3339
3421
  }
3340
3422
 
3423
+ const _hoisted_1$1 = {
3424
+ class: "tz-item",
3425
+ ref: "hour-items"
3426
+ };
3427
+ const _hoisted_2 = ["textContent", "onClick"];
3428
+ const _hoisted_3 = {
3429
+ class: "tz-item",
3430
+ ref: "minute-items"
3431
+ };
3432
+ const _hoisted_4 = ["textContent", "onClick"];
3433
+ const _hoisted_5 = {
3434
+ key: 0,
3435
+ class: "tz-item",
3436
+ ref: "second-items"
3437
+ };
3438
+ const _hoisted_6 = ["textContent", "onClick"];
3439
+ var _sfc_main$1 = vue.defineComponent({
3440
+ __name: "time-pc",
3441
+ props: {
3442
+ value: {},
3443
+ initialDisabled: {
3444
+ type: Boolean
3445
+ },
3446
+ nowDisabled: {
3447
+ type: Boolean
3448
+ },
3449
+ manager: {},
3450
+ format: {},
3451
+ min: {},
3452
+ max: {},
3453
+ inPopup: {},
3454
+ closePopup: {
3455
+ type: Function
3456
+ },
3457
+ popupStatus: {},
3458
+ target: {},
3459
+ followX: {},
3460
+ followY: {},
3461
+ pinned: {}
3462
+ },
3463
+ emits: ["clear", "confirm"],
3464
+ setup(__props, _ref) {
3465
+ let {
3466
+ emit: __emit
3467
+ } = _ref;
3468
+ const props = __props;
3469
+ const emits = __emit;
3470
+ const tm = props.manager || snail_core.useTime({
3471
+ format: props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss",
3472
+ min: snail_core.parseTime(props.min),
3473
+ max: snail_core.parseTime(props.max)
3474
+ });
3475
+ const {
3476
+ toast
3477
+ } = usePopup();
3478
+ const {
3479
+ inPopup,
3480
+ closePopup
3481
+ } = props;
3482
+ const secondDisabled = tm.format == "HH:mm";
3483
+ const tvRef = vue.ref();
3484
+ const hItemsDom = vue.useTemplateRef("hour-items");
3485
+ const mItemsDom = vue.useTemplateRef("minute-items");
3486
+ const sItemsDom = vue.useTemplateRef("second-items");
3487
+ function getTimeClass(type, value) {
3488
+ switch (type) {
3489
+ case "hour":
3490
+ return {
3491
+ active: tvRef.value.hour == value,
3492
+ disabled: tm.validateHH(value) == false
3493
+ };
3494
+ case "minute":
3495
+ return {
3496
+ active: tvRef.value.minute == value,
3497
+ disabled: tm.validateHHmm(tvRef.value.hour, value) == false
3498
+ };
3499
+ case "second":
3500
+ return {
3501
+ active: tvRef.value.second == value,
3502
+ disabled: tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value) == false
3503
+ };
3504
+ }
3505
+ }
3506
+ function scrollIntoView(items) {
3507
+ let activeIndex = void 0,
3508
+ firstValidIndex;
3509
+ for (var index = 0; index < (items ? items.children.length : 0); index++) {
3510
+ const ele = items.children[index];
3511
+ if (ele.classList.contains("disabled") == true) {
3512
+ continue;
3513
+ }
3514
+ if (firstValidIndex == void 0) {
3515
+ firstValidIndex = index;
3516
+ }
3517
+ if (ele.classList.contains("active") == true) {
3518
+ activeIndex = index;
3519
+ break;
3520
+ }
3521
+ }
3522
+ let showIndex = activeIndex;
3523
+ if (activeIndex == void 0) {
3524
+ if (firstValidIndex != void 0) {
3525
+ showIndex = firstValidIndex;
3526
+ }
3527
+ }
3528
+ showIndex != void 0 && items.children[showIndex].scrollIntoView({
3529
+ behavior: "smooth",
3530
+ block: "center"
3531
+ });
3532
+ }
3533
+ async function onTimeClick(type, value) {
3534
+ switch (type) {
3535
+ case "hour":
3536
+ if (tm.validateHH(value)) {
3537
+ tvRef.value.hour = value;
3538
+ await vue.nextTick();
3539
+ scrollIntoView(mItemsDom.value);
3540
+ }
3541
+ break;
3542
+ case "minute":
3543
+ if (tm.validateHHmm(tvRef.value.hour, value)) {
3544
+ tvRef.value.minute = value;
3545
+ await vue.nextTick();
3546
+ scrollIntoView(sItemsDom.value);
3547
+ }
3548
+ break;
3549
+ case "second":
3550
+ if (tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value)) {
3551
+ tvRef.value.second = value;
3552
+ }
3553
+ break;
3554
+ }
3555
+ }
3556
+ async function onNow() {
3557
+ tvRef.value = snail_core.getTimeNow();
3558
+ if (tm.validate(tvRef.value)) {
3559
+ await vue.nextTick();
3560
+ scrollIntoView(hItemsDom.value);
3561
+ scrollIntoView(mItemsDom.value);
3562
+ scrollIntoView(sItemsDom.value);
3563
+ }
3564
+ }
3565
+ function onConfirm() {
3566
+ tvRef.value = tm.correct(tvRef.value) || Object.create(null);
3567
+ if (tvRef.value == void 0 || tvRef.value.hour == void 0) {
3568
+ return toast("error", "请选选择时间");
3569
+ }
3570
+ if (secondDisabled != true && tvRef.value.minute == void 0) {
3571
+ return toast("error", "请选选择时间");
3572
+ }
3573
+ const value = tm.toString(tvRef.value);
3574
+ emits("confirm", value);
3575
+ inPopup && closePopup(value);
3576
+ }
3577
+ {
3578
+ props.value && (tvRef.value = tm.parse(props.value));
3579
+ tvRef.value || props.initialDisabled || (tvRef.value = tm.correct(snail_core.getTimeNow()));
3580
+ tvRef.value || (tvRef.value = Object.create(null));
3581
+ }
3582
+ vue.onMounted(async () => {
3583
+ await vue.nextTick();
3584
+ scrollIntoView(hItemsDom.value);
3585
+ scrollIntoView(mItemsDom.value);
3586
+ scrollIntoView(sItemsDom.value);
3587
+ });
3588
+ return (_ctx, _cache) => {
3589
+ return vue.openBlock(), vue.createBlock(_sfc_main$a, {
3590
+ class: vue.normalizeClass(["snail-time-picker pc", {
3591
+ "second-disabled": secondDisabled
3592
+ }]),
3593
+ mode: "vertical"
3594
+ }, {
3595
+ default: vue.withCtx(() => [vue.createVNode(_sfc_main$5, {
3596
+ group: true,
3597
+ effect: "down-up"
3598
+ }, {
3599
+ default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array(24).fill(void 0), (_, index) => {
3600
+ return vue.openBlock(), vue.createElementBlock("div", {
3601
+ class: vue.normalizeClass(["tzi-number", getTimeClass("hour", index)]),
3602
+ textContent: vue.toDisplayString(String(index).padStart(2, "0")),
3603
+ onClick: $event => onTimeClick("hour", index)
3604
+ }, null, 10, _hoisted_2);
3605
+ }), 256))], 512), vue.createElementVNode("div", _hoisted_3, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array(60).fill(void 0), (_, index) => {
3606
+ return vue.openBlock(), vue.createElementBlock("div", {
3607
+ class: vue.normalizeClass(["tzi-number", getTimeClass("minute", index)]),
3608
+ textContent: vue.toDisplayString(String(index).padStart(2, "0")),
3609
+ onClick: $event => onTimeClick("minute", index)
3610
+ }, null, 10, _hoisted_4);
3611
+ }), 256))], 512), secondDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array(60).fill(void 0), (_, index) => {
3612
+ return vue.openBlock(), vue.createElementBlock("div", {
3613
+ class: vue.normalizeClass(["tzi-number", getTimeClass("second", index)]),
3614
+ textContent: vue.toDisplayString(String(index).padStart(2, "0")),
3615
+ onClick: $event => onTimeClick("second", index)
3616
+ }, null, 10, _hoisted_6);
3617
+ }), 256))], 512)) : vue.createCommentVNode("", true)]),
3618
+ bottom: vue.withCtx(() => [vue.createVNode(_sfc_main$y, {
3619
+ type: "link",
3620
+ size: "small",
3621
+ textContent: "清空",
3622
+ onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), vue.unref(inPopup) && vue.unref(closePopup)("")))
3623
+ }), vue.unref(tm).validate(vue.unref(snail_core.getTimeNow)()) ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
3624
+ key: 0,
3625
+ type: "link",
3626
+ size: "small",
3627
+ textContent: "现在",
3628
+ onClick: onNow
3629
+ })) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$y, {
3630
+ type: "link",
3631
+ size: "small",
3632
+ textContent: "确定",
3633
+ onClick: onConfirm
3634
+ })]),
3635
+ _: 1
3636
+ })]),
3637
+ _: 1
3638
+ }, 8, ["class"]);
3639
+ };
3640
+ }
3641
+ });
3642
+
3643
+ function usePicker() {
3644
+ const popup = usePopup();
3645
+ function showTime(target, options) {
3646
+ options = {
3647
+ ...options
3648
+ };
3649
+ delete options["manager"];
3650
+ return popup.follow(target, {
3651
+ component: _sfc_main$1,
3652
+ followX: ["center"],
3653
+ spaceClient: 10,
3654
+ spaceY: 2,
3655
+ spaceX: 2,
3656
+ closeOnMask: true,
3657
+ props: options
3658
+ });
3659
+ }
3660
+ {
3661
+ const manager = Object.freeze(snail_core.mountScope({
3662
+ showTime
3663
+ }, "IPickerManager"));
3664
+ manager.onDestroy(popup.destroy);
3665
+ return manager;
3666
+ }
3667
+ }
3668
+
3341
3669
  const _hoisted_1 = ["textContent"];
3342
3670
  var _sfc_main = vue.defineComponent({
3343
3671
  ...{
@@ -3423,12 +3751,12 @@
3423
3751
  onTouchstart: onStartDrag,
3424
3752
  onTouchmove: onDragMove,
3425
3753
  onTouchend: onDragEnd
3426
- }, [dragInfoRef.value.status == "success" ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
3754
+ }, [dragInfoRef.value.status == "success" ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
3427
3755
  key: 0,
3428
3756
  type: "success",
3429
3757
  size: 20,
3430
3758
  color: "white"
3431
- })) : (vue.openBlock(), vue.createBlock(_sfc_main$w, {
3759
+ })) : (vue.openBlock(), vue.createBlock(_sfc_main$x, {
3432
3760
  key: 1,
3433
3761
  type: "custom",
3434
3762
  size: 20,
@@ -3440,32 +3768,32 @@
3440
3768
  });
3441
3769
 
3442
3770
  const components = {
3443
- Button: _sfc_main$x,
3444
- Choose: _sfc_main$v,
3445
- DatePicker: _sfc_main$u,
3446
- Footer: _sfc_main$t,
3447
- Header: _sfc_main$s,
3448
- Icon: _sfc_main$w,
3449
- Input: _sfc_main$r,
3450
- Number: _sfc_main$q,
3451
- Search: _sfc_main$p,
3452
- Select: _sfc_main$e,
3453
- Switch: _sfc_main$d,
3454
- Textarea: _sfc_main$c,
3455
- Dynamic: _sfc_main$m,
3456
- Fold: _sfc_main$b,
3457
- Layout: _sfc_main$9,
3458
- Scroll: _sfc_main$a,
3459
- Sort: _sfc_main$8,
3460
- Table: _sfc_main$7,
3461
- TableRow: _sfc_main$6,
3462
- TableCol: _sfc_main$5,
3463
- Transitions: _sfc_main$4,
3464
- Tree: _sfc_main$2,
3465
- Wrapper: _sfc_main$1,
3771
+ Button: _sfc_main$y,
3772
+ Choose: _sfc_main$w,
3773
+ DatePicker: _sfc_main$v,
3774
+ Footer: _sfc_main$u,
3775
+ Header: _sfc_main$t,
3776
+ Icon: _sfc_main$x,
3777
+ Input: _sfc_main$s,
3778
+ Number: _sfc_main$r,
3779
+ Search: _sfc_main$q,
3780
+ Select: _sfc_main$f,
3781
+ Switch: _sfc_main$e,
3782
+ Textarea: _sfc_main$d,
3783
+ Dynamic: _sfc_main$n,
3784
+ Fold: _sfc_main$c,
3785
+ Layout: _sfc_main$a,
3786
+ Scroll: _sfc_main$b,
3787
+ Sort: _sfc_main$9,
3788
+ Table: _sfc_main$8,
3789
+ TableRow: _sfc_main$7,
3790
+ TableCol: _sfc_main$6,
3791
+ Transitions: _sfc_main$5,
3792
+ Tree: _sfc_main$3,
3793
+ Wrapper: _sfc_main$2,
3466
3794
  DragVerify: _sfc_main,
3467
- Empty: _sfc_main$h,
3468
- Loading: _sfc_main$n
3795
+ Empty: _sfc_main$i,
3796
+ Loading: _sfc_main$o
3469
3797
  };
3470
3798
 
3471
3799
  snail_core.onMountScope(scope => {
@@ -3477,6 +3805,7 @@
3477
3805
  exports.mount = mount;
3478
3806
  exports.onAppCreated = onAppCreated;
3479
3807
  exports.triggerAppCreated = triggerAppCreated;
3808
+ exports.usePicker = usePicker;
3480
3809
  exports.usePopup = usePopup;
3481
3810
  exports.useReactive = useReactive;
3482
3811
  exports.useTreeContext = useTreeContext;