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