@borurio-print/print-designer 1.0.2 → 1.0.4

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.
Files changed (43) hide show
  1. package/README.md +130 -128
  2. package/dist-lib/PrintDesigner.vue.d.ts +26 -1
  3. package/dist-lib/core/componentRegistry.d.ts +5 -2
  4. package/dist-lib/core/dataResolver.d.ts +6 -0
  5. package/dist-lib/core/pdfPageRenderer.d.ts +4 -0
  6. package/dist-lib/core/printPagination.d.ts +9 -0
  7. package/dist-lib/core/textBoxLayout.d.ts +13 -0
  8. package/dist-lib/core/types.d.ts +191 -5
  9. package/dist-lib/iconfont-DUQHAX2j.js +35 -0
  10. package/dist-lib/index-1josbkwh.js +10777 -0
  11. package/dist-lib/index.d.ts +13 -2
  12. package/dist-lib/{index.es-BwhKze_p.js → index.es-Cyq100NQ.js} +2 -2
  13. package/dist-lib/index.js +1 -1
  14. package/dist-lib/locales/en-US.d.ts +120 -0
  15. package/dist-lib/locales/zh-CN.d.ts +120 -0
  16. package/dist-lib/pdf-BS8Eyhri.js +19080 -0
  17. package/dist-lib/{pdfGenerator-cShpHBr8.js → pdfGenerator-CNTPnLGu.js} +1299 -1238
  18. package/dist-lib/style.css +1 -1
  19. package/dist-lib/views/print-designer/components/BarcodeSvgElement.vue.d.ts +2 -0
  20. package/dist-lib/views/print-designer/components/ComponentPanel.vue.d.ts +10 -4
  21. package/dist-lib/views/print-designer/components/ElementListPanel.vue.d.ts +7 -1
  22. package/dist-lib/views/print-designer/components/ElementPropertiesPanel.vue.d.ts +2 -0
  23. package/dist-lib/views/print-designer/components/ImageSvgElement.vue.d.ts +11 -0
  24. package/dist-lib/views/print-designer/components/PdfPagesRenderer.vue.d.ts +2 -3
  25. package/dist-lib/views/print-designer/components/PdfSvgElement.vue.d.ts +11 -0
  26. package/dist-lib/views/print-designer/components/QrcodeSvgElement.vue.d.ts +2 -0
  27. package/dist-lib/views/print-designer/components/SvgElementsRenderer.vue.d.ts +6 -2
  28. package/dist-lib/views/print-designer/components/TableSvgElement.vue.d.ts +12 -0
  29. package/dist-lib/views/print-designer/components/TemplateInfoPanel.vue.d.ts +2 -1
  30. package/dist-lib/views/print-designer/components/TextBoxSvgElement.vue.d.ts +15 -0
  31. package/dist-lib/views/print-designer/components/WorkspaceToolbar.vue.d.ts +4 -0
  32. package/dist-lib/views/print-designer/components/properties/DisplayTypeProperty.vue.d.ts +12 -0
  33. package/dist-lib/views/print-designer/components/properties/LineHeightProperty.vue.d.ts +12 -0
  34. package/dist-lib/views/print-designer/components/properties/MinFontSizeProperty.vue.d.ts +12 -0
  35. package/dist-lib/views/print-designer/components/properties/PdfCropModeProperty.vue.d.ts +12 -0
  36. package/dist-lib/views/print-designer/components/properties/PdfCropRatioProperty.vue.d.ts +12 -0
  37. package/dist-lib/views/print-designer/components/properties/PositionProperty.vue.d.ts +12 -0
  38. package/dist-lib/views/print-designer/components/properties/TableConfigProperty.vue.d.ts +12 -0
  39. package/dist-lib/views/print-designer/components/properties/TextBoxFitModeProperty.vue.d.ts +12 -0
  40. package/dist-lib/views/print-designer/components/properties/TextBoxOverflowModeProperty.vue.d.ts +12 -0
  41. package/package.json +14 -9
  42. package/dist-lib/iconfont-BnrPP-u4.js +0 -35
  43. package/dist-lib/index-B7uQiXj_.js +0 -6971
@@ -1,10 +1,21 @@
1
1
  import './designer.css';
2
2
  import type { DefineComponent } from 'vue';
