snail.vue 2.0.11 → 2.0.13

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
- 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, useTime, parseTime, getTimeNow, onMountScope } from 'snail.core';
2
+ import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, normalizeStyle, unref, createElementVNode, toDisplayString, Fragment, renderList, 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, TransitionGroup, vShow, onBeforeUnmount, getCurrentScope, onScopeDispose } from 'vue';
3
+ import { throwError, isArrayNotEmpty, isStringNotEmpty, correctString, useKey, isArray, useTimer, newId, script, isFunction, getFromArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isObject, isNumberNotNaN, hasAny, mustFunction, useScope, removeFromArray, mustObject, delay, defer, useAsyncScope, useHook, correctNumber, throwIfTrue, hasOwnProperty, correctTimeValue, getDateValue, formatDateValue, parseTimeValue, getTimeValue, padStart, formatTimeValue, parseDateValue, correctDateFormat, getDateByValue, onMountScope } from 'snail.core';
4
4
  import { link, css, useObserver, useAnimation } from 'snail.view';
5
5
 
6
- const _hoisted_1$j = ["title"];
7
- var _sfc_main$y = defineComponent({
6
+ const _hoisted_1$k = ["title"];
7
+ var _sfc_main$B = defineComponent({
8
8
  ...{
9
9
  name: "Button",
10
10
  inheritAttrs: true
@@ -20,7 +20,7 @@ var _sfc_main$y = 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
  });
@@ -67,10 +67,10 @@ function getSvgDraw(iconType, draw) {
67
67
  }
68
68
  }
69
69
 
70
- const _hoisted_1$i = ["width", "height"];
71
- const _hoisted_2$b = ["textContent"];
72
- const _hoisted_3$9 = ["fill", "stroke", "stroke-width", "d"];
73
- var _sfc_main$x = defineComponent({
70
+ const _hoisted_1$j = ["viewBox", "width", "height"];
71
+ const _hoisted_2$c = ["textContent"];
72
+ const _hoisted_3$a = ["fill", "stroke", "stroke-width", "d"];
73
+ var _sfc_main$A = defineComponent({
74
74
  ...{
75
75
  name: "Icon",
76
76
  inheritAttrs: true
@@ -79,6 +79,7 @@ var _sfc_main$x = defineComponent({
79
79
  props: {
80
80
  title: {},
81
81
  type: {},
82
+ viewBox: {},
82
83
  color: {},
83
84
  hoverColor: {},
84
85
  size: {},
@@ -92,7 +93,7 @@ var _sfc_main$x = defineComponent({
92
93
  return (_ctx, _cache) => {
93
94
  return openBlock(), createElementBlock("svg", {
94
95
  class: normalizeClass(["snail-icon", __props.type]),
95
- viewBox: "0 0 1024 1024",
96
+ viewBox: unref(correctString)(__props.viewBox, "0 0 1024 1024", false),
96
97
  style: normalizeStyle(__props.rotate ? `transform: rotate(${__props.rotate}deg);` : ""),
97
98
  width: __props.size || 24,
98
99
  height: __props.size || 24,
@@ -100,23 +101,23 @@ var _sfc_main$x = defineComponent({
100
101
  onMouseleave: _cache[1] || (_cache[1] = $event => isMouseEnterRef.value = false)
101
102
  }, [createElementVNode("title", {
102
103
  textContent: toDisplayString(__props.title || "")
103
- }, null, 8, _hoisted_2$b), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSvgDraw)(__props.type, __props.draw), d => {
104
+ }, null, 8, _hoisted_2$c), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSvgDraw)(__props.type, __props.draw), d => {
104
105
  return openBlock(), createElementBlock("path", {
105
106
  fill: isMouseEnterRef.value ? __props.hoverColor || __props.color : __props.color,
106
107
  stroke: __props.stroke,
107
108
  "stroke-width": __props.strokeWidth,
108
109
  d
109
- }, null, 8, _hoisted_3$9);
110
- }), 256))], 46, _hoisted_1$i);
110
+ }, null, 8, _hoisted_3$a);
111
+ }), 256))], 46, _hoisted_1$j);
111
112
  };
112
113
  }
113
114
  });
114
115
 
115
- const _hoisted_1$h = ["title", "onClick"];
116
- const _hoisted_2$a = ["type", "checked"];
117
- const _hoisted_3$8 = ["textContent"];
118
- const _hoisted_4$6 = ["textContent"];
119
- var _sfc_main$w = defineComponent({
116
+ const _hoisted_1$i = ["title", "onClick"];
117
+ const _hoisted_2$b = ["type", "checked"];
118
+ const _hoisted_3$9 = ["textContent"];
119
+ const _hoisted_4$7 = ["textContent"];
120
+ var _sfc_main$z = defineComponent({
120
121
  ...{
121
122
  name: "Choose",
122
123
  inheritAttrs: true
@@ -192,10 +193,10 @@ var _sfc_main$w = defineComponent({
192
193
  key: 0,
193
194
  type: unref(type),
194
195
  checked: node.selected
195
- }, null, 8, _hoisted_2$a)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
196
+ }, null, 8, _hoisted_2$b)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
196
197
  key: 1,
197
198
  class: normalizeClass(["status", [node.selected ? "selected" : ""]])
198
- }, [node.selected ? (openBlock(), createBlock(_sfc_main$x, {
199
+ }, [node.selected ? (openBlock(), createBlock(_sfc_main$A, {
199
200
  key: 0,
200
201
  type: "success",
201
202
  size: 12,
@@ -204,18 +205,18 @@ var _sfc_main$w = defineComponent({
204
205
  key: 2,
205
206
  class: "item-text",
206
207
  textContent: toDisplayString(node.item.text)
207
- }, null, 8, _hoisted_3$8)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
208
+ }, null, 8, _hoisted_3$9)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
208
209
  key: 3,
209
210
  class: "item-des",
210
211
  textContent: toDisplayString(node.item.description)
211
- }, null, 8, _hoisted_4$6)) : createCommentVNode("", true)], 14, _hoisted_1$h);
212
+ }, null, 8, _hoisted_4$7)) : createCommentVNode("", true)], 14, _hoisted_1$i);
212
213
  }), 128))], 2);
213
214
  };
214
215
  }
215
216
  });
216
217
 
217
- const _hoisted_1$g = ["id"];
218
- var _sfc_main$v = defineComponent({
218
+ const _hoisted_1$h = ["id"];
219
+ var _sfc_main$y = defineComponent({
219
220
  __name: "datepicker",
220
221
  props: {
221
222
  type: {},
@@ -366,12 +367,12 @@ var _sfc_main$v = defineComponent({
366
367
  class: "snail-datepicker",
367
368
  id: unref(id),
368
369
  onClick
369
- }, null, 8, _hoisted_1$g);
370
+ }, null, 8, _hoisted_1$h);
370
371
  };
371
372
  }
372
373
  });
373
374
 
