diff --git a/lib/features/cache.d.ts b/lib/features/cache.d.ts index 8ad0508f..6e1fb00c 100644 --- a/lib/features/cache.d.ts +++ b/lib/features/cache.d.ts @@ -36,7 +36,7 @@ export declare class Cache): Promise>; get(entity: T, selection: S, params?: SelectOption): Promise[]>; - judgeRelation(entity: keyof ED, attr: string): string | 0 | 1 | string[] | 2; + judgeRelation(entity: keyof ED, attr: string): string | 0 | 2 | 1 | string[]; bindOnSync(callback: (opRecords: OpRecord[]) => Promise): void; unbindOnSync(callback: (opRecords: OpRecord[]) => Promise): void; getCachedData(): { [T in keyof ED]?: ED[T]["OpSchema"][] | undefined; }; diff --git a/lib/features/runningTree.d.ts b/lib/features/runningTree.d.ts index cff89433..534161ff 100644 --- a/lib/features/runningTree.d.ts +++ b/lib/features/runningTree.d.ts @@ -37,7 +37,7 @@ declare abstract class Node, action: ED[T]["Action"]) => Promise) | undefined; getAfterExecute(): ((updateData: import("oak-domain/lib/types").DeduceUpdateOperationData, action: ED[T]["Action"]) => Promise) | undefined; destroy(): void; - protected judgeRelation(attr: string): string | 0 | 1 | string[] | 2; + protected judgeRelation(attr: string): string | 0 | 2 | 1 | string[]; protected contains(filter: ED[T]['Selection']['filter'], conditionalFilter: ED[T]['Selection']['filter']): boolean; protected repel(filter1: ED[T]['Selection']['filter'], filter2: ED[T]['Selection']['filter']): boolean; } diff --git a/lib/page.web.js b/lib/page.web.js index a520fbcb..673258eb 100644 --- a/lib/page.web.js +++ b/lib/page.web.js @@ -282,20 +282,23 @@ function createPage(options, features, exceptionRouterDict) { var _this = this; var Render = render.call(this); var oakLoading = this.state.oakLoading; - return react_1.default.cloneElement((0, jsx_runtime_1.jsx)(web_1.PullToRefresh, { onRefresh: function () { - if (methods === null || methods === void 0 ? void 0 : methods.onPullDownRefresh) { - methods.onPullDownRefresh.call(_this); - return; - } - if (_this.props.width === 'xs') { - onPullDownRefresh.call(_this); - } - }, refreshing: oakLoading, distanceToRefresh: DEFAULT_REACH_BOTTOM_DISTANCE, indicator: { - activate: commonMethods.t.call(this, 'common:ptrActivate'), - deactivate: commonMethods.t.call(this, 'common:ptrDeactivate'), - release: commonMethods.t.call(this, 'common:ptrRelease'), - finish: commonMethods.t.call(this, 'common:ptrFinish'), - } }), {}, Render); + if (this.props.width === 'xs') { + return react_1.default.cloneElement((0, jsx_runtime_1.jsx)(web_1.PullToRefresh, { onRefresh: function () { + if (methods === null || methods === void 0 ? void 0 : methods.onPullDownRefresh) { + methods.onPullDownRefresh.call(_this); + return; + } + else { + onPullDownRefresh.call(_this); + } + }, refreshing: oakLoading, distanceToRefresh: DEFAULT_REACH_BOTTOM_DISTANCE, indicator: { + activate: commonMethods.t.call(this, 'common:ptrActivate'), + deactivate: commonMethods.t.call(this, 'common:ptrDeactivate'), + release: commonMethods.t.call(this, 'common:ptrRelease'), + finish: commonMethods.t.call(this, 'common:ptrFinish'), + } }), {}, Render); + } + return Render; }; return OakPageWrapper; }(react_1.default.PureComponent)); diff --git a/src/page.web.tsx b/src/page.web.tsx index cc354c22..c598748c 100644 --- a/src/page.web.tsx +++ b/src/page.web.tsx @@ -425,38 +425,43 @@ export function createPage< const Render = render.call(this); const { oakLoading } = this.state; - return React.cloneElement( - { - if (methods?.onPullDownRefresh) { - methods.onPullDownRefresh.call(this); - return; - } - if (this.props.width === 'xs') { - onPullDownRefresh.call(this); - } - }} - refreshing={oakLoading} - distanceToRefresh={DEFAULT_REACH_BOTTOM_DISTANCE} - indicator={{ - activate: commonMethods.t.call( - this, - 'common:ptrActivate' - ), - deactivate: commonMethods.t.call( - this, - 'common:ptrDeactivate' - ), - release: commonMethods.t.call( - this, - 'common:ptrRelease' - ), - finish: commonMethods.t.call(this, 'common:ptrFinish'), - }} - />, - {}, - Render - ); + if (this.props.width === 'xs') { + return React.cloneElement( + { + if (methods?.onPullDownRefresh) { + methods.onPullDownRefresh.call(this); + return; + } else { + onPullDownRefresh.call(this); + } + }} + refreshing={oakLoading} + distanceToRefresh={DEFAULT_REACH_BOTTOM_DISTANCE} + indicator={{ + activate: commonMethods.t.call( + this, + 'common:ptrActivate' + ), + deactivate: commonMethods.t.call( + this, + 'common:ptrDeactivate' + ), + release: commonMethods.t.call( + this, + 'common:ptrRelease' + ), + finish: commonMethods.t.call( + this, + 'common:ptrFinish' + ), + }} + />, + {}, + Render + ); + } + return Render; } }