3
+ import type { BusinessFieldGroup, PrintResult } from './core/types';
3
4
  /**
4
5
  * 公共组件类型仅使用 Vue 3.2 已经提供的 DefineComponent 签名。
5
6
  * 这样业务项目不会被生成声明中 Vue 3.5 新增的内部类型强制升级。
6
7
  */
7
- export type PrintDesignerComponent = DefineComponent<object, object, any>;
8
+ export interface PrintDesignerProps {
9
+ fieldGroups?: readonly BusinessFieldGroup[];
10
+ onPrintResult?: (result: PrintResult) => void;
11
+ }
12
+ export interface PrintDesignerExpose {
13
+ getTemplate: () => import('./core/types').PrintTemplate;
14
+ loadTemplate: (template: import('./core/types').PrintTemplate) => void;
15
+ generatePdf: (data: unknown) => Promise<Blob>;
16
+ previewPdf: (data: unknown) => Promise<void>;
17
+ }
18
+ export type PrintDesignerComponent = DefineComponent<PrintDesignerProps, object, any>;
8
19
  export interface IconFontProps {
9
20
  name: string;
10
21
  size?: number | string;
@@ -17,4 +28,4 @@ export { default as enUS } from './locales/en-US';
17
28
  export { default as zhCN } from './locales/zh-CN';
18
29
  export { formatDesignerDate, formatDesignerDateTime, isTextStyleElement, resolveDesignerText, } from './core/dynamicText';
19
30
  export type { DynamicTextContext } from './core/dynamicText';
20
- export type { BarcodeDesignerElement, BaseDesignerElement, DesignerElement, DesignerElementType, DynamicTextBaseDesignerElement, ElementPropertyConfig, ElementPropertyKey, ElementPropertyValue, ElementTransformPatch, LineDesignerElement, PageNumberDesignerElement, QrcodeDesignerElement, RectangleDesignerElement, ResizeHandle, SerialNumberDesignerElement, TemplateInfo, TemplateSize, TextDesignerElement, TextStyleDesignerElement, TimeDesignerElement, TimeMode, } from './core/types';
31
+ export type { BarcodeDesignerElement, BaseDesignerElement, BusinessField, BusinessFieldGroup, DesignerElement, DesignerElementType, DynamicTextBaseDesignerElement, ElementPropertyConfig, ElementPropertyKey, ElementPropertyValue, ElementTransformPatch, FieldElementType, ImageDesignerElement, LineDesignerElement, PageNumberDesignerElement, PdfCropMode, PdfDesignerElement, PrintTemplate, PrintRenderPage, PrintResult, QrcodeDesignerElement, RectangleDesignerElement, ResizeHandle, SerialNumberDesignerElement, TableColumn, TableColumnAlign, TableColumnType, TableColumnWidthMode, TableConfigValue, TableDesignerElement, TableGroupHeaderCell, TableMode, TableRuntimeData, TableRuntimeGroup, TemplateInfo, TemplateMode, TemplatePage, TemplateSize, TextBoxDesignerElement, TextBoxFitMode, TextBoxOverflowMode, TextDesignerElement, TextStyleDesignerElement, TimeDesignerElement, TimeMode, } from './core/types';
@@ -1,5 +1,5 @@
1
- import { c as Ta, g as Hu } from "./index-B7uQiXj_.js";
2
- import { _ as Ea } from "./pdfGenerator-cShpHBr8.js";
1
+ import { c as Ta, g as Hu } from "./index-1josbkwh.js";
2
+ import { _ as Ea } from "./pdfGenerator-CNTPnLGu.js";
3
3
  var Ja = {}, en = {}, ir, rn;
4
4
  function Q() {
5
5
  if (rn) return ir;
package/dist-lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as a, P as r, e as t, f as n, a as i, i as o, r as D, z as m } from "./index-B7uQiXj_.js";
1
+ import { I as a, P as r, e as t, f as n, a as i, i as o, r as D, z as m } from "./index-1josbkwh.js";
2
2
  export {
3
3
  a as IconFont,
4
4
  r as PrintDesigner,
@@ -4,6 +4,11 @@ declare const _default: {
4
4
  title: string;
5
5
  edit: string;
6
6
  name: string;
7
+ templateType: string;
8
+ singleTemplate: string;
9
+ dualTemplate: string;
10
+ firstTemplate: string;
11
+ continuationTemplate: string;
7
12
  size: string;
8
13
  dialogTitle: string;
9
14
  namePlaceholder: string;
@@ -17,6 +22,11 @@ declare const _default: {
17
22
  nameMaxLength: string;
18
23
  sizeRange: string;
19
24
  };
25
+ quickSizes: string;
26
+ quickSize50x30: string;
27
+ quickSize100x100: string;
28
+ quickSize100x150: string;
29
+ quickSizeA4: string;
20
30
  };
21
31
  components: {
22
32
  title: string;
@@ -29,6 +39,11 @@ declare const _default: {
29
39
  serialNumber: string;
30
40
  time: string;
31
41
  pageNumber: string;
42
+ table: string;
43
+ advancedTitle: string;
44
+ image: string;
45
+ pdf: string;
46
+ textBox: string;
32
47
  };
33
48
  toolbar: {
34
49
  showGrid: string;
@@ -40,12 +55,25 @@ declare const _default: {
40
55
  reset: string;
41
56
  resetTitle: string;
42
57
  resetConfirm: string;
58
+ save: string;
59
+ savedTemplatePlaceholder: string;
60
+ saveSuccess: string;
61
+ saveFailed: string;
62
+ loadSuccess: string;
63
+ loadFailed: string;
64
+ testPrint: string;
65
+ packingListMissing: string;
66
+ printFailed: string;
67
+ clipboard: string;
68
+ paste: string;
43
69
  };
44
70
  properties: {
45
71
  title: string;
46
72
  empty: string;
47
73
  content: string;
48
74
  contentPlaceholder: string;
75
+ x: string;
76
+ y: string;
49
77
  width: string;
50
78
  height: string;
51
79
  fontSize: string;
@@ -62,15 +90,107 @@ declare const _default: {
62
90
  includeTime: string;
63
91
  fixedDatePlaceholder: string;
64
92
  fixedDateTimePlaceholder: string;
93
+ displayType: string;
94
+ tableConfig: string;
95
+ tableField: string;
96
+ tableFieldPlaceholder: string;
97
+ tableShowHeader: string;
98
+ tableShowBorder: string;
99
+ tablePreviewRows: string;
100
+ tableColumn: string;
101
+ tableColumnTitle: string;
102
+ tableColumnFieldPlaceholder: string;
103
+ tableColumnContent: string;
104
+ tableColumnWidthRatio: string;
105
+ tableColumnWidthMode: string;
106
+ tableAutoWidth: string;
107
+ tableFixedWidth: string;
108
+ tableColumnWidth: string;
109
+ tableColumnMinWidth: string;
110
+ tableColumnAlign: string;
111
+ tableAlignLeft: string;
112
+ tableAlignCenter: string;
113
+ tableAlignRight: string;
114
+ tableAddColumn: string;
115
+ tableDeleteColumn: string;
116
+ imageSource: string;
117
+ imageSourcePlaceholder: string;
118
+ tableColumnType: string;
119
+ tableColumnTypeText: string;
120
+ tableColumnTypeSerialNumber: string;
121
+ tableColumnTypeImage: string;
122
+ tableColumnImageContent: string;
123
+ tableHeaderBackground: string;
124
+ tableHeaderRowHeight: string;
125
+ tableBodyRowHeight: string;
126
+ tableColumnGroupTitle: string;
127
+ tableColumnHeaderAlign: string;
128
+ tableColumnCellAlign: string;
129
+ tableMode: string;
130
+ tableModeNormal: string;
131
+ tableModeGroupedDetail: string;
132
+ tableGroupField: string;
133
+ tableGroupFieldPlaceholder: string;
134
+ tableDetailField: string;
135
+ tableDetailFieldPlaceholder: string;
136
+ tableRepeatHeader: string;
137
+ tableGroupHeaderRowHeight: string;
138
+ tablePreviewGroups: string;
139
+ tableGroupHeaderCells: string;
140
+ tableGroupHeaderCell: string;
141
+ tableGroupHeaderCellContent: string;
142
+ tableGroupHeaderCellFieldPlaceholder: string;
143
+ tableGroupHeaderCellAlign: string;
144
+ tableAddGroupHeaderCell: string;
145
+ tableDetailColumns: string;
146
+ canvasAlignment: string;
147
+ horizontalAlignment: string;
148
+ verticalAlignment: string;
149
+ alignCanvasLeft: string;
150
+ alignCanvasHorizontalCenter: string;
151
+ alignCanvasRight: string;
152
+ alignCanvasTop: string;
153
+ alignCanvasVerticalCenter: string;
154
+ alignCanvasBottom: string;
155
+ alignLeftShort: string;
156
+ alignCenterShort: string;
157
+ alignRightShort: string;
158
+ alignTopShort: string;
159
+ alignMiddleShort: string;
160
+ alignBottomShort: string;
161
+ pdfSource: string;
162
+ pdfSourcePlaceholder: string;
163
+ pdfCropMode: string;
164
+ pdfCropNone: string;
165
+ pdfCropCurrentSize: string;
166
+ pdfCropScale: string;
167
+ pdfCropWidth: string;
168
+ pdfCropHeight: string;
169
+ pdfCropRatio: string;
170
+ textBoxFitMode: string;
171
+ textBoxFitFixed: string;
172
+ textBoxFitShrinkFont: string;
173
+ textBoxOverflowMode: string;
174
+ textBoxOverflowClip: string;
175
+ textBoxOverflowEllipsis: string;
176
+ lineHeight: string;
177
+ minFontSize: string;
65
178
  };
66
179
  elementDefaults: {
67
180
  textContent: string;
68
181
  qrcodeContent: string;
69
182
  barcodeContent: string;
183
+ tableColumnTitle: string;
184
+ tableCellContent: string;
185
+ tableGroupIndexContent: string;
186
+ tableGroupLabelContent: string;
187
+ tableGroupValueContent: string;
188
+ textBoxContent: string;
70
189
  };
71
190
  elementList: {
72
191
  title: string;
73
192
  delete: string;
193
+ copy: string;
74
194
  };
75
195
  preview: {
76
196
  title: string;
@@ -4,6 +4,11 @@ declare const _default: {
4
4
  title: string;
5
5
  edit: string;
6
6
  name: string;
7
+ templateType: string;
8
+ singleTemplate: string;
9
+ dualTemplate: string;
10
+ firstTemplate: string;
11
+ continuationTemplate: string;
7
12
  size: string;
8
13
  dialogTitle: string;
9
14
  namePlaceholder: string;
@@ -17,6 +22,11 @@ declare const _default: {
17
22
  nameMaxLength: string;
18
23
  sizeRange: string;
19
24
  };
25
+ quickSizes: string;
26
+ quickSize50x30: string;
27
+ quickSize100x100: string;
28
+ quickSize100x150: string;
29
+ quickSizeA4: string;
20
30
  };
21
31
  components: {
22
32
  title: string;
@@ -29,6 +39,11 @@ declare const _default: {
29
39
  serialNumber: string;
30
40
  time: string;
31
41
  pageNumber: string;
42
+ table: string;
43
+ advancedTitle: string;
44
+ image: string;
45
+ pdf: string;
46
+ textBox: string;
32
47
  };
33
48
  toolbar: {
34
49
  showGrid: string;
@@ -40,12 +55,25 @@ declare const _default: {
40
55
  reset: string;
41
56
  resetTitle: string;
42
57
  resetConfirm: string;
58
+ save: string;
59
+ savedTemplatePlaceholder: string;
60
+ saveSuccess: string;
61
+ saveFailed: string;
62
+ loadSuccess: string;
63
+ loadFailed: string;
64
+ testPrint: string;
65
+ packingListMissing: string;
66
+ printFailed: string;
67
+ clipboard: string;
68
+ paste: string;
43
69
  };
44
70
  properties: {
45
71
  title: string;
46
72
  empty: string;
47
73
  content: string;
48
74
  contentPlaceholder: string;
75
+ x: string;
76
+ y: string;
49
77
  width: string;
50
78
  height: string;
51
79
  fontSize: string;
@@ -62,15 +90,107 @@ declare const _default: {
62
90
  includeTime: string;
63
91
  fixedDatePlaceholder: string;
64
92
  fixedDateTimePlaceholder: string;
93
+ displayType: string;
94
+ tableConfig: string;
95
+ tableField: string;
96
+ tableFieldPlaceholder: string;
97
+ tableShowHeader: string;
98
+ tableShowBorder: string;
99
+ tablePreviewRows: string;
100
+ tableColumn: string;
101
+ tableColumnTitle: string;
102
+ tableColumnFieldPlaceholder: string;
103
+ tableColumnContent: string;
104
+ tableColumnWidthRatio: string;
105
+ tableColumnWidthMode: string;
106
+ tableAutoWidth: string;
107
+ tableFixedWidth: string;
108
+ tableColumnWidth: string;
109
+ tableColumnMinWidth: string;
110
+ tableColumnAlign: string;
111
+ tableAlignLeft: string;
112
+ tableAlignCenter: string;
113
+ tableAlignRight: string;
114
+ tableAddColumn: string;
115
+ tableDeleteColumn: string;
116
+ imageSource: string;
117
+ imageSourcePlaceholder: string;
118
+ tableColumnType: string;
119
+ tableColumnTypeText: string;
120
+ tableColumnTypeSerialNumber: string;
121
+ tableColumnTypeImage: string;
122
+ tableColumnImageContent: string;
123
+ tableHeaderBackground: string;
124
+ tableHeaderRowHeight: string;
125
+ tableBodyRowHeight: string;
126
+ tableColumnGroupTitle: string;
127
+ tableColumnHeaderAlign: string;
128
+ tableColumnCellAlign: string;
129
+ tableMode: string;
130
+ tableModeNormal: string;
131
+ tableModeGroupedDetail: string;
132
+ tableGroupField: string;
133
+ tableGroupFieldPlaceholder: string;
134
+ tableDetailField: string;
135
+ tableDetailFieldPlaceholder: string;
136
+ tableRepeatHeader: string;
137
+ tableGroupHeaderRowHeight: string;
138
+ tablePreviewGroups: string;
139
+ tableGroupHeaderCells: string;
140
+ tableGroupHeaderCell: string;
141
+ tableGroupHeaderCellContent: string;
142
+ tableGroupHeaderCellFieldPlaceholder: string;
143
+ tableGroupHeaderCellAlign: string;
144
+ tableAddGroupHeaderCell: string;
145
+ tableDetailColumns: string;
146
+ canvasAlignment: string;
147
+ horizontalAlignment: string;
148
+ verticalAlignment: string;
149
+ alignCanvasLeft: string;
150
+ alignCanvasHorizontalCenter: string;
151
+ alignCanvasRight: string;
152
+ alignCanvasTop: string;
153
+ alignCanvasVerticalCenter: string;
154
+ alignCanvasBottom: string;
155
+ alignLeftShort: string;
156
+ alignCenterShort: string;
157
+ alignRightShort: string;
158
+ alignTopShort: string;
159
+ alignMiddleShort: string;
160
+ alignBottomShort: string;
161
+ pdfSource: string;
162
+ pdfSourcePlaceholder: string;
163
+ pdfCropMode: string;
164
+ pdfCropNone: string;
165
+ pdfCropCurrentSize: string;
166
+ pdfCropScale: string;
167
+ pdfCropWidth: string;
168
+ pdfCropHeight: string;
169
+ pdfCropRatio: string;
170
+ textBoxFitMode: string;
171
+ textBoxFitFixed: string;
172
+ textBoxFitShrinkFont: string;
173
+ textBoxOverflowMode: string;
174
+ textBoxOverflowClip: string;
175
+ textBoxOverflowEllipsis: string;
176
+ lineHeight: string;
177
+ minFontSize: string;
65
178
  };
66
179
  elementDefaults: {
67
180
  textContent: string;
68
181
  qrcodeContent: string;
69
182
  barcodeContent: string;
183
+ tableColumnTitle: string;
184
+ tableCellContent: string;
185
+ tableGroupIndexContent: string;
186
+ tableGroupLabelContent: string;
187
+ tableGroupValueContent: string;
188
+ textBoxContent: string;
70
189
  };
71
190
  elementList: {
72
191
  title: string;
73
192
  delete: string;
193
+ copy: string;
74
194
  };
75
195
  preview: {
76
196
  title: string;