snail.vue 2.0.27 → 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,7 +1,7 @@
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
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
- import { css, link, useObserver, useScroll, useAnimation } from 'snail.view';
4
+ import { link, css, useObserver, useScroll, useAnimation } from 'snail.view';
5
5
 
6
6
  const _hoisted_1$o = ["title"];
7
7
  var _sfc_main$F = defineComponent({
@@ -25,6 +25,10 @@ var _sfc_main$F = defineComponent({
25
25
  }
26
26
  });
27
27
 
28
+ var addLink = href => setTimeout(link.register, 0, href);
29
+
30
+ addLink("/styles/snail.vue.vue.css");
31
+
28
32
  function getBuiltinIcon(iconType) {
29
33
  switch (iconType) {
30
34
  case "success":
@@ -43,6 +47,8 @@ function getBuiltinIcon(iconType) {
43
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"];
44
48
  case "edit":
45
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"];
46
52
  case "arrow":
47
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"];
48
54
  case "datepicker":
@@ -84,6 +90,9 @@ var _sfc_main$E = defineComponent({
84
90
  hoverColor: {},
85
91
  rotate: {},
86
92
  opacity: {},
93
+ border: {},
94
+ radius: {},
95
+ background: {},
87
96
  viewBox: {}
88
97
  },
89
98
  setup(__props) {
@@ -112,6 +121,9 @@ var _sfc_main$E = defineComponent({
112
121
  rotate != 0 && (style.transform = `rotate(${rotate}deg)`);
113
122
  const opacity = correctNumber(props.opacity, void 0);
114
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);
115
127
  return style;
116
128
  });
117
129
  return (_ctx, _cache) => {
@@ -241,10 +253,6 @@ var _sfc_main$D = defineComponent({
241
253
  }
242
254
  });
243
255
 
244
- var addLink = href => setTimeout(link.register, 0, href);
245
-
246
- addLink("/styles/snail.vue.vue.css");
247
-
248
256
  var _sfc_main$C = defineComponent({
249
257
  ...{
250
258
  name: "Footer",
@@ -2790,7 +2798,11 @@ var _sfc_main$g = defineComponent({
2790
2798
  type: Boolean
2791
2799
  },
2792
2800
  trigger: {},
2793
- actions: {}
2801
+ actions: {},
2802
+ followX: {},
2803
+ followY: {},
2804
+ spaceX: {},
2805
+ spaceY: {}
2794
2806
  },
2795
2807
  emits: ["trigger"],
2796
2808
  setup(__props, _ref) {
@@ -2822,8 +2834,10 @@ var _sfc_main$g = defineComponent({
2822
2834
  closeOnMask: true,
2823
2835
  closeOnResize: true,
2824
2836
  closeOnTarget: true,
2825
- followX: longPress ? ["center", "start", "end"] : ["after", "end", "start", "end", "center"],
2826
- 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,
2827
2841
  props: {
2828
2842
  mode: "vertical",
2829
2843
  actions: props.actions
@@ -2845,7 +2859,7 @@ var _sfc_main$g = defineComponent({
2845
2859
  pressStartDate = void 0;
2846
2860
  if (time >= 0.5) {
2847
2861
  navigator.vibrate && navigator.vibrate(200);
2848
- onFollowShow(true);
2862
+ onFollowShow();
2849
2863
  }
2850
2864
  }
2851
2865
  }
@@ -2875,7 +2889,7 @@ var _sfc_main$g = defineComponent({
2875
2889
  button: "",
2876
2890
  type: "more",
2877
2891
  size: 16,
2878
- onClick: _cache[0] || (_cache[0] = $event => onFollowShow(false))
2892
+ onClick: _cache[0] || (_cache[0] = $event => onFollowShow())
2879
2893
  })])], 2)) : createCommentVNode("", true)], 512);
2880
2894
  };
2881
2895
  }
@@ -4007,18 +4021,18 @@ const _hoisted_1$4 = {
4007
4021
  class: "tz-item",
4008
4022
  ref: "hour-items"
4009
4023
  };
4010
- const _hoisted_2$1 = ["textContent", "onClick"];
4024
+ const _hoisted_2$1 = ["textContent", "onClick", "onDblclick"];
4011
4025
  const _hoisted_3$1 = {
4012
4026
  class: "tz-item",
4013
4027
  ref: "minute-items"
4014
4028
  };
4015
- const _hoisted_4$1 = ["textContent", "onClick"];
4029
+ const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
4016
4030
  const _hoisted_5$1 = {
4017
4031
  key: 0,
4018
4032
  class: "tz-item",
4019
4033
  ref: "second-items"
4020
4034
  };
4021
- const _hoisted_6$1 = ["textContent", "onClick"];
4035
+ const _hoisted_6$1 = ["textContent", "onClick", "onDblclick"];
4022
4036
  var _sfc_main$4 = defineComponent({
4023
4037
  __name: "time-pc",
4024
4038
  props: {
@@ -4088,29 +4102,27 @@ var _sfc_main$4 = defineComponent({
4088
4102
  block: "center"
4089
4103
  });
4090
4104
  }
4091
- function onHourClick(item) {
4105
+ function onHourClick(item, dbClick) {
4092
4106
  if (item.disabled != true && timeRef.value.hour != item.hour) {
4093
4107
  timeRef.value.hour = item.hour;
4094
4108
  minuteItems.value = buildMinuteItems(item, min, max);
4095
4109
  secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
4096
4110
  }
4097
4111
  }
4098
- function onMinuteClick(item) {
4112
+ function onMinuteClick(item, dbClick) {
4099
4113
  if (item.disabled != true) {
4114
+ timeRef.value.minute = item.minute;
4100
4115
  if (format == "HH:mm") {
4101
- const value = formatTimeValue(item, "HH:mm");
4102
- emits("confirm", value);
4103
- props.inPopup && props.closePopup(value);
4116
+ dbClick && onConfirm();
4104
4117
  } else if (timeRef.value.minute != item.minute) {
4105
- timeRef.value.minute = item.minute;
4106
4118
  secondItems.value = buildSecondItems(item, min, max);
4107
4119
  }
4108
4120
  }
4109
4121
  }
4110
- function onSecondClick(item) {
4122
+ function onSecondClick(item, dbClick) {
4111
4123
  if (item.disabled != true) {
4112
4124
  timeRef.value.second = item.second;
4113
- onConfirm();
4125
+ dbClick && onConfirm();
4114
4126
  }
4115
4127
  }
4116
4128
  function onConfirm() {
@@ -4140,8 +4152,9 @@ var _sfc_main$4 = defineComponent({
4140
4152
  }]),
4141
4153
  key: item.hour,
4142
4154
  textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
4143
- onClick: $event => onHourClick(item)
4144
- }, null, 10, _hoisted_2$1);
4155
+ onClick: $event => onHourClick(item),
4156
+ onDblclick: $event => onHourClick(item)
4157
+ }, null, 42, _hoisted_2$1);
4145
4158
  }), 128))], 512), createElementVNode("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
4146
4159
  return openBlock(), createElementBlock("div", {
4147
4160
  class: normalizeClass(["tzi-number", {
@@ -4150,8 +4163,9 @@ var _sfc_main$4 = defineComponent({
4150
4163
  }]),
4151
4164
  key: `${item.hour}:${item.minute}`,
4152
4165
  textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
4153
- onClick: $event => onMinuteClick(item)
4154
- }, null, 10, _hoisted_4$1);
4166
+ onClick: $event => onMinuteClick(item),
4167
+ onDblclick: $event => onMinuteClick(item, true)
4168
+ }, null, 42, _hoisted_4$1);
4155
4169
  }), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
