snail.vue 2.0.9 → 2.0.10

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';
4
- import { link, css, useObserver, useAnimation } from 'snail.view';
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
+ import { css, link, useObserver, useAnimation } from 'snail.view';
5
5
 
6
- const _hoisted_1$j = ["title"];
7
- var _sfc_main$x = defineComponent({
6
+ const _hoisted_1$k = ["title"];
7
+ var _sfc_main$y = defineComponent({
8
8
  ...{
9
9
  name: "Button",
10
10
  inheritAttrs: true
@@ -20,15 +20,11 @@ var _sfc_main$x = defineComponent({
20
20
  return openBlock(), createElementBlock("div", {
21
21
  class: normalizeClass(["snail-button", [__props.size, __props.type]]),
22
22
  title: __props.title
23
- }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮", -1))])], 10, _hoisted_1$j);
23
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮", -1))])], 10, _hoisted_1$k);
24
24
  };
25
25
  }
26
26
  });
27
27
 
28
- var addLink = href => setTimeout(link.register, 0, href);
29
-
30
- addLink("/styles/snail.vue.vue.css");
31
-
32
28
  function getSvgDraw(iconType, draw) {
33
29
  switch (iconType) {
34
30
  case "success":
@@ -67,10 +63,10 @@ function getSvgDraw(iconType, draw) {
67
63
  }
68
64
  }
69
65
 
70
- const _hoisted_1$i = ["width", "height"];
71
- const _hoisted_2$b = ["textContent"];
72
- const _hoisted_3$8 = ["fill", "stroke", "stroke-width", "d"];
73
- var _sfc_main$w = defineComponent({
66
+ const _hoisted_1$j = ["width", "height"];
67
+ const _hoisted_2$c = ["textContent"];
68
+ const _hoisted_3$9 = ["fill", "stroke", "stroke-width", "d"];
69
+ var _sfc_main$x = defineComponent({
74
70
  ...{
75
71
  name: "Icon",
76
72
  inheritAttrs: true
@@ -100,23 +96,23 @@ var _sfc_main$w = defineComponent({
100
96
  onMouseleave: _cache[1] || (_cache[1] = $event => isMouseEnterRef.value = false)
101
97
  }, [createElementVNode("title", {
102
98
  textContent: toDisplayString(__props.title || "")
103
- }, null, 8, _hoisted_2$b), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSvgDraw)(__props.type, __props.draw), d => {
99
+ }, null, 8, _hoisted_2$c), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSvgDraw)(__props.type, __props.draw), d => {
104
100
  return openBlock(), createElementBlock("path", {
105
101
  fill: isMouseEnterRef.value ? __props.hoverColor || __props.color : __props.color,
106
102
  stroke: __props.stroke,
107
103
  "stroke-width": __props.strokeWidth,
108
104
  d
109
- }, null, 8, _hoisted_3$8);
110
- }), 256))], 46, _hoisted_1$i);
105
+ }, null, 8, _hoisted_3$9);
106
+ }), 256))], 46, _hoisted_1$j);
111
107
  };
112
108
  }
113
109
  });
114
110
 
115
- const _hoisted_1$h = ["title", "onClick"];
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({
111
+ const _hoisted_1$i = ["title", "onClick"];
112
+ const _hoisted_2$b = ["type", "checked"];
113
+ const _hoisted_3$8 = ["textContent"];
114
+ const _hoisted_4$6 = ["textContent"];
115
+ var _sfc_main$w = defineComponent({
120
116
  ...{
121
117
  name: "Choose",
122
118
  inheritAttrs: true
@@ -192,10 +188,10 @@ var _sfc_main$v = defineComponent({
192
188
  key: 0,
193
189
  type: unref(type),
194
190
  checked: node.selected
195
- }, null, 8, _hoisted_2$a)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
191
+ }, null, 8, _hoisted_2$b)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
196
192
  key: 1,
197
193
  class: normalizeClass(["status", [node.selected ? "selected" : ""]])
198
- }, [node.selected ? (openBlock(), createBlock(_sfc_main$w, {
194
+ }, [node.selected ? (openBlock(), createBlock(_sfc_main$x, {
199
195
  key: 0,
200
196
  type: "success",
201
197
  size: 12,
@@ -204,18 +200,18 @@ var _sfc_main$v = defineComponent({
204
200
  key: 2,
205
201
  class: "item-text",
206
202
  textContent: toDisplayString(node.item.text)
207
- }, null, 8, _hoisted_3$7)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
203
+ }, null, 8, _hoisted_3$8)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
208
204
  key: 3,
209
205
  class: "item-des",
210
206
  textContent: toDisplayString(node.item.description)
211
- }, null, 8, _hoisted_4$5)) : createCommentVNode("", true)], 14, _hoisted_1$h);
207
+ }, null, 8, _hoisted_4$6)) : createCommentVNode("", true)], 14, _hoisted_1$i);
212
208
  }), 128))], 2);
213
209
  };
214
210
  }
215
211
  });
216
212
 
217
- const _hoisted_1$g = ["id"];
218
- var _sfc_main$u = defineComponent({
213
+ const _hoisted_1$h = ["id"];
214
+ var _sfc_main$v = defineComponent({
219
215
  __name: "datepicker",
220
216
  props: {
221
217
  type: {},
@@ -366,12 +362,16 @@ var _sfc_main$u = defineComponent({
366
362
  class: "snail-datepicker",
367
363
  id: unref(id),
368
364
  onClick
369
- }, null, 8, _hoisted_1$g);
365
+ }, null, 8, _hoisted_1$h);
370
366
  };
371
367
  }
372
368
  });
373
369
 
374
- var _sfc_main$t = defineComponent({
370
+ var addLink = href => setTimeout(link.register, 0, href);
371
+
372
+ addLink("/styles/snail.vue.vue.css");
373
+
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",
@@ -419,8 +419,8 @@ var _sfc_main$t = defineComponent({
419
419
  }
420
420
  });
421
421
 
422
- const _hoisted_1$f = ["textContent"];
423
- var _sfc_main$s = defineComponent({
422
+ const _hoisted_1$g = ["textContent"];
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$g)) : 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,
@@ -471,18 +471,18 @@ var _sfc_main$s = defineComponent({
471
471
  }
472
472
  });
473
473
 
474
- const _hoisted_1$e = ["textContent"];
475
- const _hoisted_2$9 = {
474
+ const _hoisted_1$f = ["textContent"];
475
+ const _hoisted_2$a = {
476
476
  key: 0,
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$f), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$a)) : 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
  });
@@ -756,20 +756,20 @@ function useFormatter(options) {
756
756
  return formatter;
757
757
  }
758
758
 
759
- const _hoisted_1$d = {
759
+ const _hoisted_1$e = {
760
760
  key: 0,
761
761
  class: "number-prefix"
762
762
  };
763
- const _hoisted_2$8 = ["textContent"];
764
- const _hoisted_3$5 = ["inputmode", "placeholder", "title"];
765
- const _hoisted_4$3 = {
763
+ const _hoisted_2$9 = ["textContent"];
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"];
771
- const _hoisted_7 = ["title", "textContent"];
772
- var _sfc_main$q = defineComponent({
769
+ const _hoisted_5$2 = ["textContent"];
770
+ const _hoisted_6$1 = ["title", "textContent"];
771
+ const _hoisted_7$1 = ["title", "textContent"];
772
+ var _sfc_main$r = defineComponent({
773
773
  __name: "number",
774
774
  props: mergeModels({
775
775
  placeholder: {},
@@ -916,10 +916,10 @@ var _sfc_main$q = defineComponent({
916
916
  "has-prefix": unref(hasPrefix),
917
917
  "has-suffix": unref(hasSuffix)
918
918
  }])
919
- }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [createElementVNode("span", {
919
+ }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$e, [createElementVNode("span", {
920
920
  class: "ellipsis",
921
921
  textContent: toDisplayString(unref(prefix))
922
- }, null, 8, _hoisted_2$8)])) : createCommentVNode("", true), createElementVNode("div", {
922
+ }, null, 8, _hoisted_2$9)])) : createCommentVNode("", true), createElementVNode("div", {
923
923
  class: normalizeClass(["input-panel", unref(controls)])
924
924
  }, [withDirectives(createElementVNode("input", {
925
925
  type: "text",
@@ -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,38 +950,38 @@ 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,
976
976
  textContent: toDisplayString(`千分位:${thousandsTextRef.value || ""}`)
977
- }, null, 8, _hoisted_7)) : createCommentVNode("", true)], 2);
977
+ }, null, 8, _hoisted_7$1)) : createCommentVNode("", true)], 2);
978
978
  };
979
979
  }
980
980
  });
981
981
 
982
- const _hoisted_1$c = ["placeholder", "readonly"];
982
+ const _hoisted_1$d = ["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
@@ -1026,9 +1026,9 @@ var _sfc_main$p = defineComponent({
1026
1026
  readonly: __props.readonly,
1027
1027
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
1028
1028
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
1029
- }, null, 40, _hoisted_1$c), [[vModelText, textModel.value, void 0, {
1029
+ }, null, 40, _hoisted_1$d), [[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,
@@ -1249,11 +1249,11 @@ function deducePosition(strategy, targetStart, targetEnd, contentSize, clientSiz
1249
1249
  }
1250
1250
  }
1251
1251
 
1252
- const _hoisted_1$b = {
1252
+ const _hoisted_1$c = {
1253
1253
  class: "snail-confirm flex-column"
1254
1254
  };
1255
- const _hoisted_2$7 = ["innerHTML"];
1256
- var _sfc_main$o = defineComponent({
1255
+ const _hoisted_2$8 = ["innerHTML"];
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$c, [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$8), 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
@@ -1659,12 +1667,12 @@ var _sfc_main$j = defineComponent({
1659
1667
  }
1660
1668
  });
1661
1669
 
1662
- const _hoisted_1$a = {
1670
+ const _hoisted_1$b = {
1663
1671
  key: 1,
1664
1672
  class: "icon"
1665
1673
  };
1666
- const _hoisted_2$6 = ["innerHTML"];
1667
- var _sfc_main$i = defineComponent({
1674
+ const _hoisted_2$7 = ["innerHTML"];
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,21 +1721,21 @@ 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$b, [createVNode(_sfc_main$x, {
1717
1725
  type: unref(props).type,
1718
1726
  fill: "#707070",
1719
1727
  size: 20
1720
1728
  }, null, 8, ["type"])])) : createCommentVNode("", true), createElementVNode("div", {
1721
1729
  class: "message",
1722
1730
  innerHTML: unref(props).message
1723
- }, null, 8, _hoisted_2$6)], 38);
1731
+ }, null, 8, _hoisted_2$7)], 38);
1724
1732
  };
1725
1733
  }
