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