jvs-excel-ui 0.0.0-stage → 0.1.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.
@@ -0,0 +1,118 @@
1
+ export interface CommandListItem {
2
+ id: string;
3
+ type?: string | number;
4
+ params: string;
5
+ options?: any;
6
+ }
7
+ declare function resetCommandList(): void;
8
+ declare function flushCommandList(): void;
9
+ declare function forceCommitEdit(): Promise<void>;
10
+ declare function doAction(item: any): void;
11
+ declare function getData(isEnd?: boolean): any;
12
+ declare function sendRangeInfo(): void;
13
+ declare function changeUniverEditStatus(value: boolean): Promise<void>;
14
+ declare function getUniverAPI(): any;
15
+ declare function getUniver(): any;
16
+ declare function applyCollabCommands(commands: CommandListItem[]): void;
17
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
18
+ reportDesign: {
19
+ type: ObjectConstructor;
20
+ default: () => {};
21
+ };
22
+ designInfo: {
23
+ type: ObjectConstructor;
24
+ default: () => {};
25
+ };
26
+ isEdit: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ locale: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ memberList: {
35
+ type: ArrayConstructor;
36
+ default: () => never[];
37
+ };
38
+ uploadImage: {
39
+ type: FunctionConstructor;
40
+ default: undefined;
41
+ };
42
+ }>, {
43
+ doAction: typeof doAction;
44
+ editCell: import('vue').Ref<boolean, boolean>;
45
+ getData: typeof getData;
46
+ sendRangeInfo: typeof sendRangeInfo;
47
+ resetCommandList: typeof resetCommandList;
48
+ changeUniverEditStatus: typeof changeUniverEditStatus;
49
+ flushCommandList: typeof flushCommandList;
50
+ forceCommitEdit: typeof forceCommitEdit;
51
+ applyCollabCommands: typeof applyCollabCommands;
52
+ getUniverAPI: typeof getUniverAPI;
53
+ getUniver: typeof getUniver;
54
+ univerRef: import('vue').Ref<any, any>;
55
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
56
+ cellClick: (...args: any[]) => void;
57
+ "update:currentCell": (...args: any[]) => void;
58
+ "update:sheetData": (...args: any[]) => void;
59
+ "update:undoNum": (...args: any[]) => void;
60
+ "update:redoNum": (...args: any[]) => void;
61
+ "update:currentSheetId": (...args: any[]) => void;
62
+ "update:editCell": (...args: any[]) => void;
63
+ commandExecuted: (...args: any[]) => void;
64
+ newChanges: (...args: any[]) => void;
65
+ rangeChange: (...args: any[]) => void;
66
+ univerCellChange: (...args: any[]) => void;
67
+ ready: (...args: any[]) => void;
68
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
69
+ reportDesign: {
70
+ type: ObjectConstructor;
71
+ default: () => {};
72
+ };
73
+ designInfo: {
74
+ type: ObjectConstructor;
75
+ default: () => {};
76
+ };
77
+ isEdit: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ locale: {
82
+ type: StringConstructor;
83
+ default: string;
84
+ };
85
+ memberList: {
86
+ type: ArrayConstructor;
87
+ default: () => never[];
88
+ };
89
+ uploadImage: {
90
+ type: FunctionConstructor;
91
+ default: undefined;
92
+ };
93
+ }>> & Readonly<{
94
+ onCellClick?: ((...args: any[]) => any) | undefined;
95
+ "onUpdate:currentCell"?: ((...args: any[]) => any) | undefined;
96
+ "onUpdate:sheetData"?: ((...args: any[]) => any) | undefined;
97
+ "onUpdate:undoNum"?: ((...args: any[]) => any) | undefined;
98
+ "onUpdate:redoNum"?: ((...args: any[]) => any) | undefined;
99
+ "onUpdate:currentSheetId"?: ((...args: any[]) => any) | undefined;
100
+ "onUpdate:editCell"?: ((...args: any[]) => any) | undefined;
101
+ onCommandExecuted?: ((...args: any[]) => any) | undefined;
102
+ onNewChanges?: ((...args: any[]) => any) | undefined;
103
+ onRangeChange?: ((...args: any[]) => any) | undefined;
104
+ onUniverCellChange?: ((...args: any[]) => any) | undefined;
105
+ onReady?: ((...args: any[]) => any) | undefined;
106
+ }>, {
107
+ reportDesign: Record<string, any>;
108
+ designInfo: Record<string, any>;
109
+ isEdit: boolean;
110
+ locale: string;
111
+ memberList: unknown[];
112
+ uploadImage: Function;
113
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
114
+ sheetContainerRef: HTMLDivElement;
115
+ memberCanvasRef: HTMLCanvasElement;
116
+ sheetImageInputRef: HTMLInputElement;
117
+ }, HTMLDivElement>;
118
+ export default _default;
@@ -0,0 +1,62 @@
1
+ import { ExcelInputSource } from './utils/excelIo';
2
+ export type { ExcelInputSource };
3
+ export interface JvsExcelHighlightConf {
4
+ color: string;
5
+ isUse: boolean;
6
+ }
7
+ export interface JvsExcelProps {
8
+ /** 工作簿初始数据 (Univer Workbook Snapshot) */
9
+ workbookData?: Record<string, any>;
10
+ /** Excel 文件内容(支持 File / Blob / ArrayBuffer / Uint8Array / Base64字符串 / JSON字符串) */
11
+ fileContent?: ExcelInputSource;
12
+ /** 远程或本地 Excel 文件地址 (.xlsx / .xls / .csv URL) */
13
+ fileUrl?: string;
14
+ /** 文档/报表基础信息 */
15
+ designInfo?: Record<string, any>;
16
+ /** 唯一标识 */
17
+ id?: string;
18
+ /** 是否可编辑 */
19
+ isEdit?: boolean;
20
+ /** 是否只读 */
21
+ readonly?: boolean;
22
+ /** 语言 ('zh-CN' | 'en-US') */
23
+ locale?: string;
24
+ /** 协同成员光标列表 */
25
+ memberList?: any[];
26
+ /** 自定义图片上传钩子,返回图片 URL;不传则默认使用 Base64 插入 */
27
+ uploadImage?: (file: File) => Promise<string>;
28
+ }
29
+ export interface JvsExcelExpose {
30
+ /** 获取 Univer Facade API 实例 (FUniver),可调用 executeCommand、getActiveWorkbook、addEvent 等全部官方 Facade API */
31
+ getUniverAPI: () => any;
32
+ /** 获取底层 Univer 核心实例 (Univer) */
33
+ getUniver: () => any;
34
+ /** 获取当前激活的工作簿 Facade 实例 (FWorkbook) */
35
+ getActiveWorkbook: () => any;
36
+ /** 获取当前激活的工作表 Facade 实例 (FWorksheet) */
37
+ getActiveSheet: () => any;
38
+ /** 响应式 Univer Facade API 引用 */
39
+ univerAPI: any;
40
+ /** 中间 UniverSheet 子组件实例引用 */
41
+ univerSheetRef: any;
42
+ /** 获取当前工作簿完整 JSON 快照数据 */
43
+ getData: (isEnd?: boolean) => Record<string, any> | undefined;
44
+ /** 重载/设置工作簿 JSON 快照数据 */
45
+ setData: (newWorkbookData?: Record<string, any>) => Promise<void>;
46
+ /** 导入并渲染 Excel 文件(支持 File / Blob / ArrayBuffer / Base64 / 远程文件 URL) */
47
+ importExcelFile: (source: ExcelInputSource, fileName?: string) => Promise<Record<string, any>>;
48
+ /** 导出当前工作簿为 .xlsx 文件 */
49
+ exportExcelFile: (fileName?: string, download?: boolean) => Promise<Blob>;
50
+ /** 强制提交当前正在编辑的单元格并刷新变更队列 */
51
+ forceCommitEdit: () => Promise<void>;
52
+ /** 立即触发未发送的增量命令队列 (newChanges) */
53
+ flushCommandList: () => void;
54
+ /** 清空待发送增量命令队列 */
55
+ resetCommandList: () => void;
56
+ /** 应用远端协同命令列表到当前工作簿 */
57
+ applyCollabCommands: (commands: any[]) => void;
58
+ /** 执行工具栏/底部栏动作 */
59
+ doAction: (item: any) => void;
60
+ /** 生成基础空白工作簿数据结构 */
61
+ createBaseReportData: (docId?: string) => Record<string, any>;
62
+ }
@@ -0,0 +1,14 @@
1
+ export type ExcelInputSource = File | Blob | ArrayBuffer | Uint8Array | string;
2
+ export interface ParseExcelOptions {
3
+ fileName?: string;
4
+ docId?: string;
5
+ }
6
+ /**
7
+ * 将本地 File / Blob / ArrayBuffer / Base64 / 远程文件 URL 解析为 UniverJS 工作簿快照数据
8
+ * 支持 .xlsx (完整保留主题色/索引色/RGB、字体、边框、背景、对齐、合并单元格、公式、图片、行列宽高) 与 .xls / .csv 格式
9
+ */
10
+ export declare function parseExcelToUniverData(source: ExcelInputSource, options?: ParseExcelOptions): Promise<Record<string, any>>;
11
+ /**
12
+ * 将 UniverJS 工作簿快照导出为 .xlsx 文件
13
+ */
14
+ export declare function exportUniverToExcel(data: Record<string, any>, fileName?: string, download?: boolean): Promise<Blob>;
@@ -0,0 +1,18 @@
1
+ import { Directive, ObjectDirective } from 'vue';
2
+ export declare function generateUUID(): string;
3
+ export declare function findByvalue(list: Array<{
4
+ label?: string;
5
+ value?: string | number;
6
+ }> | undefined, val: string | number | undefined): string;
7
+ export declare function hexToRgb(hex: string): {
8
+ r: number;
9
+ g: number;
10
+ b: number;
11
+ a: number;
12
+ };
13
+ export declare function tranRenderColorRGBA(value?: string, alpha?: number): string;
14
+ export declare const vResize: ObjectDirective<HTMLElement, (size: {
15
+ width: number;
16
+ height: number;
17
+ }) => void>;
18
+ export declare const vClickOutside: Directive<HTMLElement, (e: MouseEvent) => void>;
@@ -0,0 +1,6 @@
1
+ export declare const zhCN: {
2
+ [x: string]: any;
3
+ };
4
+ export declare const enUS: {
5
+ [x: string]: any;
6
+ };