1726
1734
  });
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;
@@ -1966,12 +1974,12 @@ function getNoDataBase64Image() {
1966
1974
  return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyREREODhFQ0M5M0UxMUU5ODlFREVENzc4Njk0RjQ2MiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyREREODhFREM5M0UxMUU5ODlFREVENzc4Njk0RjQ2MiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjJEREQ4OEVBQzkzRTExRTk4OUVERUQ3Nzg2OTRGNDYyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjJEREQ4OEVCQzkzRTExRTk4OUVERUQ3Nzg2OTRGNDYyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8++keGxAAAA5lJREFUeNrsmktoE0EYx3eSTdpsk2abvnwcFBVp8QFqVPDgQaGgIogIoictelKKVhARBA8q+KAVrFqooh4qXgRfiHpTEHqw9iCKXqQHSVstpqlt0yabrP9p52K1yW72GTMf/JhZMrM7/3l+37REVVWhlMwjlJhxwVwwF8wFc8FcMBfsnIlGKg98TxRa9RbYAFYXUnl+XbjoRpiKXVXMU9qns3xK76CC/YC4QfA1MAg26aiTZGlQQ9la8AZ0g3VuENwLqsArsFVnXW+e30PgKVgGnoA+Nwi+Cw6DAHgGdmqoMwJoXJrJUcYPHoGN4C3Yl6e8rWv4Nmhma/kh2J6n/HW2JsdylLkKtoAPYAeYcPxYmmX32AjcAVHwPEfZFxreR2fAJ9Z5CbMaSYzceMxxDtN198vKo8Vt57ClYh0d4f/OtTTgOjpquaa8WEhldISM5DRYWYCXZdTS4DVoR9tSegdI9y6Nl1KBL5k/7JRto99HW/ZAtGralJ7DTtCPEUKUmqqKPlH0rtXgMZk2utms2jk0PEqPqt3gEOiybJdGjy5BcobmI7LUC7HrbRQ7HaR4PORoOBRoY+f0RbSp3spjqQNIPtEb8/vEqFMnixTwH0T6gPnwbZYIRk/uZWtHqApLQzaP7GyL1kSCPUinqIuKtjWZKhgvpFt1O82X+cXPXq9njdNHD2ZZC/aRTvZ4A20sN3OEz7IgXJDDkls8laV11aEBpHGaB62mCEbPNSA5QvNYO+88hDS6xcHABtbq9XiusMdTYJ4ZI3yBORdKZTBQ6zKnqq62OiQh7WdByzmjgqlzsWs6BAqW9xAiLHJdMECEY36f9zJ7pLt3oxHH4/j0O4kwWREoW8BuKvSYxG4utFoWjOoVHZErlg/+GP2I7ApwkgnXHy1h/VLntNJA76sROfgFI9CgoXh8OD72OJ3OHDA46Am4m3KhU7rSyJfRl2QiOaXVE3oPsU0mzPKw3RcAf5iiZEPaOkf9KsxcyVq7s1vu7SsZEQ5/LO81ydhk3I5Q05Y/tcQTExKLY/+9U2XV++PJVLMtZ7cdH0mlFfnnyPgIpm3s758y3Qj3NiNfY8sxlmeXNt2NhC/ej0grllXVdHIyVY/RbTD7G9iliZkXAIZsKqUspjjmjgolZlwwF1xigr8VoaYBI4I7ilBwl5Hw8JIwcx3aAha6XCj9t4ub4HzBjgfftLhgLpgL5oK5YC6YC+aCuWDt9luAAQC2EPxjL8cUkwAAAABJRU5ErkJggg==";
1967
1975
  }
1968
1976
 
1969
- const _hoisted_1$9 = {
1977
+ const _hoisted_1$a = {
1970
1978
  class: "snail-empty"
1971
1979
  };
1972
- const _hoisted_2$5 = ["src"];
1973
- const _hoisted_3$4 = ["textContent"];
1974
- var _sfc_main$h = defineComponent({
1980
+ const _hoisted_2$6 = ["src"];
1981
+ const _hoisted_3$5 = ["textContent"];
1982
+ var _sfc_main$i = defineComponent({
1975
1983
  ...{
1976
1984
  name: "Empty",
1977
1985
  inheritAttrs: true
@@ -1984,23 +1992,23 @@ var _sfc_main$h = defineComponent({
1984
1992
  setup(__props) {
1985
1993
  const defaultImageBase64 = getNoDataBase64Image();
1986
1994
  return (_ctx, _cache) => {
1987
- return openBlock(), createElementBlock("div", _hoisted_1$9, [createElementVNode("img", {
1995
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [createElementVNode("img", {
1988
1996
  src: __props.imageUrl || unref(defaultImageBase64)
1989
- }, null, 8, _hoisted_2$5), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1997
+ }, null, 8, _hoisted_2$6), 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
- const _hoisted_1$8 = ["title"];
1998
- const _hoisted_2$4 = ["textContent"];
1999
- const _hoisted_3$3 = {
2005
+ const _hoisted_1$9 = ["title"];
2006
+ const _hoisted_2$5 = ["textContent"];
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,15 +2053,15 @@ 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$5), __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
2056
- })])) : createCommentVNode("", true)], 42, _hoisted_1$8)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2064
+ })])) : createCommentVNode("", true)], 42, _hoisted_1$9)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2057
2065
  key: 1
