snail.vue 2.0.11 → 2.0.12

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.
@@ -5,8 +5,8 @@
5
5
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SnailVue = global.SnailVue || {}, global.Vue, global.Snail, global.SnailView));
6
6
  })(this, (function (exports, vue, snail_core, snail_view) { 'use strict';
7
7
 
8
- const _hoisted_1$j = ["title"];
9
- var _sfc_main$y = vue.defineComponent({
8
+ const _hoisted_1$k = ["title"];
9
+ var _sfc_main$z = vue.defineComponent({
10
10
  ...{
11
11
  name: "Button",
12
12
  inheritAttrs: true
@@ -22,15 +22,11 @@
22
22
  return vue.openBlock(), vue.createElementBlock("div", {
23
23
  class: vue.normalizeClass(["snail-button", [__props.size, __props.type]]),
24
24
  title: __props.title
25
- }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = vue.createTextVNode("按钮", -1))])], 10, _hoisted_1$j);
25
+ }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = vue.createTextVNode("按钮", -1))])], 10, _hoisted_1$k);
26
26
  };
27
27
  }
28
28
  });
29
29
 
30
- var addLink = href => setTimeout(snail_view.link.register, 0, href);
31
-
32
- addLink("/styles/snail.vue.vue.css");
33
-
34
30
  function getSvgDraw(iconType, draw) {
35
31
  switch (iconType) {
36
32
  case "success":
@@ -69,10 +65,10 @@
69
65
  }
70
66
  }
71
67
 
72
- const _hoisted_1$i = ["width", "height"];
73
- const _hoisted_2$b = ["textContent"];
74
- const _hoisted_3$9 = ["fill", "stroke", "stroke-width", "d"];
75
- var _sfc_main$x = vue.defineComponent({
68
+ const _hoisted_1$j = ["width", "height"];
69
+ const _hoisted_2$c = ["textContent"];
70
+ const _hoisted_3$a = ["fill", "stroke", "stroke-width", "d"];
71
+ var _sfc_main$y = vue.defineComponent({
76
72
  ...{
77
73
  name: "Icon",
78
74
  inheritAttrs: true
@@ -102,23 +98,23 @@
102
98
  onMouseleave: _cache[1] || (_cache[1] = $event => isMouseEnterRef.value = false)
103
99
  }, [vue.createElementVNode("title", {
104
100
  textContent: vue.toDisplayString(__props.title || "")
105
- }, null, 8, _hoisted_2$b), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(getSvgDraw)(__props.type, __props.draw), d => {
101
+ }, null, 8, _hoisted_2$c), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(getSvgDraw)(__props.type, __props.draw), d => {
106
102
  return vue.openBlock(), vue.createElementBlock("path", {
107
103
  fill: isMouseEnterRef.value ? __props.hoverColor || __props.color : __props.color,
108
104
  stroke: __props.stroke,
109
105
  "stroke-width": __props.strokeWidth,
110
106
  d
111
- }, null, 8, _hoisted_3$9);
112
- }), 256))], 46, _hoisted_1$i);
107
+ }, null, 8, _hoisted_3$a);
108
+ }), 256))], 46, _hoisted_1$j);
113
109
  };
114
110
  }
115
111
  });
116
112
 
117
- const _hoisted_1$h = ["title", "onClick"];
118
- const _hoisted_2$a = ["type", "checked"];
119
- const _hoisted_3$8 = ["textContent"];
120
- const _hoisted_4$6 = ["textContent"];
121
- var _sfc_main$w = vue.defineComponent({
113
+ const _hoisted_1$i = ["title", "onClick"];
114
+ const _hoisted_2$b = ["type", "checked"];
115
+ const _hoisted_3$9 = ["textContent"];
116
+ const _hoisted_4$7 = ["textContent"];
117
+ var _sfc_main$x = vue.defineComponent({
122
118
  ...{
123
119
  name: "Choose",
124
120
  inheritAttrs: true
@@ -194,10 +190,10 @@
194
190
  key: 0,
195
191
  type: vue.unref(type),
196
192
  checked: node.selected
197
- }, null, 8, _hoisted_2$a)) : vue.unref(mode) == "beautiful" ? (vue.openBlock(), vue.createElementBlock("div", {
193
+ }, null, 8, _hoisted_2$b)) : vue.unref(mode) == "beautiful" ? (vue.openBlock(), vue.createElementBlock("div", {
198
194
  key: 1,
199
195
  class: vue.normalizeClass(["status", [node.selected ? "selected" : ""]])
200
- }, [node.selected ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
196
+ }, [node.selected ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
201
197
  key: 0,
202
198
  type: "success",
203
199
  size: 12,
@@ -206,18 +202,22 @@
206
202
  key: 2,
207
203
  class: "item-text",
208
204
  textContent: vue.toDisplayString(node.item.text)
209
- }, null, 8, _hoisted_3$8)) : vue.createCommentVNode("", true), node.item.description ? (vue.openBlock(), vue.createElementBlock("span", {
205
+ }, null, 8, _hoisted_3$9)) : vue.createCommentVNode("", true), node.item.description ? (vue.openBlock(), vue.createElementBlock("span", {
210
206
  key: 3,
211
207
  class: "item-des",
212
208
  textContent: vue.toDisplayString(node.item.description)
213
- }, null, 8, _hoisted_4$6)) : vue.createCommentVNode("", true)], 14, _hoisted_1$h);
209
+ }, null, 8, _hoisted_4$7)) : vue.createCommentVNode("", true)], 14, _hoisted_1$i);
214
210
  }), 128))], 2);
215
211
  };
216
212
  }
217
213
  });
218
214
 
219
- const _hoisted_1$g = ["id"];
220
- var _sfc_main$v = vue.defineComponent({
215
+ var addLink = href => setTimeout(snail_view.link.register, 0, href);
216
+
217
+ addLink("/styles/snail.vue.vue.css");
218
+
219
+ const _hoisted_1$h = ["id"];
220
+ var _sfc_main$w = vue.defineComponent({
221
221
  __name: "datepicker",
222
222
  props: {
223
223
  type: {},
@@ -368,12 +368,12 @@
368
368
  class: "snail-datepicker",
369
369
  id: vue.unref(id),
370
370
  onClick
371
- }, null, 8, _hoisted_1$g);
371
+ }, null, 8, _hoisted_1$h);
372
372
  };
373
373
  }
374
374
  });
375
375
 
376
- var _sfc_main$u = vue.defineComponent({
376
+ var _sfc_main$v = vue.defineComponent({
377
377
  ...{
378
378
  name: "Footer",
379
379
  inheritAttrs: true
@@ -404,13 +404,13 @@
404
404
  class: vue.normalizeClass(["snail-footer", {
405
405
  "start-divider": __props.divider
406
406
  }, __props.align || "right"])
407
- }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
407
+ }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
408
408
  key: 0,
409
409
  size: "max",
410
410
  type: "default",
411
411
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
412
412
  textContent: vue.toDisplayString(__props.cancelName || "取消")
413
- }, null, 8, ["textContent"])) : vue.createCommentVNode("", true), __props.confirmDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
413
+ }, null, 8, ["textContent"])) : vue.createCommentVNode("", true), __props.confirmDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
414
414
  key: 1,
415
415
  size: "max",
416
416
  type: "primary",
@@ -421,8 +421,8 @@
421
421
  }
422
422
  });
423
423
 
424
- const _hoisted_1$f = ["textContent"];
425
- var _sfc_main$t = vue.defineComponent({
424
+ const _hoisted_1$g = ["textContent"];
425
+ var _sfc_main$u = vue.defineComponent({
426
426
  ...{
427
427
  name: "Header",
428
428
  inheritAttrs: true
@@ -461,7 +461,7 @@
461
461
  key: 0,
462
462
  textContent: vue.toDisplayString(__props.title),
463
463
  class: vue.normalizeClass(["header-title", __props.titleAlign])
464
- }, null, 10, _hoisted_1$f)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
464
+ }, null, 10, _hoisted_1$g)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
465
465
  key: 1,
466
466
  type: "close",
467
467
  size: 22,
@@ -473,18 +473,18 @@
473
473
  }
474
474
  });
475
475
 
476
- const _hoisted_1$e = ["textContent"];
477
- const _hoisted_2$9 = {
476
+ const _hoisted_1$f = ["textContent"];
477
+ const _hoisted_2$a = {
478
478
  key: 0,
479
479
  class: "required",
480
480
  textContent: "*"
481
481
  };
482
- const _hoisted_3$7 = {
482
+ const _hoisted_3$8 = {
483
483
  class: "input-body"
484
484
  };
485
- const _hoisted_4$5 = ["type", "value", "readonly", "placeholder", "title"];
486
- const _hoisted_5$3 = ["title"];
487
- var _sfc_main$s = vue.defineComponent({
485
+ const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
486
+ const _hoisted_5$4 = ["title"];
487
+ var _sfc_main$t = vue.defineComponent({
488
488
  ...{
489
489
  name: "Input",
490
490
  inheritAttrs: true
@@ -536,7 +536,7 @@
536
536
  }, [vue.createElementVNode("span", {
537
537
  class: "text",
538
538
  textContent: vue.toDisplayString(__props.title)
539
- }, null, 8, _hoisted_1$e), __props.readonly != true && __props.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$9)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3$7, [vue.createElementVNode("input", {
539
+ }, null, 8, _hoisted_1$f), __props.readonly != true && __props.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$a)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3$8, [vue.createElementVNode("input", {
540
540
  ref: "input-el",
541
541
  type: __props.type || "text",
542
542
  value: inputModel.value,
@@ -545,15 +545,15 @@
545
545
  title: inputModel.value,
546
546
  onChange: onValueChange,
547
547
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
548
- }, null, 40, _hoisted_4$5), !!validateRef.value ? (vue.openBlock(), vue.createElementBlock("span", {
548
+ }, null, 40, _hoisted_4$6), !!validateRef.value ? (vue.openBlock(), vue.createElementBlock("span", {
549
549
  key: 0,
550
550
  class: "validate",
551
551
  title: validateRef.value
552
- }, [vue.createVNode(_sfc_main$x, {
552
+ }, [vue.createVNode(_sfc_main$y, {
553
553
  type: "error",
554
554
  size: 16,
555
555
  color: "red"
556
- })], 8, _hoisted_5$3)) : vue.createCommentVNode("", true)])], 2);
556
+ })], 8, _hoisted_5$4)) : vue.createCommentVNode("", true)])], 2);
557
557
  };
558
558
  }
559
559
  });
@@ -758,20 +758,20 @@
758
758
  return formatter;
759
759
  }
760
760
 
