snail.vue 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/snail.vue.js CHANGED
@@ -1,10 +1,10 @@
1
1
  //@ sourceURL=/snail.vue.js
2
- import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, normalizeStyle, createElementVNode, toDisplayString, Fragment, renderList, unref, mergeModels, useModel, computed, createCommentVNode, createBlock, nextTick, onMounted, onUnmounted, useTemplateRef, createVNode, withDirectives, vModelText, createApp, Transition, withCtx, normalizeProps, guardReactiveProps, watch, ref, onErrorCaptured, resolveDynamicComponent, mergeProps, createSlots, withModifiers, isRef, getCurrentInstance, resolveComponent, onBeforeUnmount, getCurrentScope, onScopeDispose } from 'vue';
3
- import { throwError, isArrayNotEmpty, isStringNotEmpty, useKey, isArray, useTimer, newId, script, isFunction, getFromArray, mustFunction, useScope, removeFromArray, mustObject, throwIfFalse, isObject, isNumberNotNaN, mountScope, useScopes, isPromise, wait, delay, defer, useAsyncScope, useHook, hasAny, throwIfTrue, onMountScope } from 'snail.core';
4
- import { css, link, useObserver, useAnimation } from 'snail.view';
2
+ import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, normalizeStyle, createElementVNode, toDisplayString, Fragment, renderList, unref, mergeModels, useModel, computed, createCommentVNode, createBlock, nextTick, onMounted, onUnmounted, useTemplateRef, createVNode, watch, withDirectives, isRef, vModelText, createApp, Transition, withCtx, normalizeProps, guardReactiveProps, ref, onErrorCaptured, resolveDynamicComponent, mergeProps, createSlots, withModifiers, getCurrentInstance, resolveComponent, onBeforeUnmount, TransitionGroup, getCurrentScope, onScopeDispose } from 'vue';
3
+ import { throwError, isArrayNotEmpty, isStringNotEmpty, useKey, isArray, useTimer, newId, script, isFunction, getFromArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isObject, isNumberNotNaN, hasAny, mustFunction, useScope, removeFromArray, mustObject, delay, defer, useAsyncScope, useHook, throwIfTrue, onMountScope } from 'snail.core';
4
+ import { link, css, useObserver, useAnimation } from 'snail.view';
5
5
 
6
- const _hoisted_1$h = ["title"];
7
- var _sfc_main$u = defineComponent({
6
+ const _hoisted_1$j = ["title"];
7
+ var _sfc_main$x = defineComponent({
8
8
  ...{
9
9
  name: "Button",
10
10
  inheritAttrs: true
@@ -20,11 +20,15 @@ var _sfc_main$u = defineComponent({
20
20
  return openBlock(), createElementBlock("div", {
21
21
  class: normalizeClass(["snail-button", [__props.size, __props.type]]),
22
22
  title: __props.title
23
- }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮", -1))])], 10, _hoisted_1$h);
23
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮", -1))])], 10, _hoisted_1$j);
24
24
  };
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 getSvgDraw(iconType, draw) {
29
33
  switch (iconType) {
30
34
  case "success":
@@ -63,10 +67,10 @@ function getSvgDraw(iconType, draw) {
63
67
  }
64
68
  }
65
69
 
66
- const _hoisted_1$g = ["width", "height"];
67
- const _hoisted_2$a = ["textContent"];
68
- const _hoisted_3$7 = ["fill", "stroke", "stroke-width", "d"];
69
- var _sfc_main$t = defineComponent({
70
+ const _hoisted_1$i = ["width", "height"];
71
+ const _hoisted_2$b = ["textContent"];
72
+ const _hoisted_3$8 = ["fill", "stroke", "stroke-width", "d"];
73
+ var _sfc_main$w = defineComponent({
70
74
  ...{
71
75
  name: "Icon",
72
76
  inheritAttrs: true
@@ -96,23 +100,23 @@ var _sfc_main$t = defineComponent({
96
100
  onMouseleave: _cache[1] || (_cache[1] = $event => isMouseEnterRef.value = false)
97
101
  }, [createElementVNode("title", {
98
102
  textContent: toDisplayString(__props.title || "")
99
- }, null, 8, _hoisted_2$a), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSvgDraw)(__props.type, __props.draw), draw => {
103
+ }, null, 8, _hoisted_2$b), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSvgDraw)(__props.type, __props.draw), draw => {
100
104
  return openBlock(), createElementBlock("path", {
101
105
  fill: isMouseEnterRef.value ? __props.hoverColor || __props.color : __props.color,
102
106
  stroke: __props.stroke,
103
107
  "stroke-width": __props.strokeWidth,
104
108
  d: draw
105
- }, null, 8, _hoisted_3$7);
106
- }), 256))], 46, _hoisted_1$g);
109
+ }, null, 8, _hoisted_3$8);
110
+ }), 256))], 46, _hoisted_1$i);
107
111
  };
108
112
  }
109
113
  });
110
114
 
111
- const _hoisted_1$f = ["title", "onClick"];
112
- const _hoisted_2$9 = ["type", "checked"];
113
- const _hoisted_3$6 = ["textContent"];
114
- const _hoisted_4$4 = ["textContent"];
115
- var _sfc_main$s = defineComponent({
115
+ const _hoisted_1$h = ["title", "onClick"];
116
+ const _hoisted_2$a = ["type", "checked"];
117
+ const _hoisted_3$7 = ["textContent"];
118
+ const _hoisted_4$5 = ["textContent"];
119
+ var _sfc_main$v = defineComponent({
116
120
  ...{
117
121
  name: "Choose",
118
122
  inheritAttrs: true
@@ -166,7 +170,11 @@ var _sfc_main$s = defineComponent({
166
170
  const newSelected = type == "checkbox" && props.items.length == 1 ? !node.selected : true;
167
171
  chooseItemsRef.value.forEach(item => item.selected = false);
168
172
  node.selected = newSelected;
169
- valuesModel.value = newSelected ? node.item.value : void 0;
173
+ const newValue = newSelected ? node.item.value : void 0;
174
+ if (valuesModel.value == newValue) {
175
+ return;
176
+ }
177
+ valuesModel.value = newValue;
170
178
  }
171
179
  nextTick(() => emits("change", valuesModel.value));
172
180
  }
@@ -184,10 +192,10 @@ var _sfc_main$s = defineComponent({
184
192
  key: 0,
185
193
  type: unref(type),
186
194
  checked: node.selected
187
- }, null, 8, _hoisted_2$9)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
195
+ }, null, 8, _hoisted_2$a)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
188
196
  key: 1,
189
197
  class: normalizeClass(["status", [node.selected ? "selected" : ""]])
190
- }, [node.selected ? (openBlock(), createBlock(_sfc_main$t, {
198
+ }, [node.selected ? (openBlock(), createBlock(_sfc_main$w, {
191
199
  key: 0,
192
200
  type: "success",
193
201
  size: 12,
@@ -196,22 +204,18 @@ var _sfc_main$s = defineComponent({
196
204
  key: 2,
197
205
  class: "item-text",
198
206
  textContent: toDisplayString(node.item.text)
199
- }, null, 8, _hoisted_3$6)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
207
+ }, null, 8, _hoisted_3$7)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
200
208
  key: 3,
201
209
  class: "item-des",
202
210
  textContent: toDisplayString(node.item.description)
203
- }, null, 8, _hoisted_4$4)) : createCommentVNode("", true)], 14, _hoisted_1$f);
211
+ }, null, 8, _hoisted_4$5)) : createCommentVNode("", true)], 14, _hoisted_1$h);
204
212
  }), 128))], 2);
205
213
  };
206
214
  }
207
215
  });
208
216
 
209
- var addLink = href => setTimeout(link.register, 0, href);
210
-
211
- addLink("/styles/snail.vue.vue.css");
212
-
213
- const _hoisted_1$e = ["id"];
214
- var _sfc_main$r = defineComponent({
217
+ const _hoisted_1$g = ["id"];
218
+ var _sfc_main$u = defineComponent({
215
219
  __name: "datepicker",
216
220
  props: {
217
221
  type: {},
@@ -362,12 +366,12 @@ var _sfc_main$r = defineComponent({
362
366
  class: "snail-datepicker",
363
367
  id: unref(id),
364
368
  onClick
365
- }, null, 8, _hoisted_1$e);
369
+ }, null, 8, _hoisted_1$g);
366
370
  };
367
371
  }
368
372
  });
369
373
 