4156
4170
  return openBlock(), createElementBlock("div", {
4157
4171
  class: normalizeClass(["tzi-number", {
@@ -4160,8 +4174,9 @@ var _sfc_main$4 = defineComponent({
4160
4174
  }]),
4161
4175
  key: `${item.hour}:${item.minute}:${item.second}`,
4162
4176
  textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
4163
- onClick: $event => onSecondClick(item)
4164
- }, null, 10, _hoisted_6$1);
4177
+ onClick: $event => onSecondClick(item),
4178
+ onDblclick: $event => onSecondClick(item, true)
4179
+ }, null, 42, _hoisted_6$1);
4165
4180
  }), 128))], 512)) : createCommentVNode("", true)]),
4166
4181
  _: 1
4167
4182
  }, 8, ["effect"])]),
@@ -4198,10 +4213,10 @@ var _sfc_main$4 = defineComponent({
4198
4213
  const _hoisted_1$3 = ["textContent"];
4199
4214
  const _hoisted_2 = ["textContent"];
4200
4215
  const _hoisted_3 = ["textContent"];
4201
- const _hoisted_4 = ["textContent", "onClick"];
4202
- const _hoisted_5 = ["textContent", "onClick"];
4216
+ const _hoisted_4 = ["textContent", "onClick", "onDblclick"];
4217
+ const _hoisted_5 = ["textContent", "onClick", "onDblclick"];
4203
4218
  const _hoisted_6 = ["textContent"];
4204
- const _hoisted_7 = ["textContent", "onClick"];
4219
+ const _hoisted_7 = ["textContent", "onClick", "onDblclick"];
4205
4220
  const _hoisted_8 = ["textContent"];
4206
4221
  var _sfc_main$3 = defineComponent({
4207
4222
  __name: "date-pc",
@@ -4332,13 +4347,11 @@ var _sfc_main$3 = defineComponent({
4332
4347
  function onSwitchStepClick(newValue) {
4333
4348
  setTimeout(() => stepRef.value = newValue);
4334
4349
  }
4335
- function onYearItemClick(item) {
4350
+ function onYearItemClick(item, dbClick) {
4336
4351
  if (item.disabled != true) {
4337
4352
  dateRef.value.year = item.year;
4338
4353
  if (format == "yyyy") {
4339
- const value = String(dateRef.value.year).padStart(4, "0");
4340
- emits("confirm", value);
4341
- props.inPopup && props.closePopup(value);
4354
+ dbClick && onConfirm();
4342
4355
  } else {
4343
4356
  dateRef.value.month = 1;
4344
4357
  monthItems.value = buildMonthItems(item, min, max);
@@ -4346,14 +4359,12 @@ var _sfc_main$3 = defineComponent({
4346
4359
  }
4347
4360
  }
4348
4361
  }
4349
- function onMonthItemClick(item) {
4362
+ function onMonthItemClick(item, dbClick) {
4350
4363
  if (item.disabled != true) {
4351
4364
  dateRef.value.year = item.year;
4352
4365
  dateRef.value.month = item.month;
4353
4366
  if (format == "yyyy-MM") {
4354
- const value = formatDateValue(dateRef.value, "yyyy-MM");
4355
- emits("confirm", value);
4356
- props.inPopup && props.closePopup(value);
4367
+ dbClick && onConfirm();
4357
4368
  } else {
4358
4369
  dateRef.value.day = 1;
4359
4370
  dayItemsRef.value = buildDayItems(item, min, max);
@@ -4361,19 +4372,17 @@ var _sfc_main$3 = defineComponent({
4361
4372
  }
4362
4373
  }
4363
4374
  }
4364
- function onDayItemClick(item) {
4375
+ function onDayItemClick(item, dbClick) {
4365
4376
  if (item.disabled != true) {
4366
- const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4367
4377
  Object.assign(dateRef.value, {
4368
4378
  year: item.year,
4369
4379
  month: item.month,
4370
4380
  day: item.day
4371
4381
  });
4372
4382
  if (format == "yyyy-MM-dd") {
4373
- const value = formatDateValue(dateRef.value, "yyyy-MM-dd");
4374
- emits("confirm", value);
4375
- props.inPopup && props.closePopup(value);
4383
+ dbClick && onConfirm();
4376
4384
  } else {
4385
+ const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4377
4386
  isNowMonth || buildPickerItems("day", 0);
4378
4387
  }
4379
4388
  }
@@ -4471,8 +4480,9 @@ var _sfc_main$3 = defineComponent({
4471
4480
  key: item.year
4472
4481
  }, [createElementVNode("span", {
4473
4482
  textContent: toDisplayString(item.year),
4474
- onClick: $event => onYearItemClick(item)
4475
- }, null, 8, _hoisted_4)], 2);
4483
+ onClick: $event => onYearItemClick(item),
4484
+ onDblclick: $event => onYearItemClick(item, true)
4485
+ }, null, 40, _hoisted_4)], 2);
4476
4486
  }), 128)) : stepRef.value == "month" ? (openBlock(true), createElementBlock(Fragment, {
4477
4487
  key: 1
4478
4488
  }, renderList(monthItems.value, item => {
@@ -4484,8 +4494,9 @@ var _sfc_main$3 = defineComponent({
4484
4494
  key: `${item.year}-${item.month}`
4485
4495
  }, [createElementVNode("span", {
4486
4496
  textContent: toDisplayString(item.text),
4487
- onClick: $event => onMonthItemClick(item)
4488
- }, null, 8, _hoisted_5)], 2);
4497
+ onClick: $event => onMonthItemClick(item),
4498
+ onDblclick: $event => onMonthItemClick(item, true)
4499
+ }, null, 40, _hoisted_5)], 2);
4489
4500
  }), 128)) : (openBlock(), createElementBlock(Fragment, {
4490
4501
  key: 2
4491
4502
  }, [(openBlock(), createElementBlock(Fragment, null, renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
@@ -4504,8 +4515,9 @@ var _sfc_main$3 = defineComponent({
4504
4515
  key: `${item.year}-${item.month}-${item.day}`
4505
4516
  }, [createElementVNode("span", {
4506
4517
  textContent: toDisplayString(item.day),
4507
- onClick: $event => onDayItemClick(item)
4508
- }, null, 8, _hoisted_7)], 2);
4518
+ onClick: $event => onDayItemClick(item),
4519
+ onDblclick: $event => onDayItemClick(item, true)
4520
+ }, null, 40, _hoisted_7)], 2);
4509
4521
  }), 128))], 64))]),
4510
4522
  _: 2
4511
4523
  }, [unref(endStep) == stepRef.value && (__props.toolbarDisabled != true || unref(timeFormat) != void 0) ? {
@@ -27,6 +27,10 @@
27
27
  }
28
28
  });
29
29
 
30
+ var addLink = href => setTimeout(snail_view.link.register, 0, href);
31
+
32
+ addLink("/styles/snail.vue.vue.css");
33
+
30
34
  function getBuiltinIcon(iconType) {
31
35
  switch (iconType) {
32
36
  case "success":
@@ -45,6 +49,8 @@
45
49
  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"];
46
50
  case "edit":
47
51
  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"];
52
+ case "pause":
53
+ 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"];
48
54
  case "arrow":
49
55
  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"];
50
56
  case "datepicker":
@@ -86,6 +92,9 @@
86
92
  hoverColor: {},
87
93
  rotate: {},
88
94
  opacity: {},
95
+ border: {},
96
+ radius: {},
97
+ background: {},
89
98
  viewBox: {}
90
99
  },
91
100
  setup(__props) {
@@ -114,6 +123,9 @@
114
123
  rotate != 0 && (style.transform = `rotate(${rotate}deg)`);
115
124
  const opacity = snail_core.correctNumber(props.opacity, void 0);
116
125
  opacity >= 0 && (style.opacity = opacity);
126
+ style.border = snail_core.correctString(props.border, void 0, true);
127
+ style.borderRadius = snail_core.correctString(props.radius, void 0, true);
128
+ style.background = snail_core.correctString(props.background, void 0, true);
117
129
  return style;
118
130
  });
