表格支持
This commit is contained in:
51
src/types.ts
51
src/types.ts
@@ -40,9 +40,44 @@ export const VISIBILITY_OPERATOR_LABELS: Record<VisibilityOperator, string> = {
|
||||
export type ElementSide = 'top' | 'right' | 'bottom' | 'left';
|
||||
export type ElementCorner = 'tl' | 'tr' | 'br' | 'bl';
|
||||
|
||||
/** 表格单元格数据;键为 `${row},${col}` */
|
||||
export interface TableCellData {
|
||||
/** 被合并单元格指向主单元格坐标 */
|
||||
mergeAnchor?: { row: number; col: number };
|
||||
/** 主单元格合并行数,默认 1 */
|
||||
rowSpan?: number;
|
||||
/** 主单元格合并列数,默认 1 */
|
||||
colSpan?: number;
|
||||
content?: string;
|
||||
fontSize?: number;
|
||||
textAlign?: 'left' | 'center' | 'right';
|
||||
verticalAlign?: 'top' | 'middle' | 'bottom';
|
||||
fontWeight?: 'normal' | 'bold';
|
||||
fontStyle?: 'normal' | 'italic';
|
||||
textUnderline?: boolean;
|
||||
textLineThrough?: boolean;
|
||||
textScaleX?: number;
|
||||
textScaleY?: number;
|
||||
letterSpacing?: number;
|
||||
textWritingMode?: 'horizontal' | 'vertical';
|
||||
textColor?: string;
|
||||
backgroundColor?: string;
|
||||
wordWrap?: boolean;
|
||||
fontFamily?: 'sans' | 'serif' | 'mono';
|
||||
textFormat?: TextFormat;
|
||||
decimalPlaces?: number;
|
||||
numberPartDisplay?: NumberPartDisplay;
|
||||
textExtractMode?: TextExtractMode;
|
||||
textSplitDelimiter?: string;
|
||||
textSplitIndex?: number;
|
||||
textExtractLength?: number;
|
||||
textDisplayPrefix?: string;
|
||||
textDisplaySuffix?: string;
|
||||
}
|
||||
|
||||
export interface TemplateElement {
|
||||
id: string;
|
||||
type: 'text' | 'barcode' | 'qrcode' | 'image';
|
||||
type: 'text' | 'barcode' | 'qrcode' | 'image' | 'table';
|
||||
name: string;
|
||||
x: number; // in mm
|
||||
y: number; // in mm
|
||||
@@ -137,6 +172,20 @@ export interface TemplateElement {
|
||||
borderRadiusTR?: number;
|
||||
borderRadiusBR?: number;
|
||||
borderRadiusBL?: number;
|
||||
/** 表格行数,仅 type=table */
|
||||
tableRows?: number;
|
||||
/** 表格列数,仅 type=table */
|
||||
tableCols?: number;
|
||||
/** 各行高度 (mm),仅 type=table */
|
||||
tableRowHeights?: number[];
|
||||
/** 各列宽度 (mm),仅 type=table */
|
||||
tableColWidths?: number[];
|
||||
/** 单元格数据,键 `${row},${col}`,仅 type=table */
|
||||
tableCells?: Record<string, TableCellData>;
|
||||
/** 单元格网格线宽 (mm),仅 type=table,默认 0.2 */
|
||||
tableBorderWidth?: number;
|
||||
/** 单元格网格线颜色,仅 type=table */
|
||||
tableBorderColor?: string;
|
||||
}
|
||||
|
||||
export interface DataSourceMeta {
|
||||
|
||||
Reference in New Issue
Block a user