@quickbi/bi-open 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +145 -0
- package/cjs/index.js +655 -0
- package/esm/index.d.ts +145 -0
- package/esm/index.mjs +623 -0
- package/package.json +40 -0
package/cjs/index.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../../../../../../../../../../@quickbi/bi-types
|
|
4
|
+
|
|
5
|
+
declare module '@quickbi/bi-open' {
|
|
6
|
+
export type * as Interfaces from '@quickbi/bi-open/interfaces';
|
|
7
|
+
export { formatNumberWithConfig, formatNumber } from '@quickbi/bi-open/utils/format';
|
|
8
|
+
export { I18n } from '@quickbi/bi-open/utils/i18n';
|
|
9
|
+
export { revisal, LATEST_VERSION, OLDEST_VERSION, getRevisalRange, isOldestVersion } from '@quickbi/bi-open/revisal';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module '@quickbi/bi-open/interfaces' {
|
|
13
|
+
export type { ComponentMeta, ComponentMetaPropsSchema } from '@quickbi/bi-types';
|
|
14
|
+
export type { Lifecycle, LifecycleProps, LifecycleBootstrap, LifecycleMount, LifecycleUpdate, LifecycleUnmount, } from '@quickbi/bi-types';
|
|
15
|
+
export type { ComponentProps } from '@quickbi/bi-types';
|
|
16
|
+
export type { DataSchema, DataSchemaArea, DataSchemaAreaRule, DataSchemaAreaId, } from '@quickbi/bi-types';
|
|
17
|
+
export type { StyleSchema, StyleSchemaBase, StyleSchemaArray, StyleSchemaObject, StyleSchemaDepend, StyleSchemaDependId, StyleSchemaProperties, StyleSchemaValidation, StyleSchemaValidationRule, StyleSchemaValidationResult, } from '@quickbi/bi-types';
|
|
18
|
+
/** 自定义菜单 */
|
|
19
|
+
export type { MenuSchema, MenuSchemaBase, MenuSchemaItem, MenuMeta, MenuPageConfig, MenuComponentProps, MenuComponentChartProps, MenuComponentExcelProps, MenuComponentDashboardProps, MenuChart, MenuSheet, } from '@quickbi/bi-types';
|
|
20
|
+
/** 自定义页面 */
|
|
21
|
+
export type { PageComponentProps } from '@quickbi/bi-types';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '@quickbi/bi-open/utils/format' {
|
|
25
|
+
/**
|
|
26
|
+
* 格式化数字
|
|
27
|
+
* formatNumber(1234, '#,##0')=1,234
|
|
28
|
+
* formatNumber(1.234, '0.##')=1.234
|
|
29
|
+
* formatNumber(12, '0.##')=12
|
|
30
|
+
* formatNumber(12.34, '0')=12
|
|
31
|
+
* formatNumber(12.34, '0.#')=12.3
|
|
32
|
+
* formatNumber(0.1, '%')=10%
|
|
33
|
+
* formatNumber(0.001, '0.#%')=0.1%
|
|
34
|
+
* formatNumber(0.01, '‰')=10‰
|
|
35
|
+
* @param num {Number|Object} 数字或null
|
|
36
|
+
* @param [partten] {String} 格式化样式,支持#0%‰,.不指定时返回原始值
|
|
37
|
+
* @param [invalidString] {String} 若是无效字符,返回是‘-’,还是N/A
|
|
38
|
+
* @returns {Number|Object} 处理后的
|
|
39
|
+
*/
|
|
40
|
+
export function formatNumber(num: number | string, partten: 'CN' | 'CNT' | 'CN2' | 'EN' | 'KMG' | string, invalidString?: string): string | number;
|
|
41
|
+
/**
|
|
42
|
+
* 根据配置, 格式化数字
|
|
43
|
+
* @param num
|
|
44
|
+
* @param config fieldSettingMap
|
|
45
|
+
*/
|
|
46
|
+
export function formatNumberWithConfig(num: number | string, config: any): any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare module '@quickbi/bi-open/utils/i18n' {
|
|
50
|
+
/**
|
|
51
|
+
* @author 海狸
|
|
52
|
+
* @description 开放组件国际化
|
|
53
|
+
*/
|
|
54
|
+
type ILng = 'zh-CN' | 'en-US';
|
|
55
|
+
interface IResource {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
}
|
|
58
|
+
type IResources = Partial<{
|
|
59
|
+
[key in ILng]: IResource;
|
|
60
|
+
}>;
|
|
61
|
+
type IOption = {
|
|
62
|
+
/**
|
|
63
|
+
* 当前语言
|
|
64
|
+
*/
|
|
65
|
+
lng?: ILng;
|
|
66
|
+
/**
|
|
67
|
+
* 语言包
|
|
68
|
+
*/
|
|
69
|
+
resources: IResources;
|
|
70
|
+
};
|
|
71
|
+
type IParam = {
|
|
72
|
+
[key: string]: string | number | boolean;
|
|
73
|
+
};
|
|
74
|
+
export class I18n {
|
|
75
|
+
lng: ILng;
|
|
76
|
+
resources: IResources;
|
|
77
|
+
constructor(options: IOption);
|
|
78
|
+
/**
|
|
79
|
+
* 初始化
|
|
80
|
+
* 国际化词条绑定在全局对象上, meta 和 component 就可以复用
|
|
81
|
+
* 从而减少打包体积
|
|
82
|
+
*/
|
|
83
|
+
static init(options: IOption): I18n;
|
|
84
|
+
/**
|
|
85
|
+
* 翻译函数
|
|
86
|
+
* 例如: t("{{who}}吃{{count}}个苹果", { who: t("我们"), count: 2 })
|
|
87
|
+
* @param key
|
|
88
|
+
* @param param
|
|
89
|
+
*/
|
|
90
|
+
t(key: string, param?: IParam): string;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare module '@quickbi/bi-open/revisal' {
|
|
96
|
+
import type { ComponentMeta } from '@quickbi/bi-types';
|
|
97
|
+
/**
|
|
98
|
+
* 获取订正范围
|
|
99
|
+
* @param version
|
|
100
|
+
* @param changeLog
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
export function getRevisalRange(version: string, changeLog?: import("./changelog").ChangeLog[]): import("./changelog").ChangeLog[];
|
|
104
|
+
/**
|
|
105
|
+
* 订正到当前最新版本
|
|
106
|
+
* @param componentMeta
|
|
107
|
+
* @param currentVersion
|
|
108
|
+
* @param changeLog
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
export function revisal(componentMeta: any, currentVersion: string, changeLog?: import("./changelog").ChangeLog[]): ComponentMeta;
|
|
112
|
+
/**
|
|
113
|
+
* 判断是否是最开始订正的版本的 componentMeta
|
|
114
|
+
*/
|
|
115
|
+
export function isOldestVersion(componentMeta: any): boolean;
|
|
116
|
+
export { LATEST_VERSION, CHANGE_LOGS, OLDEST_VERSION } from '@quickbi/bi-open/revisal/changelog';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare module '@quickbi/bi-open/revisal/changelog' {
|
|
120
|
+
/**
|
|
121
|
+
* @author 海狸
|
|
122
|
+
* @description
|
|
123
|
+
* 自定义组件订正
|
|
124
|
+
*
|
|
125
|
+
* [非常重要]: 独立部署不要做订正!!!!!!
|
|
126
|
+
*/
|
|
127
|
+
import type { ComponentMeta } from '@quickbi/bi-types';
|
|
128
|
+
export interface ChangeLog {
|
|
129
|
+
/** 订正的版本 */
|
|
130
|
+
version: string;
|
|
131
|
+
/** 要订正的组件 */
|
|
132
|
+
guards?: Guard[];
|
|
133
|
+
}
|
|
134
|
+
export type Guard = (componentMeta: any) => ComponentMeta;
|
|
135
|
+
/** 最老的订正版本号 */
|
|
136
|
+
export const OLDEST_VERSION = "4.0.3";
|
|
137
|
+
/**
|
|
138
|
+
* 订正日志
|
|
139
|
+
* 按版本先后排序
|
|
140
|
+
*/
|
|
141
|
+
export const CHANGE_LOGS: ChangeLog[];
|
|
142
|
+
/** 返回当前最新的版本 */
|
|
143
|
+
export const LATEST_VERSION: string;
|
|
144
|
+
}
|
|
145
|
+
|