build
This commit is contained in:
parent
4f698ce772
commit
230d459b59
|
|
@ -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: BasicFeatures<ED>["cache"]) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: BasicFeatures<ED>["cache"]) => AspectDictTrans<ED, AD, any>;
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,10 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ED, OakExtraActionProps } from '../../types/AbstractComponent';
|
import { ED, OakExtraActionProps } from '../../types/AbstractComponent';
|
||||||
import { ActionDef } from '../../types/Page';
|
import { ActionDef } from '../../types/Page';
|
||||||
declare const _default: (props: import("../../types/Page").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../../types/Page").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
entity: string | number;
|
entity: keyof ED;
|
||||||
extraActions: OakExtraActionProps[];
|
extraActions: OakExtraActionProps[];
|
||||||
actions: ActionDef<ED, string | number>[];
|
actions: ActionDef<ED, keyof ED>[];
|
||||||
cascadeActions: {
|
cascadeActions: { [K in keyof ED[keyof ED]["Schema"]]?: ActionDef<ED, keyof ED>[]; };
|
||||||
[x: string]: ActionDef<ED, string | number>[] | undefined;
|
|
||||||
id?: ActionDef<ED, string | number>[] | undefined;
|
|
||||||
$$seq$$?: ActionDef<ED, string | number>[] | undefined;
|
|
||||||
$$createAt$$?: ActionDef<ED, string | number>[] | undefined;
|
|
||||||
$$updateAt$$?: ActionDef<ED, string | number>[] | undefined;
|
|
||||||
$$deleteAt$$?: ActionDef<ED, string | number>[] | undefined;
|
|
||||||
};
|
|
||||||
onAction: Function;
|
onAction: Function;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
/// <reference types="react" />
|
import { ED } from "../../types/AbstractComponent";
|
||||||
import { Item } from './types';
|
import { Item } from './types';
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
entity: string | number;
|
entity: keyof ED;
|
||||||
items: Item[];
|
items: Item[];
|
||||||
mode: "default" | "cell" | "table-cell";
|
mode: "default" | "cell" | "table-cell";
|
||||||
column: number;
|
column: number;
|
||||||
fixed: boolean;
|
fixed: boolean;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ButtonProps } from 'antd';
|
import { ButtonProps } from 'antd';
|
||||||
export type Item = {
|
export type Item = {
|
||||||
icon?: string | React.ReactNode;
|
icon?: string | React.ReactNode;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
/// <reference types="react" />
|
import { ED } from "../../types/AbstractComponent";
|
||||||
import { IMode, Item } from "./type";
|
import { IMode, Item } from "./type";
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
entity: string | number;
|
entity: keyof ED;
|
||||||
items: Item[];
|
items: Item[];
|
||||||
rows: number;
|
rows: number;
|
||||||
column: number;
|
column: number;
|
||||||
mode: IMode;
|
mode: IMode;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ButtonProps } from 'antd';
|
import { ButtonProps } from 'antd';
|
||||||
export type Item = {
|
export type Item = {
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, boolean, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, boolean, {
|
||||||
value: (string | number)[];
|
value: Array<string | number>;
|
||||||
option: {
|
option: Array<{
|
||||||
label: string;
|
label: string;
|
||||||
value: string | number;
|
value: string | number;
|
||||||
}[];
|
}>;
|
||||||
onSelect: (v: Array<string | number>) => void;
|
onSelect: (v: Array<string | number>) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,2 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactCompo
|
||||||
column?: number | Record<Breakpoint, number>;
|
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;
|
title?: string;
|
||||||
bordered?: boolean;
|
bordered?: boolean;
|
||||||
layout?: 'horizontal' | 'vertical';
|
layout?: "horizontal" | "vertical";
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
||||||
onClicked: (entity: string) => void;
|
onClicked: (entity: string) => void;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ED } from '../../types/AbstractComponent';
|
import { ED } from '../../types/AbstractComponent';
|
||||||
import { ColumnProps } from '../../types/Filter';
|
import { ColumnProps } from '../../types/Filter';
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
||||||
entity: string | number;
|
entity: keyof ED;
|
||||||
column: ColumnProps<ED, string | number>;
|
column: ColumnProps<ED, keyof ED>;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
onActionClick: (action: string) => void;
|
onActionClick: (action: string) => void;
|
||||||
actions: string[];
|
actions: string[];
|
||||||
actionDescriptions: any;
|
actionDescriptions: any;
|
||||||
iconSize: string;
|
iconSize: string;
|
||||||
rowNum: number;
|
rowNum: number;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,2 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,2 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "i18n", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "i18n", true, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,2 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "i18n", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "i18n", false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
name: string;
|
name: string;
|
||||||
size: number | null | undefined;
|
size: number | undefined | null;
|
||||||
color: string;
|
color: "primary" | "success" | "error" | "waring" | "info" | string;
|
||||||
oakClass: string;
|
oakClass: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ 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?: TableProps<RowWithActions<ED2, T2>>['rowSelection'];
|
rowSelection?: TableProps<RowWithActions<ED2, T2>>["rowSelection"];
|
||||||
hideHeader?: boolean;
|
hideHeader?: boolean;
|
||||||
disableSerialNumber?: boolean;
|
disableSerialNumber?: boolean;
|
||||||
size?: 'large' | 'middle' | 'small';
|
size?: "large" | "middle" | "small";
|
||||||
scroll?: TableProps<RowWithActions<ED2, T2>>['scroll'];
|
scroll?: TableProps<RowWithActions<ED2, T2>>["scroll"];
|
||||||
empty?: React.ReactNode;
|
empty?: React.ReactNode;
|
||||||
opWidth?: number;
|
opWidth?: number;
|
||||||
ellipsis?: boolean;
|
ellipsis?: boolean;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { ED, OakAbsDerivedAttrDef } from '../../../types/AbstractComponent';
|
||||||
import { ReactComponentProps } from '../../../types/Page';
|
import { ReactComponentProps } from '../../../types/Page';
|
||||||
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, {
|
||||||
value: string | string[];
|
value: string | string[];
|
||||||
type: OakAbsDerivedAttrDef['type'];
|
type: OakAbsDerivedAttrDef["type"];
|
||||||
color: string;
|
color: string;
|
||||||
linkUrl: string;
|
linkUrl: string;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
key: string;
|
key: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactCompo
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
className?: string;
|
className?: string;
|
||||||
showQuickJumper?: boolean;
|
showQuickJumper?: boolean;
|
||||||
size?: 'default' | 'small';
|
size?: "default" | "small";
|
||||||
showSizeChanger?: boolean;
|
showSizeChanger?: boolean;
|
||||||
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,15 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ED } from '../../types/AbstractComponent';
|
import { ED } from '../../types/AbstractComponent';
|
||||||
import { RowWithActions } from '../..';
|
import { RowWithActions } from '../..';
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
||||||
entity: string | number;
|
entity: keyof ED;
|
||||||
multiple: boolean;
|
multiple: boolean;
|
||||||
onSelect: (value: [{
|
onSelect: (value: [{
|
||||||
id: string;
|
id: string;
|
||||||
}]) => void;
|
}]) => void;
|
||||||
title: (row: RowWithActions<ED, keyof ED>) => string;
|
title: (row: RowWithActions<ED, keyof ED>) => string;
|
||||||
titleLabel: string;
|
titleLabel: string;
|
||||||
filter: {
|
filter: ED[keyof ED]["Filter"];
|
||||||
[K: string]: any;
|
sorter: ED[keyof ED]["Sorter"];
|
||||||
};
|
|
||||||
sorter: {
|
|
||||||
$attr: {
|
|
||||||
[K: string]: any;
|
|
||||||
};
|
|
||||||
$direction?: "asc" | "desc" | undefined;
|
|
||||||
}[];
|
|
||||||
projection: {};
|
projection: {};
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { ED, OakAbsRefAttrPickerRender } from '../../types/AbstractComponent';
|
import { ED, OakAbsRefAttrPickerRender } from '../../types/AbstractComponent';
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, false, {
|
||||||
placeholder: string | undefined;
|
placeholder: string | undefined;
|
||||||
multiple: boolean;
|
multiple: boolean;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
entityIds: string[];
|
entityIds: string[];
|
||||||
pickerRender: OakAbsRefAttrPickerRender<ED, string | number>;
|
pickerRender: OakAbsRefAttrPickerRender<ED, keyof ED>;
|
||||||
onChange: (value: string[]) => void;
|
onChange: (value: string[]) => void;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "actionAuth", true, {
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "actionAuth", true, {
|
||||||
pathId: string;
|
pathId: string;
|
||||||
relations: {
|
relations: {
|
||||||
|
|
@ -6,5 +5,5 @@ declare const _default: (props: import("../../..").ReactComponentProps<import("o
|
||||||
name: string;
|
name: string;
|
||||||
}[];
|
}[];
|
||||||
actions: string[];
|
actions: string[];
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "path", false, {
|
declare const _default: (props: import("../../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "path", false, {
|
||||||
actions: string[];
|
actions: string[];
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { EntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
declare const _default: (props: import("../../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & EntityDict, "path", true, {
|
declare const _default: (props: import("../../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & EntityDict, "path", true, {
|
||||||
entity: string;
|
entity: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { EntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
declare const _default: (props: import("../../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & EntityDict, "path", false, {
|
declare const _default: (props: import("../../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & EntityDict, "path", false, {
|
||||||
onConfirmed: () => void;
|
onConfirmed: () => void;
|
||||||
entity: string;
|
entity: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "relationAuth", true, {
|
declare const _default: (props: import("../../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, "relationAuth", true, {
|
||||||
pathId: string;
|
pathId: string;
|
||||||
sourceRelations: {
|
sourceRelations: {
|
||||||
|
|
@ -9,5 +8,5 @@ declare const _default: (props: import("../../..").ReactComponentProps<import("o
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
}[];
|
}[];
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/// <reference types="react" />
|
import { ED } from '../../types/AbstractComponent';
|
||||||
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
declare const _default: (props: import("../..").ReactComponentProps<import("oak-domain/lib/types").EntityDict & import("oak-domain/lib/base-app-domain").EntityDict, string | number, true, {
|
||||||
entity: string | number;
|
entity: keyof ED;
|
||||||
attributes: string[];
|
attributes: string[];
|
||||||
placeholder: string;
|
placeholder: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { ED, OakAbsAttrUpsertDef } from '../../types/AbstractComponent';
|
import { ED, OakAbsAttrUpsertDef } from '../../types/AbstractComponent';
|
||||||
import { ReactComponentProps } from '../../types/Page';
|
import { ReactComponentProps } from '../../types/Page';
|
||||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2, T3 extends string | number = string | number>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends ED, T2 extends keyof ED2, T3 extends keyof ED = keyof ED>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
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;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export declare abstract class BackendRuntimeContext<ED extends EntityDict & Base
|
||||||
eventOperationMap: Record<string, string[]>;
|
eventOperationMap: Record<string, string[]>;
|
||||||
getNavigatorState(): {
|
getNavigatorState(): {
|
||||||
pathname: string;
|
pathname: string;
|
||||||
oakFrom?: string | undefined;
|
oakFrom?: string;
|
||||||
} | undefined;
|
} | undefined;
|
||||||
getSubscriberId(): string | undefined;
|
getSubscriberId(): string | undefined;
|
||||||
getBriefEnvironment(): BriefEnv | undefined;
|
getBriefEnvironment(): BriefEnv | undefined;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ export default abstract class Console<ED extends EntityDict & BaseEntityDict, OM
|
||||||
setContext(entity: keyof ED, entityId: string): void;
|
setContext(entity: keyof ED, entityId: string): void;
|
||||||
getContext(): ConsoleContext<ED> | undefined;
|
getContext(): ConsoleContext<ED> | undefined;
|
||||||
getAvailMenus(): (OMenu & {
|
getAvailMenus(): (OMenu & {
|
||||||
sourceEntity?: keyof ED | undefined;
|
sourceEntity?: keyof ED;
|
||||||
available: boolean | null;
|
available: boolean | null;
|
||||||
})[];
|
})[];
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="node" />
|
|
||||||
import { Feature } from '../types/Feature';
|
import { Feature } from '../types/Feature';
|
||||||
export declare class Navigator extends Feature {
|
export declare class Navigator extends Feature {
|
||||||
namespace: string;
|
namespace: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
import { OakNavigateToParameters } from '../types/Page';
|
import { OakNavigateToParameters } from '../types/Page';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { EntityDict } from 'oak-domain/lib/types';
|
import { EntityDict } from 'oak-domain/lib/types';
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ export declare class Navigator extends CommonNavigator {
|
||||||
namespace: string;
|
namespace: string;
|
||||||
url: string;
|
url: string;
|
||||||
state: unknown;
|
state: unknown;
|
||||||
key: string;
|
key: import("history").Key;
|
||||||
pathname: string;
|
pathname: import("history").Pathname;
|
||||||
search: string;
|
search: import("history").Search;
|
||||||
hash: string;
|
hash: import("history").Hash;
|
||||||
};
|
};
|
||||||
getState(): {
|
getState(): {
|
||||||
pathname: string;
|
pathname: string;
|
||||||
|
|
|
||||||
|
|
@ -119,20 +119,20 @@ declare class ListNode<ED extends EntityDict & BaseEntityDict, T extends keyof E
|
||||||
removeChild(path: string): void;
|
removeChild(path: string): void;
|
||||||
getChild(path: string): SingleNode<ED, T>;
|
getChild(path: string): SingleNode<ED, T>;
|
||||||
getNamedFilters(): (NamedFilterItem<ED, T> & {
|
getNamedFilters(): (NamedFilterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedFilterByName(name: string): (NamedFilterItem<ED, T> & {
|
getNamedFilterByName(name: string): (NamedFilterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
addNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
removeNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilterByName(name: string, refresh?: boolean): void;
|
removeNamedFilterByName(name: string, refresh?: boolean): void;
|
||||||
getNamedSorters(): (NamedSorterItem<ED, T> & {
|
getNamedSorters(): (NamedSorterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedSorterByName(name: string): (NamedSorterItem<ED, T> & {
|
getNamedSorterByName(name: string): (NamedSorterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedSorters(sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
setNamedSorters(sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedSorter(sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
addNamedSorter(sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
||||||
|
|
@ -327,20 +327,20 @@ export declare class RunningTree<ED extends EntityDict & BaseEntityDict> extends
|
||||||
setPageSize<T extends keyof ED>(path: string, pageSize: number): void;
|
setPageSize<T extends keyof ED>(path: string, pageSize: number): void;
|
||||||
setCurrentPage<T extends keyof ED>(path: string, currentPage: number): void;
|
setCurrentPage<T extends keyof ED>(path: string, currentPage: number): void;
|
||||||
getNamedFilters<T extends keyof ED>(path: string): (NamedFilterItem<ED, keyof ED> & {
|
getNamedFilters<T extends keyof ED>(path: string): (NamedFilterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedFilterByName<T extends keyof ED>(path: string, name: string): (NamedFilterItem<ED, keyof ED> & {
|
getNamedFilterByName<T extends keyof ED>(path: string, name: string): (NamedFilterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedFilters<T extends keyof ED>(path: string, filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
setNamedFilters<T extends keyof ED>(path: string, filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
addNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
removeNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilterByName<T extends keyof ED>(path: string, name: string, refresh?: boolean): void;
|
removeNamedFilterByName<T extends keyof ED>(path: string, name: string, refresh?: boolean): void;
|
||||||
getNamedSorters<T extends keyof ED>(path: string): (NamedSorterItem<ED, keyof ED> & {
|
getNamedSorters<T extends keyof ED>(path: string): (NamedSorterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedSorterByName<T extends keyof ED>(path: string, name: string): (NamedSorterItem<ED, keyof ED> & {
|
getNamedSorterByName<T extends keyof ED>(path: string, name: string): (NamedSorterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedSorters<T extends keyof ED>(path: string, sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
setNamedSorters<T extends keyof ED>(path: string, sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedSorter<T extends keyof ED>(path: string, sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
addNamedSorter<T extends keyof ED>(path: string, sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
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';
|
||||||
|
|
|
||||||
|
|
@ -25,84 +25,84 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
componentDidUpdate(prevProps: Record<string, any>, prevState: Record<string, any>): Promise<void>;
|
componentDidUpdate(prevProps: Record<string, any>, prevState: Record<string, any>): Promise<void>;
|
||||||
render(): React.ReactNode;
|
render(): React.ReactNode;
|
||||||
oakFullpath: string;
|
oakFullpath: string;
|
||||||
featuresSubscribed: {
|
featuresSubscribed: Array<{
|
||||||
name: string;
|
name: string;
|
||||||
callback: (args?: any) => void;
|
callback: (args?: any) => void;
|
||||||
unsubHandler?: (() => void) | undefined;
|
unsubHandler?: () => void;
|
||||||
}[];
|
}>;
|
||||||
addFeatureSub(name: string, callback: (args?: any) => void): void;
|
addFeatureSub(name: string, callback: (args?: any) => void): void;
|
||||||
removeFeatureSub(name: string, callback: (args?: any) => void): void;
|
removeFeatureSub(name: string, callback: (args?: any) => void): void;
|
||||||
unsubscribeAll(): void;
|
unsubscribeAll(): void;
|
||||||
subscribeAll(): void;
|
subscribeAll(): void;
|
||||||
save(key: string, item: any): Promise<void>;
|
save(key: string, item: any): Promise<void>;
|
||||||
load(key: string): Promise<any>;
|
load(key: string): Promise<any>;
|
||||||
clear(key?: string | undefined): Promise<void>;
|
clear(key?: string): Promise<void>;
|
||||||
setNotification(data: NotificationProps): void;
|
setNotification(data: NotificationProps): void;
|
||||||
consumeNotification(): NotificationProps | undefined;
|
consumeNotification(): NotificationProps | undefined;
|
||||||
setMessage(data: MessageProps): Promise<void>;
|
setMessage(data: MessageProps): Promise<void>;
|
||||||
consumeMessage(): MessageProps | undefined;
|
consumeMessage(): MessageProps | undefined;
|
||||||
reRender(extra?: Record<string, any> | undefined): void;
|
reRender(extra?: Record<string, any>): void;
|
||||||
navigateTo<T2 extends keyof ED>(options: {
|
navigateTo<T2 extends keyof ED>(options: {
|
||||||
url: string;
|
url: string;
|
||||||
} & OakNavigateToParameters<ED, T2>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
} & OakNavigateToParameters<ED, T2>, state?: Record<string, any>, disableNamespace?: boolean): Promise<void>;
|
||||||
navigateBack(delta?: number | undefined): Promise<void>;
|
navigateBack(delta?: number): Promise<void>;
|
||||||
redirectTo<T2_1 extends keyof ED>(options: {
|
redirectTo<T2 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>, state?: Record<string, any>, disableNamespace?: boolean): Promise<void>;
|
||||||
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string;
|
||||||
}, path?: string | undefined): string;
|
}, path?: string): string;
|
||||||
addItems<T_2 extends keyof ED>(data: (Omit<ED[T_2]["CreateSingle"]["data"], "id"> & {
|
addItems<T_1 extends keyof ED>(data: (Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string;
|
||||||
})[], path?: string | undefined): string[];
|
})[], path?: string): string[];
|
||||||
removeItem(id: string, path?: string | undefined): void;
|
removeItem(id: string, path?: string): void;
|
||||||
removeItems(ids: string[], path?: string | undefined): void;
|
removeItems(ids: string[], path?: string): 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;
|
updateItem<T_1 extends keyof ED>(data: ED[T_1]["Update"]["data"], id: string, action?: ED[T_1]["Action"] | undefined, path?: string): 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;
|
updateItems<T_1 extends keyof ED>(data: ED[T_1]["Update"]["data"], ids: string[], action?: ED[T_1]["Action"] | undefined, path?: string): void;
|
||||||
recoverItem(id: string, path?: string | undefined): void;
|
recoverItem(id: string, path?: string): void;
|
||||||
recoverItems(ids: string[], path?: string | undefined): void;
|
recoverItems(ids: string[], path?: string): void;
|
||||||
resetItem(id: string, path?: string | undefined): void;
|
resetItem(id: string, path?: string): void;
|
||||||
update<T_5 extends keyof ED>(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void;
|
update<T_1 extends keyof ED>(data: ED[T_1]["Update"]["data"], action?: ED[T_1]["Action"] | undefined, path?: string): void;
|
||||||
create<T_6 extends keyof ED>(data: Omit<ED[T_6]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
create<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id">, path?: string): void;
|
||||||
remove(path?: string | undefined): void;
|
remove(path?: string): void;
|
||||||
isCreation(path?: string | undefined): boolean;
|
isCreation(path?: string): boolean;
|
||||||
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
clean(lsn?: number, dontPublish?: true, path?: string): void;
|
||||||
savePoint(): number;
|
savePoint(): number;
|
||||||
t(key: string, params?: object | undefined): string;
|
t(key: string, params?: object): string;
|
||||||
execute(action?: ED[T]["Action"] | undefined, messageProps?: boolean | MessageProps | undefined, path?: string | undefined, opers?: {
|
execute(action?: ED[T]["Action"] | undefined, messageProps?: boolean | MessageProps, path?: string, opers?: {
|
||||||
entity: T;
|
entity: T;
|
||||||
operation: ED[T]["Operation"];
|
operation: ED[T]["Operation"];
|
||||||
}[] | undefined): Promise<void>;
|
}[] | undefined): Promise<void>;
|
||||||
isDirty(path?: string | undefined): boolean;
|
isDirty(path?: string): boolean;
|
||||||
getFreshValue(path?: string | undefined): Partial<import("oak-domain/lib/types").GeneralEntityShape> | Partial<import("oak-domain/lib/types").GeneralEntityShape>[] | undefined;
|
getFreshValue(path?: string): Partial<import("oak-domain/lib/types").GeneralEntityShape> | Partial<import("oak-domain/lib/types").GeneralEntityShape>[] | undefined;
|
||||||
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
select<T2 extends keyof ED>(entity: T2, selection: ED[T2]["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, cacheInsensative?: true | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
checkOperation<T2 extends keyof ED>(entity: T2, operation: Omit<ED[T2]["Operation"], "id">, checkerTypes?: CheckerType[], cacheInsensative?: true): boolean | { [A in ED[T2]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2]["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, action?: string): boolean | { [A in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
||||||
getOperations<T_7 extends keyof ED>(path?: string | undefined): {
|
getOperations<T_1 extends keyof ED>(path?: string): {
|
||||||
entity: keyof ED;
|
entity: keyof ED;
|
||||||
operation: ED[keyof ED]["Operation"];
|
operation: ED[keyof ED]["Operation"];
|
||||||
}[] | undefined;
|
}[] | undefined;
|
||||||
refresh(pageNumber?: number | undefined, resetTotal?: boolean | undefined): Promise<void>;
|
refresh(pageNumber?: number, resetTotal?: boolean): Promise<void>;
|
||||||
loadMore(): Promise<void>;
|
loadMore(): Promise<void>;
|
||||||
setId(id: string, path?: string | undefined): void;
|
setId(id: string, path?: string): void;
|
||||||
unsetId(): void;
|
unsetId(): void;
|
||||||
getId(path?: string | undefined): string | undefined;
|
getId(path?: string): string | undefined;
|
||||||
setFilters(filters: NamedFilterItem<ED, T>[], path?: string | undefined): void;
|
setFilters(filters: NamedFilterItem<ED, T>[], path?: string): void;
|
||||||
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean | undefined, path?: string | undefined): void;
|
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean, path?: string): void;
|
||||||
getFilters(path?: string | undefined): any[] | undefined;
|
getFilters(path?: string): any[] | undefined;
|
||||||
getFilterByName(name: string, path?: string | undefined): any;
|
getFilterByName(name: string, path?: string): any;
|
||||||
addNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
addNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedFilterByName(name: string, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedFilterByName(name: string, refresh?: boolean, path?: string): void;
|
||||||
setNamedSorters(namedSorters: NamedSorterItem<ED, T>[], refresh?: boolean | undefined, path?: string | undefined): void;
|
setNamedSorters(namedSorters: NamedSorterItem<ED, T>[], refresh?: boolean, path?: string): void;
|
||||||
getSorters(path?: string | undefined): ED[T]["Sorter"][] | undefined;
|
getSorters(path?: string): ED[T]["Sorter"][] | undefined;
|
||||||
getSorterByName(name: string, path?: string | undefined): any;
|
getSorterByName(name: string, path?: string): any;
|
||||||
addNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
addNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedSorterByName(name: string, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedSorterByName(name: string, refresh?: boolean, path?: string): void;
|
||||||
getPagination(path?: string | undefined): import(".").Pagination | undefined;
|
getPagination(path?: string): import(".").Pagination | undefined;
|
||||||
setPageSize(pageSize: number, path?: string | undefined): void;
|
setPageSize(pageSize: number, path?: string): void;
|
||||||
setCurrentPage(currentPage: number, path?: string | undefined): void;
|
setCurrentPage(currentPage: number, path?: string): 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;
|
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;
|
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;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { Breakpoints } from './context';
|
import { Breakpoints } from './context';
|
||||||
export interface ResponsiveProviderProps {
|
export interface ResponsiveProviderProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
breakpoints?: Breakpoints;
|
breakpoints?: Breakpoints;
|
||||||
}
|
}
|
||||||
export declare function ResponsiveProvider(props: ResponsiveProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<{
|
export declare function ResponsiveProvider(props: ResponsiveProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<{
|
||||||
breakpoints?: Breakpoints | undefined;
|
breakpoints?: Breakpoints;
|
||||||
}>>;
|
}>>;
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,5 @@ 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: React.Context<{
|
export declare const ResponsiveContext: React.Context<{
|
||||||
breakpoints?: Breakpoints | undefined;
|
breakpoints?: Breakpoints;
|
||||||
}>;
|
}>;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { BrowserRouterProps } from 'react-router-dom';
|
import { BrowserRouterProps } from 'react-router-dom';
|
||||||
export interface IBrowserRouterProps extends BrowserRouterProps {
|
export interface IBrowserRouterProps extends BrowserRouterProps {
|
||||||
namespace: string;
|
namespace: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { EntityDict } from 'oak-domain/lib/types/Entity';
|
import { EntityDict } from 'oak-domain/lib/types/Entity';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { DataType, DataTypeParams } from 'oak-domain/lib/types/schema/DataTypes';
|
import { DataType, DataTypeParams } from 'oak-domain/lib/types/schema/DataTypes';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { Dayjs } from 'dayjs';
|
import { Dayjs } from 'dayjs';
|
||||||
import { OakAbsRefAttrPickerDef, ColSpanType, ED } from './AbstractComponent';
|
import { OakAbsRefAttrPickerDef, ColSpanType, ED } from './AbstractComponent';
|
||||||
export type ViewType = 'Input' | 'Select' | 'DatePicker' | 'DatePicker.RangePicker' | 'RefAttr';
|
export type ViewType = 'Input' | 'Select' | 'DatePicker' | 'DatePicker.RangePicker' | 'RefAttr';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
export type MapComponent = (props: {
|
export type MapComponent = (props: {
|
||||||
id?: string;
|
id?: string;
|
||||||
center?: [number, number];
|
center?: [number, number];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
import { Aspect, EntityDict, CheckerType, AggregationResult, OpRecord, OakUserException } from "oak-domain/lib/types";
|
import { Aspect, EntityDict, CheckerType, AggregationResult, OpRecord, OakUserException } 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 { Feature } from './Feature';
|
import { Feature } from './Feature';
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
export type PromisifyOption<T extends Record<string, any>> = Omit<T, 'success' | 'fail' | 'complete'>;
|
export type PromisifyOption<T extends Record<string, any>> = Omit<T, 'success' | 'fail' | 'complete'>;
|
||||||
export type PromisifyResult<T extends WechatMiniprogram.AsyncMethodOptionLike> = Promise<Parameters<Exclude<T['success'], undefined>>[0]>;
|
export type PromisifyResult<T extends WechatMiniprogram.AsyncMethodOptionLike> = Promise<Parameters<Exclude<T['success'], undefined>>[0]>;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
import { PromisifyOption } from '../../types/Wx';
|
import { PromisifyOption } from '../../types/Wx';
|
||||||
export declare class Bluetooth {
|
export declare class Bluetooth {
|
||||||
private serverDict;
|
private serverDict;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export declare class Upload {
|
export declare class Upload {
|
||||||
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function): Promise<any>;
|
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, method?: "POST" | "PUT" | "PATCH"): Promise<any>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,12 @@
|
||||||
export class Upload {
|
export class Upload {
|
||||||
// async uploadFile(
|
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, method = "POST") {
|
||||||
// file: File | string,
|
const isPut = method === "PUT";
|
||||||
// name: string,
|
// 进度监听模式
|
||||||
// uploadUrl: string,
|
|
||||||
// formData: Record<string, any>,
|
|
||||||
// autoInform?: boolean
|
|
||||||
// ): Promise<any> {
|
|
||||||
// const formData2 = new FormData();
|
|
||||||
// for (const key of Object.keys(formData)) {
|
|
||||||
// formData2.append(key, formData[key]);
|
|
||||||
// }
|
|
||||||
// formData2.append(name || 'file', file as File);
|
|
||||||
// const options = {
|
|
||||||
// body: formData2,
|
|
||||||
// method: 'POST',
|
|
||||||
// };
|
|
||||||
// const result = await fetch(uploadUrl, options);
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent) {
|
|
||||||
if (getPercent) {
|
if (getPercent) {
|
||||||
const formData2 = new FormData();
|
|
||||||
Object.entries(formData).forEach(([key, value]) => {
|
|
||||||
formData2.append(key, value);
|
|
||||||
});
|
|
||||||
formData2.append(name || 'file', file);
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
let percent = 0;
|
let percent = 0;
|
||||||
xhr.upload.addEventListener('progress', (event) => {
|
xhr.upload.addEventListener("progress", (event) => {
|
||||||
if (event.lengthComputable) {
|
if (event.lengthComputable) {
|
||||||
percent = Math.round((event.loaded / event.total) * 100);
|
percent = Math.round((event.loaded / event.total) * 100);
|
||||||
getPercent(percent);
|
getPercent(percent);
|
||||||
|
|
@ -37,14 +15,14 @@ export class Upload {
|
||||||
xhr.onload = () => {
|
xhr.onload = () => {
|
||||||
if (xhr.status >= 200 && xhr.status < 300) {
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
if (xhr.status === 204) {
|
if (xhr.status === 204) {
|
||||||
resolve({ status: 204 }); // 正确返回状态码
|
resolve({ status: 204 });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(xhr.responseText);
|
const data = JSON.parse(xhr.responseText);
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch {
|
||||||
resolve({ status: xhr.status, raw: xhr.responseText });
|
resolve({ status: xhr.status, raw: xhr.responseText });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -53,22 +31,51 @@ export class Upload {
|
||||||
reject(new Error(`HTTP Error: ${xhr.status}`));
|
reject(new Error(`HTTP Error: ${xhr.status}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.onerror = () => reject(new Error('Network Error'));
|
xhr.onerror = () => reject(new Error("Network Error"));
|
||||||
xhr.open('POST', uploadUrl);
|
xhr.open(method, uploadUrl);
|
||||||
xhr.send(formData2);
|
if (isPut) {
|
||||||
|
// PUT 模式:直接上传文件
|
||||||
|
if (file instanceof File) {
|
||||||
|
xhr.setRequestHeader("Content-Type", file.type || "application/octet-stream");
|
||||||
|
}
|
||||||
|
xhr.send(file);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// POST / PATCH 模式:构建表单
|
||||||
|
const formData2 = new FormData();
|
||||||
|
Object.entries(formData).forEach(([key, value]) => {
|
||||||
|
formData2.append(key, value);
|
||||||
|
});
|
||||||
|
formData2.append(name || "file", file);
|
||||||
|
xhr.send(formData2);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 无进度监听模式(直接 fetch)
|
||||||
|
if (isPut) {
|
||||||
|
// S3 预签名上传
|
||||||
|
const headers = {};
|
||||||
|
if (file instanceof File) {
|
||||||
|
headers["Content-Type"] = file.type || "application/octet-stream";
|
||||||
|
}
|
||||||
|
const result = await fetch(uploadUrl, {
|
||||||
|
method: "PUT",
|
||||||
|
headers,
|
||||||
|
body: file,
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
// 表单上传
|
||||||
const formData2 = new FormData();
|
const formData2 = new FormData();
|
||||||
for (const key of Object.keys(formData)) {
|
for (const key of Object.keys(formData)) {
|
||||||
formData2.append(key, formData[key]);
|
formData2.append(key, formData[key]);
|
||||||
}
|
}
|
||||||
formData2.append(name || 'file', file);
|
formData2.append(name || "file", file);
|
||||||
const options = {
|
const result = await fetch(uploadUrl, {
|
||||||
|
method,
|
||||||
body: formData2,
|
body: formData2,
|
||||||
method: 'POST',
|
});
|
||||||
};
|
|
||||||
const result = await fetch(uploadUrl, options);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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: BasicFeatures<ED>["cache"]) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: BasicFeatures<ED>["cache"]) => AspectDictTrans<ED, AD, any>;
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export declare abstract class BackendRuntimeContext<ED extends EntityDict & Base
|
||||||
eventOperationMap: Record<string, string[]>;
|
eventOperationMap: Record<string, string[]>;
|
||||||
getNavigatorState(): {
|
getNavigatorState(): {
|
||||||
pathname: string;
|
pathname: string;
|
||||||
oakFrom?: string | undefined;
|
oakFrom?: string;
|
||||||
} | undefined;
|
} | undefined;
|
||||||
getSubscriberId(): string | undefined;
|
getSubscriberId(): string | undefined;
|
||||||
getBriefEnvironment(): BriefEnv | undefined;
|
getBriefEnvironment(): BriefEnv | undefined;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.createDebugStore = void 0;
|
exports.createDebugStore = createDebugStore;
|
||||||
const node_schedule_1 = require("node-schedule");
|
const node_schedule_1 = require("node-schedule");
|
||||||
const constant_1 = require("../constant/constant");
|
const constant_1 = require("../constant/constant");
|
||||||
const DebugStore_1 = require("./DebugStore");
|
const DebugStore_1 = require("./DebugStore");
|
||||||
|
|
@ -223,4 +223,3 @@ function createDebugStore(storageSchema, contextBuilder, triggers, checkers, wat
|
||||||
}
|
}
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
exports.createDebugStore = createDebugStore;
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ export default abstract class Console<ED extends EntityDict & BaseEntityDict, OM
|
||||||
setContext(entity: keyof ED, entityId: string): void;
|
setContext(entity: keyof ED, entityId: string): void;
|
||||||
getContext(): ConsoleContext<ED> | undefined;
|
getContext(): ConsoleContext<ED> | undefined;
|
||||||
getAvailMenus(): (OMenu & {
|
getAvailMenus(): (OMenu & {
|
||||||
sourceEntity?: keyof ED | undefined;
|
sourceEntity?: keyof ED;
|
||||||
available: boolean | null;
|
available: boolean | null;
|
||||||
})[];
|
})[];
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.initializeStep1 = exports.initializeStep2 = void 0;
|
exports.initializeStep2 = initializeStep2;
|
||||||
|
exports.initializeStep1 = initializeStep1;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const cache_1 = require("./cache");
|
const cache_1 = require("./cache");
|
||||||
const location_1 = require("./location");
|
const location_1 = require("./location");
|
||||||
|
|
@ -43,7 +44,6 @@ function initializeStep2(features, connector, storageSchema, frontendContextBuil
|
||||||
subscriber,
|
subscriber,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.initializeStep2 = initializeStep2;
|
|
||||||
function initializeStep1() {
|
function initializeStep1() {
|
||||||
const location = new location_1.Location();
|
const location = new location_1.Location();
|
||||||
const environment = new environment_1.Environment();
|
const environment = new environment_1.Environment();
|
||||||
|
|
@ -60,4 +60,3 @@ function initializeStep1() {
|
||||||
navigator,
|
navigator,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.initializeStep1 = initializeStep1;
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="node" />
|
|
||||||
import { Feature } from '../types/Feature';
|
import { Feature } from '../types/Feature';
|
||||||
export declare class Navigator extends Feature {
|
export declare class Navigator extends Feature {
|
||||||
namespace: string;
|
namespace: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
import { OakNavigateToParameters } from '../types/Page';
|
import { OakNavigateToParameters } from '../types/Page';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { EntityDict } from 'oak-domain/lib/types';
|
import { EntityDict } from 'oak-domain/lib/types';
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ export declare class Navigator extends CommonNavigator {
|
||||||
namespace: string;
|
namespace: string;
|
||||||
url: string;
|
url: string;
|
||||||
state: unknown;
|
state: unknown;
|
||||||
key: string;
|
key: import("history").Key;
|
||||||
pathname: string;
|
pathname: import("history").Pathname;
|
||||||
search: string;
|
search: import("history").Search;
|
||||||
hash: string;
|
hash: import("history").Hash;
|
||||||
};
|
};
|
||||||
getState(): {
|
getState(): {
|
||||||
pathname: string;
|
pathname: string;
|
||||||
|
|
|
||||||
|
|
@ -119,20 +119,20 @@ declare class ListNode<ED extends EntityDict & BaseEntityDict, T extends keyof E
|
||||||
removeChild(path: string): void;
|
removeChild(path: string): void;
|
||||||
getChild(path: string): SingleNode<ED, T>;
|
getChild(path: string): SingleNode<ED, T>;
|
||||||
getNamedFilters(): (NamedFilterItem<ED, T> & {
|
getNamedFilters(): (NamedFilterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedFilterByName(name: string): (NamedFilterItem<ED, T> & {
|
getNamedFilterByName(name: string): (NamedFilterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
addNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
removeNamedFilter(filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilterByName(name: string, refresh?: boolean): void;
|
removeNamedFilterByName(name: string, refresh?: boolean): void;
|
||||||
getNamedSorters(): (NamedSorterItem<ED, T> & {
|
getNamedSorters(): (NamedSorterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedSorterByName(name: string): (NamedSorterItem<ED, T> & {
|
getNamedSorterByName(name: string): (NamedSorterItem<ED, T> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedSorters(sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
setNamedSorters(sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedSorter(sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
addNamedSorter(sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
||||||
|
|
@ -327,20 +327,20 @@ export declare class RunningTree<ED extends EntityDict & BaseEntityDict> extends
|
||||||
setPageSize<T extends keyof ED>(path: string, pageSize: number): void;
|
setPageSize<T extends keyof ED>(path: string, pageSize: number): void;
|
||||||
setCurrentPage<T extends keyof ED>(path: string, currentPage: number): void;
|
setCurrentPage<T extends keyof ED>(path: string, currentPage: number): void;
|
||||||
getNamedFilters<T extends keyof ED>(path: string): (NamedFilterItem<ED, keyof ED> & {
|
getNamedFilters<T extends keyof ED>(path: string): (NamedFilterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedFilterByName<T extends keyof ED>(path: string, name: string): (NamedFilterItem<ED, keyof ED> & {
|
getNamedFilterByName<T extends keyof ED>(path: string, name: string): (NamedFilterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedFilters<T extends keyof ED>(path: string, filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
setNamedFilters<T extends keyof ED>(path: string, filters: NamedFilterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
addNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
removeNamedFilter<T extends keyof ED>(path: string, filter: NamedFilterItem<ED, T>, refresh?: boolean): void;
|
||||||
removeNamedFilterByName<T extends keyof ED>(path: string, name: string, refresh?: boolean): void;
|
removeNamedFilterByName<T extends keyof ED>(path: string, name: string, refresh?: boolean): void;
|
||||||
getNamedSorters<T extends keyof ED>(path: string): (NamedSorterItem<ED, keyof ED> & {
|
getNamedSorters<T extends keyof ED>(path: string): (NamedSorterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
})[];
|
})[];
|
||||||
getNamedSorterByName<T extends keyof ED>(path: string, name: string): (NamedSorterItem<ED, keyof ED> & {
|
getNamedSorterByName<T extends keyof ED>(path: string, name: string): (NamedSorterItem<ED, keyof ED> & {
|
||||||
applied?: boolean | undefined;
|
applied?: boolean;
|
||||||
}) | undefined;
|
}) | undefined;
|
||||||
setNamedSorters<T extends keyof ED>(path: string, sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
setNamedSorters<T extends keyof ED>(path: string, sorters: NamedSorterItem<ED, T>[], refresh?: boolean): void;
|
||||||
addNamedSorter<T extends keyof ED>(path: string, sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
addNamedSorter<T extends keyof ED>(path: string, sorter: NamedSorterItem<ED, T>, refresh?: boolean): void;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.initialize = void 0;
|
exports.initialize = initialize;
|
||||||
const features_1 = require("./features");
|
const features_1 = require("./features");
|
||||||
const IntrinsicCheckers_1 = require("oak-domain/lib/store/IntrinsicCheckers");
|
const IntrinsicCheckers_1 = require("oak-domain/lib/store/IntrinsicCheckers");
|
||||||
/**
|
/**
|
||||||
|
|
@ -27,4 +27,3 @@ function initialize(storageSchema, frontendContextBuilder, connector, checkers,
|
||||||
features,
|
features,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.initialize = initialize;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,13 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.select = exports.getFreshValue = exports.destroyNode = exports.execute = exports.loadMore = exports.refresh = exports.reRender = exports.onPathSet = void 0;
|
exports.onPathSet = onPathSet;
|
||||||
|
exports.reRender = reRender;
|
||||||
|
exports.refresh = refresh;
|
||||||
|
exports.loadMore = loadMore;
|
||||||
|
exports.execute = execute;
|
||||||
|
exports.destroyNode = destroyNode;
|
||||||
|
exports.getFreshValue = getFreshValue;
|
||||||
|
exports.select = select;
|
||||||
const assert_1 = require("oak-domain/lib/utils/assert");
|
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||||
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
||||||
const relation_1 = require("oak-domain/lib/store/relation");
|
const relation_1 = require("oak-domain/lib/store/relation");
|
||||||
|
|
@ -144,7 +151,6 @@ function onPathSet(option, isPage) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.onPathSet = onPathSet;
|
|
||||||
function checkActionAttrsIfNecessary(cache, entity, action, id) {
|
function checkActionAttrsIfNecessary(cache, entity, action, id) {
|
||||||
if (typeof action === 'string') {
|
if (typeof action === 'string') {
|
||||||
return action;
|
return action;
|
||||||
|
|
@ -547,13 +553,11 @@ function reRender(option, extra) {
|
||||||
this.setState(data);
|
this.setState(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.reRender = reRender;
|
|
||||||
async function refresh(pageNumber, resetTotal) {
|
async function refresh(pageNumber, resetTotal) {
|
||||||
if (this.state.oakFullpath) {
|
if (this.state.oakFullpath) {
|
||||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber, resetTotal);
|
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber, resetTotal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.refresh = refresh;
|
|
||||||
async function loadMore() {
|
async function loadMore() {
|
||||||
if (this.state.oakEntity && this.state.oakFullpath) {
|
if (this.state.oakEntity && this.state.oakFullpath) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -567,7 +571,6 @@ async function loadMore() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.loadMore = loadMore;
|
|
||||||
async function execute(action, path, messageProps, //默认true
|
async function execute(action, path, messageProps, //默认true
|
||||||
opers) {
|
opers) {
|
||||||
if (this.state.oakExecuting) {
|
if (this.state.oakExecuting) {
|
||||||
|
|
@ -589,12 +592,10 @@ opers) {
|
||||||
this.setMessage(messageData);
|
this.setMessage(messageData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.execute = execute;
|
|
||||||
function destroyNode(isPage, path) {
|
function destroyNode(isPage, path) {
|
||||||
this.features.runningTree.destroyNode(path, isPage);
|
this.features.runningTree.destroyNode(path, isPage);
|
||||||
(0, lodash_1.unset)(this.state, ['oakFullpath', 'oakEntity']);
|
(0, lodash_1.unset)(this.state, ['oakFullpath', 'oakEntity']);
|
||||||
}
|
}
|
||||||
exports.destroyNode = destroyNode;
|
|
||||||
function join(path1, path2) {
|
function join(path1, path2) {
|
||||||
if (path2 === '..') {
|
if (path2 === '..') {
|
||||||
const array = path1.split('.');
|
const array = path1.split('.');
|
||||||
|
|
@ -621,7 +622,6 @@ function getFreshValue(path) {
|
||||||
(0, assert_1.assert)(false);
|
(0, assert_1.assert)(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.getFreshValue = getFreshValue;
|
|
||||||
function select(entity, selection) {
|
function select(entity, selection) {
|
||||||
const rollback = this.features.runningTree.begin();
|
const rollback = this.features.runningTree.begin();
|
||||||
try {
|
try {
|
||||||
|
|
@ -638,4 +638,3 @@ function select(entity, selection) {
|
||||||
(0, assert_1.assert)(false);
|
(0, assert_1.assert)(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.select = select;
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
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';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.createComponent = void 0;
|
exports.createComponent = createComponent;
|
||||||
/// <reference path="../node_modules/@types/wechat-miniprogram/index.d.ts" />
|
/// <reference path="../node_modules/@types/wechat-miniprogram/index.d.ts" />
|
||||||
const assert_1 = require("oak-domain/lib/utils/assert");
|
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||||
const types_1 = require("oak-domain/lib/types");
|
const types_1 = require("oak-domain/lib/types");
|
||||||
|
|
@ -879,4 +879,3 @@ function createComponent(option, features) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.createComponent = createComponent;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.createComponent = void 0;
|
exports.createComponent = createComponent;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const react_native_1 = require("react-native");
|
const react_native_1 = require("react-native");
|
||||||
const page_react_1 = require("./page.react");
|
const page_react_1 = require("./page.react");
|
||||||
|
|
@ -41,4 +41,3 @@ function createComponent(option, features) {
|
||||||
}
|
}
|
||||||
return (0, withRouter_1.default)(Component, option);
|
return (0, withRouter_1.default)(Component, option);
|
||||||
}
|
}
|
||||||
exports.createComponent = createComponent;
|
|
||||||
|
|
|
||||||
|
|
@ -25,84 +25,84 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
||||||
componentDidUpdate(prevProps: Record<string, any>, prevState: Record<string, any>): Promise<void>;
|
componentDidUpdate(prevProps: Record<string, any>, prevState: Record<string, any>): Promise<void>;
|
||||||
render(): React.ReactNode;
|
render(): React.ReactNode;
|
||||||
oakFullpath: string;
|
oakFullpath: string;
|
||||||
featuresSubscribed: {
|
featuresSubscribed: Array<{
|
||||||
name: string;
|
name: string;
|
||||||
callback: (args?: any) => void;
|
callback: (args?: any) => void;
|
||||||
unsubHandler?: (() => void) | undefined;
|
unsubHandler?: () => void;
|
||||||
}[];
|
}>;
|
||||||
addFeatureSub(name: string, callback: (args?: any) => void): void;
|
addFeatureSub(name: string, callback: (args?: any) => void): void;
|
||||||
removeFeatureSub(name: string, callback: (args?: any) => void): void;
|
removeFeatureSub(name: string, callback: (args?: any) => void): void;
|
||||||
unsubscribeAll(): void;
|
unsubscribeAll(): void;
|
||||||
subscribeAll(): void;
|
subscribeAll(): void;
|
||||||
save(key: string, item: any): Promise<void>;
|
save(key: string, item: any): Promise<void>;
|
||||||
load(key: string): Promise<any>;
|
load(key: string): Promise<any>;
|
||||||
clear(key?: string | undefined): Promise<void>;
|
clear(key?: string): Promise<void>;
|
||||||
setNotification(data: NotificationProps): void;
|
setNotification(data: NotificationProps): void;
|
||||||
consumeNotification(): NotificationProps | undefined;
|
consumeNotification(): NotificationProps | undefined;
|
||||||
setMessage(data: MessageProps): Promise<void>;
|
setMessage(data: MessageProps): Promise<void>;
|
||||||
consumeMessage(): MessageProps | undefined;
|
consumeMessage(): MessageProps | undefined;
|
||||||
reRender(extra?: Record<string, any> | undefined): void;
|
reRender(extra?: Record<string, any>): void;
|
||||||
navigateTo<T2 extends keyof ED>(options: {
|
navigateTo<T2 extends keyof ED>(options: {
|
||||||
url: string;
|
url: string;
|
||||||
} & OakNavigateToParameters<ED, T2>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
} & OakNavigateToParameters<ED, T2>, state?: Record<string, any>, disableNamespace?: boolean): Promise<void>;
|
||||||
navigateBack(delta?: number | undefined): Promise<void>;
|
navigateBack(delta?: number): Promise<void>;
|
||||||
redirectTo<T2_1 extends keyof ED>(options: {
|
redirectTo<T2 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>, state?: Record<string, any>, disableNamespace?: boolean): Promise<void>;
|
||||||
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string;
|
||||||
}, path?: string | undefined): string;
|
}, path?: string): string;
|
||||||
addItems<T_2 extends keyof ED>(data: (Omit<ED[T_2]["CreateSingle"]["data"], "id"> & {
|
addItems<T_1 extends keyof ED>(data: (Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||||
id?: string | undefined;
|
id?: string;
|
||||||
})[], path?: string | undefined): string[];
|
})[], path?: string): string[];
|
||||||
removeItem(id: string, path?: string | undefined): void;
|
removeItem(id: string, path?: string): void;
|
||||||
removeItems(ids: string[], path?: string | undefined): void;
|
removeItems(ids: string[], path?: string): 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;
|
updateItem<T_1 extends keyof ED>(data: ED[T_1]["Update"]["data"], id: string, action?: ED[T_1]["Action"] | undefined, path?: string): 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;
|
updateItems<T_1 extends keyof ED>(data: ED[T_1]["Update"]["data"], ids: string[], action?: ED[T_1]["Action"] | undefined, path?: string): void;
|
||||||
recoverItem(id: string, path?: string | undefined): void;
|
recoverItem(id: string, path?: string): void;
|
||||||
recoverItems(ids: string[], path?: string | undefined): void;
|
recoverItems(ids: string[], path?: string): void;
|
||||||
resetItem(id: string, path?: string | undefined): void;
|
resetItem(id: string, path?: string): void;
|
||||||
update<T_5 extends keyof ED>(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void;
|
update<T_1 extends keyof ED>(data: ED[T_1]["Update"]["data"], action?: ED[T_1]["Action"] | undefined, path?: string): void;
|
||||||
create<T_6 extends keyof ED>(data: Omit<ED[T_6]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
create<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id">, path?: string): void;
|
||||||
remove(path?: string | undefined): void;
|
remove(path?: string): void;
|
||||||
isCreation(path?: string | undefined): boolean;
|
isCreation(path?: string): boolean;
|
||||||
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
clean(lsn?: number, dontPublish?: true, path?: string): void;
|
||||||
savePoint(): number;
|
savePoint(): number;
|
||||||
t(key: string, params?: object | undefined): string;
|
t(key: string, params?: object): string;
|
||||||
execute(action?: ED[T]["Action"] | undefined, messageProps?: boolean | MessageProps | undefined, path?: string | undefined, opers?: {
|
execute(action?: ED[T]["Action"] | undefined, messageProps?: boolean | MessageProps, path?: string, opers?: {
|
||||||
entity: T;
|
entity: T;
|
||||||
operation: ED[T]["Operation"];
|
operation: ED[T]["Operation"];
|
||||||
}[] | undefined): Promise<void>;
|
}[] | undefined): Promise<void>;
|
||||||
isDirty(path?: string | undefined): boolean;
|
isDirty(path?: string): boolean;
|
||||||
getFreshValue(path?: string | undefined): Partial<import("oak-domain/lib/types").GeneralEntityShape> | Partial<import("oak-domain/lib/types").GeneralEntityShape>[] | undefined;
|
getFreshValue(path?: string): Partial<import("oak-domain/lib/types").GeneralEntityShape> | Partial<import("oak-domain/lib/types").GeneralEntityShape>[] | undefined;
|
||||||
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
select<T2 extends keyof ED>(entity: T2, selection: ED[T2]["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, cacheInsensative?: true | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
checkOperation<T2 extends keyof ED>(entity: T2, operation: Omit<ED[T2]["Operation"], "id">, checkerTypes?: CheckerType[], cacheInsensative?: true): boolean | { [A in ED[T2]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2]["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, action?: string): boolean | { [A in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
||||||
getOperations<T_7 extends keyof ED>(path?: string | undefined): {
|
getOperations<T_1 extends keyof ED>(path?: string): {
|
||||||
entity: keyof ED;
|
entity: keyof ED;
|
||||||
operation: ED[keyof ED]["Operation"];
|
operation: ED[keyof ED]["Operation"];
|
||||||
}[] | undefined;
|
}[] | undefined;
|
||||||
refresh(pageNumber?: number | undefined, resetTotal?: boolean | undefined): Promise<void>;
|
refresh(pageNumber?: number, resetTotal?: boolean): Promise<void>;
|
||||||
loadMore(): Promise<void>;
|
loadMore(): Promise<void>;
|
||||||
setId(id: string, path?: string | undefined): void;
|
setId(id: string, path?: string): void;
|
||||||
unsetId(): void;
|
unsetId(): void;
|
||||||
getId(path?: string | undefined): string | undefined;
|
getId(path?: string): string | undefined;
|
||||||
setFilters(filters: NamedFilterItem<ED, T>[], path?: string | undefined): void;
|
setFilters(filters: NamedFilterItem<ED, T>[], path?: string): void;
|
||||||
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean | undefined, path?: string | undefined): void;
|
setNamedFilters(filters: NamedFilterItem<ED, T>[], refresh?: boolean, path?: string): void;
|
||||||
getFilters(path?: string | undefined): any[] | undefined;
|
getFilters(path?: string): any[] | undefined;
|
||||||
getFilterByName(name: string, path?: string | undefined): any;
|
getFilterByName(name: string, path?: string): any;
|
||||||
addNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
addNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedFilter(namedFilter: NamedFilterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedFilterByName(name: string, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedFilterByName(name: string, refresh?: boolean, path?: string): void;
|
||||||
setNamedSorters(namedSorters: NamedSorterItem<ED, T>[], refresh?: boolean | undefined, path?: string | undefined): void;
|
setNamedSorters(namedSorters: NamedSorterItem<ED, T>[], refresh?: boolean, path?: string): void;
|
||||||
getSorters(path?: string | undefined): ED[T]["Sorter"][] | undefined;
|
getSorters(path?: string): ED[T]["Sorter"][] | undefined;
|
||||||
getSorterByName(name: string, path?: string | undefined): any;
|
getSorterByName(name: string, path?: string): any;
|
||||||
addNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
addNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedSorter(namedSorter: NamedSorterItem<ED, T>, refresh?: boolean, path?: string): void;
|
||||||
removeNamedSorterByName(name: string, refresh?: boolean | undefined, path?: string | undefined): void;
|
removeNamedSorterByName(name: string, refresh?: boolean, path?: string): void;
|
||||||
getPagination(path?: string | undefined): import(".").Pagination | undefined;
|
getPagination(path?: string): import(".").Pagination | undefined;
|
||||||
setPageSize(pageSize: number, path?: string | undefined): void;
|
setPageSize(pageSize: number, path?: string): void;
|
||||||
setCurrentPage(currentPage: number, path?: string | undefined): void;
|
setCurrentPage(currentPage: number, path?: string): 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;
|
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;
|
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;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.createComponent = void 0;
|
exports.createComponent = createComponent;
|
||||||
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 assert_1 = require("oak-domain/lib/utils/assert");
|
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||||
|
|
@ -744,4 +744,3 @@ function createComponent(option, features) {
|
||||||
;
|
;
|
||||||
return OakComponentWrapper;
|
return OakComponentWrapper;
|
||||||
}
|
}
|
||||||
exports.createComponent = createComponent;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.createComponent = void 0;
|
exports.createComponent = createComponent;
|
||||||
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 withRouter_1 = tslib_1.__importDefault(require("./platforms/web/router/withRouter"));
|
const withRouter_1 = tslib_1.__importDefault(require("./platforms/web/router/withRouter"));
|
||||||
|
|
@ -105,4 +105,3 @@ function createComponent(option, features) {
|
||||||
}
|
}
|
||||||
return (0, withRouter_1.default)(Component, option);
|
return (0, withRouter_1.default)(Component, option);
|
||||||
}
|
}
|
||||||
exports.createComponent = createComponent;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.default = initialize;
|
||||||
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 client_1 = tslib_1.__importDefault(require("react-dom/client"));
|
const client_1 = tslib_1.__importDefault(require("react-dom/client"));
|
||||||
|
|
@ -39,4 +40,3 @@ function initialize(features, appName, routers, locales, error, format) {
|
||||||
root.render(Main);
|
root.render(Main);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.default = initialize;
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { Breakpoints } from './context';
|
import { Breakpoints } from './context';
|
||||||
export interface ResponsiveProviderProps {
|
export interface ResponsiveProviderProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
breakpoints?: Breakpoints;
|
breakpoints?: Breakpoints;
|
||||||
}
|
}
|
||||||
export declare function ResponsiveProvider(props: ResponsiveProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<{
|
export declare function ResponsiveProvider(props: ResponsiveProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<{
|
||||||
breakpoints?: Breakpoints | undefined;
|
breakpoints?: Breakpoints;
|
||||||
}>>;
|
}>>;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.ResponsiveProvider = void 0;
|
exports.ResponsiveProvider = ResponsiveProvider;
|
||||||
const react_1 = require("react");
|
const react_1 = require("react");
|
||||||
const context_1 = require("./context");
|
const context_1 = require("./context");
|
||||||
function ResponsiveProvider(props) {
|
function ResponsiveProvider(props) {
|
||||||
|
|
@ -12,4 +12,3 @@ function ResponsiveProvider(props) {
|
||||||
value,
|
value,
|
||||||
}, children);
|
}, children);
|
||||||
}
|
}
|
||||||
exports.ResponsiveProvider = ResponsiveProvider;
|
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,5 @@ 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: React.Context<{
|
export declare const ResponsiveContext: React.Context<{
|
||||||
breakpoints?: Breakpoints | undefined;
|
breakpoints?: Breakpoints;
|
||||||
}>;
|
}>;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.useWidth = void 0;
|
exports.useWidth = useWidth;
|
||||||
const react_1 = require("react");
|
const react_1 = require("react");
|
||||||
const react_responsive_1 = require("react-responsive");
|
const react_responsive_1 = require("react-responsive");
|
||||||
const context_1 = require("./context");
|
const context_1 = require("./context");
|
||||||
|
|
@ -46,4 +46,3 @@ function useWidth(props) {
|
||||||
}
|
}
|
||||||
return 'xs';
|
return 'xs';
|
||||||
}
|
}
|
||||||
exports.useWidth = useWidth;
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { BrowserRouterProps } from 'react-router-dom';
|
import { BrowserRouterProps } from 'react-router-dom';
|
||||||
export interface IBrowserRouterProps extends BrowserRouterProps {
|
export interface IBrowserRouterProps extends BrowserRouterProps {
|
||||||
namespace: string;
|
namespace: string;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getBrowserWidth = void 0;
|
exports.getBrowserWidth = getBrowserWidth;
|
||||||
const context_1 = require("../responsive/context");
|
const context_1 = require("../responsive/context");
|
||||||
// const canUseDocument = !!(
|
// const canUseDocument = !!(
|
||||||
// typeof window !== 'undefined' &&
|
// typeof window !== 'undefined' &&
|
||||||
|
|
@ -40,4 +40,3 @@ function getBrowserWidth() {
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
exports.getBrowserWidth = getBrowserWidth;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.lookUpAST = void 0;
|
exports.lookUpAST = lookUpAST;
|
||||||
/**
|
/**
|
||||||
* Common runtime logic between js and wxs
|
* Common runtime logic between js and wxs
|
||||||
*/
|
*/
|
||||||
|
|
@ -54,4 +54,3 @@ function lookUpAST(key, translations, locale, fallbackLocale) {
|
||||||
}
|
}
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
exports.lookUpAST = lookUpAST;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.parseTranslations = void 0;
|
exports.parseTranslations = parseTranslations;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const format_message_parse_1 = tslib_1.__importDefault(require("format-message-parse"));
|
const format_message_parse_1 = tslib_1.__importDefault(require("format-message-parse"));
|
||||||
function parseTranslations(object) {
|
function parseTranslations(object) {
|
||||||
|
|
@ -16,4 +16,3 @@ function parseTranslations(object) {
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
exports.parseTranslations = parseTranslations;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getI18next = exports.CURRENT_LOCALE_DATA = exports.LOCALE_CHANGE_HANDLER_NAME = exports.CURRENT_LOCALE_KEY = exports.getI18nInstanceWechatMp = exports.initI18nWechatMp = exports.I18nWechatMpRuntimeBase = void 0;
|
exports.CURRENT_LOCALE_DATA = exports.LOCALE_CHANGE_HANDLER_NAME = exports.CURRENT_LOCALE_KEY = exports.I18nWechatMpRuntimeBase = void 0;
|
||||||
|
exports.initI18nWechatMp = initI18nWechatMp;
|
||||||
|
exports.getI18nInstanceWechatMp = getI18nInstanceWechatMp;
|
||||||
|
exports.getI18next = getI18next;
|
||||||
const interpreter_1 = require("./interpreter");
|
const interpreter_1 = require("./interpreter");
|
||||||
const common_1 = require("./common");
|
const common_1 = require("./common");
|
||||||
const translation_parser_1 = require("./compile/translation-parser");
|
const translation_parser_1 = require("./compile/translation-parser");
|
||||||
|
|
@ -83,11 +86,9 @@ function initI18nWechatMp(options) {
|
||||||
});
|
});
|
||||||
return i18nInstance;
|
return i18nInstance;
|
||||||
}
|
}
|
||||||
exports.initI18nWechatMp = initI18nWechatMp;
|
|
||||||
function getI18nInstanceWechatMp() {
|
function getI18nInstanceWechatMp() {
|
||||||
return OakI18n?.i18nInstance;
|
return OakI18n?.i18nInstance;
|
||||||
}
|
}
|
||||||
exports.getI18nInstanceWechatMp = getI18nInstanceWechatMp;
|
|
||||||
exports.CURRENT_LOCALE_KEY = '$_locale';
|
exports.CURRENT_LOCALE_KEY = '$_locale';
|
||||||
exports.LOCALE_CHANGE_HANDLER_NAME = '$_localeChange';
|
exports.LOCALE_CHANGE_HANDLER_NAME = '$_localeChange';
|
||||||
exports.CURRENT_LOCALE_DATA = '$_translations';
|
exports.CURRENT_LOCALE_DATA = '$_translations';
|
||||||
|
|
@ -102,7 +103,6 @@ function getI18next(options) {
|
||||||
});
|
});
|
||||||
return i18n;
|
return i18n;
|
||||||
}
|
}
|
||||||
exports.getI18next = getI18next;
|
|
||||||
// type Func = (...args: any[]) => any;
|
// type Func = (...args: any[]) => any;
|
||||||
// export const I18nWechatMp = Behavior(
|
// export const I18nWechatMp = Behavior(
|
||||||
// (() => {
|
// (() => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.interpret = void 0;
|
exports.interpret = interpret;
|
||||||
const EMPTY = '';
|
const EMPTY = '';
|
||||||
function interpret(message, params) {
|
function interpret(message, params) {
|
||||||
if (!message)
|
if (!message)
|
||||||
|
|
@ -13,7 +13,6 @@ function interpret(message, params) {
|
||||||
}, [])
|
}, [])
|
||||||
.join('');
|
.join('');
|
||||||
}
|
}
|
||||||
exports.interpret = interpret;
|
|
||||||
function _eval(element, params) {
|
function _eval(element, params) {
|
||||||
params = params || {};
|
params = params || {};
|
||||||
if (typeof element === 'string') {
|
if (typeof element === 'string') {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.t = void 0;
|
exports.t = t;
|
||||||
/**
|
/**
|
||||||
* 在wxs环境下实现部分i18n-js内的逻辑
|
* 在wxs环境下实现部分i18n-js内的逻辑
|
||||||
* 参见i18n-js/src/i18n.ts中的translate逻辑
|
* 参见i18n-js/src/i18n.ts中的translate逻辑
|
||||||
|
|
@ -132,7 +132,6 @@ function t(key, p1, p2, p3, p4, p5, p6) {
|
||||||
}
|
}
|
||||||
return fullKey.split('.').pop();
|
return fullKey.split('.').pop();
|
||||||
}
|
}
|
||||||
exports.t = t;
|
|
||||||
function propObserver(locales, oldValue, instance) {
|
function propObserver(locales, oldValue, instance) {
|
||||||
Instance = instance;
|
Instance = instance;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getMessageInterpreter = void 0;
|
exports.getMessageInterpreter = getMessageInterpreter;
|
||||||
const interpreter_1 = require("../interpreter");
|
const interpreter_1 = require("../interpreter");
|
||||||
const common_1 = require("../common");
|
const common_1 = require("../common");
|
||||||
function getMessageInterpreter() {
|
function getMessageInterpreter() {
|
||||||
|
|
@ -25,4 +25,3 @@ function getMessageInterpreter() {
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.getMessageInterpreter = getMessageInterpreter;
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { EntityDict } from 'oak-domain/lib/types/Entity';
|
import { EntityDict } from 'oak-domain/lib/types/Entity';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { DataType, DataTypeParams } from 'oak-domain/lib/types/schema/DataTypes';
|
import { DataType, DataTypeParams } from 'oak-domain/lib/types/schema/DataTypes';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
import { Dayjs } from 'dayjs';
|
import { Dayjs } from 'dayjs';
|
||||||
import { OakAbsRefAttrPickerDef, ColSpanType, ED } from './AbstractComponent';
|
import { OakAbsRefAttrPickerDef, ColSpanType, ED } from './AbstractComponent';
|
||||||
export type ViewType = 'Input' | 'Select' | 'DatePicker' | 'DatePicker.RangePicker' | 'RefAttr';
|
export type ViewType = 'Input' | 'Select' | 'DatePicker' | 'DatePicker.RangePicker' | 'RefAttr';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="react" />
|
|
||||||
export type MapComponent = (props: {
|
export type MapComponent = (props: {
|
||||||
id?: string;
|
id?: string;
|
||||||
center?: [number, number];
|
center?: [number, number];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
import { Aspect, EntityDict, CheckerType, AggregationResult, OpRecord, OakUserException } from "oak-domain/lib/types";
|
import { Aspect, EntityDict, CheckerType, AggregationResult, OpRecord, OakUserException } 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 { Feature } from './Feature';
|
import { Feature } from './Feature';
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
export type PromisifyOption<T extends Record<string, any>> = Omit<T, 'success' | 'fail' | 'complete'>;
|
export type PromisifyOption<T extends Record<string, any>> = Omit<T, 'success' | 'fail' | 'complete'>;
|
||||||
export type PromisifyResult<T extends WechatMiniprogram.AsyncMethodOptionLike> = Promise<Parameters<Exclude<T['success'], undefined>>[0]>;
|
export type PromisifyResult<T extends WechatMiniprogram.AsyncMethodOptionLike> = Promise<Parameters<Exclude<T['success'], undefined>>[0]>;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="wechat-miniprogram" />
|
|
||||||
import { PromisifyOption } from '../../types/Wx';
|
import { PromisifyOption } from '../../types/Wx';
|
||||||
export declare class Bluetooth {
|
export declare class Bluetooth {
|
||||||
private serverDict;
|
private serverDict;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getEnv = void 0;
|
exports.getEnv = getEnv;
|
||||||
async function getEnv() {
|
async function getEnv() {
|
||||||
const env = await wx.getSystemInfo();
|
const env = await wx.getSystemInfo();
|
||||||
const fullEnv = Object.assign(env, {
|
const fullEnv = Object.assign(env, {
|
||||||
|
|
@ -19,4 +19,3 @@ async function getEnv() {
|
||||||
briefEnv,
|
briefEnv,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.getEnv = getEnv;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getEnv = void 0;
|
exports.getEnv = getEnv;
|
||||||
const react_native_1 = require("react-native");
|
const react_native_1 = require("react-native");
|
||||||
const react_native_localize_1 = require("react-native-localize");
|
const react_native_localize_1 = require("react-native-localize");
|
||||||
const react_native_device_info_1 = require("react-native-device-info");
|
const react_native_device_info_1 = require("react-native-device-info");
|
||||||
|
|
@ -31,4 +31,3 @@ async function getEnv() {
|
||||||
briefEnv,
|
briefEnv,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.getEnv = getEnv;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getEnv = void 0;
|
exports.getEnv = getEnv;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const fingerprintjs_1 = tslib_1.__importDefault(require("@fingerprintjs/fingerprintjs"));
|
const fingerprintjs_1 = tslib_1.__importDefault(require("@fingerprintjs/fingerprintjs"));
|
||||||
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
||||||
|
|
@ -33,4 +33,3 @@ async function getEnv() {
|
||||||
briefEnv,
|
briefEnv,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.getEnv = getEnv;
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.t = exports.registerMissCallback = void 0;
|
exports.registerMissCallback = registerMissCallback;
|
||||||
|
exports.t = t;
|
||||||
let MissCallback = () => undefined;
|
let MissCallback = () => undefined;
|
||||||
function registerMissCallback(callback) {
|
function registerMissCallback(callback) {
|
||||||
MissCallback = callback;
|
MissCallback = callback;
|
||||||
}
|
}
|
||||||
exports.registerMissCallback = registerMissCallback;
|
|
||||||
function get(object, path) {
|
function get(object, path) {
|
||||||
// 沿着路径寻找到对应的值,未找到则返回默认值 defaultValue
|
// 沿着路径寻找到对应的值,未找到则返回默认值 defaultValue
|
||||||
return (_basePath(path).reduce((o, k) => {
|
return (_basePath(path).reduce((o, k) => {
|
||||||
|
|
@ -25,4 +25,3 @@ function t(key, locales, lng, fallbackLng, params) {
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
exports.t = t;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.locate = void 0;
|
exports.locate = locate;
|
||||||
const utils_1 = require("./utils");
|
const utils_1 = require("./utils");
|
||||||
async function locateWechat() {
|
async function locateWechat() {
|
||||||
return wx.getLocation({});
|
return wx.getLocation({});
|
||||||
|
|
@ -38,4 +38,3 @@ async function locate() {
|
||||||
return result2;
|
return result2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.locate = locate;
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.isMockId = exports.generateMockId = void 0;
|
exports.generateMockId = generateMockId;
|
||||||
|
exports.isMockId = isMockId;
|
||||||
function generateMockId() {
|
function generateMockId() {
|
||||||
return `__mock-${Math.ceil(Math.random() * 100000000000)}`;
|
return `__mock-${Math.ceil(Math.random() * 100000000000)}`;
|
||||||
}
|
}
|
||||||
exports.generateMockId = generateMockId;
|
|
||||||
function isMockId(id) {
|
function isMockId(id) {
|
||||||
return id.startsWith('__mock-');
|
return id.startsWith('__mock-');
|
||||||
}
|
}
|
||||||
exports.isMockId = isMockId;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.promisify = void 0;
|
exports.promisify = promisify;
|
||||||
/**
|
/**
|
||||||
* 将小程序的API封装成支持Promise的API, 小程序部分api不支持promise
|
* 将小程序的API封装成支持Promise的API, 小程序部分api不支持promise
|
||||||
* @params fn {Function} 小程序原始API,如wx.login
|
* @params fn {Function} 小程序原始API,如wx.login
|
||||||
|
|
@ -22,4 +22,3 @@ function promisify(fn) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.promisify = promisify;
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export declare class Upload {
|
export declare class Upload {
|
||||||
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function): Promise<any>;
|
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, method?: "POST" | "PUT" | "PATCH"): Promise<any>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,36 +2,14 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.Upload = void 0;
|
exports.Upload = void 0;
|
||||||
class Upload {
|
class Upload {
|
||||||
// async uploadFile(
|
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, method = "POST") {
|
||||||
// file: File | string,
|
const isPut = method === "PUT";
|
||||||
// name: string,
|
// 进度监听模式
|
||||||
// uploadUrl: string,
|
|
||||||
// formData: Record<string, any>,
|
|
||||||
// autoInform?: boolean
|
|
||||||
// ): Promise<any> {
|
|
||||||
// const formData2 = new FormData();
|
|
||||||
// for (const key of Object.keys(formData)) {
|
|
||||||
// formData2.append(key, formData[key]);
|
|
||||||
// }
|
|
||||||
// formData2.append(name || 'file', file as File);
|
|
||||||
// const options = {
|
|
||||||
// body: formData2,
|
|
||||||
// method: 'POST',
|
|
||||||
// };
|
|
||||||
// const result = await fetch(uploadUrl, options);
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent) {
|
|
||||||
if (getPercent) {
|
if (getPercent) {
|
||||||
const formData2 = new FormData();
|
|
||||||
Object.entries(formData).forEach(([key, value]) => {
|
|
||||||
formData2.append(key, value);
|
|
||||||
});
|
|
||||||
formData2.append(name || 'file', file);
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
let percent = 0;
|
let percent = 0;
|
||||||
xhr.upload.addEventListener('progress', (event) => {
|
xhr.upload.addEventListener("progress", (event) => {
|
||||||
if (event.lengthComputable) {
|
if (event.lengthComputable) {
|
||||||
percent = Math.round((event.loaded / event.total) * 100);
|
percent = Math.round((event.loaded / event.total) * 100);
|
||||||
getPercent(percent);
|
getPercent(percent);
|
||||||
|
|
@ -40,14 +18,14 @@ class Upload {
|
||||||
xhr.onload = () => {
|
xhr.onload = () => {
|
||||||
if (xhr.status >= 200 && xhr.status < 300) {
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
if (xhr.status === 204) {
|
if (xhr.status === 204) {
|
||||||
resolve({ status: 204 }); // 正确返回状态码
|
resolve({ status: 204 });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(xhr.responseText);
|
const data = JSON.parse(xhr.responseText);
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch {
|
||||||
resolve({ status: xhr.status, raw: xhr.responseText });
|
resolve({ status: xhr.status, raw: xhr.responseText });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -56,22 +34,51 @@ class Upload {
|
||||||
reject(new Error(`HTTP Error: ${xhr.status}`));
|
reject(new Error(`HTTP Error: ${xhr.status}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.onerror = () => reject(new Error('Network Error'));
|
xhr.onerror = () => reject(new Error("Network Error"));
|
||||||
xhr.open('POST', uploadUrl);
|
xhr.open(method, uploadUrl);
|
||||||
xhr.send(formData2);
|
if (isPut) {
|
||||||
|
// PUT 模式:直接上传文件
|
||||||
|
if (file instanceof File) {
|
||||||
|
xhr.setRequestHeader("Content-Type", file.type || "application/octet-stream");
|
||||||
|
}
|
||||||
|
xhr.send(file);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// POST / PATCH 模式:构建表单
|
||||||
|
const formData2 = new FormData();
|
||||||
|
Object.entries(formData).forEach(([key, value]) => {
|
||||||
|
formData2.append(key, value);
|
||||||
|
});
|
||||||
|
formData2.append(name || "file", file);
|
||||||
|
xhr.send(formData2);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 无进度监听模式(直接 fetch)
|
||||||
|
if (isPut) {
|
||||||
|
// S3 预签名上传
|
||||||
|
const headers = {};
|
||||||
|
if (file instanceof File) {
|
||||||
|
headers["Content-Type"] = file.type || "application/octet-stream";
|
||||||
|
}
|
||||||
|
const result = await fetch(uploadUrl, {
|
||||||
|
method: "PUT",
|
||||||
|
headers,
|
||||||
|
body: file,
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
// 表单上传
|
||||||
const formData2 = new FormData();
|
const formData2 = new FormData();
|
||||||
for (const key of Object.keys(formData)) {
|
for (const key of Object.keys(formData)) {
|
||||||
formData2.append(key, formData[key]);
|
formData2.append(key, formData[key]);
|
||||||
}
|
}
|
||||||
formData2.append(name || 'file', file);
|
formData2.append(name || "file", file);
|
||||||
const options = {
|
const result = await fetch(uploadUrl, {
|
||||||
|
method,
|
||||||
body: formData2,
|
body: formData2,
|
||||||
method: 'POST',
|
});
|
||||||
};
|
|
||||||
const result = await fetch(uploadUrl, options);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,20 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.analyzeAttrMobileForCard = exports.translateAttributes = exports.analyzeDataUpsertTransformer = exports.makeDataTransformer = exports.getType = exports.getFixed = exports.getAlign = exports.getValue = exports.getWidth = exports.getLabel = exports.getPath = exports.getLinkUrl = exports.isAttributeType = exports.resolvePath = exports.getAttributes = void 0;
|
exports.getAttributes = getAttributes;
|
||||||
|
exports.resolvePath = resolvePath;
|
||||||
|
exports.isAttributeType = isAttributeType;
|
||||||
|
exports.getLinkUrl = getLinkUrl;
|
||||||
|
exports.getPath = getPath;
|
||||||
|
exports.getLabel = getLabel;
|
||||||
|
exports.getWidth = getWidth;
|
||||||
|
exports.getValue = getValue;
|
||||||
|
exports.getAlign = getAlign;
|
||||||
|
exports.getFixed = getFixed;
|
||||||
|
exports.getType = getType;
|
||||||
|
exports.makeDataTransformer = makeDataTransformer;
|
||||||
|
exports.analyzeDataUpsertTransformer = analyzeDataUpsertTransformer;
|
||||||
|
exports.translateAttributes = translateAttributes;
|
||||||
|
exports.analyzeAttrMobileForCard = analyzeAttrMobileForCard;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const assert_1 = require("oak-domain/lib/utils/assert");
|
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||||
const relation_1 = require("oak-domain/lib/store/relation");
|
const relation_1 = require("oak-domain/lib/store/relation");
|
||||||
|
|
@ -35,7 +49,6 @@ function getAttributes(attributes) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.getAttributes = getAttributes;
|
|
||||||
function resolvePath(dataSchema, entity, path) {
|
function resolvePath(dataSchema, entity, path) {
|
||||||
(0, assert_1.assert)(!path.includes('['), '数组索引不需要携带[],请使用arr.0.value');
|
(0, assert_1.assert)(!path.includes('['), '数组索引不需要携带[],请使用arr.0.value');
|
||||||
const attrs = path.split('.');
|
const attrs = path.split('.');
|
||||||
|
|
@ -86,12 +99,10 @@ function resolvePath(dataSchema, entity, path) {
|
||||||
attribute,
|
attribute,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.resolvePath = resolvePath;
|
|
||||||
// 强制类型
|
// 强制类型
|
||||||
function isAttributeType(attribute) {
|
function isAttributeType(attribute) {
|
||||||
return attribute;
|
return attribute;
|
||||||
}
|
}
|
||||||
exports.isAttributeType = isAttributeType;
|
|
||||||
function getLinkUrl(attribute, props) {
|
function getLinkUrl(attribute, props) {
|
||||||
if (typeof attribute === 'string') {
|
if (typeof attribute === 'string') {
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -107,7 +118,6 @@ function getLinkUrl(attribute, props) {
|
||||||
href += searchParams.join('&');
|
href += searchParams.join('&');
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
exports.getLinkUrl = getLinkUrl;
|
|
||||||
// 以下几个get方法只需要两个参数attribute和一个解析path对象,只是后者类型还没定义
|
// 以下几个get方法只需要两个参数attribute和一个解析path对象,只是后者类型还没定义
|
||||||
function getPath(attribute) {
|
function getPath(attribute) {
|
||||||
if (typeof attribute === 'string') {
|
if (typeof attribute === 'string') {
|
||||||
|
|
@ -115,7 +125,6 @@ function getPath(attribute) {
|
||||||
}
|
}
|
||||||
return attribute.path;
|
return attribute.path;
|
||||||
}
|
}
|
||||||
exports.getPath = getPath;
|
|
||||||
function getLabel(attribute, entity, attr, t) {
|
function getLabel(attribute, entity, attr, t) {
|
||||||
if (isAttributeType(attribute).label) {
|
if (isAttributeType(attribute).label) {
|
||||||
return isAttributeType(attribute).label;
|
return isAttributeType(attribute).label;
|
||||||
|
|
@ -133,7 +142,6 @@ function getLabel(attribute, entity, attr, t) {
|
||||||
}
|
}
|
||||||
return t(`${entity}:attr.${attr}`, {});
|
return t(`${entity}:attr.${attr}`, {});
|
||||||
}
|
}
|
||||||
exports.getLabel = getLabel;
|
|
||||||
// 目前width属性可以是undefined,只有特殊type或用户自定义才有值,这样其余attr属性可以自适应
|
// 目前width属性可以是undefined,只有特殊type或用户自定义才有值,这样其余attr属性可以自适应
|
||||||
function getWidth(attribute, attrType) {
|
function getWidth(attribute, attrType) {
|
||||||
let width;
|
let width;
|
||||||
|
|
@ -149,7 +157,6 @@ function getWidth(attribute, attrType) {
|
||||||
}
|
}
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
exports.getWidth = getWidth;
|
|
||||||
function getValue(data, path, entity, attr, attrType, t) {
|
function getValue(data, path, entity, attr, attrType, t) {
|
||||||
let value = (0, lodash_1.get)(data, path);
|
let value = (0, lodash_1.get)(data, path);
|
||||||
// 枚举类型还要通过i18转一下中文
|
// 枚举类型还要通过i18转一下中文
|
||||||
|
|
@ -173,15 +180,12 @@ function getValue(data, path, entity, attr, attrType, t) {
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
exports.getValue = getValue;
|
|
||||||
function getAlign(attribute) {
|
function getAlign(attribute) {
|
||||||
return isAttributeType(attribute).align || 'left';
|
return isAttributeType(attribute).align || 'left';
|
||||||
}
|
}
|
||||||
exports.getAlign = getAlign;
|
|
||||||
function getFixed(attribute) {
|
function getFixed(attribute) {
|
||||||
return isAttributeType(attribute).fixed;
|
return isAttributeType(attribute).fixed;
|
||||||
}
|
}
|
||||||
exports.getFixed = getFixed;
|
|
||||||
function getType(attribute, attrType) {
|
function getType(attribute, attrType) {
|
||||||
let type = attrType;
|
let type = attrType;
|
||||||
if (isAttributeType(attribute).type) {
|
if (isAttributeType(attribute).type) {
|
||||||
|
|
@ -189,7 +193,6 @@ function getType(attribute, attrType) {
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
exports.getType = getType;
|
|
||||||
function getLabelI18(dataSchema, entity, path, t) {
|
function getLabelI18(dataSchema, entity, path, t) {
|
||||||
const { attr, entity: entityI8n } = resolvePath(dataSchema, entity, path);
|
const { attr, entity: entityI8n } = resolvePath(dataSchema, entity, path);
|
||||||
return t(`${entityI8n}:attr.${attr}`, {});
|
return t(`${entityI8n}:attr.${attr}`, {});
|
||||||
|
|
@ -227,7 +230,6 @@ function makeDataTransformer(dataSchema, entity, attrDefs, t) {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.makeDataTransformer = makeDataTransformer;
|
|
||||||
function analyzeDataUpsertTransformer(dataSchema, entity, attrUpsertDefs) {
|
function analyzeDataUpsertTransformer(dataSchema, entity, attrUpsertDefs) {
|
||||||
let geoDef = undefined;
|
let geoDef = undefined;
|
||||||
const makeNativeFixedPart = (attr, def) => {
|
const makeNativeFixedPart = (attr, def) => {
|
||||||
|
|
@ -306,7 +308,6 @@ function analyzeDataUpsertTransformer(dataSchema, entity, attrUpsertDefs) {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.analyzeDataUpsertTransformer = analyzeDataUpsertTransformer;
|
|
||||||
function translateAttributes(dataSchema, entity, attributes) {
|
function translateAttributes(dataSchema, entity, attributes) {
|
||||||
const judgeAttributes = attributes.map((ele) => {
|
const judgeAttributes = attributes.map((ele) => {
|
||||||
const path = getPath(ele);
|
const path = getPath(ele);
|
||||||
|
|
@ -322,7 +323,6 @@ function translateAttributes(dataSchema, entity, attributes) {
|
||||||
});
|
});
|
||||||
return judgeAttributes;
|
return judgeAttributes;
|
||||||
}
|
}
|
||||||
exports.translateAttributes = translateAttributes;
|
|
||||||
function analyzeAttrMobileForCard(dataSchema, entity, t, attributes) {
|
function analyzeAttrMobileForCard(dataSchema, entity, t, attributes) {
|
||||||
return (data) => {
|
return (data) => {
|
||||||
// 遍历用户传入的数据源
|
// 遍历用户传入的数据源
|
||||||
|
|
@ -347,4 +347,3 @@ function analyzeAttrMobileForCard(dataSchema, entity, t, attributes) {
|
||||||
return coverData;
|
return coverData;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.analyzeAttrMobileForCard = analyzeAttrMobileForCard;
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue