snail.vue 2.0.18 → 2.0.20

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,9 +1,9 @@
1
1
  //@ sourceURL=/snail.vue.js
2
- import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, computed, mergeProps, unref, createElementVNode, toDisplayString, Fragment, renderList, mergeModels, useModel, normalizeStyle, createCommentVNode, createBlock, nextTick, useTemplateRef, createVNode, watch, withDirectives, isRef, vModelText, withCtx, createApp, resolveDynamicComponent, TransitionGroup, Transition, normalizeProps, guardReactiveProps, ref, onErrorCaptured, createSlots, onMounted, withModifiers, getCurrentInstance, resolveComponent, onBeforeUnmount, onActivated, vShow, getCurrentScope, onScopeDispose } from 'vue';
2
+ import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, computed, mergeProps, unref, createElementVNode, toDisplayString, Fragment, renderList, mergeModels, useModel, normalizeStyle, createCommentVNode, createBlock, nextTick, useTemplateRef, createVNode, watch, withDirectives, isRef, vModelText, withCtx, createApp, resolveDynamicComponent, TransitionGroup, Transition, normalizeProps, guardReactiveProps, ref, onErrorCaptured, createSlots, onMounted, withModifiers, getCurrentInstance, resolveComponent, vShow, onBeforeUnmount, onActivated, getCurrentScope, onScopeDispose } from 'vue';
3
3
  import { throwError, isObject, correctNumber, correctString, useKey, isArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isNumberNotNaN, isStringNotEmpty, hasAny, mustFunction, useScope, removeFromArray, mustObject, isArrayNotEmpty, hasOwnProperty, isString, script, delay, useTimer, defer, useAsyncScope, useHook, newId, throwIfTrue, isFunction, isNullish, getTimeNumber, getDateValue, parseDate, formatDateValue, getDateByValue, parseTimeValue, getTimeValue, padStart, formatTimeValue, parseDateValue, correctDateFormat, isValidTime, getFromArray, onMountScope } from 'snail.core';
4
- import { link, css, useObserver, useAnimation } from 'snail.view';
4
+ import { css, link, useObserver, useScroll, useAnimation } from 'snail.view';
5
5
 
6
- const _hoisted_1$n = ["title"];
6
+ const _hoisted_1$m = ["title"];
7
7
  var _sfc_main$D = defineComponent({
8
8
  ...{
9
9
  name: "Button",
@@ -20,15 +20,11 @@ var _sfc_main$D = 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$n);
23
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮", -1))])], 10, _hoisted_1$m);
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
-
32
28
  function getBuiltinIcon(iconType) {
33
29
  switch (iconType) {
34
30
  case "success":
@@ -67,9 +63,9 @@ function getBuiltinIcon(iconType) {
67
63
  }
68
64
  }
69
65
 
70
- const _hoisted_1$m = ["viewBox"];
71
- const _hoisted_2$e = ["textContent"];
72
- const _hoisted_3$b = ["d"];
66
+ const _hoisted_1$l = ["viewBox"];
67
+ const _hoisted_2$d = ["textContent"];
68
+ const _hoisted_3$a = ["d"];
73
69
  var _sfc_main$C = defineComponent({
74
70
  __name: "icon",
75
71
  props: {
@@ -125,22 +121,22 @@ var _sfc_main$C = defineComponent({
125
121
  onMouseleave: _cache[1] || (_cache[1] = $event => isMouseEnterRef.value = false)
126
122
  }), [createElementVNode("title", {
127
123
  textContent: toDisplayString(__props.title || "")
128
- }, null, 8, _hoisted_2$e), __props.custom == true ? renderSlot(_ctx.$slots, "default", {
124
+ }, null, 8, _hoisted_2$d), __props.custom == true ? renderSlot(_ctx.$slots, "default", {
129
125
  key: 0
130
126
  }) : (openBlock(true), createElementBlock(Fragment, {
131
127
  key: 1
132
128
  }, renderList(unref(getBuiltinIcon)(__props.type), d => {
133
129
  return openBlock(), createElementBlock("path", {
134
130
  d
135
- }, null, 8, _hoisted_3$b);
136
- }), 256))], 16, _hoisted_1$m);
131
+ }, null, 8, _hoisted_3$a);
132
+ }), 256))], 16, _hoisted_1$l);
137
133
  };
138
134
  }
139
135
  });
140
136
 
141
- const _hoisted_1$l = ["title", "onClick"];
142
- const _hoisted_2$d = ["type", "checked"];
143
- const _hoisted_3$a = ["textContent"];
137
+ const _hoisted_1$k = ["title", "onClick"];
138
+ const _hoisted_2$c = ["type", "checked"];
139
+ const _hoisted_3$9 = ["textContent"];
144
140
  const _hoisted_4$7 = ["textContent"];
145
141
  var _sfc_main$B = defineComponent({
146
142
  ...{
@@ -218,7 +214,7 @@ var _sfc_main$B = defineComponent({
218
214
  key: 0,
219
215
  type: unref(type),
220
216
  checked: node.selected
221
- }, null, 8, _hoisted_2$d)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
217
+ }, null, 8, _hoisted_2$c)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
222
218
  key: 1,
223
219
  class: normalizeClass(["status", [node.selected ? "selected" : ""]])
224
220
  }, [node.selected ? (openBlock(), createBlock(_sfc_main$C, {
@@ -230,16 +226,20 @@ var _sfc_main$B = defineComponent({
230
226
  key: 2,
231
227
  class: "item-text",
232
228
  textContent: toDisplayString(node.item.text)
233
- }, null, 8, _hoisted_3$a)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
229
+ }, null, 8, _hoisted_3$9)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
234
230
  key: 3,
235
231
  class: "item-des",
236
232
  textContent: toDisplayString(node.item.description)
237
- }, null, 8, _hoisted_4$7)) : createCommentVNode("", true)], 14, _hoisted_1$l);
233
+ }, null, 8, _hoisted_4$7)) : createCommentVNode("", true)], 14, _hoisted_1$k);
238
234
  }), 128))], 2);
239
235
  };
240
236
  }
241
237
  });
242
238
 
