x-print-designer 0.4.3 → 0.4.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.
- package/dist/{JsBarcode-Cdqyc2Rx.js → JsBarcode-C3c1Ipa5.js} +1 -1
- package/dist/{browser-D-hIIJSf.js → browser-D--cgW-O.js} +1 -1
- package/dist/{dom-to-image-more.min-DjWj_uYS.js → dom-to-image-more.min-CDbj39ai.js} +1 -1
- package/dist/{index-UnpbgLp3.js → index-CtL7YCyv.js} +1 -1
- package/dist/{index.es-Ca0Bzx0-.js → index.es-CuEH7TJh.js} +1 -1
- package/dist/{jspdf.es.min-0GZj5fjj.js → jspdf.es.min-3aGgCa13.js} +1 -1
- package/dist/{jszip.min-CvI76dWo.js → jszip.min-D_NGlZGC.js} +1 -1
- package/dist/print-designer.css +1 -1
- package/dist/print-designer.es.js +1 -1
- package/dist/print-designer.umd.js +39 -39
- package/dist/{web-component-DaiXMEJI.js → web-component-DVWETOuo.js} +3279 -3199
- package/dist/web-component.d.ts +116 -102
- package/package.json +1 -1
package/dist/web-component.d.ts
CHANGED
|
@@ -1,102 +1,116 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DesignerExportRequest,
|
|
3
|
-
DesignerPrintRequest,
|
|
4
|
-
DesignerPrintDefaults,
|
|
5
|
-
DesignerListContextMenuConfig,
|
|
6
|
-
DesignerListContextMenuItem,
|
|
7
|
-
DesignerTemplateTagResolver
|
|
8
|
-
} from './web-component';
|
|
9
|
-
import type {
|
|
10
|
-
LocalPrinterInfo,
|
|
11
|
-
RemotePrinterInfo,
|
|
12
|
-
LocalPrinterCaps,
|
|
13
|
-
RemoteClientInfo
|
|
14
|
-
} from './composables/usePrintSettings';
|
|
15
|
-
|
|
16
|
-
export type EndpointConfig = string | {
|
|
17
|
-
url: string;
|
|
18
|
-
method?: string;
|
|
19
|
-
data?: Record<string, any>;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type CrudEndpoints = {
|
|
23
|
-
baseUrl?: string;
|
|
24
|
-
templates?: {
|
|
25
|
-
list?: EndpointConfig;
|
|
26
|
-
get?: EndpointConfig;
|
|
27
|
-
upsert?: EndpointConfig;
|
|
28
|
-
delete?: EndpointConfig;
|
|
29
|
-
};
|
|
30
|
-
customElements?: {
|
|
31
|
-
list?: EndpointConfig;
|
|
32
|
-
get?: EndpointConfig;
|
|
33
|
-
upsert?: EndpointConfig;
|
|
34
|
-
delete?: EndpointConfig;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
1
|
+
import type {
|
|
2
|
+
DesignerExportRequest,
|
|
3
|
+
DesignerPrintRequest,
|
|
4
|
+
DesignerPrintDefaults,
|
|
5
|
+
DesignerListContextMenuConfig,
|
|
6
|
+
DesignerListContextMenuItem,
|
|
7
|
+
DesignerTemplateTagResolver
|
|
8
|
+
} from './web-component';
|
|
9
|
+
import type {
|
|
10
|
+
LocalPrinterInfo,
|
|
11
|
+
RemotePrinterInfo,
|
|
12
|
+
LocalPrinterCaps,
|
|
13
|
+
RemoteClientInfo
|
|
14
|
+
} from './composables/usePrintSettings';
|
|
15
|
+
|
|
16
|
+
export type EndpointConfig = string | {
|
|
17
|
+
url: string;
|
|
18
|
+
method?: string;
|
|
19
|
+
data?: Record<string, any>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type CrudEndpoints = {
|
|
23
|
+
baseUrl?: string;
|
|
24
|
+
templates?: {
|
|
25
|
+
list?: EndpointConfig;
|
|
26
|
+
get?: EndpointConfig;
|
|
27
|
+
upsert?: EndpointConfig;
|
|
28
|
+
delete?: EndpointConfig;
|
|
29
|
+
};
|
|
30
|
+
customElements?: {
|
|
31
|
+
list?: EndpointConfig;
|
|
32
|
+
get?: EndpointConfig;
|
|
33
|
+
upsert?: EndpointConfig;
|
|
34
|
+
delete?: EndpointConfig;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type DesignerFieldDictionaryItem = {
|
|
38
|
+
fieldKey?: string;
|
|
39
|
+
key?: string;
|
|
40
|
+
fieldType?: string;
|
|
41
|
+
label?: string;
|
|
42
|
+
labelCn?: string;
|
|
43
|
+
labelEn?: string;
|
|
44
|
+
moduleKey?: string;
|
|
45
|
+
moduleName?: string;
|
|
46
|
+
primaryKey?: boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type DesignerFieldDictionary = Record<string, DesignerFieldDictionaryItem | string | null | undefined>;
|
|
50
|
+
|
|
51
|
+
export interface PrintDesignerElement extends HTMLElement {
|
|
52
|
+
print(request?: DesignerPrintRequest): Promise<void>;
|
|
53
|
+
export(request: DesignerExportRequest): Promise<void | Blob>;
|
|
54
|
+
setPrintDefaults(payload?: DesignerPrintDefaults): void;
|
|
55
|
+
fetchLocalPrinters(): Promise<LocalPrinterInfo[]>;
|
|
56
|
+
fetchLocalPrinterCaps(printer: string): Promise<LocalPrinterCaps | undefined>;
|
|
57
|
+
fetchRemotePrinters(clientId?: string): Promise<RemotePrinterInfo[]>;
|
|
58
|
+
fetchRemoteClients(): Promise<RemoteClientInfo[]>;
|
|
59
|
+
|
|
60
|
+
setBranding(payload?: { title?: string; logoUrl?: string; showTitle?: boolean; showLogo?: boolean }): void;
|
|
61
|
+
setBrandVars(vars: Record<string, string>, options?: { persist?: boolean }): void;
|
|
62
|
+
setTheme(theme: string): void;
|
|
63
|
+
setDesignerFont(fontFamily: string, options?: { persist?: boolean }): void;
|
|
64
|
+
setLanguage(lang: 'zh' | 'en'): void;
|
|
65
|
+
getPrintQuality(): 'fast' | 'normal' | 'high' | 'ultra';
|
|
66
|
+
|
|
67
|
+
// Save callback
|
|
68
|
+
setOnSave(handler: ((payload: { id: string | null; name: string; data: Record<string, any>; isNew: boolean }) => void | Promise<void>) | null): void;
|
|
69
|
+
setAutoSave(enabled: boolean, intervalMs?: number): void;
|
|
70
|
+
setPrintQuality(quality: 'fast' | 'normal' | 'high' | 'ultra'): void;
|
|
71
|
+
|
|
72
|
+
getTestData(): Record<string, any>;
|
|
73
|
+
setTestData(data: Record<string, any>, options?: { merge?: boolean }): Promise<void>;
|
|
74
|
+
setSampleData(data: Record<string, any>): void;
|
|
75
|
+
|
|
76
|
+
getVariables(): Record<string, any>;
|
|
77
|
+
setVariables(data: Record<string, any>, options?: { merge?: boolean }): Promise<void>;
|
|
78
|
+
setTemplateVariables(data: Record<string, any>, options?: { merge?: boolean }): Promise<void>;
|
|
79
|
+
setFieldDictionary(dictionary?: DesignerFieldDictionary | null): void;
|
|
80
|
+
|
|
81
|
+
getTemplateVariables(): Record<string, any>;
|
|
82
|
+
|
|
83
|
+
getTemplateData(): any;
|
|
84
|
+
loadTemplateData(data: any): boolean;
|
|
85
|
+
|
|
86
|
+
getTemplates(options?: { includeData?: boolean }): Array<{ id: string; name: string; updatedAt: number } | any>;
|
|
87
|
+
refreshTemplates(options?: { includeData?: boolean }): Promise<Array<{ id: string; name: string; updatedAt: number } | any>>;
|
|
88
|
+
getTemplate(id: string): any | null;
|
|
89
|
+
upsertTemplate(template: { id?: string; name: string; data?: any; updatedAt?: number; [key: string]: any }, options?: { setCurrent?: boolean }): Promise<string | null>;
|
|
90
|
+
setTemplates(templates: Array<{ id: string; name: string; data?: any; updatedAt?: number; [key: string]: any }>, options?: { currentTemplateId?: string }): void;
|
|
91
|
+
deleteTemplate(id: string, options?: { confirm?: boolean }): Promise<void>;
|
|
92
|
+
loadTemplate(id: string): boolean;
|
|
93
|
+
|
|
94
|
+
getCustomElements(options?: { includeElement?: boolean }): Array<{ id: string; name: string } | any>;
|
|
95
|
+
refreshCustomElements(options?: { includeElement?: boolean }): Promise<Array<{ id: string; name: string } | any>>;
|
|
96
|
+
upsertCustomElement(customElement: { id?: string; name: string; element: any; [key: string]: any }): Promise<string | null>;
|
|
97
|
+
setCustomElements(customElements: Array<{ id: string; name: string; element: any; [key: string]: any }>): void;
|
|
98
|
+
deleteCustomElement(id: string, options?: { confirm?: boolean }): Promise<void>;
|
|
99
|
+
setTemplateContextMenu(config: DesignerListContextMenuConfig | DesignerListContextMenuItem[]): void;
|
|
100
|
+
clearTemplateContextMenu(): void;
|
|
101
|
+
setCustomElementContextMenu(config: DesignerListContextMenuConfig | DesignerListContextMenuItem[]): void;
|
|
102
|
+
clearCustomElementContextMenu(): void;
|
|
103
|
+
setTemplateTagResolver(resolver: DesignerTemplateTagResolver): void;
|
|
104
|
+
clearTemplateTagResolver(): void;
|
|
105
|
+
|
|
106
|
+
setCrudMode(mode: 'local' | 'remote'): void;
|
|
107
|
+
setCrudEndpoints(endpoints: CrudEndpoints, options?: { baseUrl?: string; headers?: Record<string, string>; fetcher?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }): void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare global {
|
|
111
|
+
interface HTMLElementTagNameMap {
|
|
112
|
+
'print-designer': PrintDesignerElement;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {};
|