tor-univer-sheet 1.0.13 → 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.
@@ -1,2 +1,141 @@
1
- export * from '../index'
2
- export {}
1
+ import { default as default_2 } from 'decimal.js';
2
+ import { ICellData } from '@univerjs/presets';
3
+ import { IObjectMatrixPrimitiveType } from '@univerjs/presets';
4
+ import { IWorkbookData } from '@univerjs/presets';
5
+
6
+ export declare enum CycleTypeEnum {
7
+ 无 = "no",
8
+ 年 = "year",
9
+ 月 = "month",
10
+ 周 = "week",
11
+ 天 = "day",
12
+ 班组 = "shift",
13
+ 小时 = "hour",
14
+ 半小时 = "half_hour"
15
+ }
16
+
17
+ /**
18
+ * 创建一个支持链式调用的 Decimal 实例
19
+ * @param value 初始值
20
+ * * @returns DecimalChain 实例
21
+ */
22
+ export declare function decimal(value?: string | number | default_2): DecimalChain;
23
+
24
+ declare class DecimalChain {
25
+ private value;
26
+ constructor(value: string | number | default_2);
27
+ /**
28
+ * 加法运算
29
+ * @param num 要加的数
30
+ * @returns DecimalChain 实例,支持链式调用
31
+ */
32
+ add(num: string | number | default_2): DecimalChain;
33
+ /**
34
+ * 减法运算
35
+ * @param num 要减的数
36
+ * @returns DecimalChain 实例,支持链式调用
37
+ */
38
+ subtract(num: string | number | default_2): DecimalChain;
39
+ /**
40
+ * 乘法运算
41
+ * @param num 要乘的数
42
+ * @returns DecimalChain 实例,支持链式调用
43
+ */
44
+ multiply(num: string | number | default_2): DecimalChain;
45
+ /**
46
+ * 除法运算
47
+ * @param num 要除的数
48
+ * @returns DecimalChain 实例,支持链式调用
49
+ * @throws 当除数为0时抛出错误
50
+ */
51
+ divide(num: string | number | default_2): DecimalChain;
52
+ /**
53
+ * 保留小数位数
54
+ * @param dp 保留的小数位数
55
+ * @param rounding 舍入模式,默认为四舍五入
56
+ * @returns DecimalChain 实例,支持链式调用
57
+ */
58
+ toFixed(dp: number, rounding?: default_2.Rounding): DecimalChain;
59
+ /**
60
+ * 返回当前值
61
+ * @returns Decimal 实例
62
+ */
63
+ valueOf(): default_2;
64
+ /**
65
+ * 转换为字符串
66
+ * @returns 字符串表示
67
+ */
68
+ toString(): string;
69
+ /**
70
+ * 转换为数字
71
+ * @returns 数字表示
72
+ */
73
+ toNumber(): number;
74
+ }
75
+
76
+ /**
77
+ * 下载axios导出的文件
78
+ * @param res
79
+ * @param _filename
80
+ */
81
+ export declare const downloadBlobRes: (res: any, _filename?: string | undefined) => void;
82
+
83
+ export declare function filterIndicatorsCell(cellData: IObjectMatrixPrimitiveType<ICellData>): Promise<{}>;
84
+
85
+ export declare function generateIndicatorsCells(cells: IObjectMatrixPrimitiveType<ICellData>, params: IGenerateIndicatorsCellsParams): Promise<ICellData>;
86
+
87
+ export declare const generateUUID: () => string;
88
+
89
+ export declare function getXlsxData(file: File): Promise<unknown>;
90
+
91
+ export declare const handleClearInput: (model: any, strList: string[]) => void;
92
+
93
+ export declare interface IGenerateIndicatorsCellsParams {
94
+ extraArgs: any;
95
+ rangeData: string[];
96
+ currentDay?: string;
97
+ }
98
+
99
+ export declare function initDateRange(cycleType: CycleTypeEnum, date: string[] | string): Promise<string[]>;
100
+
101
+ export declare enum ModeEnum {
102
+ view = "view",
103
+ edit = "edit"
104
+ }
105
+
106
+ export declare function openMultipleFileSelector(acceptTypes?: string, multiple?: boolean): Promise<unknown>;
107
+
108
+ export declare const stylePath = "./style.css";
109
+
110
+ export declare type TeamDataType = {
111
+ teamId: string;
112
+ teamName: string;
113
+ shiftId: string;
114
+ shiftName: string;
115
+ scheduleConfigName: string;
116
+ scheduleConfigId: string;
117
+ workName: string;
118
+ workCoding: string;
119
+ startDatetime: string;
120
+ endDatetime: string;
121
+ };
122
+
123
+ export declare interface UniverSheetsProps {
124
+ mode: ModeEnum;
125
+ showImportFilePlugin?: boolean;
126
+ showIndicatorsContextMenuPlugin?: boolean;
127
+ showSyncContextMenuPlugin?: boolean;
128
+ showTimeConfigContextMenuPlugin?: boolean;
129
+ license: string;
130
+ }
131
+
132
+ export declare function useData(data: UseDataType): IWorkbookData;
133
+
134
+ export declare type UseDataType = {
135
+ workbookData: IWorkbookData;
136
+ id?: string;
137
+ name?: string;
138
+ appVersion?: string;
139
+ };
140
+
141
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tor-univer-sheet",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "style": "./dist/style.css",
5
5
  "description": "基于 Univer 的 Vue3 电子表格组件",
