feat: add bounces for list,scroller,nestedSlider,flowlayout
This commit is contained in:
parent
e621db48b9
commit
6da8d5658b
@ -192,6 +192,8 @@ - (UICollectionView *)build {
|
||||
- (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValue:(id)prop {
|
||||
if ([@"scrollable" isEqualToString:name]) {
|
||||
self.view.scrollEnabled = [prop boolValue];
|
||||
} else if ([@"bounces" isEqualToString:name]) {
|
||||
self.view.bounces = [prop boolValue];
|
||||
} else if ([@"columnSpace" isEqualToString:name]) {
|
||||
self.columnSpace = [prop floatValue];
|
||||
[self.view.collectionViewLayout invalidateLayout];
|
||||
|
@ -96,6 +96,8 @@ - (UITableView *)build {
|
||||
- (void)blendView:(UITableView *)view forPropName:(NSString *)name propValue:(id)prop {
|
||||
if ([@"scrollable" isEqualToString:name]) {
|
||||
self.view.scrollEnabled = [prop boolValue];
|
||||
} else if ([@"bounces" isEqualToString:name]) {
|
||||
self.view.bounces = [prop boolValue];
|
||||
} else if ([@"itemCount" isEqualToString:name]) {
|
||||
self.itemCount = [prop unsignedIntegerValue];
|
||||
[self.view reloadData];
|
||||
|
@ -48,6 +48,8 @@ - (UIScrollView *)build {
|
||||
- (void)blendView:(UIScrollView *)view forPropName:(NSString *)name propValue:(id)prop {
|
||||
if ([@"scrollable" isEqualToString:name]) {
|
||||
self.view.scrollEnabled = [prop boolValue];
|
||||
} else if ([@"bounces" isEqualToString:name]) {
|
||||
self.view.bounces = [prop boolValue];
|
||||
} else if ([@"onPageSlided" isEqualToString:name]) {
|
||||
self.onPageSelectedFuncId = prop;
|
||||
} else {
|
||||
|
@ -129,6 +129,8 @@ - (void)requestLayout {
|
||||
- (void)blendView:(DoricScrollView *)view forPropName:(NSString *)name propValue:(id)prop {
|
||||
if ([@"scrollable" isEqualToString:name]) {
|
||||
self.view.scrollEnabled = [prop boolValue];
|
||||
} else if ([@"bounces" isEqualToString:name]) {
|
||||
self.view.bounces = [prop boolValue];
|
||||
} else if ([@"content" isEqualToString:name]) {
|
||||
self.childViewId = prop;
|
||||
} else if ([@"onScroll" isEqualToString:name]) {
|
||||
|
@ -2142,6 +2142,10 @@ var List = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "scrollable", void 0);
|
||||
__decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
return List;
|
||||
}(Superview));
|
||||
function list(config) {
|
||||
@ -2362,6 +2366,10 @@ var Scroller = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "scrollable", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "bounces", void 0);
|
||||
return Scroller;
|
||||
}(Superview));
|
||||
|
||||
@ -2671,6 +2679,10 @@ var FlowLayout = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "scrollable", void 0);
|
||||
__decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
return FlowLayout;
|
||||
}(Superview));
|
||||
function flowlayout(config) {
|
||||
@ -2858,6 +2870,10 @@ var NestedSlider = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "scrollable", void 0);
|
||||
__decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "bounces", void 0);
|
||||
return NestedSlider;
|
||||
}(Group));
|
||||
|
||||
|
@ -1637,6 +1637,10 @@ __decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "scrollable", void 0);
|
||||
__decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
function list(config) {
|
||||
const ret = new List;
|
||||
for (let key in config) {
|
||||
@ -1812,6 +1816,10 @@ __decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "scrollable", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "bounces", void 0);
|
||||
|
||||
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@ -2055,6 +2063,10 @@ __decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "scrollable", void 0);
|
||||
__decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
@ -2200,6 +2212,10 @@ __decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "scrollable", void 0);
|
||||
__decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "bounces", void 0);
|
||||
|
||||
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
|
@ -3158,6 +3158,10 @@ __decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "scrollable", void 0);
|
||||
__decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
function list(config) {
|
||||
const ret = new List;
|
||||
for (let key in config) {
|
||||
@ -3333,6 +3337,10 @@ __decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "scrollable", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "bounces", void 0);
|
||||
|
||||
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@ -3576,6 +3584,10 @@ __decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "scrollable", void 0);
|
||||
__decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
@ -3721,6 +3733,10 @@ __decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "scrollable", void 0);
|
||||
__decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "bounces", void 0);
|
||||
|
||||
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
|
4
doric-js/index.d.ts
vendored
4
doric-js/index.d.ts
vendored
@ -617,6 +617,7 @@ declare module 'doric/lib/src/widget/list' {
|
||||
}) => void;
|
||||
scrolledPosition?: number;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||
animated?: boolean;
|
||||
}): Promise<any>;
|
||||
@ -672,6 +673,7 @@ declare module 'doric/lib/src/widget/scroller' {
|
||||
y: number;
|
||||
}) => void;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
allSubviews(): View[];
|
||||
toModel(): NativeViewModel;
|
||||
scrollTo(context: BridgeContext, offset: {
|
||||
@ -737,6 +739,7 @@ declare module 'doric/lib/src/widget/flowlayout' {
|
||||
y: number;
|
||||
}) => void;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
reset(): void;
|
||||
toModel(): NativeViewModel;
|
||||
}
|
||||
@ -783,6 +786,7 @@ declare module 'doric/lib/src/widget/nestedSlider' {
|
||||
export class NestedSlider extends Group {
|
||||
onPageSlided?: (index: number) => void;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
addSlideItem(view: View): void;
|
||||
slidePage(context: BridgeContext, page: number, smooth?: boolean): Promise<any>;
|
||||
getSlidedPage(context: BridgeContext): Promise<number>;
|
||||
|
1
doric-js/lib/src/widget/flowlayout.d.ts
vendored
1
doric-js/lib/src/widget/flowlayout.d.ts
vendored
@ -27,6 +27,7 @@ export declare class FlowLayout extends Superview {
|
||||
y: number;
|
||||
}) => void;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
reset(): void;
|
||||
private getItem;
|
||||
private renderBunchedItems;
|
||||
|
@ -118,6 +118,10 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], FlowLayout.prototype, "scrollable", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
export function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
|
1
doric-js/lib/src/widget/list.d.ts
vendored
1
doric-js/lib/src/widget/list.d.ts
vendored
@ -32,6 +32,7 @@ export declare class List extends Superview {
|
||||
}) => void;
|
||||
scrolledPosition?: number;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||
animated?: boolean;
|
||||
}): Promise<any>;
|
||||
|
@ -117,6 +117,10 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], List.prototype, "scrollable", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
export function list(config) {
|
||||
const ret = new List;
|
||||
for (let key in config) {
|
||||
|
1
doric-js/lib/src/widget/nestedSlider.d.ts
vendored
1
doric-js/lib/src/widget/nestedSlider.d.ts
vendored
@ -3,6 +3,7 @@ import { BridgeContext } from '../runtime/global';
|
||||
export declare class NestedSlider extends Group {
|
||||
onPageSlided?: (index: number) => void;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
addSlideItem(view: View): void;
|
||||
slidePage(context: BridgeContext, page: number, smooth?: boolean): Promise<any>;
|
||||
getSlidedPage(context: BridgeContext): Promise<number>;
|
||||
|
@ -42,3 +42,7 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], NestedSlider.prototype, "scrollable", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], NestedSlider.prototype, "bounces", void 0);
|
||||
|
1
doric-js/lib/src/widget/scroller.d.ts
vendored
1
doric-js/lib/src/widget/scroller.d.ts
vendored
@ -16,6 +16,7 @@ export declare class Scroller extends Superview {
|
||||
y: number;
|
||||
}) => void;
|
||||
scrollable?: boolean;
|
||||
bounces?: boolean;
|
||||
allSubviews(): View[];
|
||||
toModel(): NativeViewModel;
|
||||
scrollTo(context: BridgeContext, offset: {
|
||||
|
@ -66,3 +66,7 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], Scroller.prototype, "scrollable", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], Scroller.prototype, "bounces", void 0);
|
||||
|
@ -72,6 +72,9 @@ export class FlowLayout extends Superview {
|
||||
@Property
|
||||
scrollable?: boolean
|
||||
|
||||
@Property
|
||||
bounces?: boolean
|
||||
|
||||
reset() {
|
||||
this.cachedViews.clear()
|
||||
this.itemCount = 0
|
||||
|
@ -76,6 +76,9 @@ export class List extends Superview {
|
||||
@Property
|
||||
scrollable?: boolean
|
||||
|
||||
@Property
|
||||
bounces?: boolean
|
||||
|
||||
scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean, }) {
|
||||
const animated = config?.animated
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, }) as Promise<any>
|
||||
|
@ -24,6 +24,9 @@ export class NestedSlider extends Group {
|
||||
@Property
|
||||
scrollable?: boolean
|
||||
|
||||
@Property
|
||||
bounces?: boolean
|
||||
|
||||
addSlideItem(view: View) {
|
||||
this.addChild(view)
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ export class Scroller extends Superview {
|
||||
@Property
|
||||
scrollable?: boolean
|
||||
|
||||
@Property
|
||||
bounces?: boolean
|
||||
|
||||
allSubviews() {
|
||||
return [this.content]
|
||||
}
|
||||
|
16
doric-web/dist/index.js
vendored
16
doric-web/dist/index.js
vendored
@ -3212,6 +3212,10 @@ __decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "scrollable", void 0);
|
||||
__decorate$8([
|
||||
Property,
|
||||
__metadata$8("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
function list(config) {
|
||||
const ret = new List;
|
||||
for (let key in config) {
|
||||
@ -3387,6 +3391,10 @@ __decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "scrollable", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Scroller.prototype, "bounces", void 0);
|
||||
|
||||
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@ -3630,6 +3638,10 @@ __decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "scrollable", void 0);
|
||||
__decorate$4([
|
||||
Property,
|
||||
__metadata$4("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
@ -3775,6 +3787,10 @@ __decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "scrollable", void 0);
|
||||
__decorate$2([
|
||||
Property,
|
||||
__metadata$2("design:type", Boolean)
|
||||
], NestedSlider.prototype, "bounces", void 0);
|
||||
|
||||
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
|
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