mp漏了
This commit is contained in:
parent
b404ad5faf
commit
769951ee54
|
|
@ -8,5 +8,5 @@ type TransformAspectDict<T extends AspectDict<ED, BCT>, ED extends BaseEntityDic
|
||||||
[K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise<unknown> ? (params: P, callback?: (result: R, opRecords?: OpRecord<ED>[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never;
|
[K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise<unknown> ? (params: P, callback?: (result: R, opRecords?: OpRecord<ED>[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never;
|
||||||
};
|
};
|
||||||
export type AspectDictTrans<ED extends BaseEntityDict, AD extends AspectDict<ED, BCT>, BCT extends AsyncContext<ED>> = TransformAspectDict<AD & CommonAspectDict<ED>, ED, BCT>;
|
export type AspectDictTrans<ED extends BaseEntityDict, AD extends AspectDict<ED, BCT>, BCT extends AsyncContext<ED>> = TransformAspectDict<AD & CommonAspectDict<ED>, ED, BCT>;
|
||||||
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: import("../features/cache").Cache<ED>) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: BasicFeatures<ED>["cache"]) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
export default OakComponent({
|
export default OakComponent({
|
||||||
isList: false,
|
isList: false,
|
||||||
data: {
|
data: {
|
||||||
slideWidth: 0,
|
slideWidth: 0, //小程序使用
|
||||||
slideLeft: 0,
|
slideLeft: 0, //小程序使用
|
||||||
slideShow: false,
|
slideShow: false, //小程序使用
|
||||||
commonAction: [
|
commonAction: [
|
||||||
'create',
|
'create',
|
||||||
'update',
|
'update',
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@ import { ED, OakAbsAttrDef } from '../../types/AbstractComponent';
|
||||||
import { ReactComponentProps } from '../../types/Page';
|
import { ReactComponentProps } from '../../types/Page';
|
||||||
import { Breakpoint } from 'antd';
|
import { Breakpoint } from 'antd';
|
||||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
column?: number | Record<Breakpoint, number> | undefined;
|
column?: number | Record<Breakpoint, number>;
|
||||||
entity: T2;
|
entity: T2;
|
||||||
attributes: OakAbsAttrDef[];
|
attributes: OakAbsAttrDef[];
|
||||||
data: Partial<ED2[T2]["Schema"]>;
|
data: Partial<ED2[T2]['Schema']>;
|
||||||
title?: string | undefined;
|
title?: string;
|
||||||
bordered?: boolean | undefined;
|
bordered?: boolean;
|
||||||
layout?: "horizontal" | "vertical" | undefined;
|
layout?: 'horizontal' | 'vertical';
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ export default OakComponent({
|
||||||
let currentUrl = event.currentTarget.dataset.src;
|
let currentUrl = event.currentTarget.dataset.src;
|
||||||
let urlList = event.currentTarget.dataset.list;
|
let urlList = event.currentTarget.dataset.list;
|
||||||
wx.previewImage({
|
wx.previewImage({
|
||||||
current: currentUrl,
|
current: currentUrl, // 当前显示图片的http链接
|
||||||
urls: urlList, // 需要预览的图片http链接列表
|
urls: urlList, // 需要预览的图片http链接列表
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { ReactComponentProps } from '../../types/Page';
|
||||||
import { ECode } from '../../types/ErrorPage';
|
import { ECode } from '../../types/ErrorPage';
|
||||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
code: ECode;
|
code: ECode;
|
||||||
title?: string | undefined;
|
title?: string;
|
||||||
desc?: string | undefined;
|
desc?: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export default OakComponent({
|
||||||
code: '',
|
code: '',
|
||||||
title: '',
|
title: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
icon: '',
|
icon: '', //web独有
|
||||||
imagePath: '', //小程序独有
|
imagePath: '', //小程序独有
|
||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ export default OakComponent({
|
||||||
attribute: {},
|
attribute: {},
|
||||||
options: [],
|
options: [],
|
||||||
inputType: '',
|
inputType: '',
|
||||||
timeStartStr: '',
|
timeStartStr: '', // 小程序选择时间显示
|
||||||
timeEndStr: '',
|
timeEndStr: '',
|
||||||
selectedLabel: '',
|
selectedLabel: '',
|
||||||
minDateMp: new Date(1980, 1, 1).getTime(),
|
minDateMp: new Date(1980, 1, 1).getTime(),
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,13 @@ declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactCompo
|
||||||
data: RowWithActions<ED2, T2>[];
|
data: RowWithActions<ED2, T2>[];
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
tablePagination?: React.ReactNode | false;
|
tablePagination?: React.ReactNode | false;
|
||||||
rowSelection?: import("antd/es/table/interface").TableRowSelection<RowWithActions<ED2, T2>> | undefined;
|
rowSelection?: TableProps<RowWithActions<ED2, T2>>['rowSelection'];
|
||||||
hideHeader?: boolean | undefined;
|
hideHeader?: boolean;
|
||||||
disableSerialNumber?: boolean | undefined;
|
disableSerialNumber?: boolean;
|
||||||
size?: "small" | "large" | "middle" | undefined;
|
size?: 'large' | 'middle' | 'small';
|
||||||
scroll?: ({
|
scroll?: TableProps<RowWithActions<ED2, T2>>['scroll'];
|
||||||
x?: string | number | true | undefined;
|
|
||||||
y?: string | number | undefined;
|
|
||||||
} & {
|
|
||||||
scrollToFirstRowOnChange?: boolean | undefined;
|
|
||||||
}) | undefined;
|
|
||||||
empty?: React.ReactNode;
|
empty?: React.ReactNode;
|
||||||
opWidth?: number | undefined;
|
opWidth?: number;
|
||||||
ellipsis?: boolean | undefined;
|
ellipsis?: boolean;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export default OakComponent({
|
||||||
tablePagination: undefined,
|
tablePagination: undefined,
|
||||||
rowSelection: undefined,
|
rowSelection: undefined,
|
||||||
hideHeader: false,
|
hideHeader: false,
|
||||||
disableSerialNumber: false,
|
disableSerialNumber: false, //是否禁用序号 默认启用
|
||||||
size: 'large',
|
size: 'large',
|
||||||
scroll: undefined,
|
scroll: undefined,
|
||||||
empty: undefined,
|
empty: undefined,
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,20 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ReactComponentProps } from '../../types/Page';
|
import { ReactComponentProps } from '../../types/Page';
|
||||||
import { ED } from '../../types/AbstractComponent';
|
import { ED } from '../../types/AbstractComponent';
|
||||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
style?: import("react").CSSProperties | undefined;
|
style?: React.CSSProperties;
|
||||||
className?: string | undefined;
|
className?: string;
|
||||||
title?: React.ReactNode;
|
title?: React.ReactNode;
|
||||||
showBack?: boolean | undefined;
|
showBack?: boolean;
|
||||||
onBack?: (() => void) | undefined;
|
onBack?: () => void;
|
||||||
backIcon?: React.ReactNode;
|
backIcon?: React.ReactNode;
|
||||||
delta?: number | undefined;
|
delta?: number;
|
||||||
extra?: React.ReactNode;
|
extra?: React.ReactNode;
|
||||||
subTitle?: React.ReactNode;
|
subTitle?: React.ReactNode;
|
||||||
contentMargin?: boolean | undefined;
|
contentMargin?: boolean;
|
||||||
contentStyle?: import("react").CSSProperties | undefined;
|
contentStyle?: React.CSSProperties;
|
||||||
contentClassName?: string | undefined;
|
contentClassName?: string;
|
||||||
tags?: React.ReactNode;
|
tags?: React.ReactNode;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
showHeader?: boolean | undefined;
|
showHeader?: boolean;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,22 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ReactComponentProps } from '../../types/Page';
|
import { ReactComponentProps } from '../../types/Page';
|
||||||
import { ED } from '../../types/AbstractComponent';
|
import { ED } from '../../types/AbstractComponent';
|
||||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
style?: import("react").CSSProperties | undefined;
|
style?: React.CSSProperties;
|
||||||
className?: string | undefined;
|
className?: string;
|
||||||
showHeader?: boolean | undefined;
|
showHeader?: boolean;
|
||||||
showBack?: boolean | undefined;
|
showBack?: boolean;
|
||||||
onBack?: (() => void) | undefined;
|
onBack?: () => void;
|
||||||
backIcon?: React.ReactNode;
|
backIcon?: React.ReactNode;
|
||||||
delta?: number | undefined;
|
delta?: number;
|
||||||
title?: React.ReactNode;
|
title?: React.ReactNode;
|
||||||
subTitle?: React.ReactNode;
|
subTitle?: React.ReactNode;
|
||||||
tags?: React.ReactNode;
|
tags?: React.ReactNode;
|
||||||
extra?: React.ReactNode;
|
extra?: React.ReactNode;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
content: React.ReactNode;
|
content: React.ReactNode;
|
||||||
contentStyle?: import("react").CSSProperties | undefined;
|
contentStyle?: React.CSSProperties;
|
||||||
contentClassName?: string | undefined;
|
contentClassName?: string;
|
||||||
bodyStyle?: import("react").CSSProperties | undefined;
|
bodyStyle?: React.CSSProperties;
|
||||||
bodyClassName?: string | undefined;
|
bodyClassName?: string;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ReactComponentProps } from '../../types/Page';
|
import { ReactComponentProps } from '../../types/Page';
|
||||||
import { ED } from '../../types/AbstractComponent';
|
import { ED } from '../../types/AbstractComponent';
|
||||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
entity: T2;
|
entity: T2;
|
||||||
style?: import("react").CSSProperties | undefined;
|
style?: React.CSSProperties;
|
||||||
className?: string | undefined;
|
className?: string;
|
||||||
showQuickJumper?: boolean | undefined;
|
showQuickJumper?: boolean;
|
||||||
size?: "small" | "default" | undefined;
|
size?: 'default' | 'small';
|
||||||
showSizeChanger?: boolean | undefined;
|
showSizeChanger?: boolean;
|
||||||
showTotal?: ((total: number, range: [number, number]) => React.ReactNode) | undefined;
|
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ export default OakComponent({
|
||||||
multiple: false,
|
multiple: false,
|
||||||
entityId: '',
|
entityId: '',
|
||||||
entityIds: [],
|
entityIds: [],
|
||||||
pickerRender: {},
|
pickerRender: {}, // OakAbsRefAttrPickerRender
|
||||||
onChange: (() => undefined),
|
onChange: (() => undefined),
|
||||||
},
|
},
|
||||||
formData() {
|
formData() {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ declare const _default: <ED2 extends ED, T2 extends keyof ED2, T3 extends string
|
||||||
helps: Record<string, string>;
|
helps: Record<string, string>;
|
||||||
entity: T2;
|
entity: T2;
|
||||||
attributes: OakAbsAttrUpsertDef<ED2, T2, T3>[];
|
attributes: OakAbsAttrUpsertDef<ED2, T2, T3>[];
|
||||||
data: ED2[T2]["Schema"];
|
data: ED2[T2]['Schema'];
|
||||||
layout: 'horizontal' | 'vertical';
|
layout: 'horizontal' | 'vertical';
|
||||||
mode: 'default' | 'card';
|
mode: 'default' | 'card';
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ export default OakComponent({
|
||||||
return this.props.entity;
|
return this.props.entity;
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
helps: {},
|
helps: {}, // Record<string, string>;
|
||||||
entity: '',
|
entity: '',
|
||||||
attributes: [],
|
attributes: [],
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,7 @@ export class Cache extends Feature {
|
||||||
opers.forEach((oper) => {
|
opers.forEach((oper) => {
|
||||||
const { entity, operation } = oper;
|
const { entity, operation } = oper;
|
||||||
this.cacheStore.operate(entity, operation, this.context, {
|
this.cacheStore.operate(entity, operation, this.context, {
|
||||||
checkerTypes: ['logical'],
|
checkerTypes: ['logical'], // 这里不能检查data,不然在数据没填完前会有大量异常
|
||||||
dontCollect: true,
|
dontCollect: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ export declare class RunningTree<ED extends EntityDict & BaseEntityDict> extends
|
||||||
isLoading(path: string): boolean | undefined;
|
isLoading(path: string): boolean | undefined;
|
||||||
isLoadingMore(path: string): boolean | undefined;
|
isLoadingMore(path: string): boolean | undefined;
|
||||||
isExecuting(path: string): boolean;
|
isExecuting(path: string): boolean;
|
||||||
isListDescandentOrStaleBranch(path: string): boolean;
|
isListDescandentOrStale(path: string): boolean;
|
||||||
private isInModiNextBranch;
|
private isInModiNextBranch;
|
||||||
refresh(path: string, pageNumber?: number): Promise<void>;
|
refresh(path: string, pageNumber?: number): Promise<void>;
|
||||||
loadMore(path: string): Promise<void>;
|
loadMore(path: string): Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -1184,9 +1184,9 @@ class SingleNode extends EntityNode {
|
||||||
const operations = this.ulManager.makeOperations();
|
const operations = this.ulManager.makeOperations();
|
||||||
assert(operations.length <= 1);
|
assert(operations.length <= 1);
|
||||||
const [operation] = operations;
|
const [operation] = operations;
|
||||||
// 如果本身是create, 这里无视就行(因为框架原因会调用一次)
|
|
||||||
if (operation?.action === 'create') {
|
if (operation?.action === 'create') {
|
||||||
if (operation.data.id === id) {
|
if (operation.data.id === id) {
|
||||||
|
// 如果本身是create, 这里无视就行(因为框架原因会调用一次)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -2094,11 +2094,14 @@ export class RunningTree extends Feature {
|
||||||
const node = this.findNode(path);
|
const node = this.findNode(path);
|
||||||
return node ? node.isExecuting() : false;
|
return node ? node.isExecuting() : false;
|
||||||
}
|
}
|
||||||
isListDescandentOrStaleBranch(path) {
|
isListDescandentOrStale(path) {
|
||||||
const node = this.findNode(path);
|
const node = this.findNode(path);
|
||||||
|
if (node?.isStale()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
let parent = node?.getParent();
|
let parent = node?.getParent();
|
||||||
while (parent) {
|
while (parent) {
|
||||||
if (parent instanceof ListNode || parent.isStale()) {
|
if (parent instanceof ListNode) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
|
|
||||||
|
|
@ -485,7 +485,7 @@ const oakBehavior = Behavior({
|
||||||
this.oakOption.lifetimes?.ready &&
|
this.oakOption.lifetimes?.ready &&
|
||||||
this.oakOption.lifetimes?.ready.call(this);
|
this.oakOption.lifetimes?.ready.call(this);
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -788,7 +788,7 @@ export function createComponent(option, features) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
try {
|
try {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,21 +49,21 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
redirectTo<T2_1 extends keyof ED>(options: {
|
redirectTo<T2_1 extends keyof ED>(options: {
|
||||||
url: string;
|
url: string;
|
||||||
} & OakNavigateToParameters<ED, T2_1>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
} & OakNavigateToParameters<ED, T2_1>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
||||||
addItem<T extends keyof ED>(data: Omit<ED[T]["CreateSingle"]["data"], "id"> & {
|
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string | undefined;
|
||||||
}, path?: string | undefined): string;
|
}, path?: string | undefined): string;
|
||||||
addItems<T_1 extends keyof ED>(data: (Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
addItems<T_2 extends keyof ED>(data: (Omit<ED[T_2]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string | undefined;
|
||||||
})[], path?: string | undefined): string[];
|
})[], path?: string | undefined): string[];
|
||||||
removeItem(id: string, path?: string | undefined): void;
|
removeItem(id: string, path?: string | undefined): void;
|
||||||
removeItems(ids: string[], path?: string | undefined): void;
|
removeItems(ids: string[], path?: string | undefined): void;
|
||||||
updateItem<T_2 extends keyof ED>(data: ED[T_2]["Update"]["data"], id: string, action?: ED[T_2]["Action"] | undefined, path?: string | undefined): void;
|
updateItem<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], id: string, action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
||||||
updateItems<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], ids: string[], action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
updateItems<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], ids: string[], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
||||||
recoverItem(id: string, path?: string | undefined): void;
|
recoverItem(id: string, path?: string | undefined): void;
|
||||||
recoverItems(ids: string[], path?: string | undefined): void;
|
recoverItems(ids: string[], path?: string | undefined): void;
|
||||||
resetItem(id: string, path?: string | undefined): void;
|
resetItem(id: string, path?: string | undefined): void;
|
||||||
update<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
update<T_5 extends keyof ED>(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void;
|
||||||
create<T_5 extends keyof ED>(data: Omit<ED[T_5]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
create<T_6 extends keyof ED>(data: Omit<ED[T_6]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
||||||
remove(path?: string | undefined): void;
|
remove(path?: string | undefined): void;
|
||||||
isCreation(path?: string | undefined): boolean;
|
isCreation(path?: string | undefined): boolean;
|
||||||
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
||||||
|
|
@ -78,7 +78,7 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
||||||
checkOperation<T2_3 extends keyof ED>(entity: T2_3, operation: Omit<ED[T2_3]["Operation"], "id">, checkerTypes?: CheckerType[] | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
checkOperation<T2_3 extends keyof ED>(entity: T2_3, operation: Omit<ED[T2_3]["Operation"], "id">, checkerTypes?: CheckerType[] | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
||||||
tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
||||||
getOperations<T_6 extends keyof ED>(path?: string | undefined): {
|
getOperations<T_7 extends keyof ED>(path?: string | undefined): {
|
||||||
entity: keyof ED;
|
entity: keyof ED;
|
||||||
operation: ED[keyof ED]["Operation"];
|
operation: ED[keyof ED]["Operation"];
|
||||||
}[] | undefined;
|
}[] | undefined;
|
||||||
|
|
|
||||||
|
|
@ -646,7 +646,7 @@ export function createComponent(option, features) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -704,7 +704,7 @@ export function createComponent(option, features) {
|
||||||
lifetimes?.show && lifetimes.show.call(this);
|
lifetimes?.show && lifetimes.show.call(this);
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
export const keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
export const keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
||||||
export const values = {
|
export const values = {
|
||||||
xs: 576,
|
xs: 576, //小于576
|
||||||
sm: 576,
|
sm: 576,
|
||||||
md: 768,
|
md: 768,
|
||||||
lg: 992,
|
lg: 992,
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,5 @@ type TransformAspectDict<T extends AspectDict<ED, BCT>, ED extends BaseEntityDic
|
||||||
[K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise<unknown> ? (params: P, callback?: (result: R, opRecords?: OpRecord<ED>[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never;
|
[K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise<unknown> ? (params: P, callback?: (result: R, opRecords?: OpRecord<ED>[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never;
|
||||||
};
|
};
|
||||||
export type AspectDictTrans<ED extends BaseEntityDict, AD extends AspectDict<ED, BCT>, BCT extends AsyncContext<ED>> = TransformAspectDict<AD & CommonAspectDict<ED>, ED, BCT>;
|
export type AspectDictTrans<ED extends BaseEntityDict, AD extends AspectDict<ED, BCT>, BCT extends AsyncContext<ED>> = TransformAspectDict<AD & CommonAspectDict<ED>, ED, BCT>;
|
||||||
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: import("../features/cache").Cache<ED>) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: BasicFeatures<ED>["cache"]) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -414,7 +414,7 @@ class Cache extends Feature_1.Feature {
|
||||||
opers.forEach((oper) => {
|
opers.forEach((oper) => {
|
||||||
const { entity, operation } = oper;
|
const { entity, operation } = oper;
|
||||||
this.cacheStore.operate(entity, operation, this.context, {
|
this.cacheStore.operate(entity, operation, this.context, {
|
||||||
checkerTypes: ['logical'],
|
checkerTypes: ['logical'], // 这里不能检查data,不然在数据没填完前会有大量异常
|
||||||
dontCollect: true,
|
dontCollect: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ export declare class RunningTree<ED extends EntityDict & BaseEntityDict> extends
|
||||||
isLoading(path: string): boolean | undefined;
|
isLoading(path: string): boolean | undefined;
|
||||||
isLoadingMore(path: string): boolean | undefined;
|
isLoadingMore(path: string): boolean | undefined;
|
||||||
isExecuting(path: string): boolean;
|
isExecuting(path: string): boolean;
|
||||||
isListDescandentOrStaleBranch(path: string): boolean;
|
isListDescandentOrStale(path: string): boolean;
|
||||||
private isInModiNextBranch;
|
private isInModiNextBranch;
|
||||||
refresh(path: string, pageNumber?: number): Promise<void>;
|
refresh(path: string, pageNumber?: number): Promise<void>;
|
||||||
loadMore(path: string): Promise<void>;
|
loadMore(path: string): Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -2097,11 +2097,14 @@ class RunningTree extends Feature_1.Feature {
|
||||||
const node = this.findNode(path);
|
const node = this.findNode(path);
|
||||||
return node ? node.isExecuting() : false;
|
return node ? node.isExecuting() : false;
|
||||||
}
|
}
|
||||||
isListDescandentOrStaleBranch(path) {
|
isListDescandentOrStale(path) {
|
||||||
const node = this.findNode(path);
|
const node = this.findNode(path);
|
||||||
|
if (node?.isStale()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
let parent = node?.getParent();
|
let parent = node?.getParent();
|
||||||
while (parent) {
|
while (parent) {
|
||||||
if (parent instanceof ListNode || parent.isStale()) {
|
if (parent instanceof ListNode) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ const oakBehavior = Behavior({
|
||||||
this.oakOption.lifetimes?.ready &&
|
this.oakOption.lifetimes?.ready &&
|
||||||
this.oakOption.lifetimes?.ready.call(this);
|
this.oakOption.lifetimes?.ready.call(this);
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -791,7 +791,7 @@ function createComponent(option, features) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
try {
|
try {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from 'react';
|
||||||
import { Aspect, EntityDict } from 'oak-domain/lib/types';
|
import { Aspect, EntityDict } from 'oak-domain/lib/types';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { BasicFeatures } from './features';
|
import { BasicFeatures } from './features';
|
||||||
|
|
@ -5,4 +6,4 @@ import { Feature } from './types/Feature';
|
||||||
import { DataOption, OakComponentOption } from './types/Page';
|
import { DataOption, OakComponentOption } from './types/Page';
|
||||||
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
||||||
import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
|
import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
|
||||||
export declare function createComponent<IsList extends boolean, ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>, AD extends Record<string, Aspect<ED, AsyncContext<ED>>>, FD extends Record<string, Feature>, FormedData extends Record<string, any>, TData extends Record<string, any> = {}, TProperty extends DataOption = {}, TMethod extends Record<string, Function> = {}>(option: OakComponentOption<IsList, ED, T, Cxt, FrontCxt, AD, FD, FormedData, TData, TProperty, TMethod>, features: BasicFeatures<ED> & FD): any;
|
export declare function createComponent<IsList extends boolean, ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>, AD extends Record<string, Aspect<ED, AsyncContext<ED>>>, FD extends Record<string, Feature>, FormedData extends Record<string, any>, TData extends Record<string, any> = {}, TProperty extends DataOption = {}, TMethod extends Record<string, Function> = {}>(option: OakComponentOption<IsList, ED, T, Cxt, FrontCxt, AD, FD, FormedData, TData, TProperty, TMethod>, features: BasicFeatures<ED> & FD): React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
|
import React from 'react';
|
||||||
import { Aspect, CheckerType, EntityDict, OpRecord } from 'oak-domain/lib/types';
|
import { Aspect, CheckerType, EntityDict, OpRecord } from 'oak-domain/lib/types';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { BasicFeatures } from './features';
|
import { BasicFeatures } from './features';
|
||||||
import { NamedFilterItem, NamedSorterItem } from './types/NamedCondition';
|
import { NamedFilterItem, NamedSorterItem } from './types/NamedCondition';
|
||||||
import { Feature } from './types/Feature';
|
import { Feature } from './types/Feature';
|
||||||
import { DataOption, ComponentProps, OakComponentOption, OakNavigateToParameters } from './types/Page';
|
import { DataOption, ComponentData, ComponentProps, OakComponentOption, OakNavigateToParameters } from './types/Page';
|
||||||
import { MessageProps } from './types/Message';
|
import { MessageProps } from './types/Message';
|
||||||
import { NotificationProps } from './types/Notification';
|
import { NotificationProps } from './types/Notification';
|
||||||
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
||||||
|
|
@ -48,21 +49,21 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
redirectTo<T2_1 extends keyof ED>(options: {
|
redirectTo<T2_1 extends keyof ED>(options: {
|
||||||
url: string;
|
url: string;
|
||||||
} & OakNavigateToParameters<ED, T2_1>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
} & OakNavigateToParameters<ED, T2_1>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
||||||
addItem<T extends keyof ED>(data: Omit<ED[T]["CreateSingle"]["data"], "id"> & {
|
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string | undefined;
|
||||||
}, path?: string | undefined): string;
|
}, path?: string | undefined): string;
|
||||||
addItems<T_1 extends keyof ED>(data: (Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
addItems<T_2 extends keyof ED>(data: (Omit<ED[T_2]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string | undefined;
|
||||||
})[], path?: string | undefined): string[];
|
})[], path?: string | undefined): string[];
|
||||||
removeItem(id: string, path?: string | undefined): void;
|
removeItem(id: string, path?: string | undefined): void;
|
||||||
removeItems(ids: string[], path?: string | undefined): void;
|
removeItems(ids: string[], path?: string | undefined): void;
|
||||||
updateItem<T_2 extends keyof ED>(data: ED[T_2]["Update"]["data"], id: string, action?: ED[T_2]["Action"] | undefined, path?: string | undefined): void;
|
updateItem<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], id: string, action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
||||||
updateItems<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], ids: string[], action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
updateItems<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], ids: string[], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
||||||
recoverItem(id: string, path?: string | undefined): void;
|
recoverItem(id: string, path?: string | undefined): void;
|
||||||
recoverItems(ids: string[], path?: string | undefined): void;
|
recoverItems(ids: string[], path?: string | undefined): void;
|
||||||
resetItem(id: string, path?: string | undefined): void;
|
resetItem(id: string, path?: string | undefined): void;
|
||||||
update<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
update<T_5 extends keyof ED>(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void;
|
||||||
create<T_5 extends keyof ED>(data: Omit<ED[T_5]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
create<T_6 extends keyof ED>(data: Omit<ED[T_6]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
||||||
remove(path?: string | undefined): void;
|
remove(path?: string | undefined): void;
|
||||||
isCreation(path?: string | undefined): boolean;
|
isCreation(path?: string | undefined): boolean;
|
||||||
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
||||||
|
|
@ -77,7 +78,7 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
||||||
checkOperation<T2_3 extends keyof ED>(entity: T2_3, operation: Omit<ED[T2_3]["Operation"], "id">, checkerTypes?: CheckerType[] | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
checkOperation<T2_3 extends keyof ED>(entity: T2_3, operation: Omit<ED[T2_3]["Operation"], "id">, checkerTypes?: CheckerType[] | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
||||||
tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
||||||
getOperations<T_6 extends keyof ED>(path?: string | undefined): {
|
getOperations<T_7 extends keyof ED>(path?: string | undefined): {
|
||||||
entity: keyof ED;
|
entity: keyof ED;
|
||||||
operation: ED[keyof ED]["Operation"];
|
operation: ED[keyof ED]["Operation"];
|
||||||
}[] | undefined;
|
}[] | undefined;
|
||||||
|
|
@ -103,5 +104,23 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
setPageSize(pageSize: number, path?: string | undefined): void;
|
setPageSize(pageSize: number, path?: string | undefined): void;
|
||||||
setCurrentPage(currentPage: number, path?: string | undefined): void;
|
setCurrentPage(currentPage: number, path?: string | undefined): void;
|
||||||
subDataEvents(events: string[], callback: (event: string, opRecords: OpRecord<ED>[]) => void): Promise<() => void>;
|
subDataEvents(events: string[], callback: (event: string, opRecords: OpRecord<ED>[]) => void): Promise<() => void>;
|
||||||
|
context: unknown;
|
||||||
|
setState<K extends keyof TData | keyof FormedData | keyof import("./types/Page").OakComponentData<ED, T>>(state: ComponentData<ED, T, FormedData, TData> | ((prevState: Readonly<ComponentData<ED, T, FormedData, TData>>, props: Readonly<ComponentProps<ED, T, TProperty>>) => ComponentData<ED, T, FormedData, TData> | Pick<ComponentData<ED, T, FormedData, TData>, K> | null) | Pick<ComponentData<ED, T, FormedData, TData>, K> | null, callback?: (() => void) | undefined): void;
|
||||||
|
forceUpdate(callback?: (() => void) | undefined): void;
|
||||||
|
readonly props: Readonly<ComponentProps<ED, T, TProperty>>;
|
||||||
|
state: Readonly<ComponentData<ED, T, FormedData, TData>>;
|
||||||
|
refs: {
|
||||||
|
[key: string]: React.ReactInstance;
|
||||||
|
};
|
||||||
|
shouldComponentUpdate?(nextProps: Readonly<ComponentProps<ED, T, TProperty>>, nextState: Readonly<ComponentData<ED, T, FormedData, TData>>, nextContext: any): boolean;
|
||||||
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
||||||
|
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps<ED, T, TProperty>>, prevState: Readonly<ComponentData<ED, T, FormedData, TData>>): any;
|
||||||
|
componentWillMount?(): void;
|
||||||
|
UNSAFE_componentWillMount?(): void;
|
||||||
|
componentWillReceiveProps?(nextProps: Readonly<ComponentProps<ED, T, TProperty>>, nextContext: any): void;
|
||||||
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps<ED, T, TProperty>>, nextContext: any): void;
|
||||||
|
componentWillUpdate?(nextProps: Readonly<ComponentProps<ED, T, TProperty>>, nextState: Readonly<ComponentData<ED, T, FormedData, TData>>, nextContext: any): void;
|
||||||
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps<ED, T, TProperty>>, nextState: Readonly<ComponentData<ED, T, FormedData, TData>>, nextContext: any): void;
|
||||||
};
|
};
|
||||||
|
contextType?: React.Context<any> | undefined;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -651,7 +651,7 @@ function createComponent(option, features) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -709,7 +709,7 @@ function createComponent(option, features) {
|
||||||
lifetimes?.show && lifetimes.show.call(this);
|
lifetimes?.show && lifetimes.show.call(this);
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from 'react';
|
||||||
import { Aspect, EntityDict } from 'oak-domain/lib/types';
|
import { Aspect, EntityDict } from 'oak-domain/lib/types';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { BasicFeatures } from './features';
|
import { BasicFeatures } from './features';
|
||||||
|
|
@ -5,4 +6,4 @@ import { Feature } from './types/Feature';
|
||||||
import { DataOption, OakComponentOption } from './types/Page';
|
import { DataOption, OakComponentOption } from './types/Page';
|
||||||
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
|
||||||
import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
|
import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
|
||||||
export declare function createComponent<IsList extends boolean, ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>, AD extends Record<string, Aspect<ED, AsyncContext<ED>>>, FD extends Record<string, Feature>, FormedData extends Record<string, any>, TData extends Record<string, any> = {}, TProperty extends DataOption = {}, TMethod extends Record<string, Function> = {}>(option: OakComponentOption<IsList, ED, T, Cxt, FrontCxt, AD, FD, FormedData, TData, TProperty, TMethod>, features: BasicFeatures<ED> & FD): any;
|
export declare function createComponent<IsList extends boolean, ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>, AD extends Record<string, Aspect<ED, AsyncContext<ED>>>, FD extends Record<string, Feature>, FormedData extends Record<string, any>, TData extends Record<string, any> = {}, TProperty extends DataOption = {}, TMethod extends Record<string, Function> = {}>(option: OakComponentOption<IsList, ED, T, Cxt, FrontCxt, AD, FD, FormedData, TData, TProperty, TMethod>, features: BasicFeatures<ED> & FD): React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.createComponent = void 0;
|
exports.createComponent = void 0;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||||
const react_1 = tslib_1.__importDefault(require("react"));
|
|
||||||
const withRouter_1 = tslib_1.__importDefault(require("./platforms/web/router/withRouter"));
|
const withRouter_1 = tslib_1.__importDefault(require("./platforms/web/router/withRouter"));
|
||||||
const PullToRefresh_1 = tslib_1.__importDefault(require("./platforms/web/PullToRefresh"));
|
const PullToRefresh_1 = tslib_1.__importDefault(require("./platforms/web/PullToRefresh"));
|
||||||
const page_react_1 = require("./page.react");
|
const page_react_1 = require("./page.react");
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@ type Props = {
|
||||||
features: Record<string, Feature>;
|
features: Record<string, Feature>;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
};
|
};
|
||||||
declare const FeaturesProvider: (props: Props) => any;
|
declare const FeaturesProvider: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
||||||
declare const useFeatures: <FD2 extends Record<string, Feature>>() => any;
|
declare const useFeatures: <FD2 extends Record<string, Feature>>() => FD2;
|
||||||
export { FeaturesProvider, useFeatures };
|
export { FeaturesProvider, useFeatures };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
|
import React from 'react';
|
||||||
type OakComponentProperties = {
|
type OakComponentProperties = {
|
||||||
path?: string;
|
path?: string;
|
||||||
properties?: Record<string, any>;
|
properties?: Record<string, any>;
|
||||||
};
|
};
|
||||||
declare const withRouter: (Component: React.ComponentType<any>, { path, properties }: OakComponentProperties) => any;
|
declare const withRouter: (Component: React.ComponentType<any>, { path, properties }: OakComponentProperties) => React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
||||||
export default withRouter;
|
export default withRouter;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from 'react';
|
||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
declare const _default: any;
|
declare const _default: React.MemoExoticComponent<() => null>;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||||
const react_1 = tslib_1.__importDefault(require("react"));
|
|
||||||
const rmc_pull_to_refresh_1 = tslib_1.__importDefault(require("rmc-pull-to-refresh"));
|
const rmc_pull_to_refresh_1 = tslib_1.__importDefault(require("rmc-pull-to-refresh"));
|
||||||
require("./PullToRefresh.css");
|
require("./PullToRefresh.css");
|
||||||
const OakPullToRefresh = (props) => {
|
const OakPullToRefresh = (props) => {
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@ declare const FeaturesProvider: React.FC<{
|
||||||
features: Record<string, Feature>;
|
features: Record<string, Feature>;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>;
|
}>;
|
||||||
declare const useFeatures: <FD2 extends Record<string, Feature>>() => any;
|
declare const useFeatures: <FD2 extends Record<string, Feature>>() => FD2;
|
||||||
export { FeaturesProvider, useFeatures };
|
export { FeaturesProvider, useFeatures };
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@ import React from 'react';
|
||||||
type AppContainerProps = {
|
type AppContainerProps = {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
};
|
};
|
||||||
declare const AppContainer: (props: AppContainerProps) => any;
|
declare const AppContainer: (props: AppContainerProps) => import("react/jsx-runtime").JSX.Element;
|
||||||
export default AppContainer;
|
export default AppContainer;
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,5 @@ interface ErrorProps<ED extends EntityDict & BaseEntityDict> {
|
||||||
error: any;
|
error: any;
|
||||||
features: BasicFeatures<ED>;
|
features: BasicFeatures<ED>;
|
||||||
}
|
}
|
||||||
declare function Error<ED extends EntityDict & BaseEntityDict>(props: ErrorProps<ED>): any;
|
declare function Error<ED extends EntityDict & BaseEntityDict>(props: ErrorProps<ED>): import("react/jsx-runtime").JSX.Element;
|
||||||
export default Error;
|
export default Error;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,34 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const tslib_1 = require("tslib");
|
|
||||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||||
const react_1 = tslib_1.__importStar(require("react"));
|
const react_1 = require("react");
|
||||||
const antd_1 = require("antd");
|
const antd_1 = require("antd");
|
||||||
const Exception_1 = require("oak-domain/lib/types/Exception");
|
const Exception_1 = require("oak-domain/lib/types/Exception");
|
||||||
const ErrorPage_1 = require("../../../types/ErrorPage");
|
const ErrorPage_1 = require("../../../types/ErrorPage");
|
||||||
const ErrorPage = (0, react_1.lazy)(() => Promise.resolve().then(() => tslib_1.__importStar(require('../../../components/errorPage'))));
|
const ErrorPage = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('../../../components/errorPage'))));
|
||||||
function Error(props) {
|
function Error(props) {
|
||||||
const { error, features } = props;
|
const { error, features } = props;
|
||||||
if (error instanceof Exception_1.OakException) {
|
if (error instanceof Exception_1.OakException) {
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,5 @@ declare const AppRouter: <ED extends BaseEntityDict>(props: {
|
||||||
routers: IRouter[];
|
routers: IRouter[];
|
||||||
appName: string;
|
appName: string;
|
||||||
features: BasicFeatures<ED>;
|
features: BasicFeatures<ED>;
|
||||||
}) => any;
|
}) => import("react/jsx-runtime").JSX.Element;
|
||||||
export default AppRouter;
|
export default AppRouter;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||||
// @ts-nocheck
|
|
||||||
const react_1 = tslib_1.__importDefault(require("react"));
|
|
||||||
const client_1 = tslib_1.__importDefault(require("react-dom/client"));
|
const client_1 = tslib_1.__importDefault(require("react-dom/client"));
|
||||||
const history_1 = require("history");
|
const history_1 = require("history");
|
||||||
const react_router_dom_1 = require("react-router-dom");
|
const react_router_dom_1 = require("react-router-dom");
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from 'react';
|
||||||
export type Width = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
export type Width = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
||||||
export type Keys = Width[];
|
export type Keys = Width[];
|
||||||
export type Values = {
|
export type Values = {
|
||||||
|
|
@ -15,4 +16,6 @@ export type Breakpoints = {
|
||||||
export declare const keys: Keys;
|
export declare const keys: Keys;
|
||||||
export declare const values: Values;
|
export declare const values: Values;
|
||||||
export declare const defaultBreakpoints: Breakpoints;
|
export declare const defaultBreakpoints: Breakpoints;
|
||||||
export declare const ResponsiveContext: any;
|
export declare const ResponsiveContext: React.Context<{
|
||||||
|
breakpoints?: Breakpoints | undefined;
|
||||||
|
}>;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
||||||
const react_1 = tslib_1.__importDefault(require("react"));
|
const react_1 = tslib_1.__importDefault(require("react"));
|
||||||
exports.keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
exports.keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
||||||
exports.values = {
|
exports.values = {
|
||||||
xs: 576,
|
xs: 576, //小于576
|
||||||
sm: 576,
|
sm: 576,
|
||||||
md: 768,
|
md: 768,
|
||||||
lg: 992,
|
lg: 992,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
|
import React from 'react';
|
||||||
type OakComponentProperties = {
|
type OakComponentProperties = {
|
||||||
path?: string;
|
path?: string;
|
||||||
properties?: Record<string, any>;
|
properties?: Record<string, any>;
|
||||||
};
|
};
|
||||||
declare const withRouter: (Component: React.ComponentType<any>, { path, properties }: OakComponentProperties) => any;
|
declare const withRouter: (Component: React.ComponentType<any>, { path, properties }: OakComponentProperties) => React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
||||||
export default withRouter;
|
export default withRouter;
|
||||||
|
|
|
||||||
|
|
@ -709,7 +709,7 @@ const oakBehavior = Behavior<
|
||||||
this.oakOption.lifetimes?.ready.call(this);
|
this.oakOption.lifetimes?.ready.call(this);
|
||||||
|
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
} else {
|
} else {
|
||||||
this.reRender();
|
this.reRender();
|
||||||
|
|
@ -1113,7 +1113,7 @@ export function createComponent<
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !this.features.runningTree.isListDescandentOrStaleBranch(oakFullpath)) {
|
if (oakFullpath && !this.features.runningTree.isListDescandentOrStale(oakFullpath)) {
|
||||||
try {
|
try {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue