@nutui/nutui 4.0.10-beta.1 → 4.0.11
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/CHANGELOG.md +23 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6316 -7237
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +148 -45
- package/dist/styles/themes/jdb.scss +148 -45
- package/dist/styles/themes/jddkh.scss +148 -45
- package/dist/styles/themes/jdt.scss +148 -45
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,61 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { ref, reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { u as useRect } from "./index-29892cda.js";
|
|
23
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var j = Object.defineProperty, G = Object.defineProperties;
|
|
2
|
+
var J = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var C = Object.getOwnPropertySymbols;
|
|
4
|
+
var K = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var D = (e, o, i) => o in e ? j(e, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[o] = i, E = (e, o) => {
|
|
6
|
+
for (var i in o || (o = {}))
|
|
7
|
+
K.call(o, i) && D(e, i, o[i]);
|
|
8
|
+
if (C)
|
|
9
|
+
for (var i of C(o))
|
|
10
|
+
O.call(o, i) && D(e, i, o[i]);
|
|
11
|
+
return e;
|
|
12
|
+
}, N = (e, o) => G(e, J(o));
|
|
13
|
+
import { ref as p, reactive as Q, computed as f, watch as $, toRefs as U, openBlock as S, createElementBlock as y, normalizeClass as W, normalizeStyle as H, createElementVNode as z, Fragment as X, renderList as Y, renderSlot as Z } from "vue";
|
|
14
|
+
import { c as R } from "./component-234624bc.js";
|
|
15
|
+
import { u as _ } from "./index-192a3ef6.js";
|
|
16
|
+
import { _ as tt } from "./_plugin-vue_export-helper-dad06003.js";
|
|
24
17
|
import "../locale/lang";
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
let tempIndex = null;
|
|
35
|
-
while (start <= end) {
|
|
36
|
-
tempIndex = Math.floor((start + end) / 2);
|
|
37
|
-
const midValue = list[tempIndex];
|
|
38
|
-
const compareRes = compareFunc(midValue, value);
|
|
39
|
-
if (compareRes === 1) {
|
|
40
|
-
return tempIndex;
|
|
41
|
-
}
|
|
42
|
-
if (compareRes === 2) {
|
|
43
|
-
start = tempIndex + 1;
|
|
44
|
-
} else if (compareRes === 3) {
|
|
45
|
-
end = tempIndex - 1;
|
|
46
|
-
}
|
|
18
|
+
var b = /* @__PURE__ */ ((e) => (e[e.eq = 1] = "eq", e[e.lt = 2] = "lt", e[e.gt = 3] = "gt", e))(b || {});
|
|
19
|
+
function et(e, o, i) {
|
|
20
|
+
let m = 0, l = e.length - 1, t = null;
|
|
21
|
+
for (; m <= l; ) {
|
|
22
|
+
t = Math.floor((m + l) / 2);
|
|
23
|
+
const r = e[t], h = i(r, o);
|
|
24
|
+
if (h === 1)
|
|
25
|
+
return t;
|
|
26
|
+
h === 2 ? m = t + 1 : h === 3 && (l = t - 1);
|
|
47
27
|
}
|
|
48
|
-
return
|
|
28
|
+
return t;
|
|
49
29
|
}
|
|
50
|
-
const { componentName, create } =
|
|
51
|
-
const clientHeight = document.documentElement.clientHeight || document.body.clientHeight || 667;
|
|
52
|
-
const _sfc_main = create({
|
|
30
|
+
const { componentName: nt, create: ot } = R("list"), M = document.documentElement.clientHeight || document.body.clientHeight || 667, it = ot({
|
|
53
31
|
props: {
|
|
54
32
|
listData: {
|
|
55
33
|
type: Array,
|
|
56
|
-
default: () =>
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
34
|
+
default: () => []
|
|
59
35
|
},
|
|
60
36
|
bufferSize: {
|
|
61
37
|
type: Number,
|
|
@@ -63,7 +39,7 @@ const _sfc_main = create({
|
|
|
63
39
|
},
|
|
64
40
|
containerHeight: {
|
|
65
41
|
type: [Number],
|
|
66
|
-
default:
|
|
42
|
+
default: M
|
|
67
43
|
},
|
|
68
44
|
height: {
|
|
69
45
|
type: Number,
|
|
@@ -75,198 +51,124 @@ const _sfc_main = create({
|
|
|
75
51
|
}
|
|
76
52
|
},
|
|
77
53
|
emits: ["scroll-up", "scroll-down", "scroll-bottom"],
|
|
78
|
-
setup(
|
|
79
|
-
const
|
|
80
|
-
const phantom = ref(null);
|
|
81
|
-
const actualContent = ref(null);
|
|
82
|
-
const state = reactive({
|
|
54
|
+
setup(e, { emit: o }) {
|
|
55
|
+
const i = p(null), m = p(null), l = p(null), t = Q({
|
|
83
56
|
start: 0,
|
|
84
57
|
originStartIndex: 0,
|
|
85
58
|
scrollTop: 0,
|
|
86
|
-
list:
|
|
59
|
+
list: e.listData.slice(),
|
|
87
60
|
cachePositions: [],
|
|
88
|
-
phantomHeight:
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
[prefixCls]: true
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
const visibleData = computed(() => {
|
|
106
|
-
return state.list.slice(state.start, end.value);
|
|
107
|
-
});
|
|
108
|
-
const getTransform = () => {
|
|
109
|
-
if (actualContent.value) {
|
|
110
|
-
return `translate3d(0, ${state.start >= 1 ? state.cachePositions[state.start - 1].bottom : 0}px, 0)`;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const initCachedPosition = () => {
|
|
114
|
-
state.cachePositions = [];
|
|
115
|
-
for (let i = 0; i < state.list.length; ++i) {
|
|
116
|
-
state.cachePositions[i] = {
|
|
117
|
-
index: i,
|
|
118
|
-
height: props.height,
|
|
119
|
-
top: i * props.height,
|
|
120
|
-
bottom: (i + 1) * (props.height + props.margin),
|
|
61
|
+
phantomHeight: e.height * e.listData.length
|
|
62
|
+
}), r = f(() => Math.min(e.containerHeight, M)), h = f(() => Math.ceil(r.value / e.height)), I = f(() => Math.min(t.originStartIndex + h.value + e.bufferSize, t.list.length)), w = f(() => ({
|
|
63
|
+
[nt]: !0
|
|
64
|
+
})), k = f(() => t.list.slice(t.start, I.value)), q = () => {
|
|
65
|
+
if (l.value)
|
|
66
|
+
return `translate3d(0, ${t.start >= 1 ? t.cachePositions[t.start - 1].bottom : 0}px, 0)`;
|
|
67
|
+
}, x = () => {
|
|
68
|
+
t.cachePositions = [];
|
|
69
|
+
for (let n = 0; n < t.list.length; ++n)
|
|
70
|
+
t.cachePositions[n] = {
|
|
71
|
+
index: n,
|
|
72
|
+
height: e.height,
|
|
73
|
+
top: n * e.height,
|
|
74
|
+
bottom: (n + 1) * (e.height + e.margin),
|
|
121
75
|
dValue: 0
|
|
122
76
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
nodes.forEach((node, index2) => {
|
|
130
|
-
if (!node)
|
|
77
|
+
}, V = () => {
|
|
78
|
+
let n = l.value.childNodes;
|
|
79
|
+
n = Array.from(n).filter((s) => s.nodeType === 1);
|
|
80
|
+
const u = n[0];
|
|
81
|
+
n.forEach((s, c) => {
|
|
82
|
+
if (!s)
|
|
131
83
|
return;
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const oldHeight = state.cachePositions[index2 + state.start].height;
|
|
135
|
-
const dValue = oldHeight - height2;
|
|
136
|
-
if (dValue) {
|
|
137
|
-
state.cachePositions[index2 + state.start].bottom -= dValue;
|
|
138
|
-
state.cachePositions[index2 + state.start].height = height2;
|
|
139
|
-
state.cachePositions[index2 + state.start].dValue = dValue;
|
|
140
|
-
}
|
|
84
|
+
const F = _(s), { height: T } = F, v = t.cachePositions[c + t.start].height - T;
|
|
85
|
+
v && (t.cachePositions[c + t.start].bottom -= v, t.cachePositions[c + t.start].height = T, t.cachePositions[c + t.start].dValue = v);
|
|
141
86
|
});
|
|
142
|
-
let
|
|
143
|
-
|
|
144
|
-
|
|
87
|
+
let a = 0;
|
|
88
|
+
u && (a = t.start);
|
|
89
|
+
const d = t.cachePositions.length;
|
|
90
|
+
let g = t.cachePositions[a].dValue;
|
|
91
|
+
t.cachePositions[a].dValue = 0;
|
|
92
|
+
for (let s = a + 1; s < d; ++s) {
|
|
93
|
+
const c = t.cachePositions[s];
|
|
94
|
+
t.cachePositions[s].top = t.cachePositions[s - 1].bottom, t.cachePositions[s].bottom = t.cachePositions[s].bottom - g, c.dValue !== 0 && (g += c.dValue, c.dValue = 0);
|
|
145
95
|
}
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
item.dValue = 0;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
const height = state.cachePositions[cachedPositionsLen - 1].bottom;
|
|
159
|
-
state.phantomHeight = height;
|
|
160
|
-
};
|
|
161
|
-
const getStartIndex = (scrollTop = 0) => {
|
|
162
|
-
let idx = binarySearch(
|
|
163
|
-
state.cachePositions,
|
|
164
|
-
scrollTop,
|
|
165
|
-
(currentValue, targetValue) => {
|
|
166
|
-
const currentCompareValue = currentValue.bottom;
|
|
167
|
-
if (currentCompareValue === targetValue) {
|
|
168
|
-
return CompareResult.eq;
|
|
169
|
-
}
|
|
170
|
-
if (currentCompareValue < targetValue) {
|
|
171
|
-
return CompareResult.lt;
|
|
172
|
-
}
|
|
173
|
-
return CompareResult.gt;
|
|
96
|
+
const P = t.cachePositions[d - 1].bottom;
|
|
97
|
+
t.phantomHeight = P;
|
|
98
|
+
}, A = (n = 0) => {
|
|
99
|
+
let u = et(
|
|
100
|
+
t.cachePositions,
|
|
101
|
+
n,
|
|
102
|
+
(d, g) => {
|
|
103
|
+
const P = d.bottom;
|
|
104
|
+
return P === g ? b.eq : P < g ? b.lt : b.gt;
|
|
174
105
|
}
|
|
175
106
|
);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
state.originStartIndex = 0;
|
|
184
|
-
state.start = 0;
|
|
185
|
-
state.scrollTop = 0;
|
|
186
|
-
list.value.scrollTop = 0;
|
|
187
|
-
initCachedPosition();
|
|
188
|
-
state.phantomHeight = props.height * state.list.length;
|
|
189
|
-
};
|
|
190
|
-
const handleScrollEvent = () => {
|
|
191
|
-
var _a;
|
|
192
|
-
const scrollTop = (_a = list.value) == null ? void 0 : _a.scrollTop;
|
|
193
|
-
const { originStartIndex } = state;
|
|
194
|
-
const currentIndex = getStartIndex(scrollTop);
|
|
195
|
-
if (currentIndex !== originStartIndex) {
|
|
196
|
-
state.originStartIndex = currentIndex;
|
|
197
|
-
state.start = Math.max(state.originStartIndex - props.bufferSize, 0);
|
|
198
|
-
if (end.value >= state.list.length - 1) {
|
|
199
|
-
emit("scroll-bottom");
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
emit(scrollTop > state.scrollTop ? "scroll-up" : "scroll-down", scrollTop);
|
|
203
|
-
state.scrollTop = scrollTop;
|
|
107
|
+
return t.cachePositions[u].bottom < n && (u += 1), u;
|
|
108
|
+
}, B = () => {
|
|
109
|
+
t.originStartIndex = 0, t.start = 0, t.scrollTop = 0, i.value.scrollTop = 0, x(), t.phantomHeight = e.height * t.list.length;
|
|
110
|
+
}, L = () => {
|
|
111
|
+
var d;
|
|
112
|
+
const n = (d = i.value) == null ? void 0 : d.scrollTop, { originStartIndex: u } = t, a = A(n);
|
|
113
|
+
a !== u && (t.originStartIndex = a, t.start = Math.max(t.originStartIndex - e.bufferSize, 0), I.value >= t.list.length - 1 && o("scroll-bottom")), o(n > t.scrollTop ? "scroll-up" : "scroll-down", n), t.scrollTop = n;
|
|
204
114
|
};
|
|
205
|
-
|
|
206
|
-
() =>
|
|
207
|
-
(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
} else {
|
|
213
|
-
resetAllVirtualParam();
|
|
115
|
+
return $(
|
|
116
|
+
() => e.listData,
|
|
117
|
+
(n) => {
|
|
118
|
+
if (t.list = n.slice(), t.list.length === n.length)
|
|
119
|
+
x(), V();
|
|
120
|
+
else {
|
|
121
|
+
B();
|
|
214
122
|
return;
|
|
215
123
|
}
|
|
216
124
|
}
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
() => state.start,
|
|
125
|
+
), $(
|
|
126
|
+
() => t.start,
|
|
220
127
|
() => {
|
|
221
|
-
|
|
222
|
-
updateCachedPosition();
|
|
223
|
-
}
|
|
128
|
+
l.value && t.list.length > 0 && V();
|
|
224
129
|
}
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
handleScrollEvent
|
|
130
|
+
), N(E({}, U(t)), {
|
|
131
|
+
list: i,
|
|
132
|
+
phantom: m,
|
|
133
|
+
actualContent: l,
|
|
134
|
+
getTransform: q,
|
|
135
|
+
visibleData: k,
|
|
136
|
+
classes: w,
|
|
137
|
+
getContainerHeight: r,
|
|
138
|
+
handleScrollEvent: L
|
|
235
139
|
});
|
|
236
140
|
}
|
|
237
141
|
});
|
|
238
|
-
function
|
|
239
|
-
return
|
|
240
|
-
class:
|
|
241
|
-
style:
|
|
242
|
-
onScrollPassive:
|
|
142
|
+
function st(e, o, i, m, l, t) {
|
|
143
|
+
return S(), y("div", {
|
|
144
|
+
class: W(e.classes),
|
|
145
|
+
style: H({ height: `${e.getContainerHeight}px` }),
|
|
146
|
+
onScrollPassive: o[0] || (o[0] = (...r) => e.handleScrollEvent && e.handleScrollEvent(...r)),
|
|
243
147
|
ref: "list"
|
|
244
148
|
}, [
|
|
245
|
-
|
|
149
|
+
z("div", {
|
|
246
150
|
class: "nut-list-phantom",
|
|
247
|
-
style:
|
|
151
|
+
style: H({ height: e.phantomHeight + "px" }),
|
|
248
152
|
ref: "phantom"
|
|
249
153
|
}, null, 4),
|
|
250
|
-
|
|
154
|
+
z("div", {
|
|
251
155
|
class: "nut-list-container",
|
|
252
|
-
style:
|
|
156
|
+
style: H({ transform: e.getTransform() }),
|
|
253
157
|
ref: "actualContent"
|
|
254
158
|
}, [
|
|
255
|
-
(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
]);
|
|
265
|
-
}), 128))
|
|
159
|
+
(S(!0), y(X, null, Y(e.visibleData, (r, h) => (S(), y("div", {
|
|
160
|
+
class: "nut-list-item",
|
|
161
|
+
key: r
|
|
162
|
+
}, [
|
|
163
|
+
Z(e.$slots, "default", {
|
|
164
|
+
item: r,
|
|
165
|
+
index: h + e.start
|
|
166
|
+
})
|
|
167
|
+
]))), 128))
|
|
266
168
|
], 4)
|
|
267
169
|
], 38);
|
|
268
170
|
}
|
|
269
|
-
const
|
|
171
|
+
const mt = /* @__PURE__ */ tt(it, [["render", st]]);
|
|
270
172
|
export {
|
|
271
|
-
|
|
173
|
+
mt as default
|
|
272
174
|
};
|