239
+ var addLink = href => setTimeout(link.register, 0, href);
240
+
241
+ addLink("/styles/snail.vue.vue.css");
242
+
243
243
  var _sfc_main$A = defineComponent({
244
244
  ...{
245
245
  name: "Footer",
@@ -288,7 +288,7 @@ var _sfc_main$A = defineComponent({
288
288
  }
289
289
  });
290
290
 
291
- const _hoisted_1$k = ["textContent"];
291
+ const _hoisted_1$j = ["textContent"];
292
292
  var _sfc_main$z = defineComponent({
293
293
  ...{
294
294
  name: "Header",
@@ -328,7 +328,7 @@ var _sfc_main$z = defineComponent({
328
328
  key: 0,
329
329
  textContent: toDisplayString(__props.title),
330
330
  class: normalizeClass(["header-title", __props.titleAlign])
331
- }, null, 10, _hoisted_1$k)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$C, {
331
+ }, null, 10, _hoisted_1$j)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$C, {
332
332
  key: 1,
333
333
  class: "close-icon",
334
334
  type: "close",
@@ -341,13 +341,13 @@ var _sfc_main$z = defineComponent({
341
341
  }
342
342
  });
343
343
 
344
- const _hoisted_1$j = ["textContent"];
345
- const _hoisted_2$c = {
344
+ const _hoisted_1$i = ["textContent"];
345
+ const _hoisted_2$b = {
346
346
  key: 0,
347
347
  class: "required",
348
348
  textContent: "*"
349
349
  };
350
- const _hoisted_3$9 = {
350
+ const _hoisted_3$8 = {
351
351
  class: "input-body"
352
352
  };
353
353
  const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
@@ -404,7 +404,7 @@ var _sfc_main$y = defineComponent({
404
404
  }, [createElementVNode("span", {
405
405
  class: "text",
406
406
  textContent: toDisplayString(__props.title)
407
- }, null, 8, _hoisted_1$j), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$c)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$9, [createElementVNode("input", {
407
+ }, null, 8, _hoisted_1$i), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$b)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$8, [createElementVNode("input", {
408
408
  ref: "input-el",
409
409
  type: __props.type || "text",
410
410
  value: inputModel.value,
@@ -627,12 +627,12 @@ function useFormatter(options) {
627
627
  return formatter;
628
628
  }
629
629
 
630
- const _hoisted_1$i = {
630
+ const _hoisted_1$h = {
631
631
  key: 0,
632
632
  class: "number-prefix"
633
633
  };
634
- const _hoisted_2$b = ["textContent"];
635
- const _hoisted_3$8 = ["inputmode", "placeholder", "title"];
634
+ const _hoisted_2$a = ["textContent"];
635
+ const _hoisted_3$7 = ["inputmode", "placeholder", "title"];
636
636
  const _hoisted_4$5 = {
637
637
  key: 1,
638
638
  class: "number-suffix"
@@ -787,10 +787,10 @@ var _sfc_main$x = defineComponent({
787
787
  "has-prefix": unref(hasPrefix),
788
788
  "has-suffix": unref(hasSuffix)
789
789
  }])
790
- }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$i, [createElementVNode("span", {
790
+ }, [unref(hasPrefix) ? (openBlock(), createElementBlock("div", _hoisted_1$h, [createElementVNode("span", {
791
791
  class: "ellipsis",
792
792
  textContent: toDisplayString(unref(prefix))
793
- }, null, 8, _hoisted_2$b)])) : createCommentVNode("", true), createElementVNode("div", {
793
+ }, null, 8, _hoisted_2$a)])) : createCommentVNode("", true), createElementVNode("div", {
794
794
  class: normalizeClass(["input-panel", unref(controls)])
795
795
  }, [withDirectives(createElementVNode("input", {
796
796
  type: "text",
@@ -802,7 +802,7 @@ var _sfc_main$x = defineComponent({
802
802
  onFocus: _cache[1] || (_cache[1] = $event => isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
803
803
  onPaste: _cache[2] || (_cache[2] = $event => isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
804
804
  onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
805
- }, null, 40, _hoisted_3$8), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
805
+ }, null, 40, _hoisted_3$7), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
806
806
  key: 0
807
807
  }, [createElementVNode("div", {
808
808
  class: "controls default subtract",
@@ -854,7 +854,7 @@ var _sfc_main$x = defineComponent({
854
854
  }
855
855
  });
856
856
 
857
- const _hoisted_1$h = ["placeholder", "readonly"];
857
+ const _hoisted_1$g = ["placeholder", "readonly"];
858
858
  var _sfc_main$w = defineComponent({
859
859
  ...{
860
860
  name: "Search",
@@ -900,7 +900,7 @@ var _sfc_main$w = defineComponent({
900
900
  readonly: __props.readonly,
901
901
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
902
902
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
903
- }, null, 40, _hoisted_1$h), [[vModelText, textModel.value, void 0, {
903
+ }, null, 40, _hoisted_1$g), [[vModelText, textModel.value, void 0, {
904
904
  trim: true
905
905
  }]]), createElementVNode("div", null, [createVNode(_sfc_main$C, {
906
906
  class: "search-button",
@@ -1127,10 +1127,10 @@ function deducePosition(strategy, targetStart, targetEnd, contentSize, clientSiz
1127
1127
  }
1128
1128
  }
1129
1129
 
1130
- const _hoisted_1$g = {
1130
+ const _hoisted_1$f = {
1131
1131
  class: "snail-confirm flex-column"
1132
1132
  };
1133
- const _hoisted_2$a = ["innerHTML"];
1133
+ const _hoisted_2$9 = ["innerHTML"];
1134
1134
  var _sfc_main$v = defineComponent({
1135
1135
  ...{
1136
1136
  name: "ConfirmContainer",
@@ -1159,14 +1159,14 @@ var _sfc_main$v = defineComponent({
1159
1159
  },
1160
1160
  setup(__props) {
1161
1161
  return (_ctx, _cache) => {
1162
- return openBlock(), createElementBlock("div", _hoisted_1$g, [createVNode(_sfc_main$z, {
1162
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [createVNode(_sfc_main$z, {
1163
1163
  "use-to": "dialog",
1164
1164
  title: __props.title || "提示",
1165
1165
  onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
1166
1166
  }, null, 8, ["title"]), createElementVNode("div", {
1167
1167
  class: "confirm-body",
1168
1168
  innerHTML: __props.message || "请确认?"
1169
- }, null, 8, _hoisted_2$a), createVNode(_sfc_main$A, {
1169
+ }, null, 8, _hoisted_2$9), createVNode(_sfc_main$A, {
1170
1170
  align: "right",
1171
1171
  "cancel-name": __props.cancelName,
1172
1172
  "cancel-disabled": __props.cancelDisabled,
@@ -1642,11 +1642,11 @@ var _sfc_main$p = defineComponent({
1642
1642
  }
1643
1643
  });
1644
1644
 
1645
- const _hoisted_1$f = {
1645
+ const _hoisted_1$e = {
1646
1646
  key: 1,
1647
1647
  class: "icon"
1648
1648
  };
1649
- const _hoisted_2$9 = ["innerHTML"];
1649
+ const _hoisted_2$8 = ["innerHTML"];
1650
1650
  var _sfc_main$o = defineComponent({
1651
1651
  ...{
1652
1652
  name: "ToastContainer",
@@ -1695,14 +1695,14 @@ var _sfc_main$o = defineComponent({
1695
1695
  onClick: _cache[0] || (_cache[0] = $event => {
1696
1696
  unref(closePopup)();
1697
1697
  })
1698
- })) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$f, [createVNode(_sfc_main$C, {
1698
+ })) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$e, [createVNode(_sfc_main$C, {
1699
1699
  type: unref(props).type,
1700
1700
  color: "#707070",
1701
1701
  size: 20
1702
1702
  }, null, 8, ["type"])])) : createCommentVNode("", true), createElementVNode("div", {
1703
1703
  class: "message",
1704
1704
  innerHTML: unref(props).message
1705
- }, null, 8, _hoisted_2$9)], 38);
1705
+ }, null, 8, _hoisted_2$8)], 38);
1706
1706
  };
1707
1707
  }
1708
1708
  });
@@ -1945,11 +1945,11 @@ function getNoDataBase64Image() {
1945
1945
  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==";
1946
1946
  }
1947
1947
 
1948
- const _hoisted_1$e = {
1948
+ const _hoisted_1$d = {
1949
1949
  class: "snail-empty"
1950
1950
  };
1951
- const _hoisted_2$8 = ["src"];
1952
- const _hoisted_3$7 = ["textContent"];
1951
+ const _hoisted_2$7 = ["src"];
1952
+ const _hoisted_3$6 = ["textContent"];
1953
1953
  var _sfc_main$n = defineComponent({
1954
1954
  ...{
1955
1955
  name: "Empty",
@@ -1963,19 +1963,19 @@ var _sfc_main$n = defineComponent({
1963
1963
  setup(__props) {
1964
1964
  const defaultImageBase64 = getNoDataBase64Image();
1965
1965
  return (_ctx, _cache) => {
1966
- return openBlock(), createElementBlock("div", _hoisted_1$e, [createElementVNode("img", {
1966
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [createElementVNode("img", {
1967
1967
  src: __props.imageUrl || unref(defaultImageBase64)
1968
- }, null, 8, _hoisted_2$8), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1968
+ }, null, 8, _hoisted_2$7), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1969
1969
  class: "message",
1970
1970
  textContent: toDisplayString(__props.message || "无数据")
1971
- }, null, 8, _hoisted_3$7)])]);
1971
+ }, null, 8, _hoisted_3$6)])]);
1972
1972
  };
1973
1973
  }
1974
1974
  });
1975
1975
 
1976
- const _hoisted_1$d = ["title"];
1977
- const _hoisted_2$7 = ["textContent"];
1978
- const _hoisted_3$6 = {
1976
+ const _hoisted_1$c = ["title"];
1977
+ const _hoisted_2$6 = ["textContent"];
1978
+ const _hoisted_3$5 = {
1979
1979
  key: 1,
1980
1980
  class: "select-status"
1981
1981
  };
@@ -2024,15 +2024,15 @@ var _sfc_main$m = defineComponent({
2024
2024
  }, [createElementVNode("div", {
2025
2025
  class: "item-text ellipsis",
2026
2026
  textContent: toDisplayString(__props.item.text)
2027
- }, null, 8, _hoisted_2$7), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$C, {
2027
+ }, null, 8, _hoisted_2$6), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$C, {
2028
2028
  key: 0,
2029
2029
  type: "arrow"
2030
- })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$6, [createVNode(_sfc_main$C, {
2030
+ })) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$5, [createVNode(_sfc_main$C, {
2031
2031
  type: "success",
2032
2032
  button: "",
2033
2033
  size: 12,
2034
2034
  color: "white"
2035
- })])) : createCommentVNode("", true)], 42, _hoisted_1$d)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2035
+ })])) : createCommentVNode("", true)], 42, _hoisted_1$c)) : createCommentVNode("", true), showRef.value ? (openBlock(true), createElementBlock(Fragment, {
2036
2036
  key: 1
2037
2037
  }, renderList(unref(showChildrenRef), child => {
2038
2038
  return openBlock(), createBlock(_component_SelectNode, {
@@ -2248,12 +2248,12 @@ var _sfc_main$l = defineComponent({
2248
2248
  }
2249
2249
  });
2250
2250
 
2251
- const _hoisted_1$c = {
2251
+ const _hoisted_1$b = {
2252
2252
  key: 0,
2253
2253
  class: "select-result"
2254
2254
  };
2255
- const _hoisted_2$6 = ["title", "textContent"];
2256
- const _hoisted_3$5 = ["textContent"];
2255
+ const _hoisted_2$5 = ["title", "textContent"];
2256
+ const _hoisted_3$4 = ["textContent"];
2257
2257
  const _hoisted_4$4 = {
2258
2258
  key: 1,
2259
2259
  class: "placeholder"
@@ -2393,15 +2393,15 @@ var _sfc_main$k = defineComponent({
2393
2393
  ref: "select"
2394
2394
  }, [__props.items && __props.items.length ? (openBlock(), createElementBlock(Fragment, {
2395
2395
  key: 0
2396
- }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$c, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2396
+ }, [selectedItemsRef.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$b, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
2397
2397
  class: "select-text ellipsis",
2398
2398
  title: selectedTextRef.value,
2399
2399
  textContent: toDisplayString(selectedTextRef.value)
2400
- }, null, 8, _hoisted_2$6)])])) : (openBlock(), createElementBlock("div", {
2400
+ }, null, 8, _hoisted_2$5)])])) : (openBlock(), createElementBlock("div", {
2401
2401
  key: 1,
2402
2402
  class: "placeholder",
2403
2403
  textContent: toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
2404
- }, null, 8, _hoisted_3$5)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$C, {
2404
+ }, null, 8, _hoisted_3$4)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$C, {
2405
2405
  key: 2,
2406
2406
  type: "arrow",
2407
2407
  button: "",
@@ -2461,7 +2461,7 @@ var _sfc_main$j = defineComponent({
2461
2461
  }
2462
2462
  });
2463
2463
 
2464
- const _hoisted_1$b = ["readonly", "placeholder", "rows"];
2464
+ const _hoisted_1$a = ["readonly", "placeholder", "rows"];
2465
2465
  var _sfc_main$i = defineComponent({
2466
2466
  ...{
2467
2467
  name: "Textarea",
@@ -2522,89 +2522,114 @@ var _sfc_main$i = defineComponent({
2522
2522
  onInput: _cache[2] || (_cache[2] = $event => emits("input", textareaDom.value.value)),
2523
2523
  onBlur: _cache[3] || (_cache[3] = $event => emits("blur", textareaDom.value.value)),
2524
2524
  onChange: _cache[4] || (_cache[4] = $event => emits("change", textareaDom.value.value))
2525
- }, null, 40, _hoisted_1$b)), [[vModelText, valueModel.value]]);
2525
+ }, null, 40, _hoisted_1$a)), [[vModelText, valueModel.value]]);
2526
2526
  };
2527
2527
  }
2528
2528
  });
2529
2529
 
2530
- function isRight(root) {
2531
- return root.scrollLeft + root.clientWidth >= root.scrollWidth;
2532
- }
2533
- function isBottom(root) {
2534
- return root.scrollTop + root.clientHeight >= root.scrollHeight;
2530
+ function monitScroll(manager, root, options, emiter, classStyleRef) {
2531
+ const scope = useScope();
2532
+ let preStatus = void 0;
2533
+ const observer = useObserver();
2534
+ const timer = useTimer();
2535
+ const reactive = useReactive();
2536
+ function buildClassStyle() {
2537
+ const array = (classStyleRef.value ? [...classStyleRef.value] : []).filter(item => item == "x-bar" || item == "y-bar");
2538
+ array.push(...manager.buildClassStyle(options));
2539
+ classStyleRef.value = array;
2540
+ }
2541
+ function refreshScrollInfo() {
2542
+ const status = Object.freeze(manager.getStatus(root));
2543
+ const events = Object.create(null);
2544
+ if (preStatus != void 0) {
2545
+ preStatus.xbar != status.xbar && (events.xbar = [status.xbar]);
2546
+ preStatus.ybar != status.ybar && (events.ybar = [status.ybar]);
2547
+ if (preStatus.xbar == true && status.xbar == true) {
2548
+ status.left && preStatus.left !== status.left && (events.left = []);
2549
+ status.right && preStatus.right !== status.right && (events.right = []);
2550
+ }
2551
+ if (preStatus.ybar == true && status.ybar == true) {
2552
+ status.top && preStatus.top !== status.top && (events.top = []);
2553
+ status.bottom && preStatus.bottom !== status.bottom && (events.bottom = []);
2554
+ }
2555
+ }
2556
+ preStatus = status;
2557
+ events.xbar && emiter("xbar", ...events.xbar);
2558
+ events.left && emiter("left");
2559
+ events.right && emiter("right");
2560
+ events.ybar && emiter("ybar", ...events.ybar);
2561
+ events.top && emiter("top");
2562
+ events.bottom && emiter("bottom");
2563
+ {
2564
+ const array = (classStyleRef.value ? [...classStyleRef.value] : []).filter(item => item != "x-bar" && item != "y-bar");
2565
+ status.xbar && array.push("x-bar");
2566
+ status.ybar && array.push("y-bar");
2567
+ classStyleRef.value = array;
2568
+ }
2569
+ }
2570
+ buildClassStyle();
2571
+ refreshScrollInfo();
2572
+ reactive.watcher(() => options.scroll, buildClassStyle);
2573
+ reactive.watcher(() => options.barSize, buildClassStyle);
2574
+ observer.onSize(root, refreshScrollInfo);
2575
+ observer.onEvent(root, "scroll", refreshScrollInfo);
2576
+ timer.onInterval(() => {
2577
+ const isChange = preStatus.scrollWidth != root.scrollWidth || preStatus.scrollHeight != root.scrollHeight;
2578
+ isChange && refreshScrollInfo();
2579
+ }, 100);
2580
+ scope.onDestroy(() => {
2581
+ observer.destroyed || observer.destroy();
2582
+ timer.destroyed || timer.destroy();
2583
+ reactive.destroyed || reactive.destroy();
2584
+ });
2585
+ return scope;
2535
2586
  }
2536
2587
 
2537
- const _hoisted_1$a = {
2538
- key: 0,
2539
- class: "down-refresh"
2540
- };
2541
- const _hoisted_2$5 = {
2542
- class: "main-body"
2543
- };
2544
- const _hoisted_3$4 = {
2545
- key: 1,
2546
- class: "up-more"
2547
- };
2548
2588
  var _sfc_main$h = defineComponent({
2589
+ ...{
2590
+ name: "Elastic",
2591
+ inheritAttrs: false
2592
+ },
2549
2593
  __name: "elastic",
2550
2594
  props: {
2551
2595
  scroll: {},
2596
+ barSize: {},
2552
2597
  spring: {},
2553
2598
  downRefresh: {
2554
2599
  type: Boolean
2555
2600
  },
2556
2601
  upMore: {
2557
2602
  type: Boolean
2558
- },
2559
- barSize: {}
2603
+ }
2560
2604
  },
2561
- setup(__props) {
2605
+ emits: ["xbar", "left", "right", "ybar", "top", "bottom", "refresh", "more"],
2606
+ setup(__props, _ref) {
2607
+ let {
2608
+ expose: __expose,
2609
+ emit: __emit
2610
+ } = _ref;
2611
+ __expose({
2612
+ loadRefresh,
2613
+ loadMore
2614
+ });
2562
2615
  const props = __props;
2616
+ const emits = __emit;
2563
2617
  const {
2564
2618
  onEvent
2565
2619
  } = useObserver();
2566
- const rootDom = useTemplateRef("root-dom");
2567
- const scrollStyleRef = computed(buildScrollStyle);
2568
- ref(void 0);
2569
- const springStyleRef = computed(buildSpringStyle);
2620
+ const manager = useScroll();
2621
+ const downRefreshDom = useTemplateRef("down-refresh");
2622
+ const mainBodyDom = useTemplateRef("main-body");
2623
+ const upMoreDom = useTemplateRef("up-more");
2624
+ const classStyleRef = shallowRef();
2625
+ let isStartByTouch = false;
2626
+ const startPointerRef = ref(void 0);
2627
+ const isMovingRef = shallowRef(false);
2628
+ const springStatusRef = ref(Object.create(null));
2570
2629
  const springXRef = computed(() => props.spring == "x" || props.spring == "both");
2571
2630
  const springYRef = computed(() => props.spring == "y" || props.spring == "both");
2572
- const downRefreshRef = computed(() => springYRef.value == true && props.downRefresh == true);
2573
- const upMoreRef = computed(() => springYRef.value == true && props.upMore == true);
2574
- const isMovingRef = ref(false);
2575
- const springStatusRef = ref(void 0);
2576
- const startPointerRef = ref(void 0);
2577
- let isStartByTouch = false;
2578
- function buildScrollStyle() {
2579
- const vars = Object.create(null);
2580
- switch (props.scroll) {
2581
- case "x":
2582
- vars["--overflow"] = "auto hidden";
2583
- break;
2584
- case "y":
2585
- vars["--overflow"] = "hidden auto";
2586
- break;
2587
- case "both":
2588
- vars["--overflow"] = "auto";
2589
- break;
2590
- }
2591
- switch (props.barSize) {
2592
- case "normal":
2593
- vars["--bar-size"] = "10px";
2594
- break;
2595
- case "small":
2596
- vars["--bar-size"] = "6px";
2597
- break;
2598
- case "mini":
2599
- vars["--bar-size"] = "4px";
2600
- break;
2601
- case "none":
2602
- vars["--bar-size"] = "0";
2603
- break;
2604
- }
2605
- return vars;
2606
- }
2607
- function buildSpringStyle() {
2631
+ const loadingRef = shallowRef();
2632
+ function buildMainBodyStyle() {
2608
2633
  const style = Object.create(null);
2609
2634
  if (springStatusRef.value != void 0) {
2610
2635
  const {
@@ -2614,18 +2639,54 @@ var _sfc_main$h = defineComponent({
2614
2639
  const transforms = [];
2615
2640
  x != void 0 && transforms.push(`translateX(${x}px)`);
2616
2641
  y != void 0 && transforms.push(`translateY(${y}px)`);
2617
- transforms.length && (style["--spring-transform"] = transforms.join(" "));
2642
+ transforms.length && (style["transform"] = transforms.join(" "));
2618
2643
  }
2619
2644
  return style;
2620
2645
  }
2646
+ function loadRefresh() {
2647
+ const deferred = defer();
2648
+ if (downRefreshDom.value == void 0) {
2649
+ deferred.reject("not support pullRefresh feature!");
2650
+ } else if (loadingRef.value != void 0) {
2651
+ deferred.reject(`pre load task[${loadingRef.value}] is running!`);
2652
+ } else {
2653
+ resetAfterEnd();
2654
+ loadingRef.value = "refresh";
2655
+ springStatusRef.value.y = downRefreshDom.value.clientHeight;
2656
+ emits("refresh", () => {
2657
+ resetAfterEnd();
2658
+ deferred.resolve();
2659
+ });
2660
+ }
2661
+ return deferred.promise;
2662
+ }
2663
+ function loadMore() {
2664
+ const deferred = defer();
2665
+ if (downRefreshDom.value == void 0) {
2666
+ deferred.reject("not support upMore feature!");
2667
+ } else if (loadingRef.value != void 0) {
2668
+ deferred.reject(`pre load task[${loadingRef.value}] is running!`);
2669
+ } else {
2670
+ resetAfterEnd();
2671
+ loadingRef.value = "more";
2672
+ springStatusRef.value.y = -upMoreDom.value.clientHeight;
2673
+ emits("more", () => {
2674
+ resetAfterEnd();
2675
+ deferred.resolve();
2676
+ });
2677
+ return;
2678
+ }
2679
+ return deferred.promise;
2680
+ }
2621
2681
  function onSpringStart(isTouch, position) {
2622
- if (isTouch != true && isStartByTouch == true) {
2682
+ if (loadingRef.value != void 0) {
2683
+ return;
2684
+ }
2685
+ if (isStartByTouch == true && isTouch != true) {
2623
2686
  return;
2624
2687
  }
2625
2688
  isTouch && (isStartByTouch = true);
2626
2689
  if (springXRef.value == true || springYRef.value == true) {
2627
- isMovingRef.value = true;
2628
- springStatusRef.value = Object.create(null);
2629
2690
  startPointerRef.value = {
2630
2691
  clientX: position.clientX,
2631
2692
  clientY: position.clientY
@@ -2633,60 +2694,99 @@ var _sfc_main$h = defineComponent({
2633
2694
  }
2634
2695
  }
2635
2696
  function onSpringMove(isTouch, position) {
2636
- if (startPointerRef.value == void 0 || isTouch != true && isStartByTouch == true) {
2697
+ if (startPointerRef.value == void 0 || isStartByTouch == true && isTouch != true) {
2637
2698
  return;
2638
2699
  }
2700
+ isMovingRef.value = true;
2639
2701
  if (springXRef.value == true) {
2640
2702
  const distance = position.clientX - startPointerRef.value.clientX;
2641
- if (distance >= 0 && rootDom.value.scrollLeft == 0) {
2703
+ if (distance >= 0 && manager.isLeft(mainBodyDom.value)) {
2642
2704
  springStatusRef.value.x = Math.pow(distance, 0.8);
2643
- } else if (distance <= 0 && isRight(rootDom.value)) {
2705
+ } else if (distance <= 0 && manager.isRight(mainBodyDom.value)) {
2644
2706
  springStatusRef.value.x = -Math.pow(-distance, 0.8);
2645
2707
  }
2646
2708
  }
2647
2709
  if (springYRef.value == true) {
2648
2710
  const distance = position.clientY - startPointerRef.value.clientY;
2649
- if (distance >= 0) {
2650
- if (rootDom.value.scrollTop == 0) {
2651
- springStatusRef.value.y = Math.pow(distance, 0.8);
2652
- } else {
2653
- startPointerRef.value.clientY = position.clientY;
2654
- }
2655
- } else if (distance <= 0 && isBottom(rootDom.value) == true) {
2656
- springStatusRef.value.y = -Math.pow(-distance, 0.8);
2711
+ switch (loadingRef.value) {
2712
+ default:
2713
+ {
2714
+ if (distance >= 0) {
2715
+ manager.isTop(mainBodyDom.value) ? springStatusRef.value.y = Math.pow(distance, 0.8) : startPointerRef.value.clientY = position.clientY;
2716
+ } else {
2717
+ console.log("isBottom", mainBodyDom.value.scrollTop + mainBodyDom.value.clientHeight, "---", mainBodyDom.value.scrollHeight);
2718
+ manager.isBottom(mainBodyDom.value) ? springStatusRef.value.y = -Math.pow(-distance, 0.8) : startPointerRef.value.clientY = position.clientY;
2719
+ }
2720
+ break;
2721
+ }
2657
2722
  }
2658
2723
  }
2659
2724
  }
2660
2725
  function onSpringEnd(isTouch, isCancel) {
2661
- if (startPointerRef.value != void 0) {
2662
- springStatusRef.value = Object.create(null);
2663
- isMovingRef.value = false;
2664
- startPointerRef.value = void 0;
2665
- isStartByTouch = false;
2726
+ if (startPointerRef.value == void 0 || isStartByTouch == true && isTouch != true) {
2727
+ return;
2728
+ }
2729
+ if (isMovingRef.value != true) {
2730
+ return;
2666
2731
  }
2732
+ if (loadingRef.value == void 0) {
2733
+ if (downRefreshDom.value && springStatusRef.value.y > downRefreshDom.value.clientHeight) {
2734
+ return loadRefresh();
2735
+ }
2736
+ if (upMoreDom.value && springStatusRef.value.y <= -upMoreDom.value.clientHeight) {
2737
+ return loadMore();
2738
+ }
2739
+ }
2740
+ resetAfterEnd();
2741
+ }
2742
+ function resetAfterEnd() {
2743
+ loadingRef.value = void 0;
2744
+ springStatusRef.value = Object.create(null);
2745
+ isMovingRef.value = false;
2746
+ startPointerRef.value = void 0;
2747
+ isStartByTouch = false;
2667
2748
  }
2668
2749
  onMounted(() => {
2750
+ monitScroll(manager, mainBodyDom.value, props, emits, classStyleRef);
2669
2751
  if ("ontouchstart" in window) {
2670
- onEvent(rootDom.value, "touchstart", evt => onSpringStart(true, evt.touches[0]));
2752
+ onEvent(mainBodyDom.value, "touchstart", evt => onSpringStart(true, evt.touches[0]));
2671
2753
  onEvent(window, "touchmove", evt => onSpringMove(true, evt.touches[0]));
2672
- onEvent(window, "touchend", () => onSpringEnd());
2673
- onEvent(window, "touchcancel", () => onSpringEnd());
2754
+ onEvent(window, "touchend", () => onSpringEnd(true));
2755
+ onEvent(window, "touchcancel", () => onSpringEnd(true));
2674
2756
  }
2675
2757
  if ("onmousedown" in window) {
2676
- onEvent(rootDom.value, "mousedown", evt => onSpringStart(false, evt));
2758
+ onEvent(mainBodyDom.value, "mousedown", evt => onSpringStart(false, evt));
2677
2759
  onEvent(window, "mousemove", evt => onSpringMove(false, evt));
2678
- onEvent(window, "mouseup", () => onSpringEnd());
2760
+ onEvent(window, "mouseup", () => onSpringEnd(false));
2679
2761
  }
2680
2762
  });
2681
2763
  return (_ctx, _cache) => {
2682
- return openBlock(), createElementBlock("div", {
2683
- class: normalizeClass(["snail-elastic", {
2684
- "spring": springXRef.value || springYRef.value,
2764
+ return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
2765
+ class: "snail-elastic"
2766
+ }), [springYRef.value == true && __props.downRefresh == true ? withDirectives((openBlock(), createElementBlock("div", {
2767
+ key: 0,
2768
+ class: normalizeClass(["down-refresh", {
2769
+ "running": loadingRef.value == "refresh"
2770
+ }]),
2771
+ ref: "down-refresh"
2772
+ }, [renderSlot(_ctx.$slots, "down-refresh", {}, () => [_cache[0] || (_cache[0] = createElementVNode("div", {
2773
+ class: "flex-center default-loading"
2774
+ }, [createElementVNode("span"), createElementVNode("span"), createElementVNode("span")], -1))])], 2)), [[vShow, loadingRef.value != "more"]]) : createCommentVNode("", true), createElementVNode("div", {
2775
+ class: normalizeClass(["main-body wh-fill", classStyleRef.value, {
2685
2776
  "moving": isMovingRef.value
2686
2777
  }]),
2687
- style: normalizeStyle([scrollStyleRef.value, springStyleRef.value]),
2688
- ref: "root-dom"
2689
- }, [downRefreshRef.value ? (openBlock(), createElementBlock("div", _hoisted_1$a, [renderSlot(_ctx.$slots, "down-refresh", {}, () => [_cache[0] || (_cache[0] = createTextVNode(" 默认实现[下拉刷新] ", -1))])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_2$5, [renderSlot(_ctx.$slots, "default")]), upMoreRef.value ? (openBlock(), createElementBlock("div", _hoisted_3$4, [renderSlot(_ctx.$slots, "up-more", {}, () => [_cache[1] || (_cache[1] = createTextVNode(" 默认实现[上拉加载更多] ", -1))])])) : createCommentVNode("", true)], 6);
2778
+ ref: "main-body",
2779
+ key: "main-body",
2780
+ style: normalizeStyle(buildMainBodyStyle())
2781
+ }, [renderSlot(_ctx.$slots, "default")], 6), springYRef.value == true && __props.upMore == true ? withDirectives((openBlock(), createElementBlock("div", {
2782
+ key: 1,
2783
+ class: normalizeClass(["up-more", {
2784
+ "running": loadingRef.value == "more"
2785
+ }]),
2786
+ ref: "up-more"
2787
+ }, [renderSlot(_ctx.$slots, "up-more", {}, () => [_cache[1] || (_cache[1] = createElementVNode("div", {
2788
+ class: "flex-center default-loading"
2789
+ }, [createElementVNode("span"), createElementVNode("span"), createElementVNode("span")], -1))])], 2)), [[vShow, loadingRef.value != "refresh"]]) : createCommentVNode("", true)], 16);
2690
2790
  };
2691
2791
  }
2692
2792
  });
@@ -2701,9 +2801,9 @@ var _sfc_main$g = defineComponent({
2701
2801
  direction: {},
2702
2802
  wrap: {},
2703
2803
  gap: {},
2704
- justifyContent: {},
2705
- alignItems: {},
2706
- alignContent: {},
2804
+ main: {},
2805
+ cross: {},
2806
+ content: {},
2707
2807
  repairItem: {
2708
2808
  type: Boolean
2709
2809
  },
@@ -2721,35 +2821,21 @@ var _sfc_main$g = defineComponent({
2721
2821
  watcher
2722
2822
  } = useReactive();
2723
2823
  const classRef = computed(buildClass);
2724
- const styleRef = computed(buildStyle);
2725
2824
  const repairItemsRef = shallowRef(0);
2726
2825
  function buildClass() {
2727
2826
  const items = [];
2728
- items.push(props.direction || "row");
2827
+ let direction = props.direction;
2828
+ props.repairItem == true && isStringNotEmpty(direction) == false && (direction = "row");
2829
+ direction && items.push(direction);
2729
2830
  props.wrap && items.push(props.wrap);
2730
- props.justifyContent && items.push(props.justifyContent);
2831
+ isStringNotEmpty(props.main) && items.push(`justify-${props.main}`);
2832
+ isStringNotEmpty(props.cross) && items.push(`items-${props.cross}`);
2833
+ isStringNotEmpty(props.content) && items.push(`content-${props.content}`);
2731
2834
  return items;
2732
2835
  }
2733
- function buildStyle() {
2734
- const styleVar = Object.create(null);
2735
- isStringNotEmpty(props.gap) && (styleVar["--gap"] = props.gap);
2736
- const tmpFunc = value => {
2737
- switch (value) {
2738
- case "start":
2739
- return "flex-start";
2740
- case "end":
2741
- return "flex-end";
2742
- default:
2743
- return value;
2744
- }
2745
- };
2746
- isStringNotEmpty(props.alignItems) && (styleVar["--align-items"] = tmpFunc(props.alignItems));
2747
- isStringNotEmpty(props.alignContent) && (styleVar["--align-content"] = tmpFunc(props.alignContent));
2748
- return styleVar;
2749
- }
2750
2836
  function repairSpace() {
2751
2837
  repairItemsRef.value = 0;
2752
- const needRepair = props.repairItem == true && props.justifyContent && props.justifyContent.startsWith("space-") && props.itemCount > 0 && rootDom.value.children.length > 0;
2838
+ const needRepair = props.repairItem == true && (props.main == "between" || props.main == "around" || props.main == "evenly") && props.itemCount > 0 && rootDom.value.children.length > 0;
2753
2839
  if (needRepair == true) {
2754
2840
  let containerSize, itemSize, itemGap;
2755
2841
  const containerStyle = getComputedStyle(rootDom.value);
@@ -2771,8 +2857,7 @@ var _sfc_main$g = defineComponent({
2771
2857
  break;
2772
2858
  }
2773
2859
  }
2774
- let itemCountPer;
2775
- itemCountPer = Math.floor((containerSize + itemGap) / (itemSize + itemGap));
2860
+ let itemCountPer = Math.floor((containerSize + itemGap) / (itemSize + itemGap));
2776
2861
  if (itemCountPer > 1) {
2777
2862
  const mode = props.itemCount % itemCountPer;
2778
2863
  mode > 0 && (repairItemsRef.value = itemCountPer - mode);
@@ -2788,7 +2873,9 @@ var _sfc_main$g = defineComponent({
2788
2873
  return (_ctx, _cache) => {
2789
2874
  return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
2790
2875
  class: ["snail-flex", classRef.value],
2791
- style: styleRef.value,
2876
+ style: unref(isStringNotEmpty)(__props.gap) ? {
2877
+ "--gap": __props.gap
2878
+ } : void 0,
2792
2879
  ref: "root-flex"
2793
2880
  }), [renderSlot(_ctx.$slots, "default"), (openBlock(true), createElementBlock(Fragment, null, renderList(repairItemsRef.value, _ => {
2794
2881
  return openBlock(), createBlock(resolveDynamicComponent(unref(correctString)(props.itemTag, "div", true)), {
@@ -2904,16 +2991,11 @@ var _sfc_main$f = defineComponent({
2904
2991
  var _sfc_main$e = defineComponent({
2905
2992
  ...{
2906
2993
  name: "Scroll",
2907
- inheritAttrs: true
2994
+ inheritAttrs: false
2908
2995
  },
2909
2996
  __name: "scroll",
2910
2997
  props: {
2911
- scrollX: {
2912
- type: Boolean
2913
- },
2914
- scrollY: {
2915
- type: Boolean
2916
- },
2998
+ scroll: {},
2917
2999
  barSize: {}
2918
3000
  },
2919
3001
  emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
@@ -2925,108 +3007,27 @@ var _sfc_main$e = defineComponent({
2925
3007
  const props = __props;
2926
3008
  const emits = __emit;
2927
3009
  const rootDom = useTemplateRef("scroll-root");
2928
- const {
2929
- onSize
2930
- } = useObserver();
2931
- const {
2932
- onInterval
2933
- } = useTimer();
2934
- const styleRef = computed(() => {
2935
- const style = Object.create(null);
2936
- (props.scrollX || props.scrollY) && (style["--scroll-overflow"] = `${props.scrollX == true ? "auto" : "hidden"} ${props.scrollY == true ? "auto" : "hidden"}`);
2937
- if (props.barSize) {
2938
- switch (props.barSize) {
2939
- case "normal":
2940
- style["--scroll-bar-size"] = "10px";
2941
- break;
2942
- case "small":
2943
- style["--scroll-bar-size"] = "6px";
2944
- break;
2945
- case "mini":
2946
- style["--scroll-bar-size"] = "4px";
2947
- break;
2948
- case "none":
2949
- style["--scroll-bar-size"] = "0";
2950
- break;
2951
- }
2952
- }
2953
- return style;
2954
- });
2955
- var preStatus = void 0;
3010
+ const manager = useScroll();
3011
+ const classStyleRef = shallowRef();
2956
3012
  __expose({
2957
- scroll,
2958
- scrollTo
2959
- });
2960
- function scroll(left, top) {
2961
- left == void 0 || (rootDom.value.scrollLeft += left);
2962
- top == void 0 || (rootDom.value.scrollTop += top);
2963
- }
2964
- function scrollTo(left, top) {
2965
- left == void 0 || (rootDom.value.scrollLeft = left);
2966
- top == void 0 || (rootDom.value.scrollTop = top);
2967
- }
2968
- function refreshScrollInfo() {
2969
- const status = {
2970
- xbar: rootDom.value.scrollWidth > rootDom.value.clientWidth,
2971
- ybar: rootDom.value.scrollHeight > rootDom.value.clientHeight,
2972
- left: false,
2973
- right: false,
2974
- top: false,
2975
- bottom: false,
2976
- scrollwidth: rootDom.value.scrollWidth,
2977
- scrollheight: rootDom.value.scrollHeight
2978
- };
2979
- if (status.xbar == true) {
2980
- status.left = rootDom.value.scrollLeft == 0;
2981
- status.right = rootDom.value.scrollLeft + rootDom.value.clientWidth == rootDom.value.scrollWidth;
2982
- }
2983
- if (status.ybar == true) {
2984
- status.top = rootDom.value.scrollTop == 0;
2985
- status.bottom = rootDom.value.scrollTop + rootDom.value.clientHeight == rootDom.value.scrollHeight;
2986
- }
2987
- Object.freeze(status);
2988
- const events = Object.create(null);
2989
- if (preStatus != void 0) {
2990
- preStatus.xbar != status.xbar && (events.xbar = [status.xbar]);
2991
- preStatus.ybar != status.ybar && (events.ybar = [status.ybar]);
2992
- if (preStatus.xbar == true && status.xbar == true) {
2993
- status.left && preStatus.left !== status.left && (events.left = []);
2994
- status.right && preStatus.right !== status.right && (events.right = []);
2995
- }
2996
- if (preStatus.ybar == true && status.ybar == true) {
2997
- status.top && preStatus.top !== status.top && (events.top = []);
2998
- status.bottom && preStatus.bottom !== status.bottom && (events.bottom = []);
2999
- }
3000
- }
3001
- preStatus = status;
3002
- preStatus = Object.freeze(status);
3003
- events.xbar && emits("xbar", ...events.xbar);
3004
- events.left && emits("left");
3005
- events.right && emits("right");
3006
- events.ybar && emits("ybar", ...events.ybar);
3007
- events.top && emits("top");
3008
- events.bottom && emits("bottom");
3009
- if (rootDom.value) {
3010
- rootDom.value.classList.remove("x-bar", "y-bar");
3011
- status.xbar && rootDom.value.classList.add("x-bar");
3012
- status.ybar && rootDom.value.classList.add("y-bar");
3013
+ getStatus() {
3014
+ return manager.getStatus(rootDom.value);
3015
+ },
3016
+ scroll(left, top) {
3017
+ left == void 0 || (rootDom.value.scrollLeft += left);
3018
+ top == void 0 || (rootDom.value.scrollTop += top);
3019
+ },
3020
+ scrollTo(left, top) {
3021
+ left == void 0 || (rootDom.value.scrollLeft = left);
3022
+ top == void 0 || (rootDom.value.scrollTop = top);
3013
3023
  }
3014
- }
3015
- onMounted(() => {
3016
- refreshScrollInfo();
3017
- onSize(rootDom.value, refreshScrollInfo);
3018
- onInterval(() => {
3019
- const isChange = preStatus.scrollwidth != rootDom.value.scrollWidth || preStatus.scrollheight != rootDom.value.scrollHeight;
3020
- isChange && refreshScrollInfo();
3021
- }, 100);
3022
3024
  });
3025
+ onMounted(() => monitScroll(manager, rootDom.value, props, emits, classStyleRef));
3023
3026
  return (_ctx, _cache) => {
3024
- return openBlock(), createElementBlock("div", {
3025
- class: "snail-scroll",
3026
- ref: "scroll-root",
3027
- style: normalizeStyle(styleRef.value),
3028
- onScroll: refreshScrollInfo
3029
- }, [renderSlot(_ctx.$slots, "default")], 36);
3027
+ return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
3028
+ class: ["snail-scroll", classStyleRef.value],
3029
+ ref: "scroll-root"
3030
+ }), [renderSlot(_ctx.$slots, "default")], 16);
3030
3031
  };
3031
3032
  }
3032
3033
  });
@@ -3227,12 +3228,7 @@ var _sfc_main$b = defineComponent({
3227
3228
  },
3228
3229
  __name: "table",
3229
3230
  props: {
3230
- scrollX: {
3231
- type: Boolean
3232
- },
3233
- scrollY: {
3234
- type: Boolean
3235
- },
3231
+ scroll: {},
3236
3232
  barSize: {},
3237
3233
  border: {
3238
3234
  type: Boolean
@@ -3249,8 +3245,8 @@ var _sfc_main$b = defineComponent({
3249
3245
  class: normalizeClass(["snail-table", {
3250
3246
  "start-border": __props.border == true
3251
3247
  }]),
3252
- "scroll-x": __props.scrollX,
3253
- "scroll-y": __props.scrollY
3248
+ scroll: __props.scroll,
3249
+ "bar-size": __props.barSize
3254
3250
  }, {
3255
3251
  default: withCtx(() => [createElementVNode("div", {
3256
3252
  class: "table-header",
@@ -3260,7 +3256,7 @@ var _sfc_main$b = defineComponent({
3260
3256
  style: normalizeStyle(fStyleRef.value)
3261
3257
  }, [renderSlot(_ctx.$slots, "footer")], 4)]),
3262
3258
  _: 3
3263
- }, 8, ["scroll-x", "scroll-y", "class"]);
3259
+ }, 8, ["scroll", "bar-size", "class"]);
3264
3260
  };
3265
3261
  }
3266
3262
  });
@@ -3531,7 +3527,7 @@ var _sfc_main$7 = defineComponent({
3531
3527
  }, __props.search, {
3532
3528
  onSearch
3533
3529
  }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$e, {
3534
- "scroll-y": true
3530
+ scroll: "y"
3535
3531
  }, {
3536
3532
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
3537
3533
  return openBlock(), createBlock(_sfc_main$8, {
@@ -3587,8 +3583,7 @@ var _sfc_main$6 = defineComponent({
3587
3583
  }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$e, mergeProps({
3588
3584
  class: "wrapper-body"
3589
3585
  }, __props.content || {
3590
- scrollX: false,
3591
- scrollY: false
3586
+ scroll: "none"
3592
3587
  }), {
3593
3588
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3594
3589
  _: 3