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