acud 1.0.4 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acud.css +23 -9
- package/dist/acud.css.map +1 -1
- package/dist/acud.js +426 -748
- package/dist/acud.js.map +1 -1
- package/dist/acud.min.css +1 -1
- package/dist/acud.min.css.map +1 -1
- package/dist/acud.min.js +9 -9
- package/dist/acud.min.js.map +1 -1
- package/es/_util/createWorker.d.ts +1 -0
- package/es/_util/createWorker.js +9 -0
- package/es/date-picker/src/PickerPanel.js +1 -0
- package/es/date-picker/src/RangePicker.js +1 -0
- package/es/date-picker/style/index.css +22 -0
- package/es/date-picker/style/index.less +4 -0
- package/es/date-picker/style/panel.less +11 -0
- package/es/input-number/src/hooks/useFrame.d.ts +1 -1
- package/es/select/src/OptionList.js +6 -6
- package/es/timeline/style/common.less +4 -4
- package/es/timeline/style/index.css +0 -8
- package/es/toast/style/index.less +1 -1
- package/es/transfer/DataSource.js +43 -7
- package/es/transfer/index.d.ts +1 -0
- package/es/virtual-list/List.js +7 -0
- package/lib/_util/createWorker.d.ts +1 -0
- package/lib/_util/createWorker.js +16 -0
- package/lib/date-picker/src/PickerPanel.js +1 -0
- package/lib/date-picker/src/RangePicker.js +1 -0
- package/lib/date-picker/style/index.css +22 -0
- package/lib/date-picker/style/index.less +4 -0
- package/lib/date-picker/style/panel.less +11 -0
- package/lib/input-number/src/hooks/useFrame.d.ts +1 -1
- package/lib/select/src/OptionList.js +6 -6
- package/lib/timeline/style/common.less +4 -4
- package/lib/timeline/style/index.css +0 -8
- package/lib/toast/style/index.less +1 -1
- package/lib/transfer/DataSource.js +45 -7
- package/lib/transfer/index.d.ts +1 -0
- package/lib/virtual-list/List.js +7 -0
- package/package.json +2 -1
package/lib/virtual-list/List.js
CHANGED
|
@@ -165,6 +165,7 @@ function RawList(props, ref) {
|
|
|
165
165
|
} // Always use virtual scroll bar in avoid shaking
|
|
166
166
|
|
|
167
167
|
|
|
168
|
+
// Always use virtual scroll bar in avoid shaking
|
|
168
169
|
if (!inVirtual) {
|
|
169
170
|
return {
|
|
170
171
|
scrollHeight: ((_a = fillerInnerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0,
|
|
@@ -186,12 +187,14 @@ function RawList(props, ref) {
|
|
|
186
187
|
var cacheHeight = heights.get(key);
|
|
187
188
|
var currentItemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight); // Check item top in the range
|
|
188
189
|
|
|
190
|
+
// Check item top in the range
|
|
189
191
|
if (currentItemBottom >= scrollTop && startIndex === undefined) {
|
|
190
192
|
startIndex = i;
|
|
191
193
|
startOffset = itemTop;
|
|
192
194
|
} // Check item bottom in the range. We will render additional one item for motion usage
|
|
193
195
|
|
|
194
196
|
|
|
197
|
+
// Check item bottom in the range. We will render additional one item for motion usage
|
|
195
198
|
if (currentItemBottom > scrollTop + height && endIndex === undefined) {
|
|
196
199
|
endIndex = i;
|
|
197
200
|
}
|
|
@@ -202,6 +205,9 @@ function RawList(props, ref) {
|
|
|
202
205
|
/* istanbul ignore next */
|
|
203
206
|
|
|
204
207
|
|
|
208
|
+
// Fallback to normal if not match. This code should never reach
|
|
209
|
+
|
|
210
|
+
/* istanbul ignore next */
|
|
205
211
|
if (startIndex === undefined) {
|
|
206
212
|
startIndex = 0;
|
|
207
213
|
startOffset = 0;
|
|
@@ -212,6 +218,7 @@ function RawList(props, ref) {
|
|
|
212
218
|
} // Give cache to improve scroll experience
|
|
213
219
|
|
|
214
220
|
|
|
221
|
+
// Give cache to improve scroll experience
|
|
215
222
|
endIndex = Math.min(endIndex + 1, mergedData.length);
|
|
216
223
|
return {
|
|
217
224
|
scrollHeight: itemTop,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acud",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "acg react 组件库",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"lint:style": "stylelint 'components/**/*.less' --syntax less",
|
|
22
22
|
"lint-fix:script": "npm run lint:script -- --fix",
|
|
23
23
|
"lint-fix:style": "npm run lint:style -- --fix",
|
|
24
|
+
"prepare": "curl -s http://icode.baidu.com/tools/hooks/commit-msg > .husky/commit-msg && echo '\nsh \".husky/commit-msg.sh\"' >> .husky/commit-msg && chmod u+x .husky/commit-msg && husky install",
|
|
24
25
|
"prepublishOnly": "npm run build",
|
|
25
26
|
"pub": "node ./scripts/publish.js"
|
|
26
27
|
},
|