119
131
  return (_ctx, _cache) => {
@@ -243,10 +255,6 @@
243
255
  }
244
256
  });
245
257
 
246
- var addLink = href => setTimeout(snail_view.link.register, 0, href);
247
-
248
- addLink("/styles/snail.vue.vue.css");
249
-
250
258
  var _sfc_main$C = vue.defineComponent({
251
259
  ...{
252
260
  name: "Footer",
@@ -2792,7 +2800,11 @@
2792
2800
  type: Boolean
2793
2801
  },
2794
2802
  trigger: {},
2795
- actions: {}
2803
+ actions: {},
2804
+ followX: {},
2805
+ followY: {},
2806
+ spaceX: {},
2807
+ spaceY: {}
2796
2808
  },
2797
2809
  emits: ["trigger"],
2798
2810
  setup(__props, _ref) {
@@ -2824,8 +2836,10 @@
2824
2836
  closeOnMask: true,
2825
2837
  closeOnResize: true,
2826
2838
  closeOnTarget: true,
2827
- followX: longPress ? ["center", "start", "end"] : ["after", "end", "start", "end", "center"],
2828
- followY: longPress ? ["center", "after", "before"] : ["after", "before", "center", "end", "after"],
2839
+ followX: props.followX || ["center", "start", "end", "after", "before", "ratio"],
2840
+ followY: props.followY || ["after", "before", "center", "end", "start", "ratio"],
2841
+ spaceX: props.spaceX,
2842
+ spaceY: props.spaceY,
2829
2843
  props: {
2830
2844
  mode: "vertical",
2831
2845
  actions: props.actions
@@ -2847,7 +2861,7 @@
2847
2861
  pressStartDate = void 0;
2848
2862
  if (time >= 0.5) {
2849
2863
  navigator.vibrate && navigator.vibrate(200);
2850
- onFollowShow(true);
2864
+ onFollowShow();
2851
2865
  }
2852
2866
  }
2853
2867
  }
@@ -2877,7 +2891,7 @@
2877
2891
  button: "",
2878
2892
  type: "more",
2879
2893
  size: 16,
2880
- onClick: _cache[0] || (_cache[0] = $event => onFollowShow(false))
2894
+ onClick: _cache[0] || (_cache[0] = $event => onFollowShow())
2881
2895
  })])], 2)) : vue.createCommentVNode("", true)], 512);
2882
2896
  };
2883
2897
  }
@@ -4009,18 +4023,18 @@
4009
4023
  class: "tz-item",
4010
4024
  ref: "hour-items"
4011
4025
  };
4012
- const _hoisted_2$1 = ["textContent", "onClick"];
4026
+ const _hoisted_2$1 = ["textContent", "onClick", "onDblclick"];
4013
4027
  const _hoisted_3$1 = {
4014
4028
  class: "tz-item",
4015
4029
  ref: "minute-items"
4016
4030
  };