2058
2066
  }, renderList(unref(showChildrenRef), child => {
2059
2067
  return openBlock(), createBlock(_component_SelectNode, {
@@ -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", {
@@ -2269,20 +2277,20 @@ var _sfc_main$f = defineComponent({
2269
2277
  }
2270
2278
  });
2271
2279
 
2272
- const _hoisted_1$7 = {
2280
+ const _hoisted_1$8 = {
2273
2281
  key: 0,
2274
2282
  class: "select-result"
2275
2283
  };
2276
- const _hoisted_2$3 = ["title", "textContent"];
2277
- const _hoisted_3$2 = ["textContent"];
2278
- const _hoisted_4$2 = {
2284
+ const _hoisted_2$4 = ["title", "textContent"];
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
@@ -2414,15 +2422,15 @@ var _sfc_main$e = defineComponent({
2414
2422
  ref: "select"
2415
2423
  }, [__props.items && __props.items.length ? (openBlock(), createElementBlock(Fragment, {
2416
2424
  key: 0
2417
- }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$7, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2425
+ }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2418
2426
  class: "select-text ellipsis",
2419
2427
  title: selectedTextRef.value,
2420
2428
  textContent: toDisplayString(selectedTextRef.value)
2421
- }, null, 8, _hoisted_2$3)])])) : (openBlock(), createElementBlock("div", {
2429
+ }, null, 8, _hoisted_2$4)])])) : (openBlock(), createElementBlock("div", {
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
@@ -2484,8 +2492,8 @@ var _sfc_main$d = defineComponent({
2484
2492
  }
2485
2493
  });
2486
2494
 
2487
- const _hoisted_1$6 = ["readonly", "placeholder", "rows"];
2488
- var _sfc_main$c = defineComponent({
2495
+ const _hoisted_1$7 = ["readonly", "placeholder", "rows"];
2496
+ var _sfc_main$d = defineComponent({
2489
2497
  ...{
2490
2498
  name: "Textarea"
2491
2499
  },
@@ -2545,25 +2553,25 @@ var _sfc_main$c = defineComponent({
2545
2553
  onInput: _cache[2] || (_cache[2] = $event => emits("input", textareaDom.value.value)),
2546
2554
  onBlur: _cache[3] || (_cache[3] = $event => emits("blur", textareaDom.value.value)),
2547
2555
  onChange: _cache[4] || (_cache[4] = $event => emits("change", textareaDom.value.value))
2548
- }), null, 16, _hoisted_1$6)), [[vModelText, valueModel.value]]);
2556
+ }), null, 16, _hoisted_1$7)), [[vModelText, valueModel.value]]);
2549
2557
  };
2550
2558
  }
2551
2559
  });
2552
2560
 