374
- var _sfc_main$u = defineComponent({
375
+ var _sfc_main$x = defineComponent({
375
376
  ...{
376
377
  name: "Footer",
377
378
  inheritAttrs: true
@@ -402,13 +403,13 @@ var _sfc_main$u = defineComponent({
402
403
  class: normalizeClass(["snail-footer", {
403
404
  "start-divider": __props.divider
404
405
  }, __props.align || "right"])
405
- }, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$y, {
406
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$B, {
406
407
  key: 0,
407
408
  size: "max",
408
409
  type: "default",
409
410
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
410
411
  textContent: toDisplayString(__props.cancelName || "取消")
411
- }, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$y, {
412
+ }, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$B, {
412
413
  key: 1,
413
414
  size: "max",
414
415
  type: "primary",
@@ -419,8 +420,8 @@ var _sfc_main$u = defineComponent({
419
420
  }
420
421
  });
421
422
 
422
- const _hoisted_1$f = ["textContent"];
423
- var _sfc_main$t = defineComponent({
423
+ const _hoisted_1$g = ["textContent"];
424
+ var _sfc_main$w = defineComponent({
424
425
  ...{
425
426
  name: "Header",
426
427
  inheritAttrs: true
@@ -459,7 +460,7 @@ var _sfc_main$t = defineComponent({
459
460
  key: 0,
460
461
  textContent: toDisplayString(__props.title),
461
462
  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$x, {
463
+ }, null, 10, _hoisted_1$g)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$A, {
463
464
  key: 1,
464
465
  type: "close",
465
466
  size: 22,
@@ -471,18 +472,18 @@ var _sfc_main$t = defineComponent({
471
472
  }
472
473
  });
473
474
 
474
- const _hoisted_1$e = ["textContent"];
475
- const _hoisted_2$9 = {
475
+ const _hoisted_1$f = ["textContent"];
476
+ const _hoisted_2$a = {
476
477
  key: 0,
477
478
  class: "required",
478
479
  textContent: "*"
479
480
  };
480
- const _hoisted_3$7 = {
481
+ const _hoisted_3$8 = {
481
482
  class: "input-body"
482
483
  };
483
- const _hoisted_4$5 = ["type", "value", "readonly", "placeholder", "title"];
484
- const _hoisted_5$3 = ["title"];
485
- var _sfc_main$s = defineComponent({
484
+ const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
485
+ const _hoisted_5$4 = ["title"];
486
+ var _sfc_main$v = defineComponent({
486
487
  ...{
487
488
  name: "Input",
488
489
  inheritAttrs: true
@@ -534,7 +535,7 @@ var _sfc_main$s = defineComponent({
534
535
  }, [createElementVNode("span", {
535
536
  class: "text",
536
537
  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$7, [createElementVNode("input", {
538
+ }, 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$8, [createElementVNode("input", {
538
539
  ref: "input-el",
539
540
  type: __props.type || "text",
540
541
  value: inputModel.value,
@@ -543,15 +544,15 @@ var _sfc_main$s = defineComponent({
543
544
  title: inputModel.value,
544
545
  onChange: onValueChange,
545
546
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
546
- }, null, 40, _hoisted_4$5), !!validateRef.value ? (openBlock(), createElementBlock("span", {
547
+ }, null, 40, _hoisted_4$6), !!validateRef.value ? (openBlock(), createElementBlock("span", {
547
548
  key: 0,
548
549
  class: "validate",
549
550
  title: validateRef.value
550
- }, [createVNode(_sfc_main$x, {
551
+ }, [createVNode(_sfc_main$A, {
551
552
  type: "error",
552
553
  size: 16,
553
554
  color: "red"
554
- })], 8, _hoisted_5$3)) : createCommentVNode("", true)])], 2);
555
+ })], 8, _hoisted_5$4)) : createCommentVNode("", true)])], 2);
555
556
  };
556
557
  }
557
558
  });
@@ -756,20 +757,20 @@ function useFormatter(options) {
756
757
  return formatter;
757
758
  }
758
759
 
759
- const _hoisted_1$d = {
760
+ const _hoisted_1$e = {
760
761
  key: 0,
761
762
  class: "number-prefix"
762
763
  };
763
- const _hoisted_2$8 = ["textContent"];
764
- const _hoisted_3$6 = ["inputmode", "placeholder", "title"];
765
- const _hoisted_4$4 = {
764
+ const _hoisted_2$9 = ["textContent"];
765
+ const _hoisted_3$7 = ["inputmode", "placeholder", "title"];
766
+ const _hoisted_4$5 = {
766
767
  key: 1,
767
768
  class: "number-suffix"
768
769
  };
769
- const _hoisted_5$2 = ["textContent"];
770
- const _hoisted_6$1 = ["title", "textContent"];
771
- const _hoisted_7 = ["title", "textContent"];
772
- var _sfc_main$r = defineComponent({
770
+ const _hoisted_5$3 = ["textContent"];
771
+ const _hoisted_6$2 = ["title", "textContent"];
772
+ const _hoisted_7$1 = ["title", "textContent"];
773
+ var _sfc_main$u = defineComponent({
773
774
  __name: "number",
774
775
  props: mergeModels({
775
776
  placeholder: {},
@@ -916,10 +917,10 @@ var _sfc_main$r = defineComponent({
916
917
  "has-prefix": unref(hasPrefix),
917
918
  "has-suffix": unref(hasSuffix)
918
919
  }])
919
- }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [createElementVNode("span", {
920
+ }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$e, [createElementVNode("span", {
920
921
  class: "ellipsis",
921
922
  textContent: toDisplayString(unref(prefix))
922
- }, null, 8, _hoisted_2$8)])) : createCommentVNode("", true), createElementVNode("div", {
923
+ }, null, 8, _hoisted_2$9)])) : createCommentVNode("", true), createElementVNode("div", {
923
924
  class: normalizeClass(["input-panel", unref(controls)])
924
925
  }, [withDirectives(createElementVNode("input", {
925
926
  type: "text",
@@ -931,18 +932,18 @@ var _sfc_main$r = defineComponent({
931
932
  onFocus: _cache[1] || (_cache[1] = $event => isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
932
933
  onPaste: _cache[2] || (_cache[2] = $event => isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
933
934
  onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
934
- }, null, 40, _hoisted_3$6), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
935
+ }, null, 40, _hoisted_3$7), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
935
936
  key: 0
936
937
  }, [createElementVNode("div", {
937
938
  class: "controls default subtract",
938
939
  onClick: _cache[4] || (_cache[4] = $event => onStepClick(false))
939
- }, [createVNode(_sfc_main$x, {
940
+ }, [createVNode(_sfc_main$A, {
940
941
  type: "subtract",
941
942
  size: 20
942
943
  })]), createElementVNode("div", {
943
944
  class: "controls default plus",
944
945
  onClick: _cache[5] || (_cache[5] = $event => onStepClick(true))
945
- }, [createVNode(_sfc_main$x, {
946
+ }, [createVNode(_sfc_main$A, {
946
947
  type: "plus",
947
948
  size: 20
948
949
  })])], 64)) : unref(controls) == "right" ? (openBlock(), createElementBlock(Fragment, {
@@ -950,38 +951,38 @@ var _sfc_main$r = defineComponent({
950
951
  }, [createElementVNode("div", {
951
952
  class: "controls right plus",
952
953
  onClick: _cache[6] || (_cache[6] = $event => onStepClick(true))
953
- }, [createVNode(_sfc_main$x, {
954
+ }, [createVNode(_sfc_main$A, {
954
955
  type: "arrow",
955
956
  size: 20,
956
957
  rotate: 270
957
958
  })]), createElementVNode("div", {
958
959
  class: "controls right subtract",
959
960
  onClick: _cache[7] || (_cache[7] = $event => onStepClick(false))
960
- }, [createVNode(_sfc_main$x, {
961
+ }, [createVNode(_sfc_main$A, {
961
962
  type: "arrow",
962
963
  size: 20,
963
964
  rotate: 90
964
- })])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$4, [createElementVNode("span", {
965
+ })])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$5, [createElementVNode("span", {
965
966
  class: "ellipsis",
966
967
  textContent: toDisplayString(unref(suffix))
967
- }, null, 8, _hoisted_5$2)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
968
+ }, null, 8, _hoisted_5$3)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
968
969
  key: 2,
969
970
  class: "number-util ellipsis",
970
971
  title: upperTextRef.value,
971
972
  textContent: toDisplayString(`大写:${upperTextRef.value || ""}`)
972
- }, null, 8, _hoisted_6$1)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
973
+ }, null, 8, _hoisted_6$2)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
973
974
  key: 3,
974
975
  class: "number-util ellipsis",
975
976
  title: thousandsTextRef.value,
976
977
  textContent: toDisplayString(`千分位:${thousandsTextRef.value || ""}`)
977
- }, null, 8, _hoisted_7)) : createCommentVNode("", true)], 2);
978
+ }, null, 8, _hoisted_7$1)) : createCommentVNode("", true)], 2);
978
979
  };
979
980
  }
980
981
  });
981
982
 
982
- const _hoisted_1$c = ["placeholder", "readonly"];
983
+ const _hoisted_1$d = ["placeholder", "readonly"];
983
984
  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$q = defineComponent({
985
+ var _sfc_main$t = defineComponent({
985
986
  ...{
986
987
  name: "Search",
987
988
  inheritAttrs: true
@@ -1026,9 +1027,9 @@ var _sfc_main$q = defineComponent({
1026
1027
  readonly: __props.readonly,
1027
1028
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
1028
1029
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
1029
- }, null, 40, _hoisted_1$c), [[vModelText, textModel.value, void 0, {
1030
+ }, null, 40, _hoisted_1$d), [[vModelText, textModel.value, void 0, {
1030
1031
  trim: true
1031
- }]]), createElementVNode("div", null, [createVNode(_sfc_main$x, {
1032
+ }]]), createElementVNode("div", null, [createVNode(_sfc_main$A, {
1032
1033
  class: "search-button",
1033
1034
  type: "custom",
1034
1035
  draw: searchIon,
@@ -1249,11 +1250,11 @@ function deducePosition(strategy, targetStart, targetEnd, contentSize, clientSiz
1249
1250
  }
1250
1251
  }
1251
1252
 
1252
- const _hoisted_1$b = {
1253
+ const _hoisted_1$c = {
1253
1254
  class: "snail-confirm flex-column"
1254
1255
  };
1255
- const _hoisted_2$7 = ["innerHTML"];
1256
- var _sfc_main$p = defineComponent({
1256
+ const _hoisted_2$8 = ["innerHTML"];
1257
+ var _sfc_main$s = defineComponent({
1257
1258
  ...{
1258
1259
  name: "ConfirmContainer",
1259
1260
  inheritAttrs: true
@@ -1281,14 +1282,14 @@ var _sfc_main$p = defineComponent({
1281
1282
  },
1282
1283
  setup(__props) {
1283
1284
  return (_ctx, _cache) => {
1284
- return openBlock(), createElementBlock("div", _hoisted_1$b, [createVNode(_sfc_main$t, {
1285
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [createVNode(_sfc_main$w, {
1285
1286
  "use-to": "dialog",
1286
1287
  title: __props.title || "提示",
1287
1288
  onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
1288
1289
  }, null, 8, ["title"]), createElementVNode("div", {
1289
1290
  class: "confirm-body",
1290
1291
  innerHTML: __props.message || "请确认?"
1291
- }, null, 8, _hoisted_2$7), createVNode(_sfc_main$u, {
1292
+ }, null, 8, _hoisted_2$8), createVNode(_sfc_main$x, {
1292
1293
  align: "right",
1293
1294
  "cancel-name": __props.cancelName,
1294
1295
  "cancel-disabled": __props.cancelDisabled,
@@ -1301,7 +1302,7 @@ var _sfc_main$p = defineComponent({
1301
1302
  }
1302
1303
  });
1303
1304
 
1304
- var _sfc_main$o = defineComponent({
1305
+ var _sfc_main$r = defineComponent({
1305
1306
  ...{
1306
1307
  name: "Loading",
1307
1308
  inheritAttrs: true
@@ -1340,7 +1341,7 @@ var _sfc_main$o = defineComponent({
1340
1341
  }
1341
1342
  });
1342
1343
 
1343
- var _sfc_main$n = defineComponent({
1344
+ var _sfc_main$q = defineComponent({
1344
1345
  ...{
1345
1346
  name: "Dynamic",
1346
1347
  inheritAttrs: false
@@ -1364,7 +1365,7 @@ var _sfc_main$n = defineComponent({
1364
1365
  const loadingComponent = defineComponent({
1365
1366
  inheritAttrs: false,
1366
1367
  components: {
1367
- Loading: _sfc_main$o
1368
+ Loading: _sfc_main$r
1368
1369
  },
1369
1370
  template: "<Loading :mask-disabled='true' />"
1370
1371
  });
@@ -1431,7 +1432,7 @@ var _sfc_main$n = defineComponent({
1431
1432
  }
1432
1433
  });
1433
1434
 
1434
- var _sfc_main$m = defineComponent({
1435
+ var _sfc_main$p = defineComponent({
1435
1436
  ...{
1436
1437
  name: "DialogContainer",
1437
1438
  inheritAttrs: true
@@ -1476,7 +1477,7 @@ var _sfc_main$m = defineComponent({
1476
1477
  onClick: _cache[1] || (_cache[1] = withModifiers($event => {
1477
1478
  __props.options.closeOnMask && unref(closePopup)();
1478
1479
  }, ["self"]))
1479
- }, [createVNode(_sfc_main$n, mergeProps({
1480
+ }, [createVNode(_sfc_main$q, mergeProps({
1480
1481
  class: "dialog-body",
1481
1482
  name: __props.options.name,
1482
1483
  component: __props.options.component,
@@ -1491,7 +1492,7 @@ var _sfc_main$m = defineComponent({
1491
1492
  }
1492
1493
  });
1493
1494
 
1494
- var _sfc_main$l = defineComponent({
1495
+ var _sfc_main$o = defineComponent({
1495
1496
  ...{
1496
1497
  name: "FollowContainer",
1497
1498
  inheritAttrs: true
@@ -1612,7 +1613,7 @@ var _sfc_main$l = defineComponent({
1612
1613
  });
1613
1614
  });
1614
1615
  return (_ctx, _cache) => {
1615
- return openBlock(), createBlock(_sfc_main$n, mergeProps({
1616
+ return openBlock(), createBlock(_sfc_main$q, mergeProps({
1616
1617
  class: ["snail-follow initial", [__props.popupStatus.value, __props.popupTransition.value]],
1617
1618
  style: {
1618
1619
  "z-index": __props.zIndex
@@ -1629,7 +1630,7 @@ var _sfc_main$l = defineComponent({
1629
1630
  }
1630
1631
  });
1631
1632
 
1632
- var _sfc_main$k = defineComponent({
1633
+ var _sfc_main$n = defineComponent({
1633
1634
  ...{
1634
1635
  name: "PopupContainer",
1635
1636
  inheritAttrs: true
@@ -1649,7 +1650,7 @@ var _sfc_main$k = defineComponent({
1649
1650
  model = shallowRef(void 0)
1650
1651
  } = __props.options;
1651
1652
  return (_ctx, _cache) => {
1652
- return openBlock(), createBlock(_sfc_main$n, mergeProps({
1653
+ return openBlock(), createBlock(_sfc_main$q, mergeProps({
1653
1654
  class: ["snail-popup", [__props.popupStatus.value, __props.popupTransition.value]],
1654
1655
  style: {
1655
1656
  "z-index": __props.zIndex
@@ -1667,12 +1668,12 @@ var _sfc_main$k = defineComponent({
1667
1668
  }
1668
1669
  });
1669
1670
 
1670
- const _hoisted_1$a = {
1671
+ const _hoisted_1$b = {
1671
1672
  key: 1,
1672
1673
  class: "icon"
1673
1674
  };
1674
- const _hoisted_2$6 = ["innerHTML"];
1675
- var _sfc_main$j = defineComponent({
1675
+ const _hoisted_2$7 = ["innerHTML"];
1676
+ var _sfc_main$m = defineComponent({
1676
1677
  ...{
1677
1678
  name: "ToastContainer",
1678
1679
  inheritAttrs: true
@@ -1710,7 +1711,7 @@ var _sfc_main$j = defineComponent({
1710
1711
  }),
1711
1712
  onMouseenter: _cache[3] || (_cache[3] = $event => onMouseEvent(false)),
1712
1713
  onMouseleave: _cache[4] || (_cache[4] = $event => onMouseEvent(true))
1713
- }, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$x, {
1714
+ }, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$A, {
1714
1715
  key: 0,
1715
1716
  class: "close-icon",
1716
1717
  type: "close",
@@ -1721,21 +1722,21 @@ var _sfc_main$j = defineComponent({
1721
1722
  onClick: _cache[2] || (_cache[2] = $event => {
1722
1723
  unref(closePopup)();
1723
1724
  })
1724
- }, null, 8, ["fill"])) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$a, [createVNode(_sfc_main$x, {
1725
+ }, null, 8, ["fill"])) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$b, [createVNode(_sfc_main$A, {
1725
1726
  type: unref(props).type,
1726
1727
  fill: "#707070",
1727
1728
  size: 20
1728
1729
  }, null, 8, ["type"])])) : createCommentVNode("", true), createElementVNode("div", {
1729
1730
  class: "message",
1730
1731
  innerHTML: unref(props).message
1731
- }, null, 8, _hoisted_2$6)], 38);
1732
+ }, null, 8, _hoisted_2$7)], 38);
1732
1733
  };
1733
1734
  }
1734
1735
  });
1735
1736
 
1736
1737
  function usePopup() {
1737
1738
  function popup(options) {
1738
- const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$k, options);
1739
+ const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$n, options);
1739
1740
  return addScope2Scopes(scope);
1740
1741
  }
1741
1742
  function dialog(options) {
@@ -1768,7 +1769,7 @@ function usePopup() {
1768
1769
  },
1769
1770
  onBeforeClose: fn => hook.register("onBeforeClose", fn)
1770
1771
  });
1771
- const descriptor = openPopup(_sfc_main$m, options, extOptions);
1772
+ const descriptor = openPopup(_sfc_main$p, options, extOptions);
1772
1773
  scope = useAsyncScope(deferred.promise);
1773
1774
  monitorDialog(descriptor, scope, deferred);
1774
1775
  }
@@ -1786,14 +1787,14 @@ function usePopup() {
1786
1787
  inPopup: "follow",
1787
1788
  target
1788
1789
  };
1789
- scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$l, options, extOptions);
1790
+ scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$o, options, extOptions);
1790
1791
  }
1791
1792
  return addScope2Scopes(scope);
1792
1793
  }
1793
1794
  function confirm(title, message, options) {
1794
1795
  options = options || Object.create(null);
1795
1796
  return dialog({
1796
- component: _sfc_main$p,
1797
+ component: _sfc_main$s,
1797
1798
  closeOnEscape: true,
1798
1799
  props: {
1799
1800
  ...options,
@@ -1803,7 +1804,7 @@ function usePopup() {
1803
1804
  });
1804
1805
  }
1805
1806
  function toast(type, message, options) {
1806
- return popupInCustomContainer(_sfc_main$j, {
1807
+ return popupInCustomContainer(_sfc_main$m, {
1807
1808
  url: "#ToastContainer",
1808
1809
  props: {
1809
1810
  ...(options || Object.create(null)),
@@ -1836,7 +1837,7 @@ function usePopup() {
1836
1837
  },
1837
1838
  ...extOptions
1838
1839
  });
1839
- const descriptor = openPopup(container || _sfc_main$k, options, extOptions);
1840
+ const descriptor = openPopup(container || _sfc_main$n, options, extOptions);
1840
1841
  const scope = useAsyncScope(deferred.promise);
1841
1842
  scope.onDestroy(() => destroyPopup(descriptor, deferred));
1842
1843
  return scope;
@@ -1974,12 +1975,12 @@ function getNoDataBase64Image() {
1974
1975
  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==";
1975
1976
  }
1976
1977
 
1977
- const _hoisted_1$9 = {
1978
+ const _hoisted_1$a = {
1978
1979
  class: "snail-empty"
1979
1980
  };
1980
- const _hoisted_2$5 = ["src"];
1981
- const _hoisted_3$5 = ["textContent"];
1982
- var _sfc_main$i = defineComponent({
1981
+ const _hoisted_2$6 = ["src"];
1982
+ const _hoisted_3$6 = ["textContent"];
1983
+ var _sfc_main$l = defineComponent({
1983
1984
  ...{
1984
1985
  name: "Empty",
1985
1986
  inheritAttrs: true
@@ -1992,23 +1993,23 @@ var _sfc_main$i = defineComponent({
1992
1993
  setup(__props) {
1993
1994
  const defaultImageBase64 = getNoDataBase64Image();
1994
1995
  return (_ctx, _cache) => {
1995
- return openBlock(), createElementBlock("div", _hoisted_1$9, [createElementVNode("img", {
1996
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [createElementVNode("img", {
1996
1997
  src: __props.imageUrl || unref(defaultImageBase64)
1997
- }, null, 8, _hoisted_2$5), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1998
+ }, null, 8, _hoisted_2$6), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1998
1999
  class: "message",
1999
2000
  textContent: toDisplayString(__props.message || "无数据")
2000
- }, null, 8, _hoisted_3$5)])]);
2001
+ }, null, 8, _hoisted_3$6)])]);
2001
2002
  };
2002
2003
  }
2003
2004
  });
2004
2005
 
2005
- const _hoisted_1$8 = ["title"];
2006
- const _hoisted_2$4 = ["textContent"];
2007
- const _hoisted_3$4 = {
2006
+ const _hoisted_1$9 = ["title"];
2007
+ const _hoisted_2$5 = ["textContent"];
2008
+ const _hoisted_3$5 = {
2008
2009
  key: 1,
2009
2010
  class: "select-status"
2010
2011
  };
2011
- var _sfc_main$h = defineComponent({
2012
+ var _sfc_main$k = defineComponent({
2012
2013
  ...{
2013
2014
  name: "SelectNode",
2014
2015
  inheritAttrs: true
@@ -2053,15 +2054,15 @@ var _sfc_main$h = defineComponent({
2053
2054
  }, [createElementVNode("div", {
2054
2055
  class: "item-text ellipsis",
2055
2056
  textContent: toDisplayString(__props.item.text)
2056
- }, null, 8, _hoisted_2$4), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$x, {
2057
+ }, null, 8, _hoisted_2$5), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$A, {
2057
2058
  key: 0,
2058
2059
  type: "arrow",
2059
2060
  color: "#8a9099"
2060
- })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$4, [createVNode(_sfc_main$x, {
2061
+ })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$5, [createVNode(_sfc_main$A, {
2061
2062
  type: "success",
2062
2063
  color: "white",
2063
2064
  size: 12
2064
- })])) : createCommentVNode("", true)], 42, _hoisted_1$8)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2065
+ })])) : createCommentVNode("", true)], 42, _hoisted_1$9)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2065
2066
  key: 1
2066
2067
  }, renderList(unref(showChildrenRef), child => {
2067
2068
  return openBlock(), createBlock(_component_SelectNode, {
@@ -2078,7 +2079,7 @@ var _sfc_main$h = defineComponent({
2078
2079
  }
2079
2080
  });
2080
2081
 
2081
- var _sfc_main$g = defineComponent({
2082
+ var _sfc_main$j = defineComponent({
2082
2083
  ...{
2083
2084
  name: "Select2Popup",
2084
2085
  inheritAttrs: true
@@ -2250,13 +2251,13 @@ var _sfc_main$g = defineComponent({
2250
2251
  key: 0
2251
2252
  }, [createTextVNode(" 暂无选项 ")], 64)) : (openBlock(), createElementBlock(Fragment, {
2252
2253
  key: 1
2253
- }, [__props.search ? (openBlock(), createBlock(_sfc_main$q, mergeProps({
2254
+ }, [__props.search ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
2254
2255
  key: 0
2255
2256
  }, __props.search, {
2256
2257
  onSearch,
2257
2258
  key: "select-search"
2258
2259
  }), null, 16)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
2259
- return openBlock(), createBlock(_sfc_main$h, {
2260
+ return openBlock(), createBlock(_sfc_main$k, {
2260
2261
  key: unref(context).getKey(item),
2261
2262
  multiple: __props.multiple,
2262
2263
  item,
@@ -2265,7 +2266,7 @@ var _sfc_main$g = defineComponent({
2265
2266
  onEnter: onEnterSelectNode,
2266
2267
  onClick: onClickSelectNode
2267
2268
  }, null, 8, ["multiple", "item", "context"]);
2268
- }), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$i, {
2269
+ }), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$l, {
2269
2270
  key: 1,
2270
2271
  message: "无结果"
2271
2272
  })) : createCommentVNode("", true), showClearButtonRef.value ? (openBlock(), createElementBlock("div", {
@@ -2277,20 +2278,20 @@ var _sfc_main$g = defineComponent({
2277
2278
  }
2278
2279
  });
2279
2280
 
2280
- const _hoisted_1$7 = {
2281
+ const _hoisted_1$8 = {
2281
2282
  key: 0,
2282
2283
  class: "select-result"
2283
2284
  };
2284
- const _hoisted_2$3 = ["title", "textContent"];
2285
- const _hoisted_3$3 = ["textContent"];
2286
- const _hoisted_4$3 = {
2285
+ const _hoisted_2$4 = ["title", "textContent"];
2286
+ const _hoisted_3$4 = ["textContent"];
2287
+ const _hoisted_4$4 = {
2287
2288
  key: 1,
2288
2289
  class: "placeholder"
2289
2290
  };
2290
2291
  onAppCreated((app, type) => {
2291
- type == "popup" && app.component("SelectPopup", _sfc_main$g);
2292
+ type == "popup" && app.component("SelectPopup", _sfc_main$j);
2292
2293
  });
2293
- var _sfc_main$f = defineComponent({
2294
+ var _sfc_main$i = defineComponent({
2294
2295
  ...{
2295
2296
  name: "Select",
2296
2297
  inheritAttrs: true
@@ -2422,15 +2423,15 @@ var _sfc_main$f = defineComponent({
2422
2423
  ref: "select"
2423
2424
  }, [__props.items && __props.items.length ? (openBlock(), createElementBlock(Fragment, {
2424
2425
  key: 0
2425
- }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$7, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2426
+ }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2426
2427
  class: "select-text ellipsis",
2427
2428
  title: selectedTextRef.value,
2428
2429
  textContent: toDisplayString(selectedTextRef.value)
2429
- }, null, 8, _hoisted_2$3)])])) : (openBlock(), createElementBlock("div", {
2430
+ }, null, 8, _hoisted_2$4)])])) : (openBlock(), createElementBlock("div", {
2430
2431
  key: 1,
2431
2432
  class: "placeholder",
2432
2433
  textContent: toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
2433
- }, null, 8, _hoisted_3$3)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$x, {
2434
+ }, null, 8, _hoisted_3$4)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$A, {
2434
2435
  key: 2,
2435
2436
  type: "arrow",
2436
2437
  size: 24,
@@ -2438,12 +2439,12 @@ var _sfc_main$f = defineComponent({
2438
2439
  style: {
2439
2440
  "transform": "rotate(90deg)"
2440
2441
  }
2441
- })) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", _hoisted_4$3, "暂无可选项"))], 2);
2442
+ })) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", _hoisted_4$4, "暂无可选项"))], 2);
2442
2443
  };
2443
2444
  }
2444
2445
  });
2445
2446
 
2446
- var _sfc_main$e = defineComponent({
2447
+ var _sfc_main$h = defineComponent({
2447
2448
  ...{
2448
2449
  name: "Switch",
2449
2450
  inheritAttrs: true
@@ -2492,8 +2493,8 @@ var _sfc_main$e = defineComponent({
2492
2493
  }
2493
2494
  });
2494
2495
 
2495
- const _hoisted_1$6 = ["readonly", "placeholder", "rows"];
2496
- var _sfc_main$d = defineComponent({
2496
+ const _hoisted_1$7 = ["readonly", "placeholder", "rows"];
2497
+ var _sfc_main$g = defineComponent({
2497
2498
  ...{
2498
2499
  name: "Textarea"
2499
2500
  },
@@ -2553,25 +2554,100 @@ var _sfc_main$d = defineComponent({
2553
2554
  onInput: _cache[2] || (_cache[2] = $event => emits("input", textareaDom.value.value)),
2554
2555
  onBlur: _cache[3] || (_cache[3] = $event => emits("blur", textareaDom.value.value)),
2555
2556
  onChange: _cache[4] || (_cache[4] = $event => emits("change", textareaDom.value.value))
2556
- }), null, 16, _hoisted_1$6)), [[vModelText, valueModel.value]]);
2557
+ }), null, 16, _hoisted_1$7)), [[vModelText, valueModel.value]]);
2557
2558
  };
2558
2559
  }
2559
2560
  });
2560
2561
 
2561
- const _hoisted_1$5 = {
2562
+ var _sfc_main$f = defineComponent({
2563
+ __name: "transitions",
2564
+ props: {
2565
+ group: {
2566
+ type: Boolean
2567
+ },
2568
+ duration: {},
2569
+ customClass: {},
2570
+ effect: {}
2571
+ },
2572
+ setup(__props) {
2573
+ const props = __props;
2574
+ const classNames = computed(() => {
2575
+ const array = [props.customClass || "snail-transition"];
2576
+ if (isArray(props.effect)) {
2577
+ props.effect.length > 0 ? array.push(...props.effect) : array.push("fade");
2578
+ } else {
2579
+ array.push(props.effect || "fade");
2580
+ }
2581
+ props.duration === 0 && array.push("no-duration");
2582
+ return array.join(" ");
2583
+ });
2584
+ return (_ctx, _cache) => {
2585
+ return openBlock(), createBlock(resolveDynamicComponent(__props.group ? TransitionGroup : Transition), {
2586
+ appear: "",
2587
+ duration: __props.duration,
2588
+ "enter-active-class": `${classNames.value} enter-active`,
2589
+ "enter-from-class": `${classNames.value} enter-from`,
2590
+ "enter-to-class": `${classNames.value} enter-to`,
2591
+ "leave-active-class": `${classNames.value} leave-active`,
2592
+ "leave-from-class": `${classNames.value} leave-from`,
2593
+ "leave-to-class": `${classNames.value} leave-to`
2594
+ }, {
2595
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2596
+ _: 3
2597
+ }, 8, ["duration", "enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
2598
+ };
2599
+ }
2600
+ });
2601
+
2602
+ var _sfc_main$e = defineComponent({
2603
+ __name: "element",
2604
+ props: {
2605
+ tag: {},
2606
+ show: {
2607
+ type: Boolean
2608
+ },
2609
+ showMode: {},
2610
+ transition: {},
2611
+ children: {}
2612
+ },
2613
+ setup(__props) {
2614
+ return (_ctx, _cache) => {
2615
+ return openBlock(), createBlock(_sfc_main$f, mergeProps({
2616
+ group: false
2617
+ }, __props.transition, {
2618
+ duration: __props.transition ? __props.transition.duration : 0
2619
+ }), {
2620
+ default: withCtx(() => [(__props.showMode == "vShow" ? true : __props.show) ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(correctString)(__props.tag, "div", true)), {
2621
+ key: 0
2622
+ }, {
2623
+ default: withCtx(() => [createVNode(_sfc_main$f, mergeProps(__props.children, {
2624
+ duration: __props.children ? __props.children.duration : 0
2625
+ }), {
2626
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2627
+ _: 3
2628
+ }, 16, ["duration"])]),
2629
+ _: 3
2630
+ }, 512)), [[vShow, __props.showMode == "vShow" ? __props.show : true]]) : createCommentVNode("", true)]),
2631
+ _: 3
2632
+ }, 16, ["duration"]);
2633
+ };
2634
+ }
2635
+ });
2636
+
2637
+ const _hoisted_1$6 = {
2562
2638
  class: "fold-header"
2563
2639
  };
2564
- const _hoisted_2$2 = ["textContent"];
2565
- const _hoisted_3$2 = ["textContent"];
2566
- const _hoisted_4$2 = {
2640
+ const _hoisted_2$3 = ["textContent"];
2641
+ const _hoisted_3$3 = ["textContent"];
2642
+ const _hoisted_4$3 = {
2567
2643
  key: 1,
2568
2644
  class: "status"
2569
2645
  };
2570
- const _hoisted_5$1 = {
2646
+ const _hoisted_5$2 = {
2571
2647
  class: "fold-body",
2572
2648
  ref: "foldBody"
2573
2649
  };
2574
- var _sfc_main$c = defineComponent({
2650
+ var _sfc_main$d = defineComponent({
2575
2651
  ...{
2576
2652
  name: "Fold",
2577
2653
  inheritAttrs: true
@@ -2641,23 +2717,23 @@ var _sfc_main$c = defineComponent({
2641
2717
  return (_ctx, _cache) => {
2642
2718
  return openBlock(), createElementBlock("div", {
2643
2719
  class: normalizeClass(["snail-fold", statusModel.value])
2644
- }, [createElementVNode("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("div", {
2720
+ }, [createElementVNode("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("div", {
2645
2721
  class: "title ellipsis",
2646
2722
  textContent: toDisplayString(__props.title)
2647
- }, null, 8, _hoisted_2$2), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
2723
+ }, null, 8, _hoisted_2$3), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
2648
2724
  key: 0,
2649
2725
  class: "subtitle ellipsis",
2650
2726
  textContent: toDisplayString(__props.subtitle)
2651
- }, null, 8, _hoisted_3$2)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$2, [createVNode(_sfc_main$x, {
2727
+ }, null, 8, _hoisted_3$3)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$3, [createVNode(_sfc_main$A, {
2652
2728
  type: "arrow",
2653
2729
  title: statusModel.value == "expand" ? "收起" : "展开",
2654
2730
  onClick: onStatusClick
2655
- }, null, 8, ["title"])])) : createCommentVNode("", true)])]), createElementVNode("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "default")], 512)], 2);
2731
+ }, null, 8, ["title"])])) : createCommentVNode("", true)])]), createElementVNode("div", _hoisted_5$2, [renderSlot(_ctx.$slots, "default")], 512)], 2);
2656
2732
  };
2657
2733
  }
2658
2734
  });
2659
2735
 
2660
- var _sfc_main$b = defineComponent({
2736
+ var _sfc_main$c = defineComponent({
2661
2737
  ...{
2662
2738
  name: "Scroll",
2663
2739
  inheritAttrs: true
@@ -2787,11 +2863,11 @@ var _sfc_main$b = defineComponent({
2787
2863
  }
2788
2864
  });
2789
2865
 
2790
- var _sfc_main$a = defineComponent({
2866
+ var _sfc_main$b = defineComponent({
2791
2867
  __name: "layout",
2792
2868
  props: {
2793
2869
  mode: {},
2794
- default: {},
2870
+ main: {},
2795
2871
  left: {},
2796
2872
  right: {},
2797
2873
  top: {},
@@ -2801,8 +2877,8 @@ var _sfc_main$a = defineComponent({
2801
2877
  const props = __props;
2802
2878
  const areaMap = computed(() => {
2803
2879
  const map = Object.create(null);
2804
- map.default = {
2805
- scrollable: props.default && props.default.scroll != void 0,
2880
+ map.main = {
2881
+ scrollable: props.main && props.main.scroll != void 0,
2806
2882
  class: "main-area",
2807
2883
  style: void 0
2808
2884
  };
@@ -2848,12 +2924,12 @@ var _sfc_main$a = defineComponent({
2848
2924
  return (_ctx, _cache) => {
2849
2925
  return openBlock(), createElementBlock("div", {
2850
2926
  class: normalizeClass(["snail-layout", __props.mode])
2851
- }, [(openBlock(), createElementBlock(Fragment, null, renderList(["top", "left", "default", "right", "bottom"], item => {
2927
+ }, [(openBlock(), createElementBlock(Fragment, null, renderList(["top", "left", "main", "right", "bottom"], item => {
2852
2928
  return openBlock(), createElementBlock(Fragment, {
2853
2929
  key: item
2854
2930
  }, [areaMap.value[item] && _ctx.$slots[item] ? (openBlock(), createElementBlock(Fragment, {
2855
2931
  key: 0
2856
- }, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$b, mergeProps({
2932
+ }, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$c, mergeProps({
2857
2933
  key: 0,
2858
2934
  class: areaMap.value[item].class,
2859
2935
  style: areaMap.value[item].style
@@ -2872,6 +2948,36 @@ var _sfc_main$a = defineComponent({
2872
2948
  }
2873
2949
  });
2874
2950
 
2951
+ var _sfc_main$a = defineComponent({
2952
+ __name: "motion",
2953
+ props: {
2954
+ enter: {},
2955
+ leave: {},
2956
+ multiple: {
2957
+ type: Boolean
2958
+ },
2959
+ duration: {},
2960
+ mode: {}
2961
+ },
2962
+ setup(__props) {
2963
+ const props = __props;
2964
+ const duration = correctNumber(props.duration, 200);
2965
+ return (_ctx, _cache) => {
2966
+ return openBlock(), createBlock(resolveDynamicComponent(__props.multiple ? TransitionGroup : Transition), {
2967
+ appear: "",
2968
+ type: "animation",
2969
+ duration: unref(duration),
2970
+ mode: __props.mode,
2971
+ "enter-active-class": unref(correctString)(props.enter, "fade-in", true),
2972
+ "leave-active-class": unref(correctString)(props.leave, "fade-out", true)
2973
+ }, {
2974
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2975
+ _: 3
2976
+ }, 8, ["duration", "mode", "enter-active-class", "leave-active-class"]);
2977
+ };
2978
+ }
2979
+ });
2980
+
2875
2981
  var _sfc_main$9 = defineComponent({
2876
2982
  ...{
2877
2983
  name: "Sort",
@@ -2973,7 +3079,7 @@ var _sfc_main$9 = defineComponent({
2973
3079
  }
2974
3080
  });
2975
3081
 
2976
- const _hoisted_1$4 = {
3082
+ const _hoisted_1$5 = {
2977
3083
  class: "table-body"
2978
3084
  };
2979
3085
  var _sfc_main$8 = defineComponent({
@@ -3001,7 +3107,7 @@ var _sfc_main$8 = defineComponent({
3001
3107
  const hStyleRef = computed(() => css.buildStyle(props.headerStyle));
3002
3108
  const fStyleRef = computed(() => css.buildStyle(props.footerStyle));
3003
3109
  return (_ctx, _cache) => {
3004
- return openBlock(), createBlock(_sfc_main$b, {
3110
+ return openBlock(), createBlock(_sfc_main$c, {
3005
3111
  class: normalizeClass(["snail-table", {
3006
3112
  "start-border": __props.border == true
3007
3113
  }]),
@@ -3011,7 +3117,7 @@ var _sfc_main$8 = defineComponent({
3011
3117
  default: withCtx(() => [createElementVNode("div", {
3012
3118
  class: "table-header",
3013
3119
  style: normalizeStyle(hStyleRef.value)
3014
- }, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
3120
+ }, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
3015
3121
  class: "table-footer",
3016
3122
  style: normalizeStyle(fStyleRef.value)
3017
3123
  }, [renderSlot(_ctx.$slots, "footer")], 4)]),
@@ -3090,60 +3196,20 @@ var _sfc_main$6 = defineComponent({
3090
3196
  }
3091
3197
  });
3092
3198
 
3093
- var _sfc_main$5 = defineComponent({
3094
- __name: "transitions",
3095
- props: {
3096
- group: {
3097
- type: Boolean
3098
- },
3099
- duration: {},
3100
- customClass: {},
3101
- effect: {}
3102
- },
3103
- setup(__props) {
3104
- const props = __props;
3105
- const classNames = computed(() => {
3106
- const array = [props.customClass || "snail-transition"];
3107
- if (isArray(props.effect)) {
3108
- props.effect.length > 0 ? array.push(...props.effect) : array.push("fade");
3109
- } else {
3110
- array.push(props.effect || "fade");
3111
- }
3112
- console.log(array);
3113
- return array.join(" ");
3114
- });
3115
- return (_ctx, _cache) => {
3116
- return openBlock(), createBlock(resolveDynamicComponent(__props.group ? TransitionGroup : Transition), mergeProps(_ctx.$attrs, {
3117
- appear: "",
3118
- duration: __props.duration,
3119
- "enter-active-class": `${classNames.value} enter-active`,
3120
- "enter-from-class": `${classNames.value} enter-from`,
3121
- "enter-to-class": `${classNames.value} enter-to`,
3122
- "leave-active-class": `${classNames.value} leave-active`,
3123
- "leave-from-class": `${classNames.value} leave-from`,
3124
- "leave-to-class": `${classNames.value} leave-to`
3125
- }), {
3126
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3127
- _: 3
3128
- }, 16, ["duration", "enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
3129
- };
3130
- }
3131
- });
3132
-
3133
- const _hoisted_1$3 = {
3199
+ const _hoisted_1$4 = {
3134
3200
  key: 0,
3135
3201
  class: "node-fold"
3136
3202
  };
3137
- const _hoisted_2$1 = ["title", "textContent"];
3138
- const _hoisted_3$1 = {
3203
+ const _hoisted_2$2 = ["title", "textContent"];
3204
+ const _hoisted_3$2 = {
3139
3205
  class: "node-slot ellipsis"
3140
3206
  };
3141
- const _hoisted_4$1 = {
3207
+ const _hoisted_4$2 = {
3142
3208
  key: 1,
3143
3209
  class: "snail-tree-children hidden",
3144
3210
  ref: "children"
3145
3211
  };
3146
- var _sfc_main$4 = defineComponent({
3212
+ var _sfc_main$5 = defineComponent({
3147
3213
  ...{
3148
3214
  name: "TreeNode",
3149
3215
  inheritAttrs: true
@@ -3261,7 +3327,7 @@ var _sfc_main$4 = defineComponent({
3261
3327
  key: 1
3262
3328
  }, [_cache[4] || (_cache[4] = createElementVNode("div", {
3263
3329
  class: "indent"
3264
- }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$3, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$x, {
3330
+ }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$4, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$A, {
3265
3331
  key: 0,
3266
3332
  class: normalizeClass(statusRef.value),
3267
3333
  type: "custom",
@@ -3273,7 +3339,7 @@ var _sfc_main$4 = defineComponent({
3273
3339
  class: "node-text ellipsis",
3274
3340
  title: __props.node.text,
3275
3341
  textContent: toDisplayString(__props.node.text)
3276
- }, null, 8, _hoisted_2$1), createElementVNode("div", _hoisted_3$1, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34)) : createCommentVNode("", true), showRef.value && showChildrenRef.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.node.children, child => {
3342
+ }, null, 8, _hoisted_2$2), createElementVNode("div", _hoisted_3$2, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34)) : createCommentVNode("", true), showRef.value && showChildrenRef.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.node.children, child => {
3277
3343
  return openBlock(), createBlock(_component_TreeNode, {
3278
3344
  key: __props.context.getKey(child),
3279
3345
  node: child,
@@ -3293,10 +3359,10 @@ var _sfc_main$4 = defineComponent({
3293
3359
  }
3294
3360
  });
3295
3361
 
3296
- const _hoisted_1$2 = {
3362
+ const _hoisted_1$3 = {
3297
3363
  class: "snail-tree"
3298
3364
  };
3299
- var _sfc_main$3 = defineComponent({
3365
+ var _sfc_main$4 = defineComponent({
3300
3366
  ...{
3301
3367
  name: "Tree",
3302
3368
  inheritAttrs: true
@@ -3330,15 +3396,15 @@ var _sfc_main$3 = defineComponent({
3330
3396
  emits("click", node, parents);
3331
3397
  }
3332
3398
  return (_ctx, _cache) => {
3333
- return openBlock(), createElementBlock("div", _hoisted_1$2, [__props.search ? (openBlock(), createBlock(_sfc_main$q, mergeProps({
3399
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [__props.search ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
3334
3400
  key: 0
3335
3401
  }, __props.search, {
3336
3402
  onSearch
3337
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$b, {
3403
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$c, {
3338
3404
  "scroll-y": true
3339
3405
  }, {
3340
3406
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
3341
- return openBlock(), createBlock(_sfc_main$4, {
3407
+ return openBlock(), createBlock(_sfc_main$5, {
3342
3408
  key: unref(context).getKey(node),
3343
3409
  node,
3344
3410
  parent: void 0,
@@ -3359,7 +3425,7 @@ var _sfc_main$3 = defineComponent({
3359
3425
  }
3360
3426
  });
3361
3427
 
3362
- var _sfc_main$2 = defineComponent({
3428
+ var _sfc_main$3 = defineComponent({
3363
3429
  __name: "wrapper",
3364
3430
  props: {
3365
3431
  readonly: {
@@ -3381,14 +3447,14 @@ var _sfc_main$2 = defineComponent({
3381
3447
  return (_ctx, _cache) => {
3382
3448
  return openBlock(), createElementBlock("div", {
3383
3449
  class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
3384
- }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
3450
+ }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$w, mergeProps({
3385
3451
  key: 0
3386
3452
  }, __props.header || {
3387
3453
  useTo: "dialog",
3388
3454
  title: "对话框"
3389
3455
  }, {
3390
3456
  onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
3391
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$b, mergeProps({
3457
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$c, mergeProps({
3392
3458
  class: "wrapper-body"
3393
3459
  }, __props.content || {
3394
3460
  scrollX: false,
@@ -3396,7 +3462,7 @@ var _sfc_main$2 = defineComponent({
3396
3462
  }), {
3397
3463
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3398
3464
  _: 3
3399
- }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$u, mergeProps({
3465
+ }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$x, mergeProps({
3400
3466
  key: 1
3401
3467
  }, __props.footer || {}, {
3402
3468
  onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
@@ -3410,7 +3476,7 @@ function mount(target, options, onDestroyed) {
3410
3476
  mustObject(options, "options");
3411
3477
  target instanceof HTMLElement || throwError("target must be a HTMLElement");
3412
3478
  target.classList.add("snail-app");
3413
- const app = createApp(_sfc_main$n, options);
3479
+ const app = createApp(_sfc_main$q, options);
3414
3480
  triggerAppCreated(app);
3415
3481
  app.mount(target);
3416
3482
  const scope = useScope().onDestroy(() => app.unmount());
@@ -3418,36 +3484,230 @@ function mount(target, options, onDestroyed) {
3418
3484
  return scope;
3419
3485
  }
3420
3486
 
3421
- const _hoisted_1$1 = {
3487
+ const MOTION = Object.freeze({
3488
+ "fade": {
3489
+ enter: "fade-in",
3490
+ leave: "fade-out"
3491
+ },
3492
+ "scale": {
3493
+ enter: "scale-in",
3494
+ leave: "scale-out"
3495
+ },
3496
+ "rotate": {
3497
+ enter: "rotate-in",
3498
+ leave: "rotate-out"
3499
+ },
3500
+ "top": {
3501
+ enter: "top-in",
3502
+ leave: "top-out"
3503
+ },
3504
+ "topBottom": {
3505
+ enter: "top-in",
3506
+ leave: "bottom-out"
3507
+ },
3508
+ "bottom": {
3509
+ enter: "bottom-in",
3510
+ leave: "bottom-out"
3511
+ },
3512
+ "bottomTop": {
3513
+ enter: "bottom-in",
3514
+ leave: "top-out"
3515
+ },
3516
+ "left": {
3517
+ enter: "left-in",
3518
+ leave: "left-out"
3519
+ },
3520
+ "leftRight": {
3521
+ enter: "left-in",
3522
+ leave: "right-out"
3523
+ },
3524
+ "right": {
3525
+ enter: "right-in",
3526
+ leave: "right-out"
3527
+ },
3528
+ "rightLeft": {
3529
+ enter: "right-in",
3530
+ leave: "left-out"
3531
+ }
3532
+ });
3533
+ for (var key in MOTION) hasOwnProperty(MOTION, key) && Object.freeze(MOTION[key]);
3534
+
3535
+ function initStepByFormat(format) {
3536
+ switch (format) {
3537
+ case "yyyy":
3538
+ return "year";
3539
+ case "yyyy-MM":
3540
+ return "month";
3541
+ default:
3542
+ return "day";
3543
+ }
3544
+ }
3545
+ function electDateValue(min, max) {
3546
+ return getDateValue(new Date());
3547
+ }
3548
+ function buildYearItems(year, min, max) {
3549
+ year = year - 10;
3550
+ const items = new Array(18);
3551
+ for (var index = 0; index < items.length; index++) {
3552
+ year += 1;
3553
+ items[index] = Object.freeze({
3554
+ year,
3555
+ disabled: min && min.year != void 0 && year < min.year || max && max.year != void 0 && year > max.year
3556
+ });
3557
+ }
3558
+ return items;
3559
+ }
3560
+ function buildMonthItems(yearItem, min, max) {
3561
+ const minDate = new Date(formatDateValue(min, "yyyy-MM"));
3562
+ const maxDate = new Date(formatDateValue(max, "yyyy-MM"));
3563
+ const items = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"];
3564
+ return items.map((item, index) => {
3565
+ const mi = {
3566
+ text: item,
3567
+ month: index + 1,
3568
+ year: yearItem.year,
3569
+ disabled: yearItem.disabled
3570
+ };
3571
+ if (mi.disabled != true) {
3572
+ const date = new Date(formatDateValue(mi, "yyyy-MM"));
3573
+ mi.disabled = minDate != void 0 && date < minDate || maxDate != void 0 && date > maxDate;
3574
+ }
3575
+ return Object.freeze(mi);
3576
+ });
3577
+ }
3578
+ function buildDayItems(monthItem, min, max) {
3579
+ const minDate = new Date(formatDateValue(min, "yyyy-MM-dd"));
3580
+ const maxDate = new Date(formatDateValue(max, "yyyy-MM-dd"));
3581
+ const date = new Date(monthItem.year, monthItem.month - 1);
3582
+ date.setDate(date.getDate() - (date.getDay() || 7) - 1);
3583
+ const items = new Array(42);
3584
+ for (var index = 0; index < items.length; index++) {
3585
+ date.setDate(date.getDate() + 1);
3586
+ const item = {
3587
+ day: date.getDate(),
3588
+ month: date.getMonth() + 1,
3589
+ year: date.getFullYear(),
3590
+ disabled: monthItem.disabled
3591
+ };
3592
+ if (item.disabled != true) {
3593
+ const date2 = new Date(formatDateValue(item, "yyyy-MM-dd"));
3594
+ item.disabled = minDate != void 0 && date2 < minDate || maxDate != void 0 && date2 > maxDate;
3595
+ }
3596
+ items[index] = Object.freeze(item);
3597
+ }
3598
+ return items;
3599
+ }
3600
+ function buildHourItems(min, max) {
3601
+ const items = new Array(24);
3602
+ for (var index = 0; index < items.length; index++) {
3603
+ items[index] = Object.freeze({
3604
+ hour: index,
3605
+ disabled: min && min.hour != void 0 && index < min.hour || max && max.hour != void 0 && index > max.hour
3606
+ });
3607
+ }
3608
+ return items;
3609
+ }
3610
+ function buildMinuteItems(hourItem, min, max) {
3611
+ const items = new Array(60);
3612
+ const minNumber = min && min.minute != void 0 ? getTimeNumber(min.hour, min.minute, 0) : void 0;
3613
+ const maxNumber = max && max.minute != void 0 ? getTimeNumber(max.hour, max.minute, 0) : void 0;
3614
+ for (let index = 0; index < items.length; index++) {
3615
+ const item = {
3616
+ minute: index,
3617
+ hour: hourItem.hour,
3618
+ disabled: hourItem.disabled
3619
+ };
3620
+ if (item.disabled != true) {
3621
+ const number = getTimeNumber(item.hour, item.minute, 0);
3622
+ item.disabled = minNumber != void 0 && number < minNumber || maxNumber != void 0 && number > maxNumber;
3623
+ }
3624
+ items[index] = Object.freeze(item);
3625
+ }
3626
+ return items;
3627
+ }
3628
+ function buildSecondItems(minuteItem, min, max) {
3629
+ const items = new Array(60);
3630
+ const minNumber = min && min.minute != void 0 ? getTimeNumber(min.hour, min.minute, min.second) : void 0;
3631
+ const maxNumber = max && max.minute != void 0 ? getTimeNumber(max.hour, max.minute, max.second) : void 0;
3632
+ for (let index = 0; index < items.length; index++) {
3633
+ const item = {
3634
+ second: index,
3635
+ minute: minuteItem.minute,
3636
+ hour: minuteItem.hour,
3637
+ disabled: minuteItem.disabled
3638
+ };
3639
+ if (item.disabled != true) {
3640
+ const number = getTimeNumber(item.hour, item.minute, item.second);
3641
+ item.disabled = minNumber != void 0 && number < minNumber || maxNumber != void 0 && number > maxNumber;
3642
+ }
3643
+ items[index] = Object.freeze(item);
3644
+ }
3645
+ return items;
3646
+ }
3647
+ function getTimeNumber(hour, minute, second) {
3648
+ return (hour || 0) * 1e4 + (minute || 0) * 100 + (second || 0);
3649
+ }
3650
+ function isValidTime(format, time, min, max) {
3651
+ time = correctTimeValue(time);
3652
+ if (time) {
3653
+ min = correctTimeValue({
3654
+ ...min
3655
+ });
3656
+ const timeNumber = getTimeNumber(time.hour, time.minute, format == "HH:mm" ? 0 : time.second);
3657
+ if (min != void 0) {
3658
+ const minNumber = getTimeNumber(min.hour, min.minute, format == "HH:mm" ? 0 : max.second);
3659
+ if (timeNumber < minNumber) {
3660
+ return false;
3661
+ }
3662
+ }
3663
+ max = correctTimeValue({
3664
+ ...max
3665
+ });
3666
+ if (max != void 0) {
3667
+ const maxNumber = getTimeNumber(max.hour, max.minute, format == "HH:mm" ? 0 : max.second);
3668
+ if (timeNumber > maxNumber) {
3669
+ return false;
3670
+ }
3671
+ }
3672
+ return true;
3673
+ }
3674
+ return false;
3675
+ }
3676
+
3677
+ const _hoisted_1$2 = {
3422
3678
  class: "tz-item",
3423
3679
  ref: "hour-items"
3424
3680
  };
3425
- const _hoisted_2 = ["textContent", "onClick"];
3426
- const _hoisted_3 = {
3681
+ const _hoisted_2$1 = ["textContent", "onClick"];
3682
+ const _hoisted_3$1 = {
3427
3683
  class: "tz-item",
3428
3684
  ref: "minute-items"
3429
3685
  };
3430
- const _hoisted_4 = ["textContent", "onClick"];
3431
- const _hoisted_5 = {
3686
+ const _hoisted_4$1 = ["textContent", "onClick"];
3687
+ const _hoisted_5$1 = {
3432
3688
  key: 0,
3433
3689
  class: "tz-item",
3434
3690
  ref: "second-items"
3435
3691
  };
3436
- const _hoisted_6 = ["textContent", "onClick"];
3437
- var _sfc_main$1 = defineComponent({
3692
+ const _hoisted_6$1 = ["textContent", "onClick"];
3693
+ var _sfc_main$2 = defineComponent({
3438
3694
  __name: "time-pc",
3439
3695
  props: {
3440
3696
  value: {},
3441
- initialDisabled: {
3697
+ format: {},
3698
+ min: {},
3699
+ max: {},
3700
+ toolbarDisabled: {
3442
3701
  type: Boolean
3443
3702
  },
3444
3703
  nowDisabled: {
3445
3704
  type: Boolean
3446
3705
  },
3447
- manager: {},
3448
- format: {},
3449
- min: {},
3450
- max: {},
3706
+ clearDisabled: {
3707
+ type: Boolean
3708
+ },
3709
+ popup: {},
3710
+ picker: {},
3451
3711
  inPopup: {},
3452
3712
  closePopup: {
3453
3713
  type: Function
@@ -3465,203 +3725,543 @@ var _sfc_main$1 = defineComponent({
3465
3725
  } = _ref;
3466
3726
  const props = __props;
3467
3727
  const emits = __emit;
3468
- const tm = props.manager || useTime({
3469
- format: props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss",
3470
- min: parseTime(props.min),
3471
- max: parseTime(props.max)
3472
- });
3473
- const {
3474
- toast
3475
- } = usePopup();
3476
- const {
3477
- inPopup,
3478
- closePopup
3479
- } = props;
3480
- const secondDisabled = tm.format == "HH:mm";
3481
- const tvRef = ref();
3728
+ const format = props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss";
3729
+ const min = parseTimeValue(props.min);
3730
+ const max = parseTimeValue(props.max);
3731
+ const timeRef = ref(parseTimeValue(props.value) || getTimeValue(new Date()));
3732
+ const isValidTimeRef = computed(() => format == "HH:mm" ? minuteItems.value && minuteItems.value[timeRef.value.minute].disabled != true : secondItems.value && secondItems.value[timeRef.value.second].disabled != true);
3733
+ const hourItems = shallowRef(buildHourItems(min, max));
3734
+ const minuteItems = shallowRef();
3735
+ const secondItems = shallowRef();
3482
3736
  const hItemsDom = useTemplateRef("hour-items");
3483
3737
  const mItemsDom = useTemplateRef("minute-items");
3484
3738
  const sItemsDom = useTemplateRef("second-items");
3485
- function getTimeClass(type, value) {
3486
- switch (type) {
3487
- case "hour":
3488
- return {
3489
- active: tvRef.value.hour == value,
3490
- disabled: tm.validateHH(value) == false
3491
- };
3492
- case "minute":
3493
- return {
3494
- active: tvRef.value.minute == value,
3495
- disabled: tm.validateHHmm(tvRef.value.hour, value) == false
3496
- };
3497
- case "second":
3498
- return {
3499
- active: tvRef.value.second == value,
3500
- disabled: tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value) == false
3501
- };
3502
- }
3739
+ async function rebuildItems(time) {
3740
+ time != void 0 && (timeRef.value = time);
3741
+ minuteItems.value = buildMinuteItems(hourItems.value[timeRef.value.hour], min, max);
3742
+ secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
3743
+ await nextTick();
3744
+ scrollIntoView(hItemsDom.value);
3745
+ scrollIntoView(mItemsDom.value);
3746
+ scrollIntoView(sItemsDom.value);
3503
3747
  }
3504
3748
  function scrollIntoView(items) {
3505
- let activeIndex = void 0,
3506
- firstValidIndex;
3749
+ let activeIndex = void 0;
3507
3750
  for (var index = 0; index < (items ? items.children.length : 0); index++) {
3508
3751
  const ele = items.children[index];
3509
- if (ele.classList.contains("disabled") == true) {
3510
- continue;
3511
- }
3512
- if (firstValidIndex == void 0) {
3513
- firstValidIndex = index;
3514
- }
3515
3752
  if (ele.classList.contains("active") == true) {
3516
3753
  activeIndex = index;
3517
3754
  break;
3518
3755
  }
3519
3756
  }
3520
- let showIndex = activeIndex;
3521
- if (activeIndex == void 0) {
3522
- if (firstValidIndex != void 0) {
3523
- showIndex = firstValidIndex;
3524
- }
3525
- }
3526
- showIndex != void 0 && items.children[showIndex].scrollIntoView({
3757
+ activeIndex != void 0 && items.children[activeIndex].scrollIntoView({
3527
3758
  behavior: "smooth",
3528
3759
  block: "center"
3529
3760
  });
3530
3761
  }
3531
- async function onTimeClick(type, value) {
3532
- switch (type) {
3533
- case "hour":
3534
- if (tm.validateHH(value)) {
3535
- tvRef.value.hour = value;
3536
- await nextTick();
3537
- scrollIntoView(mItemsDom.value);
3538
- }
3539
- break;
3540
- case "minute":
3541
- if (tm.validateHHmm(tvRef.value.hour, value)) {
3542
- tvRef.value.minute = value;
3543
- await nextTick();
3544
- scrollIntoView(sItemsDom.value);
3545
- }
3546
- break;
3547
- case "second":
3548
- if (tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value)) {
3549
- tvRef.value.second = value;
3550
- }
3551
- break;
3762
+ function onHourClick(item) {
3763
+ if (item.disabled != true && timeRef.value.hour != item.hour) {
3764
+ timeRef.value.hour = item.hour;
3765
+ minuteItems.value = buildMinuteItems(item, min, max);
3766
+ secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
3552
3767
  }
3553
3768
  }
3554
- async function onNow() {
3555
- tvRef.value = getTimeNow();
3556
- if (tm.validate(tvRef.value)) {
3557
- await nextTick();
3558
- scrollIntoView(hItemsDom.value);
3559
- scrollIntoView(mItemsDom.value);
3560
- scrollIntoView(sItemsDom.value);
3769
+ function onMinuteClick(item) {
3770
+ if (item.disabled != true) {
3771
+ if (format == "HH:mm") {
3772
+ const value = formatTimeValue(item, "HH:mm");
3773
+ emits("confirm", value);
3774
+ props.inPopup && props.closePopup(value);
3775
+ } else if (timeRef.value.minute != item.minute) {
3776
+ timeRef.value.minute = item.minute;
3777
+ secondItems.value = buildSecondItems(item, min, max);
3778
+ }
3561
3779
  }
3562
3780
  }
3563
- function onConfirm() {
3564
- tvRef.value = tm.correct(tvRef.value) || Object.create(null);
3565
- if (tvRef.value == void 0 || tvRef.value.hour == void 0) {
3566
- return toast("error", "请选选择时间");
3567
- }
3568
- if (secondDisabled != true && tvRef.value.minute == void 0) {
3569
- return toast("error", "请选选择时间");
3781
+ function onSecondClick(item) {
3782
+ if (item.disabled != true) {
3783
+ timeRef.value.second = item.second;
3784
+ onConfirm();
3570
3785
  }
3571
- const value = tm.toString(tvRef.value);
3572
- emits("confirm", value);
3573
- inPopup && closePopup(value);
3574
3786
  }
3575
- {
3576
- props.value && (tvRef.value = tm.parse(props.value));
3577
- tvRef.value || props.initialDisabled || (tvRef.value = tm.correct(getTimeNow()));
3578
- tvRef.value || (tvRef.value = Object.create(null));
3787
+ function onConfirm() {
3788
+ if (isValidTimeRef.value == true) {
3789
+ const value = formatTimeValue(timeRef.value, format);
3790
+ emits("confirm", value);
3791
+ props.inPopup && props.closePopup(value);
3792
+ }
3579
3793
  }
3580
- onMounted(async () => {
3581
- await nextTick();
3582
- scrollIntoView(hItemsDom.value);
3583
- scrollIntoView(mItemsDom.value);
3584
- scrollIntoView(sItemsDom.value);
3585
- });
3794
+ onMounted(rebuildItems);
3586
3795
  return (_ctx, _cache) => {
3587
- return openBlock(), createBlock(_sfc_main$a, {
3588
- class: normalizeClass(["snail-time-picker pc", {
3589
- "second-disabled": secondDisabled
3796
+ return openBlock(), createBlock(_sfc_main$b, {
3797
+ class: normalizeClass(["time-picker pc", {
3798
+ "second-disabled": unref(format) != "HH:mm:ss"
3590
3799
  }]),
3591
3800
  mode: "vertical"
3592
- }, {
3593
- default: withCtx(() => [createVNode(_sfc_main$5, {
3801
+ }, createSlots({
3802
+ main: withCtx(() => [createVNode(_sfc_main$f, {
3594
3803
  group: true,
3595
3804
  effect: "down-up"
3596
3805
  }, {
3597
- default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(Array(24).fill(void 0), (_, index) => {
3806
+ default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(hourItems.value, item => {
3598
3807
  return openBlock(), createElementBlock("div", {
3599
- class: normalizeClass(["tzi-number", getTimeClass("hour", index)]),
3600
- textContent: toDisplayString(String(index).padStart(2, "0")),
3601
- onClick: $event => onTimeClick("hour", index)
3602
- }, null, 10, _hoisted_2);
3603
- }), 256))], 512), createElementVNode("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(Array(60).fill(void 0), (_, index) => {
3808
+ class: normalizeClass(["tzi-number", {
3809
+ active: item.hour == timeRef.value.hour,
3810
+ disabled: item.disabled
3811
+ }]),
3812
+ key: item.hour,
3813
+ textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
3814
+ onClick: $event => onHourClick(item)
3815
+ }, null, 10, _hoisted_2$1);
3816
+ }), 128))], 512), createElementVNode("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
3604
3817
  return openBlock(), createElementBlock("div", {
3605
- class: normalizeClass(["tzi-number", getTimeClass("minute", index)]),
3606
- textContent: toDisplayString(String(index).padStart(2, "0")),
3607
- onClick: $event => onTimeClick("minute", index)
3608
- }, null, 10, _hoisted_4);
3609
- }), 256))], 512), secondDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(Array(60).fill(void 0), (_, index) => {
3818
+ class: normalizeClass(["tzi-number", {
3819
+ active: item.minute == timeRef.value.minute,
3820
+ disabled: item.disabled
3821
+ }]),
3822
+ key: `${item.hour}:${item.minute}`,
3823
+ textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
3824
+ onClick: $event => onMinuteClick(item)
3825
+ }, null, 10, _hoisted_4$1);
3826
+ }), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
3610
3827
  return openBlock(), createElementBlock("div", {
3611
- class: normalizeClass(["tzi-number", getTimeClass("second", index)]),
3612
- textContent: toDisplayString(String(index).padStart(2, "0")),
3613
- onClick: $event => onTimeClick("second", index)
3614
- }, null, 10, _hoisted_6);
3615
- }), 256))], 512)) : createCommentVNode("", true)]),
3616
- bottom: withCtx(() => [createVNode(_sfc_main$y, {
3617
- type: "link",
3618
- size: "small",
3619
- textContent: "清空",
3620
- onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), unref(inPopup) && unref(closePopup)("")))
3621
- }), unref(tm).validate(unref(getTimeNow)()) ? (openBlock(), createBlock(_sfc_main$y, {
3622
- key: 0,
3623
- type: "link",
3624
- size: "small",
3625
- textContent: "现在",
3626
- onClick: onNow
3627
- })) : createCommentVNode("", true), createVNode(_sfc_main$y, {
3628
- type: "link",
3629
- size: "small",
3630
- textContent: "确定",
3631
- onClick: onConfirm
3632
- })]),
3828
+ class: normalizeClass(["tzi-number", {
3829
+ active: item.second == timeRef.value.second,
3830
+ disabled: item.disabled
3831
+ }]),
3832
+ key: `${item.hour}:${item.minute}:${item.second}`,
3833
+ textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
3834
+ onClick: $event => onSecondClick(item)
3835
+ }, null, 10, _hoisted_6$1);
3836
+ }), 128))], 512)) : createCommentVNode("", true)]),
3633
3837
  _: 1
3634
3838
  })]),
3635
- _: 1
3636
- }, 8, ["class"]);
3839
+ _: 2
3840
+ }, [__props.toolbarDisabled != true ? {
3841
+ name: "bottom",
3842
+ fn: withCtx(() => [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$B, {
3843
+ key: 0,
3844
+ type: "link",
3845
+ size: "small",
3846
+ textContent: "清空",
3847
+ onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), __props.inPopup && __props.closePopup("")))
3848
+ })) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$B, {
3849
+ key: 1,
3850
+ type: "link",
3851
+ size: "small",
3852
+ textContent: "现在",
3853
+ onClick: _cache[1] || (_cache[1] = $event => rebuildItems(unref(getTimeValue)(new Date())))
3854
+ })) : createCommentVNode("", true), createVNode(_sfc_main$B, {
3855
+ type: "link",
3856
+ size: "small",
3857
+ textContent: "确定",
3858
+ class: normalizeClass({
3859
+ disabled: isValidTimeRef.value != true
3860
+ }),
3861
+ onClick: onConfirm
3862
+ }, null, 8, ["class"])]),
3863
+ key: "0"
3864
+ } : void 0]), 1032, ["class"]);
3865
+ };
3866
+ }
3867
+ });
3868
+
3869
+ const _hoisted_1$1 = ["textContent"];
3870
+ const _hoisted_2 = ["textContent"];
3871
+ const _hoisted_3 = ["textContent"];
3872
+ const _hoisted_4 = ["textContent", "onClick"];
3873
+ const _hoisted_5 = ["textContent", "onClick"];
3874
+ const _hoisted_6 = ["textContent"];
3875
+ const _hoisted_7 = ["textContent", "onClick"];
3876
+ const _hoisted_8 = ["textContent"];
3877
+ var _sfc_main$1 = defineComponent({
3878
+ __name: "date-pc",
3879
+ props: {
3880
+ value: {},
3881
+ format: {},
3882
+ min: {},
3883
+ max: {},
3884
+ minPickTime: {},
3885
+ maxPickTime: {},
3886
+ toolbarDisabled: {
3887
+ type: Boolean
3888
+ },
3889
+ nowDisabled: {
3890
+ type: Boolean
3891
+ },
3892
+ clearDisabled: {
3893
+ type: Boolean
3894
+ },
3895
+ popup: {},
3896
+ picker: {},
3897
+ popupStatus: {},
3898
+ target: {},
3899
+ followX: {},
3900
+ followY: {},
3901
+ pinned: {},
3902
+ inPopup: {},
3903
+ closePopup: {
3904
+ type: Function
3905
+ }
3906
+ },
3907
+ emits: ["clear", "confirm"],
3908
+ setup(__props, _ref) {
3909
+ let {
3910
+ emit: __emit
3911
+ } = _ref;
3912
+ const props = __props;
3913
+ const emits = __emit;
3914
+ const {
3915
+ inPopup
3916
+ } = props;
3917
+ const dateRef = ref(parseDateValue(props.value));
3918
+ const format = correctDateFormat(props.format, "yyyy-MM-dd");
3919
+ const min = Object.freeze(parseDateValue(props.min));
3920
+ const max = Object.freeze(parseDateValue(props.max));
3921
+ const endStep = initStepByFormat(format);
3922
+ const stepRef = shallowRef(endStep);
3923
+ const yearItems = shallowRef();
3924
+ const monthItems = shallowRef();
3925
+ const dayItemsRef = shallowRef([]);
3926
+ const isValidDateRef = computed(validateDate);
3927
+ const minPickTime = Object.freeze(parseTimeValue(props.minPickTime));
3928
+ const maxPickTime = Object.freeze(parseTimeValue(props.maxPickTime));
3929
+ const timeFormat = format == "yyyy-MM-dd HH:mm" ? "HH:mm" : format == "yyyy-MM-dd HH:mm:ss" ? "HH:mm:ss" : void 0;
3930
+ const timeAreaDom = timeFormat ? useTemplateRef("time-area") : void 0;
3931
+ function validateDate() {
3932
+ switch (format) {
3933
+ case "yyyy":
3934
+ {
3935
+ const item = yearItems.value.find(item2 => item2.year == dateRef.value.year);
3936
+ return item && item.disabled != true;
3937
+ }
3938
+ case "yyyy-MM":
3939
+ {
3940
+ const item = monthItems.value.find(item2 => item2.year == dateRef.value.year && item2.month == dateRef.value.month);
3941
+ return item && item.disabled != true;
3942
+ }
3943
+ case "yyyy-MM-dd":
3944
+ {
3945
+ const item = dayItemsRef.value.find(item2 => item2.year == dateRef.value.year && item2.month == dateRef.value.month && item2.day == dateRef.value.day);
3946
+ return item ? item.disabled != true : false;
3947
+ }
3948
+ case "yyyy-MM-dd HH:mm":
3949
+ case "yyyy-MM-dd HH:mm:ss":
3950
+ {
3951
+ if (isValidTime(timeFormat, dateRef.value, minPickTime, maxPickTime) == true) {
3952
+ const date = getDateByValue(dateRef.value);
3953
+ const disabled = min && date < getDateByValue(min) || max && date > getDateByValue(max);
3954
+ return disabled != true;
3955
+ }
3956
+ return false;
3957
+ }
3958
+ default:
3959
+ return false;
3960
+ }
3961
+ }
3962
+ function buildPickerItems(step, basis) {
3963
+ switch (step) {
3964
+ case "year":
3965
+ {
3966
+ dateRef.value.year += basis * 18;
3967
+ yearItems.value = buildYearItems(dateRef.value.year, min, max);
3968
+ if (basis != 0) {
3969
+ dateRef.value.month = 1;
3970
+ dateRef.value.day = 1;
3971
+ }
3972
+ break;
3973
+ }
3974
+ case "month":
3975
+ {
3976
+ dateRef.value.year += basis;
3977
+ let yearItem = (yearItems.value || []).find(item => item.year == dateRef.value.year);
3978
+ if (yearItem == void 0) {
3979
+ buildPickerItems("year", 0);
3980
+ yearItem = yearItems.value[9];
3981
+ }
3982
+ monthItems.value = buildMonthItems(yearItem, min, max);
3983
+ basis != 0 && (dateRef.value.day = 1);
3984
+ break;
3985
+ }
3986
+ case "day":
3987
+ {
3988
+ const date = new Date(dateRef.value.year, dateRef.value.month - 1, 1);
3989
+ date.setMonth(date.getMonth() + basis);
3990
+ dateRef.value.year = date.getFullYear();
3991
+ dateRef.value.month = date.getMonth() + 1;
3992
+ let monthItem = (monthItems.value || []).find(item => item.year == dateRef.value.year && item.month == dateRef.value.month);
3993
+ if (monthItem == void 0) {
3994
+ buildPickerItems("month", 0);
3995
+ monthItem = monthItems.value[dateRef.value.month - 1];
3996
+ }
3997
+ dayItemsRef.value = buildDayItems(monthItem, min, max);
3998
+ basis != 0 && (dateRef.value.day = 1);
3999
+ break;
4000
+ }
4001
+ }
4002
+ }
4003
+ function onSwitchStepClick(newValue) {
4004
+ setTimeout(() => stepRef.value = newValue);
4005
+ }
4006
+ function onYearItemClick(item) {
4007
+ if (item.disabled != true) {
4008
+ dateRef.value.year = item.year;
4009
+ if (format == "yyyy") {
4010
+ const value = String(dateRef.value.year).padStart(4, "0");
4011
+ emits("confirm", value);
4012
+ props.inPopup && props.closePopup(value);
4013
+ } else {
4014
+ dateRef.value.month = 1;
4015
+ monthItems.value = buildMonthItems(item, min, max);
4016
+ onSwitchStepClick("month");
4017
+ }
4018
+ }
4019
+ }
4020
+ function onMonthItemClick(item) {
4021
+ if (item.disabled != true) {
4022
+ dateRef.value.year = item.year;
4023
+ dateRef.value.month = item.month;
4024
+ if (format == "yyyy-MM") {
4025
+ const value = formatDateValue(dateRef.value, "yyyy-MM");
4026
+ emits("confirm", value);
4027
+ props.inPopup && props.closePopup(value);
4028
+ } else {
4029
+ dateRef.value.day = 1;
4030
+ dayItemsRef.value = buildDayItems(item, min, max);
4031
+ onSwitchStepClick("day");
4032
+ }
4033
+ }
4034
+ }
4035
+ function onDayItemClick(item) {
4036
+ if (item.disabled != true) {
4037
+ const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4038
+ Object.assign(dateRef.value, {
4039
+ year: item.year,
4040
+ month: item.month,
4041
+ day: item.day
4042
+ });
4043
+ if (format == "yyyy-MM-dd") {
4044
+ const value = formatDateValue(dateRef.value, "yyyy-MM-dd");
4045
+ emits("confirm", value);
4046
+ props.inPopup && props.closePopup(value);
4047
+ } else {
4048
+ isNowMonth || buildPickerItems("day", 0);
4049
+ }
4050
+ }
4051
+ }
4052
+ async function onSelectTime() {
4053
+ if (props.picker == void 0 || timeAreaDom.value == void 0 || props.pinned.value == true) {
4054
+ return;
4055
+ }
4056
+ props.pinned.value = true;
4057
+ const task = props.picker.showTime(timeAreaDom.value, {
4058
+ format: timeFormat,
4059
+ value: formatTimeValue(dateRef.value, timeFormat),
4060
+ min: props.minPickTime,
4061
+ max: props.minPickTime,
4062
+ followX: "start",
4063
+ followY: "before",
4064
+ spaceX: -2,
4065
+ spaceY: 4
4066
+ });
4067
+ task.finally(() => setTimeout(() => props.pinned.value = false)).then(text => {
4068
+ if (text != void 0) {
4069
+ const time = parseTimeValue(text) || Object.create(null);
4070
+ dateRef.value.hour = time.hour;
4071
+ dateRef.value.minute = time.minute;
4072
+ dateRef.value.second = time.second;
4073
+ }
4074
+ }, reason => {
4075
+ console.error(reason);
4076
+ });
4077
+ }
4078
+ function onNow() {
4079
+ stepRef.value = initStepByFormat(format);
4080
+ dateRef.value = getDateValue(new Date());
4081
+ buildPickerItems(stepRef.value, 0);
4082
+ }
4083
+ function onConfirm() {
4084
+ if (isValidDateRef.value == true) {
4085
+ const value = formatDateValue(dateRef.value, format);
4086
+ emits("confirm", value);
4087
+ props.inPopup && props.closePopup(value);
4088
+ }
4089
+ }
4090
+ dateRef.value == void 0 && (dateRef.value = electDateValue());
4091
+ buildPickerItems(stepRef.value, 0);
4092
+ return (_ctx, _cache) => {
4093
+ return openBlock(), createBlock(_sfc_main$b, {
4094
+ class: normalizeClass(["date-picker pc", {
4095
+ "time-now": __props.pinned && __props.pinned.value == true
4096
+ }]),
4097
+ mode: "vertical",
4098
+ top: {
4099
+ height: "40px"
4100
+ },
4101
+ bottom: {
4102
+ height: "30px"
4103
+ }
4104
+ }, createSlots({
4105
+ top: withCtx(() => [createVNode(_sfc_main$A, {
4106
+ type: "arrow",
4107
+ rotate: 180,
4108
+ size: 26,
4109
+ onClick: _cache[0] || (_cache[0] = $event => buildPickerItems(stepRef.value, -1))
4110
+ }), createElementVNode("div", {
4111
+ class: normalizeClass(["header-content", stepRef.value])
4112
+ }, [stepRef.value == "year" ? (openBlock(), createElementBlock("div", {
4113
+ key: 0,
4114
+ textContent: toDisplayString(`${yearItems.value[0].year}年 - ${unref(getFromArray)(yearItems.value, -1).year}年`)
4115
+ }, null, 8, _hoisted_1$1)) : (openBlock(), createElementBlock(Fragment, {
4116
+ key: 1
4117
+ }, [createElementVNode("div", {
4118
+ textContent: toDisplayString(`${dateRef.value.year}年`),
4119
+ onClick: _cache[1] || (_cache[1] = $event => onSwitchStepClick("year"))
4120
+ }, null, 8, _hoisted_2), stepRef.value == "day" ? (openBlock(), createElementBlock("div", {
4121
+ key: 0,
4122
+ textContent: toDisplayString(`${dateRef.value.month}月`),
4123
+ onClick: _cache[2] || (_cache[2] = $event => onSwitchStepClick("month"))
4124
+ }, null, 8, _hoisted_3)) : createCommentVNode("", true)], 64))], 2), createVNode(_sfc_main$A, {
4125
+ type: "arrow",
4126
+ size: 26,
4127
+ onClick: _cache[3] || (_cache[3] = $event => buildPickerItems(stepRef.value, 1))
4128
+ })]),
4129
+ main: withCtx(() => [stepRef.value == "year" ? (openBlock(true), createElementBlock(Fragment, {
4130
+ key: 0
4131
+ }, renderList(yearItems.value, item => {
4132
+ return openBlock(), createElementBlock("div", {
4133
+ class: normalizeClass(["year-item", {
4134
+ "active": dateRef.value.year == item.year,
4135
+ "disabled": item.disabled
4136
+ }]),
4137
+ key: item.year
4138
+ }, [createElementVNode("span", {
4139
+ textContent: toDisplayString(item.year),
4140
+ onClick: $event => onYearItemClick(item)
4141
+ }, null, 8, _hoisted_4)], 2);
4142
+ }), 128)) : stepRef.value == "month" ? (openBlock(true), createElementBlock(Fragment, {
4143
+ key: 1
4144
+ }, renderList(monthItems.value, item => {
4145
+ return openBlock(), createElementBlock("div", {
4146
+ class: normalizeClass(["month-item", {
4147
+ "active": dateRef.value.month == item.month,
4148
+ "disabled": item.disabled
4149
+ }]),
4150
+ key: `${item.year}-${item.month}`
4151
+ }, [createElementVNode("span", {
4152
+ textContent: toDisplayString(item.text),
4153
+ onClick: $event => onMonthItemClick(item)
4154
+ }, null, 8, _hoisted_5)], 2);
4155
+ }), 128)) : (openBlock(), createElementBlock(Fragment, {
4156
+ key: 2
4157
+ }, [(openBlock(), createElementBlock(Fragment, null, renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
4158
+ return createElementVNode("div", {
4159
+ class: "day-item week",
4160
+ key: item,
4161
+ textContent: toDisplayString(item)
4162
+ }, null, 8, _hoisted_6);
4163
+ }), 64)), (openBlock(true), createElementBlock(Fragment, null, renderList(dayItemsRef.value, item => {
4164
+ return openBlock(), createElementBlock("div", {
4165
+ class: normalizeClass(["day-item", {
4166
+ "active": dateRef.value.year == item.year && dateRef.value.month == item.month && dateRef.value.day == item.day,
4167
+ "now-month": dateRef.value.year == item.year && dateRef.value.month == item.month,
4168
+ "disabled": item.disabled
4169
+ }]),
4170
+ key: `${item.year}-${item.month}-${item.day}`
4171
+ }, [createElementVNode("span", {
4172
+ textContent: toDisplayString(item.day),
4173
+ onClick: $event => onDayItemClick(item)
4174
+ }, null, 8, _hoisted_7)], 2);
4175
+ }), 128))], 64))]),
4176
+ _: 2
4177
+ }, [unref(endStep) == stepRef.value && (__props.toolbarDisabled != true || unref(timeFormat) != void 0) ? {
4178
+ name: "bottom",
4179
+ fn: withCtx(() => [unref(timeFormat) != void 0 ? (openBlock(), createElementBlock("div", {
4180
+ key: 0,
4181
+ class: normalizeClass(["time-area", {
4182
+ placeholder: dateRef.value.hour == void 0
4183
+ }]),
4184
+ ref: "time-area",
4185
+ textContent: toDisplayString(unref(formatTimeValue)(dateRef.value, unref(timeFormat)) || "选择时间"),
4186
+ onClick: onSelectTime
4187
+ }, null, 10, _hoisted_8)) : createCommentVNode("", true), __props.toolbarDisabled != true ? (openBlock(), createElementBlock(Fragment, {
4188
+ key: 1
4189
+ }, [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$B, {
4190
+ key: 0,
4191
+ type: "link",
4192
+ size: "small",
4193
+ textContent: "清空",
4194
+ onClick: _cache[4] || (_cache[4] = $event => (emits("clear"), unref(inPopup) && __props.closePopup("")))
4195
+ })) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$B, {
4196
+ key: 1,
4197
+ type: "link",
4198
+ size: "small",
4199
+ textContent: "现在",
4200
+ onClick: onNow
4201
+ })) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), createVNode(_sfc_main$B, {
4202
+ type: "link",
4203
+ size: "small",
4204
+ textContent: "确定",
4205
+ class: normalizeClass({
4206
+ "disabled": isValidDateRef.value != true
4207
+ }),
4208
+ onClick: onConfirm
4209
+ }, null, 8, ["class"])]),
4210
+ key: "0"
4211
+ } : void 0]), 1032, ["class"]);
3637
4212
  };
3638
4213
  }
3639
4214
  });
3640
4215
 
3641
4216
  function usePicker() {
3642
4217
  const popup = usePopup();
4218
+ function showDate(target, options) {
4219
+ options = {
4220
+ ...options
4221
+ };
4222
+ return showPicker(target, _sfc_main$1, options);
4223
+ }
3643
4224
  function showTime(target, options) {
3644
4225
  options = {
3645
4226
  ...options
3646
4227
  };
3647
- delete options["manager"];
4228
+ return showPicker(target, _sfc_main$2, options);
4229
+ }
4230
+ function showPicker(target, component, options) {
4231
+ let popupOptions = Object.create(null);
4232
+ if (options != void 0) {
4233
+ popupOptions.followX = options.followX;
4234
+ popupOptions.followY = options.followY;
4235
+ popupOptions.spaceX = options.spaceX;
4236
+ popupOptions.spaceY = options.spaceY;
4237
+ popupOptions.spaceClient = options.spaceClien;
4238
+ delete options.followX;
4239
+ delete options.followY;
4240
+ delete options.spaceX;
4241
+ delete options.spaceY;
4242
+ delete options.spaceClient;
4243
+ }
3648
4244
  return popup.follow(target, {
3649
- component: _sfc_main$1,
3650
- followX: ["center"],
3651
- spaceClient: 10,
3652
- spaceY: 2,
3653
- spaceX: 2,
4245
+ component,
4246
+ followX: popupOptions.followX || "center",
4247
+ followY: popupOptions.followY,
4248
+ spaceX: correctNumber(popupOptions.spaceX, 2),
4249
+ spaceY: correctNumber(popupOptions.spaceY, 2),
4250
+ spaceClient: correctNumber(popupOptions.spaceClient, 10),
3654
4251
  closeOnMask: true,
3655
- props: options
4252
+ props: {
4253
+ ...options,
4254
+ picker: manager,
4255
+ popup
4256
+ }
3656
4257
  });
3657
4258
  }
3658
- {
3659
- const manager = Object.freeze(mountScope({
3660
- showTime
3661
- }, "IPickerManager"));
3662
- manager.onDestroy(popup.destroy);
3663
- return manager;
3664
- }
4259
+ const manager = Object.freeze(mountScope({
4260
+ showDate,
4261
+ showTime
4262
+ }, "IPickerManager"));
4263
+ manager.onDestroy(popup.destroy);
4264
+ return manager;
3665
4265
  }
3666
4266
 
3667
4267
  const _hoisted_1 = ["textContent"];
@@ -3749,12 +4349,12 @@ var _sfc_main = defineComponent({
3749
4349
  onTouchstart: onStartDrag,
3750
4350
  onTouchmove: onDragMove,
3751
4351
  onTouchend: onDragEnd
3752
- }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$x, {
4352
+ }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$A, {
3753
4353
  key: 0,
3754
4354
  type: "success",
3755
4355
  size: 20,
3756
4356
  color: "white"
3757
- })) : (openBlock(), createBlock(_sfc_main$x, {
4357
+ })) : (openBlock(), createBlock(_sfc_main$A, {
3758
4358
  key: 1,
3759
4359
  type: "custom",
3760
4360
  size: 20,
@@ -3766,36 +4366,38 @@ var _sfc_main = defineComponent({
3766
4366
  });
3767
4367
 
3768
4368
  const components = {
3769
- Button: _sfc_main$y,
3770
- Choose: _sfc_main$w,
3771
- DatePicker: _sfc_main$v,
3772
- Footer: _sfc_main$u,
3773
- Header: _sfc_main$t,
3774
- Icon: _sfc_main$x,
3775
- Input: _sfc_main$s,
3776
- Number: _sfc_main$r,
3777
- Search: _sfc_main$q,
3778
- Select: _sfc_main$f,
3779
- Switch: _sfc_main$e,
3780
- Textarea: _sfc_main$d,
3781
- Dynamic: _sfc_main$n,
3782
- Fold: _sfc_main$c,
3783
- Layout: _sfc_main$a,
3784
- Scroll: _sfc_main$b,
4369
+ Button: _sfc_main$B,
4370
+ Choose: _sfc_main$z,
4371
+ DatePicker: _sfc_main$y,
4372
+ Footer: _sfc_main$x,
4373
+ Header: _sfc_main$w,
4374
+ Icon: _sfc_main$A,
4375
+ Input: _sfc_main$v,
4376
+ Number: _sfc_main$u,
4377
+ Search: _sfc_main$t,
4378
+ Select: _sfc_main$i,
4379
+ Switch: _sfc_main$h,
4380
+ Textarea: _sfc_main$g,
4381
+ Dynamic: _sfc_main$q,
4382
+ Element: _sfc_main$e,
4383
+ Fold: _sfc_main$d,
4384
+ Motion: _sfc_main$a,
4385
+ Layout: _sfc_main$b,
4386
+ Scroll: _sfc_main$c,
3785
4387
  Sort: _sfc_main$9,
3786
4388
  Table: _sfc_main$8,
3787
4389
  TableRow: _sfc_main$7,
3788
4390
  TableCol: _sfc_main$6,
3789
- Transitions: _sfc_main$5,
3790
- Tree: _sfc_main$3,
3791
- Wrapper: _sfc_main$2,
4391
+ Transitions: _sfc_main$f,
4392
+ Tree: _sfc_main$4,
4393
+ Wrapper: _sfc_main$3,
3792
4394
  DragVerify: _sfc_main,
3793
- Empty: _sfc_main$i,
3794
- Loading: _sfc_main$o
4395
+ Empty: _sfc_main$l,
4396
+ Loading: _sfc_main$r
3795
4397
  };
3796
4398
 
3797
4399
  onMountScope(scope => {
3798
4400
  getCurrentScope() && onScopeDispose(scope.destroy);
3799
4401
  });
3800
4402
 
3801
- export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePicker, usePopup, useReactive, useTreeContext };
4403
+ export { MOTION, components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePicker, usePopup, useReactive, useTreeContext };