snail.vue 2.0.30 → 2.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/snail.vue.js CHANGED
@@ -1,10 +1,10 @@
1
1
  //@ sourceURL=/snail.vue.js
2
2
  import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, computed, mergeProps, unref, createElementVNode, toDisplayString, Fragment, renderList, mergeModels, useModel, normalizeStyle, createCommentVNode, createBlock, nextTick, useTemplateRef, shallowRef, 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, 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 { link, css, useObserver, useScroll, useAnimation } from 'snail.view';
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, getTimeNumber, getDateValue, parseDate, formatDateValue, getDateByValue, parseTimeValue, getTimeValue, padStart, formatTimeValue, parseDateValue, correctDateFormat, isValidTime, getFromArray, isNullish, onMountScope } from 'snail.core';
4
+ import { css, link, useObserver, useScroll, useAnimation, useElastic } from 'snail.view';
5
5
 
6
- const _hoisted_1$o = ["title"];
7
- var _sfc_main$F = defineComponent({
6
+ const _hoisted_1$p = ["title"];
7
+ var _sfc_main$G = defineComponent({
8
8
  ...{
9
9
  name: "Button",
10
10
  inheritAttrs: true
@@ -26,15 +26,11 @@ var _sfc_main$F = defineComponent({
26
26
  class: normalizeClass(["snail-button", [__props.size, __props.type]]),
27
27
  title: __props.title,
28
28
  onClick: _cache[0] || (_cache[0] = evt => emits("click", evt))
29
- }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[1] || (_cache[1] = createTextVNode("按钮", -1))])], 10, _hoisted_1$o);
29
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[1] || (_cache[1] = createTextVNode("按钮", -1))])], 10, _hoisted_1$p);
30
30
  };
31
31
  }
32
32
  });
33
33
 
34
- var addLink = href => setTimeout(link.register, 0, href);
35
-
36
- addLink("/styles/snail.vue.vue.css");
37
-
38
34
  function getBuiltinIcon(iconType) {
39
35
  switch (iconType) {
40
36
  case "success":
@@ -77,10 +73,10 @@ function getBuiltinIcon(iconType) {
77
73
  }
78
74
  }
79
75
 
80
- const _hoisted_1$n = ["viewBox"];
81
- const _hoisted_2$h = ["textContent"];
82
- const _hoisted_3$a = ["d"];
83
- var _sfc_main$E = defineComponent({
76
+ const _hoisted_1$o = ["viewBox"];
77
+ const _hoisted_2$i = ["textContent"];
78
+ const _hoisted_3$b = ["d"];
79
+ var _sfc_main$F = defineComponent({
84
80
  __name: "icon",
85
81
  props: {
86
82
  title: {},
@@ -148,24 +144,24 @@ var _sfc_main$E = defineComponent({
148
144
  onClick: _cache[0] || (_cache[0] = evt => emits("click", evt))
149
145
  }), [createElementVNode("title", {
150
146
  textContent: toDisplayString(__props.title || "")
151
- }, null, 8, _hoisted_2$h), __props.custom == true ? renderSlot(_ctx.$slots, "default", {
147
+ }, null, 8, _hoisted_2$i), __props.custom == true ? renderSlot(_ctx.$slots, "default", {
152
148
  key: 0
153
149
  }) : (openBlock(true), createElementBlock(Fragment, {
154
150
  key: 1
155
151
  }, renderList(unref(getBuiltinIcon)(__props.type), d => {
156
152
  return openBlock(), createElementBlock("path", {
157
153
  d
158
- }, null, 8, _hoisted_3$a);
159
- }), 256))], 16, _hoisted_1$n);
154
+ }, null, 8, _hoisted_3$b);
155
+ }), 256))], 16, _hoisted_1$o);
160
156
  };
161
157
  }
162
158
  });
163
159
 
164
- const _hoisted_1$m = ["title", "onClick"];
165
- const _hoisted_2$g = ["type", "checked"];
166
- const _hoisted_3$9 = ["textContent"];
167
- const _hoisted_4$6 = ["textContent"];
168
- var _sfc_main$D = defineComponent({
160
+ const _hoisted_1$n = ["title", "onClick"];
161
+ const _hoisted_2$h = ["type", "checked"];
162
+ const _hoisted_3$a = ["textContent"];
163
+ const _hoisted_4$7 = ["textContent"];
164
+ var _sfc_main$E = defineComponent({
169
165
  ...{
170
166
  name: "Choose",
171
167
  inheritAttrs: true
@@ -241,10 +237,10 @@ var _sfc_main$D = defineComponent({
241
237
  key: 0,
242
238
  type: unref(type),
243
239
  checked: node.selected
244
- }, null, 8, _hoisted_2$g)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
240
+ }, null, 8, _hoisted_2$h)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
245
241
  key: 1,
246
242
  class: normalizeClass(["status", [node.selected ? "selected" : ""]])
247
- }, [node.selected ? (openBlock(), createBlock(_sfc_main$E, {
243
+ }, [node.selected ? (openBlock(), createBlock(_sfc_main$F, {
248
244
  key: 0,
249
245
  type: "success",
250
246
  size: 12,
@@ -253,17 +249,21 @@ var _sfc_main$D = defineComponent({
253
249
  key: 2,
254
250
  class: "item-text",
255
251
  textContent: toDisplayString(node.item.text)
256
- }, null, 8, _hoisted_3$9)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
252
+ }, null, 8, _hoisted_3$a)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
257
253
  key: 3,
258
254
  class: "item-des",
259
255
  textContent: toDisplayString(node.item.description)
260
- }, null, 8, _hoisted_4$6)) : createCommentVNode("", true)], 14, _hoisted_1$m);
256
+ }, null, 8, _hoisted_4$7)) : createCommentVNode("", true)], 14, _hoisted_1$n);
261
257
  }), 128))], 2);
262
258
  };
263
259
  }
264
260
  });
265
261
 
