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