370
- var _sfc_main$q = defineComponent({
374
+ var _sfc_main$t = defineComponent({
371
375
  ...{
372
376
  name: "Footer",
373
377
  inheritAttrs: true
@@ -398,13 +402,13 @@ var _sfc_main$q = defineComponent({
398
402
  class: normalizeClass(["snail-footer", {
399
403
  "start-divider": __props.divider
400
404
  }, __props.align || "right"])
401
- }, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$u, {
405
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$x, {
402
406
  key: 0,
403
407
  size: "max",
404
408
  type: "default",
405
409
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
406
410
  textContent: toDisplayString(__props.cancelName || "取消")
407
- }, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$u, {
411
+ }, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$x, {
408
412
  key: 1,
409
413
  size: "max",
410
414
  type: "primary",
@@ -415,8 +419,8 @@ var _sfc_main$q = defineComponent({
415
419
  }
416
420
  });
417
421
 
418
- const _hoisted_1$d = ["textContent"];
419
- var _sfc_main$p = defineComponent({
422
+ const _hoisted_1$f = ["textContent"];
423
+ var _sfc_main$s = defineComponent({
420
424
  ...{
421
425
  name: "Header",
422
426
  inheritAttrs: true
@@ -455,7 +459,7 @@ var _sfc_main$p = defineComponent({
455
459
  key: 0,
456
460
  textContent: toDisplayString(__props.title),
457
461
  class: normalizeClass(["header-title", __props.titleAlign])
458
- }, null, 10, _hoisted_1$d)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$t, {
462
+ }, null, 10, _hoisted_1$f)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$w, {
459
463
  key: 1,
460
464
  type: "close",
461
465
  size: 22,
@@ -467,18 +471,18 @@ var _sfc_main$p = defineComponent({
467
471
  }
468
472
  });
469
473
 
470
- const _hoisted_1$c = ["textContent"];
471
- const _hoisted_2$8 = {
474
+ const _hoisted_1$e = ["textContent"];
475
+ const _hoisted_2$9 = {
472
476
  key: 0,
473
477
  class: "required",
474
478
  textContent: "*"
475
479
  };
476
- const _hoisted_3$5 = {
480
+ const _hoisted_3$6 = {
477
481
  class: "input-body"
478
482
  };
479
- const _hoisted_4$3 = ["type", "value", "readonly", "placeholder", "title"];
480
- const _hoisted_5$1 = ["title"];
481
- var _sfc_main$o = defineComponent({
483
+ const _hoisted_4$4 = ["type", "value", "readonly", "placeholder", "title"];
484
+ const _hoisted_5$2 = ["title"];
485
+ var _sfc_main$r = defineComponent({
482
486
  ...{
483
487
  name: "Input",
484
488
  inheritAttrs: true
@@ -530,7 +534,7 @@ var _sfc_main$o = defineComponent({
530
534
  }, [createElementVNode("span", {
531
535
  class: "text",
532
536
  textContent: toDisplayString(__props.title)
533
- }, null, 8, _hoisted_1$c), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$8)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$5, [createElementVNode("input", {
537
+ }, null, 8, _hoisted_1$e), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$9)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$6, [createElementVNode("input", {
534
538
  ref: "input-el",
535
539
  type: __props.type || "text",
536
540
  value: inputModel.value,
@@ -539,22 +543,445 @@ var _sfc_main$o = defineComponent({
539
543
  title: inputModel.value,
540
544
  onChange: onValueChange,
541
545
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
542
- }, null, 40, _hoisted_4$3), !!validateRef.value ? (openBlock(), createElementBlock("span", {
546
+ }, null, 40, _hoisted_4$4), !!validateRef.value ? (openBlock(), createElementBlock("span", {
543
547
  key: 0,
544
548
  class: "validate",
545
549
  title: validateRef.value
546
- }, [createVNode(_sfc_main$t, {
550
+ }, [createVNode(_sfc_main$w, {
547
551
  type: "error",
548
552
  size: 16,
549
553
  color: "red"
550
- })], 8, _hoisted_5$1)) : createCommentVNode("", true)])], 2);
554
+ })], 8, _hoisted_5$2)) : createCommentVNode("", true)])], 2);
551
555
  };
552
556
  }
553
557
  });
554
558
 
555
- const _hoisted_1$b = ["placeholder", "readonly"];
559
+ function useReactive() {
560
+ function transition(rv, effect, time) {
561
+ throwIfFalse(isObject(effect), "transition: effect must be an object.");
562
+ const scope = scopes.get();
563
+ rv.value = effect.from;
564
+ const endId = setTimeout(scope.destroy, time);
565
+ return scope.onDestroy(function () {
566
+ rv.value = effect.to;
567
+ clearTimeout(endId);
568
+ });
569
+ }
570
+ function load(task, status, delay) {
571
+ throwIfFalse(isPromise(task), "task: task must be a Promise.");
572
+ status.value = true;
573
+ task.finally(function () {
574
+ delay > 0 ? setTimeout(() => status.value = false, delay) : status.value = false;
575
+ });
576
+ return wait(task);
577
+ }
578
+ function watcher(source, callback, deep) {
579
+ const {
580
+ stop
581
+ } = watch(source, callback, {
582
+ deep
583
+ });
584
+ return scopes.get().onDestroy(stop);
585
+ }
586
+ const manager = mountScope({
587
+ transition,
588
+ load,
589
+ watcher
590
+ }, "IReactiveManager");
591
+ const scopes = useScopes();
592
+ manager.onDestroy(scopes.destroy);
593
+ return Object.freeze(manager);
594
+ }
595
+
596
+ function useFormatter(options) {
597
+ const multiplier = options.formatMultiplier > 1 ? Math.trunc(Math.log10(options.formatMultiplier)) : 0;
598
+ const step = options.step > 1 ? parseInt(String(options.step)) : 1;
599
+ const clamp = options.clamp || "keep";
600
+ function format(text, isEnd) {
601
+ isStringNotEmpty(text) && (text = text.replace(/,/g, ""));
602
+ if (hasAny(text) == false) {
603
+ return Object.freeze({
604
+ valid: true,
605
+ number: void 0,
606
+ text: ""
607
+ });
608
+ }
609
+ const isNegative = text.startsWith("-");
610
+ if (isNegative == true) {
611
+ text = text.substring(1);
612
+ if (text.length == 0) {
613
+ return Object.freeze({
614
+ valid: isEnd ? false : true,
615
+ number: void 0,
616
+ text: isEnd ? "" : "-"
617
+ });
618
+ }
619
+ }
620
+ if (/^(?:[1-9]\d*|0)(?:\.\d*)?$/.test(text) == false) {
621
+ return Object.freeze({
622
+ valid: false,
623
+ number: void 0,
624
+ text: ""
625
+ });
626
+ }
627
+ isEnd && formatter.precision >= 0 && (text = parseFloat(text).toFixed(formatter.precision));
628
+ const number = isNegative ? -parseFloat(text) : parseFloat(text);
629
+ const error = 9007199254740991 < number || number < -9007199254740991 ? "超过Number的最大精度范围" : void 0;
630
+ const [integerPart, decimalPart] = text.split(".");
631
+ const multiplier2 = dealMultiplier(integerPart, decimalPart);
632
+ return Object.freeze({
633
+ valid: true,
634
+ number,
635
+ text: isNegative ? `-${text}` : text,
636
+ error,
637
+ isNegative,
638
+ isDecimal: decimalPart !== void 0,
639
+ integerPart,
640
+ decimalPart,
641
+ integerPartAfterMultiplier: multiplier2.integerPart,
642
+ decimalPartAfterMultiplier: multiplier2.decimalPart
643
+ });
644
+ }
645
+ function checkThreshold(number) {
646
+ const belowMin = formatter.minValue == void 0 ? false : number < formatter.minValue;
647
+ const exceedMax = formatter.maxValue == void 0 ? false : number > formatter.maxValue;
648
+ if (belowMin == true) {
649
+ clamp == "clamp" && (number = formatter.minValue);
650
+ } else if (exceedMax == true) {
651
+ clamp == "clamp" && (number = formatter.maxValue);
652
+ }
653
+ return {
654
+ number,
655
+ belowMin,
656
+ exceedMax
657
+ };
658
+ }
659
+ function buildUpper(result) {
660
+ if (formatter.upper == true) {
661
+ const rt = buildIntegerPartUpperText(result.integerPartAfterMultiplier);
662
+ if (rt.success != true) {
663
+ return rt.reason;
664
+ }
665
+ const decimalPart = buildDecimalPartUpperText(result.decimalPartAfterMultiplier) || "整";
666
+ return `${result.isNegative ? "负" : ""}${rt.data}元${decimalPart}`;
667
+ }
668
+ return "";
669
+ }
670
+ function buildThousands(result) {
671
+ if (formatter.thousands != "disabled") {
672
+ const integerPart = (formatter.thousands == "inline" ? result.integerPart : result.integerPartAfterMultiplier).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
673
+ const decimalPart = formatter.thousands == "inline" ? result.decimalPart : result.decimalPartAfterMultiplier;
674
+ return decimalPart === void 0 ? `${result.isNegative ? "-" : ""}${integerPart}` : `${result.isNegative ? "-" : ""}${integerPart}.${decimalPart}`;
675
+ }
676
+ return "";
677
+ }
678
+ function calcByStep(number, isPlus) {
679
+ number === void 0 && (number = 0);
680
+ let [, tmpStr] = String(number).split(".");
681
+ number = Math.trunc(number) + (isPlus ? step : -step);
682
+ tmpStr = tmpStr === void 0 ? String(number) : `${number}.${tmpStr}`;
683
+ return parseFloat(tmpStr);
684
+ }
685
+ function dealMultiplier(integerPart, decimalPart) {
686
+ for (let index = 1; index <= multiplier; index++) {
687
+ let moveStr = void 0;
688
+ if (isStringNotEmpty(decimalPart) == true) {
689
+ moveStr = decimalPart[0];
690
+ decimalPart = decimalPart.substring(1);
691
+ }
692
+ moveStr === void 0 && (moveStr = "0");
693
+ integerPart += moveStr;
694
+ }
695
+ return {
696
+ integerPart,
697
+ decimalPart
698
+ };
699
+ }
700
+ function buildIntegerPartUpperText(integerPart) {
701
+ if (isStringNotEmpty(integerPart) != true) {
702
+ return {
703
+ success: true,
704
+ data: ""
705
+ };
706
+ }
707
+ const digits = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
708
+ const units = ["仟万", "佰万", "拾万", "万", "仟", "佰", "拾", "亿", "仟", "佰", "拾", "万", "仟", "佰", "拾", ""];
709
+ const isNegativeNumber = integerPart.startsWith("-");
710
+ isNegativeNumber && (integerPart = integerPart.substring(1));
711
+ if (units.length < integerPart.length) {
712
+ return {
713
+ success: false,
714
+ reason: `转换大写时整数部分最多支持${units.length}位。`
715
+ };
716
+ }
717
+ const texts = [];
718
+ const unitsOffset = units.length - integerPart.length;
719
+ for (let index = integerPart.length - 1; index >= 0; index--) {
720
+ const digit = `${digits[parseInt(integerPart[index])]}`;
721
+ const unit = units[index + unitsOffset];
722
+ digit != "零" ? texts.push(`${digit}${unit}`) : (unit == "亿" || unit == "万") && texts.push(unit);
723
+ }
724
+ isNegativeNumber && texts.push("负");
725
+ const text = texts.reverse().join("").replace("万万亿", "万亿").replace("亿万", "亿") || "零";
726
+ return {
727
+ success: true,
728
+ data: text
729
+ };
730
+ }
731
+ function buildDecimalPartUpperText(decimalPart) {
732
+ if (isStringNotEmpty(decimalPart) != true) {
733
+ return "";
734
+ }
735
+ const digits = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
736
+ let one = parseInt(decimalPart[0]),
737
+ two = parseInt(decimalPart[1]);
738
+ if (isNaN(two) == true || two === 0) {
739
+ return isNaN(one) == true || one === 0 ? "" : `${digits[one]}角`;
740
+ } else {
741
+ return isNaN(one) == true || one === 0 ? `零${digits[two]}分` : `${digits[one]}角${digits[two]}分`;
742
+ }
743
+ }
744
+ const formatter = Object.freeze(mountScope({
745
+ minValue: isNumberNotNaN(options.minValue) ? options.minValue : void 0,
746
+ maxValue: isNumberNotNaN(options.maxValue) ? options.maxValue : void 0,
747
+ precision: options.precision >= 0 ? parseInt(String(options.precision)) : void 0,
748
+ thousands: options.thousands || "disabled",
749
+ upper: options.upper === true,
750
+ format,
751
+ checkThreshold,
752
+ buildUpper,
753
+ buildThousands,
754
+ calcByStep
755
+ }, "INumberFormatter"));
756
+ return formatter;
757
+ }
758
+
759
+ const _hoisted_1$d = {
760
+ key: 0,
761
+ class: "number-prefix"
762
+ };
763
+ const _hoisted_2$8 = ["textContent"];
764
+ const _hoisted_3$5 = ["inputmode", "placeholder", "title"];
765
+ const _hoisted_4$3 = {
766
+ key: 1,
767
+ class: "number-suffix"
768
+ };
769
+ const _hoisted_5$1 = ["textContent"];
770
+ const _hoisted_6 = ["title", "textContent"];
771
+ const _hoisted_7 = ["title", "textContent"];
772
+ var _sfc_main$q = defineComponent({
773
+ __name: "number",
774
+ props: mergeModels({
775
+ placeholder: {},
776
+ readonly: {
777
+ type: Boolean
778
+ },
779
+ minValue: {},
780
+ maxValue: {},
781
+ clamp: {},
782
+ precision: {},
783
+ thousands: {},
784
+ upper: {
785
+ type: Boolean
786
+ },
787
+ formatMultiplier: {},
788
+ prefix: {},
789
+ suffix: {},
790
+ controls: {},
791
+ step: {}
792
+ }, {
793
+ "modelValue": {},
794
+ "modelModifiers": {}
795
+ }),
796
+ emits: mergeModels(["change", "error", "belowMin", "exceedMax"], ["update:modelValue"]),
797
+ setup(__props, _ref) {
798
+ let {
799
+ emit: __emit
800
+ } = _ref;
801
+ const _ = __props;
802
+ const emits = __emit;
803
+ const valueModel = useModel(__props, "modelValue");
804
+ const inputDom = useTemplateRef("input");
805
+ const {
806
+ watcher
807
+ } = useReactive();
808
+ const formatter = useFormatter(_);
809
+ const {
810
+ readonly,
811
+ prefix,
812
+ suffix
813
+ } = _;
814
+ const {
815
+ precision,
816
+ upper,
817
+ thousands,
818
+ format,
819
+ checkThreshold,
820
+ buildUpper,
821
+ buildThousands,
822
+ calcByStep
823
+ } = formatter;
824
+ const hasPrefix = isStringNotEmpty(prefix);
825
+ const hasSuffix = isStringNotEmpty(suffix);
826
+ const controls = readonly == true ? "disabled" : _.controls || "disabled";
827
+ const displayValueRef = shallowRef();
828
+ const thousandsTextRef = shallowRef();
829
+ const upperTextRef = shallowRef();
830
+ let originNumber = valueModel.value;
831
+ let latestNumber = valueModel.value;
832
+ let needBackSection;
833
+ let ignoreCurValueChange;
834
+ function resetDisplayValue(newValue) {
835
+ if (displayValueRef.value !== newValue) {
836
+ ignoreCurValueChange = true;
837
+ displayValueRef.value = newValue;
838
+ setTimeout(() => ignoreCurValueChange = false, 0);
839
+ return true;
840
+ }
841
+ return false;
842
+ }
843
+ function formatInput(text, isEnd, onInValid, onResetDisplay) {
844
+ const result = format(text, isEnd);
845
+ if (result.error) {
846
+ emits("error", result.error);
847
+ return;
848
+ }
849
+ latestNumber = result.number;
850
+ if (result.valid != true) {
851
+ onInValid && onInValid();
852
+ } else if (result.number === void 0 || isNaN(result.number) == true) {
853
+ upperTextRef.value = "";
854
+ thousandsTextRef.value = "";
855
+ } else {
856
+ upperTextRef.value = buildUpper(result);
857
+ thousandsTextRef.value = buildThousands(result);
858
+ thousands == "inline" ? resetDisplayValue(thousandsTextRef.value) && onResetDisplay && onResetDisplay() : resetDisplayValue(result.text) && onResetDisplay && onResetDisplay();
859
+ }
860
+ return result;
861
+ }
862
+ function validateRange() {
863
+ const check = checkThreshold(latestNumber);
864
+ check.belowMin == true && emits("belowMin", latestNumber, formatter.minValue);
865
+ check.exceedMax == true && emits("exceedMax", latestNumber, formatter.maxValue);
866
+ latestNumber = check.number;
867
+ }
868
+ function bakSectionStart() {
869
+ const inputSectionStart = inputDom.value ? inputDom.value.selectionStart : null;
870
+ return {
871
+ restore(offset) {
872
+ inputSectionStart != null && needBackSection && nextTick(() => {
873
+ const newPosition = inputSectionStart + (offset == void 0 ? 0 : offset);
874
+ inputDom.value.setSelectionRange(newPosition, newPosition);
875
+ });
876
+ }
877
+ };
878
+ }
879
+ function formatOnEnd(triggerChangeEvent) {
880
+ needBackSection = false;
881
+ validateRange();
882
+ formatInput(String(latestNumber), true, () => {
883
+ latestNumber = void 0;
884
+ resetDisplayValue("");
885
+ });
886
+ valueModel.value = latestNumber;
887
+ const hasChange = originNumber != latestNumber;
888
+ const oldValue = originNumber;
889
+ originNumber = latestNumber;
890
+ hasChange && triggerChangeEvent && emits("change", originNumber, oldValue);
891
+ }
892
+ function onStepClick(isPlus) {
893
+ latestNumber = calcByStep(latestNumber, isPlus);
894
+ formatOnEnd(true);
895
+ }
896
+ originNumber !== void 0 && formatOnEnd(false);
897
+ watcher(valueModel, (newValue, oldValue) => {
898
+ if (newValue !== latestNumber) {
899
+ latestNumber = newValue;
900
+ formatOnEnd(false);
901
+ }
902
+ });
903
+ watcher(displayValueRef, (newValue, oldValue) => {
904
+ const bak = bakSectionStart();
905
+ oldValue == void 0 && (oldValue = "");
906
+ ignoreCurValueChange || formatInput(newValue, false, () => {
907
+ latestNumber = valueModel.value;
908
+ resetDisplayValue(oldValue);
909
+ bak.restore(oldValue.length - newValue.length);
910
+ }, () => bak.restore(displayValueRef.value.length - newValue.length));
911
+ valueModel.value = latestNumber;
912
+ });
913
+ return (_ctx, _cache) => {
914
+ return openBlock(), createElementBlock("div", {
915
+ class: normalizeClass(["snail-number", {
916
+ "has-prefix": unref(hasPrefix),
917
+ "has-suffix": unref(hasSuffix)
918
+ }])
919
+ }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [createElementVNode("span", {
920
+ class: "ellipsis",
921
+ textContent: toDisplayString(unref(prefix))
922
+ }, null, 8, _hoisted_2$8)])) : createCommentVNode("", true), createElementVNode("div", {
923
+ class: normalizeClass(["input-panel", unref(controls)])
924
+ }, [withDirectives(createElementVNode("input", {
925
+ type: "text",
926
+ ref: "input",
927
+ inputmode: unref(precision) > 0 ? "decimal" : "numeric",
928
+ placeholder: unref(readonly) ? "" : __props.placeholder,
929
+ title: displayValueRef.value,
930
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => displayValueRef.value = $event),
931
+ onFocus: _cache[1] || (_cache[1] = $event => isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
932
+ onPaste: _cache[2] || (_cache[2] = $event => isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
933
+ onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
934
+ }, null, 40, _hoisted_3$5), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
935
+ key: 0
936
+ }, [createElementVNode("div", {
937
+ class: "controls default subtract",
938
+ onClick: _cache[4] || (_cache[4] = $event => onStepClick(false))
939
+ }, [createVNode(_sfc_main$w, {
940
+ type: "subtract",
941
+ size: 20
942
+ })]), createElementVNode("div", {
943
+ class: "controls default plus",
944
+ onClick: _cache[5] || (_cache[5] = $event => onStepClick(true))
945
+ }, [createVNode(_sfc_main$w, {
946
+ type: "plus",
947
+ size: 20
948
+ })])], 64)) : unref(controls) == "right" ? (openBlock(), createElementBlock(Fragment, {
949
+ key: 1
950
+ }, [createElementVNode("div", {
951
+ class: "controls right plus",
952
+ onClick: _cache[6] || (_cache[6] = $event => onStepClick(true))
953
+ }, [createVNode(_sfc_main$w, {
954
+ type: "arrow",
955
+ size: 20,
956
+ rotate: 270
957
+ })]), createElementVNode("div", {
958
+ class: "controls right subtract",
959
+ onClick: _cache[7] || (_cache[7] = $event => onStepClick(false))
960
+ }, [createVNode(_sfc_main$w, {
961
+ type: "arrow",
962
+ size: 20,
963
+ rotate: 90
964
+ })])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [createElementVNode("span", {
965
+ class: "ellipsis",
966
+ textContent: toDisplayString(unref(suffix))
967
+ }, null, 8, _hoisted_5$1)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
968
+ key: 2,
969
+ class: "number-util ellipsis",
970
+ title: upperTextRef.value,
971
+ textContent: toDisplayString(`大写:${upperTextRef.value || ""}`)
972
+ }, null, 8, _hoisted_6)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
973
+ key: 3,
974
+ class: "number-util ellipsis",
975
+ title: thousandsTextRef.value,
976
+ textContent: toDisplayString(`千分位:${thousandsTextRef.value || ""}`)
977
+ }, null, 8, _hoisted_7)) : createCommentVNode("", true)], 2);
978
+ };
979
+ }
980
+ });
981
+
982
+ const _hoisted_1$c = ["placeholder", "readonly"];
556
983
  const searchIon = "M 860.16 824.32 l -163.84 -163.84 c 102.4 -120.32 97.28 -302.08 -17.92 -414.72 c -120.32 -120.32 -314.88 -120.32 -435.2 0 c -120.32 120.32 -120.32 314.88 0 435.2 c 112.64 112.64 294.4 120.32 414.72 17.92 l 163.84 163.84 c 10.24 10.24 25.6 10.24 35.84 0 c 12.8 -12.8 12.8 -28.16 2.56 -38.4 Z M 281.6 642.56 C 181.76 542.72 181.76 381.44 281.6 281.6 c 99.84 -99.84 261.12 -99.84 360.96 0 c 99.84 99.84 99.84 261.12 0 360.96 c -99.84 102.4 -261.12 102.4 -360.96 0 Z";
557
- var _sfc_main$n = defineComponent({
984
+ var _sfc_main$p = defineComponent({
558
985
  ...{
559
986
  name: "Search",
560
987
  inheritAttrs: true
@@ -599,9 +1026,9 @@ var _sfc_main$n = defineComponent({
599
1026
  readonly: __props.readonly,
600
1027
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
601
1028
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
602
- }, null, 40, _hoisted_1$b), [[vModelText, textModel.value, void 0, {
1029
+ }, null, 40, _hoisted_1$c), [[vModelText, textModel.value, void 0, {
603
1030
  trim: true
604
- }]]), createElementVNode("div", null, [createVNode(_sfc_main$t, {
1031
+ }]]), createElementVNode("div", null, [createVNode(_sfc_main$w, {
605
1032
  class: "search-button",
606
1033
  type: "custom",
607
1034
  draw: searchIon,
@@ -822,11 +1249,11 @@ function deducePosition(strategy, targetStart, targetEnd, contentSize, clientSiz
822
1249
  }
823
1250
  }
824
1251
 
825
- const _hoisted_1$a = {
1252
+ const _hoisted_1$b = {
826
1253
  class: "snail-confirm flex-column"
827
1254
  };
828
1255
  const _hoisted_2$7 = ["innerHTML"];
829
- var _sfc_main$m = defineComponent({
1256
+ var _sfc_main$o = defineComponent({
830
1257
  ...{
831
1258
  name: "ConfirmContainer",
832
1259
  inheritAttrs: true
@@ -853,14 +1280,14 @@ var _sfc_main$m = defineComponent({
853
1280
  },
854
1281
  setup(__props) {
855
1282
  return (_ctx, _cache) => {
856
- return openBlock(), createElementBlock("div", _hoisted_1$a, [createVNode(_sfc_main$p, {
1283
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [createVNode(_sfc_main$s, {
857
1284
  "use-to": "dialog",
858
1285
  title: __props.title || "提示",
859
1286
  onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
860
1287
  }, null, 8, ["title"]), createElementVNode("div", {
861
1288
  class: "confirm-body",
862
1289
  innerHTML: __props.message || "请确认?"
863
- }, null, 8, _hoisted_2$7), createVNode(_sfc_main$q, {
1290
+ }, null, 8, _hoisted_2$7), createVNode(_sfc_main$t, {
864
1291
  align: "right",
865
1292
  "cancel-name": __props.cancelName,
866
1293
  "cancel-disabled": __props.cancelDisabled,
@@ -873,7 +1300,7 @@ var _sfc_main$m = defineComponent({
873
1300
  }
874
1301
  });
875
1302
 
876
- var _sfc_main$l = defineComponent({
1303
+ var _sfc_main$n = defineComponent({
877
1304
  ...{
878
1305
  name: "Loading",
879
1306
  inheritAttrs: true
@@ -912,44 +1339,7 @@ var _sfc_main$l = defineComponent({
912
1339
  }
913
1340
  });
914
1341
 
915
- function useReactive() {
916
- function transition(rv, effect, time) {
917
- throwIfFalse(isObject(effect), "transition: effect must be an object.");
918
- const scope = scopes.get();
919
- rv.value = effect.from;
920
- const endId = setTimeout(scope.destroy, time);
921
- return scope.onDestroy(function () {
922
- rv.value = effect.to;
923
- clearTimeout(endId);
924
- });
925
- }
926
- function load(task, status, delay) {
927
- throwIfFalse(isPromise(task), "task: task must be a Promise.");
928
- status.value = true;
929
- task.finally(function () {
930
- delay > 0 ? setTimeout(() => status.value = false, delay) : status.value = false;
931
- });
932
- return wait(task);
933
- }
934
- function watcher(source, callback, deep) {
935
- const {
936
- stop
937
- } = watch(source, callback, {
938
- deep
939
- });
940
- return scopes.get().onDestroy(stop);
941
- }
942
- const manager = mountScope({
943
- transition,
944
- load,
945
- watcher
946
- }, "IReactiveManager");
947
- const scopes = useScopes();
948
- manager.onDestroy(scopes.destroy);
949
- return Object.freeze(manager);
950
- }
951
-
952
- var _sfc_main$k = defineComponent({
1342
+ var _sfc_main$m = defineComponent({
953
1343
  ...{
954
1344
  name: "Dynamic",
955
1345
  inheritAttrs: false
@@ -968,11 +1358,27 @@ var _sfc_main$k = defineComponent({
968
1358
  watcher
969
1359
  } = useReactive();
970
1360
  const componentRef = ref(null);
971
- const dynamicComponentRef = shallowRef(void 0);
972
- const dynamicErrorRef = shallowRef(void 0);
1361
+ const dynamicComponentRef = shallowRef();
1362
+ const errorRef = shallowRef(void 0);
1363
+ const loadingComponent = defineComponent({
1364
+ inheritAttrs: false,
1365
+ components: {
1366
+ Loading: _sfc_main$n
1367
+ },
1368
+ template: "<Loading :mask-disabled='true' />"
1369
+ });
1370
+ const errorComponent = defineComponent({
1371
+ inheritAttrs: false,
1372
+ template: `<div class="snail-dynamic-error">load component error:<span v-text="error" /></div>`,
1373
+ data() {
1374
+ return {
1375
+ error: errorRef
1376
+ };
1377
+ }
1378
+ });
973
1379
  async function buildDynamicComponent() {
974
- dynamicComponentRef.value = void 0;
975
- dynamicErrorRef.value = void 0;
1380
+ dynamicComponentRef.value = loadingComponent;
1381
+ errorRef.value = void 0;
976
1382
  if (isStringNotEmpty(__props.name) == true) {
977
1383
  dynamicComponentRef.value = __props.name;
978
1384
  return;
@@ -986,19 +1392,20 @@ var _sfc_main$k = defineComponent({
986
1392
  await delay(200);
987
1393
  try {
988
1394
  const comp = await task;
989
- isObject(comp) || isStringNotEmpty(comp) ? dynamicComponentRef.value = comp : dynamicErrorRef.value = `load component failed:return nulll or undefined. url:${__props.url}.`;
1395
+ isObject(comp) || isStringNotEmpty(comp) ? dynamicComponentRef.value = comp : errorRef.value = `load component failed:return nulll or undefined. url:${__props.url}.`;
990
1396
  } catch (ex) {
991
1397
  dynamicComponentRef.value = void 0;
992
- dynamicErrorRef.value = ex.message;
1398
+ errorRef.value = ex.message;
993
1399
  }
994
1400
  } else {
995
- dynamicErrorRef.value = "load error: name component、url are all empty.";
1401
+ errorRef.value = "load error: name component、url are all empty.";
996
1402
  }
997
1403
  }
998
1404
  {
999
1405
  watcher(() => __props.name, buildDynamicComponent);
1000
1406
  watcher(() => __props.component, buildDynamicComponent);
1001
1407
  watcher(() => __props.url, buildDynamicComponent);
1408
+ watcher(errorRef, () => isStringNotEmpty(errorRef.value) && (dynamicComponentRef.value = errorComponent));
1002
1409
  buildDynamicComponent();
1003
1410
  }
1004
1411
  onErrorCaptured((error, vm, info) => {
@@ -1008,7 +1415,7 @@ var _sfc_main$k = defineComponent({
1008
1415
  }
1009
1416
  });
1010
1417
  return (_ctx, _cache) => {
1011
- return openBlock(), createElementBlock(Fragment, null, [(openBlock(), createBlock(resolveDynamicComponent(dynamicComponentRef.value), mergeProps({
1418
+ return openBlock(), createBlock(resolveDynamicComponent(dynamicComponentRef.value), mergeProps({
1012
1419
  ref_key: "componentRef",
1013
1420
  ref: componentRef
1014
1421
  }, __props.props, _ctx.$attrs), createSlots({
@@ -1016,21 +1423,14 @@ var _sfc_main$k = defineComponent({
1016
1423
  }, [renderList(_ctx.$slots, (_, name) => {
1017
1424
  return {
1018
1425
  name,
1019
- fn: withCtx(slotData => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotData)))])
1426
+ fn: withCtx(slotData => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotData == void 0 ? {} : slotData)))])
1020
1427
  };
1021
- })]), 1040)), dynamicErrorRef.value != void 0 ? (openBlock(), createElementBlock("div", mergeProps({
1022
- key: 0,
1023
- class: "snail-dynamic-error"
1024
- }, _ctx.$attrs), [_cache[0] || (_cache[0] = createTextVNode(" load component error:", -1)), createElementVNode("span", null, toDisplayString(dynamicErrorRef.value), 1)], 16)) : dynamicComponentRef.value == void 0 ? (openBlock(), createBlock(_sfc_main$l, {
1025
- key: 1,
1026
- show: true,
1027
- "mask-disabled": true
1028
- })) : createCommentVNode("", true)], 64);
1428
+ })]), 1040);
1029
1429
  };
1030
1430
  }
1031
1431
  });
1032
1432
 
1033
- var _sfc_main$j = defineComponent({
1433
+ var _sfc_main$l = defineComponent({
1034
1434
  ...{
1035
1435
  name: "DialogContainer",
1036
1436
  inheritAttrs: true
@@ -1075,7 +1475,7 @@ var _sfc_main$j = defineComponent({
1075
1475
  onClick: _cache[1] || (_cache[1] = withModifiers($event => {
1076
1476
  __props.options.closeOnMask && unref(closePopup)();
1077
1477
  }, ["self"]))
1078
- }, [createVNode(_sfc_main$k, mergeProps({
1478
+ }, [createVNode(_sfc_main$m, mergeProps({
1079
1479
  class: "dialog-body",
1080
1480
  name: __props.options.name,
1081
1481
  component: __props.options.component,
@@ -1089,7 +1489,7 @@ var _sfc_main$j = defineComponent({
1089
1489
  }
1090
1490
  });
1091
1491
 
1092
- var _sfc_main$i = defineComponent({
1492
+ var _sfc_main$k = defineComponent({
1093
1493
  ...{
1094
1494
  name: "FollowContainer",
1095
1495
  inheritAttrs: true
@@ -1202,7 +1602,7 @@ var _sfc_main$i = defineComponent({
1202
1602
  });
1203
1603
  });
1204
1604
  return (_ctx, _cache) => {
1205
- return openBlock(), createBlock(_sfc_main$k, mergeProps({
1605
+ return openBlock(), createBlock(_sfc_main$m, mergeProps({
1206
1606
  class: ["snail-follow initial", [__props.popupStatus.value, __props.popupTransition.value]],
1207
1607
  style: {
1208
1608
  "z-index": __props.zIndex
@@ -1219,7 +1619,7 @@ var _sfc_main$i = defineComponent({
1219
1619
  }
1220
1620
  });
1221
1621
 
1222
- var _sfc_main$h = defineComponent({
1622
+ var _sfc_main$j = defineComponent({
1223
1623
  ...{
1224
1624
  name: "PopupContainer",
1225
1625
  inheritAttrs: true
@@ -1239,7 +1639,7 @@ var _sfc_main$h = defineComponent({
1239
1639
  model = shallowRef(void 0)
1240
1640
  } = __props.options;
1241
1641
  return (_ctx, _cache) => {
1242
- return openBlock(), createBlock(_sfc_main$k, mergeProps({
1642
+ return openBlock(), createBlock(_sfc_main$m, mergeProps({
1243
1643
  class: ["snail-popup", [__props.popupStatus.value, __props.popupTransition.value]],
1244
1644
  style: {
1245
1645
  "z-index": __props.zIndex
@@ -1256,12 +1656,12 @@ var _sfc_main$h = defineComponent({
1256
1656
  }
1257
1657
  });
1258
1658
 
1259
- const _hoisted_1$9 = {
1260
- key: 0,
1659
+ const _hoisted_1$a = {
1660
+ key: 1,
1261
1661
  class: "icon"
1262
1662
  };
1263
1663
  const _hoisted_2$6 = ["innerHTML"];
1264
- var _sfc_main$g = defineComponent({
1664
+ var _sfc_main$i = defineComponent({
1265
1665
  ...{
1266
1666
  name: "ToastContainer",
1267
1667
  inheritAttrs: true
@@ -1279,15 +1679,16 @@ var _sfc_main$g = defineComponent({
1279
1679
  const {
1280
1680
  onTimeout
1281
1681
  } = useTimer();
1682
+ const props = __props.options.props;
1282
1683
  const {
1283
1684
  closePopup
1284
1685
  } = __props.extOptions;
1285
- const props = __props.options.props;
1686
+ const duration = props.duration > 0 ? props.duration : 1500;
1286
1687
  const closeFillRef = ref("#707070");
1287
1688
  var destroyTimer;
1288
1689
  function onMouseEvent(isLeave) {
1289
1690
  destroyTimer && destroyTimer.destroy();
1290
- destroyTimer = isLeave ? onTimeout(closePopup, 1500) : void 0;
1691
+ destroyTimer = isLeave ? onTimeout(closePopup, duration) : void 0;
1291
1692
  }
1292
1693
  onMounted(() => onMouseEvent(true));
1293
1694
  return (_ctx, _cache) => {
@@ -1298,9 +1699,10 @@ var _sfc_main$g = defineComponent({
1298
1699
  }),
1299
1700
  onMouseenter: _cache[3] || (_cache[3] = $event => onMouseEvent(false)),
1300
1701
  onMouseleave: _cache[4] || (_cache[4] = $event => onMouseEvent(true))
1301
- }, [createVNode(_sfc_main$t, {
1302
- type: "close",
1702
+ }, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$w, {
1703
+ key: 0,
1303
1704
  class: "close-icon",
1705
+ type: "close",
1304
1706
  fill: closeFillRef.value,
1305
1707
  size: 20,
1306
1708
  onMouseenter: _cache[0] || (_cache[0] = $event => closeFillRef.value = "red"),
@@ -1308,7 +1710,7 @@ var _sfc_main$g = defineComponent({
1308
1710
  onClick: _cache[2] || (_cache[2] = $event => {
1309
1711
  unref(closePopup)();
1310
1712
  })
1311
- }, null, 8, ["fill"]), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$9, [createVNode(_sfc_main$t, {
1713
+ }, null, 8, ["fill"])) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$a, [createVNode(_sfc_main$w, {
1312
1714
  type: unref(props).type,
1313
1715
  fill: "#707070",
1314
1716
  size: 20
@@ -1322,7 +1724,7 @@ var _sfc_main$g = defineComponent({
1322
1724
 
1323
1725
  function usePopup() {
1324
1726
  function popup(options) {
1325
- const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$h, options);
1727
+ const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$j, options);
1326
1728
  return addScope2Scopes(scope);
1327
1729
  }
1328
1730
  function dialog(options) {
@@ -1355,7 +1757,7 @@ function usePopup() {
1355
1757
  },
1356
1758
  onBeforeClose: fn => hook.register("onBeforeClose", fn)
1357
1759
  });
1358
- const descriptor = openPopup(_sfc_main$j, options, extOptions);
1760
+ const descriptor = openPopup(_sfc_main$l, options, extOptions);
1359
1761
  scope = useAsyncScope(deferred.promise);
1360
1762
  monitorDialog(descriptor, scope, deferred);
1361
1763
  }
@@ -1373,14 +1775,14 @@ function usePopup() {
1373
1775
  inPopup: "follow",
1374
1776
  target
1375
1777
  };
1376
- scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$i, options, extOptions);
1778
+ scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$k, options, extOptions);
1377
1779
  }
1378
1780
  return addScope2Scopes(scope);
1379
1781
  }
1380
1782
  function confirm(title, message, options) {
1381
1783
  options = options || Object.create(null);
1382
1784
  return dialog({
1383
- component: _sfc_main$m,
1785
+ component: _sfc_main$o,
1384
1786
  closeOnEscape: true,
1385
1787
  props: {
1386
1788
  ...options,
@@ -1390,7 +1792,7 @@ function usePopup() {
1390
1792
  });
1391
1793
  }
1392
1794
  function toast(type, message, options) {
1393
- return popupInCustomContainer(_sfc_main$g, {
1795
+ return popupInCustomContainer(_sfc_main$i, {
1394
1796
  url: "#ToastContainer",
1395
1797
  props: {
1396
1798
  ...(options || Object.create(null)),
@@ -1423,7 +1825,7 @@ function usePopup() {
1423
1825
  },
1424
1826
  ...extOptions
1425
1827
  });
1426
- const descriptor = openPopup(container || _sfc_main$h, options, extOptions);
1828
+ const descriptor = openPopup(container || _sfc_main$j, options, extOptions);
1427
1829
  const scope = useAsyncScope(deferred.promise);
1428
1830
  scope.onDestroy(() => destroyPopup(descriptor, deferred));
1429
1831
  return scope;
@@ -1561,12 +1963,12 @@ function getNoDataBase64Image() {
1561
1963
  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==";
1562
1964
  }
1563
1965
 
1564
- const _hoisted_1$8 = {
1966
+ const _hoisted_1$9 = {
1565
1967
  class: "snail-empty"
1566
1968
  };
1567
1969
  const _hoisted_2$5 = ["src"];
1568
1970
  const _hoisted_3$4 = ["textContent"];
1569
- var _sfc_main$f = defineComponent({
1971
+ var _sfc_main$h = defineComponent({
1570
1972
  ...{
1571
1973
  name: "Empty",
1572
1974
  inheritAttrs: true
@@ -1579,7 +1981,7 @@ var _sfc_main$f = defineComponent({
1579
1981
  setup(__props) {
1580
1982
  const defaultImageBase64 = getNoDataBase64Image();
1581
1983
  return (_ctx, _cache) => {
1582
- return openBlock(), createElementBlock("div", _hoisted_1$8, [createElementVNode("img", {
1984
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [createElementVNode("img", {
1583
1985
  src: __props.imageUrl || unref(defaultImageBase64)
1584
1986
  }, null, 8, _hoisted_2$5), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1585
1987
  class: "message",
@@ -1589,13 +1991,13 @@ var _sfc_main$f = defineComponent({
1589
1991
  }
1590
1992
  });
1591
1993
 
1592
- const _hoisted_1$7 = ["title"];
1994
+ const _hoisted_1$8 = ["title"];
1593
1995
  const _hoisted_2$4 = ["textContent"];
1594
1996
  const _hoisted_3$3 = {
1595
1997
  key: 1,
1596
1998
  class: "select-status"
1597
1999
  };
1598
- var _sfc_main$e = defineComponent({
2000
+ var _sfc_main$g = defineComponent({
1599
2001
  ...{
1600
2002
  name: "SelectNode",
1601
2003
  inheritAttrs: true
@@ -1640,15 +2042,15 @@ var _sfc_main$e = defineComponent({
1640
2042
  }, [createElementVNode("div", {
1641
2043
  class: "item-text ellipsis",
1642
2044
  textContent: toDisplayString(__props.item.text)
1643
- }, null, 8, _hoisted_2$4), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$t, {
2045
+ }, null, 8, _hoisted_2$4), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$w, {
1644
2046
  key: 0,
1645
2047
  type: "arrow",
1646
2048
  color: "#8a9099"
1647
- })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$3, [createVNode(_sfc_main$t, {
2049
+ })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$3, [createVNode(_sfc_main$w, {
1648
2050
  type: "success",
1649
2051
  color: "white",
1650
2052
  size: 12
1651
- })])) : createCommentVNode("", true)], 42, _hoisted_1$7)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2053
+ })])) : createCommentVNode("", true)], 42, _hoisted_1$8)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
1652
2054
  key: 1
1653
2055
  }, renderList(unref(showChildrenRef), child => {
1654
2056
  return openBlock(), createBlock(_component_SelectNode, {
@@ -1665,7 +2067,7 @@ var _sfc_main$e = defineComponent({
1665
2067
  }
1666
2068
  });
1667
2069
 
1668
- var _sfc_main$d = defineComponent({
2070
+ var _sfc_main$f = defineComponent({
1669
2071
  ...{
1670
2072
  name: "Select2Popup",
1671
2073
  inheritAttrs: true
@@ -1837,13 +2239,13 @@ var _sfc_main$d = defineComponent({
1837
2239
  key: 0
1838
2240
  }, [createTextVNode(" 暂无选项 ")], 64)) : (openBlock(), createElementBlock(Fragment, {
1839
2241
  key: 1
1840
- }, [__props.search ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
2242
+ }, [__props.search ? (openBlock(), createBlock(_sfc_main$p, mergeProps({
1841
2243
  key: 0
1842
2244
  }, __props.search, {
1843
2245
  onSearch,
1844
2246
  key: "select-search"
1845
2247
  }), null, 16)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
1846
- return openBlock(), createBlock(_sfc_main$e, {
2248
+ return openBlock(), createBlock(_sfc_main$g, {
1847
2249
  key: unref(context).getKey(item),
1848
2250
  multiple: __props.multiple,
1849
2251
  item,
@@ -1852,7 +2254,7 @@ var _sfc_main$d = defineComponent({
1852
2254
  onEnter: onEnterSelectNode,
1853
2255
  onClick: onClickSelectNode
1854
2256
  }, null, 8, ["multiple", "item", "context"]);
1855
- }), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$f, {
2257
+ }), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$h, {
1856
2258
  key: 1,
1857
2259
  message: "无结果"
1858
2260
  })) : createCommentVNode("", true), showClearButtonRef.value ? (openBlock(), createElementBlock("div", {
@@ -1864,7 +2266,7 @@ var _sfc_main$d = defineComponent({
1864
2266
  }
1865
2267
  });
1866
2268
 
1867
- const _hoisted_1$6 = {
2269
+ const _hoisted_1$7 = {
1868
2270
  key: 0,
1869
2271
  class: "select-result"
1870
2272
  };
@@ -1875,9 +2277,9 @@ const _hoisted_4$2 = {
1875
2277
  class: "placeholder"
1876
2278
  };
1877
2279
  onAppCreated((app, type) => {
1878
- type == "popup" && app.component("SelectPopup", _sfc_main$d);
2280
+ type == "popup" && app.component("SelectPopup", _sfc_main$f);
1879
2281
  });
1880
- var _sfc_main$c = defineComponent({
2282
+ var _sfc_main$e = defineComponent({
1881
2283
  ...{
1882
2284
  name: "Select",
1883
2285
  inheritAttrs: true
@@ -2009,7 +2411,7 @@ var _sfc_main$c = defineComponent({
2009
2411
  ref: "select"
2010
2412
  }, [__props.items && __props.items.length ? (openBlock(), createElementBlock(Fragment, {
2011
2413
  key: 0
2012
- }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2414
+ }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$7, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2013
2415
  class: "select-text ellipsis",
2014
2416
  title: selectedTextRef.value,
2015
2417
  textContent: toDisplayString(selectedTextRef.value)
@@ -2017,7 +2419,7 @@ var _sfc_main$c = defineComponent({
2017
2419
  key: 1,
2018
2420
  class: "placeholder",
2019
2421
  textContent: toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
2020
- }, null, 8, _hoisted_3$2)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$t, {
2422
+ }, null, 8, _hoisted_3$2)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$w, {
2021
2423
  key: 2,
2022
2424
  type: "arrow",
2023
2425
  size: 24,
@@ -2030,7 +2432,7 @@ var _sfc_main$c = defineComponent({
2030
2432
  }
2031
2433
  });
2032
2434
 
2033
- var _sfc_main$b = defineComponent({
2435
+ var _sfc_main$d = defineComponent({
2034
2436
  ...{
2035
2437
  name: "Switch",
2036
2438
  inheritAttrs: true
@@ -2079,6 +2481,72 @@ var _sfc_main$b = defineComponent({
2079
2481
  }
2080
2482
  });
2081
2483
 
2484
+ const _hoisted_1$6 = ["readonly", "placeholder", "rows"];
2485
+ var _sfc_main$c = defineComponent({
2486
+ ...{
2487
+ name: "Textarea"
2488
+ },
2489
+ __name: "textarea",
2490
+ props: mergeModels({
2491
+ readonly: {
2492
+ type: Boolean
2493
+ },
2494
+ placeholder: {},
2495
+ autoHeight: {
2496
+ type: Boolean
2497
+ },
2498
+ minRows: {},
2499
+ maxRows: {}
2500
+ }, {
2501
+ "modelValue": {
2502
+ default: void 0
2503
+ },
2504
+ "modelModifiers": {}
2505
+ }),
2506
+ emits: mergeModels(["focus", "input", "blur", "change"], ["update:modelValue"]),
2507
+ setup(__props, _ref) {
2508
+ let {
2509
+ emit: __emit
2510
+ } = _ref;
2511
+ const props = __props;
2512
+ const emits = __emit;
2513
+ const valueModel = useModel(__props, "modelValue");
2514
+ const textareaDom = useTemplateRef("textarea");
2515
+ const minRows = props.minRows > 0 ? props.minRows : 4;
2516
+ const maxRows = props.maxRows > 0 ? props.maxRows : 10;
2517
+ const rowsRef = shallowRef(minRows);
2518
+ async function calcRows() {
2519
+ if (textareaDom.value) {
2520
+ rowsRef.value = 1;
2521
+ await nextTick();
2522
+ const style = window.getComputedStyle(textareaDom.value);
2523
+ let lineHeight = parseFloat(style.lineHeight);
2524
+ isNaN(lineHeight) && (lineHeight = parseFloat(style.fontSize) * 1.2);
2525
+ const vPadding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
2526
+ const rows = Math.trunc((textareaDom.value.scrollHeight - vPadding) / lineHeight);
2527
+ rowsRef.value = Math.max(minRows, Math.min(maxRows, rows));
2528
+ }
2529
+ requestAnimationFrame(calcRows);
2530
+ }
2531
+ props.autoHeight == true && onMounted(calcRows);
2532
+ return (_ctx, _cache) => {
2533
+ return withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
2534
+ class: "snail-textarea",
2535
+ ref: "textarea"
2536
+ }, _ctx.$attrs, {
2537
+ readonly: __props.readonly,
2538
+ placeholder: __props.placeholder,
2539
+ rows: rowsRef.value,
2540
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => valueModel.value = $event),
2541
+ onFocus: _cache[1] || (_cache[1] = $event => emits("focus")),
2542
+ onInput: _cache[2] || (_cache[2] = $event => emits("input", textareaDom.value.value)),
2543
+ onBlur: _cache[3] || (_cache[3] = $event => emits("blur", textareaDom.value.value)),
2544
+ onChange: _cache[4] || (_cache[4] = $event => emits("change", textareaDom.value.value))
2545
+ }), null, 16, _hoisted_1$6)), [[vModelText, valueModel.value]]);
2546
+ };
2547
+ }
2548
+ });
2549
+
2082
2550
  const _hoisted_1$5 = {
2083
2551
  class: "fold-header"
2084
2552
  };
@@ -2092,7 +2560,7 @@ const _hoisted_5 = {
2092
2560
  class: "fold-body",
2093
2561
  ref: "foldBody"
2094
2562
  };
2095
- var _sfc_main$a = defineComponent({
2563
+ var _sfc_main$b = defineComponent({
2096
2564
  ...{
2097
2565
  name: "Fold",
2098
2566
  inheritAttrs: true
@@ -2169,7 +2637,7 @@ var _sfc_main$a = defineComponent({
2169
2637
  key: 0,
2170
2638
  class: "subtitle ellipsis",
2171
2639
  textContent: toDisplayString(__props.subtitle)
2172
- }, null, 8, _hoisted_3$1)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$1, [createVNode(_sfc_main$t, {
2640
+ }, null, 8, _hoisted_3$1)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$1, [createVNode(_sfc_main$w, {
2173
2641
  type: "arrow",
2174
2642
  title: statusModel.value == "expand" ? "收起" : "展开",
2175
2643
  onClick: onStatusClick
@@ -2178,7 +2646,7 @@ var _sfc_main$a = defineComponent({
2178
2646
  }
2179
2647
  });
2180
2648
 
2181
- var _sfc_main$9 = defineComponent({
2649
+ var _sfc_main$a = defineComponent({
2182
2650
  ...{
2183
2651
  name: "Scroll",
2184
2652
  inheritAttrs: true
@@ -2303,7 +2771,7 @@ const _hoisted_2$1 = {
2303
2771
  key: 1,
2304
2772
  class: "layout-end"
2305
2773
  };
2306
- var _sfc_main$8 = defineComponent({
2774
+ var _sfc_main$9 = defineComponent({
2307
2775
  __name: "layout",
2308
2776
  props: {
2309
2777
  mode: {},
@@ -2313,7 +2781,7 @@ var _sfc_main$8 = defineComponent({
2313
2781
  return (_ctx, _cache) => {
2314
2782
  return openBlock(), createElementBlock("div", {
2315
2783
  class: normalizeClass(["snail-layout", __props.mode])
2316
- }, [_ctx.$slots.start ? (openBlock(), createElementBlock("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "start")])) : createCommentVNode("", true), createVNode(_sfc_main$9, mergeProps({
2784
+ }, [_ctx.$slots.start ? (openBlock(), createElementBlock("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "start")])) : createCommentVNode("", true), createVNode(_sfc_main$a, mergeProps({
2317
2785
  class: "layout-body"
2318
2786
  }, __props.scroll), {
2319
2787
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
@@ -2323,7 +2791,7 @@ var _sfc_main$8 = defineComponent({
2323
2791
  }
2324
2792
  });
2325
2793
 
2326
- var _sfc_main$7 = defineComponent({
2794
+ var _sfc_main$8 = defineComponent({
2327
2795
  ...{
2328
2796
  name: "Sort",
2329
2797
  inheritAttrs: true
@@ -2345,7 +2813,7 @@ var _sfc_main$7 = defineComponent({
2345
2813
  type: Boolean
2346
2814
  }
2347
2815
  },
2348
- emits: ["start", "add", "remove", "end", "update"],
2816
+ emits: ["start", "move", "add", "remove", "end", "update"],
2349
2817
  setup(__props, _ref) {
2350
2818
  let {
2351
2819
  emit: __emit
@@ -2376,6 +2844,14 @@ var _sfc_main$7 = defineComponent({
2376
2844
  };
2377
2845
  isStringNotEmpty(props.group) ? group.name = props.group : isObject(props.group) && Object.assign(group, props.group);
2378
2846
  group.name || (group.name = newId());
2847
+ if (typeof group.pull == "function") {
2848
+ const orign = group.pull;
2849
+ group.pull = (to, from, item) => orign(item, to.el, from.el);
2850
+ }
2851
+ if (typeof group.put == "function") {
2852
+ const orign = group.put;
2853
+ group.put = (to, from, item) => orign(item, to.el, from.el);
2854
+ }
2379
2855
  sortInstance = new MODULE_Sortable(sortPanel, {
2380
2856
  group,
2381
2857
  sort: props.sortDisabled != true,
@@ -2389,9 +2865,10 @@ var _sfc_main$7 = defineComponent({
2389
2865
  forceFallback: true,
2390
2866
  fallbackTolerance: 2,
2391
2867
  onStart: evt => emits("start", evt),
2868
+ onMove: (evt, originalEvent) => emits("move", evt, originalEvent),
2392
2869
  onAdd: evt => emits("add", evt),
2393
2870
  onRemove: evt => emits("remove", evt),
2394
- onEnd: evt => emits("add", evt),
2871
+ onEnd: evt => emits("end", evt),
2395
2872
  onUpdate: evt => emits("update", evt.oldIndex, evt.newIndex)
2396
2873
  });
2397
2874
  }
@@ -2418,7 +2895,7 @@ var _sfc_main$7 = defineComponent({
2418
2895
  const _hoisted_1$3 = {
2419
2896
  class: "table-body"
2420
2897
  };
2421
- var _sfc_main$6 = defineComponent({
2898
+ var _sfc_main$7 = defineComponent({
2422
2899
  ...{
2423
2900
  name: "Table",
2424
2901
  inheritAttrs: true
@@ -2442,7 +2919,7 @@ var _sfc_main$6 = defineComponent({
2442
2919
  const hStyleRef = computed(() => css.buildStyle(props.headerStyle));
2443
2920
  const fStyleRef = computed(() => css.buildStyle(props.footerStyle));
2444
2921
  return (_ctx, _cache) => {
2445
- return openBlock(), createBlock(_sfc_main$9, {
2922
+ return openBlock(), createBlock(_sfc_main$a, {
2446
2923
  class: normalizeClass(["snail-table", {
2447
2924
  "start-border": __props.border == true
2448
2925
  }]),
@@ -2462,7 +2939,7 @@ var _sfc_main$6 = defineComponent({
2462
2939
  }
2463
2940
  });
2464
2941
 
2465
- var _sfc_main$5 = defineComponent({
2942
+ var _sfc_main$6 = defineComponent({
2466
2943
  ...{
2467
2944
  name: "TableRow",
2468
2945
  inheritAttrs: true
@@ -2485,7 +2962,7 @@ var _sfc_main$5 = defineComponent({
2485
2962
  }
2486
2963
  });
2487
2964
 
2488
- var _sfc_main$4 = defineComponent({
2965
+ var _sfc_main$5 = defineComponent({
2489
2966
  ...{
2490
2967
  name: "TableCol",
2491
2968
  inheritAttrs: true
@@ -2531,6 +3008,43 @@ var _sfc_main$4 = defineComponent({
2531
3008
  }
2532
3009
  });
2533
3010
 
3011
+ var _sfc_main$4 = defineComponent({
3012
+ __name: "transitions",
3013
+ props: {
3014
+ customClass: {},
3015
+ effect: {},
3016
+ group: {
3017
+ type: Boolean
3018
+ }
3019
+ },
3020
+ setup(__props) {
3021
+ const props = __props;
3022
+ const classNames = computed(() => {
3023
+ const array = [props.customClass || "snail-transition"];
3024
+ if (isArray(props.effect)) {
3025
+ props.effect.length > 0 ? array.push(...props.effect) : array.push("fade");
3026
+ } else {
3027
+ array.push(props.effect || "fade");
3028
+ }
3029
+ return array.join(" ");
3030
+ });
3031
+ return (_ctx, _cache) => {
3032
+ return openBlock(), createBlock(resolveDynamicComponent(__props.group ? TransitionGroup : Transition), mergeProps(_ctx.$attrs, {
3033
+ appear: "",
3034
+ "enter-active-class": `${classNames.value} enter-active`,
3035
+ "enter-from-class": `${classNames.value} enter-from`,
3036
+ "enter-to-class": `${classNames.value} enter-to`,
3037
+ "leave-active-class": `${classNames.value} leave-active`,
3038
+ "leave-from-class": `${classNames.value} leave-from`,
3039
+ "leave-to-class": `${classNames.value} leave-to`
3040
+ }), {
3041
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3042
+ _: 3
3043
+ }, 16, ["enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]);
3044
+ };
3045
+ }
3046
+ });
3047
+
2534
3048
  const _hoisted_1$2 = {
2535
3049
  key: 0,
2536
3050
  class: "node-fold"
@@ -2662,7 +3176,7 @@ var _sfc_main$3 = defineComponent({
2662
3176
  key: 1
2663
3177
  }, [_cache[4] || (_cache[4] = createElementVNode("div", {
2664
3178
  class: "indent"
2665
- }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$2, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$t, {
3179
+ }, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$2, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$w, {
2666
3180
  key: 0,
2667
3181
  class: normalizeClass(statusRef.value),
2668
3182
  type: "custom",
@@ -2731,11 +3245,11 @@ var _sfc_main$2 = defineComponent({
2731
3245
  emits("click", node, parents);
2732
3246
  }
2733
3247
  return (_ctx, _cache) => {
2734
- return openBlock(), createElementBlock("div", _hoisted_1$1, [__props.search ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
3248
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [__props.search ? (openBlock(), createBlock(_sfc_main$p, mergeProps({
2735
3249
  key: 0
2736
3250
  }, __props.search, {
2737
3251
  onSearch
2738
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$9, {
3252
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$a, {
2739
3253
  "scroll-y": true
2740
3254
  }, {
2741
3255
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
@@ -2782,14 +3296,14 @@ var _sfc_main$1 = defineComponent({
2782
3296
  return (_ctx, _cache) => {
2783
3297
  return openBlock(), createElementBlock("div", {
2784
3298
  class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
2785
- }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$p, mergeProps({
3299
+ }, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$s, mergeProps({
2786
3300
  key: 0
2787
3301
  }, __props.header || {
2788
3302
  useTo: "dialog",
2789
3303
  title: "对话框"
2790
3304
  }, {
2791
3305
  onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
2792
- }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$9, mergeProps({
3306
+ }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$a, mergeProps({
2793
3307
  class: "wrapper-body"
2794
3308
  }, __props.content || {
2795
3309
  scrollX: false,
@@ -2797,7 +3311,7 @@ var _sfc_main$1 = defineComponent({
2797
3311
  }), {
2798
3312
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2799
3313
  _: 3
2800
- }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$q, mergeProps({
3314
+ }, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$t, mergeProps({
2801
3315
  key: 1
2802
3316
  }, __props.footer || {}, {
2803
3317
  onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
@@ -2811,7 +3325,7 @@ function mount(target, options, onDestroyed) {
2811
3325
  mustObject(options, "options");
2812
3326
  target instanceof HTMLElement || throwError("target must be a HTMLElement");
2813
3327
  target.classList.add("snail-app");
2814
- const app = createApp(_sfc_main$k, options);
3328
+ const app = createApp(_sfc_main$m, options);
2815
3329
  triggerAppCreated(app);
2816
3330
  app.mount(target);
2817
3331
  const scope = useScope().onDestroy(() => app.unmount());
@@ -2904,12 +3418,12 @@ var _sfc_main = defineComponent({
2904
3418
  onTouchstart: onStartDrag,
2905
3419
  onTouchmove: onDragMove,
2906
3420
  onTouchend: onDragEnd
2907
- }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$t, {
3421
+ }, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$w, {
2908
3422
  key: 0,
2909
3423
  type: "success",
2910
3424
  size: 20,
2911
3425
  color: "white"
2912
- })) : (openBlock(), createBlock(_sfc_main$t, {
3426
+ })) : (openBlock(), createBlock(_sfc_main$w, {
2913
3427
  key: 1,
2914
3428
  type: "custom",
2915
3429
  size: 20,
@@ -2921,29 +3435,32 @@ var _sfc_main = defineComponent({
2921
3435
  });
2922
3436
 
2923
3437
  const components = {
2924
- Button: _sfc_main$u,
2925
- Choose: _sfc_main$s,
2926
- DatePicker: _sfc_main$r,
2927
- Footer: _sfc_main$q,
2928
- Header: _sfc_main$p,
2929
- Icon: _sfc_main$t,
2930
- Search: _sfc_main$n,
2931
- Select: _sfc_main$c,
2932
- Switch: _sfc_main$b,
2933
- Dynamic: _sfc_main$k,
2934
- Fold: _sfc_main$a,
2935
- Layout: _sfc_main$8,
2936
- Scroll: _sfc_main$9,
2937
- Sort: _sfc_main$7,
2938
- Table: _sfc_main$6,
2939
- TableRow: _sfc_main$5,
2940
- TableCol: _sfc_main$4,
3438
+ Button: _sfc_main$x,
3439
+ Choose: _sfc_main$v,
3440
+ DatePicker: _sfc_main$u,
3441
+ Footer: _sfc_main$t,
3442
+ Header: _sfc_main$s,
3443
+ Icon: _sfc_main$w,
3444
+ Input: _sfc_main$r,
3445
+ Number: _sfc_main$q,
3446
+ Search: _sfc_main$p,
3447
+ Select: _sfc_main$e,
3448
+ Switch: _sfc_main$d,
3449
+ Textarea: _sfc_main$c,
3450
+ Dynamic: _sfc_main$m,
3451
+ Fold: _sfc_main$b,
3452
+ Layout: _sfc_main$9,
3453
+ Scroll: _sfc_main$a,
3454
+ Sort: _sfc_main$8,
3455
+ Table: _sfc_main$7,
3456
+ TableRow: _sfc_main$6,
3457
+ TableCol: _sfc_main$5,
3458
+ Transitions: _sfc_main$4,
2941
3459
  Tree: _sfc_main$2,
2942
3460
  Wrapper: _sfc_main$1,
2943
- Input: _sfc_main$o,
2944
3461
  DragVerify: _sfc_main,
2945
- Empty: _sfc_main$f,
2946
- Loading: _sfc_main$l
3462
+ Empty: _sfc_main$h,
3463
+ Loading: _sfc_main$n
2947
3464
  };
2948
3465
 
2949
3466
  onMountScope(scope => {