266
- var _sfc_main$C = defineComponent({
262
+ var addLink = href => setTimeout(link.register, 0, href);
263
+
264
+ addLink("/styles/snail.vue.vue.css");
265
+
266
+ var _sfc_main$D = defineComponent({
267
267
  ...{
268
268
  name: "Footer",
269
269
  inheritAttrs: true
@@ -294,13 +294,13 @@ var _sfc_main$C = defineComponent({
294
294
  class: normalizeClass(["snail-footer", {
295
295
  "start-divider": __props.divider
296
296
  }, __props.align || "right"])
297
- }, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
297
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
298
298
  key: 0,
299
299
  size: "max",
300
300
  type: "default",
301
301
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
302
302
  textContent: toDisplayString(__props.cancelName || "取消")
303
- }, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
303
+ }, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
304
304
  key: 1,
305
305
  size: "max",
306
306
  type: "primary",
@@ -311,8 +311,8 @@ var _sfc_main$C = defineComponent({
311
311
  }
312
312
  });
313
313
 
314
- const _hoisted_1$l = ["textContent"];
315
- var _sfc_main$B = defineComponent({
314
+ const _hoisted_1$m = ["textContent"];
315
+ var _sfc_main$C = defineComponent({
316
316
  ...{
317
317
  name: "Header",
318
318
  inheritAttrs: true
@@ -351,7 +351,7 @@ var _sfc_main$B = defineComponent({
351
351
  key: 0,
352
352
  textContent: toDisplayString(__props.title),
353
353
  class: normalizeClass(["header-title", __props.titleAlign])
354
- }, null, 10, _hoisted_1$l)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$E, {
354
+ }, null, 10, _hoisted_1$m)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
355
355
  key: 1,
356
356
  class: "close-icon",
357
357
  type: "close",
@@ -364,18 +364,18 @@ var _sfc_main$B = defineComponent({
364
364
  }
365
365
  });
366
366
 
367
- const _hoisted_1$k = ["textContent"];
368
- const _hoisted_2$f = {
367
+ const _hoisted_1$l = ["textContent"];
368
+ const _hoisted_2$g = {
369
369
  key: 0,
370
370
  class: "required",
371
371
  textContent: "*"
372
372
  };
373
- const _hoisted_3$8 = {
373
+ const _hoisted_3$9 = {
374
374
  class: "input-body"
375
375
  };
376
- const _hoisted_4$5 = ["type", "value", "readonly", "placeholder", "title"];
377
- const _hoisted_5$3 = ["title"];
378
- var _sfc_main$A = defineComponent({
376
+ const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
377
+ const _hoisted_5$4 = ["title"];
378
+ var _sfc_main$B = defineComponent({
379
379
  ...{
380
380
  name: "Input",
381
381
  inheritAttrs: true
@@ -427,7 +427,7 @@ var _sfc_main$A = defineComponent({
427
427
  }, [createElementVNode("span", {
428
428
  class: "text",
429
429
  textContent: toDisplayString(__props.title)
430
- }, null, 8, _hoisted_1$k), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$f)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$8, [createElementVNode("input", {
430
+ }, null, 8, _hoisted_1$l), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$g)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$9, [createElementVNode("input", {
431
431
  ref: "input-el",
432
432
  type: __props.type || "text",
433
433
  value: inputModel.value,
@@ -436,16 +436,16 @@ var _sfc_main$A = defineComponent({
436
436
  title: inputModel.value,
437
437
  onChange: onValueChange,
438
438
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
439
- }, null, 40, _hoisted_4$5), !!validateRef.value ? (openBlock(), createElementBlock("span", {
439
+ }, null, 40, _hoisted_4$6), !!validateRef.value ? (openBlock(), createElementBlock("span", {
440
440
  key: 0,
441
441
  class: "validate",
442
442
  title: validateRef.value
443
- }, [createVNode(_sfc_main$E, {
443
+ }, [createVNode(_sfc_main$F, {
444
444
  type: "error",
445
445
  button: "",
446
446
  size: 16,
447
447
  color: "red"
448
- })], 8, _hoisted_5$3)) : createCommentVNode("", true)])], 2);
448
+ })], 8, _hoisted_5$4)) : createCommentVNode("", true)])], 2);
449
449
  };
450
450
  }
451
451
  });
@@ -650,20 +650,20 @@ function useFormatter(options) {
650
650
  return formatter;
651
651
  }
652
652
 
653
- const _hoisted_1$j = {
653
+ const _hoisted_1$k = {
654
654
  key: 0,
655
655
  class: "number-prefix"
656
656
  };
657
- const _hoisted_2$e = ["textContent"];
658
- const _hoisted_3$7 = ["inputmode", "placeholder", "title"];
659
- const _hoisted_4$4 = {
657
+ const _hoisted_2$f = ["textContent"];
658
+ const _hoisted_3$8 = ["inputmode", "placeholder", "title"];
659
+ const _hoisted_4$5 = {
660
660
  key: 1,
661
661
  class: "number-suffix"
662
662
  };
663
- const _hoisted_5$2 = ["textContent"];
664
- const _hoisted_6$2 = ["title", "textContent"];
663
+ const _hoisted_5$3 = ["textContent"];
664
+ const _hoisted_6$3 = ["title", "textContent"];
665
665
  const _hoisted_7$1 = ["title", "textContent"];
666
- var _sfc_main$z = defineComponent({
666
+ var _sfc_main$A = defineComponent({
667
667
  __name: "number",
668
668
  props: mergeModels({
669
669
  placeholder: {},
@@ -810,10 +810,10 @@ var _sfc_main$z = defineComponent({
810
810
  "has-prefix": unref(hasPrefix),
811
811
  "has-suffix": unref(hasSuffix)
812
812
  }])
813
- }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$j, [createElementVNode("span", {
813
+ }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$k, [createElementVNode("span", {
814
814
  class: "ellipsis",
815
815
  textContent: toDisplayString(unref(prefix))
816
- }, null, 8, _hoisted_2$e)])) : createCommentVNode("", true), createElementVNode("div", {
816
+ }, null, 8, _hoisted_2$f)])) : createCommentVNode("", true), createElementVNode("div", {
817
817
  class: normalizeClass(["input-panel", unref(controls)])
818
818
  }, [withDirectives(createElementVNode("input", {
819
819
  type: "text",
@@ -825,19 +825,19 @@ var _sfc_main$z = defineComponent({
825
825
  onFocus: _cache[1] || (_cache[1] = $event => isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
826
826
  onPaste: _cache[2] || (_cache[2] = $event => isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
827
827
  onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
828
- }, null, 40, _hoisted_3$7), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
828
+ }, null, 40, _hoisted_3$8), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
829
829
  key: 0
830
830
  }, [createElementVNode("div", {
831
831
  class: "controls default subtract",
832
832
  onClick: _cache[4] || (_cache[4] = $event => onStepClick(false))
833
- }, [createVNode(_sfc_main$E, {
833
+ }, [createVNode(_sfc_main$F, {
834
834
  type: "subtract",
835
835
  button: "",
836
836
  size: 20
837
837
  })]), createElementVNode("div", {
838
838
  class: "controls default plus",
839
839
  onClick: _cache[5] || (_cache[5] = $event => onStepClick(true))
840
- }, [createVNode(_sfc_main$E, {
840
+ }, [createVNode(_sfc_main$F, {
841
841
  type: "plus",
842
842
  button: "",
843
843
  size: 20
@@ -846,7 +846,7 @@ var _sfc_main$z = defineComponent({
846
846
  }, [createElementVNode("div", {
847
847
  class: "controls right plus",
848
848
  onClick: _cache[6] || (_cache[6] = $event => onStepClick(true))
849
- }, [createVNode(_sfc_main$E, {
849
+ }, [createVNode(_sfc_main$F, {
850
850
  type: "arrow",
851
851
  button: "",
852
852
  size: 20,
@@ -854,20 +854,20 @@ var _sfc_main$z = defineComponent({
854
854
  })]), createElementVNode("div", {
855
855
  class: "controls right subtract",
856
856
  onClick: _cache[7] || (_cache[7] = $event => onStepClick(false))
857
- }, [createVNode(_sfc_main$E, {
857
+ }, [createVNode(_sfc_main$F, {
858
858
  type: "arrow",
859
859
  button: "",
860
860
  size: 20,
861
861
  rotate: 90
862
- })])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$4, [createElementVNode("span", {
862
+ })])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$5, [createElementVNode("span", {
863
863
  class: "ellipsis",
864
864
  textContent: toDisplayString(unref(suffix))
865
- }, null, 8, _hoisted_5$2)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
865
+ }, null, 8, _hoisted_5$3)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
866
866
  key: 2,
867
867
  class: "number-util ellipsis",
868
868
  title: upperTextRef.value,
869
869
  textContent: toDisplayString(`大写:${upperTextRef.value || ""}`)
870
- }, null, 8, _hoisted_6$2)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
870
+ }, null, 8, _hoisted_6$3)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
871
871
  key: 3,
872
872
  class: "number-util ellipsis",
873
873
  title: thousandsTextRef.value,
@@ -877,8 +877,8 @@ var _sfc_main$z = defineComponent({
877
877
  }
878
878
  });
879
879
 
880
- const _hoisted_1$i = ["placeholder", "readonly"];
881
- var _sfc_main$y = defineComponent({
880
+ const _hoisted_1$j = ["placeholder", "readonly"];
881
+ var _sfc_main$z = defineComponent({
882
882
  ...{
883
883
  name: "Search",
884
884
  inheritAttrs: true
@@ -923,9 +923,9 @@ var _sfc_main$y = defineComponent({
923
923
  readonly: __props.readonly,
924
924
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
925
925
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
926
- }, null, 40, _hoisted_1$i), [[vModelText, textModel.value, void 0, {
926
+ }, null, 40, _hoisted_1$j), [[vModelText, textModel.value, void 0, {
927
927
  trim: true
928
- }]]), createElementVNode("div", null, [createVNode(_sfc_main$E, {
928
+ }]]), createElementVNode("div", null, [createVNode(_sfc_main$F, {
929
929
  class: "search-button",
930
930
  custom: "",
931
931
  button: "",
@@ -1150,11 +1150,11 @@ function deducePosition(strategy, targetStart, targetEnd, contentSize, clientSiz
1150
1150
  }
1151
1151
  }
1152
1152
 
1153
- const _hoisted_1$h = {
1153
+ const _hoisted_1$i = {
1154
1154
  class: "snail-confirm flex-column"
1155
1155
  };
1156
- const _hoisted_2$d = ["innerHTML"];
1157
- var _sfc_main$x = defineComponent({
1156
+ const _hoisted_2$e = ["innerHTML"];
1157
+ var _sfc_main$y = defineComponent({
1158
1158
  ...{
1159
1159
  name: "ConfirmContainer",
1160
1160
  inheritAttrs: true
@@ -1182,14 +1182,14 @@ var _sfc_main$x = defineComponent({
1182
1182
  },
1183
1183
  setup(__props) {
1184
1184
  return (_ctx, _cache) => {
1185
- return openBlock(), createElementBlock("div", _hoisted_1$h, [createVNode(_sfc_main$B, {
1185
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [createVNode(_sfc_main$C, {
1186
1186
  "use-to": "dialog",
1187
1187
  title: __props.title || "提示",
1188
1188
  onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
1189
1189
  }, null, 8, ["title"]), createElementVNode("div", {
1190
1190
  class: "confirm-body",
1191
1191
  innerHTML: __props.message || "请确认?"
1192
- }, null, 8, _hoisted_2$d), createVNode(_sfc_main$C, {
1192
+ }, null, 8, _hoisted_2$e), createVNode(_sfc_main$D, {
1193
1193
  align: "right",
1194
1194
  "cancel-name": __props.cancelName,
1195
1195
  "cancel-disabled": __props.cancelDisabled,
@@ -1250,7 +1250,7 @@ const MOTION = Object.freeze({
1250
1250
  });
1251
1251
  for (var key in MOTION) hasOwnProperty(MOTION, key) && Object.freeze(MOTION[key]);
1252
1252
 
1253
- var _sfc_main$w = defineComponent({
1253
+ var _sfc_main$x = defineComponent({
1254
1254
  __name: "motion",
1255
1255
  props: {
1256
1256
  multiple: {
@@ -1299,7 +1299,7 @@ var _sfc_main$w = defineComponent({
1299
1299
  }
1300
1300
  });
1301
1301
 
1302
- var _sfc_main$v = defineComponent({
1302
+ var _sfc_main$w = defineComponent({
1303
1303
  ...{
1304
1304
  name: "Loading",
1305
1305
  inheritAttrs: true
@@ -1323,7 +1323,7 @@ var _sfc_main$v = defineComponent({
1323
1323
  },
1324
1324
  setup(__props) {
1325
1325
  return (_ctx, _cache) => {
1326
- return openBlock(), createBlock(_sfc_main$w, {
1326
+ return openBlock(), createBlock(_sfc_main$x, {
1327
1327
  effect: unref(MOTION).fade
1328
1328
  }, {
1329
1329
  default: withCtx(() => [__props.show ? (openBlock(), createElementBlock("div", {
@@ -1338,7 +1338,7 @@ var _sfc_main$v = defineComponent({
1338
1338
  }
1339
1339
  });
1340
1340
 
1341
- var _sfc_main$u = defineComponent({
1341
+ var _sfc_main$v = defineComponent({
1342
1342
  ...{
1343
1343
  name: "Dynamic",
1344
1344
  inheritAttrs: false
@@ -1362,7 +1362,7 @@ var _sfc_main$u = defineComponent({
1362
1362
  const loadingComponent = defineComponent({
1363
1363
  inheritAttrs: false,
1364
1364
  components: {
1365
- Loading: _sfc_main$v
1365
+ Loading: _sfc_main$w
1366
1366
  },
1367
1367
  template: "<Loading :mask-disabled='true' />"
1368
1368
  });
@@ -1487,7 +1487,7 @@ function monitScroll(manager, root, options, emiter, classStyleRef) {
1487
1487
  return scope;
1488
1488
  }
1489
1489
 
1490
- var _sfc_main$t = defineComponent({
1490
+ var _sfc_main$u = defineComponent({
1491
1491
  ...{
1492
1492
  name: "Scroll",
1493
1493
  inheritAttrs: false
@@ -1531,7 +1531,7 @@ var _sfc_main$t = defineComponent({
1531
1531
  }
1532
1532
  });
1533
1533
 
1534
- var _sfc_main$s = defineComponent({
1534
+ var _sfc_main$t = defineComponent({
1535
1535
  __name: "wrapper",
1536
1536
  props: {
1537
1537
  inPopup: {
@@ -1550,7 +1550,7 @@ var _sfc_main$s = defineComponent({
1550
1550
  return (_ctx, _cache) => {
1551
1551
  return openBlock(), createElementBlock("div", {
1552
1552
  class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
1553
- }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$B, mergeProps({
1553
+ }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$C, mergeProps({
1554
1554
  key: 0
1555
1555
  }, __props.header || {
1556
1556
  useTo: "dialog",
@@ -1558,14 +1558,14 @@ var _sfc_main$s = defineComponent({
1558
1558
  }, {
1559
1559
  "use-to": (__props.header ? __props.header.useTo : void 0) || (__props.inPopup ? "dialog" : "page"),
1560
1560
  onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
1561
- }), null, 16, ["use-to"])) : createCommentVNode("", true), createVNode(_sfc_main$t, mergeProps({
1561
+ }), null, 16, ["use-to"])) : createCommentVNode("", true), createVNode(_sfc_main$u, mergeProps({
1562
1562
  class: "wrapper-body flex-1"
1563
1563
  }, __props.content || {
1564
1564
  scroll: "none"
1565
1565
  }), {
1566
1566
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1567
1567
  _: 3
1568
- }, 16), __props.footer && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$C, mergeProps({
1568
+ }, 16), __props.footer && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$D, mergeProps({
1569
1569
  key: 1
1570
1570
  }, __props.footer || {}, {
1571
1571
  onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
@@ -1575,7 +1575,7 @@ var _sfc_main$s = defineComponent({
1575
1575
  }
1576
1576
  });
1577
1577
 
1578
- var _sfc_main$r = defineComponent({
1578
+ var _sfc_main$s = defineComponent({
1579
1579
  ...{
1580
1580
  name: "DialogContainer",
1581
1581
  inheritAttrs: true
@@ -1607,6 +1607,11 @@ var _sfc_main$r = defineComponent({
1607
1607
  onBeforeClose
1608
1608
  });
1609
1609
  let fn_onBuildData = void 0;
1610
+ let mousedownTarget = void 0;
1611
+ function onDialogRootClick(evt) {
1612
+ evt.target === mousedownTarget && __props.options.closeOnMask && closePopup();
1613
+ mousedownTarget = void 0;
1614
+ }
1610
1615
  const registerBuildDataFunc = fn => {
1611
1616
  mustFunction(fn, "fn");
1612
1617
  fn_onBuildData = fn;
@@ -1624,6 +1629,7 @@ var _sfc_main$r = defineComponent({
1624
1629
  onEvent(window, "keyup", event => {
1625
1630
  event.key === "Escape" && __props.popupStatus.value == "active" && __props.options.closeOnEscape && closePopup();
1626
1631
  });
1632
+ onEvent(window, "click", () => mousedownTarget = void 0);
1627
1633
  });
1628
1634
  return (_ctx, _cache) => {
1629
1635
  return openBlock(), createElementBlock("div", {
@@ -1631,10 +1637,9 @@ var _sfc_main$r = defineComponent({
1631
1637
  style: normalizeStyle({
1632
1638
  "z-index": __props.zIndex
1633
1639
  }),
1634
- onClick: _cache[3] || (_cache[3] = withModifiers($event => {
1635
- __props.options.closeOnMask && unref(closePopup)();
1636
- }, ["self"]))
1637
- }, [__props.options.wrapper == void 0 ? (openBlock(), createBlock(_sfc_main$u, mergeProps({
1640
+ onMousedown: _cache[3] || (_cache[3] = withModifiers(evt => isRef(mousedownTarget) ? mousedownTarget.value = evt.target : mousedownTarget = evt.target, ["self"])),
1641
+ onClick: withModifiers(onDialogRootClick, ["self"])
1642
+ }, [__props.options.wrapper == void 0 ? (openBlock(), createBlock(_sfc_main$v, mergeProps({
1638
1643
  key: 0,
1639
1644
  class: "dialog-body",
1640
1645
  name: __props.options.name,
@@ -1645,7 +1650,7 @@ var _sfc_main$r = defineComponent({
1645
1650
  "popup-status": __props.popupStatus.value,
1646
1651
  modelValue: unref(model),
1647
1652
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => isRef(model) ? model.value = $event : null)
1648
- }), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])) : (openBlock(), createBlock(_sfc_main$s, mergeProps({
1653
+ }), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])) : (openBlock(), createBlock(_sfc_main$t, mergeProps({
1649
1654
  key: 1,
1650
1655
  class: "dialog-body dialog-builtin",
1651
1656
  "in-popup": true
@@ -1653,7 +1658,7 @@ var _sfc_main$r = defineComponent({
1653
1658
  onCancel: _cache[2] || (_cache[2] = $event => unref(closePopup)()),
1654
1659
  onConfirm: onWrapperConfirm
1655
1660
  }), {
1656
- default: withCtx(() => [createVNode(_sfc_main$u, mergeProps({
1661
+ default: withCtx(() => [createVNode(_sfc_main$v, mergeProps({
1657
1662
  name: __props.options.name,
1658
1663
  component: __props.options.component,
1659
1664
  url: __props.options.url,
@@ -1665,12 +1670,12 @@ var _sfc_main$r = defineComponent({
1665
1670
  "on-build-data": registerBuildDataFunc
1666
1671
  }), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])]),
1667
1672
  _: 1
1668
- }, 16))], 6);
1673
+ }, 16))], 38);
1669
1674
  };
1670
1675
  }
1671
1676
  });
1672
1677
 
1673
- var _sfc_main$q = defineComponent({
1678
+ var _sfc_main$r = defineComponent({
1674
1679
  ...{
1675
1680
  name: "FollowContainer",
1676
1681
  inheritAttrs: true
@@ -1791,7 +1796,7 @@ var _sfc_main$q = defineComponent({
1791
1796
  });
1792
1797
  });
1793
1798
  return (_ctx, _cache) => {
1794
- return openBlock(), createBlock(_sfc_main$u, mergeProps({
1799
+ return openBlock(), createBlock(_sfc_main$v, mergeProps({
1795
1800
  class: ["snail-follow initial", [__props.popupStatus.value, __props.popupTransition.value]],
1796
1801
  style: {
1797
1802
  "z-index": __props.zIndex
@@ -1808,7 +1813,7 @@ var _sfc_main$q = defineComponent({
1808
1813
  }
1809
1814
  });
1810
1815
 
1811
- var _sfc_main$p = defineComponent({
1816
+ var _sfc_main$q = defineComponent({
1812
1817
  ...{
1813
1818
  name: "PopupContainer",
1814
1819
  inheritAttrs: true
@@ -1828,7 +1833,7 @@ var _sfc_main$p = defineComponent({
1828
1833
  model = shallowRef(void 0)
1829
1834
  } = __props.options;
1830
1835
  return (_ctx, _cache) => {
1831
- return openBlock(), createBlock(_sfc_main$u, mergeProps({
1836
+ return openBlock(), createBlock(_sfc_main$v, mergeProps({
1832
1837
  class: ["snail-popup", [__props.popupStatus.value, __props.popupTransition.value]],
1833
1838
  style: {
1834
1839
  "z-index": __props.zIndex
@@ -1846,12 +1851,12 @@ var _sfc_main$p = defineComponent({
1846
1851
  }
1847
1852
  });
1848
1853
 
1849
- const _hoisted_1$g = {
1854
+ const _hoisted_1$h = {
1850
1855
  key: 1,
1851
1856
  class: "icon"
1852
1857
  };
1853
- const _hoisted_2$c = ["innerHTML"];
1854
- var _sfc_main$o = defineComponent({
1858
+ const _hoisted_2$d = ["innerHTML"];
1859
+ var _sfc_main$p = defineComponent({
1855
1860
  ...{
1856
1861
  name: "ToastContainer",
1857
1862
  inheritAttrs: true
@@ -1888,7 +1893,7 @@ var _sfc_main$o = defineComponent({
1888
1893
  }),
1889
1894
  onMouseenter: _cache[1] || (_cache[1] = $event => onMouseEvent(false)),
1890
1895
  onMouseleave: _cache[2] || (_cache[2] = $event => onMouseEvent(true))
1891
- }, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$E, {
1896
+ }, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
1892
1897
  key: 0,
1893
1898
  class: "close-icon",
1894
1899
  type: "close",
@@ -1899,21 +1904,21 @@ var _sfc_main$o = defineComponent({
1899
1904
  onClick: _cache[0] || (_cache[0] = $event => {
1900
1905
  unref(closePopup)();
1901
1906
  })
1902
- })) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$g, [createVNode(_sfc_main$E, {
1907
+ })) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$h, [createVNode(_sfc_main$F, {
1903
1908
  type: unref(props).type,
1904
1909
  color: "#707070",
1905
1910
  size: 20
1906
1911
  }, null, 8, ["type"])])) : createCommentVNode("", true), createElementVNode("div", {
1907
1912
  class: "message",
1908
1913
  innerHTML: unref(props).message
1909
- }, null, 8, _hoisted_2$c)], 38);
1914
+ }, null, 8, _hoisted_2$d)], 38);
1910
1915
  };
1911
1916
  }
1912
1917
  });
1913
1918
 
1914
1919
  function usePopup() {
1915
1920
  function popup(options) {
1916
- const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$p, options);
1921
+ const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$q, options);
1917
1922
  return addScope2Scopes(scope);
1918
1923
  }
1919
1924
  function dialog(options) {
@@ -1946,7 +1951,7 @@ function usePopup() {
1946
1951
  },
1947
1952
  onBeforeClose: fn => hook.register("onBeforeClose", fn)
1948
1953
  });
1949
- const descriptor = openPopup(_sfc_main$r, options, extOptions);
1954
+ const descriptor = openPopup(_sfc_main$s, options, extOptions);
1950
1955
  scope = useAsyncScope(deferred.promise);
1951
1956
  monitorDialog(descriptor, scope, deferred);
1952
1957
  }
@@ -1964,14 +1969,14 @@ function usePopup() {
1964
1969
  inPopup: "follow",
1965
1970
  target
1966
1971
  };
1967
- scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$q, options, extOptions);
1972
+ scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$r, options, extOptions);
1968
1973
  }
1969
1974
  return addScope2Scopes(scope);
1970
1975
  }
1971
1976
  function confirm(title, message, options) {
1972
1977
  options = options || Object.create(null);
1973
1978
  return dialog({
1974
- component: _sfc_main$x,
1979
+ component: _sfc_main$y,
1975
1980
  closeOnEscape: true,
1976
1981
  props: {
1977
1982
  ...options,
@@ -1981,7 +1986,7 @@ function usePopup() {
1981
1986
  });
1982
1987
  }
1983
1988
  function toast(type, message, options) {
1984
- return popupInCustomContainer(_sfc_main$o, {
1989
+ return popupInCustomContainer(_sfc_main$p, {
1985
1990
  url: "#ToastContainer",
1986
1991
  props: {
1987
1992
  ...(options || Object.create(null)),
@@ -2014,7 +2019,7 @@ function usePopup() {
2014
2019
  },
2015
2020
  ...extOptions
2016
2021
  });
2017
- const descriptor = openPopup(container || _sfc_main$p, options, extOptions);
2022
+ const descriptor = openPopup(container || _sfc_main$q, options, extOptions);
2018
2023
  const scope = useAsyncScope(deferred.promise);
2019
2024
  scope.onDestroy(() => destroyPopup(descriptor, deferred));
2020
2025
  return scope;
@@ -2149,12 +2154,12 @@ function getNoDataBase64Image() {
2149
2154
  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==";
2150
2155
  }
2151
2156
 
2152
- const _hoisted_1$f = {
2157
+ const _hoisted_1$g = {
2153
2158
  class: "snail-empty"
2154
2159
  };
2155
- const _hoisted_2$b = ["src"];
2156
- const _hoisted_3$6 = ["textContent"];
2157
- var _sfc_main$n = defineComponent({
2160
+ const _hoisted_2$c = ["src"];
2161
+ const _hoisted_3$7 = ["textContent"];
2162
+ var _sfc_main$o = defineComponent({
2158
2163
  ...{
2159
2164
  name: "Empty",
2160
2165
  inheritAttrs: true
@@ -2167,23 +2172,23 @@ var _sfc_main$n = defineComponent({
2167
2172
  setup(__props) {
2168
2173
  const defaultImageBase64 = getNoDataBase64Image();
2169
2174
  return (_ctx, _cache) => {
2170
- return openBlock(), createElementBlock("div", _hoisted_1$f, [createElementVNode("img", {
2175
+ return openBlock(), createElementBlock("div", _hoisted_1$g, [createElementVNode("img", {
2171
2176
  src: __props.imageUrl || unref(defaultImageBase64)
2172
- }, null, 8, _hoisted_2$b), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
2177
+ }, null, 8, _hoisted_2$c), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
2173
2178
  class: "message",
2174
2179
  textContent: toDisplayString(__props.message || "无数据")
2175
- }, null, 8, _hoisted_3$6)])]);
2180
+ }, null, 8, _hoisted_3$7)])]);
2176
2181
  };
2177
2182
  }
2178
2183
  });
2179
2184
 
2180
- const _hoisted_1$e = ["title"];
2181
- const _hoisted_2$a = ["textContent"];
2182
- const _hoisted_3$5 = {
2185
+ const _hoisted_1$f = ["title"];
2186
+ const _hoisted_2$b = ["textContent"];
2187
+ const _hoisted_3$6 = {
2183
2188
  key: 1,
2184
2189
  class: "select-status"
2185
2190
  };
2186
- var _sfc_main$m = defineComponent({
2191
+ var _sfc_main$n = defineComponent({
2187
2192
  ...{
2188
2193
  name: "SelectNode",
2189
2194
  inheritAttrs: true
@@ -2228,15 +2233,15 @@ var _sfc_main$m = defineComponent({
2228
2233
  }, [createElementVNode("div", {
2229
2234
  class: "item-text ellipsis",
2230
2235
  textContent: toDisplayString(__props.item.text)
2231
- }, null, 8, _hoisted_2$a), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$E, {
2236
+ }, null, 8, _hoisted_2$b), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$F, {
2232
2237
  key: 0,
2233
2238
  type: "arrow"
2234
- })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$5, [createVNode(_sfc_main$E, {
2239
+ })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$6, [createVNode(_sfc_main$F, {
2235
2240
  type: "success",
2236
2241
  button: "",
2237
2242
  size: 12,
2238
2243
  color: "white"
2239
- })])) : createCommentVNode("", true)], 42, _hoisted_1$e)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2244
+ })])) : createCommentVNode("", true)], 42, _hoisted_1$f)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2240
2245
  key: 1
2241
2246
  }, renderList(unref(showChildrenRef), child => {
2242
2247
  return openBlock(), createBlock(_component_SelectNode, {
@@ -2253,7 +2258,7 @@ var _sfc_main$m = defineComponent({
2253
2258
  }
2254
2259
  });
2255
2260
 
2256
- var _sfc_main$l = defineComponent({
2261
+ var _sfc_main$m = defineComponent({
2257
2262
  ...{
2258
2263
  name: "Select2Popup",
2259
2264
  inheritAttrs: true
@@ -2425,13 +2430,13 @@ var _sfc_main$l = defineComponent({
2425
2430
  key: 0
2426
2431
  }, [createTextVNode(" 暂无选项 ")], 64)) : (openBlock(), createElementBlock(Fragment, {
2427
2432
  key: 1
2428
- }, [__props.search ? (openBlock(), createBlock(_sfc_main$y, mergeProps({
2433
+ }, [__props.search ? (openBlock(), createBlock(_sfc_main$z, mergeProps({
2429
2434
  key: 0
2430
2435
  }, __props.search, {
2431
2436
  onSearch,
2432
2437
  key: "select-search"
2433
2438
  }), null, 16)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
2434
- return openBlock(), createBlock(_sfc_main$m, {
2439
+ return openBlock(), createBlock(_sfc_main$n, {
2435
2440
  key: unref(context).getKey(item),
2436
2441
  multiple: __props.multiple,
2437
2442
  item,
@@ -2440,7 +2445,7 @@ var _sfc_main$l = defineComponent({
2440
2445
  onEnter: onEnterSelectNode,
2441
2446
  onClick: onClickSelectNode
2442
2447
  }, null, 8, ["multiple", "item", "context"]);
2443
- }), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$n, {
2448
+ }), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$o, {
2444
2449
  key: 1,
2445
2450
  message: "无结果"
2446
2451
  })) : createCommentVNode("", true), showClearButtonRef.value ? (openBlock(), createElementBlock("div", {
@@ -2452,20 +2457,20 @@ var _sfc_main$l = defineComponent({
2452
2457
  }
2453
2458
  });
2454
2459
 
2455
- const _hoisted_1$d = {
2460
+ const _hoisted_1$e = {
2456
2461
  key: 0,
2457
2462
  class: "select-result"
2458
2463
  };
2459
- const _hoisted_2$9 = ["title", "textContent"];
2460
- const _hoisted_3$4 = ["textContent"];
2461
- const _hoisted_4$3 = {
2464
+ const _hoisted_2$a = ["title", "textContent"];
2465
+ const _hoisted_3$5 = ["textContent"];
2466
+ const _hoisted_4$4 = {
2462
2467
  key: 1,
2463
2468
  class: "placeholder"
2464
2469
  };
2465
2470
  onAppCreated((app, type) => {
2466
- type == "popup" && app.component("SelectPopup", _sfc_main$l);
2471
+ type == "popup" && app.component("SelectPopup", _sfc_main$m);
2467
2472
  });
2468
- var _sfc_main$k = defineComponent({
2473
+ var _sfc_main$l = defineComponent({
2469
2474
  ...{
2470
2475
  name: "Select",
2471
2476
  inheritAttrs: true
@@ -2597,26 +2602,26 @@ var _sfc_main$k = defineComponent({
2597
2602
  ref: "select"
2598
2603
  }, [__props.items && __props.items.length ? (openBlock(), createElementBlock(Fragment, {
2599
2604
  key: 0
2600
- }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$d, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2605
+ }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$e, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2601
2606
  class: "select-text ellipsis",
2602
2607
  title: selectedTextRef.value,
2603
2608
  textContent: toDisplayString(selectedTextRef.value)
2604
- }, null, 8, _hoisted_2$9)])])) : (openBlock(), createElementBlock("div", {
2609
+ }, null, 8, _hoisted_2$a)])])) : (openBlock(), createElementBlock("div", {
2605
2610
  key: 1,
2606
2611
  class: "placeholder",
2607
2612
  textContent: toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
2608
- }, null, 8, _hoisted_3$4)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$E, {
2613
+ }, null, 8, _hoisted_3$5)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$F, {
2609
2614
  key: 2,
2610
2615
  type: "arrow",
2611
2616
  button: "",
2612
2617
  size: 24,
2613
2618
  rotate: 90
2614
- })) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", _hoisted_4$3, "暂无可选项"))], 2);
2619
+ })) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", _hoisted_4$4, "暂无可选项"))], 2);
2615
2620
  };
2616
2621
  }
2617
2622
  });
2618
2623
 
2619
- var _sfc_main$j = defineComponent({
2624
+ var _sfc_main$k = defineComponent({
2620
2625
  ...{
2621
2626
  name: "Switch",
2622
2627
  inheritAttrs: true
@@ -2655,7 +2660,7 @@ var _sfc_main$j = defineComponent({
2655
2660
  return openBlock(), createElementBlock("div", {
2656
2661
  class: normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", __props.readonly ? "readonly" : ""], __props.type || "switch"]),
2657
2662
  onClick: onSwitchChange
2658
- }, [__props.type == "checkbox" || __props.type == "radio" ? withDirectives((openBlock(), createBlock(_sfc_main$E, {
2663
+ }, [__props.type == "checkbox" || __props.type == "radio" ? withDirectives((openBlock(), createBlock(_sfc_main$F, {
2659
2664
  key: 0,
2660
2665
  type: "success",
2661
2666
  color: "white",
@@ -2673,8 +2678,8 @@ var _sfc_main$j = defineComponent({
2673
2678
  }
2674
2679
  });
2675
2680
 
2676
- const _hoisted_1$c = ["readonly", "placeholder", "rows"];
2677
- var _sfc_main$i = defineComponent({
2681
+ const _hoisted_1$d = ["readonly", "placeholder", "rows"];
2682
+ var _sfc_main$j = defineComponent({
2678
2683
  ...{
2679
2684
  name: "Textarea",
2680
2685
  inheritAttrs: true
@@ -2734,178 +2739,12 @@ var _sfc_main$i = defineComponent({
2734
2739
  onInput: _cache[2] || (_cache[2] = $event => emits("input", textareaDom.value.value)),
2735
2740
  onBlur: _cache[3] || (_cache[3] = $event => emits("blur", textareaDom.value.value)),
2736
2741
  onChange: _cache[4] || (_cache[4] = $event => emits("change", textareaDom.value.value))
2737
- }, null, 40, _hoisted_1$c)), [[vModelText, valueModel.value]]);
2738
- };
2739
- }
2740
- });
2741
-
2742
- const _hoisted_1$b = ["onClick"];
2743
- const _hoisted_2$8 = ["textContent"];
2744
- var _sfc_main$h = defineComponent({
2745
- __name: "action-items",
2746
- props: {
2747
- mode: {},
2748
- actions: {},
2749
- inPopup: {},
2750
- closePopup: {
2751
- type: Function
2752
- },
2753
- popupStatus: {},
2754
- target: {},
2755
- followX: {},
2756
- followY: {},
2757
- pinned: {}
2758
- },
2759
- emits: ["trigger"],
2760
- setup(__props, _ref) {
2761
- let {
2762
- emit: __emit
2763
- } = _ref;
2764
- const props = __props;
2765
- const emits = __emit;
2766
- function onActionItemClick(code) {
2767
- emits("trigger", code);
2768
- props.inPopup && props.closePopup(code);
2769
- }
2770
- return (_ctx, _cache) => {
2771
- return openBlock(), createElementBlock("div", {
2772
- class: normalizeClass(["snail-action-items", [unref(correctString)(__props.mode, "vertical", true), unref(isStringNotEmpty)(__props.inPopup) ? "in-popup" : ""]])
2773
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, action => {
2774
- return openBlock(), createElementBlock("div", {
2775
- class: "action-item flex-cross-center",
2776
- key: action.code,
2777
- style: normalizeStyle({
2778
- "--color": unref(correctString)(action.color, null, true),
2779
- "--hcolor": unref(correctString)(action.hoverColor, null, true)
2780
- }),
2781
- onClick: $event => onActionItemClick(action.code)
2782
- }, [action.icon != void 0 ? (openBlock(), createBlock(_sfc_main$E, mergeProps({
2783
- key: 0,
2784
- ref_for: true
2785
- }, action.icon, {
2786
- custom: false,
2787
- size: 20
2788
- }), null, 16)) : createCommentVNode("", true), createElementVNode("span", {
2789
- class: "ellipsis",
2790
- textContent: toDisplayString(action.name)
2791
- }, null, 8, _hoisted_2$8)], 12, _hoisted_1$b);
2792
- }), 128))], 2);
2793
- };
2794
- }
2795
- });
2796
-
2797
- const _hoisted_1$a = {
2798
- class: "snail-action flex-cross-center",
2799
- ref: "snail-action"
2800
- };
2801
- const _hoisted_2$7 = {
2802
- class: "action-slot flex-cross-center"
2803
- };
2804
- var _sfc_main$g = defineComponent({
2805
- __name: "action",
2806
- props: {
2807
- disabled: {
2808
- type: Boolean
2809
- },
2810
- trigger: {},
2811
- actions: {},
2812
- followX: {},
2813
- followY: {},
2814
- spaceX: {},
2815
- spaceY: {}
2816
- },
2817
- emits: ["trigger"],
2818
- setup(__props, _ref) {
2819
- let {
2820
- emit: __emit
2821
- } = _ref;
2822
- const props = __props;
2823
- const emits = __emit;
2824
- const {
2825
- follow
2826
- } = usePopup();
2827
- const {
2828
- onEvent
2829
- } = useObserver();
2830
- const rootDom = useTemplateRef("snail-action");
2831
- const popupScopeRef = shallowRef(void 0);
2832
- let pressStartDate = void 0;
2833
- const slotHandle = Object.freeze({
2834
- isActived: () => popupScopeRef.value != void 0,
2835
- trigger: () => onFollowShow(props.trigger == "long-press")
2836
- });
2837
- async function onFollowShow(longPress) {
2838
- if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
2839
- popupScopeRef.value.destroy();
2840
- } else if (props.disabled != true) {
2841
- popupScopeRef.value = follow(rootDom.value, {
2842
- component: _sfc_main$h,
2843
- closeOnEscape: true,
2844
- closeOnMask: true,
2845
- closeOnResize: true,
2846
- closeOnTarget: true,
2847
- followX: props.followX || ["center", "start", "end", "after", "before", "ratio"],
2848
- followY: props.followY || ["after", "before", "center", "end", "start", "ratio"],
2849
- spaceX: props.spaceX,
2850
- spaceY: props.spaceY,
2851
- props: {
2852
- mode: "vertical",
2853
- actions: props.actions
2854
- }
2855
- });
2856
- const code = await popupScopeRef.value;
2857
- isStringNotEmpty(code) && emits("trigger", code);
2858
- }
2859
- popupScopeRef.value = void 0;
2860
- }
2861
- function onMouseDown() {
2862
- if (props.trigger == "long-press" && pressStartDate == void 0) {
2863
- pressStartDate = new Date();
2864
- }
2865
- }
2866
- function onMouseUp() {
2867
- if (pressStartDate != void 0) {
2868
- const time = ((new Date()).getTime() - pressStartDate.getTime()) / 1e3;
2869
- pressStartDate = void 0;
2870
- if (time >= 0.5) {
2871
- navigator.vibrate && navigator.vibrate(200);
2872
- onFollowShow();
2873
- }
2874
- }
2875
- }
2876
- function onMouseCancel() {
2877
- setTimeout(() => pressStartDate = void 0, 10);
2878
- }
2879
- onMounted(() => {
2880
- onEvent(rootDom.value, "mousedown", onMouseDown);
2881
- onEvent(rootDom.value, "mouseup", onMouseUp);
2882
- if ("ontouchstart" in window) {
2883
- onEvent(rootDom.value, "touchstart", onMouseDown);
2884
- onEvent(rootDom.value, "touchend", onMouseUp);
2885
- }
2886
- onEvent(window, "mouseup", onMouseCancel);
2887
- if ("ontouchstart" in window) {
2888
- onEvent(window, "touchend", onMouseCancel);
2889
- onEvent(window, "touchcancel", onMouseCancel);
2890
- }
2891
- });
2892
- return (_ctx, _cache) => {
2893
- return openBlock(), createElementBlock("div", _hoisted_1$a, [createElementVNode("div", _hoisted_2$7, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotHandle))))]), __props.disabled != true && (__props.trigger == "hover" || __props.trigger == "always") ? (openBlock(), createElementBlock("div", {
2894
- key: 0,
2895
- class: normalizeClass(["trigger-area", {
2896
- hidden: __props.trigger == "hover"
2897
- }])
2898
- }, [renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createVNode(_sfc_main$E, {
2899
- button: "",
2900
- type: "more",
2901
- size: 16,
2902
- onClick: _cache[0] || (_cache[0] = $event => onFollowShow())
2903
- })])], 2)) : createCommentVNode("", true)], 512);
2742
+ }, null, 40, _hoisted_1$d)), [[vModelText, valueModel.value]]);
2904
2743
  };
2905
2744
  }
2906
2745
  });
2907
2746
 
2908
- var _sfc_main$f = defineComponent({
2747
+ var _sfc_main$i = defineComponent({
2909
2748
  ...{
2910
2749
  name: "Elastic",
2911
2750
  inheritAttrs: false
@@ -3111,7 +2950,7 @@ var _sfc_main$f = defineComponent({
3111
2950
  }
3112
2951
  });
3113
2952
 
3114
- var _sfc_main$e = defineComponent({
2953
+ var _sfc_main$h = defineComponent({
3115
2954
  ...{
3116
2955
  name: "Flex",
3117
2956
  inheritAttrs: false
@@ -3206,13 +3045,13 @@ var _sfc_main$e = defineComponent({
3206
3045
  }
3207
3046
  });
3208
3047
 
3209
- const _hoisted_1$9 = ["textContent"];
3210
- const _hoisted_2$6 = ["textContent"];
3211
- const _hoisted_3$3 = {
3048
+ const _hoisted_1$c = ["textContent"];
3049
+ const _hoisted_2$9 = ["textContent"];
3050
+ const _hoisted_3$4 = {
3212
3051
  key: 1,
3213
3052
  class: "status"
3214
3053
  };
3215
- var _sfc_main$d = defineComponent({
3054
+ var _sfc_main$g = defineComponent({
3216
3055
  ...{
3217
3056
  name: "Fold",
3218
3057
  inheritAttrs: true
@@ -3304,11 +3143,11 @@ var _sfc_main$d = defineComponent({
3304
3143
  }, [renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(slotHandle)), () => [createElementVNode("div", {
3305
3144
  class: "title ellipsis",
3306
3145
  textContent: toDisplayString(__props.title)
3307
- }, null, 8, _hoisted_1$9), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
3146
+ }, null, 8, _hoisted_1$c), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
3308
3147
  key: 0,
3309
3148
  class: "subtitle ellipsis",
3310
3149
  textContent: toDisplayString(__props.subtitle)
3311
- }, null, 8, _hoisted_2$6)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_3$3, [createVNode(_sfc_main$E, {
3150
+ }, null, 8, _hoisted_2$9)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_3$4, [createVNode(_sfc_main$F, {
3312
3151
  type: "arrow",
3313
3152
  button: "",
3314
3153
  title: statusModel.value == "expand" ? "收起" : "展开",
@@ -3322,7 +3161,7 @@ var _sfc_main$d = defineComponent({
3322
3161
  }
3323
3162
  });
3324
3163
 
3325
- var _sfc_main$c = defineComponent({
3164
+ var _sfc_main$f = defineComponent({
3326
3165
  __name: "layout",
3327
3166
  props: {
3328
3167
  direction: {},
@@ -3399,7 +3238,7 @@ var _sfc_main$c = defineComponent({
3399
3238
  key: item
3400
3239
  }, [areaMap.value[item] && _ctx.$slots[item] ? (openBlock(), createElementBlock(Fragment, {
3401
3240
  key: 0
3402
- }, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
3241
+ }, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$u, mergeProps({
3403
3242
  key: 0,
3404
3243
  class: areaMap.value[item].class,
3405
3244
  style: areaMap.value[item].style
@@ -3418,7 +3257,7 @@ var _sfc_main$c = defineComponent({
3418
3257
  }
3419
3258
  });
3420
3259
 
3421
- var _sfc_main$b = defineComponent({
3260
+ var _sfc_main$e = defineComponent({
3422
3261
  ...{
3423
3262
  name: "Sort",
3424
3263
  inheritAttrs: true
@@ -3519,10 +3358,10 @@ var _sfc_main$b = defineComponent({
3519
3358
  }
3520
3359
  });
3521
3360
 
3522
- const _hoisted_1$8 = {
3361
+ const _hoisted_1$b = {
3523
3362
  class: "table-body"
3524
3363
  };
3525
- var _sfc_main$a = defineComponent({
3364
+ var _sfc_main$d = defineComponent({
3526
3365
  ...{
3527
3366
  name: "Table",
3528
3367
  inheritAttrs: true
@@ -3542,7 +3381,7 @@ var _sfc_main$a = defineComponent({
3542
3381
  const hStyleRef = computed(() => css.buildStyle(props.headerStyle));
3543
3382
  const fStyleRef = computed(() => css.buildStyle(props.footerStyle));
3544
3383
  return (_ctx, _cache) => {
3545
- return openBlock(), createBlock(_sfc_main$t, {
3384
+ return openBlock(), createBlock(_sfc_main$u, {
3546
3385
  class: normalizeClass(["snail-table", {
3547
3386
  "start-border": __props.border == true
3548
3387
  }]),
@@ -3552,7 +3391,7 @@ var _sfc_main$a = defineComponent({
3552
3391
  default: withCtx(() => [createElementVNode("div", {
3553
3392
  class: "table-header",
3554
3393
  style: normalizeStyle(hStyleRef.value)
3555
- }, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$8, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
3394
+ }, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$b, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
3556
3395
  class: "table-footer",
3557
3396
  style: normalizeStyle(fStyleRef.value)
3558
3397
  }, [renderSlot(_ctx.$slots, "footer")], 4)]),
@@ -3562,7 +3401,7 @@ var _sfc_main$a = defineComponent({
3562
3401
  }
3563
3402
  });
3564
3403
 
3565
- var _sfc_main$9 = defineComponent({
3404
+ var _sfc_main$c = defineComponent({
3566
3405
  ...{
3567
3406
  name: "TableRow",
3568
3407
  inheritAttrs: true
@@ -3585,7 +3424,7 @@ var _sfc_main$9 = defineComponent({
3585
3424
  }
3586
3425
  });
3587
3426
 
3588
- var _sfc_main$8 = defineComponent({
3427
+ var _sfc_main$b = defineComponent({
3589
3428
  ...{
3590
3429
  name: "TableCol",
3591
3430
  inheritAttrs: true
@@ -3631,19 +3470,19 @@ var _sfc_main$8 = defineComponent({
3631
3470
  }
3632
3471
  });
3633
3472
 
3634
- const _hoisted_1$7 = {
3473
+ const _hoisted_1$a = {
3635
3474
  key: 0,
3636
3475
  class: "node-fold"
3637
3476
  };
3638
- const _hoisted_2$5 = ["title", "textContent"];
3639
- const _hoisted_3$2 = {
3477
+ const _hoisted_2$8 = ["title", "textContent"];
3478
+ const _hoisted_3$3 = {
3640
3479
  class: "node-slot ellipsis"
3641
3480
  };
3642
- const _hoisted_4$2 = {
3481
+ const _hoisted_4$3 = {
3643
3482
  class: "snail-tree-children",
3644
3483
  ref: "children"
3645
3484
  };
3646
- var _sfc_main$7 = defineComponent({
3485
+ var _sfc_main$a = defineComponent({
3647
3486
  ...{
3648
3487
  name: "TreeNode",
3649
3488
  inheritAttrs: true
@@ -3751,7 +3590,7 @@ var _sfc_main$7 = defineComponent({
3751
3590
  key: 1
3752
3591
  }, [_cache[5] || (_cache[5] = createElementVNode("div", {
3753
3592
  class: "indent"
3754
- }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$7, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$E, {
3593
+ }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$a, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$F, {
3755
3594
  key: 0,
3756
3595
  class: normalizeClass(statusRef.value),
3757
3596
  custom: "",
@@ -3766,7 +3605,7 @@ var _sfc_main$7 = defineComponent({
3766
3605
  class: "node-text ellipsis",
3767
3606
  title: __props.node.text,
3768
3607
  textContent: toDisplayString(__props.node.text)
3769
- }, null, 8, _hoisted_2$5), createElementVNode("div", _hoisted_3$2, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34), [[vShow, showRef.value]]), withDirectives(createElementVNode("div", _hoisted_4$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.node.children, child => {
3608
+ }, null, 8, _hoisted_2$8), createElementVNode("div", _hoisted_3$3, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34), [[vShow, showRef.value]]), withDirectives(createElementVNode("div", _hoisted_4$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.node.children, child => {
3770
3609
  return openBlock(), createBlock(_component_TreeNode, {
3771
3610
  key: __props.context.getKey(child),
3772
3611
  node: child,
@@ -3786,10 +3625,10 @@ var _sfc_main$7 = defineComponent({
3786
3625
  }
3787
3626
  });
3788
3627
 
3789
- const _hoisted_1$6 = {
3628
+ const _hoisted_1$9 = {
3790
3629
  class: "snail-tree"
3791
3630
  };
3792
- var _sfc_main$6 = defineComponent({
3631
+ var _sfc_main$9 = defineComponent({
3793
3632
  ...{
3794
3633
  name: "Tree",
3795
3634
  inheritAttrs: true
@@ -3823,15 +3662,15 @@ var _sfc_main$6 = defineComponent({
3823
3662
  emits("click", node, parents);
3824
3663
  }
3825
3664
  return (_ctx, _cache) => {
3826
- return openBlock(), createElementBlock("div", _hoisted_1$6, [__props.search ? (openBlock(), createBlock(_sfc_main$y, mergeProps({
3665
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [__props.search ? (openBlock(), createBlock(_sfc_main$z, mergeProps({
3827
3666
  key: 0
3828
3667
  }, __props.search, {
3829
3668
  onSearch
3830
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$t, {
3669
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$u, {
3831
3670
  scroll: "y"
3832
3671
  }, {
3833
3672
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
3834
- return openBlock(), createBlock(_sfc_main$7, {
3673
+ return openBlock(), createBlock(_sfc_main$a, {
3835
3674
  key: unref(context).getKey(node),
3836
3675
  node,
3837
3676
  parent: void 0,
@@ -3856,7 +3695,7 @@ function mount(target, options, onDestroyed) {
3856
3695
  mustObject(options, "options");
3857
3696
  target instanceof HTMLElement || throwError("target must be a HTMLElement");
3858
3697
  target.classList.add("snail-app");
3859
- const app = createApp(_sfc_main$u, options);
3698
+ const app = createApp(_sfc_main$v, options);
3860
3699
  triggerAppCreated(app);
3861
3700
  app.mount(target);
3862
3701
  const scope = useScope().onDestroy(() => app.unmount());
@@ -3864,49 +3703,57 @@ function mount(target, options, onDestroyed) {
3864
3703
  return scope;
3865
3704
  }
3866
3705
 
3867
- const _hoisted_1$5 = {
3868
- class: "snail-flash-number"
3869
- };
3870
- const _hoisted_2$4 = ["textContent"];
3871
- var _sfc_main$5 = defineComponent({
3872
- __name: "flash-number",
3706
+ const _hoisted_1$8 = ["onClick"];
3707
+ const _hoisted_2$7 = ["textContent"];
3708
+ var _sfc_main$8 = defineComponent({
3709
+ __name: "action-items",
3873
3710
  props: {
3874
- value: {}
3711
+ mode: {},
3712
+ actions: {},
3713
+ inPopup: {},
3714
+ closePopup: {
3715
+ type: Function
3716
+ },
3717
+ popupStatus: {},
3718
+ target: {},
3719
+ followX: {},
3720
+ followY: {},
3721
+ pinned: {}
3875
3722
  },
3876
- setup(__props) {
3723
+ emits: ["trigger"],
3724
+ setup(__props, _ref) {
3725
+ let {
3726
+ emit: __emit
3727
+ } = _ref;
3877
3728
  const props = __props;
3878
- const itemsRef = ref();
3879
- function buildNumberItems() {
3880
- itemsRef.value = [];
3881
- const value = isNullish(props.value) ? null : String(props.value);
3882
- if (isStringNotEmpty(value) == true) {
3883
- for (const item of value) {
3884
- const number = parseInt(item);
3885
- const isNumber = 0 <= number && number <= 9;
3886
- itemsRef.value.push({
3887
- id: newId(),
3888
- text: item,
3889
- number: isNumber ? number : void 0
3890
- });
3891
- }
3892
- }
3893
- if (isArrayNotEmpty(itemsRef.value) == true) ;
3729
+ const emits = __emit;
3730
+ function onActionItemClick(code) {
3731
+ emits("trigger", code);
3732
+ props.inPopup && props.closePopup(code);
3894
3733
  }
3895
- onMounted(() => {
3896
- buildNumberItems();
3897
- });
3898
3734
  return (_ctx, _cache) => {
3899
- return openBlock(), createElementBlock("div", _hoisted_1$5, [(openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
3900
- return openBlock(), createElementBlock("span", {
3901
- key: item.id,
3902
- textContent: toDisplayString(item.text),
3903
- class: normalizeClass(unref(isNullish)(item.number) ? "" : "number-item")
3904
- }, null, 10, _hoisted_2$4);
3905
- }), 128)), _cache[0] || (_cache[0] = createElementVNode("span", {
3906
- style: {
3907
- "color": "red"
3908
- }
3909
- }, "-----还没实现,别用", -1))]);
3735
+ return openBlock(), createElementBlock("div", {
3736
+ class: normalizeClass(["snail-action-items", [unref(correctString)(__props.mode, "vertical", true), unref(isStringNotEmpty)(__props.inPopup) ? "in-popup" : ""]])
3737
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, action => {
3738
+ return openBlock(), createElementBlock("div", {
3739
+ class: "action-item flex-cross-center",
3740
+ key: action.code,
3741
+ style: normalizeStyle({
3742
+ "--color": unref(correctString)(action.color, null, true),
3743
+ "--hcolor": unref(correctString)(action.hoverColor, null, true)
3744
+ }),
3745
+ onClick: $event => onActionItemClick(action.code)
3746
+ }, [action.icon != void 0 ? (openBlock(), createBlock(_sfc_main$F, mergeProps({
3747
+ key: 0,
3748
+ ref_for: true
3749
+ }, action.icon, {
3750
+ custom: false,
3751
+ size: 20
3752
+ }), null, 16)) : createCommentVNode("", true), createElementVNode("span", {
3753
+ class: "ellipsis",
3754
+ textContent: toDisplayString(action.name)
3755
+ }, null, 8, _hoisted_2$7)], 12, _hoisted_1$8);
3756
+ }), 128))], 2);
3910
3757
  };
3911
3758
  }
3912
3759
  });
@@ -4027,23 +3874,23 @@ function buildSecondItems(minuteItem, min, max) {
4027
3874
  return items;
4028
3875
  }
4029
3876
 
4030
- const _hoisted_1$4 = {
3877
+ const _hoisted_1$7 = {
4031
3878
  class: "tz-item",
4032
3879
  ref: "hour-items"
4033
3880
  };
4034
- const _hoisted_2$3 = ["textContent", "onClick", "onDblclick"];
4035
- const _hoisted_3$1 = {
3881
+ const _hoisted_2$6 = ["textContent", "onClick", "onDblclick"];
3882
+ const _hoisted_3$2 = {
4036
3883
  class: "tz-item",
4037
3884
  ref: "minute-items"
4038
3885
  };
4039
- const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
4040
- const _hoisted_5$1 = {
3886
+ const _hoisted_4$2 = ["textContent", "onClick", "onDblclick"];
3887
+ const _hoisted_5$2 = {
4041
3888
  key: 0,
4042
3889
  class: "tz-item",
4043
3890
  ref: "second-items"
4044
3891
  };
4045
- const _hoisted_6$1 = ["textContent", "onClick", "onDblclick"];
4046
- var _sfc_main$4 = defineComponent({
3892
+ const _hoisted_6$2 = ["textContent", "onClick", "onDblclick"];
3893
+ var _sfc_main$7 = defineComponent({
4047
3894
  __name: "time-pc",
4048
3895
  props: {
4049
3896
  value: {},
@@ -4145,17 +3992,17 @@ var _sfc_main$4 = defineComponent({
4145
3992
  }
4146
3993
  onMounted(rebuildItems);
4147
3994
  return (_ctx, _cache) => {
4148
- return openBlock(), createBlock(_sfc_main$c, {
3995
+ return openBlock(), createBlock(_sfc_main$f, {
4149
3996
  class: normalizeClass(["time-picker pc", {
4150
3997
  "second-disabled": unref(format) != "HH:mm:ss"
4151
3998
  }]),
4152
3999
  direction: "vertical"
4153
4000
  }, createSlots({
4154
- main: withCtx(() => [createVNode(_sfc_main$w, {
4001
+ main: withCtx(() => [createVNode(_sfc_main$x, {
4155
4002
  multiple: "",
4156
4003
  effect: unref(MOTION).top
4157
4004
  }, {
4158
- default: withCtx(() => [createElementVNode("div", _hoisted_1$4, [(openBlock(true), createElementBlock(Fragment, null, renderList(hourItems.value, item => {
4005
+ default: withCtx(() => [createElementVNode("div", _hoisted_1$7, [(openBlock(true), createElementBlock(Fragment, null, renderList(hourItems.value, item => {
4159
4006
  return openBlock(), createElementBlock("div", {
4160
4007
  class: normalizeClass(["tzi-number", {
4161
4008
  active: item.hour == timeRef.value.hour,
@@ -4165,8 +4012,8 @@ var _sfc_main$4 = defineComponent({
4165
4012
  textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
4166
4013
  onClick: $event => onHourClick(item),
4167
4014
  onDblclick: $event => onHourClick(item)
4168
- }, null, 42, _hoisted_2$3);
4169
- }), 128))], 512), createElementVNode("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
4015
+ }, null, 42, _hoisted_2$6);
4016
+ }), 128))], 512), createElementVNode("div", _hoisted_3$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
4170
4017
  return openBlock(), createElementBlock("div", {
4171
4018
  class: normalizeClass(["tzi-number", {
4172
4019
  active: item.minute == timeRef.value.minute,
@@ -4176,8 +4023,8 @@ var _sfc_main$4 = defineComponent({
4176
4023
  textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
4177
4024
  onClick: $event => onMinuteClick(item),
4178
4025
  onDblclick: $event => onMinuteClick(item, true)
4179
- }, null, 42, _hoisted_4$1);
4180
- }), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
4026
+ }, null, 42, _hoisted_4$2);
4027
+ }), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
4181
4028
  return openBlock(), createElementBlock("div", {
4182
4029
  class: normalizeClass(["tzi-number", {
4183
4030
  active: item.second == timeRef.value.second,
@@ -4187,26 +4034,26 @@ var _sfc_main$4 = defineComponent({
4187
4034
  textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
4188
4035
  onClick: $event => onSecondClick(item),
4189
4036
  onDblclick: $event => onSecondClick(item, true)
4190
- }, null, 42, _hoisted_6$1);
4037
+ }, null, 42, _hoisted_6$2);
4191
4038
  }), 128))], 512)) : createCommentVNode("", true)]),
4192
4039
  _: 1
4193
4040
  }, 8, ["effect"])]),
4194
4041
  _: 2
4195
4042
  }, [__props.toolbarDisabled != true ? {
4196
4043
  name: "bottom",
4197
- fn: withCtx(() => [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
4044
+ fn: withCtx(() => [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
4198
4045
  key: 0,
4199
4046
  type: "link",
4200
4047
  size: "small",
4201
4048
  textContent: "清空",
4202
4049
  onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), __props.inPopup && __props.closePopup("")))
4203
- })) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
4050
+ })) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
4204
4051
  key: 1,
4205
4052
  type: "link",
4206
4053
  size: "small",
4207
4054
  textContent: "现在",
4208
4055
  onClick: _cache[1] || (_cache[1] = $event => rebuildItems(unref(getTimeValue)(new Date())))
4209
- })) : createCommentVNode("", true), createVNode(_sfc_main$F, {
4056
+ })) : createCommentVNode("", true), createVNode(_sfc_main$G, {
4210
4057
  type: "link",
4211
4058
  size: "small",
4212
4059
  textContent: "确定",
@@ -4221,15 +4068,15 @@ var _sfc_main$4 = defineComponent({
4221
4068
  }
4222
4069
  });
4223
4070
 
4224
- const _hoisted_1$3 = ["textContent"];
4225
- const _hoisted_2$2 = ["textContent"];
4226
- const _hoisted_3 = ["textContent"];
4227
- const _hoisted_4 = ["textContent", "onClick", "onDblclick"];
4228
- const _hoisted_5 = ["textContent", "onClick", "onDblclick"];
4229
- const _hoisted_6 = ["textContent"];
4071
+ const _hoisted_1$6 = ["textContent"];
4072
+ const _hoisted_2$5 = ["textContent"];
4073
+ const _hoisted_3$1 = ["textContent"];
4074
+ const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
4075
+ const _hoisted_5$1 = ["textContent", "onClick", "onDblclick"];
4076
+ const _hoisted_6$1 = ["textContent"];
4230
4077
  const _hoisted_7 = ["textContent", "onClick", "onDblclick"];
4231
4078
  const _hoisted_8 = ["textContent"];
4232
- var _sfc_main$3 = defineComponent({
4079
+ var _sfc_main$6 = defineComponent({
4233
4080
  __name: "date-pc",
4234
4081
  props: {
4235
4082
  value: {},
@@ -4446,7 +4293,7 @@ var _sfc_main$3 = defineComponent({
4446
4293
  dateRef.value == void 0 && (dateRef.value = electDateValue());
4447
4294
  buildPickerItems(stepRef.value, 0);
4448
4295
  return (_ctx, _cache) => {
4449
- return openBlock(), createBlock(_sfc_main$c, {
4296
+ return openBlock(), createBlock(_sfc_main$f, {
4450
4297
  class: normalizeClass(["date-picker pc", {
4451
4298
  "time-now": __props.pinned && __props.pinned.value == true
4452
4299
  }]),
@@ -4458,7 +4305,7 @@ var _sfc_main$3 = defineComponent({
4458
4305
  height: "30px"
4459
4306
  }
4460
4307
  }, createSlots({
4461
- top: withCtx(() => [createVNode(_sfc_main$E, {
4308
+ top: withCtx(() => [createVNode(_sfc_main$F, {
4462
4309
  type: "arrow",
4463
4310
  button: "",
4464
4311
  rotate: 180,
@@ -4471,16 +4318,16 @@ var _sfc_main$3 = defineComponent({
4471
4318
  }, [stepRef.value == "year" ? (openBlock(), createElementBlock("div", {
4472
4319
  key: 0,
4473
4320
  textContent: toDisplayString(`${yearItems.value[0].year}年 - ${unref(getFromArray)(yearItems.value, -1).year}年`)
4474
- }, null, 8, _hoisted_1$3)) : (openBlock(), createElementBlock(Fragment, {
4321
+ }, null, 8, _hoisted_1$6)) : (openBlock(), createElementBlock(Fragment, {
4475
4322
  key: 1
4476
4323
  }, [createElementVNode("div", {
4477
4324
  textContent: toDisplayString(`${dateRef.value.year}年`),
4478
4325
  onClick: _cache[1] || (_cache[1] = $event => onSwitchStepClick("year"))
4479
- }, null, 8, _hoisted_2$2), stepRef.value == "day" ? (openBlock(), createElementBlock("div", {
4326
+ }, null, 8, _hoisted_2$5), stepRef.value == "day" ? (openBlock(), createElementBlock("div", {
4480
4327
  key: 0,
4481
4328
  textContent: toDisplayString(`${dateRef.value.month}月`),
4482
4329
  onClick: _cache[2] || (_cache[2] = $event => onSwitchStepClick("month"))
4483
- }, null, 8, _hoisted_3)) : createCommentVNode("", true)], 64))], 2), createVNode(_sfc_main$E, {
4330
+ }, null, 8, _hoisted_3$1)) : createCommentVNode("", true)], 64))], 2), createVNode(_sfc_main$F, {
4484
4331
  class: "flex-0",
4485
4332
  type: "arrow",
4486
4333
  button: "",
@@ -4502,7 +4349,7 @@ var _sfc_main$3 = defineComponent({
4502
4349
  textContent: toDisplayString(item.year),
4503
4350
  onClick: $event => onYearItemClick(item),
4504
4351
  onDblclick: $event => onYearItemClick(item, true)
4505
- }, null, 40, _hoisted_4)], 2);
4352
+ }, null, 40, _hoisted_4$1)], 2);
4506
4353
  }), 128)) : stepRef.value == "month" ? (openBlock(true), createElementBlock(Fragment, {
4507
4354
  key: 1
4508
4355
  }, renderList(monthItems.value, item => {
@@ -4516,7 +4363,7 @@ var _sfc_main$3 = defineComponent({
4516
4363
  textContent: toDisplayString(item.text),
4517
4364
  onClick: $event => onMonthItemClick(item),
4518
4365
  onDblclick: $event => onMonthItemClick(item, true)
4519
- }, null, 40, _hoisted_5)], 2);
4366
+ }, null, 40, _hoisted_5$1)], 2);
4520
4367
  }), 128)) : (openBlock(), createElementBlock(Fragment, {
4521
4368
  key: 2
4522
4369
  }, [(openBlock(), createElementBlock(Fragment, null, renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
@@ -4524,7 +4371,7 @@ var _sfc_main$3 = defineComponent({
4524
4371
  class: "day-item week",
4525
4372
  key: item,
4526
4373
  textContent: toDisplayString(item)
4527
- }, null, 8, _hoisted_6);
4374
+ }, null, 8, _hoisted_6$1);
4528
4375
  }), 64)), (openBlock(true), createElementBlock(Fragment, null, renderList(dayItemsRef.value, item => {
4529
4376
  return openBlock(), createElementBlock("div", {
4530
4377
  class: normalizeClass(["day-item", {
@@ -4552,19 +4399,19 @@ var _sfc_main$3 = defineComponent({
4552
4399
  onClick: onSelectTime
4553
4400
  }, null, 10, _hoisted_8)) : createCommentVNode("", true), __props.toolbarDisabled != true ? (openBlock(), createElementBlock(Fragment, {
4554
4401
  key: 1
4555
- }, [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
4402
+ }, [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
4556
4403
  key: 0,
4557
4404
  type: "link",
4558
4405
  size: "small",
4559
4406
  textContent: "清空",
4560
4407
  onClick: _cache[4] || (_cache[4] = $event => (emits("clear"), unref(inPopup) && __props.closePopup("")))
4561
- })) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$F, {
4408
+ })) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
4562
4409
  key: 1,
4563
4410
  type: "link",
4564
4411
  size: "small",
4565
4412
  textContent: "现在",
4566
4413
  onClick: onNow
4567
- })) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), createVNode(_sfc_main$F, {
4414
+ })) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), createVNode(_sfc_main$G, {
4568
4415
  type: "link",
4569
4416
  size: "small",
4570
4417
  textContent: "确定",
@@ -4579,19 +4426,148 @@ var _sfc_main$3 = defineComponent({
4579
4426
  }
4580
4427
  });
4581
4428
 
4429
+ const _hoisted_1$5 = {
4430
+ class: "snail-scroll-picker"
4431
+ };
4432
+ const _hoisted_2$4 = {
4433
+ key: 0,
4434
+ class: "pick-header"
4435
+ };
4436
+ const _hoisted_3 = ["textContent"];
4437
+ const _hoisted_4 = {
4438
+ class: "pick-body"
4439
+ };
4440
+ const _hoisted_5 = {
4441
+ class: "pick-items",
4442
+ ref: "pick-items"
4443
+ };
4444
+ const _hoisted_6 = ["textContent"];
4445
+ const itemHeight = 32;
4446
+ var _sfc_main$5 = defineComponent({
4447
+ __name: "scroll-picker",
4448
+ props: {
4449
+ items: {},
4450
+ value: {},
4451
+ title: {},
4452
+ clearDisabled: {
4453
+ type: Boolean
4454
+ },
4455
+ inPopup: {},
4456
+ closePopup: {
4457
+ type: Function
4458
+ },
4459
+ onBeforeClose: {
4460
+ type: Function
4461
+ },
4462
+ popupStatus: {},
4463
+ popup: {},
4464
+ picker: {}
4465
+ },
4466
+ emits: ["select"],
4467
+ setup(__props, _ref) {
4468
+ var _ref2, _props$value, _props$items$;
4469
+ let {
4470
+ emit: __emit
4471
+ } = _ref;
4472
+ const props = __props;
4473
+ const emits = __emit;
4474
+ const {
4475
+ onSize
4476
+ } = useObserver();
4477
+ const {
4478
+ onTimeout
4479
+ } = useTimer();
4480
+ const pickItemsDom = useTemplateRef("pick-items");
4481
+ const elasticRef = shallowRef();
4482
+ const valueRef = ref((_ref2 = (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : (_props$items$ = props.items[0]) === null || _props$items$ === void 0 ? void 0 : _props$items$.code) !== null && _ref2 !== void 0 ? _ref2 : "");
4483
+ let backValue = void 0;
4484
+ function onElastic(detail) {
4485
+ if (detail.status == "start") {
4486
+ backValue = valueRef.value;
4487
+ } else {
4488
+ const index = parseInt((detail.position.y / itemHeight).toFixed(0));
4489
+ const item = props.items[-index];
4490
+ valueRef.value = item ? item.code : void 0;
4491
+ if (detail.status == "end") {
4492
+ elasticRef.value.scrollTo(void 0, index * itemHeight);
4493
+ backValue != valueRef.value && emits("select", valueRef.value);
4494
+ }
4495
+ }
4496
+ }
4497
+ onMounted(async () => {
4498
+ onSize(pickItemsDom.value.parentElement, size => {
4499
+ const offset = (size.height - itemHeight) / 2;
4500
+ pickItemsDom.value.style.padding = `${offset}px 0`;
4501
+ });
4502
+ elasticRef.value = useElastic(pickItemsDom.value, {
4503
+ elastic: "y",
4504
+ distance: 100
4505
+ }, onElastic);
4506
+ const index = props.items.findIndex(item => item.code == valueRef.value);
4507
+ index != -1 && onTimeout(() => elasticRef.value.scrollTo(void 0, -itemHeight * index), 50);
4508
+ });
4509
+ return (_ctx, _cache) => {
4510
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [__props.inPopup ? (openBlock(), createElementBlock("div", _hoisted_2$4, [createElementVNode("span", {
4511
+ class: "pick-button",
4512
+ textContent: "取消",
4513
+ onClick: _cache[0] || (_cache[0] = $event => __props.closePopup(void 0))
4514
+ }), __props.clearDisabled != true ? (openBlock(), createElementBlock("span", {
4515
+ key: 0,
4516
+ class: "pick-button",
4517
+ textContent: "清空",
4518
+ onClick: _cache[1] || (_cache[1] = $event => __props.closePopup(""))
4519
+ })) : createCommentVNode("", true), createElementVNode("span", {
4520
+ class: "pick-title ellipsis",
4521
+ textContent: toDisplayString(__props.title)
4522
+ }, null, 8, _hoisted_3), createElementVNode("span", {
4523
+ class: "pick-button",
4524
+ textContent: "确定",
4525
+ onClick: _cache[2] || (_cache[2] = $event => __props.closePopup(valueRef.value))
4526
+ })])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, item => {
4527
+ return openBlock(), createElementBlock("span", {
4528
+ class: normalizeClass(["pick-item", {
4529
+ selected: item.code === valueRef.value,
4530
+ disabled: item.disabled
4531
+ }]),
4532
+ key: item.code,
4533
+ textContent: toDisplayString(item.name)
4534
+ }, null, 10, _hoisted_6);
4535
+ }), 128))], 512), _cache[3] || (_cache[3] = createElementVNode("div", {
4536
+ class: "pick-layer"
4537
+ }, [createElementVNode("span", {
4538
+ class: "layer-top"
4539
+ }), createElementVNode("span", {
4540
+ class: "layer-selection"
4541
+ }), createElementVNode("span", {
4542
+ class: "layer-bottom"
4543
+ })], -1))])]);
4544
+ };
4545
+ }
4546
+ });
4547
+
4582
4548
  function usePicker() {
4583
4549
  const popup = usePopup();
4584
4550
  function showDate(target, options, popupOptions) {
4585
4551
  options = {
4586
4552
  ...options
4587
4553
  };
4588
- return showPicker(target, _sfc_main$3, options, popupOptions);
4554
+ return showPicker(target, _sfc_main$6, options, popupOptions);
4589
4555
  }
4590
4556
  function showTime(target, options, popupOptions) {
4591
4557
  options = {
4592
4558
  ...options
4593
4559
  };
4594
- return showPicker(target, _sfc_main$4, options, popupOptions);
4560
+ return showPicker(target, _sfc_main$7, options, popupOptions);
4561
+ }
4562
+ function showScroll(options) {
4563
+ const popupOptions = {
4564
+ mode: "dialog",
4565
+ dialog: {
4566
+ closeOnEscape: true,
4567
+ closeOnMask: true
4568
+ }
4569
+ };
4570
+ return showPicker(void 0, _sfc_main$5, options, popupOptions);
4595
4571
  }
4596
4572
  function showPicker(target, component, options, popupOptions) {
4597
4573
  if (popupOptions && popupOptions.mode == "dialog") {
@@ -4629,12 +4605,188 @@ function usePicker() {
4629
4605
  }
4630
4606
  const manager = Object.freeze(mountScope({
4631
4607
  showDate,
4632
- showTime
4608
+ showTime,
4609
+ showScroll
4633
4610
  }, "IPickerManager"));
4634
4611
  manager.onDestroy(popup.destroy);
4635
4612
  return manager;
4636
4613
  }
4637
4614
 
4615
+ const _hoisted_1$4 = {
4616
+ class: "action-slot flex-cross-center"
4617
+ };
4618
+ const _hoisted_2$3 = ["textContent"];
4619
+ var _sfc_main$4 = defineComponent({
4620
+ __name: "action",
4621
+ props: {
4622
+ disabled: {
4623
+ type: Boolean
4624
+ },
4625
+ value: {},
4626
+ actions: {},
4627
+ mode: {},
4628
+ icon: {},
4629
+ popup: {},
4630
+ follow: {}
4631
+ },
4632
+ emits: ["trigger"],
4633
+ setup(__props, _ref) {
4634
+ let {
4635
+ emit: __emit
4636
+ } = _ref;
4637
+ const props = __props;
4638
+ const emits = __emit;
4639
+ const {
4640
+ follow
4641
+ } = usePopup();
4642
+ const {
4643
+ showScroll
4644
+ } = usePicker();
4645
+ const {
4646
+ onTouch
4647
+ } = useObserver();
4648
+ const valueRef = shallowRef(props.value);
4649
+ const rootDom = useTemplateRef("snail-action");
4650
+ const popupScopeRef = shallowRef(void 0);
4651
+ const slotHandle = Object.freeze({
4652
+ isActived: () => popupScopeRef.value != void 0,
4653
+ trigger: () => onShowActions(props.mode == "press")
4654
+ });
4655
+ function buildDefaultText() {
4656
+ if (isArrayNotEmpty(props.actions) == true) {
4657
+ const item = props.actions.find(item2 => item2.code == valueRef.value) || props.actions[0];
4658
+ return item.name;
4659
+ }
4660
+ return void 0;
4661
+ }
4662
+ async function onShowActions(longPress) {
4663
+ if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
4664
+ popupScopeRef.value.destroy();
4665
+ popupScopeRef.value = void 0;
4666
+ }
4667
+ if (props.disabled != true) {
4668
+ switch (props.popup) {
4669
+ case "picker":
4670
+ {
4671
+ popupScopeRef.value = showScroll({
4672
+ value: valueRef.value,
4673
+ items: props.actions,
4674
+ clearDisabled: true
4675
+ });
4676
+ break;
4677
+ }
4678
+ default:
4679
+ {
4680
+ const followOptions = props.follow || Object.create(null);
4681
+ popupScopeRef.value = follow(rootDom.value, {
4682
+ component: _sfc_main$8,
4683
+ closeOnEscape: true,
4684
+ closeOnMask: true,
4685
+ closeOnResize: true,
4686
+ closeOnTarget: true,
4687
+ followX: followOptions.followX || ["center", "start", "end", "after", "before", "ratio"],
4688
+ followY: followOptions.followY || ["after", "before", "center", "end", "start", "ratio"],
4689
+ spaceX: followOptions.spaceX,
4690
+ spaceY: followOptions.spaceY,
4691
+ props: {
4692
+ mode: "vertical",
4693
+ actions: props.actions
4694
+ }
4695
+ });
4696
+ break;
4697
+ }
4698
+ }
4699
+ const code = await popupScopeRef.value;
4700
+ popupScopeRef.value = void 0;
4701
+ if (isStringNotEmpty(code) == true) {
4702
+ valueRef.value = code;
4703
+ emits("trigger", code);
4704
+ }
4705
+ }
4706
+ }
4707
+ onMounted(() => {
4708
+ onTouch(rootDom.value, {}, detail => {
4709
+ if (props.mode == "press" && detail.status == "end") {
4710
+ const time = detail.now.timestamp - detail.start.timestamp;
4711
+ if (time > 500) {
4712
+ navigator.vibrate && navigator.vibrate(200);
4713
+ onShowActions();
4714
+ }
4715
+ }
4716
+ });
4717
+ });
4718
+ return (_ctx, _cache) => {
4719
+ return openBlock(), createElementBlock("div", {
4720
+ class: normalizeClass(["snail-action flex-cross-center", {
4721
+ button: __props.mode == "whole" && __props.disabled != true
4722
+ }]),
4723
+ ref: "snail-action",
4724
+ onClick: _cache[1] || (_cache[1] = $event => __props.mode == "whole" && onShowActions())
4725
+ }, [createElementVNode("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createElementVNode("span", {
4726
+ class: "ellipsis",
4727
+ textContent: toDisplayString(buildDefaultText())
4728
+ }, null, 8, _hoisted_2$3)])]), __props.disabled != true && __props.mode != "press" ? (openBlock(), createElementBlock("div", {
4729
+ key: 0,
4730
+ class: normalizeClass(["trigger-slot", {
4731
+ "hover-show": __props.icon != "always"
4732
+ }])
4733
+ }, [renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createVNode(_sfc_main$F, {
4734
+ button: "",
4735
+ type: "more",
4736
+ size: 16,
4737
+ onClick: _cache[0] || (_cache[0] = $event => __props.mode != "whole" && onShowActions())
4738
+ })])], 2)) : createCommentVNode("", true)], 2);
4739
+ };
4740
+ }
4741
+ });
4742
+
4743
+ const _hoisted_1$3 = {
4744
+ class: "snail-flash-number"
4745
+ };
4746
+ const _hoisted_2$2 = ["textContent"];
4747
+ var _sfc_main$3 = defineComponent({
4748
+ __name: "flash-number",
4749
+ props: {
4750
+ value: {}
4751
+ },
4752
+ setup(__props) {
4753
+ const props = __props;
4754
+ const itemsRef = ref();
4755
+ function buildNumberItems() {
4756
+ itemsRef.value = [];
4757
+ const value = isNullish(props.value) ? null : String(props.value);
4758
+ if (isStringNotEmpty(value) == true) {
4759
+ for (const item of value) {
4760
+ const number = parseInt(item);
4761
+ const isNumber = 0 <= number && number <= 9;
4762
+ itemsRef.value.push({
4763
+ id: newId(),
4764
+ text: item,
4765
+ number: isNumber ? number : void 0
4766
+ });
4767
+ }
4768
+ }
4769
+ if (isArrayNotEmpty(itemsRef.value) == true) ;
4770
+ }
4771
+ onMounted(() => {
4772
+ buildNumberItems();
4773
+ });
4774
+ return (_ctx, _cache) => {
4775
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
4776
+ return openBlock(), createElementBlock("span", {
4777
+ key: item.id,
4778
+ textContent: toDisplayString(item.text),
4779
+ class: normalizeClass(unref(isNullish)(item.number) ? "" : "number-item")
4780
+ }, null, 10, _hoisted_2$2);
4781
+ }), 128)), _cache[0] || (_cache[0] = createElementVNode("span", {
4782
+ style: {
4783
+ "color": "red"
4784
+ }
4785
+ }, "-----还没实现,别用", -1))]);
4786
+ };
4787
+ }
4788
+ });
4789
+
4638
4790
  const _hoisted_1$2 = ["title"];
4639
4791
  const _hoisted_2$1 = ["textContent"];
4640
4792
  var _sfc_main$2 = defineComponent({
@@ -4713,7 +4865,7 @@ var _sfc_main$2 = defineComponent({
4713
4865
  "flex-1": __props.mode != "simple"
4714
4866
  }]),
4715
4867
  textContent: toDisplayString(valueRef.value)
4716
- }, null, 10, _hoisted_2$1)) : createCommentVNode("", true), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$E, {
4868
+ }, null, 10, _hoisted_2$1)) : createCommentVNode("", true), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$F, {
4717
4869
  key: 1,
4718
4870
  type: "datepicker",
4719
4871
  button: "",
@@ -4801,7 +4953,7 @@ var _sfc_main$1 = defineComponent({
4801
4953
  "flex-1": __props.mode != "simple"
4802
4954
  }]),
4803
4955
  textContent: toDisplayString(valueRef.value)
4804
- }, null, 10, _hoisted_2)) : createCommentVNode("", true), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$E, {
4956
+ }, null, 10, _hoisted_2)) : createCommentVNode("", true), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$F, {
4805
4957
  key: 1,
4806
4958
  type: "timepicker",
4807
4959
  button: "",
@@ -4897,12 +5049,12 @@ var _sfc_main = defineComponent({
4897
5049
  onTouchstart: onStartDrag,
4898
5050
  onTouchmove: onDragMove,
4899
5051
  onTouchend: onDragEnd
4900
- }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$E, {
5052
+ }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$F, {
4901
5053
  key: 0,
4902
5054
  type: "success",
4903
5055
  size: 20,
4904
5056
  color: "white"
4905
- })) : (openBlock(), createBlock(_sfc_main$E, {
5057
+ })) : (openBlock(), createBlock(_sfc_main$F, {
4906
5058
  key: 1,
4907
5059
  custom: "",
4908
5060
  size: 20,
@@ -4921,37 +5073,38 @@ var _sfc_main = defineComponent({
4921
5073
  });
4922
5074
 
4923
5075
  const components = {
4924
- Action: _sfc_main$g,
4925
- Button: _sfc_main$F,
4926
- Choose: _sfc_main$D,
4927
- Footer: _sfc_main$C,
4928
- Header: _sfc_main$B,
4929
- Icon: _sfc_main$E,
4930
- Input: _sfc_main$A,
4931
- Number: _sfc_main$z,
4932
- Search: _sfc_main$y,
4933
- Select: _sfc_main$k,
4934
- Switch: _sfc_main$j,
4935
- Textarea: _sfc_main$i,
4936
- Dynamic: _sfc_main$u,
4937
- Elastic: _sfc_main$f,
4938
- Flex: _sfc_main$e,
4939
- Fold: _sfc_main$d,
4940
- Motion: _sfc_main$w,
4941
- Layout: _sfc_main$c,
4942
- Scroll: _sfc_main$t,
4943
- Sort: _sfc_main$b,
4944
- Table: _sfc_main$a,
4945
- TableRow: _sfc_main$9,
4946
- TableCol: _sfc_main$8,
4947
- Tree: _sfc_main$6,
4948
- Wrapper: _sfc_main$s,
4949
- FlashNumber: _sfc_main$5,
5076
+ Button: _sfc_main$G,
5077
+ Choose: _sfc_main$E,
5078
+ Footer: _sfc_main$D,
5079
+ Header: _sfc_main$C,
5080
+ Icon: _sfc_main$F,
5081
+ Input: _sfc_main$B,
5082
+ Number: _sfc_main$A,
5083
+ Search: _sfc_main$z,
5084
+ Select: _sfc_main$l,
5085
+ Switch: _sfc_main$k,
5086
+ Textarea: _sfc_main$j,
5087
+ Dynamic: _sfc_main$v,
5088
+ Elastic: _sfc_main$i,
5089
+ Flex: _sfc_main$h,
5090
+ Fold: _sfc_main$g,
5091
+ Motion: _sfc_main$x,
5092
+ Layout: _sfc_main$f,
5093
+ Scroll: _sfc_main$u,
5094
+ Sort: _sfc_main$e,
5095
+ Table: _sfc_main$d,
5096
+ TableRow: _sfc_main$c,
5097
+ TableCol: _sfc_main$b,
5098
+ Tree: _sfc_main$9,
5099
+ Wrapper: _sfc_main$t,
5100
+ Action: _sfc_main$4,
5101
+ FlashNumber: _sfc_main$3,
4950
5102
  DatePicker: _sfc_main$2,
5103
+ ScrollPicker: _sfc_main$5,
4951
5104
  TimePicker: _sfc_main$1,
4952
5105
  DragVerify: _sfc_main,
4953
- Empty: _sfc_main$n,
4954
- Loading: _sfc_main$v
5106
+ Empty: _sfc_main$o,
5107
+ Loading: _sfc_main$w
4955
5108
  };
4956
5109
 
4957
5110
  onMountScope(scope => {