snail.vue 2.0.26 → 2.0.28

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,6 +1,6 @@
1
1
  //@ sourceURL=/snail.vue.js
2
2
  import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, computed, mergeProps, unref, createElementVNode, toDisplayString, Fragment, renderList, mergeModels, useModel, normalizeStyle, createCommentVNode, createBlock, nextTick, useTemplateRef, createVNode, watch, withDirectives, isRef, vModelText, withCtx, createApp, resolveDynamicComponent, TransitionGroup, Transition, normalizeProps, guardReactiveProps, ref, onErrorCaptured, createSlots, onMounted, withModifiers, getCurrentInstance, resolveComponent, vShow, onBeforeUnmount, onActivated, getCurrentScope, onScopeDispose } from 'vue';
3
- import { throwError, isObject, correctNumber, correctString, useKey, isArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isNumberNotNaN, isStringNotEmpty, hasAny, mustFunction, useScope, removeFromArray, mustObject, isArrayNotEmpty, hasOwnProperty, isString, script, delay, useTimer, defer, useAsyncScope, useHook, newId, throwIfTrue, isFunction, isNullish, getTimeNumber, getDateValue, parseDate, formatDateValue, getDateByValue, parseTimeValue, getTimeValue, padStart, formatTimeValue, parseDateValue, correctDateFormat, isValidTime, getFromArray, onMountScope } from 'snail.core';
3
+ import { throwError, isObject, correctNumber, correctString, useKey, isArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isNumberNotNaN, isStringNotEmpty, hasAny, mustFunction, useScope, removeFromArray, mustObject, isArrayNotEmpty, hasOwnProperty, isString, script, delay, useTimer, runAsync, defer, useAsyncScope, useHook, newId, throwIfTrue, isFunction, isNullish, getTimeNumber, getDateValue, parseDate, formatDateValue, getDateByValue, parseTimeValue, getTimeValue, padStart, formatTimeValue, parseDateValue, correctDateFormat, isValidTime, getFromArray, onMountScope } from 'snail.core';
4
4
  import { link, css, useObserver, useScroll, useAnimation } from 'snail.view';
5
5
 
6
6
  const _hoisted_1$o = ["title"];
@@ -40,13 +40,15 @@ function getBuiltinIcon(iconType) {
40
40
  case "close":
41
41
  return ["M 571.733 512 l 187.733 -187.733 c 17.0667 -17.0667 17.0667 -42.6667 0 -59.7333 c -17.0667 -17.0667 -42.6667 -17.0667 -59.7333 0 L 512 452.267 L 324.267 268.8 c -17.0667 -17.0667 -42.6667 -17.0667 -59.7333 0 c -17.0667 17.0667 -17.0667 42.6667 0 59.7333 l 187.733 187.733 l -187.733 187.733 c -17.0667 17.0667 -17.0667 42.6667 0 59.7333 c 17.0667 17.0667 42.6667 17.0667 59.7333 0 l 187.733 -187.733 l 187.733 187.733 c 17.0667 17.0667 42.6667 17.0667 59.7333 0 c 17.0667 -17.0667 17.0667 -42.6667 0 -59.7333 L 571.733 512 Z"];
42
42
  case "trash":
43
- return ["M 597.333 213.333 V 170.667 h -170.667 v 42.6667 H 213.333 v 42.6667 h 597.333 V 213.333 Z M 298.667 298.667 H 256 v 469.333 h 512 V 298.667 H 298.667 Z m 170.667 341.333 h -42.6667 V 384 h 42.6667 v 256 Z m 128 0 h -42.6667 V 384 h 42.6667 v 256 Z"];
43
+ return ["M736 352.032L736.096 800h-0.128L288 799.968 288.032 352 736 352.032zM384 224h256v64h-256V224z m448 64h-128V202.624C704 182.048 687.232 160 640.16 160h-256.32C336.768 160 320 182.048 320 202.624V288H192a32 32 0 1 0 0 64h32V799.968C224 835.296 252.704 864 288.032 864h447.936A64.064 64.064 0 0 0 800 799.968V352h32a32 32 0 1 0 0-64z", "M608 690.56a32 32 0 0 0 32-32V448a32 32 0 1 0-64 0v210.56a32 32 0 0 0 32 32M416 690.56a32 32 0 0 0 32-32V448a32 32 0 1 0-64 0v210.56a32 32 0 0 0 32 32"];
44
44
  case "download":
45
45
  return ["M47.234 979.775v-210.45h102.303v70.151h724.874v-70.15h102.3v210.45H47.233zM149.54 359.948l242.595 0.175V44.451h242.6v309.827h242.6L517.821 734.253 149.539 359.948z"];
46
46
  case "print":
47
47
  return ["M896 256H128a96 96 0 0 0-96 96v256a96 96 0 0 0 96 96h32v-160h704v160h32a96 96 0 0 0 96-96v-256a96 96 0 0 0-96-96z m-67.52 208a64 64 0 1 1 64-64 64 64 0 0 1-64 64zM224 960a32 32 0 0 0 32 32h512a32 32 0 0 0 32-32V608H224zM800 96a35.2 35.2 0 0 0-35.52-32h-512A29.12 29.12 0 0 0 224 96v96h576z"];
48
48
  case "edit":
49
49
  return ["M 780.8 366.933 c 34.1333 -34.1333 34.1333 -93.8667 0 -128 c -38.4 -34.1333 -93.8667 -34.1333 -132.267 0 l -68.2667 68.2667 l 132.267 128 l 68.2667 -68.2667 Z M 541.867 349.867 l -277.333 277.333 L 213.333 806.4 l 179.2 -51.2 l 281.6 -277.333 Z M 469.333 768 h 341.333 v 42.6667 h -341.333 Z"];
50
+ case "pause":
51
+ return ["M716.805057 780.798397V243.199797c0-21.204979-17.196985-38.40377-38.40377-38.403771s-38.401964 17.196985-38.401964 38.403771v537.5986c0 21.204979 17.196985 38.392933 38.401964 38.392933s38.40377-17.187954 38.40377-38.392933zM384.000677 780.798397V243.199797c0-21.204979-17.187954-38.40377-38.391127-38.403771-21.215816 0-38.40377 17.196985-38.40377 38.403771v537.5986c0 21.204979 17.187954 38.392933 38.40377 38.392933 21.203173 0 38.391127-17.187954 38.391127-38.392933z"];
50
52
  case "arrow":
51
53
  return ["M651.3 514.2c0 8.2-3.1 16.4-9.4 22.6L426.4 752.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L574 514.2 381.1 321.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l215.5 215.5c6.2 6.3 9.4 14.5 9.4 22.6z"];
52
54
  case "datepicker":
@@ -57,6 +59,8 @@ function getBuiltinIcon(iconType) {
57
59
  return ["M 768 469.333 h -213.333 V 256 c 0 -25.6 -17.0667 -42.6667 -42.6667 -42.6667 s -42.6667 17.0667 -42.6667 42.6667 v 213.333 H 256 c -25.6 0 -42.6667 17.0667 -42.6667 42.6667 s 17.0667 42.6667 42.6667 42.6667 h 213.333 v 213.333 c 0 25.6 17.0667 42.6667 42.6667 42.6667 s 42.6667 -17.0667 42.6667 -42.6667 v -213.333 h 213.333 c 25.6 0 42.6667 -17.0667 42.6667 -42.6667 s -17.0667 -42.6667 -42.6667 -42.6667 Z"];
58
60
  case "subtract":
59
61
  return ["M768 554.666667H256c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h512c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667z"];
62
+ case "more":
63
+ return ["M415.93 223.79c0-52.98 43.004-95.984 95.984-95.984s95.984 43.004 95.984 95.984-43.004 95.984-95.984 95.984-95.984-43.003-95.984-95.984zM415.93 511.742c0-52.98 43.004-95.984 95.984-95.984s95.984 43.004 95.984 95.984-43.004 95.984-95.984 95.984-95.984-43.004-95.984-95.984zM415.93 799.866c0-52.98 43.004-95.984 95.984-95.984s95.984 43.003 95.984 95.984-43.004 95.983-95.984 95.983-95.984-43.175-95.984-95.983z"];
60
64
  case "grip":
61
65
  return ["M 384 256 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 384 426.667 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 384 597.333 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 384 768 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 640 256 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 640 426.667 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 640 597.333 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z", "M 640 768 m -42.6667 0 a 42.6667 42.6667 0 1 0 85.3333 0 a 42.6667 42.6667 0 1 0 -85.3333 0 Z"];
62
66
  default:
@@ -85,6 +89,10 @@ var _sfc_main$E = defineComponent({
85
89
  color: {},
86
90
  hoverColor: {},
87
91
  rotate: {},
92
+ opacity: {},
93
+ border: {},
94
+ radius: {},
95
+ background: {},
88
96
  viewBox: {}
89
97
  },
90
98
  setup(__props) {
@@ -111,6 +119,11 @@ var _sfc_main$E = defineComponent({
111
119
  fill && (style.fill = fill);
112
120
  const rotate = correctNumber(props.rotate, 0);
113
121
  rotate != 0 && (style.transform = `rotate(${rotate}deg)`);
122
+ const opacity = correctNumber(props.opacity, void 0);
123
+ opacity >= 0 && (style.opacity = opacity);
124
+ style.border = correctString(props.border, void 0, true);
125
+ style.borderRadius = correctString(props.radius, void 0, true);
126
+ style.background = correctString(props.background, void 0, true);
114
127
  return style;
115
128
  });
116
129
  return (_ctx, _cache) => {
@@ -1590,10 +1603,7 @@ var _sfc_main$r = defineComponent({
1590
1603
  };
1591
1604
  async function onWrapperConfirm() {
1592
1605
  if (fn_onBuildData != void 0) {
1593
- const rt = (await wait(fn_onBuildData())) || {
1594
- success: true,
1595
- data: void 0
1596
- };
1606
+ const rt = await runAsync(fn_onBuildData);
1597
1607
  console.log("onBuildData result:", rt);
1598
1608
  rt.success !== false && closePopup(rt.data);
1599
1609
  } else {
@@ -2788,7 +2798,11 @@ var _sfc_main$g = defineComponent({
2788
2798
  type: Boolean
2789
2799
  },
2790
2800
  trigger: {},
2791
- actions: {}
2801
+ actions: {},
2802
+ followX: {},
2803
+ followY: {},
2804
+ spaceX: {},
2805
+ spaceY: {}
2792
2806
  },
2793
2807
  emits: ["trigger"],
2794
2808
  setup(__props, _ref) {
@@ -2804,30 +2818,35 @@ var _sfc_main$g = defineComponent({
2804
2818
  onEvent
2805
2819
  } = useObserver();
2806
2820
  const rootDom = useTemplateRef("snail-action");
2807
- let popupScope = void 0;
2821
+ const popupScopeRef = shallowRef(void 0);
2808
2822
  let pressStartDate = void 0;
2823
+ const slotHandle = Object.freeze({
2824
+ isActived: () => popupScopeRef.value != void 0,
2825
+ trigger: () => onFollowShow(props.trigger == "long-press")
2826
+ });
2809
2827
  async function onFollowShow(longPress) {
2810
- if (popupScope && popupScope.destroyed != true) {
2811
- popupScope.destroy();
2812
- return;
2813
- }
2814
- if (props.disabled != true) {
2815
- popupScope = follow(rootDom.value, {
2828
+ if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
2829
+ popupScopeRef.value.destroy();
2830
+ } else if (props.disabled != true) {
2831
+ popupScopeRef.value = follow(rootDom.value, {
2816
2832
  component: _sfc_main$h,
2817
2833
  closeOnEscape: true,
2818
2834
  closeOnMask: true,
2819
2835
  closeOnResize: true,
2820
2836
  closeOnTarget: true,
2821
- followX: longPress ? ["center", "start", "end"] : ["after", "end", "start", "end", "center"],
2822
- followY: longPress ? ["center", "after", "before"] : ["after", "before", "center", "end", "after"],
2837
+ followX: props.followX || ["center", "start", "end", "after", "before", "ratio"],
2838
+ followY: props.followY || ["after", "before", "center", "end", "start", "ratio"],
2839
+ spaceX: props.spaceX,
2840
+ spaceY: props.spaceY,
2823
2841
  props: {
2824
2842
  mode: "vertical",
2825
2843
  actions: props.actions
2826
2844
  }
2827
2845
  });
2828
- const code = await popupScope;
2846
+ const code = await popupScopeRef.value;
2829
2847
  isStringNotEmpty(code) && emits("trigger", code);
2830
2848
  }
2849
+ popupScopeRef.value = void 0;
2831
2850
  }
2832
2851
  function onMouseDown() {
2833
2852
  if (props.trigger == "long-press" && pressStartDate == void 0) {
@@ -2840,7 +2859,7 @@ var _sfc_main$g = defineComponent({
2840
2859
  pressStartDate = void 0;
2841
2860
  if (time >= 0.5) {
2842
2861
  navigator.vibrate && navigator.vibrate(200);
2843
- onFollowShow(true);
2862
+ onFollowShow();
2844
2863
  }
2845
2864
  }
2846
2865
  }
@@ -2861,19 +2880,17 @@ var _sfc_main$g = defineComponent({
2861
2880
  }
2862
2881
  });
2863
2882
  return (_ctx, _cache) => {
2864
- return openBlock(), createElementBlock("div", _hoisted_1$a, [createElementVNode("div", _hoisted_2$5, [renderSlot(_ctx.$slots, "default")]), __props.trigger == "hover" && __props.disabled != true ? (openBlock(), createBlock(_sfc_main$E, {
2883
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [createElementVNode("div", _hoisted_2$5, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotHandle))))]), __props.disabled != true && (__props.trigger == "hover" || __props.trigger == "always") ? (openBlock(), createElementBlock("div", {
2865
2884
  key: 0,
2866
- class: "hover-tips",
2885
+ class: normalizeClass(["trigger-area", {
2886
+ hidden: __props.trigger == "hover"
2887
+ }])
2888
+ }, [renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createVNode(_sfc_main$E, {
2867
2889
  button: "",
2868
- custom: "",
2890
+ type: "more",
2869
2891
  size: 16,
2870
- onClick: _cache[0] || (_cache[0] = $event => onFollowShow(false))
2871
- }, {
2872
- default: withCtx(() => [...(_cache[1] || (_cache[1] = [createElementVNode("path", {
2873
- d: "M415.93 223.79c0-52.98 43.004-95.984 95.984-95.984s95.984 43.004 95.984 95.984-43.004 95.984-95.984 95.984-95.984-43.003-95.984-95.984zM415.93 511.742c0-52.98 43.004-95.984 95.984-95.984s95.984 43.004 95.984 95.984-43.004 95.984-95.984 95.984-95.984-43.004-95.984-95.984zM415.93 799.866c0-52.98 43.004-95.984 95.984-95.984s95.984 43.003 95.984 95.984-43.004 95.983-95.984 95.983-95.984-43.175-95.984-95.983z"
2874
- }, null, -1)]))]),
2875
- _: 1
2876
- })) : createCommentVNode("", true)], 512);
2892
+ onClick: _cache[0] || (_cache[0] = $event => onFollowShow())
2893
+ })])], 2)) : createCommentVNode("", true)], 512);
2877
2894
  };
2878
2895
  }
2879
2896
  });
@@ -4004,18 +4021,18 @@ const _hoisted_1$4 = {
4004
4021
  class: "tz-item",
4005
4022
  ref: "hour-items"
4006
4023
  };
4007
- const _hoisted_2$1 = ["textContent", "onClick"];
4024
+ const _hoisted_2$1 = ["textContent", "onClick", "onDblclick"];
4008
4025
  const _hoisted_3$1 = {
4009
4026
  class: "tz-item",
4010
4027
  ref: "minute-items"
4011
4028
  };
4012
- const _hoisted_4$1 = ["textContent", "onClick"];
4029
+ const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
4013
4030
  const _hoisted_5$1 = {
4014
4031
  key: 0,
4015
4032
  class: "tz-item",
4016
4033
  ref: "second-items"
4017
4034
  };
4018
- const _hoisted_6$1 = ["textContent", "onClick"];
4035
+ const _hoisted_6$1 = ["textContent", "onClick", "onDblclick"];
4019
4036
  var _sfc_main$4 = defineComponent({
4020
4037
  __name: "time-pc",
4021
4038
  props: {
@@ -4085,29 +4102,27 @@ var _sfc_main$4 = defineComponent({
4085
4102
  block: "center"
4086
4103
  });
4087
4104
  }
4088
- function onHourClick(item) {
4105
+ function onHourClick(item, dbClick) {
4089
4106
  if (item.disabled != true && timeRef.value.hour != item.hour) {
4090
4107
  timeRef.value.hour = item.hour;
4091
4108
  minuteItems.value = buildMinuteItems(item, min, max);
4092
4109
  secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
4093
4110
  }
4094
4111
  }
4095
- function onMinuteClick(item) {
4112
+ function onMinuteClick(item, dbClick) {
4096
4113
  if (item.disabled != true) {
4114
+ timeRef.value.minute = item.minute;
4097
4115
  if (format == "HH:mm") {
4098
- const value = formatTimeValue(item, "HH:mm");
4099
- emits("confirm", value);
4100
- props.inPopup && props.closePopup(value);
4116
+ dbClick && onConfirm();
4101
4117
  } else if (timeRef.value.minute != item.minute) {
4102
- timeRef.value.minute = item.minute;
4103
4118
  secondItems.value = buildSecondItems(item, min, max);
4104
4119
  }
4105
4120
  }
4106
4121
  }
4107
- function onSecondClick(item) {
4122
+ function onSecondClick(item, dbClick) {
4108
4123
  if (item.disabled != true) {
4109
4124
  timeRef.value.second = item.second;
4110
- onConfirm();
4125
+ dbClick && onConfirm();
4111
4126
  }
4112
4127
  }
4113
4128
  function onConfirm() {
@@ -4137,8 +4152,9 @@ var _sfc_main$4 = defineComponent({
4137
4152
  }]),
4138
4153
  key: item.hour,
4139
4154
  textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
4140
- onClick: $event => onHourClick(item)
4141
- }, null, 10, _hoisted_2$1);
4155
+ onClick: $event => onHourClick(item),
4156
+ onDblclick: $event => onHourClick(item)
4157
+ }, null, 42, _hoisted_2$1);
4142
4158
  }), 128))], 512), createElementVNode("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
4143
4159
  return openBlock(), createElementBlock("div", {
4144
4160
  class: normalizeClass(["tzi-number", {
@@ -4147,8 +4163,9 @@ var _sfc_main$4 = defineComponent({
4147
4163
  }]),
4148
4164
  key: `${item.hour}:${item.minute}`,
4149
4165
  textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
4150
- onClick: $event => onMinuteClick(item)
4151
- }, null, 10, _hoisted_4$1);
4166
+ onClick: $event => onMinuteClick(item),
4167
+ onDblclick: $event => onMinuteClick(item, true)
4168
+ }, null, 42, _hoisted_4$1);
4152
4169
  }), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
4153
4170
  return openBlock(), createElementBlock("div", {
4154
4171
  class: normalizeClass(["tzi-number", {
@@ -4157,8 +4174,9 @@ var _sfc_main$4 = defineComponent({
4157
4174
  }]),
4158
4175
  key: `${item.hour}:${item.minute}:${item.second}`,
4159
4176
  textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
4160
- onClick: $event => onSecondClick(item)
4161
- }, null, 10, _hoisted_6$1);
4177
+ onClick: $event => onSecondClick(item),
4178
+ onDblclick: $event => onSecondClick(item, true)
4179
+ }, null, 42, _hoisted_6$1);
4162
4180
  }), 128))], 512)) : createCommentVNode("", true)]),
4163
4181
  _: 1
4164
4182
  }, 8, ["effect"])]),
@@ -4195,10 +4213,10 @@ var _sfc_main$4 = defineComponent({
4195
4213
  const _hoisted_1$3 = ["textContent"];
4196
4214
  const _hoisted_2 = ["textContent"];
4197
4215
  const _hoisted_3 = ["textContent"];
4198
- const _hoisted_4 = ["textContent", "onClick"];
4199
- const _hoisted_5 = ["textContent", "onClick"];
4216
+ const _hoisted_4 = ["textContent", "onClick", "onDblclick"];
4217
+ const _hoisted_5 = ["textContent", "onClick", "onDblclick"];
4200
4218
  const _hoisted_6 = ["textContent"];
4201
- const _hoisted_7 = ["textContent", "onClick"];
4219
+ const _hoisted_7 = ["textContent", "onClick", "onDblclick"];
4202
4220
  const _hoisted_8 = ["textContent"];
4203
4221
  var _sfc_main$3 = defineComponent({
4204
4222
  __name: "date-pc",
@@ -4329,13 +4347,11 @@ var _sfc_main$3 = defineComponent({
4329
4347
  function onSwitchStepClick(newValue) {
4330
4348
  setTimeout(() => stepRef.value = newValue);
4331
4349
  }
4332
- function onYearItemClick(item) {
4350
+ function onYearItemClick(item, dbClick) {
4333
4351
  if (item.disabled != true) {
4334
4352
  dateRef.value.year = item.year;
4335
4353
  if (format == "yyyy") {
4336
- const value = String(dateRef.value.year).padStart(4, "0");
4337
- emits("confirm", value);
4338
- props.inPopup && props.closePopup(value);
4354
+ dbClick && onConfirm();
4339
4355
  } else {
4340
4356
  dateRef.value.month = 1;
4341
4357
  monthItems.value = buildMonthItems(item, min, max);
@@ -4343,14 +4359,12 @@ var _sfc_main$3 = defineComponent({
4343
4359
  }
4344
4360
  }
4345
4361
  }
4346
- function onMonthItemClick(item) {
4362
+ function onMonthItemClick(item, dbClick) {
4347
4363
  if (item.disabled != true) {
4348
4364
  dateRef.value.year = item.year;
4349
4365
  dateRef.value.month = item.month;
4350
4366
  if (format == "yyyy-MM") {
4351
- const value = formatDateValue(dateRef.value, "yyyy-MM");
4352
- emits("confirm", value);
4353
- props.inPopup && props.closePopup(value);
4367
+ dbClick && onConfirm();
4354
4368
  } else {
4355
4369
  dateRef.value.day = 1;
4356
4370
  dayItemsRef.value = buildDayItems(item, min, max);
@@ -4358,19 +4372,17 @@ var _sfc_main$3 = defineComponent({
4358
4372
  }
4359
4373
  }
4360
4374
  }
4361
- function onDayItemClick(item) {
4375
+ function onDayItemClick(item, dbClick) {
4362
4376
  if (item.disabled != true) {
4363
- const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4364
4377
  Object.assign(dateRef.value, {
4365
4378
  year: item.year,
4366
4379
  month: item.month,
4367
4380
  day: item.day
4368
4381
  });
4369
4382
  if (format == "yyyy-MM-dd") {
4370
- const value = formatDateValue(dateRef.value, "yyyy-MM-dd");
4371
- emits("confirm", value);
4372
- props.inPopup && props.closePopup(value);
4383
+ dbClick && onConfirm();
4373
4384
  } else {
4385
+ const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4374
4386
  isNowMonth || buildPickerItems("day", 0);
4375
4387
  }
4376
4388
  }
@@ -4468,8 +4480,9 @@ var _sfc_main$3 = defineComponent({
4468
4480
  key: item.year
4469
4481
  }, [createElementVNode("span", {
4470
4482
  textContent: toDisplayString(item.year),
4471
- onClick: $event => onYearItemClick(item)
4472
- }, null, 8, _hoisted_4)], 2);
4483
+ onClick: $event => onYearItemClick(item),
4484
+ onDblclick: $event => onYearItemClick(item, true)
4485
+ }, null, 40, _hoisted_4)], 2);
4473
4486
  }), 128)) : stepRef.value == "month" ? (openBlock(true), createElementBlock(Fragment, {
4474
4487
  key: 1
4475
4488
  }, renderList(monthItems.value, item => {
@@ -4481,8 +4494,9 @@ var _sfc_main$3 = defineComponent({
4481
4494
  key: `${item.year}-${item.month}`
4482
4495
  }, [createElementVNode("span", {
4483
4496
  textContent: toDisplayString(item.text),
4484
- onClick: $event => onMonthItemClick(item)
4485
- }, null, 8, _hoisted_5)], 2);
4497
+ onClick: $event => onMonthItemClick(item),
4498
+ onDblclick: $event => onMonthItemClick(item, true)
4499
+ }, null, 40, _hoisted_5)], 2);
4486
4500
  }), 128)) : (openBlock(), createElementBlock(Fragment, {
4487
4501
  key: 2
4488
4502
  }, [(openBlock(), createElementBlock(Fragment, null, renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
@@ -4501,8 +4515,9 @@ var _sfc_main$3 = defineComponent({
4501
4515
  key: `${item.year}-${item.month}-${item.day}`
4502
4516
  }, [createElementVNode("span", {
4503
4517
  textContent: toDisplayString(item.day),
4504
- onClick: $event => onDayItemClick(item)
4505
- }, null, 8, _hoisted_7)], 2);
4518
+ onClick: $event => onDayItemClick(item),
4519
+ onDblclick: $event => onDayItemClick(item, true)
4520
+ }, null, 40, _hoisted_7)], 2);
4506
4521
  }), 128))], 64))]),
4507
4522
  _: 2
4508
4523
  }, [unref(endStep) == stepRef.value && (__props.toolbarDisabled != true || unref(timeFormat) != void 0) ? {