Remove header and footer support,this is unnecessary
This commit is contained in:
@@ -2316,6 +2316,12 @@ var ListItem = /** @class */ (function (_super) {
|
||||
], ListItem.prototype, "actions", void 0);
|
||||
return ListItem;
|
||||
}(Stack));
|
||||
exports.OtherItems = void 0;
|
||||
(function (OtherItems) {
|
||||
OtherItems[OtherItems["LoadMore"] = -10] = "LoadMore";
|
||||
OtherItems[OtherItems["Header"] = -11] = "Header";
|
||||
OtherItems[OtherItems["Footer"] = -12] = "Footer";
|
||||
})(exports.OtherItems || (exports.OtherItems = {}));
|
||||
var List = /** @class */ (function (_super) {
|
||||
__extends$c(List, _super);
|
||||
function List() {
|
||||
@@ -2330,18 +2336,26 @@ var List = /** @class */ (function (_super) {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
List.prototype.scrollToItem = function (context, index, config) {
|
||||
var animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index: index, animated: animated, });
|
||||
};
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
*/
|
||||
List.prototype.findVisibleItems = function (context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
};
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
*/
|
||||
List.prototype.findCompletelyVisibleItems = function (context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
};
|
||||
List.prototype.reset = function () {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -2363,12 +2377,6 @@ var List = /** @class */ (function (_super) {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return _super.prototype.toModel.call(this);
|
||||
};
|
||||
__decorate$9([
|
||||
@@ -2415,14 +2423,6 @@ var List = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$9("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
__decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", ListItem)
|
||||
], List.prototype, "header", void 0);
|
||||
__decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", ListItem)
|
||||
], List.prototype, "footer", void 0);
|
||||
return List;
|
||||
}(Superview));
|
||||
function list(config) {
|
||||
@@ -2952,14 +2952,22 @@ var FlowLayout = /** @class */ (function (_super) {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
*/
|
||||
FlowLayout.prototype.findVisibleItems = function (context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
};
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
*/
|
||||
FlowLayout.prototype.findCompletelyVisibleItems = function (context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
};
|
||||
FlowLayout.prototype.reset = function () {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -2981,12 +2989,6 @@ var FlowLayout = /** @class */ (function (_super) {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return _super.prototype.toModel.call(this);
|
||||
};
|
||||
__decorate$5([
|
||||
@@ -3041,14 +3043,6 @@ var FlowLayout = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$5("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
__decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "header", void 0);
|
||||
__decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "footer", void 0);
|
||||
return FlowLayout;
|
||||
}(Superview));
|
||||
function flowlayout(config) {
|
||||
|
||||
@@ -1739,6 +1739,12 @@ __decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", Array)
|
||||
], ListItem.prototype, "actions", void 0);
|
||||
exports.OtherItems = void 0;
|
||||
(function (OtherItems) {
|
||||
OtherItems[OtherItems["LoadMore"] = -10] = "LoadMore";
|
||||
OtherItems[OtherItems["Header"] = -11] = "Header";
|
||||
OtherItems[OtherItems["Footer"] = -12] = "Footer";
|
||||
})(exports.OtherItems || (exports.OtherItems = {}));
|
||||
class List extends Superview {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
@@ -1751,18 +1757,26 @@ class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
scrollToItem(context, index, config) {
|
||||
const animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
*/
|
||||
findVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
*/
|
||||
findCompletelyVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -1783,12 +1797,6 @@ class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -1836,14 +1844,6 @@ __decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
__decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", ListItem)
|
||||
], List.prototype, "header", void 0);
|
||||
__decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", ListItem)
|
||||
], List.prototype, "footer", void 0);
|
||||
function list(config) {
|
||||
const ret = new List;
|
||||
ret.apply(config);
|
||||
@@ -2228,14 +2228,22 @@ class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
*/
|
||||
findVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
*/
|
||||
findCompletelyVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -2256,12 +2264,6 @@ class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -2317,14 +2319,6 @@ __decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
__decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "header", void 0);
|
||||
__decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "footer", void 0);
|
||||
function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
|
||||
@@ -3260,6 +3260,12 @@ __decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", Array)
|
||||
], ListItem.prototype, "actions", void 0);
|
||||
exports.OtherItems = void 0;
|
||||
(function (OtherItems) {
|
||||
OtherItems[OtherItems["LoadMore"] = -10] = "LoadMore";
|
||||
OtherItems[OtherItems["Header"] = -11] = "Header";
|
||||
OtherItems[OtherItems["Footer"] = -12] = "Footer";
|
||||
})(exports.OtherItems || (exports.OtherItems = {}));
|
||||
class List extends Superview {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
@@ -3272,18 +3278,26 @@ class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
scrollToItem(context, index, config) {
|
||||
const animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
*/
|
||||
findVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
*/
|
||||
findCompletelyVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -3304,12 +3318,6 @@ class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -3357,14 +3365,6 @@ __decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
__decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", ListItem)
|
||||
], List.prototype, "header", void 0);
|
||||
__decorate$9([
|
||||
Property,
|
||||
__metadata$9("design:type", ListItem)
|
||||
], List.prototype, "footer", void 0);
|
||||
function list(config) {
|
||||
const ret = new List;
|
||||
ret.apply(config);
|
||||
@@ -3749,14 +3749,22 @@ class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
*/
|
||||
findVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
*/
|
||||
findCompletelyVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -3777,12 +3785,6 @@ class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -3838,14 +3840,6 @@ __decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
__decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "header", void 0);
|
||||
__decorate$5([
|
||||
Property,
|
||||
__metadata$5("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "footer", void 0);
|
||||
function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
|
||||
43
doric-js/index.d.ts
vendored
43
doric-js/index.d.ts
vendored
@@ -703,6 +703,11 @@ declare module 'doric/lib/src/widget/list' {
|
||||
callback: () => void;
|
||||
}[];
|
||||
}
|
||||
export enum OtherItems {
|
||||
LoadMore = -10,
|
||||
Header = -11,
|
||||
Footer = -12
|
||||
}
|
||||
export class List extends Superview {
|
||||
allSubviews(): ListItem[];
|
||||
itemCount: number;
|
||||
@@ -725,11 +730,25 @@ declare module 'doric/lib/src/widget/list' {
|
||||
* Take effect only on iOS
|
||||
*/
|
||||
bounces?: boolean;
|
||||
header?: ListItem;
|
||||
footer?: ListItem;
|
||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||
animated?: boolean;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
*/
|
||||
findVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}>;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
*/
|
||||
findCompletelyVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}>;
|
||||
reset(): void;
|
||||
toModel(): NativeViewModel;
|
||||
}
|
||||
@@ -830,6 +849,7 @@ declare module 'doric/lib/src/widget/refreshable' {
|
||||
declare module 'doric/lib/src/widget/flowlayout' {
|
||||
import { Stack } from 'doric/lib/src/widget/layouts';
|
||||
import { Superview, View, NativeViewModel } from 'doric/lib/src/ui/view';
|
||||
import { BridgeContext } from "doric/lib/src/runtime/global";
|
||||
export class FlowLayoutItem extends Stack {
|
||||
/**
|
||||
* Set to reuse native view
|
||||
@@ -837,6 +857,7 @@ declare module 'doric/lib/src/widget/flowlayout' {
|
||||
identifier?: string;
|
||||
/**
|
||||
* When set to true, the item will layout using all span area.
|
||||
* HeaderView, footerView or loadMoreView is always true by default.
|
||||
*/
|
||||
fullSpan?: boolean;
|
||||
}
|
||||
@@ -864,8 +885,22 @@ declare module 'doric/lib/src/widget/flowlayout' {
|
||||
* Take effect only on iOS
|
||||
*/
|
||||
bounces?: boolean;
|
||||
header?: FlowLayoutItem;
|
||||
footer?: FlowLayoutItem;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
*/
|
||||
findVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}[]>;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
*/
|
||||
findCompletelyVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}[]>;
|
||||
reset(): void;
|
||||
toModel(): NativeViewModel;
|
||||
}
|
||||
|
||||
20
doric-js/lib/src/widget/flowlayout.d.ts
vendored
20
doric-js/lib/src/widget/flowlayout.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import { Stack } from './layouts';
|
||||
import { Superview, View, NativeViewModel } from '../ui/view';
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
export declare class FlowLayoutItem extends Stack {
|
||||
/**
|
||||
* Set to reuse native view
|
||||
@@ -7,6 +8,7 @@ export declare class FlowLayoutItem extends Stack {
|
||||
identifier?: string;
|
||||
/**
|
||||
* When set to true, the item will layout using all span area.
|
||||
* HeaderView, footerView or loadMoreView is always true by default.
|
||||
*/
|
||||
fullSpan?: boolean;
|
||||
}
|
||||
@@ -35,8 +37,22 @@ export declare class FlowLayout extends Superview {
|
||||
* Take effect only on iOS
|
||||
*/
|
||||
bounces?: boolean;
|
||||
header?: FlowLayoutItem;
|
||||
footer?: FlowLayoutItem;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
*/
|
||||
findVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}[]>;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
*/
|
||||
findCompletelyVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}[]>;
|
||||
reset(): void;
|
||||
private getItem;
|
||||
private renderBunchedItems;
|
||||
|
||||
@@ -48,14 +48,22 @@ export class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
*/
|
||||
findVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views for each column.
|
||||
*/
|
||||
findCompletelyVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -76,12 +84,6 @@ export class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -137,14 +139,6 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], FlowLayout.prototype, "bounces", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "header", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", FlowLayoutItem)
|
||||
], FlowLayout.prototype, "footer", void 0);
|
||||
export function flowlayout(config) {
|
||||
const ret = new FlowLayout;
|
||||
for (let key in config) {
|
||||
|
||||
23
doric-js/lib/src/widget/list.d.ts
vendored
23
doric-js/lib/src/widget/list.d.ts
vendored
@@ -13,6 +13,11 @@ export declare class ListItem extends Stack {
|
||||
callback: () => void;
|
||||
}[];
|
||||
}
|
||||
export declare enum OtherItems {
|
||||
LoadMore = -10,
|
||||
Header = -11,
|
||||
Footer = -12
|
||||
}
|
||||
export declare class List extends Superview {
|
||||
private cachedViews;
|
||||
allSubviews(): ListItem[];
|
||||
@@ -36,11 +41,25 @@ export declare class List extends Superview {
|
||||
* Take effect only on iOS
|
||||
*/
|
||||
bounces?: boolean;
|
||||
header?: ListItem;
|
||||
footer?: ListItem;
|
||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||
animated?: boolean;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
*/
|
||||
findVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}>;
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
*/
|
||||
findCompletelyVisibleItems(context: BridgeContext): Promise<{
|
||||
first: number;
|
||||
last: number;
|
||||
}>;
|
||||
reset(): void;
|
||||
private getItem;
|
||||
private renderBunchedItems;
|
||||
|
||||
@@ -35,6 +35,12 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Array)
|
||||
], ListItem.prototype, "actions", void 0);
|
||||
export var OtherItems;
|
||||
(function (OtherItems) {
|
||||
OtherItems[OtherItems["LoadMore"] = -10] = "LoadMore";
|
||||
OtherItems[OtherItems["Header"] = -11] = "Header";
|
||||
OtherItems[OtherItems["Footer"] = -12] = "Footer";
|
||||
})(OtherItems || (OtherItems = {}));
|
||||
export class List extends Superview {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
@@ -47,18 +53,26 @@ export class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView);
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header);
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
scrollToItem(context, index, config) {
|
||||
const animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views.
|
||||
*/
|
||||
findVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findVisibleItems')();
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the completely visible views.
|
||||
*/
|
||||
findCompletelyVisibleItems(context) {
|
||||
return this.nativeChannel(context, 'findCompletelyVisibleItems')();
|
||||
}
|
||||
reset() {
|
||||
this.cachedViews.clear();
|
||||
this.itemCount = 0;
|
||||
@@ -79,12 +93,6 @@ export class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId;
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId;
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId;
|
||||
}
|
||||
return super.toModel();
|
||||
}
|
||||
}
|
||||
@@ -132,14 +140,6 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], List.prototype, "bounces", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", ListItem)
|
||||
], List.prototype, "header", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", ListItem)
|
||||
], List.prototype, "footer", void 0);
|
||||
export function list(config) {
|
||||
const ret = new List;
|
||||
ret.apply(config);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
import { Stack } from './layouts'
|
||||
import { Property, Superview, View, NativeViewModel } from '../ui/view'
|
||||
import { layoutConfig } from '../util/index.util'
|
||||
import { BridgeContext } from '../..'
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
|
||||
export class FlowLayoutItem extends Stack {
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ export class FlowLayoutItem extends Stack {
|
||||
identifier?: string
|
||||
/**
|
||||
* When set to true, the item will layout using all span area.
|
||||
* HeaderView, footerView or loadMoreView is always true by default.
|
||||
* LoadMoreView is default to true.
|
||||
*/
|
||||
@Property
|
||||
fullSpan?: boolean
|
||||
@@ -40,12 +40,6 @@ export class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView)
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header)
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
@@ -90,11 +84,6 @@ export class FlowLayout extends Superview {
|
||||
@Property
|
||||
bounces?: boolean
|
||||
|
||||
@Property
|
||||
header?: FlowLayoutItem
|
||||
|
||||
@Property
|
||||
footer?: FlowLayoutItem
|
||||
/**
|
||||
* @param context
|
||||
* @returns Returns the range of the visible views for each column.
|
||||
@@ -132,12 +121,6 @@ export class FlowLayout extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId
|
||||
}
|
||||
return super.toModel()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,6 @@ export class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
ret.push(this.loadMoreView)
|
||||
}
|
||||
if (this.header) {
|
||||
ret.push(this.header)
|
||||
}
|
||||
if (this.footer) {
|
||||
ret.push(this.footer)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
@@ -93,12 +87,6 @@ export class List extends Superview {
|
||||
@Property
|
||||
bounces?: boolean
|
||||
|
||||
@Property
|
||||
header?: ListItem
|
||||
|
||||
@Property
|
||||
footer?: ListItem
|
||||
|
||||
scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean, }) {
|
||||
const animated = config?.animated
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, }) as Promise<any>
|
||||
@@ -140,12 +128,6 @@ export class List extends Superview {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId
|
||||
}
|
||||
if (this.header) {
|
||||
this.dirtyProps['header'] = this.header.viewId
|
||||
}
|
||||
if (this.footer) {
|
||||
this.dirtyProps['footer'] = this.footer.viewId
|
||||
}
|
||||
return super.toModel()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user