761
- const _hoisted_1$d = {
761
+ const _hoisted_1$e = {
762
762
  key: 0,
763
763
  class: "number-prefix"
764
764
  };
765
- const _hoisted_2$8 = ["textContent"];
766
- const _hoisted_3$6 = ["inputmode", "placeholder", "title"];
767
- const _hoisted_4$4 = {
765
+ const _hoisted_2$9 = ["textContent"];
766
+ const _hoisted_3$7 = ["inputmode", "placeholder", "title"];
767
+ const _hoisted_4$5 = {
768
768
  key: 1,
769
769
  class: "number-suffix"
770
770
  };
771
- const _hoisted_5$2 = ["textContent"];
772
- const _hoisted_6$1 = ["title", "textContent"];
773
- const _hoisted_7 = ["title", "textContent"];
774
- var _sfc_main$r = vue.defineComponent({
771
+ const _hoisted_5$3 = ["textContent"];
772
+ const _hoisted_6$2 = ["title", "textContent"];
773
+ const _hoisted_7$1 = ["title", "textContent"];
774
+ var _sfc_main$s = vue.defineComponent({
775
775
  __name: "number",
776
776
  props: vue.mergeModels({
777
777
  placeholder: {},
@@ -918,10 +918,10 @@
918
918
  "has-prefix": vue.unref(hasPrefix),
919
919
  "has-suffix": vue.unref(hasSuffix)
920
920
  }])
921
- }, [vue.unref(hasPrefix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [vue.createElementVNode("span", {
921
+ }, [vue.unref(hasPrefix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [vue.createElementVNode("span", {
922
922
  class: "ellipsis",
923
923
  textContent: vue.toDisplayString(vue.unref(prefix))
924
- }, null, 8, _hoisted_2$8)])) : vue.createCommentVNode("", true), vue.createElementVNode("div", {
924
+ }, null, 8, _hoisted_2$9)])) : vue.createCommentVNode("", true), vue.createElementVNode("div", {
925
925
  class: vue.normalizeClass(["input-panel", vue.unref(controls)])
926
926
  }, [vue.withDirectives(vue.createElementVNode("input", {
927
927
  type: "text",
@@ -933,18 +933,18 @@
933
933
  onFocus: _cache[1] || (_cache[1] = $event => vue.isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
934
934
  onPaste: _cache[2] || (_cache[2] = $event => vue.isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
935
935
  onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
936
- }, null, 40, _hoisted_3$6), [[vue.vModelText, displayValueRef.value]]), vue.unref(controls) == "default" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
936
+ }, null, 40, _hoisted_3$7), [[vue.vModelText, displayValueRef.value]]), vue.unref(controls) == "default" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
937
937
  key: 0
938
938
  }, [vue.createElementVNode("div", {
939
939
  class: "controls default subtract",
940
940
  onClick: _cache[4] || (_cache[4] = $event => onStepClick(false))
941
- }, [vue.createVNode(_sfc_main$x, {
941
+ }, [vue.createVNode(_sfc_main$y, {
942
942
  type: "subtract",
943
943
  size: 20
944
944
  })]), vue.createElementVNode("div", {
945
945
  class: "controls default plus",
946
946
  onClick: _cache[5] || (_cache[5] = $event => onStepClick(true))
947
- }, [vue.createVNode(_sfc_main$x, {
947
+ }, [vue.createVNode(_sfc_main$y, {
948
948
  type: "plus",
949
949
  size: 20
950
950
  })])], 64)) : vue.unref(controls) == "right" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
@@ -952,38 +952,38 @@
952
952
  }, [vue.createElementVNode("div", {
953
953
  class: "controls right plus",
954
954
  onClick: _cache[6] || (_cache[6] = $event => onStepClick(true))
955
- }, [vue.createVNode(_sfc_main$x, {
955
+ }, [vue.createVNode(_sfc_main$y, {
956
956
  type: "arrow",
957
957
  size: 20,
958
958
  rotate: 270
959
959
  })]), vue.createElementVNode("div", {
960
960
  class: "controls right subtract",
961
961
  onClick: _cache[7] || (_cache[7] = $event => onStepClick(false))
962
- }, [vue.createVNode(_sfc_main$x, {
962
+ }, [vue.createVNode(_sfc_main$y, {
963
963
  type: "arrow",
964
964
  size: 20,
965
965
  rotate: 90
966
- })])], 64)) : vue.createCommentVNode("", true)], 2), vue.unref(hasSuffix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [vue.createElementVNode("span", {
966
+ })])], 64)) : vue.createCommentVNode("", true)], 2), vue.unref(hasSuffix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [vue.createElementVNode("span", {
967
967
  class: "ellipsis",
968
968
  textContent: vue.toDisplayString(vue.unref(suffix))
969
- }, null, 8, _hoisted_5$2)])) : vue.createCommentVNode("", true), vue.unref(upper) ? (vue.openBlock(), vue.createElementBlock("div", {
969
+ }, null, 8, _hoisted_5$3)])) : vue.createCommentVNode("", true), vue.unref(upper) ? (vue.openBlock(), vue.createElementBlock("div", {
970
970
  key: 2,
971
971
  class: "number-util ellipsis",
972
972
  title: upperTextRef.value,
973
973
  textContent: vue.toDisplayString(`大写:${upperTextRef.value || ""}`)
974
- }, null, 8, _hoisted_6$1)) : vue.createCommentVNode("", true), vue.unref(thousands) == "below" ? (vue.openBlock(), vue.createElementBlock("div", {
974
+ }, null, 8, _hoisted_6$2)) : vue.createCommentVNode("", true), vue.unref(thousands) == "below" ? (vue.openBlock(), vue.createElementBlock("div", {
975
975
  key: 3,
976
976
  class: "number-util ellipsis",
977
977
  title: thousandsTextRef.value,
978
978
  textContent: vue.toDisplayString(`千分位:${thousandsTextRef.value || ""}`)
979
- }, null, 8, _hoisted_7)) : vue.createCommentVNode("", true)], 2);
979
+ }, null, 8, _hoisted_7$1)) : vue.createCommentVNode("", true)], 2);
980
980
  };
981
981
  }
982
982
  });
983
983
 
984
- const _hoisted_1$c = ["placeholder", "readonly"];
984
+ const _hoisted_1$d = ["placeholder", "readonly"];
985
985
  const searchIon = "M 860.16 824.32 l -163.84 -163.84 c 102.4 -120.32 97.28 -302.08 -17.92 -414.72 c -120.32 -120.32 -314.88 -120.32 -435.2 0 c -120.32 120.32 -120.32 314.88 0 435.2 c 112.64 112.64 294.4 120.32 414.72 17.92 l 163.84 163.84 c 10.24 10.24 25.6 10.24 35.84 0 c 12.8 -12.8 12.8 -28.16 2.56 -38.4 Z M 281.6 642.56 C 181.76 542.72 181.76 381.44 281.6 281.6 c 99.84 -99.84 261.12 -99.84 360.96 0 c 99.84 99.84 99.84 261.12 0 360.96 c -99.84 102.4 -261.12 102.4 -360.96 0 Z";
