js: add slidePosition

This commit is contained in:
pengfei.zhou
2023-04-04 19:49:10 +08:00
committed by osborn
parent f1177e27b4
commit 930593fe0c
11 changed files with 98 additions and 14 deletions

View File

@@ -2641,7 +2641,7 @@ var List = /** @class */ (function (_super) {
__metadata$b("design:type", Function)
], List.prototype, "onScrollEnd", void 0);
__decorate$b([
Property,
InconsistProperty,
__metadata$b("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
__decorate$b([
@@ -2820,6 +2820,10 @@ var Slider = /** @class */ (function (_super) {
Property,
__metadata$a("design:type", Object)
], Slider.prototype, "slideStyle", void 0);
__decorate$a([
InconsistProperty,
__metadata$a("design:type", Number)
], Slider.prototype, "slidePosition", void 0);
return Slider;
}(Superview));
function slider(config) {

View File

@@ -1993,7 +1993,7 @@ __decorate$b([
__metadata$b("design:type", Function)
], List.prototype, "onScrollEnd", void 0);
__decorate$b([
Property,
InconsistProperty,
__metadata$b("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
__decorate$b([
@@ -2147,6 +2147,10 @@ __decorate$a([
Property,
__metadata$a("design:type", Object)
], Slider.prototype, "slideStyle", void 0);
__decorate$a([
InconsistProperty,
__metadata$a("design:type", Number)
], Slider.prototype, "slidePosition", void 0);
function slider(config) {
const ret = new Slider;
ret.apply(config);

View File

@@ -3533,7 +3533,7 @@ __decorate$b([
__metadata$b("design:type", Function)
], List.prototype, "onScrollEnd", void 0);
__decorate$b([
Property,
InconsistProperty,
__metadata$b("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
__decorate$b([
@@ -3687,6 +3687,10 @@ __decorate$a([
Property,
__metadata$a("design:type", Object)
], Slider.prototype, "slideStyle", void 0);
__decorate$a([
InconsistProperty,
__metadata$a("design:type", Number)
], Slider.prototype, "slidePosition", void 0);
function slider(config) {
const ret = new Slider;
ret.apply(config);

1
doric-js/index.d.ts vendored
View File

@@ -1106,6 +1106,7 @@ declare module "doric" {
minScale: number;
maxScale: number;
};
slidePosition?: number;
/**
* Reload all list items.
* @param context

View File

@@ -22,7 +22,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { View, Property, Superview } from "../ui/view";
import { View, Property, Superview, InconsistProperty } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
import { deepClone } from "./utils";
@@ -133,7 +133,7 @@ __decorate([
__metadata("design:type", Function)
], List.prototype, "onScrollEnd", void 0);
__decorate([
Property,
InconsistProperty,
__metadata("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
__decorate([

View File

@@ -33,6 +33,7 @@ export declare class Slider extends Superview {
minScale: number;
maxScale: number;
};
slidePosition?: number;
/**
* Reload all list items.
* @param context

View File

@@ -22,7 +22,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Superview, View, Property } from "../ui/view";
import { Superview, View, Property, InconsistProperty } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
import { deepClone } from "./utils";
@@ -110,6 +110,10 @@ __decorate([
Property,
__metadata("design:type", Object)
], Slider.prototype, "slideStyle", void 0);
__decorate([
InconsistProperty,
__metadata("design:type", Number)
], Slider.prototype, "slidePosition", void 0);
export function slider(config) {
const ret = new Slider;
ret.apply(config);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { View, Property, Superview, NativeViewModel } from "../ui/view";
import { View, Property, Superview, NativeViewModel, InconsistProperty } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
import { BridgeContext } from "../runtime/global";
@@ -71,7 +71,7 @@ export class List extends Superview {
@Property
onScrollEnd?: (offset: { x: number, y: number }) => void
@Property
@InconsistProperty
scrolledPosition?: number
@Property

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Superview, View, Property } from "../ui/view";
import { Superview, View, Property, InconsistProperty } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
import { BridgeContext } from "../runtime/global";
@@ -71,6 +71,9 @@ export class Slider extends Superview {
@Property
slideStyle?: "zoomOut" | { type: "zoomOut", minScale: number, maxScale: number }
@InconsistProperty
slidePosition?: number
/**
* Reload all list items.
* @param context