ze-react-component-library
Version:
ZeroETP React Component Library
184 lines (183 loc) • 7.29 kB
TypeScript
import { FC, ReactNode } from "react";
import { PropertyType, SchemaType, LogicformAPIResultType, LogicformType } from "zeroetp-api-sdk";
import type { FallbackProps } from "react-error-boundary";
import type { CardProps } from "antd";
import "antd/lib/cascader/style/index";
/**
* 相比zeroetp-api-sdk里面的findPropByName,多了对.号的predChain的支持
* @param schema
* @param propName
* @returns
*/
export declare const findProperty: (schema: SchemaType, propName: string, splitter?: string) => PropertyType;
export declare const valueTypeMapping: (property: PropertyType) => string;
export declare const valueEnumMapping: (property: PropertyType) => any;
export declare const isSearchFilter: (property: PropertyType) => boolean;
export declare const getFormatter: (property: PropertyType) => any;
export declare const getFormatterString: (property: PropertyType) => any;
export declare const autoUnitForData: (resData: LogicformAPIResultType & Record<string, any>, t?: (s: string) => string) => void;
export declare const formatWithProperty: (property: PropertyType | undefined, value: any) => any;
export declare const customValueTypes: (schema: SchemaType, entityTooltipCardProps?: {
width?: number;
height?: number;
extra?: (entity: any, schema: SchemaType) => ReactNode;
customComponent?: (entity: any, schema: SchemaType) => ReactNode;
}) => {
percentage: {
render: (number: number, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
object: {
render: (entity: any, props: any, ...rest: any[]) => any;
renderFormItem: (_text: any, props: any, form: any) => any;
};
category: {
renderFormItem: (_text: any, props: any, form: any) => any;
render: (v: any) => any;
};
boolean: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
table: {
renderFormItem: (_text: any, props: any, form: any) => any;
};
number: {
render: (number: number, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
string: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
tag: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
checkboxGroup: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
image: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
file: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
url: {
render: (v: any, props: any, ...rest: any[]) => any;
renderFormItem: (text: any, props: any, form: any) => any;
};
json: {
render: (v: any) => any;
renderFormItem: (v: any, props: any, form: any) => JSX.Element;
};
rule: {
render: (v: any) => any;
renderFormItem: (v: any, props: any, form: any) => JSX.Element;
};
cron: {
render: (v: any) => any;
renderFormItem: (v: any, props: any, dom: any) => JSX.Element;
};
};
export declare const unnormalizeQuery: (query: any, withoutEntityQuery?: boolean) => {};
export declare const genYoyAndMomLogicform: (normedLF: LogicformType, op: "$yoy" | "$mom") => LogicformType;
export declare const ErrorFallBack: FC<FallbackProps & {
cardProps?: CardProps;
}>;
export declare const getColumnPublicProps: (p: any, col?: any, propertyConfig?: any) => {
valueType: any;
valueEnum: any;
fieldProps: any;
valueOptions: {
label: any;
value: string;
}[];
};
export declare const getExportFileName: (filename?: string, suffix?: string) => string;
/** antd表格导出excel */
export declare function exportTableToExcel(parentNode: HTMLDivElement, filename: string, XLSX?: any): import("antd/lib/message").MessageType;
export declare const typePropertyOfSchema: {
name: string;
type: string;
primal_type: string;
constraints: {
required: boolean;
enum: string[];
enumText: {
timestamp: string;
string: string;
name: string;
category: string;
object: string;
tag: string;
number: string;
int: string;
currency: string;
percentage: string;
duration: string;
order: string;
boolean: string;
date: string;
image: string;
file: string;
report: string;
};
};
};
export declare const getHierarchyDrillDownLevel: (_currentLevel: string, result: LogicformAPIResultType) => string;
export declare const getHierarchyListDrillDownLogicform: (logicform: LogicformType, result: LogicformAPIResultType, record: any) => {
query: {
[x: string]: {
$startsWith: any;
$level: string;
};
};
limit: number;
schema?: string;
schemaName?: string;
total?: number;
sort?: object;
limitBy?: number;
skip?: number;
preds?: import("zeroetp-api-sdk").PredItemType[];
field?: string;
name?: string;
operator?: string;
pred?: import("zeroetp-api-sdk").PredItemType;
groupby?: any;
entity?: any;
having?: object;
populate?: string[];
expands?: string[];
close_default_query?: boolean;
children?: LogicformType[];
_role?: string;
_authQueryKeys?: string[];
entity_id?: string;
_unknown?: string[];
_path?: any[];
_noRelationGroupby?: any[];
representation?: import("zeroetp-api-sdk").RepresentationType;
};
export declare const getPropertyQueryKey: (name: string, schema: SchemaType, withName?: boolean) => any;
export declare const filterValueOperators: string[];
export declare const operatorDisplay: (o: string) => "" | "等于" | "不等于" | "包含" | "大于" | "大于等于" | "小于" | "小于等于";
export declare const basicValueDisplay: (oldV: any, t?: (s: string) => string) => any;
export declare const isHttps: () => boolean;
export declare const logicformValueToColumnFilter: (oldV: any, prop: PropertyType, nameProp?: PropertyType) => any;
export declare const isNullQuery: (v: any) => boolean;
export declare const filterValueToLogicformQuery: ({ queryKey, v, newLF, property, }: {
queryKey: string;
v: any;
newLF: any;
property: PropertyType;
}) => void;
export declare const formatResultName: (data: LogicformAPIResultType, delimiter?: string, fields?: string[]) => any;
export declare function getDatasourceFromLogicform(logicform: LogicformType, allSchemas: Record<string, SchemaType>): SchemaType[];
export declare function getDatasourceFromRes(res: any): SchemaType[];
export declare function enableShowSubTotalsSetting(logicform: LogicformType): boolean;
export declare function formatDataResult(data: LogicformAPIResultType): any[];