986
- var _sfc_main$q = vue.defineComponent({
986
+ var _sfc_main$r = vue.defineComponent({
987
987
  ...{
988
988
  name: "Search",
989
989
  inheritAttrs: true
@@ -1028,9 +1028,9 @@
1028
1028
  readonly: __props.readonly,
1029
1029
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
1030
1030
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
1031
- }, null, 40, _hoisted_1$c), [[vue.vModelText, textModel.value, void 0, {
1031
+ }, null, 40, _hoisted_1$d), [[vue.vModelText, textModel.value, void 0, {
1032
1032
  trim: true
1033
- }]]), vue.createElementVNode("div", null, [vue.createVNode(_sfc_main$x, {
1033
+ }]]), vue.createElementVNode("div", null, [vue.createVNode(_sfc_main$y, {
1034
1034
  class: "search-button",
1035
1035
  type: "custom",
1036
1036
  draw: searchIon,
@@ -1251,11 +1251,11 @@
1251
1251
  }
1252
1252
  }
1253
1253
 
1254
- const _hoisted_1$b = {
1254
+ const _hoisted_1$c = {
1255
1255
  class: "snail-confirm flex-column"
1256
1256
  };
1257
- const _hoisted_2$7 = ["innerHTML"];
1258
- var _sfc_main$p = vue.defineComponent({
1257
+ const _hoisted_2$8 = ["innerHTML"];
1258
+ var _sfc_main$q = vue.defineComponent({
1259
1259
  ...{
1260
1260
  name: "ConfirmContainer",
1261
1261
  inheritAttrs: true
@@ -1283,14 +1283,14 @@
1283
1283
  },
1284
1284
  setup(__props) {
1285
1285
  return (_ctx, _cache) => {
1286
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [vue.createVNode(_sfc_main$t, {
1286
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [vue.createVNode(_sfc_main$u, {
1287
1287
  "use-to": "dialog",
1288
1288
  title: __props.title || "提示",
1289
1289
  onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
1290
1290
  }, null, 8, ["title"]), vue.createElementVNode("div", {
1291
1291
  class: "confirm-body",
1292
1292
  innerHTML: __props.message || "请确认?"
1293
- }, null, 8, _hoisted_2$7), vue.createVNode(_sfc_main$u, {
1293
+ }, null, 8, _hoisted_2$8), vue.createVNode(_sfc_main$v, {
1294
1294
  align: "right",
1295
1295
  "cancel-name": __props.cancelName,
1296
1296
  "cancel-disabled": __props.cancelDisabled,
@@ -1303,7 +1303,7 @@
1303
1303
  }
1304
1304
  });
1305
1305
 
1306
- var _sfc_main$o = vue.defineComponent({
1306
+ var _sfc_main$p = vue.defineComponent({
1307
1307
  ...{
1308
1308
  name: "Loading",
1309
1309
  inheritAttrs: true
@@ -1342,7 +1342,7 @@
1342
1342
  }
1343
1343
  });
1344
1344
 
1345
- var _sfc_main$n = vue.defineComponent({
1345
+ var _sfc_main$o = vue.defineComponent({
1346
1346
  ...{
1347
1347
  name: "Dynamic",
1348
1348
  inheritAttrs: false
@@ -1366,7 +1366,7 @@
1366
1366
  const loadingComponent = vue.defineComponent({
1367
1367
  inheritAttrs: false,
1368
1368
  components: {
1369
- Loading: _sfc_main$o
1369
+ Loading: _sfc_main$p
1370
1370
  },
1371
1371
  template: "<Loading :mask-disabled='true' />"
1372
1372
  });
@@ -1433,7 +1433,7 @@
1433
1433
  }
1434
1434
  });
1435
1435
 
1436
- var _sfc_main$m = vue.defineComponent({
1436
+ var _sfc_main$n = vue.defineComponent({
1437
1437
  ...{
1438
1438
  name: "DialogContainer",
1439
1439
  inheritAttrs: true
@@ -1478,7 +1478,7 @@
1478
1478
  onClick: _cache[1] || (_cache[1] = vue.withModifiers($event => {
1479
1479
  __props.options.closeOnMask && vue.unref(closePopup)();
1480
1480
  }, ["self"]))
1481
- }, [vue.createVNode(_sfc_main$n, vue.mergeProps({
1481
+ }, [vue.createVNode(_sfc_main$o, vue.mergeProps({
1482
1482
  class: "dialog-body",
1483
1483
  name: __props.options.name,
1484
1484
  component: __props.options.component,
@@ -1493,7 +1493,7 @@
1493
1493
  }
1494
1494
  });
1495
1495
 
1496
- var _sfc_main$l = vue.defineComponent({
1496
+ var _sfc_main$m = vue.defineComponent({
1497
1497
  ...{
1498
1498
  name: "FollowContainer",
1499
1499
  inheritAttrs: true
@@ -1614,7 +1614,7 @@
1614
1614
  });
1615
1615
  });
1616
1616
  return (_ctx, _cache) => {
1617
- return vue.openBlock(), vue.createBlock(_sfc_main$n, vue.mergeProps({
1617
+ return vue.openBlock(), vue.createBlock(_sfc_main$o, vue.mergeProps({
1618
1618
  class: ["snail-follow initial", [__props.popupStatus.value, __props.popupTransition.value]],
1619
1619
  style: {
1620
1620
  "z-index": __props.zIndex
@@ -1631,7 +1631,7 @@
1631
1631
  }
1632
1632
  });
1633
1633
 
1634
- var _sfc_main$k = vue.defineComponent({
1634
+ var _sfc_main$l = vue.defineComponent({
1635
1635
  ...{
1636
1636
  name: "PopupContainer",
1637
1637
  inheritAttrs: true
@@ -1651,7 +1651,7 @@
1651
1651
  model = vue.shallowRef(void 0)
1652
1652
  } = __props.options;
1653
1653
  return (_ctx, _cache) => {
1654
- return vue.openBlock(), vue.createBlock(_sfc_main$n, vue.mergeProps({
1654
+ return vue.openBlock(), vue.createBlock(_sfc_main$o, vue.mergeProps({
1655
1655
  class: ["snail-popup", [__props.popupStatus.value, __props.popupTransition.value]],
1656
1656
  style: {
1657
1657
  "z-index": __props.zIndex
@@ -1669,12 +1669,12 @@
1669
1669
  }
1670
1670
  });
1671
1671
 
1672
- const _hoisted_1$a = {
1672
+ const _hoisted_1$b = {
1673
1673
  key: 1,
1674
1674
  class: "icon"
1675
1675
  };
1676
- const _hoisted_2$6 = ["innerHTML"];
1677
- var _sfc_main$j = vue.defineComponent({
1676
+ const _hoisted_2$7 = ["innerHTML"];
1677
+ var _sfc_main$k = vue.defineComponent({
1678
1678
  ...{
1679
1679
  name: "ToastContainer",
1680
1680
  inheritAttrs: true
@@ -1712,7 +1712,7 @@
1712
1712
  }),
1713
1713
  onMouseenter: _cache[3] || (_cache[3] = $event => onMouseEvent(false)),
1714
1714
  onMouseleave: _cache[4] || (_cache[4] = $event => onMouseEvent(true))
1715
- }, [vue.unref(props).closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
1715
+ }, [vue.unref(props).closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
1716
1716
  key: 0,
1717
1717
  class: "close-icon",
1718
1718
  type: "close",
@@ -1723,21 +1723,21 @@
1723
1723
  onClick: _cache[2] || (_cache[2] = $event => {
1724
1724
  vue.unref(closePopup)();
1725
1725
  })
1726
- }, null, 8, ["fill"])) : vue.createCommentVNode("", true), vue.unref(props).type ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [vue.createVNode(_sfc_main$x, {
1726
+ }, null, 8, ["fill"])) : vue.createCommentVNode("", true), vue.unref(props).type ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [vue.createVNode(_sfc_main$y, {
1727
1727
  type: vue.unref(props).type,
1728
1728
  fill: "#707070",
1729
1729
  size: 20
1730
1730
  }, null, 8, ["type"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", {
1731
1731
  class: "message",
1732
1732
  innerHTML: vue.unref(props).message
1733
- }, null, 8, _hoisted_2$6)], 38);
1733
+ }, null, 8, _hoisted_2$7)], 38);
1734
1734
  };
1735
1735
  }
1736
1736
  });
1737
1737
 
1738
1738
  function usePopup() {
1739
1739
  function popup(options) {
1740
- const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$k, options);
1740
+ const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$l, options);
1741
1741
  return addScope2Scopes(scope);
1742
1742
  }
1743
1743
  function dialog(options) {
@@ -1770,7 +1770,7 @@
1770
1770
  },
1771
1771
  onBeforeClose: fn => hook.register("onBeforeClose", fn)
1772
1772
  });
1773
- const descriptor = openPopup(_sfc_main$m, options, extOptions);
1773
+ const descriptor = openPopup(_sfc_main$n, options, extOptions);
1774
1774
  scope = snail_core.useAsyncScope(deferred.promise);
1775
1775
  monitorDialog(descriptor, scope, deferred);
1776
1776
  }
@@ -1788,14 +1788,14 @@
1788
1788
  inPopup: "follow",
1789
1789
  target
1790
1790
  };
1791
- scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$l, options, extOptions);
1791
+ scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$m, options, extOptions);
1792
1792
  }
1793
1793
  return addScope2Scopes(scope);
1794
1794
  }
1795
1795
  function confirm(title, message, options) {
1796
1796
  options = options || Object.create(null);
1797
1797
  return dialog({
1798
- component: _sfc_main$p,
1798
+ component: _sfc_main$q,
1799
1799
  closeOnEscape: true,
1800
1800
  props: {
1801
1801
  ...options,
@@ -1805,7 +1805,7 @@
1805
1805
  });
1806
1806
  }
1807
1807
  function toast(type, message, options) {
1808
- return popupInCustomContainer(_sfc_main$j, {
1808
+ return popupInCustomContainer(_sfc_main$k, {
1809
1809
  url: "#ToastContainer",
1810
1810
  props: {
1811
1811
  ...(options || Object.create(null)),
@@ -1838,7 +1838,7 @@
1838
1838
  },
1839
1839
  ...extOptions
1840
1840
  });
1841
- const descriptor = openPopup(container || _sfc_main$k, options, extOptions);
1841
+ const descriptor = openPopup(container || _sfc_main$l, options, extOptions);
1842
1842
  const scope = snail_core.useAsyncScope(deferred.promise);
1843
1843
  scope.onDestroy(() => destroyPopup(descriptor, deferred));
1844
1844
  return scope;
@@ -1976,12 +1976,12 @@
1976
1976
  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==";
1977
1977
  }
1978
1978
 
1979
- const _hoisted_1$9 = {
1979
+ const _hoisted_1$a = {
1980
1980
  class: "snail-empty"
1981
1981
  };
1982
- const _hoisted_2$5 = ["src"];
1983
- const _hoisted_3$5 = ["textContent"];
1984
- var _sfc_main$i = vue.defineComponent({
1982
+ const _hoisted_2$6 = ["src"];
1983
+ const _hoisted_3$6 = ["textContent"];
1984
+ var _sfc_main$j = vue.defineComponent({
1985
1985
  ...{
1986
1986
  name: "Empty",
1987
1987
  inheritAttrs: true
@@ -1994,23 +1994,23 @@
1994
1994
  setup(__props) {
1995
1995
  const defaultImageBase64 = getNoDataBase64Image();
1996
1996
  return (_ctx, _cache) => {
1997
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [vue.createElementVNode("img", {
1997
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [vue.createElementVNode("img", {
1998
1998
  src: __props.imageUrl || vue.unref(defaultImageBase64)
1999
- }, null, 8, _hoisted_2$5), vue.renderSlot(_ctx.$slots, "default", {}, () => [vue.createElementVNode("div", {
1999
+ }, null, 8, _hoisted_2$6), vue.renderSlot(_ctx.$slots, "default", {}, () => [vue.createElementVNode("div", {
2000
2000
  class: "message",
2001
2001
  textContent: vue.toDisplayString(__props.message || "无数据")
2002
- }, null, 8, _hoisted_3$5)])]);
2002
+ }, null, 8, _hoisted_3$6)])]);
2003
2003
  };
2004
2004
  }
2005
2005
  });
2006
2006
 
2007
- const _hoisted_1$8 = ["title"];
2008
- const _hoisted_2$4 = ["textContent"];
2009
- const _hoisted_3$4 = {
2007
+ const _hoisted_1$9 = ["title"];
2008
+ const _hoisted_2$5 = ["textContent"];
2009
+ const _hoisted_3$5 = {
2010
2010
  key: 1,
2011
2011
  class: "select-status"
2012
2012
  };
2013
- var _sfc_main$h = vue.defineComponent({
2013
+ var _sfc_main$i = vue.defineComponent({
2014
2014
  ...{
2015
2015
  name: "SelectNode",
2016
2016
  inheritAttrs: true
@@ -2055,15 +2055,15 @@
2055
2055
  }, [vue.createElementVNode("div", {
2056
2056
  class: "item-text ellipsis",
2057
2057
  textContent: vue.toDisplayString(__props.item.text)
2058
- }, null, 8, _hoisted_2$4), __props.item.type == "group" ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
2058
+ }, null, 8, _hoisted_2$5), __props.item.type == "group" ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
2059
2059
  key: 0,
2060
2060
  type: "arrow",
2061
2061
  color: "#8a9099"
2062
- })) : __props.multiple == true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, [vue.createVNode(_sfc_main$x, {
2062
+ })) : __props.multiple == true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, [vue.createVNode(_sfc_main$y, {
2063
2063
  type: "success",
2064
2064
  color: "white",
2065
2065
  size: 12
2066
- })])) : vue.createCommentVNode("", true)], 42, _hoisted_1$8)) : vue.createCommentVNode("", true), showRef.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
2066
+ })])) : vue.createCommentVNode("", true)], 42, _hoisted_1$9)) : vue.createCommentVNode("", true), showRef.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
2067
2067
  key: 1
2068
2068
  }, vue.renderList(vue.unref(showChildrenRef), child => {
2069
2069
  return vue.openBlock(), vue.createBlock(_component_SelectNode, {
@@ -2080,7 +2080,7 @@
2080
2080
  }
2081
2081
  });
2082
2082
 
2083
- var _sfc_main$g = vue.defineComponent({
2083
+ var _sfc_main$h = vue.defineComponent({
2084
2084
  ...{
2085
2085
  name: "Select2Popup",
2086
2086
  inheritAttrs: true
@@ -2252,13 +2252,13 @@
2252
2252
  key: 0
2253
2253
  }, [vue.createTextVNode(" 暂无选项 ")], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2254
2254
  key: 1
2255
- }, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$q, vue.mergeProps({
2255
+ }, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$r, vue.mergeProps({
2256
2256
  key: 0
2257
2257
  }, __props.search, {
2258
2258
  onSearch,
2259
2259
  key: "select-search"
2260
2260
  }), null, 16)) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(itemsRef.value, item => {
2261
- return vue.openBlock(), vue.createBlock(_sfc_main$h, {
2261
+ return vue.openBlock(), vue.createBlock(_sfc_main$i, {
2262
2262
  key: vue.unref(context).getKey(item),
2263
2263
  multiple: __props.multiple,
2264
2264
  item,
@@ -2267,7 +2267,7 @@
2267
2267
  onEnter: onEnterSelectNode,
2268
2268
  onClick: onClickSelectNode
2269
2269
  }, null, 8, ["multiple", "item", "context"]);
2270
- }), 128)), itemsRef.value.length == 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
2270
+ }), 128)), itemsRef.value.length == 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$j, {
2271
2271
  key: 1,
2272
2272
  message: "无结果"
2273
2273
  })) : vue.createCommentVNode("", true), showClearButtonRef.value ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -2279,20 +2279,20 @@
2279
2279
  }
2280
2280
  });
2281
2281
 
2282
- const _hoisted_1$7 = {
2282
+ const _hoisted_1$8 = {
2283
2283
  key: 0,
2284
2284
  class: "select-result"
2285
2285
  };
2286
- const _hoisted_2$3 = ["title", "textContent"];
2287
- const _hoisted_3$3 = ["textContent"];
2288
- const _hoisted_4$3 = {
2286
+ const _hoisted_2$4 = ["title", "textContent"];
2287
+ const _hoisted_3$4 = ["textContent"];
2288
+ const _hoisted_4$4 = {
2289
2289
  key: 1,
2290
2290
  class: "placeholder"
2291
2291
  };
2292
2292
  onAppCreated((app, type) => {
2293
- type == "popup" && app.component("SelectPopup", _sfc_main$g);
2293
+ type == "popup" && app.component("SelectPopup", _sfc_main$h);
2294
2294
  });
2295
- var _sfc_main$f = vue.defineComponent({
2295
+ var _sfc_main$g = vue.defineComponent({
2296
2296
  ...{
2297
2297
  name: "Select",
2298
2298
  inheritAttrs: true
@@ -2424,15 +2424,15 @@
2424
2424
  ref: "select"
2425
2425
  }, [__props.items && __props.items.length ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2426
2426
  key: 0
2427
- }, [selectedItemsRef.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))), () => [vue.createElementVNode("div", {
2427
+ }, [selectedItemsRef.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))), () => [vue.createElementVNode("div", {
2428
2428
  class: "select-text ellipsis",
2429
2429
  title: selectedTextRef.value,
2430
2430
  textContent: vue.toDisplayString(selectedTextRef.value)
2431
- }, null, 8, _hoisted_2$3)])])) : (vue.openBlock(), vue.createElementBlock("div", {
2431
+ }, null, 8, _hoisted_2$4)])])) : (vue.openBlock(), vue.createElementBlock("div", {
2432
2432
  key: 1,
2433
2433
  class: "placeholder",
2434
2434
  textContent: vue.toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
2435
- }, null, 8, _hoisted_3$3)), __props.readonly != true ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
2435
+ }, null, 8, _hoisted_3$4)), __props.readonly != true ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
2436
2436
  key: 2,
2437
2437
  type: "arrow",
2438
2438
  size: 24,
@@ -2440,12 +2440,12 @@
2440
2440
  style: {
2441
2441
  "transform": "rotate(90deg)"
2442
2442
  }
2443
- })) : vue.createCommentVNode("", true)], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, "暂无可选项"))], 2);
2443
+ })) : vue.createCommentVNode("", true)], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, "暂无可选项"))], 2);
2444
2444
  };