4017
- const _hoisted_4$1 = ["textContent", "onClick"];
4031
+ const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
4018
4032
  const _hoisted_5$1 = {
4019
4033
  key: 0,
4020
4034
  class: "tz-item",
4021
4035
  ref: "second-items"
4022
4036
  };
4023
- const _hoisted_6$1 = ["textContent", "onClick"];
4037
+ const _hoisted_6$1 = ["textContent", "onClick", "onDblclick"];
4024
4038
  var _sfc_main$4 = vue.defineComponent({
4025
4039
  __name: "time-pc",
4026
4040
  props: {
@@ -4090,29 +4104,27 @@
4090
4104
  block: "center"
4091
4105
  });
4092
4106
  }
4093
- function onHourClick(item) {
4107
+ function onHourClick(item, dbClick) {
4094
4108
  if (item.disabled != true && timeRef.value.hour != item.hour) {
4095
4109
  timeRef.value.hour = item.hour;
4096
4110
  minuteItems.value = buildMinuteItems(item, min, max);
4097
4111
  secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
4098
4112
  }
4099
4113
  }
4100
- function onMinuteClick(item) {
4114
+ function onMinuteClick(item, dbClick) {
4101
4115
  if (item.disabled != true) {
4116
+ timeRef.value.minute = item.minute;
4102
4117
  if (format == "HH:mm") {
4103
- const value = snail_core.formatTimeValue(item, "HH:mm");
4104
- emits("confirm", value);
4105
- props.inPopup && props.closePopup(value);
4118
+ dbClick && onConfirm();
4106
4119
  } else if (timeRef.value.minute != item.minute) {
4107
- timeRef.value.minute = item.minute;
4108
4120
  secondItems.value = buildSecondItems(item, min, max);
4109
4121
  }
4110
4122
  }
4111
4123
  }
4112
- function onSecondClick(item) {
4124
+ function onSecondClick(item, dbClick) {
4113
4125
  if (item.disabled != true) {
4114
4126
  timeRef.value.second = item.second;
4115
- onConfirm();
4127
+ dbClick && onConfirm();
4116
4128
  }
4117
4129
  }
4118
4130
  function onConfirm() {
@@ -4142,8 +4154,9 @@
4142
4154
  }]),
4143
4155
  key: item.hour,
4144
4156
  textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.hour, 2, "0")),
4145
- onClick: $event => onHourClick(item)
4146
- }, null, 10, _hoisted_2$1);
4157
+ onClick: $event => onHourClick(item),
4158
+ onDblclick: $event => onHourClick(item)
4159
+ }, null, 42, _hoisted_2$1);
4147
4160
  }), 128))], 512), vue.createElementVNode("div", _hoisted_3$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(minuteItems.value, item => {
4148
4161
  return vue.openBlock(), vue.createElementBlock("div", {
4149
4162
  class: vue.normalizeClass(["tzi-number", {
@@ -4152,8 +4165,9 @@
4152
4165
  }]),
4153
4166
  key: `${item.hour}:${item.minute}`,
4154
4167
  textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.minute, 2, "0")),
4155
- onClick: $event => onMinuteClick(item)
4156
- }, null, 10, _hoisted_4$1);
4168
+ onClick: $event => onMinuteClick(item),
4169
+ onDblclick: $event => onMinuteClick(item, true)
4170
+ }, null, 42, _hoisted_4$1);
4157
4171
  }), 128))], 512), vue.unref(format) == "HH:mm:ss" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(secondItems.value, item => {
4158
4172
  return vue.openBlock(), vue.createElementBlock("div", {
4159
4173
  class: vue.normalizeClass(["tzi-number", {
@@ -4162,8 +4176,9 @@
4162
4176
  }]),
4163
4177
  key: `${item.hour}:${item.minute}:${item.second}`,
4164
4178
  textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.second, 2, "0")),
4165
- onClick: $event => onSecondClick(item)
4166
- }, null, 10, _hoisted_6$1);
4179
+ onClick: $event => onSecondClick(item),
4180
+ onDblclick: $event => onSecondClick(item, true)
4181
+ }, null, 42, _hoisted_6$1);
4167
4182
  }), 128))], 512)) : vue.createCommentVNode("", true)]),
4168
4183
  _: 1
4169
4184
  }, 8, ["effect"])]),
@@ -4200,10 +4215,10 @@
4200
4215
  const _hoisted_1$3 = ["textContent"];
4201
4216
  const _hoisted_2 = ["textContent"];
4202
4217
  const _hoisted_3 = ["textContent"];
4203
- const _hoisted_4 = ["textContent", "onClick"];
4204
- const _hoisted_5 = ["textContent", "onClick"];
4218
+ const _hoisted_4 = ["textContent", "onClick", "onDblclick"];
4219
+ const _hoisted_5 = ["textContent", "onClick", "onDblclick"];
4205
4220
  const _hoisted_6 = ["textContent"];
