@esvndev/es-print-template 0.0.1
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/README.md +93 -0
- package/dist/component/edit-template/component/block-content.d.ts +25 -0
- package/dist/component/edit-template/component/block-signature.d.ts +17 -0
- package/dist/component/edit-template/component/block-table.d.ts +17 -0
- package/dist/component/edit-template/component/input-number.d.ts +18 -0
- package/dist/component/edit-template/component/select-field.d.ts +24 -0
- package/dist/component/edit-template/component/select-signature.d.ts +12 -0
- package/dist/component/edit-template/component/select-table-feld-component.d.ts +18 -0
- package/dist/component/edit-template/component/select-table.d.ts +17 -0
- package/dist/component/edit-template/component/setting-content.d.ts +16 -0
- package/dist/component/edit-template/component/setting-element/date.d.ts +9 -0
- package/dist/component/edit-template/component/setting-element/format.d.ts +11 -0
- package/dist/component/edit-template/component/setting-element/image.d.ts +12 -0
- package/dist/component/edit-template/component/setting-layout.d.ts +19 -0
- package/dist/component/edit-template/component/setting-page/index.d.ts +10 -0
- package/dist/component/edit-template/component/setting-page/setting-image.d.ts +11 -0
- package/dist/component/edit-template/component/setting-page/upload-image.d.ts +19 -0
- package/dist/component/edit-template/component/sidebar.d.ts +24 -0
- package/dist/component/edit-template/component/toolbar.d.ts +33 -0
- package/dist/component/edit-template/hooks/constant.d.ts +25 -0
- package/dist/component/edit-template/hooks/fonts.d.ts +4 -0
- package/dist/component/edit-template/hooks/index.d.ts +4 -0
- package/dist/component/edit-template/hooks/isNullOrUndefined.d.ts +2 -0
- package/dist/component/edit-template/hooks/useOnClickOutside.d.ts +1 -0
- package/dist/component/edit-template/hooks/utils.d.ts +122 -0
- package/dist/component/edit-template/icon/index.d.ts +2 -0
- package/dist/component/edit-template/index.d.ts +23 -0
- package/dist/component/edit-template/style/Style.d.ts +29 -0
- package/dist/component/edit-template/type/index.d.ts +2 -0
- package/dist/component/edit-template/type/print-type.d.ts +293 -0
- package/dist/component/edit-template/type/type-data.d.ts +32 -0
- package/dist/component/input/input-text/index.d.ts +35 -0
- package/dist/component/modal/index.d.ts +106 -0
- package/dist/component/modal/modal-edit-tempate.d.ts +21 -0
- package/dist/component/modal/modal-print-options.d.ts +33 -0
- package/dist/component/modal/modal.d.ts +36 -0
- package/dist/component/modal/sidebar-fields.d.ts +10 -0
- package/dist/component/modal/tab-select-file.d.ts +9 -0
- package/dist/component/modal-header/index.d.ts +10 -0
- package/dist/component/sidebar/index.d.ts +11 -0
- package/dist/index.d.ts +445 -0
- package/dist/index.js +92194 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +92168 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles/index.css +128 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/layout.css +29 -0
- package/dist/styles/layout.css.map +1 -0
- package/dist/styles/select-background.css +34 -0
- package/dist/styles/select-background.css.map +1 -0
- package/dist/styles/tab.css +20 -0
- package/dist/styles/tab.css.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ITextAlign, ITypeEdit } from "../type";
|
|
2
|
+
export declare const TextStyle: import("styled-components").StyledComponent<"span", any, {
|
|
3
|
+
bold?: boolean;
|
|
4
|
+
fontFamily?: string;
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
italic?: boolean;
|
|
8
|
+
underline?: boolean;
|
|
9
|
+
textAlign?: ITextAlign;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
}, never>;
|
|
12
|
+
export declare const UploadStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const LabelStyle: import("styled-components").StyledComponent<"span", any, {
|
|
14
|
+
bold?: boolean;
|
|
15
|
+
fontFamily?: string;
|
|
16
|
+
fontSize?: number;
|
|
17
|
+
color?: string;
|
|
18
|
+
italic?: boolean;
|
|
19
|
+
underline?: boolean;
|
|
20
|
+
textAlign?: ITextAlign;
|
|
21
|
+
isActive?: boolean;
|
|
22
|
+
}, never>;
|
|
23
|
+
export declare const SectionContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
|
+
export declare const EditTemplateStyle: import("styled-components").StyledComponent<"div", any, {
|
|
25
|
+
height?: number | string;
|
|
26
|
+
}, never>;
|
|
27
|
+
export declare const TemplatePaper: import("styled-components").StyledComponent<"div", any, {
|
|
28
|
+
type: ITypeEdit;
|
|
29
|
+
}, never>;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { DataRecord, IBorder, ITextAlign } from "./type-data";
|
|
2
|
+
export type ITypeEdit = "layout" | "section";
|
|
3
|
+
export interface IFPrintDocumentLayoutDisplay {
|
|
4
|
+
i: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
h: number;
|
|
8
|
+
w: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
minW?: number;
|
|
11
|
+
minH?: number;
|
|
12
|
+
maxW?: number;
|
|
13
|
+
static?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface IFOrganization {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
address: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IFPrintDocFile {
|
|
21
|
+
name: string;
|
|
22
|
+
path: string;
|
|
23
|
+
size: number;
|
|
24
|
+
title: string;
|
|
25
|
+
type: string;
|
|
26
|
+
tableFields: string[];
|
|
27
|
+
virtualPath: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Đại diện cho một tài liệu in
|
|
31
|
+
*/
|
|
32
|
+
export interface IFPrintDocument {
|
|
33
|
+
/** ID tài liệu (tùy chọn) */
|
|
34
|
+
id?: string;
|
|
35
|
+
/** Tên tài liệu */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Loại tài liệu */
|
|
38
|
+
type: string;
|
|
39
|
+
/** Mã chức năng tài liệu */
|
|
40
|
+
resourceCode: string;
|
|
41
|
+
/** Có phải tài liệu mặc định không (tùy chọn) */
|
|
42
|
+
isDefault?: boolean;
|
|
43
|
+
/** Cấu hình tài liệu in bằng file*/
|
|
44
|
+
file?: IFPrintDocFile;
|
|
45
|
+
/** Cấu hình tài liệu in */
|
|
46
|
+
setting?: IFPrintDocumentSetting;
|
|
47
|
+
/** Danh sách trường dữ liệu (tùy chọn) */
|
|
48
|
+
dataFields?: IFPrintDocumentSetupColumn[];
|
|
49
|
+
/** Danh sách bảng dữ liệu (tùy chọn) */
|
|
50
|
+
tableFields?: IFPrintDocumentTableField[];
|
|
51
|
+
more?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IFOptionTypePrint {
|
|
54
|
+
value: string;
|
|
55
|
+
label: string;
|
|
56
|
+
resourceCode: string;
|
|
57
|
+
/** Danh sách trường dữ liệu (tùy chọn) */
|
|
58
|
+
dataFields?: IFPrintDocumentSetupColumn[];
|
|
59
|
+
/** Danh sách bảng dữ liệu (tùy chọn) */
|
|
60
|
+
tableFields?: IFPrintDocumentTableField[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Đại diện một bảng trong tài liệu in
|
|
64
|
+
*/
|
|
65
|
+
export interface IFPrintDocumentTableField {
|
|
66
|
+
/** Tên trường dữ liệu */
|
|
67
|
+
field: string;
|
|
68
|
+
/** Danh sách cột của bảng */
|
|
69
|
+
columns: IFPrintDocumentSetupColumn[];
|
|
70
|
+
/** Tiêu đề hiển thị của bảng */
|
|
71
|
+
headerText: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Cấu hình kiểu dữ liệu cho nội dung
|
|
75
|
+
*/
|
|
76
|
+
export interface IFDataStyleSetting {
|
|
77
|
+
/** Màu chữ */
|
|
78
|
+
color?: string;
|
|
79
|
+
/** Màu nền */
|
|
80
|
+
backgroundColor?: string;
|
|
81
|
+
/** Font chữ */
|
|
82
|
+
fontFamily?: string;
|
|
83
|
+
/** Kích thước chữ */
|
|
84
|
+
fontSize?: number;
|
|
85
|
+
/** In đậm hay không */
|
|
86
|
+
bold?: boolean;
|
|
87
|
+
/** In nghiêng hay không */
|
|
88
|
+
italic?: boolean;
|
|
89
|
+
/** Gạch chân hay không */
|
|
90
|
+
underline?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Cấu hình của tài liệu in
|
|
94
|
+
*/
|
|
95
|
+
export interface IFPrintDocumentSetting {
|
|
96
|
+
/** Cấu hình trang in */
|
|
97
|
+
pageSetting: PageSetting;
|
|
98
|
+
/** Kiểu dáng chung */
|
|
99
|
+
style: IFDataStyleSetting;
|
|
100
|
+
/** Bố cục của tài liệu (mảng 2 chiều) */
|
|
101
|
+
layout: IFPrintDocumentLayout[][];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Định nghĩa bố cục của tài liệu in
|
|
105
|
+
*/
|
|
106
|
+
export interface IFPrintDocumentLayout {
|
|
107
|
+
/** ID của bố cục (tùy chọn) */
|
|
108
|
+
id?: string;
|
|
109
|
+
/** Số hàng trong bố cục */
|
|
110
|
+
rows?: number;
|
|
111
|
+
/** Độ rộng phần tử trong bố cục */
|
|
112
|
+
width: number;
|
|
113
|
+
/** Loại nội dung (bảng, chữ ký, nội dung) */
|
|
114
|
+
type?: "table" | "signature" | "content";
|
|
115
|
+
/** Căn chỉnh vị trí */
|
|
116
|
+
align?: ITextAlign;
|
|
117
|
+
/** Đường viền */
|
|
118
|
+
border?: IBorder;
|
|
119
|
+
/** Các cột con (nếu có) */
|
|
120
|
+
children?: IFPrintDocumentSetupColumn[][];
|
|
121
|
+
/** Định nghĩa bảng (nếu type là 'table') */
|
|
122
|
+
table?: IFPrintDocumentSetupTable;
|
|
123
|
+
/** Định nghĩa chữ ký (nếu type là 'signature') */
|
|
124
|
+
signature?: IFPrintDocumentSetupSignature;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Cấu hình bảng trong tài liệu in
|
|
128
|
+
*/
|
|
129
|
+
export interface IFPrintDocumentSetupTable {
|
|
130
|
+
/** Danh sách cột trong bảng */
|
|
131
|
+
columns: IFPrintDocumentSetupColumn[];
|
|
132
|
+
/** Cấu hình kiểu dữ liệu cho header */
|
|
133
|
+
header: IFDataStyleSetting;
|
|
134
|
+
/** Cấu hình kiểu dữ liệu cho nội dung */
|
|
135
|
+
content: IFDataStyleSetting;
|
|
136
|
+
/** Cấu hình kiểu dữ liệu cho tổng kết */
|
|
137
|
+
summary: IFDataStyleSetting;
|
|
138
|
+
/** Text hàng tổng */
|
|
139
|
+
headerSum?: string;
|
|
140
|
+
/** Tên trường dữ liệu chính */
|
|
141
|
+
field: string;
|
|
142
|
+
/** Danh sách trường cần tính tổng */
|
|
143
|
+
fieldSums: string[];
|
|
144
|
+
/** Có phải bảng tổng không */
|
|
145
|
+
isTotalTable: boolean;
|
|
146
|
+
/** Có hàng mẫu hay không*/
|
|
147
|
+
haveSampleRow?: boolean;
|
|
148
|
+
/** Các trường dùng để tính tổng bảng */
|
|
149
|
+
fieldTotalTable: string[];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Cấu hình hình ảnh trong tài liệu in
|
|
153
|
+
*/
|
|
154
|
+
export interface IFPrintDocumentSetupImage {
|
|
155
|
+
/** Chiều cao ảnh */
|
|
156
|
+
height: number;
|
|
157
|
+
/** Chiều rộng ảnh */
|
|
158
|
+
width: number;
|
|
159
|
+
/** Khoảng cách từ lề trái (tùy chọn) */
|
|
160
|
+
left?: number;
|
|
161
|
+
/** Khoảng cách từ lề trên (tùy chọn) */
|
|
162
|
+
top?: number;
|
|
163
|
+
/** Ảnh nằm dưới chữ hay không */
|
|
164
|
+
behindText?: boolean;
|
|
165
|
+
/** Đường dẫn ảnh */
|
|
166
|
+
url: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Cấu hình một cột trong bảng hoặc nội dung tài liệu in
|
|
170
|
+
*/
|
|
171
|
+
export interface IFPrintDocumentSetupColumn {
|
|
172
|
+
/** ID của cột (tùy chọn) */
|
|
173
|
+
id?: string;
|
|
174
|
+
/** Tiêu đề hiển thị của cột */
|
|
175
|
+
headerText: string;
|
|
176
|
+
/** Nội dung hiển thị ở header */
|
|
177
|
+
headerDisplay?: string;
|
|
178
|
+
/** Tên trường dữ liệu tương ứng */
|
|
179
|
+
field?: string;
|
|
180
|
+
/** Loại dữ liệu của cột */
|
|
181
|
+
type?: "text" | "template" | "image" | "data" | "blank";
|
|
182
|
+
/** Kiểu dữ liệu (số, ngày, chuỗi) */
|
|
183
|
+
dataType?: "number" | "date" | "string" | "QrCode" | "BarCode";
|
|
184
|
+
/** Định dạng hiển thị dữ liệu */
|
|
185
|
+
format?: string;
|
|
186
|
+
/** Độ rộng của cột */
|
|
187
|
+
width?: number;
|
|
188
|
+
/** Chiều cao của cột (tính theo hàng) */
|
|
189
|
+
rows?: number;
|
|
190
|
+
/** Số phần thập phân (nếu là số) */
|
|
191
|
+
fraction?: number;
|
|
192
|
+
/** Cấu hình kiểu dáng của cột */
|
|
193
|
+
style?: IFDataStyleSetting;
|
|
194
|
+
/** Cấu hình ảnh (nếu type là 'image') */
|
|
195
|
+
imageSetting?: IFPrintDocumentSetupImage;
|
|
196
|
+
/** Căn chỉnh tiêu đề */
|
|
197
|
+
headerAlign?: "left" | "right" | "center";
|
|
198
|
+
/** Các cột con (chỉ dùng cho bảng và dữ liệu text có chứa dữ liệu nhiều trường) */
|
|
199
|
+
children?: IFPrintDocumentSetupColumn[];
|
|
200
|
+
/** Gộp cột (chỉ dùng cho bảng) */
|
|
201
|
+
colspan?: number;
|
|
202
|
+
/** Gộp hàng (chỉ dùng cho bảng) */
|
|
203
|
+
rowspan?: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Cấu hình trang in
|
|
207
|
+
*/
|
|
208
|
+
export interface PageSetting {
|
|
209
|
+
/** Lề trên */
|
|
210
|
+
marginTop: number;
|
|
211
|
+
/** Lề dưới */
|
|
212
|
+
marginBottom: number;
|
|
213
|
+
/** Lề trái */
|
|
214
|
+
marginLeft: number;
|
|
215
|
+
/** Lề phải */
|
|
216
|
+
marginRight: number;
|
|
217
|
+
/** Màu nền trang */
|
|
218
|
+
background?: string;
|
|
219
|
+
/** Kích thước trang */
|
|
220
|
+
pageSize?: "A4" | "A4R" | "A3" | "A3R" | "A5" | "A5R";
|
|
221
|
+
/** Độ trong suốt của trang */
|
|
222
|
+
opacity?: number;
|
|
223
|
+
/** Khoảng cách giữa các phần trong trang */
|
|
224
|
+
spaceLayout?: number;
|
|
225
|
+
/** Danh sách hình ảnh trong trang */
|
|
226
|
+
images?: IFPrintDocumentSetupImage[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Cấu hình chữ ký trong tài liệu in
|
|
230
|
+
*/
|
|
231
|
+
export interface IFPrintDocumentSetupSignature {
|
|
232
|
+
/** Cấu hình chữ ký */
|
|
233
|
+
setting: IFDataSetupSignature;
|
|
234
|
+
/** Kiểu dáng chữ ký */
|
|
235
|
+
style?: IFDataStyleSetting;
|
|
236
|
+
}
|
|
237
|
+
export interface IFPrintDocOrganizationApi {
|
|
238
|
+
id: string;
|
|
239
|
+
organization: string;
|
|
240
|
+
setting?: IFPrintDocumentSetting;
|
|
241
|
+
file?: IFPrintDocFile;
|
|
242
|
+
data: DataRecord[];
|
|
243
|
+
typePage: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* API tài liệu in
|
|
247
|
+
*/
|
|
248
|
+
export interface IFPrintDocumentApi {
|
|
249
|
+
/** Tổ chức sử dụng tài liệu này */
|
|
250
|
+
organization: IFOrganization;
|
|
251
|
+
/** Cấu hình tài liệu */
|
|
252
|
+
setting?: IFPrintDocumentSetting;
|
|
253
|
+
/** Cấu hình tài liệu in bằng file*/
|
|
254
|
+
file?: IFPrintDocFile;
|
|
255
|
+
/** Loại trang */
|
|
256
|
+
typePage?: string;
|
|
257
|
+
/** dữ liệu in */
|
|
258
|
+
data: DataRecord[];
|
|
259
|
+
/** Danh sách trường dữ liệu (tùy chọn) */
|
|
260
|
+
dataFields?: IFPrintDocumentSetupColumn[];
|
|
261
|
+
/** Danh sách bảng dữ liệu (tùy chọn) */
|
|
262
|
+
tableFields?: IFPrintDocumentTableField[];
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Cấu hình chữ ký trong tài liệu in
|
|
266
|
+
*/
|
|
267
|
+
export interface IFDataSetupSignature {
|
|
268
|
+
/** Tiêu đề chữ ký */
|
|
269
|
+
title: string;
|
|
270
|
+
/** Danh sách chữ ký chi tiết */
|
|
271
|
+
detail: IFDataSetupSignatureDetail[];
|
|
272
|
+
/** In tên người ký lên chứng từ, báo cáo */
|
|
273
|
+
reportSigning?: number;
|
|
274
|
+
/** Lấy tên người lập biểu theo tài khoản đăng nhập */
|
|
275
|
+
loginSigning?: number;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Chi tiết của một chữ ký
|
|
279
|
+
*/
|
|
280
|
+
export interface IFDataSetupSignatureDetail {
|
|
281
|
+
/** ID chữ ký (tùy chọn) */
|
|
282
|
+
id?: string;
|
|
283
|
+
/** Vị trí chữ ký */
|
|
284
|
+
position: string;
|
|
285
|
+
/** Tiêu đề chữ ký */
|
|
286
|
+
title?: string;
|
|
287
|
+
/** Tên người ký */
|
|
288
|
+
name?: string;
|
|
289
|
+
/** Mã chữ ký / trường dữ liệu*/
|
|
290
|
+
code: string;
|
|
291
|
+
/** Là chữ ký từ dữ liệu phiếu */
|
|
292
|
+
isSignForm?: boolean;
|
|
293
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Layout } from 'react-grid-layout';
|
|
2
|
+
export type ITextAlign = 'center' | 'left' | 'right' | 'initial' | 'start' | 'unset' | 'inherit';
|
|
3
|
+
export type IBorder = 'top' | 'left' | 'right' | 'bottom' | 'none' | 'inside' | 'outside' | 'full' | 'vertical' | 'horizontal';
|
|
4
|
+
export type DataRecord = Record<string, unknown>;
|
|
5
|
+
export type TemplateApiResponse<T = unknown> = Promise<T>;
|
|
6
|
+
export type UploadFileApi<T = unknown> = (params: FormData) => TemplateApiResponse<T>;
|
|
7
|
+
export type PageSizeKey = 'A4' | 'A4R' | 'A3' | 'A3R' | 'A5' | 'A5R';
|
|
8
|
+
export type PageSize = {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
export type TemplateBreakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
|
|
13
|
+
export type TemplateGridLayouts = Record<TemplateBreakpoint, Layout[]>;
|
|
14
|
+
export type IFNumberFormat = {
|
|
15
|
+
dateFormat?: string;
|
|
16
|
+
decimalSeparator?: string;
|
|
17
|
+
thousandSeparator?: string;
|
|
18
|
+
colorNegative?: string;
|
|
19
|
+
prefixNegative?: string;
|
|
20
|
+
suffixNegative?: string;
|
|
21
|
+
};
|
|
22
|
+
export type IColumnType = "number" | "time" | "date" | "week" | "month" | "file" | "quarter" | "year" | "datetime" | "string" | "boolean" | "checkbox" | "color" | null | undefined;
|
|
23
|
+
export interface IFDataGeneralSetting {
|
|
24
|
+
id?: string;
|
|
25
|
+
organizationId: string;
|
|
26
|
+
type: 'PrintDocument' | 'ColumnsTable';
|
|
27
|
+
name: string;
|
|
28
|
+
category: string;
|
|
29
|
+
resourceCode: string;
|
|
30
|
+
value: string;
|
|
31
|
+
more?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InputType } from "reactstrap/types/lib/Input";
|
|
2
|
+
interface IFFormInput {
|
|
3
|
+
control: any;
|
|
4
|
+
name: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
type?: InputType;
|
|
7
|
+
label: string;
|
|
8
|
+
labelSize?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
errors?: any;
|
|
11
|
+
classes?: string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
width?: number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
row?: number;
|
|
18
|
+
isLabel?: boolean;
|
|
19
|
+
inLine?: boolean;
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
callback?: any;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
classLabel?: string;
|
|
25
|
+
}
|
|
26
|
+
interface IPropLabel {
|
|
27
|
+
required?: boolean;
|
|
28
|
+
label: string;
|
|
29
|
+
name: string;
|
|
30
|
+
classLabel?: string;
|
|
31
|
+
isLabel?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const renderLabel: (props: IPropLabel) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const TextInput: (props: IFFormInput) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export default TextInput;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { IFColumnSelectTable } from "react-table-edit";
|
|
2
|
+
import { IFDataSetupSignature, IFNumberFormat, IFOrganization, IFPrintDocument, IFPrintDocumentApi } from "../edit-template/type";
|
|
3
|
+
import { IFieldConfig } from "./modal-print-options";
|
|
4
|
+
export type IFActionPrint = {
|
|
5
|
+
/** Điều kiện hiển thị*/
|
|
6
|
+
condition?: {
|
|
7
|
+
/** Dư liệu dòng*/
|
|
8
|
+
rowData: any;
|
|
9
|
+
/** Danh sách điều kiện hiển thị*/
|
|
10
|
+
listCondition: IFieldConfig[];
|
|
11
|
+
};
|
|
12
|
+
/** Kích thước của cửa sổ (window size), có thể dùng để xác định layout in */
|
|
13
|
+
windowSize: any;
|
|
14
|
+
/** Tên mẫu in mặc định */
|
|
15
|
+
defaultNameTemplate: string;
|
|
16
|
+
/** Thuộc tính có lấy dữ liệu ban đầu khi khỏi tạo không?*/
|
|
17
|
+
isLoadOnInit?: boolean;
|
|
18
|
+
/** Thuộc tính diable in*/
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/** Có hiện tên hay không */
|
|
21
|
+
showTitle?: boolean;
|
|
22
|
+
/** Tổ chức, dùng để xác định dữ liệu liên quan khi in */
|
|
23
|
+
organization: IFOrganization;
|
|
24
|
+
/** Cấu hình chữ ký trong tài liệu in */
|
|
25
|
+
signatures?: IFDataSetupSignature;
|
|
26
|
+
/** Cấu hình format số trong tài liệu in */
|
|
27
|
+
formatNumber: IFNumberFormat;
|
|
28
|
+
/** Danh sách tùy chọn kiểu in mặc định */
|
|
29
|
+
defaultOptionTypePrint: IFPrintDocument[];
|
|
30
|
+
/** Url xem PDF */
|
|
31
|
+
DOCUMENT_URL_VIEW: string;
|
|
32
|
+
/** Url cnd*/
|
|
33
|
+
CDN_URL_VIEW: string;
|
|
34
|
+
containerDropDown?: string | HTMLElement | React.RefObject<HTMLElement> | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* API lấy danh sách cấu hình hộp cài đặt chung
|
|
37
|
+
* @param params - Tham số truyền lên API
|
|
38
|
+
*/
|
|
39
|
+
getListBoxGeneralSettingApi: (params: any) => Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* API cập nhật cấu hình chung
|
|
42
|
+
* @param params - Tham số cập nhật
|
|
43
|
+
*/
|
|
44
|
+
updateGeneralSettingApi: (params: any) => Promise<any>;
|
|
45
|
+
/**
|
|
46
|
+
* Hàm lấy thông tin lọc in hàng loạt
|
|
47
|
+
* @param params - Tham số lọc, phân trang
|
|
48
|
+
* @returns Promise trả về dữ liệu
|
|
49
|
+
*/
|
|
50
|
+
handleFilterPrint?: (data: any) => string;
|
|
51
|
+
/**
|
|
52
|
+
* API lấy dữ liệu phân trang
|
|
53
|
+
* @param params - Tham số lọc, phân trang
|
|
54
|
+
* @returns Promise trả về dữ liệu
|
|
55
|
+
*/
|
|
56
|
+
getPagingDataApi?: (params: any) => Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* API upload file
|
|
59
|
+
* @param params - Dữ liệu file cần upload
|
|
60
|
+
* @returns Promise trả về kết quả upload
|
|
61
|
+
*/
|
|
62
|
+
uploadFileApi: (params: any) => Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* API thực hiện in
|
|
65
|
+
* @param params - Tham số cấu hình in
|
|
66
|
+
* @returns Promise trả về kết quả in
|
|
67
|
+
*/
|
|
68
|
+
exportApi: (params: IFPrintDocumentApi) => Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* API xuất file sau khi merge dữ liệu
|
|
71
|
+
* @param params - Tham số cấu hình merge
|
|
72
|
+
* @returns Promise trả về kết quả file
|
|
73
|
+
*/
|
|
74
|
+
printApi: (params: IFPrintDocumentApi) => Promise<any>;
|
|
75
|
+
/**
|
|
76
|
+
* Thực hiện lấy dữ liệu cần in
|
|
77
|
+
* @param type - Loại mẫu in
|
|
78
|
+
* @returns Promise trả về dữ liệu cần in
|
|
79
|
+
*/
|
|
80
|
+
handlGetDataPrint: (type: string, name: string) => Promise<any>;
|
|
81
|
+
/**
|
|
82
|
+
* API Xóa cấu hình in
|
|
83
|
+
* @param params - id cấu hình in
|
|
84
|
+
* @returns Promise trả về kết quả in
|
|
85
|
+
*/
|
|
86
|
+
deleteGeneralSettingApi: (params: string) => Promise<any>;
|
|
87
|
+
/**
|
|
88
|
+
* Tùy chọn thay thế
|
|
89
|
+
*/
|
|
90
|
+
optionalFields?: {
|
|
91
|
+
field: string;
|
|
92
|
+
label: string;
|
|
93
|
+
isClearable?: boolean;
|
|
94
|
+
loadOptions?: any;
|
|
95
|
+
columns?: IFColumnSelectTable[];
|
|
96
|
+
fieldLabel?: string;
|
|
97
|
+
fieldValue?: string;
|
|
98
|
+
options: any[];
|
|
99
|
+
callback: (val: any, item: any) => void;
|
|
100
|
+
}[];
|
|
101
|
+
};
|
|
102
|
+
export type IFPrintComponentRef = {
|
|
103
|
+
getListTemplate: any;
|
|
104
|
+
};
|
|
105
|
+
declare const PrintComponent: import("react").ForwardRefExoticComponent<IFActionPrint & import("react").RefAttributes<IFPrintComponentRef>>;
|
|
106
|
+
export default PrintComponent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IFDataGeneralSetting, IFDataSetupSignature, IFNumberFormat, IFOrganization, IFPrintDocument } from '../edit-template/type';
|
|
2
|
+
export interface IFPropsModal {
|
|
3
|
+
typeModal?: 'Add' | 'Edit' | 'Duplicate';
|
|
4
|
+
openModal: boolean;
|
|
5
|
+
handleModal: () => void;
|
|
6
|
+
windowSize: any;
|
|
7
|
+
dataSetting: IFPrintDocument;
|
|
8
|
+
dataSource: any;
|
|
9
|
+
organization: IFOrganization;
|
|
10
|
+
signatures?: IFDataSetupSignature;
|
|
11
|
+
formatNumber: IFNumberFormat;
|
|
12
|
+
onSaveData: (name: string) => void;
|
|
13
|
+
uploadFileApi: (params: FormData) => Promise<any>;
|
|
14
|
+
CDN_URL_VIEW: string;
|
|
15
|
+
updateGeneralSettingApi: (params: IFDataGeneralSetting) => Promise<any>;
|
|
16
|
+
}
|
|
17
|
+
export interface IFDataModalEditTempate {
|
|
18
|
+
fileName?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const ModalEditTempatesComponent: (props: IFPropsModal) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default ModalEditTempatesComponent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IFDataGeneralSetting, IFOptionTypePrint, IFOrganization, IFPrintDocFile, IFPrintDocument } from '../edit-template/type';
|
|
2
|
+
export type IFieldConfig = {
|
|
3
|
+
name: any;
|
|
4
|
+
label: any;
|
|
5
|
+
type: 'select';
|
|
6
|
+
options: any[];
|
|
7
|
+
} | {
|
|
8
|
+
name: any;
|
|
9
|
+
label: any;
|
|
10
|
+
type?: 'string' | undefined;
|
|
11
|
+
options?: never;
|
|
12
|
+
};
|
|
13
|
+
export interface IFPropsModal {
|
|
14
|
+
openModal: boolean;
|
|
15
|
+
handleModal: () => void;
|
|
16
|
+
windowSize: any;
|
|
17
|
+
/** Tổ chức, dùng để xác định dữ liệu liên quan khi in */
|
|
18
|
+
organization: IFOrganization;
|
|
19
|
+
optionPrintType: IFOptionTypePrint[];
|
|
20
|
+
optionCurrentPrintTemplate: IFPrintDocument[];
|
|
21
|
+
onSaveData: (name: string) => void;
|
|
22
|
+
uploadFileApi: (params: FormData) => Promise<any>;
|
|
23
|
+
updateGeneralSettingApi: (params: IFDataGeneralSetting) => Promise<any>;
|
|
24
|
+
listCondition?: IFieldConfig[];
|
|
25
|
+
}
|
|
26
|
+
export interface IFDataModalPrintOption {
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
resourceCode: string;
|
|
30
|
+
file?: IFPrintDocFile;
|
|
31
|
+
}
|
|
32
|
+
declare const ModalPrintOptionsComponent: (props: IFPropsModal) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export default ModalPrintOptionsComponent;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { IFColumnSelectTable } from "react-table-edit";
|
|
3
|
+
import { IFOrganization, IFPrintDocument, IFPrintDocumentApi } from "../edit-template/type";
|
|
4
|
+
export interface IFPropsModal {
|
|
5
|
+
windowSize: any;
|
|
6
|
+
openModal: boolean;
|
|
7
|
+
setNamePrint: Dispatch<SetStateAction<string>>;
|
|
8
|
+
namePrint: string;
|
|
9
|
+
setTypeModal: Dispatch<SetStateAction<"Add" | "Edit" | "Duplicate" | undefined>>;
|
|
10
|
+
defaultNameTemplate: string;
|
|
11
|
+
dataSource: any;
|
|
12
|
+
optionTypePrint: IFPrintDocument[];
|
|
13
|
+
dataSetting?: IFPrintDocument;
|
|
14
|
+
setDataSetting: Dispatch<SetStateAction<IFPrintDocument | undefined>>;
|
|
15
|
+
organization: IFOrganization;
|
|
16
|
+
DOCUMENT_URL_VIEW: string;
|
|
17
|
+
CDN_URL_VIEW: string;
|
|
18
|
+
optionalFields?: {
|
|
19
|
+
field: string;
|
|
20
|
+
label: string;
|
|
21
|
+
isClearable?: boolean;
|
|
22
|
+
loadOptions?: any;
|
|
23
|
+
columns?: IFColumnSelectTable[];
|
|
24
|
+
fieldLabel?: string;
|
|
25
|
+
fieldValue?: string;
|
|
26
|
+
options: any[];
|
|
27
|
+
callback: (val: any, item: any) => void;
|
|
28
|
+
}[];
|
|
29
|
+
handleModal: (newModal?: 'modalEdit' | 'modalOption') => void;
|
|
30
|
+
handleGetTemplate: (handlePrint?: (typePage?: string, newOption?: IFPrintDocument[], newName?: string) => void, name?: string) => void;
|
|
31
|
+
printApi: (params: IFPrintDocumentApi) => Promise<any>;
|
|
32
|
+
exportApi: (params: IFPrintDocumentApi) => Promise<any>;
|
|
33
|
+
deleteGeneralSettingApi: (params: string) => Promise<any>;
|
|
34
|
+
}
|
|
35
|
+
declare const ModalPrint: (props: IFPropsModal) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export default ModalPrint;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IFOptionTypePrint } from '../edit-template/type';
|
|
2
|
+
export interface IFPropsDetail {
|
|
3
|
+
windowSize: any;
|
|
4
|
+
openModal: boolean;
|
|
5
|
+
handleModal: () => void;
|
|
6
|
+
optionTypePrint: IFOptionTypePrint[];
|
|
7
|
+
selected: string;
|
|
8
|
+
}
|
|
9
|
+
declare const SidebarFields: (props: IFPropsDetail) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default SidebarFields;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UseFormSetValue, UseFormWatch } from 'react-hook-form';
|
|
2
|
+
import { IFDataModalPrintOption } from './modal-print-options';
|
|
3
|
+
export interface IFPropsDetail {
|
|
4
|
+
watch: UseFormWatch<IFDataModalPrintOption>;
|
|
5
|
+
setValue: UseFormSetValue<IFDataModalPrintOption>;
|
|
6
|
+
uploadFileApi: (params: FormData) => Promise<any>;
|
|
7
|
+
}
|
|
8
|
+
declare const TabSelectFile: (props: IFPropsDetail) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default TabSelectFile;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface IFDataProps {
|
|
2
|
+
title: string;
|
|
3
|
+
handleModal?: any;
|
|
4
|
+
typeModal?: string;
|
|
5
|
+
component?: any;
|
|
6
|
+
componentRight?: any;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ModalHeader: (props: IFDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ModalHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface IFDataProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
children: any;
|
|
4
|
+
toggleSidebar: any;
|
|
5
|
+
width?: string | number;
|
|
6
|
+
keyboard?: boolean;
|
|
7
|
+
hiddenBackground?: boolean;
|
|
8
|
+
hiddenFullScreenButton?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Sidebar: (props: IFDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default Sidebar;
|