2445
2445
  }
2446
2446
  });
2447
2447
 
2448
- var _sfc_main$e = vue.defineComponent({
2448
+ var _sfc_main$f = vue.defineComponent({
2449
2449
  ...{
2450
2450
  name: "Switch",
2451
2451
  inheritAttrs: true
@@ -2494,8 +2494,8 @@
2494
2494
  }
2495
2495
  });
2496
2496
 
2497
- const _hoisted_1$6 = ["readonly", "placeholder", "rows"];
2498
- var _sfc_main$d = vue.defineComponent({
2497
+ const _hoisted_1$7 = ["readonly", "placeholder", "rows"];
2498
+ var _sfc_main$e = vue.defineComponent({
2499
2499
  ...{
2500
2500
  name: "Textarea"
2501
2501
  },
@@ -2555,25 +2555,25 @@
2555
2555
  onInput: _cache[2] || (_cache[2] = $event => emits("input", textareaDom.value.value)),
2556
2556
  onBlur: _cache[3] || (_cache[3] = $event => emits("blur", textareaDom.value.value)),
2557
2557
  onChange: _cache[4] || (_cache[4] = $event => emits("change", textareaDom.value.value))
2558
- }), null, 16, _hoisted_1$6)), [[vue.vModelText, valueModel.value]]);
2558
+ }), null, 16, _hoisted_1$7)), [[vue.vModelText, valueModel.value]]);
2559
2559
  };
2560
2560
  }
2561
2561
  });
2562
2562
 
2563
- const _hoisted_1$5 = {
2563
+ const _hoisted_1$6 = {
2564
2564
  class: "fold-header"
2565
2565
  };
2566
- const _hoisted_2$2 = ["textContent"];
2567
- const _hoisted_3$2 = ["textContent"];
2568
- const _hoisted_4$2 = {
2566
+ const _hoisted_2$3 = ["textContent"];
2567
+ const _hoisted_3$3 = ["textContent"];
2568
+ const _hoisted_4$3 = {
2569
2569
  key: 1,
2570
2570
  class: "status"
2571
2571
  };
2572
- const _hoisted_5$1 = {
2572
+ const _hoisted_5$2 = {
2573
2573
  class: "fold-body",
2574
2574
  ref: "foldBody"
2575
2575
  };
2576
- var _sfc_main$c = vue.defineComponent({
2576
+ var _sfc_main$d = vue.defineComponent({
2577
2577
  ...{
2578
2578
  name: "Fold",
2579
2579
  inheritAttrs: true
@@ -2643,23 +2643,23 @@
2643
2643
  return (_ctx, _cache) => {
2644
2644
  return vue.openBlock(), vue.createElementBlock("div", {
2645
2645
  class: vue.normalizeClass(["snail-fold", statusModel.value])
2646
- }, [vue.createElementVNode("div", _hoisted_1$5, [vue.renderSlot(_ctx.$slots, "header", {}, () => [vue.createElementVNode("div", {
2646
+ }, [vue.createElementVNode("div", _hoisted_1$6, [vue.renderSlot(_ctx.$slots, "header", {}, () => [vue.createElementVNode("div", {
2647
2647
  class: "title ellipsis",
2648
2648
  textContent: vue.toDisplayString(__props.title)
2649
- }, null, 8, _hoisted_2$2), !!__props.subtitle ? (vue.openBlock(), vue.createElementBlock("div", {
2649
+ }, null, 8, _hoisted_2$3), !!__props.subtitle ? (vue.openBlock(), vue.createElementBlock("div", {
2650
2650
  key: 0,
2651
2651
  class: "subtitle ellipsis",
2652
2652
  textContent: vue.toDisplayString(__props.subtitle)
2653
- }, null, 8, _hoisted_3$2)) : vue.createCommentVNode("", true), __props.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [vue.createVNode(_sfc_main$x, {
2653
+ }, null, 8, _hoisted_3$3)) : vue.createCommentVNode("", true), __props.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [vue.createVNode(_sfc_main$y, {
2654
2654
  type: "arrow",
2655
2655
  title: statusModel.value == "expand" ? "收起" : "展开",
2656
2656
  onClick: onStatusClick
2657
- }, null, 8, ["title"])])) : vue.createCommentVNode("", true)])]), vue.createElementVNode("div", _hoisted_5$1, [vue.renderSlot(_ctx.$slots, "default")], 512)], 2);
2657
+ }, null, 8, ["title"])])) : vue.createCommentVNode("", true)])]), vue.createElementVNode("div", _hoisted_5$2, [vue.renderSlot(_ctx.$slots, "default")], 512)], 2);
2658
2658
  };
2659
2659
  }
2660
2660
  });
2661
2661
 
2662
- var _sfc_main$b = vue.defineComponent({
2662
+ var _sfc_main$c = vue.defineComponent({
2663
2663
  ...{
2664
2664
  name: "Scroll",
2665
2665
  inheritAttrs: true
@@ -2789,11 +2789,11 @@
2789
2789
  }
2790
2790
  });
2791
2791
 
2792
- var _sfc_main$a = vue.defineComponent({
2792
+ var _sfc_main$b = vue.defineComponent({
2793
2793
  __name: "layout",
2794
2794
  props: {
2795
2795
  mode: {},
2796
- default: {},
2796
+ main: {},
2797
2797
  left: {},
2798
2798
  right: {},
2799
2799
  top: {},
@@ -2803,8 +2803,8 @@
2803
2803
  const props = __props;
2804
2804
  const areaMap = vue.computed(() => {
2805
2805
  const map = Object.create(null);
2806
- map.default = {
2807
- scrollable: props.default && props.default.scroll != void 0,
2806
+ map.main = {
2807
+ scrollable: props.main && props.main.scroll != void 0,
2808
2808
  class: "main-area",
2809
2809
  style: void 0
2810
2810
  };
@@ -2850,12 +2850,12 @@
2850
2850
  return (_ctx, _cache) => {
2851
2851
  return vue.openBlock(), vue.createElementBlock("div", {
2852
2852
  class: vue.normalizeClass(["snail-layout", __props.mode])
2853
- }, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["top", "left", "default", "right", "bottom"], item => {
2853
+ }, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["top", "left", "main", "right", "bottom"], item => {
2854
2854
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2855
2855
  key: item
2856
2856
  }, [areaMap.value[item] && _ctx.$slots[item] ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
2857
2857
  key: 0
2858
- }, [areaMap.value[item].scrollable ? (vue.openBlock(), vue.createBlock(_sfc_main$b, vue.mergeProps({
2858
+ }, [areaMap.value[item].scrollable ? (vue.openBlock(), vue.createBlock(_sfc_main$c, vue.mergeProps({
2859
2859
  key: 0,
2860
2860
  class: areaMap.value[item].class,
2861
2861
  style: areaMap.value[item].style
@@ -2874,7 +2874,7 @@
2874
2874
  }
2875
2875
  });
2876
2876
 
2877
- var _sfc_main$9 = vue.defineComponent({
2877
+ var _sfc_main$a = vue.defineComponent({
2878
2878
  ...{
2879
2879
  name: "Sort",
2880
2880
  inheritAttrs: true
@@ -2975,10 +2975,10 @@
2975
2975
  }
2976
2976
  });
2977
2977
 
2978
- const _hoisted_1$4 = {
2978
+ const _hoisted_1$5 = {
2979
2979
  class: "table-body"
2980
2980
  };
2981
- var _sfc_main$8 = vue.defineComponent({
2981
+ var _sfc_main$9 = vue.defineComponent({
2982
2982
  ...{
2983
2983
  name: "Table",
2984
2984
  inheritAttrs: true
@@ -3003,7 +3003,7 @@
3003
3003
  const hStyleRef = vue.computed(() => snail_view.css.buildStyle(props.headerStyle));
3004
3004
  const fStyleRef = vue.computed(() => snail_view.css.buildStyle(props.footerStyle));
3005
3005
  return (_ctx, _cache) => {
3006
- return vue.openBlock(), vue.createBlock(_sfc_main$b, {
3006
+ return vue.openBlock(), vue.createBlock(_sfc_main$c, {
3007
3007
  class: vue.normalizeClass(["snail-table", {
3008
3008
  "start-border": __props.border == true
3009
3009
  }]),
@@ -3013,7 +3013,7 @@
3013
3013
  default: vue.withCtx(() => [vue.createElementVNode("div", {
3014
3014
  class: "table-header",
3015
3015
  style: vue.normalizeStyle(hStyleRef.value)
3016
- }, [vue.renderSlot(_ctx.$slots, "header")], 4), vue.createElementVNode("div", _hoisted_1$4, [vue.renderSlot(_ctx.$slots, "default")]), vue.createElementVNode("div", {
3016
+ }, [vue.renderSlot(_ctx.$slots, "header")], 4), vue.createElementVNode("div", _hoisted_1$5, [vue.renderSlot(_ctx.$slots, "default")]), vue.createElementVNode("div", {
3017
3017
  class: "table-footer",
3018
3018
  style: vue.normalizeStyle(fStyleRef.value)
3019
3019
  }, [vue.renderSlot(_ctx.$slots, "footer")], 4)]),
@@ -3023,7 +3023,7 @@
3023
3023
  }
3024
3024
  });
3025
3025
 
3026
- var _sfc_main$7 = vue.defineComponent({
3026
+ var _sfc_main$8 = vue.defineComponent({
3027
3027
  ...{
3028
3028
  name: "TableRow",
3029
3029
  inheritAttrs: true
@@ -3046,7 +3046,7 @@
3046
3046
  }
3047
3047
  });
3048
3048
 
3049
- var _sfc_main$6 = vue.defineComponent({
3049
+ var _sfc_main$7 = vue.defineComponent({
3050
3050
  ...{
3051
3051
  name: "TableCol",
3052
3052
  inheritAttrs: true
@@ -3092,7 +3092,7 @@
3092
3092
  }
3093
3093
  });
3094
3094
 
3095
- var _sfc_main$5 = vue.defineComponent({
3095
+ var _sfc_main$6 = vue.defineComponent({
3096
3096
  __name: "transitions",
3097
3097
  props: {
3098
3098
  group: {
@@ -3132,20 +3132,20 @@
3132
3132
  }
3133
3133
  });
3134
3134
 
3135
- const _hoisted_1$3 = {
3135
+ const _hoisted_1$4 = {
3136
3136
  key: 0,
3137
3137
  class: "node-fold"
3138
3138
  };
3139
- const _hoisted_2$1 = ["title", "textContent"];
3140
- const _hoisted_3$1 = {
3139
+ const _hoisted_2$2 = ["title", "textContent"];
3140
+ const _hoisted_3$2 = {
3141
3141
  class: "node-slot ellipsis"
3142
3142
  };
3143
- const _hoisted_4$1 = {
3143
+ const _hoisted_4$2 = {
3144
3144
  key: 1,
3145
3145
  class: "snail-tree-children hidden",
3146
3146
  ref: "children"
3147
3147
  };
3148
- var _sfc_main$4 = vue.defineComponent({
3148
+ var _sfc_main$5 = vue.defineComponent({
3149
3149
  ...{
3150
3150
  name: "TreeNode",
3151
3151
  inheritAttrs: true
@@ -3263,7 +3263,7 @@
3263
3263
  key: 1
3264
3264
  }, [_cache[4] || (_cache[4] = vue.createElementVNode("div", {
3265
3265
  class: "indent"
3266
- }, null, -1)), __props.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [showChildrenRef.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
3266
+ }, null, -1)), __props.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [showChildrenRef.value ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
3267
3267
  key: 0,
3268
3268
  class: vue.normalizeClass(statusRef.value),
3269
3269
  type: "custom",
@@ -3275,7 +3275,7 @@
3275
3275
  class: "node-text ellipsis",
3276
3276
  title: __props.node.text,
3277
3277
  textContent: vue.toDisplayString(__props.node.text)
3278
- }, null, 8, _hoisted_2$1), vue.createElementVNode("div", _hoisted_3$1, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))))])], 64))], 34)) : vue.createCommentVNode("", true), showRef.value && showChildrenRef.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.node.children, child => {
3278
+ }, null, 8, _hoisted_2$2), vue.createElementVNode("div", _hoisted_3$2, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))))])], 64))], 34)) : vue.createCommentVNode("", true), showRef.value && showChildrenRef.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.node.children, child => {
3279
3279
  return vue.openBlock(), vue.createBlock(_component_TreeNode, {
3280
3280
  key: __props.context.getKey(child),
3281
3281
  node: child,
@@ -3295,10 +3295,10 @@
3295
3295
  }
3296
3296
  });
3297
3297
 
3298
- const _hoisted_1$2 = {
3298
+ const _hoisted_1$3 = {
3299
3299
  class: "snail-tree"
3300
3300
  };
3301
- var _sfc_main$3 = vue.defineComponent({
3301
+ var _sfc_main$4 = vue.defineComponent({
3302
3302
  ...{
3303
3303
  name: "Tree",
3304
3304
  inheritAttrs: true
@@ -3332,15 +3332,15 @@
3332
3332
  emits("click", node, parents);
3333
3333
  }
3334
3334
  return (_ctx, _cache) => {
3335
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$q, vue.mergeProps({
3335
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$r, vue.mergeProps({
3336
3336
  key: 0
3337
3337
  }, __props.search, {
3338
3338
  onSearch
3339
- }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$b, {
3339
+ }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$c, {
3340
3340
  "scroll-y": true
3341
3341
  }, {
3342
3342
  default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.nodes || [], node => {
3343
- return vue.openBlock(), vue.createBlock(_sfc_main$4, {
3343
+ return vue.openBlock(), vue.createBlock(_sfc_main$5, {
3344
3344
  key: vue.unref(context).getKey(node),
3345
3345
  node,
3346
3346
  parent: void 0,
@@ -3361,7 +3361,7 @@
3361
3361
  }
3362
3362
  });
3363
3363
 
3364
- var _sfc_main$2 = vue.defineComponent({
3364
+ var _sfc_main$3 = vue.defineComponent({
3365
3365
  __name: "wrapper",
3366
3366
  props: {
3367
3367
  readonly: {
@@ -3383,14 +3383,14 @@
3383
3383
  return (_ctx, _cache) => {
3384
3384
  return vue.openBlock(), vue.createElementBlock("div", {
3385
3385
  class: vue.normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
3386
- }, [__props.header && __props.header.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, vue.mergeProps({
3386
+ }, [__props.header && __props.header.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$u, vue.mergeProps({
3387
3387
  key: 0
3388
3388
  }, __props.header || {
3389
3389
  useTo: "dialog",
3390
3390
  title: "对话框"
3391
3391
  }, {
3392
3392
  onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
3393
- }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$b, vue.mergeProps({
3393
+ }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$c, vue.mergeProps({
3394
3394
  class: "wrapper-body"
3395
3395
  }, __props.content || {
3396
3396
  scrollX: false,
@@ -3398,7 +3398,7 @@
3398
3398
  }), {
3399
3399
  default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]),
3400
3400
  _: 3
3401
- }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$u, vue.mergeProps({
3401
+ }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$v, vue.mergeProps({
3402
3402
  key: 1
3403
3403
  }, __props.footer || {}, {
3404
3404
  onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
@@ -3412,7 +3412,7 @@
3412
3412
  snail_core.mustObject(options, "options");
3413
3413
  target instanceof HTMLElement || snail_core.throwError("target must be a HTMLElement");
3414
3414
  target.classList.add("snail-app");
3415
- const app = vue.createApp(_sfc_main$n, options);
3415
+ const app = vue.createApp(_sfc_main$o, options);
3416
3416
  triggerAppCreated(app);
3417
3417
  app.mount(target);
3418
3418
  const scope = snail_core.useScope().onDestroy(() => app.unmount());
@@ -3420,36 +3420,182 @@
3420
3420
  return scope;
3421
3421
  }
3422
3422
 
3423
- const _hoisted_1$1 = {
3423
+ function initStepByFormat(format) {
3424
+ switch (format) {
3425
+ case "yyyy":
3426
+ return "year";
3427
+ case "yyyy-MM":
3428
+ return "month";
3429
+ default:
3430
+ return "day";
3431
+ }
3432
+ }
3433
+ function electDateValue(min, max) {
3434
+ return snail_core.getDateValue(new Date());
3435
+ }
3436
+ function buildYearItems(year, min, max) {
3437
+ year = year - 10;
3438
+ const items = new Array(18);
3439
+ for (var index = 0; index < items.length; index++) {
3440
+ year += 1;
3441
+ items[index] = Object.freeze({
3442
+ year,
3443
+ disabled: min && min.year != void 0 && year < min.year || max && max.year != void 0 && year > max.year
3444
+ });
3445
+ }
3446
+ return items;
3447
+ }
3448
+ function buildMonthItems(yearItem, min, max) {
3449
+ const minDate = new Date(snail_core.formatDateValue(min, "yyyy-MM"));
3450
+ const maxDate = new Date(snail_core.formatDateValue(max, "yyyy-MM"));
3451
+ const items = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"];
3452
+ return items.map((item, index) => {
3453
+ const mi = {
3454
+ text: item,
3455
+ month: index + 1,
3456
+ year: yearItem.year,
3457
+ disabled: yearItem.disabled
3458
+ };
3459
+ if (mi.disabled != true) {
3460
+ const date = new Date(snail_core.formatDateValue(mi, "yyyy-MM"));
3461
+ mi.disabled = minDate != void 0 && date < minDate || maxDate != void 0 && date > maxDate;
3462
+ }
3463
+ return Object.freeze(mi);
3464
+ });
3465
+ }
3466
+ function buildDayItems(monthItem, min, max) {
3467
+ const minDate = new Date(snail_core.formatDateValue(min, "yyyy-MM-dd"));
3468
+ const maxDate = new Date(snail_core.formatDateValue(max, "yyyy-MM-dd"));
3469
+ const date = new Date(monthItem.year, monthItem.month - 1);
3470
+ date.setDate(date.getDate() - (date.getDay() || 7) - 1);
3471
+ const items = new Array(42);
3472
+ for (var index = 0; index < items.length; index++) {
3473
+ date.setDate(date.getDate() + 1);
3474
+ const item = {
3475
+ day: date.getDate(),
3476
+ month: date.getMonth() + 1,
3477
+ year: date.getFullYear(),
3478
+ disabled: monthItem.disabled
3479
+ };
3480
+ if (item.disabled != true) {
3481
+ const date2 = new Date(snail_core.formatDateValue(item, "yyyy-MM-dd"));
3482
+ item.disabled = minDate != void 0 && date2 < minDate || maxDate != void 0 && date2 > maxDate;
3483
+ }
3484
+ items[index] = Object.freeze(item);
3485
+ }
3486
+ return items;
3487
+ }
3488
+ function buildHourItems(min, max) {
3489
+ const items = new Array(24);
3490
+ for (var index = 0; index < items.length; index++) {
3491
+ items[index] = Object.freeze({
3492
+ hour: index,
3493
+ disabled: min && min.hour != void 0 && index < min.hour || max && max.hour != void 0 && index > max.hour
3494
+ });
3495
+ }
3496
+ return items;
3497
+ }
3498
+ function buildMinuteItems(hourItem, min, max) {
3499
+ const items = new Array(60);
3500
+ const minNumber = min && min.minute != void 0 ? getTimeNumber(min.hour, min.minute, 0) : void 0;
3501
+ const maxNumber = max && max.minute != void 0 ? getTimeNumber(max.hour, max.minute, 0) : void 0;
3502
+ for (let index = 0; index < items.length; index++) {
3503
+ const item = {
3504
+ minute: index,
3505
+ hour: hourItem.hour,
3506
+ disabled: hourItem.disabled
3507
+ };
3508
+ if (item.disabled != true) {
3509
+ const number = getTimeNumber(item.hour, item.minute, 0);
3510
+ item.disabled = minNumber != void 0 && number < minNumber || maxNumber != void 0 && number > maxNumber;
3511
+ }
3512
+ items[index] = Object.freeze(item);
3513
+ }
3514
+ return items;
3515
+ }
3516
+ function buildSecondItems(minuteItem, min, max) {
3517
+ const items = new Array(60);
3518
+ const minNumber = min && min.minute != void 0 ? getTimeNumber(min.hour, min.minute, min.second) : void 0;
3519
+ const maxNumber = max && max.minute != void 0 ? getTimeNumber(max.hour, max.minute, max.second) : void 0;
3520
+ for (let index = 0; index < items.length; index++) {
3521
+ const item = {
3522
+ second: index,
3523
+ minute: minuteItem.minute,
3524
+ hour: minuteItem.hour,
3525
+ disabled: minuteItem.disabled
3526
+ };
3527
+ if (item.disabled != true) {
3528
+ const number = getTimeNumber(item.hour, item.minute, item.second);
3529
+ item.disabled = minNumber != void 0 && number < minNumber || maxNumber != void 0 && number > maxNumber;
3530
+ }
3531
+ items[index] = Object.freeze(item);
3532
+ }
3533
+ return items;
3534
+ }
3535
+ function getTimeNumber(hour, minute, second) {
3536
+ return (hour || 0) * 1e4 + (minute || 0) * 100 + (second || 0);
3537
+ }
3538
+ function isValidTime(format, time, min, max) {
3539
+ time = snail_core.correctTimeValue(time);
3540
+ if (time) {
3541
+ min = snail_core.correctTimeValue({
3542
+ ...min
3543
+ });
3544
+ const timeNumber = getTimeNumber(time.hour, time.minute, format == "HH:mm" ? 0 : time.second);
3545
+ if (min != void 0) {
3546
+ const minNumber = getTimeNumber(min.hour, min.minute, format == "HH:mm" ? 0 : max.second);
3547
+ if (timeNumber < minNumber) {
3548
+ return false;
3549
+ }
3550
+ }
3551
+ max = snail_core.correctTimeValue({
3552
+ ...max
3553
+ });
3554
+ if (max != void 0) {
3555
+ const maxNumber = getTimeNumber(max.hour, max.minute, format == "HH:mm" ? 0 : max.second);
3556
+ if (timeNumber > maxNumber) {
3557
+ return false;
3558
+ }
3559
+ }
3560
+ return true;
3561
+ }
3562
+ return false;
3563
+ }
3564
+
3565
+ const _hoisted_1$2 = {
3424
3566
  class: "tz-item",
3425
3567
  ref: "hour-items"
3426
3568
  };
3427
- const _hoisted_2 = ["textContent", "onClick"];
3428
- const _hoisted_3 = {
3569
+ const _hoisted_2$1 = ["textContent", "onClick"];
3570
+ const _hoisted_3$1 = {
3429
3571
  class: "tz-item",
3430
3572
  ref: "minute-items"
3431
3573
  };
3432
- const _hoisted_4 = ["textContent", "onClick"];
3433
- const _hoisted_5 = {
3574
+ const _hoisted_4$1 = ["textContent", "onClick"];
3575
+ const _hoisted_5$1 = {
3434
3576
  key: 0,
3435
3577
  class: "tz-item",
3436
3578
  ref: "second-items"
3437
3579
  };
3438
- const _hoisted_6 = ["textContent", "onClick"];
3439
- var _sfc_main$1 = vue.defineComponent({
3580
+ const _hoisted_6$1 = ["textContent", "onClick"];
3581
+ var _sfc_main$2 = vue.defineComponent({
3440
3582
  __name: "time-pc",
3441
3583
  props: {
3442
3584
  value: {},
3443
- initialDisabled: {
3585
+ format: {},
3586
+ min: {},
3587
+ max: {},
3588
+ toolbarDisabled: {
3444
3589
  type: Boolean
3445
3590
  },
3446
3591
  nowDisabled: {
3447
3592
  type: Boolean
3448
3593
  },
3449
- manager: {},
3450
- format: {},
3451
- min: {},
3452
- max: {},
3594
+ clearDisabled: {
3595
+ type: Boolean
3596
+ },
3597
+ popup: {},
3598
+ picker: {},
3453
3599
  inPopup: {},
3454
3600
  closePopup: {
3455
3601
  type: Function
@@ -3467,203 +3613,543 @@
3467
3613
  } = _ref;
3468
3614
  const props = __props;
3469
3615
  const emits = __emit;
3470
- const tm = props.manager || snail_core.useTime({
3471
- format: props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss",
3472
- min: snail_core.parseTime(props.min),
3473
- max: snail_core.parseTime(props.max)
3474
- });
3475
- const {
3476
- toast
3477
- } = usePopup();
3478
- const {
3479
- inPopup,
3480
- closePopup
3481
- } = props;
3482
- const secondDisabled = tm.format == "HH:mm";
3483
- const tvRef = vue.ref();
3616
+ const format = props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss";
3617
+ const min = snail_core.parseTimeValue(props.min);
3618
+ const max = snail_core.parseTimeValue(props.max);
3619
+ const timeRef = vue.ref(snail_core.parseTimeValue(props.value) || snail_core.getTimeValue(new Date()));
3620
+ const isValidTimeRef = vue.computed(() => format == "HH:mm" ? minuteItems.value && minuteItems.value[timeRef.value.minute].disabled != true : secondItems.value && secondItems.value[timeRef.value.second].disabled != true);
3621
+ const hourItems = vue.shallowRef(buildHourItems(min, max));
3622
+ const minuteItems = vue.shallowRef();
3623
+ const secondItems = vue.shallowRef();
3484
3624
  const hItemsDom = vue.useTemplateRef("hour-items");
3485
3625
  const mItemsDom = vue.useTemplateRef("minute-items");
3486
3626
  const sItemsDom = vue.useTemplateRef("second-items");
3487
- function getTimeClass(type, value) {
3488
- switch (type) {
3489
- case "hour":
3490
- return {
3491
- active: tvRef.value.hour == value,
3492
- disabled: tm.validateHH(value) == false
3493
- };
3494
- case "minute":
3495
- return {
3496
- active: tvRef.value.minute == value,
3497
- disabled: tm.validateHHmm(tvRef.value.hour, value) == false
3498
- };
3499
- case "second":
3500
- return {
3501
- active: tvRef.value.second == value,
3502
- disabled: tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value) == false
3503
- };
3504
- }
3627
+ async function rebuildItems(time) {
3628
+ time != void 0 && (timeRef.value = time);
3629
+ minuteItems.value = buildMinuteItems(hourItems.value[timeRef.value.hour], min, max);
3630
+ secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
3631
+ await vue.nextTick();
3632
+ scrollIntoView(hItemsDom.value);
3633
+ scrollIntoView(mItemsDom.value);
3634
+ scrollIntoView(sItemsDom.value);
3505
3635
  }
3506
3636
  function scrollIntoView(items) {
3507
- let activeIndex = void 0,
3508
- firstValidIndex;
3637
+ let activeIndex = void 0;
3509
3638
  for (var index = 0; index < (items ? items.children.length : 0); index++) {
3510
3639
  const ele = items.children[index];
3511
- if (ele.classList.contains("disabled") == true) {
3512
- continue;
3513
- }
3514
- if (firstValidIndex == void 0) {
3515
- firstValidIndex = index;
3516
- }
3517
3640
  if (ele.classList.contains("active") == true) {
3518
3641
  activeIndex = index;
3519
3642
  break;
3520
3643
  }
3521
3644
  }
3522
- let showIndex = activeIndex;
3523
- if (activeIndex == void 0) {
3524
- if (firstValidIndex != void 0) {
3525
- showIndex = firstValidIndex;
3526
- }
3527
- }
3528
- showIndex != void 0 && items.children[showIndex].scrollIntoView({
3645
+ activeIndex != void 0 && items.children[activeIndex].scrollIntoView({
3529
3646
  behavior: "smooth",
3530
3647
  block: "center"
3531
3648
  });
3532
3649
  }
3533
- async function onTimeClick(type, value) {
3534
- switch (type) {
3535
- case "hour":
3536
- if (tm.validateHH(value)) {
3537
- tvRef.value.hour = value;
3538
- await vue.nextTick();
3539
- scrollIntoView(mItemsDom.value);
3540
- }
3541
- break;
3542
- case "minute":
3543
- if (tm.validateHHmm(tvRef.value.hour, value)) {
3544
- tvRef.value.minute = value;
3545
- await vue.nextTick();
3546
- scrollIntoView(sItemsDom.value);
3547
- }
3548
- break;
3549
- case "second":
3550
- if (tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value)) {
3551
- tvRef.value.second = value;
3552
- }
3553
- break;
3650
+ function onHourClick(item) {
3651
+ if (item.disabled != true && timeRef.value.hour != item.hour) {
3652
+ timeRef.value.hour = item.hour;
3653
+ minuteItems.value = buildMinuteItems(item, min, max);
3654
+ secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
3554
3655
  }
3555
3656
  }
3556
- async function onNow() {
3557
- tvRef.value = snail_core.getTimeNow();
3558
- if (tm.validate(tvRef.value)) {
3559
- await vue.nextTick();
3560
- scrollIntoView(hItemsDom.value);
3561
- scrollIntoView(mItemsDom.value);
3562
- scrollIntoView(sItemsDom.value);
3657
+ function onMinuteClick(item) {
3658
+ if (item.disabled != true) {
3659
+ if (format == "HH:mm") {
3660
+ const value = snail_core.formatTimeValue(item, "HH:mm");
3661
+ emits("confirm", value);
3662
+ props.inPopup && props.closePopup(value);
3663
+ } else if (timeRef.value.minute != item.minute) {
3664
+ timeRef.value.minute = item.minute;
3665
+ secondItems.value = buildSecondItems(item, min, max);
3666
+ }
3563
3667
  }
3564
3668
  }
3565
- function onConfirm() {
3566
- tvRef.value = tm.correct(tvRef.value) || Object.create(null);
3567
- if (tvRef.value == void 0 || tvRef.value.hour == void 0) {
3568
- return toast("error", "请选选择时间");
3569
- }
3570
- if (secondDisabled != true && tvRef.value.minute == void 0) {
3571
- return toast("error", "请选选择时间");
3669
+ function onSecondClick(item) {
3670
+ if (item.disabled != true) {
3671
+ timeRef.value.second = item.second;
3672
+ onConfirm();
3572
3673
  }
3573
- const value = tm.toString(tvRef.value);
3574
- emits("confirm", value);
3575
- inPopup && closePopup(value);
3576
3674
  }
3577
- {
3578
- props.value && (tvRef.value = tm.parse(props.value));
3579
- tvRef.value || props.initialDisabled || (tvRef.value = tm.correct(snail_core.getTimeNow()));
3580
- tvRef.value || (tvRef.value = Object.create(null));
3675
+ function onConfirm() {
3676
+ if (isValidTimeRef.value == true) {
3677
+ const value = snail_core.formatTimeValue(timeRef.value, format);
3678
+ emits("confirm", value);
3679
+ props.inPopup && props.closePopup(value);
3680
+ }
3581
3681
  }
3582
- vue.onMounted(async () => {
3583
- await vue.nextTick();
3584
- scrollIntoView(hItemsDom.value);
3585
- scrollIntoView(mItemsDom.value);
3586
- scrollIntoView(sItemsDom.value);
3587
- });
3682
+ vue.onMounted(rebuildItems);
3588
3683
  return (_ctx, _cache) => {
3589
- return vue.openBlock(), vue.createBlock(_sfc_main$a, {
3590
- class: vue.normalizeClass(["snail-time-picker pc", {
3591
- "second-disabled": secondDisabled
3684
+ return vue.openBlock(), vue.createBlock(_sfc_main$b, {
3685
+ class: vue.normalizeClass(["time-picker pc", {
3686
+ "second-disabled": vue.unref(format) != "HH:mm:ss"
3592
3687
  }]),
3593
3688
  mode: "vertical"
3594
- }, {
3595
- default: vue.withCtx(() => [vue.createVNode(_sfc_main$5, {
3689
+ }, vue.createSlots({
3690
+ main: vue.withCtx(() => [vue.createVNode(_sfc_main$6, {
3596
3691
  group: true,
3597
3692
  effect: "down-up"
3598
3693
  }, {
3599
- default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array(24).fill(void 0), (_, index) => {
3694
+ default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1$2, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(hourItems.value, item => {
3600
3695
  return vue.openBlock(), vue.createElementBlock("div", {
3601
- class: vue.normalizeClass(["tzi-number", getTimeClass("hour", index)]),
3602
- textContent: vue.toDisplayString(String(index).padStart(2, "0")),
3603
- onClick: $event => onTimeClick("hour", index)
3604
- }, null, 10, _hoisted_2);
3605
- }), 256))], 512), vue.createElementVNode("div", _hoisted_3, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array(60).fill(void 0), (_, index) => {
3696
+ class: vue.normalizeClass(["tzi-number", {
3697
+ active: item.hour == timeRef.value.hour,
3698
+ disabled: item.disabled
3699
+ }]),
3700
+ key: item.hour,
3701
+ textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.hour, 2, "0")),
3702
+ onClick: $event => onHourClick(item)
3703
+ }, null, 10, _hoisted_2$1);
3704
+ }), 128))], 512), vue.createElementVNode("div", _hoisted_3$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(minuteItems.value, item => {
3606
3705
  return vue.openBlock(), vue.createElementBlock("div", {
3607
- class: vue.normalizeClass(["tzi-number", getTimeClass("minute", index)]),
3608
- textContent: vue.toDisplayString(String(index).padStart(2, "0")),
3609
- onClick: $event => onTimeClick("minute", index)
3610
- }, null, 10, _hoisted_4);
3611
- }), 256))], 512), secondDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Array(60).fill(void 0), (_, index) => {
3706
+ class: vue.normalizeClass(["tzi-number", {
3707
+ active: item.minute == timeRef.value.minute,
3708
+ disabled: item.disabled
3709
+ }]),
3710
+ key: `${item.hour}:${item.minute}`,
3711
+ textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.minute, 2, "0")),
3712
+ onClick: $event => onMinuteClick(item)
3713
+ }, null, 10, _hoisted_4$1);
3714
+ }), 128))], 512), vue.unref(format) == "HH:mm:ss" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(secondItems.value, item => {
3612
3715
  return vue.openBlock(), vue.createElementBlock("div", {
3613
- class: vue.normalizeClass(["tzi-number", getTimeClass("second", index)]),
3614
- textContent: vue.toDisplayString(String(index).padStart(2, "0")),
3615
- onClick: $event => onTimeClick("second", index)
3616
- }, null, 10, _hoisted_6);
3617
- }), 256))], 512)) : vue.createCommentVNode("", true)]),
3618
- bottom: vue.withCtx(() => [vue.createVNode(_sfc_main$y, {
3619
- type: "link",
3620
- size: "small",
3621
- textContent: "清空",
3622
- onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), vue.unref(inPopup) && vue.unref(closePopup)("")))
3623
- }), vue.unref(tm).validate(vue.unref(snail_core.getTimeNow)()) ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
3624
- key: 0,
3625
- type: "link",
3626
- size: "small",
3627
- textContent: "现在",
3628
- onClick: onNow
3629
- })) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$y, {
3630
- type: "link",
3631
- size: "small",
3632
- textContent: "确定",
3633
- onClick: onConfirm
3634
- })]),
3716
+ class: vue.normalizeClass(["tzi-number", {
3717
+ active: item.second == timeRef.value.second,
3718
+ disabled: item.disabled
3719
+ }]),
3720
+ key: `${item.hour}:${item.minute}:${item.second}`,
3721
+ textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.second, 2, "0")),
3722
+ onClick: $event => onSecondClick(item)
3723
+ }, null, 10, _hoisted_6$1);
3724
+ }), 128))], 512)) : vue.createCommentVNode("", true)]),
3635
3725
  _: 1
3636
3726
  })]),
3637
- _: 1
3638
- }, 8, ["class"]);
3727
+ _: 2
3728
+ }, [__props.toolbarDisabled != true ? {
3729
+ name: "bottom",
3730
+ fn: vue.withCtx(() => [__props.clearDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
3731
+ key: 0,
3732
+ type: "link",
3733
+ size: "small",
3734
+ textContent: "清空",
3735
+ onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), __props.inPopup && __props.closePopup("")))
3736
+ })) : vue.createCommentVNode("", true), __props.nowDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
3737
+ key: 1,
3738
+ type: "link",
3739
+ size: "small",
3740
+ textContent: "现在",
3741
+ onClick: _cache[1] || (_cache[1] = $event => rebuildItems(vue.unref(snail_core.getTimeValue)(new Date())))
3742
+ })) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$z, {
3743
+ type: "link",
3744
+ size: "small",
3745
+ textContent: "确定",
3746
+ class: vue.normalizeClass({
3747
+ disabled: isValidTimeRef.value != true
3748
+ }),
3749
+ onClick: onConfirm
3750
+ }, null, 8, ["class"])]),
3751
+ key: "0"
3752
+ } : void 0]), 1032, ["class"]);
3753
+ };
3754
+ }
3755
+ });
3756
+
3757
+ const _hoisted_1$1 = ["textContent"];
3758
+ const _hoisted_2 = ["textContent"];
3759
+ const _hoisted_3 = ["textContent"];
3760
+ const _hoisted_4 = ["textContent", "onClick"];
3761
+ const _hoisted_5 = ["textContent", "onClick"];
3762
+ const _hoisted_6 = ["textContent"];
3763
+ const _hoisted_7 = ["textContent", "onClick"];
3764
+ const _hoisted_8 = ["textContent"];
3765
+ var _sfc_main$1 = vue.defineComponent({
3766
+ __name: "date-pc",
3767
+ props: {
3768
+ value: {},
3769
+ format: {},
3770
+ min: {},
3771
+ max: {},
3772
+ minPickTime: {},
3773
+ maxPickTime: {},
3774
+ toolbarDisabled: {
3775
+ type: Boolean
3776
+ },
3777
+ nowDisabled: {
3778
+ type: Boolean
3779
+ },
3780
+ clearDisabled: {
3781
+ type: Boolean
3782
+ },
3783
+ popup: {},
3784
+ picker: {},
3785
+ popupStatus: {},
3786
+ target: {},
3787
+ followX: {},
3788
+ followY: {},
3789
+ pinned: {},
3790
+ inPopup: {},
3791
+ closePopup: {
3792
+ type: Function
3793
+ }
3794
+ },
3795
+ emits: ["clear", "confirm"],
3796
+ setup(__props, _ref) {
3797
+ let {
3798
+ emit: __emit
3799
+ } = _ref;
3800
+ const props = __props;
3801
+ const emits = __emit;
3802
+ const {
3803
+ inPopup
3804
+ } = props;
3805
+ const dateRef = vue.ref(snail_core.parseDateValue(props.value));
3806
+ const format = snail_core.correctDateFormat(props.format, "yyyy-MM-dd");
3807
+ const min = Object.freeze(snail_core.parseDateValue(props.min));
3808
+ const max = Object.freeze(snail_core.parseDateValue(props.max));
3809
+ const endStep = initStepByFormat(format);
3810
+ const stepRef = vue.shallowRef(endStep);
3811
+ const yearItems = vue.shallowRef();
3812
+ const monthItems = vue.shallowRef();
3813
+ const dayItemsRef = vue.shallowRef([]);
3814
+ const isValidDateRef = vue.computed(validateDate);
3815
+ const minPickTime = Object.freeze(snail_core.parseTimeValue(props.minPickTime));
3816
+ const maxPickTime = Object.freeze(snail_core.parseTimeValue(props.maxPickTime));
3817
+ const timeFormat = format == "yyyy-MM-dd HH:mm" ? "HH:mm" : format == "yyyy-MM-dd HH:mm:ss" ? "HH:mm:ss" : void 0;
3818
+ const timeAreaDom = timeFormat ? vue.useTemplateRef("time-area") : void 0;
3819
+ function validateDate() {
3820
+ switch (format) {
3821
+ case "yyyy":
3822
+ {
3823
+ const item = yearItems.value.find(item2 => item2.year == dateRef.value.year);
3824
+ return item && item.disabled != true;
3825
+ }
3826
+ case "yyyy-MM":
3827
+ {
3828
+ const item = monthItems.value.find(item2 => item2.year == dateRef.value.year && item2.month == dateRef.value.month);
3829
+ return item && item.disabled != true;
3830
+ }
3831
+ case "yyyy-MM-dd":
3832
+ {
3833
+ const item = dayItemsRef.value.find(item2 => item2.year == dateRef.value.year && item2.month == dateRef.value.month && item2.day == dateRef.value.day);
3834
+ return item ? item.disabled != true : false;
3835
+ }
3836
+ case "yyyy-MM-dd HH:mm":
3837
+ case "yyyy-MM-dd HH:mm:ss":
3838
+ {
3839
+ if (isValidTime(timeFormat, dateRef.value, minPickTime, maxPickTime) == true) {
3840
+ const date = snail_core.getDateByValue(dateRef.value);
3841
+ const disabled = min && date < snail_core.getDateByValue(min) || max && date > snail_core.getDateByValue(max);
3842
+ return disabled != true;
3843
+ }
3844
+ return false;
3845
+ }
3846
+ default:
3847
+ return false;
3848
+ }
3849
+ }
3850
+ function buildPickerItems(step, basis) {
3851
+ switch (step) {
3852
+ case "year":
3853
+ {
3854
+ dateRef.value.year += basis * 18;
3855
+ yearItems.value = buildYearItems(dateRef.value.year, min, max);
3856
+ if (basis != 0) {
3857
+ dateRef.value.month = 1;
3858
+ dateRef.value.day = 1;
3859
+ }
3860
+ break;
3861
+ }
3862
+ case "month":
3863
+ {
3864
+ dateRef.value.year += basis;
3865
+ let yearItem = (yearItems.value || []).find(item => item.year == dateRef.value.year);
3866
+ if (yearItem == void 0) {
3867
+ buildPickerItems("year", 0);
3868
+ yearItem = yearItems.value[9];
3869
+ }
3870
+ monthItems.value = buildMonthItems(yearItem, min, max);
3871
+ basis != 0 && (dateRef.value.day = 1);
3872
+ break;
3873
+ }
3874
+ case "day":
3875
+ {
3876
+ const date = new Date(dateRef.value.year, dateRef.value.month - 1, 1);
3877
+ date.setMonth(date.getMonth() + basis);
3878
+ dateRef.value.year = date.getFullYear();
3879
+ dateRef.value.month = date.getMonth() + 1;
3880
+ let monthItem = (monthItems.value || []).find(item => item.year == dateRef.value.year && item.month == dateRef.value.month);
3881
+ if (monthItem == void 0) {
3882
+ buildPickerItems("month", 0);
3883
+ monthItem = monthItems.value[dateRef.value.month - 1];
3884
+ }
3885
+ dayItemsRef.value = buildDayItems(monthItem, min, max);
3886
+ basis != 0 && (dateRef.value.day = 1);
3887
+ break;
3888
+ }
3889
+ }
3890
+ }
3891
+ function onSwitchStepClick(newValue) {
3892
+ setTimeout(() => stepRef.value = newValue);
3893
+ }
3894
+ function onYearItemClick(item) {
3895
+ if (item.disabled != true) {
3896
+ dateRef.value.year = item.year;
3897
+ if (format == "yyyy") {
3898
+ const value = String(dateRef.value.year).padStart(4, "0");
3899
+ emits("confirm", value);
3900
+ props.inPopup && props.closePopup(value);
3901
+ } else {
3902
+ dateRef.value.month = 1;
3903
+ monthItems.value = buildMonthItems(item, min, max);
3904
+ onSwitchStepClick("month");
3905
+ }
3906
+ }
3907
+ }
3908
+ function onMonthItemClick(item) {
3909
+ if (item.disabled != true) {
3910
+ dateRef.value.year = item.year;
3911
+ dateRef.value.month = item.month;
3912
+ if (format == "yyyy-MM") {
3913
+ const value = snail_core.formatDateValue(dateRef.value, "yyyy-MM");
3914
+ emits("confirm", value);
3915
+ props.inPopup && props.closePopup(value);
3916
+ } else {
3917
+ dateRef.value.day = 1;
3918
+ dayItemsRef.value = buildDayItems(item, min, max);
3919
+ onSwitchStepClick("day");
3920
+ }
3921
+ }
3922
+ }
3923
+ function onDayItemClick(item) {
3924
+ if (item.disabled != true) {
3925
+ const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
3926
+ Object.assign(dateRef.value, {
3927
+ year: item.year,
3928
+ month: item.month,
3929
+ day: item.day
3930
+ });
3931
+ if (format == "yyyy-MM-dd") {
3932
+ const value = snail_core.formatDateValue(dateRef.value, "yyyy-MM-dd");
3933
+ emits("confirm", value);
3934
+ props.inPopup && props.closePopup(value);
3935
+ } else {
3936
+ isNowMonth || buildPickerItems("day", 0);
3937
+ }
3938
+ }
3939
+ }
3940
+ async function onSelectTime() {
3941
+ if (props.picker == void 0 || timeAreaDom.value == void 0 || props.pinned.value == true) {
3942
+ return;
3943
+ }
3944
+ props.pinned.value = true;
3945
+ const task = props.picker.showTime(timeAreaDom.value, {
3946
+ format: timeFormat,
3947
+ value: snail_core.formatTimeValue(dateRef.value, timeFormat),
3948
+ min: props.minPickTime,
3949
+ max: props.minPickTime,
3950
+ followX: "start",
3951
+ followY: "before",
3952
+ spaceX: -2,
3953
+ spaceY: 4
3954
+ });
3955
+ task.finally(() => setTimeout(() => props.pinned.value = false)).then(text => {
3956
+ if (text != void 0) {
3957
+ const time = snail_core.parseTimeValue(text) || Object.create(null);
3958
+ dateRef.value.hour = time.hour;
3959
+ dateRef.value.minute = time.minute;
3960
+ dateRef.value.second = time.second;
3961
+ }
3962
+ }, reason => {
3963
+ console.error(reason);
3964
+ });
3965
+ }
3966
+ function onNow() {
3967
+ stepRef.value = initStepByFormat(format);
3968
+ dateRef.value = snail_core.getDateValue(new Date());
3969
+ buildPickerItems(stepRef.value, 0);
3970
+ }
3971
+ function onConfirm() {
3972
+ if (isValidDateRef.value == true) {
3973
+ const value = snail_core.formatDateValue(dateRef.value, format);
3974
+ emits("confirm", value);
3975
+ props.inPopup && props.closePopup(value);
3976
+ }
3977
+ }
3978
+ dateRef.value == void 0 && (dateRef.value = electDateValue());
3979
+ buildPickerItems(stepRef.value, 0);
3980
+ return (_ctx, _cache) => {
3981
+ return vue.openBlock(), vue.createBlock(_sfc_main$b, {
3982
+ class: vue.normalizeClass(["date-picker pc", {
3983
+ "time-now": __props.pinned && __props.pinned.value == true
3984
+ }]),
3985
+ mode: "vertical",
3986
+ top: {
3987
+ height: "40px"
3988
+ },
3989
+ bottom: {
3990
+ height: "30px"
3991
+ }
3992
+ }, vue.createSlots({
3993
+ top: vue.withCtx(() => [vue.createVNode(_sfc_main$y, {
3994
+ type: "arrow",
3995
+ rotate: 180,
3996
+ size: 26,
3997
+ onClick: _cache[0] || (_cache[0] = $event => buildPickerItems(stepRef.value, -1))
3998
+ }), vue.createElementVNode("div", {
3999
+ class: vue.normalizeClass(["header-content", stepRef.value])
4000
+ }, [stepRef.value == "year" ? (vue.openBlock(), vue.createElementBlock("div", {
4001
+ key: 0,
4002
+ textContent: vue.toDisplayString(`${yearItems.value[0].year}年 - ${vue.unref(snail_core.getFromArray)(yearItems.value, -1).year}年`)
4003
+ }, null, 8, _hoisted_1$1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
4004
+ key: 1
4005
+ }, [vue.createElementVNode("div", {
4006
+ textContent: vue.toDisplayString(`${dateRef.value.year}年`),
4007
+ onClick: _cache[1] || (_cache[1] = $event => onSwitchStepClick("year"))
4008
+ }, null, 8, _hoisted_2), stepRef.value == "day" ? (vue.openBlock(), vue.createElementBlock("div", {
4009
+ key: 0,
4010
+ textContent: vue.toDisplayString(`${dateRef.value.month}月`),
4011
+ onClick: _cache[2] || (_cache[2] = $event => onSwitchStepClick("month"))
4012
+ }, null, 8, _hoisted_3)) : vue.createCommentVNode("", true)], 64))], 2), vue.createVNode(_sfc_main$y, {
4013
+ type: "arrow",
4014
+ size: 26,
4015
+ onClick: _cache[3] || (_cache[3] = $event => buildPickerItems(stepRef.value, 1))
4016
+ })]),
4017
+ main: vue.withCtx(() => [stepRef.value == "year" ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
4018
+ key: 0
4019
+ }, vue.renderList(yearItems.value, item => {
4020
+ return vue.openBlock(), vue.createElementBlock("div", {
4021
+ class: vue.normalizeClass(["year-item", {
4022
+ "active": dateRef.value.year == item.year,
4023
+ "disabled": item.disabled
4024
+ }]),
4025
+ key: item.year
4026
+ }, [vue.createElementVNode("span", {
4027
+ textContent: vue.toDisplayString(item.year),
4028
+ onClick: $event => onYearItemClick(item)
4029
+ }, null, 8, _hoisted_4)], 2);
4030
+ }), 128)) : stepRef.value == "month" ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
4031
+ key: 1
4032
+ }, vue.renderList(monthItems.value, item => {
4033
+ return vue.openBlock(), vue.createElementBlock("div", {
4034
+ class: vue.normalizeClass(["month-item", {
4035
+ "active": dateRef.value.month == item.month,
4036
+ "disabled": item.disabled
4037
+ }]),
4038
+ key: `${item.year}-${item.month}`
4039
+ }, [vue.createElementVNode("span", {
4040
+ textContent: vue.toDisplayString(item.text),
4041
+ onClick: $event => onMonthItemClick(item)
4042
+ }, null, 8, _hoisted_5)], 2);
4043
+ }), 128)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
4044
+ key: 2
4045
+ }, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
4046
+ return vue.createElementVNode("div", {
4047
+ class: "day-item week",
4048
+ key: item,
4049
+ textContent: vue.toDisplayString(item)
4050
+ }, null, 8, _hoisted_6);
4051
+ }), 64)), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(dayItemsRef.value, item => {
4052
+ return vue.openBlock(), vue.createElementBlock("div", {
4053
+ class: vue.normalizeClass(["day-item", {
4054
+ "active": dateRef.value.year == item.year && dateRef.value.month == item.month && dateRef.value.day == item.day,
4055
+ "now-month": dateRef.value.year == item.year && dateRef.value.month == item.month,
4056
+ "disabled": item.disabled
4057
+ }]),
4058
+ key: `${item.year}-${item.month}-${item.day}`
4059
+ }, [vue.createElementVNode("span", {
4060
+ textContent: vue.toDisplayString(item.day),
4061
+ onClick: $event => onDayItemClick(item)
4062
+ }, null, 8, _hoisted_7)], 2);
4063
+ }), 128))], 64))]),
4064
+ _: 2
4065
+ }, [vue.unref(endStep) == stepRef.value && (__props.toolbarDisabled != true || vue.unref(timeFormat) != void 0) ? {
4066
+ name: "bottom",
4067
+ fn: vue.withCtx(() => [vue.unref(timeFormat) != void 0 ? (vue.openBlock(), vue.createElementBlock("div", {
4068
+ key: 0,
4069
+ class: vue.normalizeClass(["time-area", {
4070
+ placeholder: dateRef.value.hour == void 0
4071
+ }]),
4072
+ ref: "time-area",
4073
+ textContent: vue.toDisplayString(vue.unref(snail_core.formatTimeValue)(dateRef.value, vue.unref(timeFormat)) || "选择时间"),
4074
+ onClick: onSelectTime
4075
+ }, null, 10, _hoisted_8)) : vue.createCommentVNode("", true), __props.toolbarDisabled != true ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
4076
+ key: 1
4077
+ }, [__props.clearDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
4078
+ key: 0,
4079
+ type: "link",
4080
+ size: "small",
4081
+ textContent: "清空",
4082
+ onClick: _cache[4] || (_cache[4] = $event => (emits("clear"), vue.unref(inPopup) && __props.closePopup("")))
4083
+ })) : vue.createCommentVNode("", true), __props.nowDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
4084
+ key: 1,
4085
+ type: "link",
4086
+ size: "small",
4087
+ textContent: "现在",
4088
+ onClick: onNow
4089
+ })) : vue.createCommentVNode("", true)], 64)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$z, {
4090
+ type: "link",
4091
+ size: "small",
4092
+ textContent: "确定",
4093
+ class: vue.normalizeClass({
4094
+ "disabled": isValidDateRef.value != true
4095
+ }),
4096
+ onClick: onConfirm
4097
+ }, null, 8, ["class"])]),
4098
+ key: "0"
4099
+ } : void 0]), 1032, ["class"]);
3639
4100
  };
