feat: add preloadItemCount for List, incase we need preload more items before scroll to end

This commit is contained in:
pengfei.zhou
2023-03-09 10:55:32 +08:00
committed by jingpeng
parent 4103704162
commit 0774df96e1
26 changed files with 4495 additions and 2639 deletions

View File

@@ -2645,6 +2645,10 @@ var List = /** @class */ (function (_super) {
Property,
__metadata$b("design:type", Function)
], List.prototype, "onDragged", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Number)
], List.prototype, "preloadItemCount", void 0);
return List;
}(Superview));
function list(config) {
@@ -4402,7 +4406,7 @@ var __generator$1 = (undefined && undefined.__generator) || function (thisArg, b
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) { throw new TypeError("Generator is already executing."); }
while (_) { try {
while (g && (g = 0, op[0] && (_ = 0)), _) { try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; }
if (y = 0, t) { op = [op[0] & 2, t.value]; }
switch (op[0]) {
@@ -4631,7 +4635,7 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) { throw new TypeError("Generator is already executing."); }
while (_) { try {
while (g && (g = 0, op[0] && (_ = 0)), _) { try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; }
if (y = 0, t) { op = [op[0] & 2, t.value]; }
switch (op[0]) {

View File

@@ -161,6 +161,24 @@ function createRef() {
return new Ref;
}
class View {
callback2Id(f) {
const id = uniqueId('Function');
this.callbacks.set(id, f);
return id;
}
id2Callback(id) {
let f = this.callbacks.get(id);
if (f === undefined) {
f = Reflect.get(this, id);
}
return f;
}
findViewByTag(tag) {
if (tag === this.tag) {
return this;
}
return undefined;
}
constructor() {
this.width = 0;
this.height = 0;
@@ -192,24 +210,6 @@ class View {
}
});
}
callback2Id(f) {
const id = uniqueId('Function');
this.callbacks.set(id, f);
return id;
}
id2Callback(id) {
let f = this.callbacks.get(id);
if (f === undefined) {
f = Reflect.get(this, id);
}
return f;
}
findViewByTag(tag) {
if (tag === this.tag) {
return this;
}
return undefined;
}
/** Anchor start*/
get left() {
return this.x;
@@ -2010,6 +2010,10 @@ __decorate$b([
Property,
__metadata$b("design:type", Function)
], List.prototype, "onDragged", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Number)
], List.prototype, "preloadItemCount", void 0);
function list(config) {
const ret = new List;
ret.apply(config);

File diff suppressed because it is too large Load Diff

View File

@@ -1273,6 +1273,16 @@ var doric = (function (exports) {
}
}
class Context {
hookBeforeNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []);
}
}
hookAfterNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []);
}
}
constructor(id) {
this.callbacks = new Map;
this.classes = new Map;
@@ -1307,16 +1317,6 @@ var doric = (function (exports) {
}
});
}
hookBeforeNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []);
}
}
hookAfterNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []);
}
}
callNative(namespace, method, args) {
const callbackId = uniqueId('callback');
return new Promise((resolve, reject) => {

View File

@@ -1284,6 +1284,16 @@ function jsCallReject(contextId, callbackId, args) {
}
}
class Context {
hookBeforeNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []);
}
}
hookAfterNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []);
}
}
constructor(id) {
this.callbacks = new Map;
this.classes = new Map;
@@ -1318,16 +1328,6 @@ class Context {
}
});
}
hookBeforeNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []);
}
}
hookAfterNativeCall() {
if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) {
Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []);
}
}
callNative(namespace, method, args) {
const callbackId = uniqueId('callback');
return new Promise((resolve, reject) => {
@@ -1701,6 +1701,24 @@ function createRef() {
return new Ref;
}
class View {
callback2Id(f) {
const id = uniqueId('Function');
this.callbacks.set(id, f);
return id;
}
id2Callback(id) {
let f = this.callbacks.get(id);
if (f === undefined) {
f = Reflect.get(this, id);
}
return f;
}
findViewByTag(tag) {
if (tag === this.tag) {
return this;
}
return undefined;
}
constructor() {
this.width = 0;
this.height = 0;
@@ -1732,24 +1750,6 @@ class View {
}
});
}
callback2Id(f) {
const id = uniqueId('Function');
this.callbacks.set(id, f);
return id;
}
id2Callback(id) {
let f = this.callbacks.get(id);
if (f === undefined) {
f = Reflect.get(this, id);
}
return f;
}
findViewByTag(tag) {
if (tag === this.tag) {
return this;
}
return undefined;
}
/** Anchor start*/
get left() {
return this.x;
@@ -3550,6 +3550,10 @@ __decorate$b([
Property,
__metadata$b("design:type", Function)
], List.prototype, "onDragged", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Number)
], List.prototype, "preloadItemCount", void 0);
function list(config) {
const ret = new List;
ret.apply(config);