4206
- const _hoisted_7 = ["textContent", "onClick"];
4221
+ const _hoisted_7 = ["textContent", "onClick", "onDblclick"];
4207
4222
  const _hoisted_8 = ["textContent"];
4208
4223
  var _sfc_main$3 = vue.defineComponent({
4209
4224
  __name: "date-pc",
@@ -4334,13 +4349,11 @@
4334
4349
  function onSwitchStepClick(newValue) {
4335
4350
  setTimeout(() => stepRef.value = newValue);
4336
4351
  }
4337
- function onYearItemClick(item) {
4352
+ function onYearItemClick(item, dbClick) {
4338
4353
  if (item.disabled != true) {
4339
4354
  dateRef.value.year = item.year;
4340
4355
  if (format == "yyyy") {
4341
- const value = String(dateRef.value.year).padStart(4, "0");
4342
- emits("confirm", value);
4343
- props.inPopup && props.closePopup(value);
4356
+ dbClick && onConfirm();
4344
4357
  } else {
4345
4358
  dateRef.value.month = 1;
4346
4359
  monthItems.value = buildMonthItems(item, min, max);
@@ -4348,14 +4361,12 @@
4348
4361
  }
4349
4362
  }
4350
4363
  }
4351
- function onMonthItemClick(item) {
4364
+ function onMonthItemClick(item, dbClick) {
4352
4365
  if (item.disabled != true) {
4353
4366
  dateRef.value.year = item.year;
4354
4367
  dateRef.value.month = item.month;
4355
4368
  if (format == "yyyy-MM") {
4356
- const value = snail_core.formatDateValue(dateRef.value, "yyyy-MM");
4357
- emits("confirm", value);
4358
- props.inPopup && props.closePopup(value);
4369
+ dbClick && onConfirm();
4359
4370
  } else {
4360
4371
  dateRef.value.day = 1;
4361
4372
  dayItemsRef.value = buildDayItems(item, min, max);
@@ -4363,19 +4374,17 @@
4363
4374
  }
4364
4375
  }
4365
4376
  }
4366
- function onDayItemClick(item) {
4377
+ function onDayItemClick(item, dbClick) {
4367
4378
  if (item.disabled != true) {
4368
- const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4369
4379
  Object.assign(dateRef.value, {
4370
4380
  year: item.year,
4371
4381
  month: item.month,
4372
4382
  day: item.day
4373
4383
  });
4374
4384
  if (format == "yyyy-MM-dd") {
4375
- const value = snail_core.formatDateValue(dateRef.value, "yyyy-MM-dd");
4376
- emits("confirm", value);
4377
- props.inPopup && props.closePopup(value);
4385
+ dbClick && onConfirm();
4378
4386
  } else {
4387
+ const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
4379
4388
  isNowMonth || buildPickerItems("day", 0);
4380
4389
  }
4381
4390
  }
@@ -4473,8 +4482,9 @@
4473
4482
  key: item.year
4474
4483
  }, [vue.createElementVNode("span", {
4475
4484
  textContent: vue.toDisplayString(item.year),
4476
- onClick: $event => onYearItemClick(item)
4477
- }, null, 8, _hoisted_4)], 2);
4485
+ onClick: $event => onYearItemClick(item),
4486
+ onDblclick: $event => onYearItemClick(item, true)
4487
+ }, null, 40, _hoisted_4)], 2);
4478
4488
  }), 128)) : stepRef.value == "month" ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
4479
4489
  key: 1
4480
4490
  }, vue.renderList(monthItems.value, item => {
@@ -4486,8 +4496,9 @@
4486
4496
  key: `${item.year}-${item.month}`
4487
4497
  }, [vue.createElementVNode("span", {
4488
4498
  textContent: vue.toDisplayString(item.text),
4489
- onClick: $event => onMonthItemClick(item)
4490
- }, null, 8, _hoisted_5)], 2);
4499
+ onClick: $event => onMonthItemClick(item),
4500
+ onDblclick: $event => onMonthItemClick(item, true)
4501
+ }, null, 40, _hoisted_5)], 2);
4491
4502
  }), 128)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
4492
4503
  key: 2
4493
4504
  }, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
@@ -4506,8 +4517,9 @@
4506
4517
  key: `${item.year}-${item.month}-${item.day}`
4507
4518
  }, [vue.createElementVNode("span", {
4508
4519
  textContent: vue.toDisplayString(item.day),
4509
- onClick: $event => onDayItemClick(item)
4510
- }, null, 8, _hoisted_7)], 2);
4520
+ onClick: $event => onDayItemClick(item),
4521
+ onDblclick: $event => onDayItemClick(item, true)
4522
+ }, null, 40, _hoisted_7)], 2);
4511
4523
  }), 128))], 64))]),