3640
4101
  }
3641
4102
  });
3642
4103
 
3643
4104
  function usePicker() {
3644
4105
  const popup = usePopup();
4106
+ function showDate(target, options) {
4107
+ options = {
4108
+ ...options
4109
+ };
4110
+ return showPicker(target, _sfc_main$1, options);
4111
+ }
3645
4112
  function showTime(target, options) {
3646
4113
  options = {
3647
4114
  ...options
3648
4115
  };
3649
- delete options["manager"];
4116
+ return showPicker(target, _sfc_main$2, options);
4117
+ }
4118
+ function showPicker(target, component, options) {
4119
+ let popupOptions = Object.create(null);
4120
+ if (options != void 0) {
4121
+ popupOptions.followX = options.followX;
4122
+ popupOptions.followY = options.followY;
4123
+ popupOptions.spaceX = options.spaceX;
4124
+ popupOptions.spaceY = options.spaceY;
4125
+ popupOptions.spaceClient = options.spaceClien;
4126
+ delete options.followX;
4127
+ delete options.followY;
4128
+ delete options.spaceX;
4129
+ delete options.spaceY;
4130
+ delete options.spaceClient;
4131
+ }
3650
4132
  return popup.follow(target, {
3651
- component: _sfc_main$1,
3652
- followX: ["center"],
3653
- spaceClient: 10,
3654
- spaceY: 2,
3655
- spaceX: 2,
4133
+ component,
4134
+ followX: popupOptions.followX || "center",
4135
+ followY: popupOptions.followY,
4136
+ spaceX: snail_core.correctNumber(popupOptions.spaceX, 2),
4137
+ spaceY: snail_core.correctNumber(popupOptions.spaceY, 2),
4138
+ spaceClient: snail_core.correctNumber(popupOptions.spaceClient, 10),
3656
4139
  closeOnMask: true,
3657
- props: options
4140
+ props: {
4141
+ ...options,
4142
+ picker: manager,
4143
+ popup
4144
+ }
3658
4145
  });
3659
4146
  }
3660
- {
3661
- const manager = Object.freeze(snail_core.mountScope({
3662
- showTime
3663
- }, "IPickerManager"));
3664
- manager.onDestroy(popup.destroy);
3665
- return manager;
3666
- }
4147
+ const manager = Object.freeze(snail_core.mountScope({
4148
+ showDate,
4149
+ showTime
4150
+ }, "IPickerManager"));
4151
+ manager.onDestroy(popup.destroy);
4152
+ return manager;
3667
4153
  }
