@sl-material/sl-table-sheet 1.0.0-beta0
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/config/config.d.ts +0 -0
- package/core/Dialog-column.d.ts +117 -0
- package/core/Dialog.d.ts +117 -0
- package/core/ExcelUtils.d.ts +6 -0
- package/core/SlTableSheet.d.ts +166 -0
- package/core/TableSheet.d.ts +188 -0
- package/core/Toolbar.d.ts +110 -0
- package/core/comnon.d.ts +6 -0
- package/core/excel/ExcelExporter.d.ts +26 -0
- package/core/excel/ExcelParser.d.ts +12 -0
- package/core/excel/index.d.ts +15 -0
- package/core/excel/parsers/CommentExtractor.d.ts +23 -0
- package/core/excel/parsers/HeaderDetector.d.ts +45 -0
- package/core/excel/parsers/StyleExtractor.d.ts +27 -0
- package/core/excel/types.d.ts +39 -0
- package/core/excel/utils/ColorConverter.d.ts +15 -0
- package/core/index.d.ts +12 -0
- package/core/managers/CellMarkManager.d.ts +33 -0
- package/core/managers/CustomComponentManager.d.ts +34 -0
- package/core/managers/EditorManager.d.ts +16 -0
- package/core/managers/EventManager.d.ts +34 -0
- package/core/processors/DataProcessor.d.ts +23 -0
- package/core/processors/StyleProcessor.d.ts +15 -0
- package/core/types.d.ts +59 -0
- package/data.d.ts +3 -0
- package/index.d.ts +8 -0
- package/index.umd.d.ts +3 -0
- package/locales/index.d.ts +87 -0
- package/locales/test-zh-TW.d.ts +5 -0
- package/package.json +29 -0
- package/sl-table-sheet.cjs.js +491 -0
- package/sl-table-sheet.es.js +2499 -0
- package/sl-table-sheet.umd.umd.js +492 -0
- package/style.css +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ExcelColumn } from './types';
|
|
2
|
+
|
|
3
|
+
export declare class ExcelExporter {
|
|
4
|
+
/**
|
|
5
|
+
* 导出为 Excel 流
|
|
6
|
+
*/
|
|
7
|
+
static exportToStream(columns: ExcelColumn[], records: any[], options?: {
|
|
8
|
+
filterEmptyColumns?: boolean;
|
|
9
|
+
}): ArrayBuffer;
|
|
10
|
+
/**
|
|
11
|
+
* 下载 Excel 文件
|
|
12
|
+
*/
|
|
13
|
+
static download(buffer: ArrayBuffer, filename?: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* 过滤空列
|
|
16
|
+
*/
|
|
17
|
+
private static filterEmptyColumns;
|
|
18
|
+
/**
|
|
19
|
+
* 构建数据行
|
|
20
|
+
*/
|
|
21
|
+
private static buildDataRows;
|
|
22
|
+
/**
|
|
23
|
+
* 提取单元格值
|
|
24
|
+
*/
|
|
25
|
+
private static extractCellValue;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExcelParseOptions, ExcelParseResult } from './types';
|
|
2
|
+
|
|
3
|
+
export declare class ExcelParser {
|
|
4
|
+
/**
|
|
5
|
+
* 解析 Excel ArrayBuffer
|
|
6
|
+
*/
|
|
7
|
+
static parseBuffer(buffer: ArrayBuffer, options?: ExcelParseOptions): ExcelParseResult;
|
|
8
|
+
/**
|
|
9
|
+
* 构建列配置
|
|
10
|
+
*/
|
|
11
|
+
private static buildColumns;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExcelParseOptions, ExcelParseResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Excel 模块统一导出
|
|
4
|
+
*/
|
|
5
|
+
export { ExcelParser } from './ExcelParser';
|
|
6
|
+
export { ExcelExporter } from './ExcelExporter';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export declare function fetchExcelFromUrl(url: string): Promise<ArrayBuffer>;
|
|
9
|
+
export declare function parseExcelBuffer(buffer: ArrayBuffer, options?: ExcelParseOptions): ExcelParseResult;
|
|
10
|
+
export declare function loadExcelFromUrl(url: string, options?: ExcelParseOptions): Promise<ExcelParseResult>;
|
|
11
|
+
export declare function parseExcelFile(file: File, options?: ExcelParseOptions): Promise<ExcelParseResult>;
|
|
12
|
+
export declare function exportToExcelStream(columns: any[], records: any[], options?: {
|
|
13
|
+
filterEmptyColumns?: boolean;
|
|
14
|
+
}): ArrayBuffer;
|
|
15
|
+
export declare function downloadExcel(buffer: ArrayBuffer, filename?: string): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CellComment } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Excel 批注提取器
|
|
4
|
+
*/
|
|
5
|
+
import * as XLSX from "xlsx";
|
|
6
|
+
export declare class CommentExtractor {
|
|
7
|
+
/**
|
|
8
|
+
* 提取批注数据
|
|
9
|
+
*/
|
|
10
|
+
static extractComments(worksheet: XLSX.WorkSheet, dataStartRow: number): Map<string, CellComment> | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 收集所有批注
|
|
13
|
+
*/
|
|
14
|
+
private static collectComments;
|
|
15
|
+
/**
|
|
16
|
+
* 从单元格中提取批注
|
|
17
|
+
*/
|
|
18
|
+
private static extractCommentsFromCells;
|
|
19
|
+
/**
|
|
20
|
+
* 清理批注文本
|
|
21
|
+
*/
|
|
22
|
+
private static cleanCommentText;
|
|
23
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel 表头智能检测器
|
|
3
|
+
*/
|
|
4
|
+
export interface HeaderDetectionResult {
|
|
5
|
+
headerRows: number;
|
|
6
|
+
dataStartRow: number;
|
|
7
|
+
effectiveHeaderRows: any[][];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 智能检测 Excel 表头结构
|
|
11
|
+
*/
|
|
12
|
+
export declare class HeaderDetector {
|
|
13
|
+
/**
|
|
14
|
+
* 检测表头行数
|
|
15
|
+
*/
|
|
16
|
+
static detectHeaderRows(rawData: any[][], userHeaderRows?: number): HeaderDetectionResult;
|
|
17
|
+
/**
|
|
18
|
+
* 自动检测表头行数
|
|
19
|
+
*/
|
|
20
|
+
private static autoDetectHeaderRows;
|
|
21
|
+
/**
|
|
22
|
+
* 过滤标题行,只保留表头行
|
|
23
|
+
*/
|
|
24
|
+
private static filterTitleRows;
|
|
25
|
+
/**
|
|
26
|
+
* 获取非空单元格
|
|
27
|
+
*/
|
|
28
|
+
private static getNonEmptyCells;
|
|
29
|
+
/**
|
|
30
|
+
* 判断是否为标题行
|
|
31
|
+
*/
|
|
32
|
+
private static isTitleRow;
|
|
33
|
+
/**
|
|
34
|
+
* 判断是否为表头行
|
|
35
|
+
*/
|
|
36
|
+
private static isHeaderRow;
|
|
37
|
+
/**
|
|
38
|
+
* 判断是否为数据行
|
|
39
|
+
*/
|
|
40
|
+
private static isDataRow;
|
|
41
|
+
/**
|
|
42
|
+
* 合并多层表头
|
|
43
|
+
*/
|
|
44
|
+
static mergeHeaders(effectiveHeaderRows: any[][], maxCols: number): string[];
|
|
45
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CellStyle } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Excel 单元格样式提取器
|
|
4
|
+
*/
|
|
5
|
+
import * as XLSX from "xlsx";
|
|
6
|
+
export declare class StyleExtractor {
|
|
7
|
+
/**
|
|
8
|
+
* 提取单元格样式
|
|
9
|
+
*/
|
|
10
|
+
static extractStyles(worksheet: XLSX.WorkSheet, workbook: XLSX.WorkBook, dataStartRow: number): Map<string, CellStyle> | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 提取单个单元格样式
|
|
13
|
+
*/
|
|
14
|
+
private static extractCellStyle;
|
|
15
|
+
/**
|
|
16
|
+
* 提取字体样式
|
|
17
|
+
*/
|
|
18
|
+
private static extractFontStyle;
|
|
19
|
+
/**
|
|
20
|
+
* 提取填充样式
|
|
21
|
+
*/
|
|
22
|
+
private static extractFillStyle;
|
|
23
|
+
/**
|
|
24
|
+
* 检查是否有非默认样式
|
|
25
|
+
*/
|
|
26
|
+
private static hasNonDefaultStyle;
|
|
27
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel 相关类型定义
|
|
3
|
+
*/
|
|
4
|
+
export interface ExcelColumn {
|
|
5
|
+
field?: string;
|
|
6
|
+
key?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ExcelParseOptions {
|
|
10
|
+
sheetIndex?: number;
|
|
11
|
+
headerRow?: number;
|
|
12
|
+
headerRows?: number;
|
|
13
|
+
mergeHeaders?: boolean;
|
|
14
|
+
extractStyles?: boolean;
|
|
15
|
+
extractComments?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface CellStyle {
|
|
18
|
+
fontColor?: string;
|
|
19
|
+
bgColor?: string;
|
|
20
|
+
bold?: boolean;
|
|
21
|
+
italic?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface CellComment {
|
|
24
|
+
text: string;
|
|
25
|
+
author?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ExcelParseResult {
|
|
28
|
+
columns: Array<{
|
|
29
|
+
key: string;
|
|
30
|
+
field: string;
|
|
31
|
+
title: string;
|
|
32
|
+
width: number;
|
|
33
|
+
sort?: boolean;
|
|
34
|
+
filter?: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
records: any[][];
|
|
37
|
+
cellStyles?: Map<string, CellStyle>;
|
|
38
|
+
cellComments?: Map<string, CellComment>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 颜色格式转换工具
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 将 ARGB 颜色转换为 hex 格式
|
|
6
|
+
*/
|
|
7
|
+
export declare function argbToHex(argb: string | undefined): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* 从 xlsx 主题颜色索引获取颜色
|
|
10
|
+
*/
|
|
11
|
+
export declare function getThemeColor(theme: number, _tint?: number): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* 解析 xlsx 颜色对象
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseXlsxColor(color: any): string | undefined;
|
package/core/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心模块导出
|
|
3
|
+
*/
|
|
4
|
+
export { TableSheet } from './TableSheet';
|
|
5
|
+
export type { TableSheetConfig } from './TableSheet';
|
|
6
|
+
export { FindReplaceDialog } from './Dialog';
|
|
7
|
+
export type { MatchPosition, FindReplaceOptions } from './Dialog';
|
|
8
|
+
export { Toolbar } from './Toolbar';
|
|
9
|
+
export type { ToolbarConfig } from './Toolbar';
|
|
10
|
+
export { SlTableSheet } from './SlTableSheet';
|
|
11
|
+
export type { SlTableSheetConfig } from './SlTableSheet';
|
|
12
|
+
export { SlTableSheet as default } from './SlTableSheet';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 标记单元格管理器
|
|
3
|
+
*/
|
|
4
|
+
export declare class CellMarkManager {
|
|
5
|
+
private markedMap;
|
|
6
|
+
private tableInstance;
|
|
7
|
+
constructor(tableInstance: any, markedMap?: Map<string, {
|
|
8
|
+
isMarked: boolean;
|
|
9
|
+
comment?: string;
|
|
10
|
+
}>);
|
|
11
|
+
/**
|
|
12
|
+
* 处理单元格鼠标进入事件
|
|
13
|
+
*/
|
|
14
|
+
handleCellMouseEnter(args: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* 显示 tooltip
|
|
17
|
+
*/
|
|
18
|
+
private showTooltip;
|
|
19
|
+
/**
|
|
20
|
+
* 获取标记映射
|
|
21
|
+
*/
|
|
22
|
+
getMarkedMap(): Map<string, {
|
|
23
|
+
isMarked: boolean;
|
|
24
|
+
comment?: string;
|
|
25
|
+
}> | null;
|
|
26
|
+
/**
|
|
27
|
+
* 设置标记映射
|
|
28
|
+
*/
|
|
29
|
+
setMarkedMap(markedMap: Map<string, {
|
|
30
|
+
isMarked: boolean;
|
|
31
|
+
comment?: string;
|
|
32
|
+
}>): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CustomComponentConfig } from '../TableSheet';
|
|
2
|
+
|
|
3
|
+
export declare class CustomComponentManager {
|
|
4
|
+
private customComponentContainers;
|
|
5
|
+
private activeComponentKey;
|
|
6
|
+
private justCreatedComponent;
|
|
7
|
+
private tableInstance;
|
|
8
|
+
private container;
|
|
9
|
+
constructor(tableInstance: any, container: HTMLElement | null);
|
|
10
|
+
/**
|
|
11
|
+
* 显示自定义组件
|
|
12
|
+
*/
|
|
13
|
+
showComponent(componentName: string, config: CustomComponentConfig, cellArgs: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* 创建组件容器
|
|
16
|
+
*/
|
|
17
|
+
private createComponentContainer;
|
|
18
|
+
/**
|
|
19
|
+
* 关闭当前激活的组件
|
|
20
|
+
*/
|
|
21
|
+
closeActiveComponent(): void;
|
|
22
|
+
/**
|
|
23
|
+
* 处理点击表格外部
|
|
24
|
+
*/
|
|
25
|
+
private handleOutsideClick;
|
|
26
|
+
/**
|
|
27
|
+
* 绑定外部点击处理
|
|
28
|
+
*/
|
|
29
|
+
private bindOutsideClickHandler;
|
|
30
|
+
/**
|
|
31
|
+
* 销毁管理器
|
|
32
|
+
*/
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 编辑器管理器
|
|
3
|
+
*/
|
|
4
|
+
export interface EditorConfig {
|
|
5
|
+
dateEditor?: boolean | any;
|
|
6
|
+
listEditor?: {
|
|
7
|
+
values: string[];
|
|
8
|
+
};
|
|
9
|
+
customEditors?: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
export declare class EditorManager {
|
|
12
|
+
/**
|
|
13
|
+
* 注册编辑器
|
|
14
|
+
*/
|
|
15
|
+
static registerEditors(config?: EditorConfig): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CustomComponentConfig } from '../TableSheet';
|
|
2
|
+
import { CustomComponentManager } from './CustomComponentManager';
|
|
3
|
+
import { CellMarkManager } from './CellMarkManager';
|
|
4
|
+
|
|
5
|
+
export interface EventManagerConfig {
|
|
6
|
+
tableInstance: any;
|
|
7
|
+
columns?: any[];
|
|
8
|
+
customComponents?: Record<string, CustomComponentConfig>;
|
|
9
|
+
onCellClick?: (args: any) => void;
|
|
10
|
+
onCellChange?: (args: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare class EventManager {
|
|
13
|
+
private tableInstance;
|
|
14
|
+
private config;
|
|
15
|
+
private customComponentManager;
|
|
16
|
+
private cellMarkManager;
|
|
17
|
+
constructor(config: EventManagerConfig, customComponentManager: CustomComponentManager | null, cellMarkManager: CellMarkManager | null);
|
|
18
|
+
/**
|
|
19
|
+
* 绑定所有事件
|
|
20
|
+
*/
|
|
21
|
+
bindEvents(): void;
|
|
22
|
+
/**
|
|
23
|
+
* 处理单元格点击
|
|
24
|
+
*/
|
|
25
|
+
private handleCellClick;
|
|
26
|
+
/**
|
|
27
|
+
* 监听事件
|
|
28
|
+
*/
|
|
29
|
+
on(eventName: string, callback: Function): void;
|
|
30
|
+
/**
|
|
31
|
+
* 取消监听事件
|
|
32
|
+
*/
|
|
33
|
+
off(eventName: string, callback?: Function): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 数据处理器 - 处理数据预处理逻辑
|
|
3
|
+
*/
|
|
4
|
+
export declare class DataProcessor {
|
|
5
|
+
/**
|
|
6
|
+
* 预处理数据:将 {value, isMarked} 格式转换为二维数组格式,并构建标记索引
|
|
7
|
+
*/
|
|
8
|
+
static processRecords(records: any[], columns: any[]): {
|
|
9
|
+
displayRecords: any[][];
|
|
10
|
+
markedMap: Map<string, {
|
|
11
|
+
isMarked: boolean;
|
|
12
|
+
comment?: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 处理数组格式的行
|
|
17
|
+
*/
|
|
18
|
+
private static processArrayRow;
|
|
19
|
+
/**
|
|
20
|
+
* 处理对象格式的行
|
|
21
|
+
*/
|
|
22
|
+
private static processObjectRow;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CellStyle } from '../excel';
|
|
2
|
+
|
|
3
|
+
export declare class StyleProcessor {
|
|
4
|
+
/**
|
|
5
|
+
* 初始化列配置,根据 markedMap 添加高亮样式,并应用 Excel 单元格样式
|
|
6
|
+
*/
|
|
7
|
+
static initColumns(columns: any[], markedMap: Map<string, {
|
|
8
|
+
isMarked: boolean;
|
|
9
|
+
comment?: string;
|
|
10
|
+
}>, cellStyles?: Map<string, CellStyle> | null): any[];
|
|
11
|
+
/**
|
|
12
|
+
* 应用 Excel 单元格样式
|
|
13
|
+
*/
|
|
14
|
+
private static applyExcelStyle;
|
|
15
|
+
}
|
package/core/types.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表格配置接口
|
|
3
|
+
*/
|
|
4
|
+
export interface TableSheetConfig {
|
|
5
|
+
/** 容器元素或选择器 */
|
|
6
|
+
container: HTMLElement | string;
|
|
7
|
+
/** 列配置 */
|
|
8
|
+
columns?: any[];
|
|
9
|
+
/** 数据 */
|
|
10
|
+
records?: any[];
|
|
11
|
+
/** 是否显示公式栏 */
|
|
12
|
+
showFormulaBar?: boolean;
|
|
13
|
+
/** 是否显示工作表标签 */
|
|
14
|
+
showSheetTab?: boolean;
|
|
15
|
+
/** 工作表配置 */
|
|
16
|
+
sheets?: SheetConfig[];
|
|
17
|
+
/** 编辑器配置 */
|
|
18
|
+
editors?: EditorConfig;
|
|
19
|
+
/** 其他选项 */
|
|
20
|
+
options?: any;
|
|
21
|
+
/** 事件回调 */
|
|
22
|
+
onReady?: (instance: any) => void;
|
|
23
|
+
onCellClick?: (args: any) => void;
|
|
24
|
+
onCellChange?: (args: any) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 工作表配置
|
|
28
|
+
*/
|
|
29
|
+
export interface SheetConfig {
|
|
30
|
+
sheetKey: string;
|
|
31
|
+
sheetTitle: string;
|
|
32
|
+
columns: any[];
|
|
33
|
+
data: any[];
|
|
34
|
+
dragOrder?: {
|
|
35
|
+
dragHeaderMode?: 'all' | 'column' | 'row';
|
|
36
|
+
};
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 编辑器配置
|
|
41
|
+
*/
|
|
42
|
+
export interface EditorConfig {
|
|
43
|
+
/** 日期编辑器配置 */
|
|
44
|
+
dateEditor?: boolean | any;
|
|
45
|
+
/** 下拉列表编辑器 */
|
|
46
|
+
listEditor?: {
|
|
47
|
+
values: string[];
|
|
48
|
+
};
|
|
49
|
+
/** 自定义编辑器 */
|
|
50
|
+
customEditors?: Record<string, any>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* API 方法返回值
|
|
54
|
+
*/
|
|
55
|
+
export interface CellInfo {
|
|
56
|
+
col: number;
|
|
57
|
+
row: number;
|
|
58
|
+
value: any;
|
|
59
|
+
}
|
package/data.d.ts
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableSheet 统一导出
|
|
3
|
+
* 支持多种技术栈:Vue 2/3、原生 JS、Web Component
|
|
4
|
+
*/
|
|
5
|
+
export type { TableSheetConfig, SheetConfig, EditorConfig, CellInfo, } from './core/types';
|
|
6
|
+
export { loadExcelFromUrl, parseExcelFile, parseExcelBuffer, fetchExcelFromUrl, } from './core/ExcelUtils';
|
|
7
|
+
export type { ExcelParseOptions, ExcelParseResult, CellStyle, } from './core/ExcelUtils';
|
|
8
|
+
export { SlTableSheet as default } from './core/SlTableSheet';
|
package/index.umd.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 国际化配置
|
|
3
|
+
*/
|
|
4
|
+
export type LocaleType = 'zh-CN' | 'en-US' | 'zh-TW';
|
|
5
|
+
export interface I18nMessages {
|
|
6
|
+
toolbar: {
|
|
7
|
+
title: string;
|
|
8
|
+
unit: string;
|
|
9
|
+
total: string;
|
|
10
|
+
hint: string;
|
|
11
|
+
buttons: {
|
|
12
|
+
search: string;
|
|
13
|
+
freeze: {
|
|
14
|
+
label: string;
|
|
15
|
+
suffix: string;
|
|
16
|
+
};
|
|
17
|
+
list: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
dialog: {
|
|
21
|
+
find: {
|
|
22
|
+
label: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
};
|
|
25
|
+
replace: {
|
|
26
|
+
label: string;
|
|
27
|
+
placeholder: string;
|
|
28
|
+
};
|
|
29
|
+
checkbox: {
|
|
30
|
+
selectedOnly: string;
|
|
31
|
+
};
|
|
32
|
+
buttons: {
|
|
33
|
+
close: string;
|
|
34
|
+
findPrev: string;
|
|
35
|
+
findNext: string;
|
|
36
|
+
replaceOne: string;
|
|
37
|
+
replaceAll: string;
|
|
38
|
+
};
|
|
39
|
+
messages: {
|
|
40
|
+
pleaseInputFind: string;
|
|
41
|
+
notConnected: string;
|
|
42
|
+
pleaseSelectColumns: string;
|
|
43
|
+
noMatchFound: string;
|
|
44
|
+
nothingToReplace: string;
|
|
45
|
+
replacedOne: string;
|
|
46
|
+
replacedAll: string;
|
|
47
|
+
};
|
|
48
|
+
result: {
|
|
49
|
+
found: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
sheet: {
|
|
53
|
+
defaultTitle: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
declare const zhCN: I18nMessages;
|
|
57
|
+
declare const zhTW: I18nMessages;
|
|
58
|
+
declare const enUS: I18nMessages;
|
|
59
|
+
/**
|
|
60
|
+
* 获取当前语言
|
|
61
|
+
*/
|
|
62
|
+
export declare function getCurrentLocale(): LocaleType;
|
|
63
|
+
/**
|
|
64
|
+
* 设置当前语言
|
|
65
|
+
*/
|
|
66
|
+
export declare function setLocale(locale: LocaleType): void;
|
|
67
|
+
/**
|
|
68
|
+
* 获取国际化消息
|
|
69
|
+
*/
|
|
70
|
+
export declare function getMessages(): I18nMessages;
|
|
71
|
+
/**
|
|
72
|
+
* 格式化消息(支持简单的变量替换)
|
|
73
|
+
*/
|
|
74
|
+
export declare function formatMessage(template: string, params?: Record<string, any>): string;
|
|
75
|
+
/**
|
|
76
|
+
* 获取指定路径的消息
|
|
77
|
+
*/
|
|
78
|
+
export declare function getMessage(path: string, params?: Record<string, any>): string;
|
|
79
|
+
export { zhCN, enUS, zhTW };
|
|
80
|
+
declare const _default: {
|
|
81
|
+
getCurrentLocale: typeof getCurrentLocale;
|
|
82
|
+
setLocale: typeof setLocale;
|
|
83
|
+
getMessages: typeof getMessages;
|
|
84
|
+
getMessage: typeof getMessage;
|
|
85
|
+
formatMessage: typeof formatMessage;
|
|
86
|
+
};
|
|
87
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sl-material/sl-table-sheet",
|
|
3
|
+
"version": "1.0.0-beta0",
|
|
4
|
+
"description": "VTable 组件库 - 支持 npm 和 UMD",
|
|
5
|
+
"main": "./sl-table-sheet.cjs.js",
|
|
6
|
+
"module": "./sl-table-sheet.es.js",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./sl-table-sheet.es.js",
|
|
11
|
+
"require": "./sl-table-sheet.cjs.js",
|
|
12
|
+
"types": "./index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./style.css": "./style.css"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"spreadsheet",
|
|
18
|
+
"typescript",
|
|
19
|
+
"javascript"
|
|
20
|
+
],
|
|
21
|
+
"author": "",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@sl-ui-pc/theme-chalk": "0.1.0-beta1",
|
|
25
|
+
"@visactor/vtable-editors": "^1.22.9",
|
|
26
|
+
"@visactor/vtable-sheet": "^1.22.9",
|
|
27
|
+
"xlsx": "^0.18.5"
|
|
28
|
+
}
|
|
29
|
+
}
|