@ecan-bi/tools 1.0.12 → 1.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecan-bi/tools",
3
- "version": "1.0.12",
3
+ "version": "1.0.15",
4
4
  "description": "General tools",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -14,9 +14,14 @@
14
14
  "scripts": {
15
15
  "dev": "vite build -wc vite.config.js",
16
16
  "build": "npm run clean && npm run dist",
17
+ "compile": "vite build -c vite.config.compile.js",
17
18
  "dist": "vite build -c vite.config.js",
18
- "test": "echo \"Error: no test specified\" && exit 1",
19
- "module": "npm run clean && npm run compile"
19
+ "lint": "eslint ./src --ext .vue,.js,.ts,.jsx,.tsx",
20
+ "lint:fix": "eslint --fix ./src --ext .vue,.js,.ts,.jsx,.tsx",
21
+ "clean": "rimraf ./dist ./types ./es ./lib",
22
+ "test": "jest",
23
+ "module": "npm run clean && npm run compile",
24
+ "prepublishOnly": "npm run build"
20
25
  },
21
26
  "author": "huangjunhao",
22
27
  "publishConfig": {
@@ -28,16 +33,15 @@
28
33
  "lodash-es": "^4.17.21"
29
34
  },
30
35
  "devDependencies": {
36
+ "@babel/core": "^7.26.8",
37
+ "@babel/preset-env": "^7.26.8",
31
38
  "babel-jest": "^26.6.3",
32
- "vue": "3.3.8",
33
- "@vitejs/plugin-vue": "^4.0.0",
34
- "@vitejs/plugin-vue-jsx": "^3.0.0",
35
39
  "rollup-plugin-peer-deps-external": "^2.2.4",
36
40
  "vite": "^4.0.4",
41
+ "vite-plugin-babel": "^1.3.0",
37
42
  "vite-plugin-banner": "^0.5.0",
38
- "vite-plugin-css-injected-by-js": "^2.2.0",
39
- "vite-plugin-dts": "1.7.1",
40
43
  "vite-plugin-eslint": "^1.8.1",
41
- "vite-plugin-external": "^1.2.3"
44
+ "vite-plugin-external": "^1.2.3",
45
+ "vue": "3.3.8"
42
46
  }
43
47
  }