3668
4154
 
3669
4155
  const _hoisted_1 = ["textContent"];
@@ -3751,12 +4237,12 @@
3751
4237
  onTouchstart: onStartDrag,
3752
4238
  onTouchmove: onDragMove,
3753
4239
  onTouchend: onDragEnd
3754
- }, [dragInfoRef.value.status == "success" ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
4240
+ }, [dragInfoRef.value.status == "success" ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
3755
4241
  key: 0,
3756
4242
  type: "success",
3757
4243
  size: 20,
3758
4244
  color: "white"
3759
- })) : (vue.openBlock(), vue.createBlock(_sfc_main$x, {
4245
+ })) : (vue.openBlock(), vue.createBlock(_sfc_main$y, {
3760
4246
  key: 1,
3761
4247
  type: "custom",
3762
4248
  size: 20,
@@ -3768,32 +4254,32 @@
3768
4254
  });
3769
4255
 
3770
4256
  const components = {
3771
- Button: _sfc_main$y,
3772
- Choose: _sfc_main$w,
3773
- DatePicker: _sfc_main$v,
3774
- Footer: _sfc_main$u,
3775
- Header: _sfc_main$t,
3776
- Icon: _sfc_main$x,
3777
- Input: _sfc_main$s,
3778
- Number: _sfc_main$r,
3779
- Search: _sfc_main$q,
3780
- Select: _sfc_main$f,
3781
- Switch: _sfc_main$e,
3782
- Textarea: _sfc_main$d,
3783
- Dynamic: _sfc_main$n,
3784
- Fold: _sfc_main$c,
3785
- Layout: _sfc_main$a,
3786
- Scroll: _sfc_main$b,
3787
- Sort: _sfc_main$9,
3788
- Table: _sfc_main$8,
3789
- TableRow: _sfc_main$7,
3790
- TableCol: _sfc_main$6,
3791
- Transitions: _sfc_main$5,
3792
- Tree: _sfc_main$3,
3793
- Wrapper: _sfc_main$2,
4257
+ Button: _sfc_main$z,
4258
+ Choose: _sfc_main$x,
4259
+ DatePicker: _sfc_main$w,
4260
+ Footer: _sfc_main$v,
4261
+ Header: _sfc_main$u,
4262
+ Icon: _sfc_main$y,
4263
+ Input: _sfc_main$t,
4264
+ Number: _sfc_main$s,
4265
+ Search: _sfc_main$r,
4266
+ Select: _sfc_main$g,
4267
+ Switch: _sfc_main$f,
4268
+ Textarea: _sfc_main$e,
4269
+ Dynamic: _sfc_main$o,
4270
+ Fold: _sfc_main$d,
4271
+ Layout: _sfc_main$b,
4272
+ Scroll: _sfc_main$c,
4273
+ Sort: _sfc_main$a,
4274
+ Table: _sfc_main$9,
4275
+ TableRow: _sfc_main$8,
4276
+ TableCol: _sfc_main$7,
4277
+ Transitions: _sfc_main$6,
4278
+ Tree: _sfc_main$4,
4279
+ Wrapper: _sfc_main$3,
3794
4280
  DragVerify: _sfc_main,
3795
- Empty: _sfc_main$i,
3796
- Loading: _sfc_main$o
4281
+ Empty: _sfc_main$j,
4282
+ Loading: _sfc_main$p
3797
4283
  };
3798
4284
 
3799
4285
  snail_core.onMountScope(scope => {