update scrollToItem API
This commit is contained in:
parent
bce9350959
commit
8214e50f79
@ -1889,7 +1889,9 @@ var List = /** @class */ (function (_super) {
|
|||||||
return this.cachedViews.values();
|
return this.cachedViews.values();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
List.prototype.scrollToItem = function (context, pos, animated) {
|
List.prototype.scrollToItem = function (context, pos, config) {
|
||||||
|
var _a;
|
||||||
|
var animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ pos: pos, animated: animated });
|
return this.nativeChannel(context, 'scrollToItem')({ pos: pos, animated: animated });
|
||||||
};
|
};
|
||||||
List.prototype.reset = function () {
|
List.prototype.reset = function () {
|
||||||
|
@ -1395,7 +1395,9 @@ class List extends Superview {
|
|||||||
return this.cachedViews.values();
|
return this.cachedViews.values();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scrollToItem(context, pos, animated) {
|
scrollToItem(context, pos, config) {
|
||||||
|
var _a;
|
||||||
|
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
||||||
}
|
}
|
||||||
reset() {
|
reset() {
|
||||||
|
@ -2854,7 +2854,9 @@ class List extends Superview {
|
|||||||
return this.cachedViews.values();
|
return this.cachedViews.values();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scrollToItem(context, pos, animated) {
|
scrollToItem(context, pos, config) {
|
||||||
|
var _a;
|
||||||
|
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
||||||
}
|
}
|
||||||
reset() {
|
reset() {
|
||||||
|
4
doric-js/index.d.ts
vendored
4
doric-js/index.d.ts
vendored
@ -523,7 +523,9 @@ declare module 'doric/lib/src/widget/list' {
|
|||||||
y: number;
|
y: number;
|
||||||
}) => void;
|
}) => void;
|
||||||
scrolledPosition?: number;
|
scrolledPosition?: number;
|
||||||
scrollToItem(context: BridgeContext, pos: number, animated?: boolean): Promise<any>;
|
scrollToItem(context: BridgeContext, pos: number, config?: {
|
||||||
|
animated?: boolean;
|
||||||
|
}): Promise<any>;
|
||||||
reset(): void;
|
reset(): void;
|
||||||
isDirty(): boolean;
|
isDirty(): boolean;
|
||||||
toModel(): NativeViewModel;
|
toModel(): NativeViewModel;
|
||||||
|
4
doric-js/lib/src/widget/list.d.ts
vendored
4
doric-js/lib/src/widget/list.d.ts
vendored
@ -26,7 +26,9 @@ export declare class List extends Superview {
|
|||||||
y: number;
|
y: number;
|
||||||
}) => void;
|
}) => void;
|
||||||
scrolledPosition?: number;
|
scrolledPosition?: number;
|
||||||
scrollToItem(context: BridgeContext, pos: number, animated?: boolean): Promise<any>;
|
scrollToItem(context: BridgeContext, pos: number, config?: {
|
||||||
|
animated?: boolean;
|
||||||
|
}): Promise<any>;
|
||||||
reset(): void;
|
reset(): void;
|
||||||
private getItem;
|
private getItem;
|
||||||
isDirty(): boolean;
|
isDirty(): boolean;
|
||||||
|
@ -47,7 +47,9 @@ export class List extends Superview {
|
|||||||
return this.cachedViews.values();
|
return this.cachedViews.values();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scrollToItem(context, pos, animated) {
|
scrollToItem(context, pos, config) {
|
||||||
|
var _a;
|
||||||
|
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
||||||
}
|
}
|
||||||
reset() {
|
reset() {
|
||||||
|
@ -67,7 +67,8 @@ export class List extends Superview {
|
|||||||
@Property
|
@Property
|
||||||
scrolledPosition?: number
|
scrolledPosition?: number
|
||||||
|
|
||||||
scrollToItem(context: BridgeContext, pos: number, animated?: boolean) {
|
scrollToItem(context: BridgeContext, pos: number, config?: { animated?: boolean }) {
|
||||||
|
const animated = config?.animated
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ pos, animated }) as Promise<any>
|
return this.nativeChannel(context, 'scrollToItem')({ pos, animated }) as Promise<any>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
doric-web/dist/index.js
vendored
4
doric-web/dist/index.js
vendored
@ -2912,7 +2912,9 @@ class List extends Superview {
|
|||||||
return this.cachedViews.values();
|
return this.cachedViews.values();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scrollToItem(context, pos, animated) {
|
scrollToItem(context, pos, config) {
|
||||||
|
var _a;
|
||||||
|
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
return this.nativeChannel(context, 'scrollToItem')({ pos, animated });
|
||||||
}
|
}
|
||||||
reset() {
|
reset() {
|
||||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user