diff --git a/doric-js/bundle/doric-lib.es5.js b/doric-js/bundle/doric-lib.es5.js index 855b73d8..658f4d7f 100644 --- a/doric-js/bundle/doric-lib.es5.js +++ b/doric-js/bundle/doric-lib.es5.js @@ -2586,6 +2586,10 @@ var List = /** @class */ (function (_super) { Property, __metadata$b("design:type", Boolean) ], List.prototype, "canDrag", void 0); + __decorate$b([ + Property, + __metadata$b("design:type", Function) + ], List.prototype, "itemCanDrag", void 0); __decorate$b([ Property, __metadata$b("design:type", Function) @@ -3268,6 +3272,10 @@ var FlowLayout = /** @class */ (function (_super) { Property, __metadata$7("design:type", Boolean) ], FlowLayout.prototype, "canDrag", void 0); + __decorate$7([ + Property, + __metadata$7("design:type", Function) + ], FlowLayout.prototype, "itemCanDrag", void 0); __decorate$7([ Property, __metadata$7("design:type", Function) @@ -4010,6 +4018,10 @@ var HorizontalList = /** @class */ (function (_super) { Property, __metadata("design:type", Boolean) ], HorizontalList.prototype, "canDrag", void 0); + __decorate([ + Property, + __metadata("design:type", Function) + ], HorizontalList.prototype, "itemCanDrag", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/bundle/doric-lib.js b/doric-js/bundle/doric-lib.js index e733430c..61948c7f 100644 --- a/doric-js/bundle/doric-lib.js +++ b/doric-js/bundle/doric-lib.js @@ -1972,6 +1972,10 @@ __decorate$b([ Property, __metadata$b("design:type", Boolean) ], List.prototype, "canDrag", void 0); +__decorate$b([ + Property, + __metadata$b("design:type", Function) +], List.prototype, "itemCanDrag", void 0); __decorate$b([ Property, __metadata$b("design:type", Function) @@ -2505,6 +2509,10 @@ __decorate$7([ Property, __metadata$7("design:type", Boolean) ], FlowLayout.prototype, "canDrag", void 0); +__decorate$7([ + Property, + __metadata$7("design:type", Function) +], FlowLayout.prototype, "itemCanDrag", void 0); __decorate$7([ Property, __metadata$7("design:type", Function) @@ -3071,6 +3079,10 @@ __decorate([ Property, __metadata("design:type", Boolean) ], HorizontalList.prototype, "canDrag", void 0); +__decorate([ + Property, + __metadata("design:type", Function) +], HorizontalList.prototype, "itemCanDrag", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index cb300eb8..bd0f8259 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -3502,6 +3502,10 @@ __decorate$b([ Property, __metadata$b("design:type", Boolean) ], List.prototype, "canDrag", void 0); +__decorate$b([ + Property, + __metadata$b("design:type", Function) +], List.prototype, "itemCanDrag", void 0); __decorate$b([ Property, __metadata$b("design:type", Function) @@ -4035,6 +4039,10 @@ __decorate$7([ Property, __metadata$7("design:type", Boolean) ], FlowLayout.prototype, "canDrag", void 0); +__decorate$7([ + Property, + __metadata$7("design:type", Function) +], FlowLayout.prototype, "itemCanDrag", void 0); __decorate$7([ Property, __metadata$7("design:type", Function) @@ -4601,6 +4609,10 @@ __decorate([ Property, __metadata("design:type", Boolean) ], HorizontalList.prototype, "canDrag", void 0); +__decorate([ + Property, + __metadata("design:type", Function) +], HorizontalList.prototype, "itemCanDrag", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/index.d.ts b/doric-js/index.d.ts index b4f87368..f2313554 100644 --- a/doric-js/index.d.ts +++ b/doric-js/index.d.ts @@ -1029,7 +1029,16 @@ declare module "doric" { */ bounces?: boolean; canDrag?: boolean; - beforeDragging?: (from: number) => void; + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + itemCanDrag?: (from: number) => boolean; + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + beforeDragging?: (from: number) => (Array | void); onDragging?: (from: number, to: number) => void; onDragged?: (from: number, to: number) => void; scrollToItem(context: BridgeContext, index: number, config?: { @@ -1191,7 +1200,16 @@ declare module "doric" { */ bounces?: boolean; canDrag?: boolean; - beforeDragging?: (from: number) => void; + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + itemCanDrag?: (from: number) => boolean; + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + beforeDragging?: (from: number) => (Array | void); onDragging?: (from: number, to: number) => void; onDragged?: (from: number, to: number) => void; /** @@ -1454,7 +1472,16 @@ declare module "doric" { */ bounces?: boolean; canDrag?: boolean; - beforeDragging?: (from: number) => void; + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + itemCanDrag?: (from: number) => boolean; + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + beforeDragging?: (from: number) => (Array | void); onDragging?: (from: number, to: number) => void; onDragged?: (from: number, to: number) => void; scrollToItem(context: BridgeContext, index: number, config?: { diff --git a/doric-js/lib/src/widget/flowlayout.d.ts b/doric-js/lib/src/widget/flowlayout.d.ts index f922eeee..9d3bb1c5 100644 --- a/doric-js/lib/src/widget/flowlayout.d.ts +++ b/doric-js/lib/src/widget/flowlayout.d.ts @@ -38,7 +38,16 @@ export declare class FlowLayout extends Superview { */ bounces?: boolean; canDrag?: boolean; - beforeDragging?: (from: number) => void; + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + itemCanDrag?: (from: number) => boolean; + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + beforeDragging?: (from: number) => (Array | void); onDragging?: (from: number, to: number) => void; onDragged?: (from: number, to: number) => void; /** diff --git a/doric-js/lib/src/widget/flowlayout.js b/doric-js/lib/src/widget/flowlayout.js index deb91a57..a60b596b 100644 --- a/doric-js/lib/src/widget/flowlayout.js +++ b/doric-js/lib/src/widget/flowlayout.js @@ -151,6 +151,10 @@ __decorate([ Property, __metadata("design:type", Boolean) ], FlowLayout.prototype, "canDrag", void 0); +__decorate([ + Property, + __metadata("design:type", Function) +], FlowLayout.prototype, "itemCanDrag", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/lib/src/widget/horizontalList.d.ts b/doric-js/lib/src/widget/horizontalList.d.ts index 004cbf1a..0d29dd3e 100644 --- a/doric-js/lib/src/widget/horizontalList.d.ts +++ b/doric-js/lib/src/widget/horizontalList.d.ts @@ -31,7 +31,16 @@ export declare class HorizontalList extends Superview { */ bounces?: boolean; canDrag?: boolean; - beforeDragging?: (from: number) => void; + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + itemCanDrag?: (from: number) => boolean; + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + beforeDragging?: (from: number) => (Array | void); onDragging?: (from: number, to: number) => void; onDragged?: (from: number, to: number) => void; scrollToItem(context: BridgeContext, index: number, config?: { diff --git a/doric-js/lib/src/widget/horizontalList.js b/doric-js/lib/src/widget/horizontalList.js index 3bfebf52..f0d84887 100644 --- a/doric-js/lib/src/widget/horizontalList.js +++ b/doric-js/lib/src/widget/horizontalList.js @@ -142,6 +142,10 @@ __decorate([ Property, __metadata("design:type", Boolean) ], HorizontalList.prototype, "canDrag", void 0); +__decorate([ + Property, + __metadata("design:type", Function) +], HorizontalList.prototype, "itemCanDrag", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/lib/src/widget/list.d.ts b/doric-js/lib/src/widget/list.d.ts index 821084e0..e3034a21 100644 --- a/doric-js/lib/src/widget/list.d.ts +++ b/doric-js/lib/src/widget/list.d.ts @@ -37,7 +37,16 @@ export declare class List extends Superview { */ bounces?: boolean; canDrag?: boolean; - beforeDragging?: (from: number) => void; + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + itemCanDrag?: (from: number) => boolean; + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + beforeDragging?: (from: number) => (Array | void); onDragging?: (from: number, to: number) => void; onDragged?: (from: number, to: number) => void; scrollToItem(context: BridgeContext, index: number, config?: { diff --git a/doric-js/lib/src/widget/list.js b/doric-js/lib/src/widget/list.js index b3eaa9a2..86062f54 100644 --- a/doric-js/lib/src/widget/list.js +++ b/doric-js/lib/src/widget/list.js @@ -146,6 +146,10 @@ __decorate([ Property, __metadata("design:type", Boolean) ], List.prototype, "canDrag", void 0); +__decorate([ + Property, + __metadata("design:type", Function) +], List.prototype, "itemCanDrag", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/src/widget/flowlayout.ts b/doric-js/src/widget/flowlayout.ts index a8543d03..6d0cfcaa 100644 --- a/doric-js/src/widget/flowlayout.ts +++ b/doric-js/src/widget/flowlayout.ts @@ -87,8 +87,19 @@ export class FlowLayout extends Superview { @Property canDrag?: boolean + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ @Property - beforeDragging?: (from: number) => void + itemCanDrag?: (from: number) => boolean + + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ + @Property + beforeDragging?: (from: number) => (Array | void) @Property onDragging?: (from: number, to: number) => void diff --git a/doric-js/src/widget/horizontalList.ts b/doric-js/src/widget/horizontalList.ts index 9414819b..d564ff68 100644 --- a/doric-js/src/widget/horizontalList.ts +++ b/doric-js/src/widget/horizontalList.ts @@ -84,8 +84,19 @@ export class HorizontalList extends Superview { @Property canDrag?: boolean + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + @Property + itemCanDrag?: (from: number) => boolean + + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ @Property - beforeDragging?: (from: number) => void + beforeDragging?: (from: number) => (Array | void) @Property onDragging?: (from: number, to: number) => void diff --git a/doric-js/src/widget/list.ts b/doric-js/src/widget/list.ts index 4c8f3f98..8d31a8c0 100644 --- a/doric-js/src/widget/list.ts +++ b/doric-js/src/widget/list.ts @@ -84,8 +84,19 @@ export class List extends Superview { @Property canDrag?: boolean + /** + * @param from + * @returns Returns the item of index which can dragged or not. + */ + @Property + itemCanDrag?: (from: number) => boolean + + /** + * @param from + * @returns Returns an array of index which can not be swap during dragging. + */ @Property - beforeDragging?: (from: number) => void + beforeDragging?: (from: number) => (Array | void) @Property onDragging?: (from: number, to: number) => void