6
6
  "author": "tortormore",
@@ -11,9 +11,9 @@
11
11
  "types": "./dist/types/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
+ "types": "./dist/types/index.d.ts",
14
15
  "import": "./dist/tor-univer-sheet.es.js",
15
- "require": "./dist/tor-univer-sheet.umd.js",
16
- "types": "./dist/index.d.ts"
16
+ "require": "./dist/tor-univer-sheet.umd.js"
17
17
  },
18
18
  "./style.css": "./dist/style.css"
19
19
  },
@@ -40,14 +40,14 @@
40
40
  "xlsx": "^0.18.5"
41
41
  },
42
42
  "dependencies": {
43
- "@univerjs/core": "^0.15.5",
44
- "@univerjs/preset-sheets-advanced": "^0.15.5",
45
- "@univerjs/preset-sheets-core": "^0.15.5",
46
- "@univerjs/preset-sheets-drawing": "^0.15.5",
47
- "@univerjs/preset-sheets-note": "^0.15.5",
48
- "@univerjs/presets": "^0.15.5",
49
- "@univerjs/ui": "^0.15.5",
50
- "@univerjs/ui-adapter-vue3": "^0.15.5",
43
+ "@univerjs/core": "^0.18.0",
44
+ "@univerjs/preset-sheets-advanced": "^0.18.0",
45
+ "@univerjs/preset-sheets-core": "^0.18.0",
46
+ "@univerjs/preset-sheets-drawing": "^0.18.0",
47
+ "@univerjs/preset-sheets-note": "^0.18.0",
48
+ "@univerjs/presets": "^0.18.0",
49
+ "@univerjs/ui": "^0.18.0",
50
+ "@univerjs/ui-adapter-vue3": "^0.18.0",
51
51
  "vite-plugin-dts": "^4.5.4"
52
52
  },
53
53
  "devDependencies": {
package/src/index.ts CHANGED
@@ -1,19 +1,24 @@
1
1
  // src/index.ts
2
2
  export { useData } from './components/UniverSheet'
3
-
3
+ export type { UseDataType } from './components/UniverSheet'
4
4
 
5
5
  export {
6
6
  ModeEnum,
7
7
  CycleTypeEnum,
8
8
  } from './components/UniverSheet'
9
9
 
10
+ export type {
11
+ UniverSheetsProps,
12
+ IGenerateIndicatorsCellsParams,
13
+ TeamDataType,
14
+ } from './components/UniverSheet'
15
+
10
16
  export {
11
17
  initDateRange,
12
18
  filterIndicatorsCell,
13
19
  generateIndicatorsCells,
14
20
  } from './components/UniverSheet'
15
21
 
16
-
17
22
  export { decimal } from './utils/decimal'
18
23
 
19
24
  export { handleClearInput, generateUUID } from './utils'
@@ -24,15 +29,5 @@ export {
24
29
  downloadBlobRes,
25
30
  } from './utils/fileHelp'
26
31
 
27
- export type {
28
- UniverSheetsProps,
29
- UseDataType,
30
- IGenerateIndicatorsCellsParams,
31
- TeamDataType,
32
- } from './components/UniverSheet'
33
-
34
-
35
-
36
-
37
32
  // 导出样式文件路径(不导入,让使用者自己导入)
38
33
  export const stylePath = './style.css'