2553
- const _hoisted_1$5 = {
2561
+ const _hoisted_1$6 = {
2554
2562
  class: "fold-header"
2555
2563
  };
2556
- const _hoisted_2$2 = ["textContent"];
2557
- const _hoisted_3$1 = ["textContent"];
2558
- const _hoisted_4$1 = {
2564
+ const _hoisted_2$3 = ["textContent"];
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
@@ -2633,23 +2641,23 @@ var _sfc_main$b = defineComponent({
2633
2641
  return (_ctx, _cache) => {
2634
2642
  return openBlock(), createElementBlock("div", {
2635
2643
  class: normalizeClass(["snail-fold", statusModel.value])
2636
- }, [createElementVNode("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("div", {
2644
+ }, [createElementVNode("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("div", {
2637
2645
  class: "title ellipsis",
2638
2646
  textContent: toDisplayString(__props.title)
2639
- }, null, 8, _hoisted_2$2), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
2647
+ }, null, 8, _hoisted_2$3), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
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,6 +2669,11 @@ var _sfc_main$a = defineComponent({
2661
2669
  },
2662
2670
  scrollY: {
2663
2671
  type: Boolean
2672
+ },
2673
+ barSize: {},
2674
+ barMode: {},
2675
+ debounce: {
2676
+ type: Boolean
2664
2677
  }
2665
2678
  },
2666
2679
  emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
@@ -2679,9 +2692,30 @@ var _sfc_main$a = defineComponent({
2679
2692
  onInterval
2680
2693
  } = useTimer();
2681
2694
  const classRef = computed(() => ({
2682
- "scroll-x": props.scrollX == true,
2683
- "scroll-y": props.scrollY == true
2695
+ "debounce": props.scrollY == true && props.debounce == true,
2696
+ "hover-show": props.barMode == "hover"
2684
2697
  }));
2698
+ const styleRef = computed(() => {
2699
+ const style = Object.create(null);
2700
+ (props.scrollX || props.scrollY) && (style["--scroll-overflow"] = `${props.scrollX ? "auto" : "hidden"} ${props.scrollY ? "auto" : "hidden"}`);
2701
+ if (props.barSize) {
2702
+ switch (props.barSize) {
2703
+ case "normal":
2704
+ style["--scroll-bar-size"] = "10px";
2705
+ break;
2706
+ case "small":
2707
+ style["--scroll-bar-size"] = "6px";
2708
+ break;
2709
+ case "mini":
2710
+ style["--scroll-bar-size"] = "4px";
2711
+ break;
2712
+ case "none":
2713
+ style["--scroll-bar-size"] = "0";
2714
+ break;
2715
+ }
2716
+ }
2717
+ return style;
2718
+ });
2685
2719
  var preStatus = void 0;
2686
2720
  __expose({
2687
2721
  scroll,
@@ -2760,21 +2794,22 @@ var _sfc_main$a = defineComponent({
2760
2794
  return openBlock(), createElementBlock("div", {
2761
2795
  class: normalizeClass(["snail-scroll", classRef.value]),
2762
2796
  ref: "scroll-root",
2797
+ style: normalizeStyle(styleRef.value),
2763
2798
  onScroll: refreshScrollInfo
2764
- }, [renderSlot(_ctx.$slots, "default")], 34);
2799
+ }, [renderSlot(_ctx.$slots, "default")], 38);
2765
2800
  };
2766
2801
  }
2767
2802
  });
2768
2803
 
2769
- const _hoisted_1$4 = {
2804
+ const _hoisted_1$5 = {
2770
2805
  key: 0,
2771
2806
  class: "layout-start"
2772
2807
  };
2773
- const _hoisted_2$1 = {
2808
+ const _hoisted_2$2 = {
2774
2809
  key: 1,
2775
2810
  class: "layout-end"
2776
2811
  };
2777
- var _sfc_main$9 = defineComponent({
2812
+ var _sfc_main$a = defineComponent({
2778
2813
  __name: "layout",
2779
2814
  props: {
2780
2815
  mode: {},
@@ -2784,17 +2819,17 @@ var _sfc_main$9 = defineComponent({
2784
2819
  return (_ctx, _cache) => {
2785
2820
  return openBlock(), createElementBlock("div", {
2786
2821
  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({
2822
+ }, [_ctx.$slots.start ? (openBlock(), createElementBlock("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "start")])) : createCommentVNode("", true), createVNode(_sfc_main$b, mergeProps({
2788
2823
  class: "layout-body"
2789
2824
  }, __props.scroll), {
2790
2825
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2791
2826
  _: 3
2792
- }, 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", _hoisted_2$1, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("", true)], 2);
2827
+ }, 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", _hoisted_2$2, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("", true)], 2);
2793
2828
  };
2794
2829
  }
2795
2830
  });
2796
2831
 
2797
- var _sfc_main$8 = defineComponent({
2832
+ var _sfc_main$9 = defineComponent({
2798
2833
  ...{
2799
2834
  name: "Sort",
2800
2835
  inheritAttrs: true
@@ -2895,10 +2930,10 @@ var _sfc_main$8 = defineComponent({
2895
2930
  }
2896
2931
  });
2897
2932
 
2898
- const _hoisted_1$3 = {
2933
+ const _hoisted_1$4 = {
2899
2934
  class: "table-body"
2900
2935
  };
2901
- var _sfc_main$7 = defineComponent({
2936
+ var _sfc_main$8 = defineComponent({
2902
2937
  ...{
2903
2938
  name: "Table",
2904
2939
  inheritAttrs: true
@@ -2911,6 +2946,11 @@ var _sfc_main$7 = defineComponent({
2911
2946
  scrollY: {
2912
2947
  type: Boolean
2913
2948
  },
2949
+ barSize: {},
2950
+ barMode: {},
2951
+ debounce: {
2952
+ type: Boolean
2953
+ },
2914
2954
  border: {
2915
2955
  type: Boolean
2916
2956
  },
@@ -2922,7 +2962,7 @@ var _sfc_main$7 = defineComponent({
2922
2962
  const hStyleRef = computed(() => css.buildStyle(props.headerStyle));
2923
2963
  const fStyleRef = computed(() => css.buildStyle(props.footerStyle));
2924
2964
  return (_ctx, _cache) => {
2925
- return openBlock(), createBlock(_sfc_main$a, {
2965
+ return openBlock(), createBlock(_sfc_main$b, {
2926
2966
  class: normalizeClass(["snail-table", {
2927
2967
  "start-border": __props.border == true
2928
2968
  }]),
@@ -2932,7 +2972,7 @@ var _sfc_main$7 = defineComponent({
2932
2972
  default: withCtx(() => [createElementVNode("div", {
2933
2973
  class: "table-header",
2934
2974
  style: normalizeStyle(hStyleRef.value)
2935
- }, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$3, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
2975
+ }, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
2936
2976
  class: "table-footer",
2937
2977
  style: normalizeStyle(fStyleRef.value)
2938
2978
  }, [renderSlot(_ctx.$slots, "footer")], 4)]),
@@ -2942,7 +2982,7 @@ var _sfc_main$7 = defineComponent({
2942
2982
  }
2943
2983
  });
2944
2984
 
2945
- var _sfc_main$6 = defineComponent({
2985
+ var _sfc_main$7 = defineComponent({
2946
2986
  ...{
2947
2987
  name: "TableRow",
2948
2988
  inheritAttrs: true
@@ -2965,7 +3005,7 @@ var _sfc_main$6 = defineComponent({
2965
3005
  }
2966
3006
  });
2967
3007
 
2968
- var _sfc_main$5 = defineComponent({
3008
+ var _sfc_main$6 = defineComponent({
2969
3009
  ...{
2970
3010
  name: "TableCol",
2971
3011
  inheritAttrs: true
@@ -3011,14 +3051,15 @@ var _sfc_main$5 = defineComponent({
3011
3051
  }
3012
3052
  });
3013
3053
 
3014
- var _sfc_main$4 = defineComponent({
3054
+ var _sfc_main$5 = defineComponent({
3015
3055
  __name: "transitions",
3016
3056
  props: {
3017
- customClass: {},
3018
- effect: {},
3019
3057
  group: {
3020
3058
  type: Boolean
3021
- }
3059
+ },
3060
+ duration: {},
3061
+ customClass: {},
3062
+ effect: {}
3022
3063
  },
3023
3064
  setup(__props) {
3024
3065
  const props = __props;
@@ -3029,11 +3070,13 @@ var _sfc_main$4 = defineComponent({
3029
3070
  } else {
3030
3071
  array.push(props.effect || "fade");
3031
3072
  }
3073
+ console.log(array);
3032
3074
  return array.join(" ");
3033
3075
  });
3034
3076
  return (_ctx, _cache) => {
3035
3077
  return openBlock(), createBlock(resolveDynamicComponent(__props.group ? TransitionGroup : Transition), mergeProps(_ctx.$attrs, {
3036
3078
  appear: "",
3079
+ duration: __props.duration,
3037
3080
  "enter-active-class": `${classNames.value} enter-active`,
3038
3081
  "enter-from-class": `${classNames.value} enter-from`,
3039
3082
  "enter-to-class": `${classNames.value} enter-to`,
@@ -3043,25 +3086,25 @@ var _sfc_main$4 = defineComponent({
3043
3086
  }), {
3044
3087
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3045
3088
  _: 3
3046
- }, 16, ["enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
3089
+ }, 16, ["duration", "enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
3047
3090
  };
3048
3091
  }
3049
3092
  });
3050
3093
 
3051
- const _hoisted_1$2 = {
3094
+ const _hoisted_1$3 = {
3052
3095
  key: 0,
3053
3096
  class: "node-fold"
3054
3097
  };
3055
- const _hoisted_2 = ["title", "textContent"];
3056
- const _hoisted_3 = {
3098
+ const _hoisted_2$1 = ["title", "textContent"];
3099
+ const _hoisted_3$1 = {
3057
3100
  class: "node-slot ellipsis"
3058
3101
  };
3059
- const _hoisted_4 = {
3102
+ const _hoisted_4$1 = {
3060
3103
  key: 1,
3061
3104
  class: "snail-tree-children hidden",
3062
3105
  ref: "children"
3063
3106
  };
3064
- var _sfc_main$3 = defineComponent({
3107
+ var _sfc_main$4 = defineComponent({
3065
3108
  ...{
3066
3109
  name: "TreeNode",
3067
3110
  inheritAttrs: true
@@ -3179,7 +3222,7 @@ var _sfc_main$3 = defineComponent({
3179
3222
  key: 1
3180
3223
  }, [_cache[4] || (_cache[4] = createElementVNode("div", {
3181
3224
  class: "indent"
3182
- }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$2, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$w, {
3225
+ }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$3, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$x, {
3183
3226
  key: 0,
3184
3227
  class: normalizeClass(statusRef.value),
3185
3228
  type: "custom",
@@ -3191,7 +3234,7 @@ var _sfc_main$3 = defineComponent({
3191
3234
  class: "node-text ellipsis",
3192
3235
  title: __props.node.text,
3193
3236
  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 => {
3237
+ }, 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
3238
  return openBlock(), createBlock(_component_TreeNode, {
3196
3239
  key: __props.context.getKey(child),
3197
3240
  node: child,
@@ -3211,10 +3254,10 @@ var _sfc_main$3 = defineComponent({
3211
3254
  }
3212
3255
  });
3213
3256
 
3214
- const _hoisted_1$1 = {
3257
+ const _hoisted_1$2 = {
3215
3258
  class: "snail-tree"
3216
3259
  };
3217
- var _sfc_main$2 = defineComponent({
3260
+ var _sfc_main$3 = defineComponent({
3218
3261
  ...{
3219
3262
  name: "Tree",
3220
3263
  inheritAttrs: true
@@ -3248,15 +3291,15 @@ var _sfc_main$2 = defineComponent({
3248
3291
  emits("click", node, parents);
3249
3292
  }
3250
3293
  return (_ctx, _cache) => {
3251
- return openBlock(), createElementBlock("div", _hoisted_1$1, [__props.search ? (openBlock(), createBlock(_sfc_main$p, mergeProps({
3294
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [__props.search ? (openBlock(), createBlock(_sfc_main$q, mergeProps({
3252
3295
  key: 0
3253
3296
  }, __props.search, {
3254
3297
  onSearch
3255
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$a, {
3298
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$b, {
3256
3299
  "scroll-y": true
3257
3300
  }, {
3258
3301
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
3259
- return openBlock(), createBlock(_sfc_main$3, {
3302
+ return openBlock(), createBlock(_sfc_main$4, {
3260
3303
  key: unref(context).getKey(node),
3261
3304
  node,
3262
3305
  parent: void 0,
@@ -3277,7 +3320,7 @@ var _sfc_main$2 = defineComponent({
3277
3320
  }
3278
3321
  });
3279
3322
 
3280
- var _sfc_main$1 = defineComponent({
3323
+ var _sfc_main$2 = defineComponent({
3281
3324
  __name: "wrapper",
3282
3325
  props: {
3283
3326
  readonly: {
@@ -3299,14 +3342,14 @@ var _sfc_main$1 = defineComponent({
3299
3342
  return (_ctx, _cache) => {
3300
3343
  return openBlock(), createElementBlock("div", {
3301
3344
  class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
3302
- }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$s, mergeProps({
3345
+ }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
3303
3346
  key: 0
3304
3347
  }, __props.header || {
3305
3348
  useTo: "dialog",
3306
3349
  title: "对话框"
3307
3350
  }, {
3308
3351
  onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
3309
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$a, mergeProps({
3352
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$b, mergeProps({
3310
3353
  class: "wrapper-body"
3311
3354
  }, __props.content || {
3312
3355
  scrollX: false,
@@ -3314,7 +3357,7 @@ var _sfc_main$1 = defineComponent({
3314
3357
  }), {
3315
3358
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3316
3359
  _: 3
3317
- }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
3360
+ }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$u, mergeProps({
3318
3361
  key: 1
3319
3362
  }, __props.footer || {}, {
3320
3363
  onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
@@ -3328,7 +3371,7 @@ function mount(target, options, onDestroyed) {
3328
3371
  mustObject(options, "options");
3329
3372
  target instanceof HTMLElement || throwError("target must be a HTMLElement");
3330
3373
  target.classList.add("snail-app");
3331
- const app = createApp(_sfc_main$m, options);
3374
+ const app = createApp(_sfc_main$n, options);
3332
3375
  triggerAppCreated(app);
3333
3376
  app.mount(target);
3334
3377
  const scope = useScope().onDestroy(() => app.unmount());
@@ -3336,6 +3379,253 @@ function mount(target, options, onDestroyed) {
3336
3379
  return scope;
3337
3380
  }
3338
3381
 
3382
+ const _hoisted_1$1 = {
3383
+ class: "time-zone"
3384
+ };
3385
+ const _hoisted_2 = {
3386
+ class: "tz-item",
3387
+ ref: "hour-items"
3388
+ };
3389
+ const _hoisted_3 = ["textContent", "onClick"];
3390
+ const _hoisted_4 = {
3391
+ class: "tz-item",
3392
+ ref: "minute-items"
3393
+ };
3394
+ const _hoisted_5 = ["textContent", "onClick"];
3395
+ const _hoisted_6 = {
3396
+ key: 0,
3397
+ class: "tz-item",
3398
+ ref: "second-items"
3399
+ };
3400
+ const _hoisted_7 = ["textContent", "onClick"];
3401
+ const _hoisted_8 = {
3402
+ class: "time-operation"
3403
+ };
3404
+ var _sfc_main$1 = defineComponent({
3405
+ __name: "time-pc",
3406
+ props: {
3407
+ value: {},
3408
+ initialDisabled: {
3409
+ type: Boolean
3410
+ },
3411
+ nowDisabled: {
3412
+ type: Boolean
3413
+ },
3414
+ manager: {},
3415
+ format: {},
3416
+ min: {},
3417
+ max: {},
3418
+ inPopup: {},
3419
+ closePopup: {
3420
+ type: Function
3421
+ },
3422
+ popupStatus: {},
3423
+ target: {},
3424
+ followX: {},
3425
+ followY: {},
3426
+ pinned: {}
3427
+ },
3428
+ emits: ["clear", "confirm"],
3429
+ setup(__props, _ref) {
3430
+ let {
3431
+ emit: __emit
3432
+ } = _ref;
3433
+ const props = __props;
3434
+ const emits = __emit;
3435
+ const tm = props.manager || useTime({
3436
+ format: props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss",
3437
+ min: parseTime(props.min),
3438
+ max: parseTime(props.max)
3439
+ });
3440
+ const {
3441
+ toast
3442
+ } = usePopup();
3443
+ const {
3444
+ inPopup,
3445
+ closePopup
3446
+ } = props;
3447
+ const secondDisabled = tm.format == "HH:mm";
3448
+ const tvRef = ref();
3449
+ const hItemsDom = useTemplateRef("hour-items");
3450
+ const mItemsDom = useTemplateRef("minute-items");
3451
+ const sItemsDom = useTemplateRef("second-items");
3452
+ function getTimeClass(type, value) {
3453
+ switch (type) {
3454
+ case "hour":
3455
+ return {
3456
+ active: tvRef.value.hour == value,
3457
+ disabled: tm.validateHH(value) == false
3458
+ };
3459
+ case "minute":
3460
+ return {
3461
+ active: tvRef.value.minute == value,
3462
+ disabled: tm.validateHHmm(tvRef.value.hour, value) == false
3463
+ };
3464
+ case "second":
3465
+ return {
3466
+ active: tvRef.value.second == value,
3467
+ disabled: tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value) == false
3468
+ };
3469
+ }
3470
+ }
3471
+ function scrollIntoView(items) {
3472
+ let activeIndex = void 0,
3473
+ firstValidIndex;
3474
+ for (var index = 0; index < (items ? items.children.length : 0); index++) {
3475
+ const ele = items.children[index];
3476
+ if (ele.classList.contains("disabled") == true) {
3477
+ continue;
3478
+ }
3479
+ if (firstValidIndex == void 0) {
3480
+ firstValidIndex = index;
3481
+ }
3482
+ if (ele.classList.contains("active") == true) {
3483
+ activeIndex = index;
3484
+ break;
3485
+ }
3486
+ }
3487
+ let showIndex = activeIndex;
3488
+ if (activeIndex == void 0) {
3489
+ if (firstValidIndex != void 0) {
3490
+ showIndex = firstValidIndex;
3491
+ }
3492
+ }
3493
+ showIndex != void 0 && items.children[showIndex].scrollIntoView({
3494
+ behavior: "smooth",
3495
+ block: "center"
3496
+ });
3497
+ }
3498
+ async function onTimeClick(type, value) {
3499
+ switch (type) {
3500
+ case "hour":
3501
+ if (tm.validateHH(value)) {
3502
+ tvRef.value.hour = value;
3503
+ await nextTick();
3504
+ scrollIntoView(mItemsDom.value);
3505
+ }
3506
+ break;
3507
+ case "minute":
3508
+ if (tm.validateHHmm(tvRef.value.hour, value)) {
3509
+ tvRef.value.minute = value;
3510
+ await nextTick();
3511
+ scrollIntoView(sItemsDom.value);
3512
+ }
3513
+ break;
3514
+ case "second":
3515
+ if (tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value)) {
3516
+ tvRef.value.second = value;
3517
+ }
3518
+ break;
3519
+ }
3520
+ }
3521
+ async function onNow() {
3522
+ tvRef.value = getTimeNow();
3523
+ if (tm.validate(tvRef.value)) {
3524
+ await nextTick();
3525
+ scrollIntoView(hItemsDom.value);
3526
+ scrollIntoView(mItemsDom.value);
3527
+ scrollIntoView(sItemsDom.value);
3528
+ }
3529
+ }
3530
+ function onConfirm() {
3531
+ tvRef.value = tm.correct(tvRef.value) || Object.create(null);
3532
+ if (tvRef.value == void 0 || tvRef.value.hour == void 0) {
3533
+ return toast("error", "请选选择时间");
3534
+ }
3535
+ if (secondDisabled != true && tvRef.value.minute == void 0) {
3536
+ return toast("error", "请选选择时间");
3537
+ }
3538
+ const value = tm.toString(tvRef.value);
3539
+ emits("confirm", value);
3540
+ inPopup && closePopup(value);
3541
+ }
3542
+ {
3543
+ props.value && (tvRef.value = tm.parse(props.value));
3544
+ tvRef.value || props.initialDisabled || (tvRef.value = tm.correct(getTimeNow()));
3545
+ tvRef.value || (tvRef.value = Object.create(null));
3546
+ }
3547
+ onMounted(async () => {
3548
+ await nextTick();
3549
+ scrollIntoView(hItemsDom.value);
3550
+ scrollIntoView(mItemsDom.value);
3551
+ scrollIntoView(sItemsDom.value);
3552
+ });
3553
+ return (_ctx, _cache) => {
3554
+ return openBlock(), createElementBlock("div", {
3555
+ class: normalizeClass(["snail-time-picker pc", {
3556
+ "second-disabled": secondDisabled
3557
+ }])
3558
+ }, [createVNode(_sfc_main$5, {
3559
+ group: true,
3560
+ effect: ["down-up"]
3561
+ }, {
3562
+ default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(Array(24).fill(void 0), (_, index) => {
3563
+ return openBlock(), createElementBlock("div", {
3564
+ class: normalizeClass(["tzi-number", getTimeClass("hour", index)]),
3565
+ textContent: toDisplayString(String(index).padStart(2, "0")),
3566
+ onClick: $event => onTimeClick("hour", index)
3567
+ }, null, 10, _hoisted_3);
3568
+ }), 256))], 512), createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(Array(60).fill(void 0), (_, index) => {
3569
+ return openBlock(), createElementBlock("div", {
3570
+ class: normalizeClass(["tzi-number", getTimeClass("minute", index)]),
3571
+ textContent: toDisplayString(String(index).padStart(2, "0")),
3572
+ onClick: $event => onTimeClick("minute", index)
3573
+ }, null, 10, _hoisted_5);
3574
+ }), 256))], 512), secondDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(Array(60).fill(void 0), (_, index) => {
3575
+ return openBlock(), createElementBlock("div", {
3576
+ class: normalizeClass(["tzi-number", getTimeClass("second", index)]),
3577
+ textContent: toDisplayString(String(index).padStart(2, "0")),
3578
+ onClick: $event => onTimeClick("second", index)
3579
+ }, null, 10, _hoisted_7);
3580
+ }), 256))], 512)) : createCommentVNode("", true)]), createElementVNode("div", _hoisted_8, [createVNode(_sfc_main$y, {
3581
+ type: "link",
3582
+ size: "small",
3583
+ textContent: "清空",
3584
+ onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), unref(inPopup) && unref(closePopup)("")))
3585
+ }), unref(tm).validate(unref(getTimeNow)()) ? (openBlock(), createBlock(_sfc_main$y, {
3586
+ key: 0,
3587
+ type: "link",
3588
+ size: "small",
3589
+ textContent: "现在",
3590
+ onClick: onNow
3591
+ })) : createCommentVNode("", true), createVNode(_sfc_main$y, {
3592
+ type: "link",
3593
+ size: "small",
3594
+ textContent: "确定",
3595
+ onClick: onConfirm
3596
+ })])]),
3597
+ _: 1
3598
+ })], 2);
3599
+ };
3600
+ }
3601
+ });
3602
+
3603
+ function usePicker() {
3604
+ const popup = usePopup();
3605
+ function showTime(target, options) {
3606
+ options = {
3607
+ ...options
3608
+ };
3609
+ delete options["manager"];
3610
+ return popup.follow(target, {
3611
+ component: _sfc_main$1,
3612
+ followX: ["center"],
3613
+ spaceClient: 10,
3614
+ spaceY: 2,
3615
+ spaceX: 2,
3616
+ closeOnMask: true,
3617
+ props: options
3618
+ });
3619
+ }
3620
+ {
3621
+ const manager = Object.freeze(mountScope({
3622
+ showTime
3623
+ }, "IPickerManager"));
3624
+ manager.onDestroy(popup.destroy);
3625
+ return manager;
3626
+ }
3627
+ }
3628
+
3339
3629
  const _hoisted_1 = ["textContent"];
3340
3630
  var _sfc_main = defineComponent({
3341
3631
  ...{
@@ -3421,12 +3711,12 @@ var _sfc_main = defineComponent({
3421
3711
  onTouchstart: onStartDrag,
3422
3712
  onTouchmove: onDragMove,
3423
3713
  onTouchend: onDragEnd
3424
- }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$w, {
3714
+ }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$x, {
3425
3715
  key: 0,
3426
3716
  type: "success",
3427
3717
  size: 20,
3428
3718
  color: "white"
3429
- })) : (openBlock(), createBlock(_sfc_main$w, {
3719
+ })) : (openBlock(), createBlock(_sfc_main$x, {
3430
3720
  key: 1,
3431
3721
  type: "custom",
3432
3722
  size: 20,
@@ -3438,36 +3728,36 @@ var _sfc_main = defineComponent({
3438
3728
  });
3439
3729
 
3440
3730
  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,
3731
+ Button: _sfc_main$y,
3732
+ Choose: _sfc_main$w,
3733
+ DatePicker: _sfc_main$v,
3734
+ Footer: _sfc_main$u,
3735
+ Header: _sfc_main$t,
3736
+ Icon: _sfc_main$x,
3737
+ Input: _sfc_main$s,
3738
+ Number: _sfc_main$r,
3739
+ Search: _sfc_main$q,
3740
+ Select: _sfc_main$f,
3741
+ Switch: _sfc_main$e,
3742
+ Textarea: _sfc_main$d,
3743
+ Dynamic: _sfc_main$n,
3744
+ Fold: _sfc_main$c,
3745
+ Layout: _sfc_main$a,
3746
+ Scroll: _sfc_main$b,
3747
+ Sort: _sfc_main$9,
3748
+ Table: _sfc_main$8,
3749
+ TableRow: _sfc_main$7,
3750
+ TableCol: _sfc_main$6,
3751
+ Transitions: _sfc_main$5,
3752
+ Tree: _sfc_main$3,
3753
+ Wrapper: _sfc_main$2,
3464
3754
  DragVerify: _sfc_main,
3465
- Empty: _sfc_main$h,
3466
- Loading: _sfc_main$n
3755
+ Empty: _sfc_main$i,
3756
+ Loading: _sfc_main$o
3467
3757
  };
3468
3758
 
3469
3759
  onMountScope(scope => {
3470
3760
  getCurrentScope() && onScopeDispose(scope.destroy);
3471
3761
  });
3472
3762
 
3473
- export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
3763
+ export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePicker, usePopup, useReactive, useTreeContext };