operp-print-designer 1.0.7 → 1.0.9

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,8 @@
1
+ import React from 'react';
2
+ /** 简易条形码渲染组件(使用Canvas绘制) */
3
+ interface BarcodeProps {
4
+ value: string;
5
+ format: string;
6
+ }
7
+ declare const Barcode: React.FC<BarcodeProps>;
8
+ export default Barcode;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import 'react-grid-layout/css/styles.css';
3
+ import 'react-resizable/css/styles.css';
4
+ declare const Canvas: React.FC<{
5
+ isPreview?: boolean;
6
+ }>;
7
+ export default Canvas;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ComponentPanel: React.FC;
3
+ export default ComponentPanel;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const DataSourcePanel: React.FC;
3
+ export default DataSourcePanel;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const HeaderFooterDialog: React.FC;
3
+ export default HeaderFooterDialog;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const LeftPanel: React.FC;
3
+ export default LeftPanel;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PageSettings: React.FC;
3
+ export default PageSettings;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { TemplateData } from '../../types';
3
+ export interface PrintDesignerProps {
4
+ /** 是否为预览模式(只读) */
5
+ isPreview?: boolean;
6
+ /** 初始模板数据 */
7
+ initialTemplateData?: TemplateData;
8
+ /** 保存回调 */
9
+ onSave?: (templateData: TemplateData) => void;
10
+ /** 打印回调 */
11
+ onPrint?: () => void;
12
+ }
13
+ declare const PrintDesigner: React.FC<PrintDesignerProps>;
14
+ export default PrintDesigner;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PrintPreview: React.FC;
3
+ export default PrintPreview;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PropertyPanel: React.FC;
3
+ export default PropertyPanel;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface ToolbarProps {
3
+ /** 自定义保存回调 */
4
+ onCustomSave?: () => void;
5
+ /** 自定义打印回调 */
6
+ onCustomPrint?: () => void;
7
+ }
8
+ declare const Toolbar: React.FC<ToolbarProps>;
9
+ export default Toolbar;
@@ -0,0 +1,67 @@
1
+ import { PaperSizePreset } from '../types';
2
+ /** 纸张预设尺寸 - 宽高 mm (portrait) */
3
+ export declare const PAPER_SIZES: Record<Exclude<PaperSizePreset, 'custom'>, {
4
+ width: number;
5
+ height: number;
6
+ }>;
7
+ /** 默认页面设置 */
8
+ export declare const DEFAULT_PAGE_SETTINGS: {
9
+ paperSize: PaperSizePreset;
10
+ customWidth: number;
11
+ customHeight: number;
12
+ orientation: "portrait";
13
+ marginTop: number;
14
+ marginRight: number;
15
+ marginBottom: number;
16
+ marginLeft: number;
17
+ showHeader: boolean;
18
+ headerContent: string;
19
+ showFooter: boolean;
20
+ footerContent: string;
21
+ showPageNumber: boolean;
22
+ pageNumberFormat: string;
23
+ };
24
+ /** 缩放系数: 1mm 对应的像素 */
25
+ export declare const MM_TO_PX_RATIO = 3;
26
+ /** 默认网格设置 */
27
+ export declare const DEFAULT_GRID_SETTINGS: {
28
+ cellSize: number;
29
+ cols: number;
30
+ };
31
+ /** 组件类型中文名 */
32
+ export declare const COMPONENT_TYPE_LABELS: Record<string, string>;
33
+ /** 组件类型默认属性 */
34
+ export declare const COMPONENT_DEFAULTS: {
35
+ text: {
36
+ content: string;
37
+ fontSize: number;
38
+ fontWeight: "normal";
39
+ fontStyle: "normal";
40
+ textAlign: "left";
41
+ color: string;
42
+ backgroundColor: string;
43
+ };
44
+ image: {
45
+ src: string;
46
+ fit: "contain";
47
+ content: string;
48
+ };
49
+ table: {
50
+ rows: number;
51
+ cols: number;
52
+ borderWidth: number;
53
+ borderColor: string;
54
+ content: string;
55
+ };
56
+ barcode: {
57
+ value: string;
58
+ format: "CODE128";
59
+ content: string;
60
+ };
61
+ line: {
62
+ color: string;
63
+ thickness: number;
64
+ style: "solid";
65
+ content: string;
66
+ };
67
+ };
@@ -0,0 +1,7 @@
1
+ import PrintDesigner from './components/PrintDesigner';
2
+ export default PrintDesigner;
3
+ export { PrintDesigner };
4
+ export type { PrintDesignerProps } from './components/PrintDesigner';
5
+ export type { CanvasComponent, CanvasComponentType, PageSettings, GridSettings, TemplateData, DataSource, DataSourceType, TableColumnConfig, DataBinding, DataBindingConfig, } from './types';
6
+ export { getRenderValue, getObjectFromDataSource, getArrayFromDataSource, safeParseJSON, getValueByPath, } from './utils/dataHelper';
7
+ export { useDesignerStore } from './store';