@@ -1,25 +0,0 @@
1
- interface DataItem {
2
- name: string | number;
3
- value: string | number;
4
- type?: string;
5
- }
6
- export declare type Data = DataItem[];
7
- export interface KeyTypeDataFieldNames {
8
- name: string;
9
- types: {
10
- label: string;
11
- value: string;
12
- }[];
13
- }
14
- /**
15
- * 图形转化数据
16
- * @param data 数据
17
- * @param dataFieldNames 字段映射
18
- */
19
- export declare const useTransformChartDataByAttrKey: (data: Data, dataFieldNames: KeyTypeDataFieldNames) => {
20
- dimensions: unknown[];
21
- dataset: {
22
- [key: string]: any;
23
- }[];
24
- };
25
- export default useTransformChartDataByAttrKey;
@@ -1,23 +0,0 @@
1
- interface DataItem {
2
- name: string | number;
3
- value: string | number;
4
- type?: string;
5
- }
6
- export declare type Data = DataItem[];
7
- export interface ValueTypeDataFieldNames {
8
- name: string;
9
- value: string;
10
- type: string;
11
- }
12
- /**
13
- * 图形转化数据
14
- * @param data 数据
15
- * @param dataFieldNames 字段映射
16
- */
17
- export declare const useTransformChartDataByAttrValue: (data: Data, dataFieldNames?: ValueTypeDataFieldNames) => {
18
- dimensions: unknown[];
19
- dataset: {
20
- [key: string]: any;
21
- }[];
22
- };
23
- export default useTransformChartDataByAttrValue;
@@ -1,2 +0,0 @@
1
- export declare const useValueFormatter: (formatter: string, value: string) => string;
2
- export default useValueFormatter;
@@ -1,12 +0,0 @@
1
- export declare const useVariablesInText: (formatter?: string, { textData, codeData }?: {
2
- textData?: {
3
- [key: string]: any;
4
- };
5
- codeData?: {
6
- [key: string]: any;
7
- };
8
- }, { useNewline, useSpace }?: {
9
- useNewline?: boolean;
10
- useSpace?: boolean;
11
- }) => string;
12
- export default useVariablesInText;
package/types/index.d.ts DELETED
@@ -1,53 +0,0 @@
1
- import { getIndicatorParams } from './utils/util';
2
- declare const _default: {
3
- runCode: (code: string, data?: {
4
- [key: string]: any;
5
- }) => any;
6
- useTransformChartDataByAttrKey: (data: import("./hooks/useTransformChartDataByAttrKey").Data, dataFieldNames: import("./hooks/useTransformChartDataByAttrKey").KeyTypeDataFieldNames) => {
7
- dimensions: unknown[];
8
- dataset: {
9
- [key: string]: any;
10
- }[];
11
- };
12
- useTransformChartDataByAttrValue: (data: import("./hooks/useTransformChartDataByAttrValue").Data, dataFieldNames?: import("./hooks/useTransformChartDataByAttrValue").ValueTypeDataFieldNames) => {
13
- dimensions: unknown[];
14
- dataset: {
15
- [key: string]: any;
16
- }[];
17
- };
18
- useValueFormatter: (formatter: string, value: string) => string;
19
- useVariablesInText: (formatter?: string, { textData, codeData }?: {
20
- textData?: {
21
- [key: string]: any;
22
- };
23
- codeData?: {
24
- [key: string]: any;
25
- };
26
- }, { useNewline, useSpace }?: {
27
- useNewline?: boolean;
28
- useSpace?: boolean;
29
- }) => string;
30
- transformProps: (chartsOptions: any, chartData: any, fontSize?: number) => {
31
- title: {
32
- text: any;
33
- subtext: any;
34
- textStyle: {
35
- fontSize: any;
36
- fontWeight: any;
37
- color: any;
38
- };
39
- left: any;
40
- };
41
- grid: {
42
- top: any;
43
- bottom: any;
44
- left: any;
45
- right: any;
46
- containLabel: any;
47
- };
48
- color: any;
49
- };
50
- getIndicatorParams: typeof getIndicatorParams;
51
- formatIndicatorParams: (props: any, otherParams?: any) => any;
52
- };
53
- export default _default;
@@ -1,4 +0,0 @@
1
- declare const _default: {
2
- formatIndicatorParams: (props: any, otherParams?: any) => any;
3
- };
4
- export default _default;
@@ -1 +0,0 @@
1
- export declare const MODEL_KEY_LIST: string[];
@@ -1,4 +0,0 @@
1
- declare const runCode: (code: string, data?: {
2
- [key: string]: any;
3
- }) => any;
4
- export default runCode;
@@ -1,21 +0,0 @@
1
- declare const transformProps: (chartsOptions: any, chartData: any, fontSize?: number) => {
2
- title: {
3
- text: any;
4
- subtext: any;
5
- textStyle: {
6
- fontSize: any;
7
- fontWeight: any;
8
- color: any;
9
- };
10
- left: any;
11
- };
12
- grid: {
13
- top: any;
14
- bottom: any;
15
- left: any;
16
- right: any;
17
- containLabel: any;
18
- };
19
- color: any;
20
- };
21
- export default transformProps;
@@ -1,31 +0,0 @@
1
- /**
2
- * 字符串1 中是否包含 字符串2 (会全部转成小写)
3
- * @param v1 字符串1
4
- * @param v2 字符串2
5
- * @constructor
6
- */
7
- export declare const lowerCaseIncludes: (v1: any, v2: any) => boolean;
8
- /**
9
- * 判断 key 是否在对象上
10
- * @param v
11
- * @param k
12
- */
13
- export declare const hasOwn: (v: object, k: string | symbol) => k is never;
14
- export declare const getConditions: (conditions: any) => any;
15
- export declare function getFormatStep(format: string): string;
16
- export declare const handleFormatter: (formatter: string) => string;
17
- /**
18
- * 图表的图例格式化
19
- * @param format 表达式
20
- * @param textData 传入参数
21
- * @returns 显示的图例文本
22
- */
23
- export declare const getLegendFormat: (format: string, textData: any) => string;
24
- export declare function formatQfw(str: string): string;
25
- export declare function getIndicatorParams({ graphicConfig, request, INDICATOR_URL, PAGE_ID, dataSourceId }: {
26
- graphicConfig: any;
27
- request: any;
28
- INDICATOR_URL?: string;
29
- PAGE_ID: any;
30
- dataSourceId: any;
31
- }): Promise<any>;