4512
4524
  _: 2
4513
4525
  }, [vue.unref(endStep) == stepRef.value && (__props.toolbarDisabled != true || vue.unref(timeFormat) != void 0) ? {
@@ -16,12 +16,12 @@
16
16
  .snail-search{align-items:center;background:#fff;display:flex;flex-shrink:0;height:34px}.snail-search>input{border-radius:0!important;flex:1;height:100%}.snail-search>div{align-items:center;border:1px solid #dddfed;border-left:none;display:flex;flex-shrink:0;height:100%;justify-content:center;width:34px}
17
17
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/base/select.vue index:0 */
18
18
  .snail-select{align-items:center;border:1px solid #dddfed;border-radius:4px;color:#2e3033;display:flex;height:32px;width:100%}.snail-select:not(.readonly){background-color:#fff}.snail-select:not(.readonly,.empty){cursor:pointer}.snail-select>div.select-result{align-items:center;display:flex;flex:1;flex-wrap:nowrap;height:30px;overflow:hidden;padding:0 10px 0 6px}.snail-select>div.placeholder{flex:1;padding:0 10px 0 6px}.snail-select>svg.snail-icon{flex-shrink:0;margin-right:4px}.snail-select>div.no-items{flex:1;padding:0 8px}
19
+ /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/base/textarea.vue index:0 */
20
+ textarea.snail-textarea{font-size:14px;line-height:1.5em;overflow-x:hidden;overflow-y:auto;resize:none;width:100%}
19
21
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/base/switch.vue index:0 */
20
22
  .snail-switch{cursor:pointer;overflow:hidden;position:relative}.snail-switch.readonly{cursor:not-allowed}.snail-switch.switch{border-radius:10px 10px 10px 10px;height:20px!important;width:36px!important}.snail-switch.switch>div.on{background-color:#5ca3ff}.snail-switch.switch>div.off{background-color:#c4c8cc;position:absolute;transition:left .2s ease}.snail-switch.switch>div.status{background:#fff;border-radius:10px 10px 10px 10px;height:16px;position:absolute;top:2px;transition:left .2s ease;width:16px}.snail-switch.switch.on>div.off{left:100%;top:0}.snail-switch.switch.on>div.status{left:calc(100% - 18px)}.snail-switch.switch.off>div.off{left:0;top:0}.snail-switch.switch.off>div.status{left:2px}
21
23
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/base/switch.vue index:1 */
22
24
  .snail-switch.checkbox,.snail-switch.radio{align-items:center;display:flex;flex-shrink:0;height:18px;justify-content:center;width:18px}.snail-switch.checkbox.off,.snail-switch.radio.off{border:1px solid #dcdfe6}.snail-switch.checkbox.on,.snail-switch.radio.on{background-color:#4c9aff;border:1px solid #4c9aff}.snail-switch.radio{border-radius:50%}
23
- /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/base/textarea.vue index:0 */
24
- textarea.snail-textarea{font-size:14px;line-height:1.5em;overflow-x:hidden;overflow-y:auto;resize:none;width:100%}
25
25
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/action.vue index:0 */
26
26
  .snail-action,.snail-action *{-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-action>.action-slot{flex:1;overflow:hidden;position:relative}.snail-action>.trigger-area{align-items:center;flex-shrink:0;width:-moz-fit-content;width:fit-content}.snail-action>.trigger-area.hidden{display:none}.snail-action:hover>.trigger-area{display:flex}
27
27
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/dynamic.vue index:0 */
@@ -30,10 +30,10 @@ textarea.snail-textarea{font-size:14px;line-height:1.5em;overflow-x:hidden;overf
30
30
  .snail-elastic{background-color:#f6f8ff;overflow:hidden;position:relative}.snail-elastic>div.main-body{background-color:#fff;overflow:auto;overflow-anchor:none;position:relative;scroll-behavior:smooth;transition:transform .4s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;will-change:transform;z-index:1}.snail-elastic>div.main-body.moving{transition-property:none!important}.snail-elastic>div.down-refresh,.snail-elastic>div.up-more{left:0;overflow:hidden;position:absolute;width:100%}.snail-elastic>div.down-refresh>div.default-loading,.snail-elastic>div.up-more>div.default-loading{gap:6px;height:40px}@keyframes snail-elastic-pull-down{0%{opacity:.2}to{opacity:.8}}.snail-elastic>div.down-refresh>div.default-loading>span,.snail-elastic>div.up-more>div.default-loading>span{animation-direction:alternate;animation-duration:.8s;animation-iteration-count:infinite;animation-timing-function:linear;background-color:#000;border-radius:8px;height:8px;opacity:.2;width:8px}.snail-elastic>div.down-refresh>div.default-loading>span:nth-child(2),.snail-elastic>div.up-more>div.default-loading>span:nth-child(2){animation-delay:.4s}.snail-elastic>div.down-refresh>div.default-loading>span:nth-child(3),.snail-elastic>div.up-more>div.default-loading>span:nth-child(3){animation-delay:.8s}.snail-elastic>div.down-refresh.running>div.default-loading>span,.snail-elastic>div.up-more.running>div.default-loading>span{animation-name:snail-elastic-pull-down}.snail-elastic>div.down-refresh{top:0}.snail-elastic>div.up-more{bottom:0}
31
31
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/flex.vue index:0 */
32
32
  .snail-flex{display:flex;--gap:0;gap:var(--gap)}.snail-flex.row{flex-direction:row}.snail-flex.row-reverse{flex-direction:row-reverse}.snail-flex.column{flex-direction:column}.snail-flex.column-reverse{flex-direction:column-reverse}.snail-flex.nowrap{flex-wrap:nowrap}.snail-flex.wrap{flex-wrap:wrap}.snail-flex.wrap-reverse{flex-wrap:wrap-reverse}.snail-flex.justify-start{justify-content:flex-start}.snail-flex.justify-center{justify-content:center}.snail-flex.justify-end{justify-content:flex-end}.snail-flex.justify-between{justify-content:space-between}.snail-flex.justify-around{justify-content:space-around}.snail-flex.justify-evenly{justify-content:space-evenly}.snail-flex.items-start{align-items:flex-start}.snail-flex.items-center{align-items:center}.snail-flex.items-end{align-items:flex-end}.snail-flex.items-stretch{align-items:stretch}.snail-flex.items-baseline{align-items:baseline}.snail-flex.content-start{align-content:flex-start}.snail-flex.content-center{align-content:center}.snail-flex.content-end{align-content:flex-end}.snail-flex.content-stretch{align-content:stretch}.snail-flex.content-between{align-content:space-between}.snail-flex.content-around{align-content:space-around}.snail-flex.content-evenly{align-content:space-evenly}.snail-flex.row-reverse>.repair-item,.snail-flex.row>.repair-item{height:0!important;padding-bottom:0!important;padding-top:0!important;visibility:hidden!important}.snail-flex.column-reverse,.snail-flex.column>.repair-item{padding-left:0!important;padding-right:0!important;visibility:hidden!important;width:0!important}
33
- /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/layout.vue index:0 */
34
- .snail-layout{display:flex;flex-wrap:nowrap}.snail-layout,.snail-layout>div:not(.snail-scroll){overflow:hidden}.snail-layout>div.main-area{flex:1}.snail-layout.horizontal>div.left-area,.snail-layout.horizontal>div.right-area{flex-shrink:0;width:-moz-fit-content;width:fit-content}.snail-layout.vertical{flex-direction:column}.snail-layout.vertical>div.bottom-area,.snail-layout.vertical>div.top-area{flex-shrink:0;height:-moz-fit-content;height:fit-content}
35
33
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/fold.vue index:0 */
36
34
  .snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.title{color:#2e3033;font-weight:bold;padding-left:20px}.snail-fold>div.fold-header>.subtitle{color:#8a9099;font-size:13px}.snail-fold>div.fold-header>div.status{align-items:flex-end;display:flex;flex:1;justify-content:flex-end}.snail-fold>div.fold-body{padding-left:20px}
35
+ /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/layout.vue index:0 */
36
+ .snail-layout{display:flex;flex-wrap:nowrap}.snail-layout,.snail-layout>div:not(.snail-scroll){overflow:hidden}.snail-layout>div.main-area{flex:1}.snail-layout.horizontal>div.left-area,.snail-layout.horizontal>div.right-area{flex-shrink:0;width:-moz-fit-content;width:fit-content}.snail-layout.vertical{flex-direction:column}.snail-layout.vertical>div.bottom-area,.snail-layout.vertical>div.top-area{flex-shrink:0;height:-moz-fit-content;height:fit-content}
37
37
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/motion.vue index:0 */
38
38
 
39
39
  /* src:../../../../../01_snail/snail.js/packages/snail.vue/src/container/scroll.vue index:0 */
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "依赖【snail】,基于vue封装常用UI组件",
4
4
  "author": "snail_dev@163.com",
5
5
  "license": "MIT",
6
- "version": "2.0.27",
6
+ "version": "2.0.28",
7
7
  "type": "module",
8
8
  "main": "dist/snail.vue.js",
9
9
  "module": "dist/snail.vue.js",