dc-editor 1.0.0
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/index.d.ts +2166 -0
- package/dist/index.js +970 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2166 @@
|
|
|
1
|
+
import { Attrs } from 'prosemirror-model';
|
|
2
|
+
|
|
3
|
+
type DocConfig = {
|
|
4
|
+
/** doc 节点配置 */
|
|
5
|
+
doc?: {
|
|
6
|
+
/** 设置节点默认样式 */
|
|
7
|
+
defaultStyle?: (attrs: DocAttrs) => Partial<CSSStyleDeclaration>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
interface DefDocAttrs {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
type DocAttrs = DefDocAttrs & FoAttrs;
|
|
14
|
+
|
|
15
|
+
type ViewModeConfig = {
|
|
16
|
+
/** 视图模式配置 */
|
|
17
|
+
viewMode?: {
|
|
18
|
+
locale?: {
|
|
19
|
+
/** 视图模式 */
|
|
20
|
+
view_mode?: string;
|
|
21
|
+
/** 只读模式 */
|
|
22
|
+
view_mode_readonly?: string;
|
|
23
|
+
/** 表单模式 */
|
|
24
|
+
view_mode_form?: string;
|
|
25
|
+
/** 编辑模式 */
|
|
26
|
+
view_mode_edit?: string;
|
|
27
|
+
/** 设置模式 */
|
|
28
|
+
view_mode_setting?: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type ViewModeState = {
|
|
34
|
+
/** 只读|编辑|表单|设置 默认 edit */
|
|
35
|
+
value: 'readonly' | 'edit' | 'form' | 'setting';
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
interface DefInlineBaseAttrs extends DefBaseAttrs {
|
|
39
|
+
/** 禁删 */
|
|
40
|
+
readonly notDelete?: boolean;
|
|
41
|
+
/** 编辑时只读 */
|
|
42
|
+
readonly readOnly?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface DefBaseAttrs {
|
|
45
|
+
/** name 推荐唯一(radio,checkbox 允许多个公用一个表示一组),用于计算时引用变量 */
|
|
46
|
+
readonly name?: string;
|
|
47
|
+
/** 代码 */
|
|
48
|
+
readonly code?: string;
|
|
49
|
+
}
|
|
50
|
+
type CtrlRightPanelInputRendered<AttrsType, TypeName> = {
|
|
51
|
+
/** 针对 setting 模式下 右侧设置面板中控件的修饰,可以通过 onChange 修改值 */
|
|
52
|
+
rightPanelInputRendered?: (attrs: AttrsType, attrName: TypeName, input: HTMLInputElement, onChange: (text: string) => void) => void;
|
|
53
|
+
};
|
|
54
|
+
type CtrlEventConfig = {
|
|
55
|
+
/**
|
|
56
|
+
* 初始化完成,初始化编辑器内容后也会被批量触发
|
|
57
|
+
* @param ctrl 控件实例
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
onInited?: (ctrl: EditorNodeType) => void;
|
|
61
|
+
/**
|
|
62
|
+
* 更新后触发,两种情况:
|
|
63
|
+
* 1. 当前节点属性更新后触发
|
|
64
|
+
* 2. 当前节点子节点更新后触发
|
|
65
|
+
* @param ctrl 控件实例
|
|
66
|
+
* @param attrsChanged 属性是否发生变更
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
onUpdated?: (ctrl: EditorNodeType, attrsChanged: boolean) => void;
|
|
70
|
+
/**
|
|
71
|
+
* 控件销毁后触发
|
|
72
|
+
* @param ctrl 控件实例
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
onDestroyed?: (ctrl: EditorNodeType) => void;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
type ParagraphConfig = {
|
|
79
|
+
/** 普通段落配置 */
|
|
80
|
+
paragraph?: {
|
|
81
|
+
/** 默认样式 */
|
|
82
|
+
defaultStyle?: (attrs: ParagraphAttrs) => Partial<CSSStyleDeclaration>;
|
|
83
|
+
/** 默认下划线样式:1px solid black */
|
|
84
|
+
underlineStyle?: string;
|
|
85
|
+
/** 多语言国际化 */
|
|
86
|
+
locale?: {
|
|
87
|
+
/** 增大缩进 */
|
|
88
|
+
increase_indent_bar?: string;
|
|
89
|
+
/** 减小缩进 */
|
|
90
|
+
decrease_indent_bar?: string;
|
|
91
|
+
/** placeholder 占位符 */
|
|
92
|
+
placeholder_bar?: string;
|
|
93
|
+
/** 行高 */
|
|
94
|
+
line_height_bar?: string;
|
|
95
|
+
/** 字间距 */
|
|
96
|
+
letter_spacing_bar?: string;
|
|
97
|
+
/** 段前距 */
|
|
98
|
+
paragraph_margin_top_bar?: string;
|
|
99
|
+
/** 段后距 */
|
|
100
|
+
paragraph_margin_bottom_bar?: string;
|
|
101
|
+
/** 左对齐 */
|
|
102
|
+
left_text_align_bar?: string;
|
|
103
|
+
/** 右对齐 */
|
|
104
|
+
right_text_align_bar?: string;
|
|
105
|
+
/** 居中 */
|
|
106
|
+
center_text_align_bar?: string;
|
|
107
|
+
/** 两端对齐 */
|
|
108
|
+
justify_text_align_bar?: string;
|
|
109
|
+
/** 段落 */
|
|
110
|
+
panel_title?: string;
|
|
111
|
+
/** 对齐方式 */
|
|
112
|
+
textAlign_title?: string;
|
|
113
|
+
/** 缩进 */
|
|
114
|
+
textIndent_title?: string;
|
|
115
|
+
/** 行高 */
|
|
116
|
+
lineHeight_title?: string;
|
|
117
|
+
/** 字间距 */
|
|
118
|
+
letterSpacing_title?: string;
|
|
119
|
+
/** 占位符 */
|
|
120
|
+
placeholder_title?: string;
|
|
121
|
+
/** 下划线 */
|
|
122
|
+
underline_title?: string;
|
|
123
|
+
/** 名称 */
|
|
124
|
+
name_title?: string;
|
|
125
|
+
/** 编码 */
|
|
126
|
+
code_title?: string;
|
|
127
|
+
};
|
|
128
|
+
/** 字间距配置 */
|
|
129
|
+
defLetterSpacingOpts?: Array<{
|
|
130
|
+
value: string;
|
|
131
|
+
title: string;
|
|
132
|
+
}>;
|
|
133
|
+
/** 段前距 */
|
|
134
|
+
defMarginTopOpts?: Array<{
|
|
135
|
+
value: string;
|
|
136
|
+
title: string;
|
|
137
|
+
}>;
|
|
138
|
+
/** 段后距 */
|
|
139
|
+
defMarginBottomOpts?: Array<{
|
|
140
|
+
value: string;
|
|
141
|
+
title: string;
|
|
142
|
+
}>;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
interface DefParagraphAttrs extends DefBaseAttrs {
|
|
146
|
+
/** 空段落提示文案 */
|
|
147
|
+
placeholder?: string;
|
|
148
|
+
/** 段落对齐方式 */
|
|
149
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
150
|
+
/** 缩进 */
|
|
151
|
+
textIndent?: number;
|
|
152
|
+
/** 段前距 */
|
|
153
|
+
marginTop?: string;
|
|
154
|
+
/** 段后距 */
|
|
155
|
+
marginBottom?: string;
|
|
156
|
+
/** 行高 */
|
|
157
|
+
lineHeight?: number;
|
|
158
|
+
/** 字间距 */
|
|
159
|
+
letterSpacing?: string;
|
|
160
|
+
/** 下划线 */
|
|
161
|
+
underline?: boolean;
|
|
162
|
+
}
|
|
163
|
+
type ParagraphAttrs = DefParagraphAttrs & FoAttrs;
|
|
164
|
+
|
|
165
|
+
type FooterConfig = {
|
|
166
|
+
/** 页脚配置 */
|
|
167
|
+
footer?: {
|
|
168
|
+
/** 自定义样式 */
|
|
169
|
+
defaultStyle?: (attrs: FooterAttrs) => Partial<CSSStyleDeclaration>;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
interface DefFooterAttrs {
|
|
173
|
+
[key: string]: any;
|
|
174
|
+
}
|
|
175
|
+
type FooterAttrs = DefFooterAttrs & FoAttrs;
|
|
176
|
+
|
|
177
|
+
type MainConfig = {
|
|
178
|
+
/** 内容区域配置 */
|
|
179
|
+
main?: {
|
|
180
|
+
/** 自定义样式 */
|
|
181
|
+
defaultStyle?: (attrs: MainAttrs) => Partial<CSSStyleDeclaration>;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
interface DefMainAttrs {
|
|
185
|
+
[key: string]: any;
|
|
186
|
+
}
|
|
187
|
+
type MainAttrs = DefMainAttrs & FoAttrs;
|
|
188
|
+
|
|
189
|
+
type HeaderConfig = {
|
|
190
|
+
/** header 页头节点配置 */
|
|
191
|
+
header?: {
|
|
192
|
+
/** 节点样式 */
|
|
193
|
+
defaultStyle?: (attrs: HeaderAttrs) => Partial<CSSStyleDeclaration>;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
interface DefHeaderAttrs {
|
|
197
|
+
[key: string]: any;
|
|
198
|
+
}
|
|
199
|
+
type HeaderAttrs = DefHeaderAttrs & FoAttrs;
|
|
200
|
+
|
|
201
|
+
type TextConfig = {
|
|
202
|
+
text?: {
|
|
203
|
+
[key: string]: any;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
declare const PARAGRAPH_TYPE_NAME: "paragraph";
|
|
208
|
+
declare const SECTION_TYPE_NAME: "section";
|
|
209
|
+
declare const AREA_TYPE_NAME: "area";
|
|
210
|
+
declare const IMAGE_TYPE_NAME: "image";
|
|
211
|
+
declare const FORMULA_TYPE_NAME: "formula";
|
|
212
|
+
declare const LINK_TYPE_NAME: "link";
|
|
213
|
+
declare const PGNUM_TYPE_NAME: "pgnum";
|
|
214
|
+
declare const CCHECKBOX_TYPE_NAME: "ccheckbox";
|
|
215
|
+
declare const CRADIO_TYPE_NAME: "cradio";
|
|
216
|
+
declare const CDATE_TYPE_NAME: "cdate";
|
|
217
|
+
declare const CSELECT_TYPE_NAME: "cselect";
|
|
218
|
+
declare const CTEXT_TYPE_NAME: "ctext";
|
|
219
|
+
declare const CTAG_TYPE_NAME: "ctag";
|
|
220
|
+
declare const CSIGN_TYPE_NAME: "csign";
|
|
221
|
+
declare const CQRCODE_TYPE_NAME: "cqrcode";
|
|
222
|
+
|
|
223
|
+
type ImageConfig = {
|
|
224
|
+
/** image 节点配置 */
|
|
225
|
+
image?: {
|
|
226
|
+
/** 默认样式 */
|
|
227
|
+
defaultStyle?: (attrs: ImageAttrs) => Partial<CSSStyleDeclaration>;
|
|
228
|
+
/** 多语言国际化 */
|
|
229
|
+
locale?: {
|
|
230
|
+
/** */
|
|
231
|
+
insert_image_bar?: string;
|
|
232
|
+
/** 重试 */
|
|
233
|
+
setting_reload?: string;
|
|
234
|
+
/** 删除 */
|
|
235
|
+
setting_delete?: string;
|
|
236
|
+
/** 图片 */
|
|
237
|
+
panel_title?: string;
|
|
238
|
+
/** 名称 */
|
|
239
|
+
name_title?: string;
|
|
240
|
+
/** 编码 */
|
|
241
|
+
code_title?: string;
|
|
242
|
+
/** 宽 */
|
|
243
|
+
w_title?: string;
|
|
244
|
+
/** 高 */
|
|
245
|
+
h_title?: string;
|
|
246
|
+
/** 隐藏 */
|
|
247
|
+
hide_title?: string;
|
|
248
|
+
};
|
|
249
|
+
/** 限定类型 */
|
|
250
|
+
acceptType?: Array<'jpg' | 'jpeg' | 'png' | 'gif' | string>;
|
|
251
|
+
/** 上传前检测,返回 false 或报错则不会上传该接口 */
|
|
252
|
+
beforeUpload?: (file: File) => Promise<boolean>;
|
|
253
|
+
/** 图片上传接口,不传默认取图片 base64 格式 */
|
|
254
|
+
upload?: (file: File) => Promise<{
|
|
255
|
+
src: string;
|
|
256
|
+
}>;
|
|
257
|
+
/** 是否进行转存,如果是调用 transferFile 进行转存 */
|
|
258
|
+
isTransform?: (src: string) => boolean;
|
|
259
|
+
/** 转存图片,从某些外网复制过来的图片做转存处理 */
|
|
260
|
+
transferFile?: (src: string) => Promise<{
|
|
261
|
+
src: string;
|
|
262
|
+
}>;
|
|
263
|
+
/** 图片双击事件,默认为图片编辑功能,也可以自定义实现,updateAttrs 可以更新当前 image 的属性 */
|
|
264
|
+
onDblClick?: (attrs: ImageAttrs, updateAttrs: (attrName: Partial<ImageAttrs>) => Promise<void>) => void;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
interface DefImageAttrs {
|
|
268
|
+
readonly name?: string;
|
|
269
|
+
readonly code?: string;
|
|
270
|
+
/** 允许隐藏(diplay:none) */
|
|
271
|
+
readonly hide?: boolean;
|
|
272
|
+
readonly src: string;
|
|
273
|
+
readonly w: string;
|
|
274
|
+
readonly h: string;
|
|
275
|
+
/** 自定义扩展属性 */
|
|
276
|
+
readonly data?: Record<string, any>;
|
|
277
|
+
}
|
|
278
|
+
type ImageAttrs = DefImageAttrs & FoAttrs;
|
|
279
|
+
type ImageNodeType = NodeJSONType<typeof IMAGE_TYPE_NAME, ImageAttrs>;
|
|
280
|
+
|
|
281
|
+
type KeymapConfig = {
|
|
282
|
+
/** 快捷键配置 */
|
|
283
|
+
keymap?: {
|
|
284
|
+
/** 绑定快捷键 */
|
|
285
|
+
bindings?: Record<string, (state: any, dispatch: (tr: any) => void) => boolean>;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
type BrConfig = {
|
|
290
|
+
/** br 节点配置 */
|
|
291
|
+
br?: {
|
|
292
|
+
/** 默认样式 */
|
|
293
|
+
defaultStyle?: (attrs: BrAttrs) => Partial<CSSStyleDeclaration>;
|
|
294
|
+
/** 多语言国际化配置 */
|
|
295
|
+
locale?: {
|
|
296
|
+
/** 分行符 */
|
|
297
|
+
break_bar?: string;
|
|
298
|
+
/** 分页符 */
|
|
299
|
+
break_page_bar?: string;
|
|
300
|
+
/** 分行符 placeholder */
|
|
301
|
+
break_placeholder?: string;
|
|
302
|
+
/** 分页符 placeholder */
|
|
303
|
+
break_page_placeholder?: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
interface DefBrAttrs {
|
|
308
|
+
/** 是否分页符 */
|
|
309
|
+
readonly page?: boolean;
|
|
310
|
+
}
|
|
311
|
+
type BrAttrs = DefBrAttrs & FoAttrs;
|
|
312
|
+
|
|
313
|
+
type HistoryOptions = {
|
|
314
|
+
/** 多语言配置 */
|
|
315
|
+
locale?: {
|
|
316
|
+
/** 撤销 */
|
|
317
|
+
undo_bar?: string;
|
|
318
|
+
/** 重做 */
|
|
319
|
+
redo_bar?: string;
|
|
320
|
+
};
|
|
321
|
+
/** 最大记录历史堆栈,默认 100 */
|
|
322
|
+
depth: number;
|
|
323
|
+
/** 分组间隔,默认 500ms */
|
|
324
|
+
newGroupDelay: number;
|
|
325
|
+
};
|
|
326
|
+
type HistoryConfig = {
|
|
327
|
+
/** 撤销重做配置 */
|
|
328
|
+
history?: Partial<HistoryOptions>;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
interface MarksConfig {
|
|
332
|
+
/** mark 样式配置 */
|
|
333
|
+
marks?: {
|
|
334
|
+
/** 多语言配置 */
|
|
335
|
+
locale?: {
|
|
336
|
+
/** 倾斜 */
|
|
337
|
+
italic_bar?: string;
|
|
338
|
+
/** 加粗 */
|
|
339
|
+
bold_bar?: string;
|
|
340
|
+
/** 下划线 */
|
|
341
|
+
underline_bar?: string;
|
|
342
|
+
/** 删除线 */
|
|
343
|
+
strike_bar?: string;
|
|
344
|
+
/** 上标 */
|
|
345
|
+
sup_bar?: string;
|
|
346
|
+
/** 下标 */
|
|
347
|
+
sub_bar?: string;
|
|
348
|
+
/** 字体颜色 */
|
|
349
|
+
color_bar?: string;
|
|
350
|
+
/** 背景色 */
|
|
351
|
+
bgcolor_bar?: string;
|
|
352
|
+
/** 字号 */
|
|
353
|
+
fontsize_bar?: string;
|
|
354
|
+
/** 字体 */
|
|
355
|
+
fontfamily_bar?: string;
|
|
356
|
+
/** 增大字体 */
|
|
357
|
+
increase_fontsize_bar?: string;
|
|
358
|
+
/** 减小字体 */
|
|
359
|
+
decrease_fontsize_bar?: string;
|
|
360
|
+
/** 恢复默认 */
|
|
361
|
+
clear_color_bgcolor?: string;
|
|
362
|
+
/** 清除格式 */
|
|
363
|
+
clear_style_bar?: string;
|
|
364
|
+
/** 格式刷 */
|
|
365
|
+
format_painter_bar?: string;
|
|
366
|
+
};
|
|
367
|
+
/** 默认字号配置 */
|
|
368
|
+
defFontSizeOpts?: Array<{
|
|
369
|
+
value: string;
|
|
370
|
+
title: string;
|
|
371
|
+
}>;
|
|
372
|
+
/** 默认字体配置 */
|
|
373
|
+
defFontFamilyOpts?: Array<{
|
|
374
|
+
value: string;
|
|
375
|
+
title: string;
|
|
376
|
+
}>;
|
|
377
|
+
/** 默认颜色配置 */
|
|
378
|
+
defColorOpts?: Array<{
|
|
379
|
+
value: string;
|
|
380
|
+
title: string;
|
|
381
|
+
}>;
|
|
382
|
+
/** 默认背景色配置 */
|
|
383
|
+
defBackgroundColorOpts?: Array<{
|
|
384
|
+
value: string;
|
|
385
|
+
title: string;
|
|
386
|
+
}>;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
type LinkConfig = {
|
|
391
|
+
/** link 配置 */
|
|
392
|
+
link?: {
|
|
393
|
+
/** 默认样式 */
|
|
394
|
+
defaultStyle?: (attrs: LinkAttrs) => Partial<CSSStyleDeclaration>;
|
|
395
|
+
/** 本地话多语言配置 */
|
|
396
|
+
locale?: {
|
|
397
|
+
/** 插入链接 */
|
|
398
|
+
link_bar?: string;
|
|
399
|
+
/** 取消链接 */
|
|
400
|
+
unlink_bar?: string;
|
|
401
|
+
/** 文本 */
|
|
402
|
+
text?: string;
|
|
403
|
+
/** 链接 */
|
|
404
|
+
link?: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
interface DefLinkAttrs {
|
|
409
|
+
href?: string;
|
|
410
|
+
}
|
|
411
|
+
type LinkAttrs = DefLinkAttrs & FoAttrs;
|
|
412
|
+
|
|
413
|
+
type FormulaRender<T = FormulaAttrs> = (dom: HTMLElement, attrs: T, updater?: (attrs: T) => void, destroyRef?: {
|
|
414
|
+
value: () => void;
|
|
415
|
+
}) => boolean;
|
|
416
|
+
type FormulaConfig = {
|
|
417
|
+
/** 医学公式配置 */
|
|
418
|
+
formula?: {
|
|
419
|
+
/** 多语言配置 */
|
|
420
|
+
locale?: {
|
|
421
|
+
/** 医学公式 */
|
|
422
|
+
placeholder: string;
|
|
423
|
+
/** 医学公式 */
|
|
424
|
+
insert_formula_bar?: string;
|
|
425
|
+
/** 牙位图 */
|
|
426
|
+
tooth_item?: string;
|
|
427
|
+
/** 通用公式 */
|
|
428
|
+
general_item?: string;
|
|
429
|
+
/** 月经史 */
|
|
430
|
+
menstrual_item?: string;
|
|
431
|
+
/** 初潮年龄 */
|
|
432
|
+
menarche_age_title?: string;
|
|
433
|
+
/** 绝经年龄/末次月经 */
|
|
434
|
+
menopausal_age_title?: string;
|
|
435
|
+
/** 周期(天) */
|
|
436
|
+
menstrual_cycle_title?: string;
|
|
437
|
+
/** 经期(天) */
|
|
438
|
+
menstrual_days_title?: string;
|
|
439
|
+
};
|
|
440
|
+
/** 自定义类型 */
|
|
441
|
+
customTypes?: Array<{
|
|
442
|
+
type: string;
|
|
443
|
+
title: string;
|
|
444
|
+
}>;
|
|
445
|
+
/** 自定义样式 */
|
|
446
|
+
defaultStyle?: (attrs: FormulaAttrs) => Partial<CSSStyleDeclaration>;
|
|
447
|
+
/** 自定义渲染,优先使用,updater 可更新公式属性 */
|
|
448
|
+
render?: FormulaRender;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
type ToothFormulaAttrs = {
|
|
452
|
+
readonly type: 'tooth';
|
|
453
|
+
readonly data?: any;
|
|
454
|
+
};
|
|
455
|
+
type MenstrualFormulaData = {
|
|
456
|
+
/** 初潮年龄 */
|
|
457
|
+
menarcheAge: number;
|
|
458
|
+
/** 绝经年龄 */
|
|
459
|
+
menopausalAge: number;
|
|
460
|
+
/** 月经周期 */
|
|
461
|
+
menstrualCycle: number;
|
|
462
|
+
/** 月经天数(经期) */
|
|
463
|
+
menstrualDays: number;
|
|
464
|
+
};
|
|
465
|
+
type MenstrualFormulaAttrs = {
|
|
466
|
+
readonly type: 'menstrual';
|
|
467
|
+
readonly data?: MenstrualFormulaData;
|
|
468
|
+
};
|
|
469
|
+
type GeneralFormulaData = {
|
|
470
|
+
a: string;
|
|
471
|
+
b: string;
|
|
472
|
+
c: string;
|
|
473
|
+
d: string;
|
|
474
|
+
};
|
|
475
|
+
/** 通用公式 */
|
|
476
|
+
type GeneralFormulaAttrs = {
|
|
477
|
+
readonly type: 'general';
|
|
478
|
+
readonly data?: GeneralFormulaData;
|
|
479
|
+
};
|
|
480
|
+
/** 牙位图|月经史|其他自定义公式 */
|
|
481
|
+
type DefFormulaAttrs = GeneralFormulaAttrs | ToothFormulaAttrs | MenstrualFormulaAttrs | {
|
|
482
|
+
readonly type: string;
|
|
483
|
+
readonly data?: any;
|
|
484
|
+
};
|
|
485
|
+
type FormulaAttrs = DefFormulaAttrs & FoAttrs;
|
|
486
|
+
type FormulaNodeType = NodeJSONType<typeof FORMULA_TYPE_NAME, FormulaAttrs>;
|
|
487
|
+
|
|
488
|
+
type ExportFileConfig = {
|
|
489
|
+
/** 导出文件配置 */
|
|
490
|
+
exportfile?: {
|
|
491
|
+
locale?: {
|
|
492
|
+
/** 导出文件 */
|
|
493
|
+
export_file?: string;
|
|
494
|
+
/** 导出 Word */
|
|
495
|
+
docx?: string;
|
|
496
|
+
/** 导出 PDF */
|
|
497
|
+
pdf?: string;
|
|
498
|
+
};
|
|
499
|
+
/** 获取文件名称 */
|
|
500
|
+
getFileName?: (type: 'doc' | 'pdf') => Promise<string>;
|
|
501
|
+
/** 下载 pdf 触发事件 */
|
|
502
|
+
downloadPdf?: (html: string) => void;
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
type TableConfig = {
|
|
507
|
+
/** 表格配置 */
|
|
508
|
+
table?: {
|
|
509
|
+
/** 多语言配置 */
|
|
510
|
+
locale?: {
|
|
511
|
+
/** 自适应列宽 */
|
|
512
|
+
auto_column_width_bar?: string;
|
|
513
|
+
/** 插入表格 */
|
|
514
|
+
insert_table_bar?: string;
|
|
515
|
+
/** 合并单元格 */
|
|
516
|
+
merge_cells_bar?: string;
|
|
517
|
+
/** 拆分单元格 */
|
|
518
|
+
split_cells_bar?: string;
|
|
519
|
+
/** 删除表格 */
|
|
520
|
+
delete_table_bar?: string;
|
|
521
|
+
/** 删除当前行 */
|
|
522
|
+
delete_rows_bar?: string;
|
|
523
|
+
/** 删除当前列 */
|
|
524
|
+
delete_columns_bar?: string;
|
|
525
|
+
/** 顶部新增行 */
|
|
526
|
+
insert_row_top_bar?: string;
|
|
527
|
+
/** 底部新增行 */
|
|
528
|
+
insert_row_bottom_bar?: string;
|
|
529
|
+
/** 左侧新增列 */
|
|
530
|
+
insert_column_left_bar?: string;
|
|
531
|
+
/** 右侧新增列 */
|
|
532
|
+
insert_column_right_bar?: string;
|
|
533
|
+
/** 靠上对齐 */
|
|
534
|
+
vertical_align_top_bar?: string;
|
|
535
|
+
/** 垂直居中 */
|
|
536
|
+
vertical_align_center_bar?: string;
|
|
537
|
+
/** 靠下对齐 */
|
|
538
|
+
vertical_align_bottom_bar?: string;
|
|
539
|
+
/** 靠左 */
|
|
540
|
+
text_align_left_bar?: string;
|
|
541
|
+
/** 居中 */
|
|
542
|
+
text_align_center_bar?: string;
|
|
543
|
+
/** 靠右 */
|
|
544
|
+
text_align_right_bar?: string;
|
|
545
|
+
/** 名称 */
|
|
546
|
+
name_title?: string;
|
|
547
|
+
/** 编码 */
|
|
548
|
+
code_title?: string;
|
|
549
|
+
/** 禁删 */
|
|
550
|
+
not_delete_title?: string;
|
|
551
|
+
/** 表格 */
|
|
552
|
+
panel_title?: string;
|
|
553
|
+
/** 单元格背景色 */
|
|
554
|
+
bgcolor_bar?: string;
|
|
555
|
+
/** 恢复默认 */
|
|
556
|
+
clear_bgcolor?: string;
|
|
557
|
+
/** 表格边框 */
|
|
558
|
+
cell_border_bar?: string;
|
|
559
|
+
/** 恢复默认 */
|
|
560
|
+
border_reset?: string;
|
|
561
|
+
/** 无边框 */
|
|
562
|
+
border_none?: string;
|
|
563
|
+
};
|
|
564
|
+
/** table 根节点样式 */
|
|
565
|
+
defaultStyle?: (attrs: TableAttrs) => Partial<CSSStyleDeclaration>;
|
|
566
|
+
/** table 节点配置 */
|
|
567
|
+
defaultTableStyle?: CSSStyleDeclaration;
|
|
568
|
+
/** tr 节点样式配置 */
|
|
569
|
+
defaultRowStyle?: CSSStyleDeclaration;
|
|
570
|
+
/** td 节点样式配置 */
|
|
571
|
+
defaultCellStyle?: CSSStyleDeclaration;
|
|
572
|
+
/** 当前模式,全部锁定|允许插入行|default 不加锁 */
|
|
573
|
+
mode?: 'locked' | 'allow_insert_row';
|
|
574
|
+
/** 默认背景色配置 */
|
|
575
|
+
defBackgroundColorOpts?: Array<{
|
|
576
|
+
value: string;
|
|
577
|
+
title: string;
|
|
578
|
+
}>;
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
interface DefTableAttrs {
|
|
582
|
+
/** name */
|
|
583
|
+
readonly name?: string;
|
|
584
|
+
/** name */
|
|
585
|
+
readonly code?: string;
|
|
586
|
+
/** 禁删 */
|
|
587
|
+
readonly notDelete?: boolean;
|
|
588
|
+
/** 总列数必须以次为准 */
|
|
589
|
+
cols: (string | null)[];
|
|
590
|
+
}
|
|
591
|
+
type TableAttrs = DefTableAttrs & FoAttrs;
|
|
592
|
+
|
|
593
|
+
interface AreaConfig {
|
|
594
|
+
/** area 区域配置 */
|
|
595
|
+
area?: {
|
|
596
|
+
/** 国际化 */
|
|
597
|
+
locale?: {
|
|
598
|
+
/** 区域 */
|
|
599
|
+
insert_bar?: string;
|
|
600
|
+
/** 区域 */
|
|
601
|
+
panel_title?: string;
|
|
602
|
+
/** 脚本 */
|
|
603
|
+
script_title?: string;
|
|
604
|
+
/** 区域 */
|
|
605
|
+
def_placeholder?: string;
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
interface DefAreaAttrs extends DefBaseAttrs {
|
|
610
|
+
/** 是否隐藏计算脚本 */
|
|
611
|
+
readonly hideScript?: string;
|
|
612
|
+
/** 隐藏 */
|
|
613
|
+
readonly hide?: boolean;
|
|
614
|
+
/** 占位符 */
|
|
615
|
+
readonly placeholder?: string;
|
|
616
|
+
}
|
|
617
|
+
type AreaAttrs = DefAreaAttrs & FoAttrs;
|
|
618
|
+
type AreaNodeType = NodeJSONType<typeof AREA_TYPE_NAME, AreaAttrs>;
|
|
619
|
+
|
|
620
|
+
interface SectionConfig {
|
|
621
|
+
/** section 集合配置 */
|
|
622
|
+
section?: {
|
|
623
|
+
locale?: {
|
|
624
|
+
/** 集合 */
|
|
625
|
+
insert_bar?: string;
|
|
626
|
+
/** 集合 */
|
|
627
|
+
panel_title?: string;
|
|
628
|
+
/** 脚本 */
|
|
629
|
+
script_title?: string;
|
|
630
|
+
/** 集合 */
|
|
631
|
+
def_placeholder?: string;
|
|
632
|
+
/** 名称 */
|
|
633
|
+
name_title?: string;
|
|
634
|
+
/** 编码 */
|
|
635
|
+
code_title?: string;
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
interface CTextConfig {
|
|
641
|
+
/** 普通文本控件配置 */
|
|
642
|
+
ctext?: {
|
|
643
|
+
/** 国际化 */
|
|
644
|
+
locale?: {
|
|
645
|
+
/** 文本 */
|
|
646
|
+
insert_bar?: string;
|
|
647
|
+
/** 名称 */
|
|
648
|
+
name_title?: string;
|
|
649
|
+
/** 编码 */
|
|
650
|
+
code_title?: string;
|
|
651
|
+
/** 文本 */
|
|
652
|
+
panel_title?: string;
|
|
653
|
+
/** 禁删 */
|
|
654
|
+
not_delete_title?: string;
|
|
655
|
+
/** 占位符 */
|
|
656
|
+
placeholder_title?: string;
|
|
657
|
+
/** 只读 */
|
|
658
|
+
readonly_title?: string;
|
|
659
|
+
/** 下划线 */
|
|
660
|
+
underline_title?: string;
|
|
661
|
+
/** 必填项 */
|
|
662
|
+
requiredContent_title?: string;
|
|
663
|
+
};
|
|
664
|
+
/** 前缀 */
|
|
665
|
+
prefix?: string;
|
|
666
|
+
/** 后缀 */
|
|
667
|
+
suffix?: string;
|
|
668
|
+
/** 默认下划线样式:1px solid black */
|
|
669
|
+
underlineStyle?: string;
|
|
670
|
+
/** 默认样式 */
|
|
671
|
+
defaultStyle?: (attrs: CTextAttrs) => Partial<CSSStyleDeclaration>;
|
|
672
|
+
/** 验证是否有效,true 有效,string 为错误信息 */
|
|
673
|
+
verify?: (text: string, attrs: CTextAttrs) => true | string;
|
|
674
|
+
} & CtrlRightPanelInputRendered<CTextAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
675
|
+
}
|
|
676
|
+
interface DefCTextAttrs extends DefInlineBaseAttrs {
|
|
677
|
+
/** 为空时的占位符 */
|
|
678
|
+
readonly placeholder?: string;
|
|
679
|
+
/** 下划线 */
|
|
680
|
+
readonly underline?: boolean;
|
|
681
|
+
}
|
|
682
|
+
type CTextAttrs = DefCTextAttrs & FoAttrs;
|
|
683
|
+
type CTextNodeType = NodeJSONType<typeof CTEXT_TYPE_NAME, CTextAttrs>;
|
|
684
|
+
|
|
685
|
+
interface CSelectConfig {
|
|
686
|
+
/** 下拉选择控件配置 */
|
|
687
|
+
cselect?: {
|
|
688
|
+
/** 国际化 */
|
|
689
|
+
locale?: {
|
|
690
|
+
/** 下拉 */
|
|
691
|
+
insert_bar?: string;
|
|
692
|
+
/** 全选 */
|
|
693
|
+
select_all?: string;
|
|
694
|
+
/** 清空 */
|
|
695
|
+
clear_all?: string;
|
|
696
|
+
/** 选择 */
|
|
697
|
+
panel_title?: string;
|
|
698
|
+
/** 名称 */
|
|
699
|
+
name_title?: string;
|
|
700
|
+
/** code */
|
|
701
|
+
code_title?: string;
|
|
702
|
+
/** 占位符 */
|
|
703
|
+
placeholder_title?: string;
|
|
704
|
+
/** 连接符 */
|
|
705
|
+
join_string_title?: string;
|
|
706
|
+
/** 多选 */
|
|
707
|
+
mult_title?: string;
|
|
708
|
+
/** 选项 */
|
|
709
|
+
items_title?: string;
|
|
710
|
+
/** 默认值 */
|
|
711
|
+
default_value_title?: string;
|
|
712
|
+
/** 名 */
|
|
713
|
+
items_title_title?: string;
|
|
714
|
+
/** 值 */
|
|
715
|
+
items_value_title?: string;
|
|
716
|
+
/** 扩展 */
|
|
717
|
+
exts_title?: string;
|
|
718
|
+
/** 下划线 */
|
|
719
|
+
underline_title?: string;
|
|
720
|
+
/** 展开 */
|
|
721
|
+
expand_title?: string;
|
|
722
|
+
};
|
|
723
|
+
/** 前缀 */
|
|
724
|
+
prefix?: string;
|
|
725
|
+
/** 后缀 */
|
|
726
|
+
suffix?: string;
|
|
727
|
+
/** 默认下划线样式:1px solid black */
|
|
728
|
+
underlineStyle?: string;
|
|
729
|
+
/** 默认样式 */
|
|
730
|
+
defaultStyle?: (attrs: CSelectAttrs) => Partial<CSSStyleDeclaration>;
|
|
731
|
+
/** 搜索/获取选项 未设置选项值的控件会执行此方法 */
|
|
732
|
+
getItems: (key: string, attrs: CSelectAttrs) => Promise<CSelectItem[]>;
|
|
733
|
+
} & CtrlRightPanelInputRendered<CSelectAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
734
|
+
}
|
|
735
|
+
type CSelectItem = {
|
|
736
|
+
title: string;
|
|
737
|
+
value: string;
|
|
738
|
+
[key: string]: any;
|
|
739
|
+
};
|
|
740
|
+
interface DefCSelectAttrs extends DefInlineBaseAttrs {
|
|
741
|
+
/** 多选 */
|
|
742
|
+
readonly mult?: boolean;
|
|
743
|
+
/** Select 选项,如果为 false 表示通过 getItems 获取 */
|
|
744
|
+
readonly items?: CSelectItem[] | false;
|
|
745
|
+
/** 选中的 items */
|
|
746
|
+
readonly selectedItems?: CSelectItem[];
|
|
747
|
+
/** 扩展属性 */
|
|
748
|
+
readonly exts?: Record<string, any>;
|
|
749
|
+
/** 为空时的占位符 */
|
|
750
|
+
readonly placeholder?: string;
|
|
751
|
+
/** 多选时的连接字符,默认:「、」 */
|
|
752
|
+
readonly joinString?: string;
|
|
753
|
+
/** 下划线 */
|
|
754
|
+
readonly underline?: boolean;
|
|
755
|
+
/** 是否展开 */
|
|
756
|
+
readonly expand?: boolean;
|
|
757
|
+
}
|
|
758
|
+
type CSelectAttrs = DefCSelectAttrs & FoAttrs;
|
|
759
|
+
type CSelectNodeType = NodeJSONType<typeof CSELECT_TYPE_NAME, CSelectAttrs>;
|
|
760
|
+
|
|
761
|
+
interface CDateConfig {
|
|
762
|
+
/** 日期控件配置 */
|
|
763
|
+
cdate?: {
|
|
764
|
+
/** 国际化 */
|
|
765
|
+
locale?: {
|
|
766
|
+
/** 日期 */
|
|
767
|
+
insert_bar?: string;
|
|
768
|
+
/** 清空 */
|
|
769
|
+
clear_bar?: string;
|
|
770
|
+
/** 名称 */
|
|
771
|
+
name_title?: string;
|
|
772
|
+
/** 编码 */
|
|
773
|
+
code_title?: string;
|
|
774
|
+
/** 日期 */
|
|
775
|
+
panel_title?: string;
|
|
776
|
+
/** 禁删 */
|
|
777
|
+
not_delete_title?: string;
|
|
778
|
+
/** 占位符 */
|
|
779
|
+
placeholder_title?: string;
|
|
780
|
+
/** 只读 */
|
|
781
|
+
readonly_title?: string;
|
|
782
|
+
/** 格式化* */
|
|
783
|
+
format_title?: string;
|
|
784
|
+
/** 下划线 */
|
|
785
|
+
underline_title?: string;
|
|
786
|
+
};
|
|
787
|
+
/** 前缀 */
|
|
788
|
+
prefix?: string;
|
|
789
|
+
/** 后缀 */
|
|
790
|
+
suffix?: string;
|
|
791
|
+
/** 默认下划线样式:1px solid black */
|
|
792
|
+
underlineStyle?: string;
|
|
793
|
+
defaultStyle?: (attrs: CDateAttrs) => Partial<CSSStyleDeclaration>;
|
|
794
|
+
/** 验证是否有效,true 有效,string 为错误信息 */
|
|
795
|
+
verify?: (text: string, attrs: CDateAttrs) => true | string;
|
|
796
|
+
} & CtrlRightPanelInputRendered<CDateAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
797
|
+
}
|
|
798
|
+
interface DefCDateAttrs extends DefInlineBaseAttrs {
|
|
799
|
+
/** 日期格式化 */
|
|
800
|
+
readonly format?: string;
|
|
801
|
+
/** 为空时的占位符 */
|
|
802
|
+
readonly placeholder?: string;
|
|
803
|
+
/** 下划线 */
|
|
804
|
+
readonly underline?: boolean;
|
|
805
|
+
}
|
|
806
|
+
type CDateAttrs = DefCDateAttrs & FoAttrs;
|
|
807
|
+
type CDateNodeType = NodeJSONType<typeof CDATE_TYPE_NAME, CDateAttrs>;
|
|
808
|
+
|
|
809
|
+
interface CRadioConfig {
|
|
810
|
+
/** 单选控件 */
|
|
811
|
+
cradio?: {
|
|
812
|
+
locale?: {
|
|
813
|
+
/** 单选 */
|
|
814
|
+
insert_bar?: string;
|
|
815
|
+
/** 名称 */
|
|
816
|
+
name_title?: string;
|
|
817
|
+
/** 编码 */
|
|
818
|
+
code_title?: string;
|
|
819
|
+
/** 单选 */
|
|
820
|
+
panel_title?: string;
|
|
821
|
+
/** 禁删 */
|
|
822
|
+
not_delete_title?: string;
|
|
823
|
+
/** 只读 */
|
|
824
|
+
readonly_title?: string;
|
|
825
|
+
/** 文本 */
|
|
826
|
+
text_title?: string;
|
|
827
|
+
/** 值 */
|
|
828
|
+
value_title?: string;
|
|
829
|
+
};
|
|
830
|
+
/** 前缀 */
|
|
831
|
+
prefix?: string;
|
|
832
|
+
/** 后缀 */
|
|
833
|
+
suffix?: string;
|
|
834
|
+
defaultStyle?: (attrs: CRadioAttrs) => Partial<CSSStyleDeclaration>;
|
|
835
|
+
} & CtrlRightPanelInputRendered<CRadioAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
836
|
+
}
|
|
837
|
+
interface DefCRadioAttrs extends DefInlineBaseAttrs {
|
|
838
|
+
/** 是否已选中 */
|
|
839
|
+
selected?: boolean;
|
|
840
|
+
/** 当前 item 值 */
|
|
841
|
+
text: string;
|
|
842
|
+
value: string;
|
|
843
|
+
}
|
|
844
|
+
type CRadioAttrs = DefCRadioAttrs & FoAttrs;
|
|
845
|
+
type CRadioNodeType = NodeJSONType<typeof CRADIO_TYPE_NAME, CRadioAttrs>;
|
|
846
|
+
|
|
847
|
+
interface CCheckboxConfig {
|
|
848
|
+
/** 多选控件 */
|
|
849
|
+
ccheckbox?: {
|
|
850
|
+
locale?: {
|
|
851
|
+
/** 多选 */
|
|
852
|
+
insert_bar?: string;
|
|
853
|
+
/** 名称 */
|
|
854
|
+
name_title?: string;
|
|
855
|
+
/** 编码 */
|
|
856
|
+
code_title?: string;
|
|
857
|
+
/** 单选 */
|
|
858
|
+
panel_title?: string;
|
|
859
|
+
/** 禁删 */
|
|
860
|
+
not_delete_title?: string;
|
|
861
|
+
/** 只读 */
|
|
862
|
+
readonly_title?: string;
|
|
863
|
+
/** 文本 */
|
|
864
|
+
text_title?: string;
|
|
865
|
+
/** 值 */
|
|
866
|
+
value_title?: string;
|
|
867
|
+
};
|
|
868
|
+
/** 前缀 */
|
|
869
|
+
prefix?: string;
|
|
870
|
+
/** 后缀 */
|
|
871
|
+
suffix?: string;
|
|
872
|
+
defaultStyle?: (attrs: CCheckboxAttrs) => Partial<CSSStyleDeclaration>;
|
|
873
|
+
} & CtrlRightPanelInputRendered<CCheckboxAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
874
|
+
}
|
|
875
|
+
interface DefCCheckboxAttrs extends DefInlineBaseAttrs {
|
|
876
|
+
/** 是否已选中 */
|
|
877
|
+
selected?: boolean;
|
|
878
|
+
/** 当前 item 值 */
|
|
879
|
+
text: string;
|
|
880
|
+
value: string;
|
|
881
|
+
}
|
|
882
|
+
type CCheckboxAttrs = DefCCheckboxAttrs & FoAttrs;
|
|
883
|
+
type CCheckboxNodeType = NodeJSONType<typeof CCHECKBOX_TYPE_NAME, CCheckboxAttrs>;
|
|
884
|
+
|
|
885
|
+
interface CSignConfig {
|
|
886
|
+
/** 签名控件配置 */
|
|
887
|
+
csign?: {
|
|
888
|
+
/** 国际化 */
|
|
889
|
+
locale?: {
|
|
890
|
+
/** 签名 */
|
|
891
|
+
insert_bar?: string;
|
|
892
|
+
/** 撤销 */
|
|
893
|
+
undo?: string;
|
|
894
|
+
/** 名称 */
|
|
895
|
+
name_title?: string;
|
|
896
|
+
/** 编码 */
|
|
897
|
+
code_title?: string;
|
|
898
|
+
/** 签名 */
|
|
899
|
+
panel_title?: string;
|
|
900
|
+
/** 禁删 */
|
|
901
|
+
not_delete_title?: string;
|
|
902
|
+
/** 占位符 */
|
|
903
|
+
placeholder_title?: string;
|
|
904
|
+
/** 扩展 */
|
|
905
|
+
exts_title?: string;
|
|
906
|
+
/** 宽 */
|
|
907
|
+
w_title?: string;
|
|
908
|
+
/** 高 */
|
|
909
|
+
h_title?: string;
|
|
910
|
+
/** 只读 */
|
|
911
|
+
readonly_title?: string;
|
|
912
|
+
/** 确认 */
|
|
913
|
+
ok_title?: string;
|
|
914
|
+
/** 取消 */
|
|
915
|
+
cancel_title?: string;
|
|
916
|
+
/** 隐藏 */
|
|
917
|
+
hide_title?: string;
|
|
918
|
+
};
|
|
919
|
+
/** sign 弹出的 dialog 宽度,高度是当前签名控件的等比值,默认 70vw(当前屏幕的70%) */
|
|
920
|
+
dialogWidth?: string;
|
|
921
|
+
/** 默认样式 */
|
|
922
|
+
defaultStyle?: (attrs: CSignAttrs) => Partial<CSSStyleDeclaration>;
|
|
923
|
+
/** 双击弹出 dialog 中的图片,默认是 attrs.src */
|
|
924
|
+
onDialogSrc?: (attrs: CSignAttrs) => Promise<string>;
|
|
925
|
+
} & CtrlRightPanelInputRendered<CSignAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
926
|
+
}
|
|
927
|
+
interface DefCSignAttrs extends DefInlineBaseAttrs {
|
|
928
|
+
/** 支持 base64 或者 img.src */
|
|
929
|
+
readonly src: string;
|
|
930
|
+
/** 与 h 单位相同,推荐 px */
|
|
931
|
+
readonly w: string;
|
|
932
|
+
/** 与 w 单位相同,推荐 px */
|
|
933
|
+
readonly h: string;
|
|
934
|
+
/** 初始化的占位符,允许 html 格式 */
|
|
935
|
+
readonly placeholder: string;
|
|
936
|
+
/** 隐藏(display:none) */
|
|
937
|
+
readonly hide?: boolean;
|
|
938
|
+
/** 自定义结构 */
|
|
939
|
+
readonly exts?: Record<string, any>;
|
|
940
|
+
}
|
|
941
|
+
type CSignAttrs = DefCSignAttrs & FoAttrs;
|
|
942
|
+
type CSignNodeType = NodeJSONType<typeof CSIGN_TYPE_NAME, CSignAttrs>;
|
|
943
|
+
|
|
944
|
+
interface CQRCodeConfig {
|
|
945
|
+
/** 条码控件配置 */
|
|
946
|
+
cqrcode?: {
|
|
947
|
+
/** 国际化 */
|
|
948
|
+
locale?: {
|
|
949
|
+
/** 条码 */
|
|
950
|
+
insert_bar?: string;
|
|
951
|
+
/** 名称 */
|
|
952
|
+
name_title?: string;
|
|
953
|
+
/** 编码 */
|
|
954
|
+
code_title?: string;
|
|
955
|
+
/** 条码 */
|
|
956
|
+
panel_title?: string;
|
|
957
|
+
/** 占位符 */
|
|
958
|
+
placeholder_title?: string;
|
|
959
|
+
/** 宽 */
|
|
960
|
+
w_title?: string;
|
|
961
|
+
/** 类型 */
|
|
962
|
+
type_title?: string;
|
|
963
|
+
/** 值 */
|
|
964
|
+
value_title?: string;
|
|
965
|
+
/** 二维码 */
|
|
966
|
+
qrcode_type_title?: string;
|
|
967
|
+
/** 条形码 */
|
|
968
|
+
barcode_type_title?: string;
|
|
969
|
+
/** 隐藏 */
|
|
970
|
+
hide_title?: string;
|
|
971
|
+
};
|
|
972
|
+
/** 默认样式 */
|
|
973
|
+
defaultStyle?: (attrs: CQRCodeAttrs) => Partial<CSSStyleDeclaration>;
|
|
974
|
+
} & CtrlRightPanelInputRendered<CQRCodeAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
975
|
+
}
|
|
976
|
+
interface DefCQRCodeAttrs extends DefBaseAttrs {
|
|
977
|
+
/** 支持 base64 或者 img.src */
|
|
978
|
+
readonly value: string;
|
|
979
|
+
/** 条码类型 */
|
|
980
|
+
readonly type: QRCodeType;
|
|
981
|
+
/** 与 h 单位相同,推荐 px */
|
|
982
|
+
readonly w: string;
|
|
983
|
+
/** 与 w 单位相同,推荐 px */
|
|
984
|
+
/** 初始化的占位符,允许 html 格式 */
|
|
985
|
+
readonly placeholder: string;
|
|
986
|
+
/** 隐藏(display:none) */
|
|
987
|
+
readonly hide?: boolean;
|
|
988
|
+
}
|
|
989
|
+
/** 条码类型:二维码|条形码 */
|
|
990
|
+
type QRCodeType = 'qrcode' | 'barcode';
|
|
991
|
+
type CQRCodeAttrs = DefCQRCodeAttrs & FoAttrs;
|
|
992
|
+
type CQRCodeNodeType = NodeJSONType<typeof CQRCODE_TYPE_NAME, CQRCodeAttrs>;
|
|
993
|
+
|
|
994
|
+
type PgNumConfig = {
|
|
995
|
+
/** 页码控件 */
|
|
996
|
+
pgnum?: {
|
|
997
|
+
locale?: {
|
|
998
|
+
/** 页码占位符,非分页模式下显示 */
|
|
999
|
+
num_placeholder?: string;
|
|
1000
|
+
/** 总页数占位符,非分页模式下显示 */
|
|
1001
|
+
count_placeholder?: string;
|
|
1002
|
+
};
|
|
1003
|
+
defaultStyle?: (attrs: PgNumAttrs) => Partial<CSSStyleDeclaration>;
|
|
1004
|
+
/** 显示模版,渲染时会替换 {{num}},{{count}},以元素中的 template 优先级最高,默认:{{num}}/{{count}} */
|
|
1005
|
+
template?: string;
|
|
1006
|
+
};
|
|
1007
|
+
};
|
|
1008
|
+
interface DefPgNumAttrs {
|
|
1009
|
+
/** 页码,默认 decimal */
|
|
1010
|
+
readonly fmt: 'decimal' | 'chinese';
|
|
1011
|
+
/** 如果缺省表示从上一个页码继承,否则表示重新编码 */
|
|
1012
|
+
readonly start?: number;
|
|
1013
|
+
/** 显示模版,渲染时会替换 {{num}},{{count}},默认:{{num}}/{{count}} */
|
|
1014
|
+
readonly template?: string;
|
|
1015
|
+
}
|
|
1016
|
+
type PgNumAttrs = DefPgNumAttrs & FoAttrs;
|
|
1017
|
+
|
|
1018
|
+
type CCPAConfig = {
|
|
1019
|
+
/** 复制粘贴剪切配置 */
|
|
1020
|
+
ccpa?: {
|
|
1021
|
+
locale?: {
|
|
1022
|
+
/** cut 剪切 */
|
|
1023
|
+
cut_bar?: string;
|
|
1024
|
+
/** copy 复制 */
|
|
1025
|
+
copy_bar?: string;
|
|
1026
|
+
/** paste 粘贴 */
|
|
1027
|
+
paste_bar?: string;
|
|
1028
|
+
/** selectall 全选 */
|
|
1029
|
+
selectall_bar?: string;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
/** 剪切 */
|
|
1035
|
+
declare const CUT_ICON_MENU_KEY: "icon-cut";
|
|
1036
|
+
/** 剪切 */
|
|
1037
|
+
type CUT_ICON_MENUKEY = typeof CUT_ICON_MENU_KEY;
|
|
1038
|
+
/** 剪切 */
|
|
1039
|
+
declare const CUT_ICON_TEXT_MENU_KEY: "icon-text-cut";
|
|
1040
|
+
/** 剪切 */
|
|
1041
|
+
type CUT_ICON_TEXT_MENUKEY = typeof CUT_ICON_TEXT_MENU_KEY;
|
|
1042
|
+
/** 复制 */
|
|
1043
|
+
declare const COPY_ICON_MENU_KEY: "icon-copy";
|
|
1044
|
+
/** 复制 */
|
|
1045
|
+
type COPY_ICON_MENUKEY = typeof COPY_ICON_MENU_KEY;
|
|
1046
|
+
/** 复制 */
|
|
1047
|
+
declare const COPY_ICON_TEXT_MENU_KEY: "icon-text-copy";
|
|
1048
|
+
/** 复制 */
|
|
1049
|
+
type COPY_ICON_TEXT_MENUKEY = typeof COPY_ICON_TEXT_MENU_KEY;
|
|
1050
|
+
|
|
1051
|
+
/** 粘贴 */
|
|
1052
|
+
declare const PASTE_ICON_MENU_KEY: "icon-paste";
|
|
1053
|
+
/** 粘贴 */
|
|
1054
|
+
type PASTE_ICON_MENUKEY = typeof PASTE_ICON_MENU_KEY;
|
|
1055
|
+
/** 粘贴 */
|
|
1056
|
+
declare const PASTE_ICON_TEXT_MENU_KEY: "icon-text-paste";
|
|
1057
|
+
/** 粘贴 */
|
|
1058
|
+
type PASTE_ICON_TEXT_MENUKEY = typeof PASTE_ICON_TEXT_MENU_KEY;
|
|
1059
|
+
|
|
1060
|
+
/** 全选 */
|
|
1061
|
+
declare const SELECTALL_ICON_MENU_KEY: "icon-selectall";
|
|
1062
|
+
/** 全选 */
|
|
1063
|
+
type SELECTALL_ICON_MENUKEY = typeof SELECTALL_ICON_MENU_KEY;
|
|
1064
|
+
/** 全选 */
|
|
1065
|
+
declare const SELECTALL_ICON_TEXT_MENU_KEY: "icon-text-selectall";
|
|
1066
|
+
/** 全选 */
|
|
1067
|
+
type SELECTALL_ICON_TEXT_MENUKEY = typeof SELECTALL_ICON_TEXT_MENU_KEY;
|
|
1068
|
+
|
|
1069
|
+
/** 重做 */
|
|
1070
|
+
declare const ICON_MENU_KEY$d: "icon-redo";
|
|
1071
|
+
/** 重做 */
|
|
1072
|
+
type REDO_ICON_MENUKEY = typeof ICON_MENU_KEY$d;
|
|
1073
|
+
/** 重做 */
|
|
1074
|
+
declare const ICON_TEXT_MENU_KEY$g: "icon-text-redo";
|
|
1075
|
+
/** 重做 */
|
|
1076
|
+
type REDO_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$g;
|
|
1077
|
+
|
|
1078
|
+
/** 重做 */
|
|
1079
|
+
declare const ICON_MENU_KEY$c: "icon-undo";
|
|
1080
|
+
/** 重做 */
|
|
1081
|
+
type UNDO_ICON_MENUKEY = typeof ICON_MENU_KEY$c;
|
|
1082
|
+
/** 重做 */
|
|
1083
|
+
declare const ICON_TEXT_MENU_KEY$f: "icon-text-undo";
|
|
1084
|
+
/** 重做 */
|
|
1085
|
+
type UNDO_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$f;
|
|
1086
|
+
|
|
1087
|
+
declare const MENU_KEY$A: "icon-bold";
|
|
1088
|
+
/** 加粗 */
|
|
1089
|
+
type BOLD_ICON_MENUKEY = typeof MENU_KEY$A;
|
|
1090
|
+
|
|
1091
|
+
/** 清除格式 */
|
|
1092
|
+
declare const CLEAR_STYLE_MENU_KEY: "icon-clear-style";
|
|
1093
|
+
/** 清除格式 */
|
|
1094
|
+
type CLEAR_STYLE_ICON_MENUKEY = typeof CLEAR_STYLE_MENU_KEY;
|
|
1095
|
+
|
|
1096
|
+
declare const MENU_KEY$z: "icon-color";
|
|
1097
|
+
/** 颜色背景色 */
|
|
1098
|
+
type COLOR_ICON_MENUKEY = typeof MENU_KEY$z;
|
|
1099
|
+
|
|
1100
|
+
declare const FONTSIZE_MENU_KEY: "icon-fontsize";
|
|
1101
|
+
/** 字号 */
|
|
1102
|
+
type FONTSIZE_ICON_MENUKEY = typeof FONTSIZE_MENU_KEY;
|
|
1103
|
+
declare const FONTFAMILY_MENU_KEY: "icon-fontfamily";
|
|
1104
|
+
/** 字体 */
|
|
1105
|
+
type FONTFAMILY_ICON_MENUKEY = typeof FONTFAMILY_MENU_KEY;
|
|
1106
|
+
|
|
1107
|
+
declare const INCREASE_MENU_KEY: "icon-increase-fontsize";
|
|
1108
|
+
/** 增大字体 */
|
|
1109
|
+
type INCREASE_FONTSIZE_ICON_MENUKEY = typeof INCREASE_MENU_KEY;
|
|
1110
|
+
declare const DECREASE_MENU_KEY: "icon-decrease-fontsize";
|
|
1111
|
+
/** 增大字体 */
|
|
1112
|
+
type DECREASE_FONTSIZE_ICON_MENUKEY = typeof DECREASE_MENU_KEY;
|
|
1113
|
+
|
|
1114
|
+
declare const MENU_KEY$y: "icon-format-painter";
|
|
1115
|
+
/** 格式刷 */
|
|
1116
|
+
type FORMAT_PAINTER_ICON_MENUKEY = typeof MENU_KEY$y;
|
|
1117
|
+
|
|
1118
|
+
declare const MENU_KEY$x: "icon-italic";
|
|
1119
|
+
/** 倾斜 */
|
|
1120
|
+
type ITALIC_ICON_MENUKEY = typeof MENU_KEY$x;
|
|
1121
|
+
|
|
1122
|
+
declare const MENU_KEY$w: "icon-strike";
|
|
1123
|
+
/** 删除线 */
|
|
1124
|
+
type STRIKE_ICON_MENUKEY = typeof MENU_KEY$w;
|
|
1125
|
+
|
|
1126
|
+
declare const MENU_KEY$v: "icon-sub";
|
|
1127
|
+
/** 下标 */
|
|
1128
|
+
type SUB_ICON_MENUKEY = typeof MENU_KEY$v;
|
|
1129
|
+
|
|
1130
|
+
declare const MENU_KEY$u: "icon-sup";
|
|
1131
|
+
/** 上标 */
|
|
1132
|
+
type SUP_ICON_MENUKEY = typeof MENU_KEY$u;
|
|
1133
|
+
|
|
1134
|
+
/** 增大缩紧 */
|
|
1135
|
+
declare const INCREASE_INDENT_MENU_KEY: "icon-increase-indent";
|
|
1136
|
+
/** 增大缩紧 */
|
|
1137
|
+
type INCREASE_INDENT_ICON_MENUKEY = typeof INCREASE_INDENT_MENU_KEY;
|
|
1138
|
+
/** 减小缩紧 */
|
|
1139
|
+
declare const DECREASE_INDENT_MENU_KEY: "icon-decrease-indent";
|
|
1140
|
+
/** 减小缩紧 */
|
|
1141
|
+
type DECREASE_INDENT_ICON_MENUKEY = typeof DECREASE_INDENT_MENU_KEY;
|
|
1142
|
+
|
|
1143
|
+
declare const MENU_KEY$t: "icon-underline";
|
|
1144
|
+
/** 下划线 */
|
|
1145
|
+
type UNDERLINE_ICON_MENUKEY = typeof MENU_KEY$t;
|
|
1146
|
+
|
|
1147
|
+
/** 插入表格 */
|
|
1148
|
+
declare const MENU_KEY$s: "icon-insert-table";
|
|
1149
|
+
declare const TEXT_MENU_KEY$7: "icon-text-insert-table";
|
|
1150
|
+
declare const BIG_MENU_KEY$l: "big-insert-table";
|
|
1151
|
+
/** 插入表格 */
|
|
1152
|
+
type INSERT_TABLE_MENUKEY = typeof MENU_KEY$s;
|
|
1153
|
+
type INSERT_TABLE_TEXT_MENUKEY = typeof TEXT_MENU_KEY$7;
|
|
1154
|
+
type INSERT_TABLE_BIG_MENUKEY = typeof BIG_MENU_KEY$l;
|
|
1155
|
+
|
|
1156
|
+
/** 菜单配置 */
|
|
1157
|
+
type MenuConfig<T = string> = {
|
|
1158
|
+
/** 标题 */
|
|
1159
|
+
title?: string;
|
|
1160
|
+
/** 分组 */
|
|
1161
|
+
groups: (number | (() => HTMLElement) | T)[][];
|
|
1162
|
+
};
|
|
1163
|
+
type InnerToolbarsConfig<T = string> = {
|
|
1164
|
+
/** toolbars 控件配置 */
|
|
1165
|
+
toolbars?: {
|
|
1166
|
+
/** toolbars 独立渲染容器,默认显示在顶部 */
|
|
1167
|
+
container?: HTMLElement;
|
|
1168
|
+
/** 默认打开第几个 tab,默认为 0(第一个) */
|
|
1169
|
+
activeIndex?: number;
|
|
1170
|
+
/** 菜单配置,如果只有一个配置,且 title 为空,则平铺显示 */
|
|
1171
|
+
menus?: MenuConfig<T>[];
|
|
1172
|
+
/** 国际化 */
|
|
1173
|
+
locale?: {
|
|
1174
|
+
/** 上传文件 */
|
|
1175
|
+
upload_file_bar?: string;
|
|
1176
|
+
/** 下载文件 */
|
|
1177
|
+
download_file_bar?: string;
|
|
1178
|
+
/** 特殊字符 */
|
|
1179
|
+
spechars_bar?: string;
|
|
1180
|
+
/** 罗马字符 */
|
|
1181
|
+
rome_spechars?: string;
|
|
1182
|
+
/** 数学字符 */
|
|
1183
|
+
math_spechars?: string;
|
|
1184
|
+
/** 日文字符 */
|
|
1185
|
+
japanese_spechars?: string;
|
|
1186
|
+
/** 希腊字母 */
|
|
1187
|
+
greek_spechars?: string;
|
|
1188
|
+
/** 俄文字符 */
|
|
1189
|
+
russian_spechars?: string;
|
|
1190
|
+
/** 拼音字符 */
|
|
1191
|
+
pinyin_spechars?: string;
|
|
1192
|
+
/** 英语音标 */
|
|
1193
|
+
english_spechars?: string;
|
|
1194
|
+
/** 其他 */
|
|
1195
|
+
other_spechars?: string;
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
/** 导出文件 */
|
|
1201
|
+
declare const MENU_KEY$r: "big-download-file";
|
|
1202
|
+
/** 导出文件 */
|
|
1203
|
+
type DOWNLOAD_FILE_MENUKEY = typeof MENU_KEY$r;
|
|
1204
|
+
|
|
1205
|
+
/** 导出文件 */
|
|
1206
|
+
declare const MENU_KEY$q: "big-upload-file";
|
|
1207
|
+
/** 导出文件 */
|
|
1208
|
+
type IMPORT_FILE_MENUKEY = typeof MENU_KEY$q;
|
|
1209
|
+
|
|
1210
|
+
/** 特殊字符 */
|
|
1211
|
+
declare const MENU_KEY$p: "icon-spechars";
|
|
1212
|
+
declare const BIG_MENU_KEY$k: "big-spechars";
|
|
1213
|
+
/** 特殊字符 */
|
|
1214
|
+
type SPECHARS_MENUKEY = typeof MENU_KEY$p;
|
|
1215
|
+
type SPECHARS_BIG_MENUKEY = typeof BIG_MENU_KEY$k;
|
|
1216
|
+
|
|
1217
|
+
declare const MENU_KEY$o: "icon-placeholder";
|
|
1218
|
+
/** placeholder */
|
|
1219
|
+
type PLACEHOLDER_ICON_MENUKEY = typeof MENU_KEY$o;
|
|
1220
|
+
|
|
1221
|
+
declare const LEFT_MENU_KEY$1: "icon-text-align-left";
|
|
1222
|
+
/** 左对齐 */
|
|
1223
|
+
type TEXT_ALIGN_LEFT_ICON_MENUKEY = typeof LEFT_MENU_KEY$1;
|
|
1224
|
+
declare const RIGHT_MENU_KEY$1: "icon-text-align-right";
|
|
1225
|
+
/** 右对齐 */
|
|
1226
|
+
type TEXT_ALIGN_RIGHT_ICON_MENUKEY = typeof RIGHT_MENU_KEY$1;
|
|
1227
|
+
declare const CENTER_MENU_KEY: "icon-text-align-center";
|
|
1228
|
+
/** 居中 */
|
|
1229
|
+
type TEXT_ALIGN_CENTER_ICON_MENUKEY = typeof CENTER_MENU_KEY;
|
|
1230
|
+
declare const JUSTIFY_MENU_KEY: "icon-text-align-justify";
|
|
1231
|
+
/** 两端对齐 */
|
|
1232
|
+
type TEXT_ALIGN_JUSTIFY_ICON_MENUKEY = typeof JUSTIFY_MENU_KEY;
|
|
1233
|
+
|
|
1234
|
+
declare const LINEHEIGHT_MENU_KEY: "icon-lineheight";
|
|
1235
|
+
/** 行高 */
|
|
1236
|
+
type LINEHEIGHT_ICON_MENUKEY = typeof LINEHEIGHT_MENU_KEY;
|
|
1237
|
+
|
|
1238
|
+
/** 插入图片 */
|
|
1239
|
+
declare const MENU_KEY$n: "icon-insert-image";
|
|
1240
|
+
declare const TEXT_MENU_KEY$6: "icon-text-insert-image";
|
|
1241
|
+
declare const BIG_MENU_KEY$j: "big-insert-image";
|
|
1242
|
+
/** 插入图片 */
|
|
1243
|
+
type INSERT_IMAGE_MENUKEY = typeof MENU_KEY$n;
|
|
1244
|
+
type INSERT_IMAGE_TEXT_MENUKEY = typeof TEXT_MENU_KEY$6;
|
|
1245
|
+
type INSERT_IMAGE_BIG_MENUKEY = typeof BIG_MENU_KEY$j;
|
|
1246
|
+
|
|
1247
|
+
/** 新建页 */
|
|
1248
|
+
declare const NEW_MENU_KEY: "icon-new-page";
|
|
1249
|
+
declare const ICON_TEXT_NEW_MENU_KEY: "icon-text-new-page";
|
|
1250
|
+
declare const BIG_NEW_MENU_KEY: "big-new-page";
|
|
1251
|
+
/** 新建页 */
|
|
1252
|
+
type NEW_PAGE_MENUKEY = typeof NEW_MENU_KEY;
|
|
1253
|
+
type NEW_PAGE_BIG_MENUKEY = typeof BIG_NEW_MENU_KEY;
|
|
1254
|
+
type NEW_PAGE_ICON_TEXT_MENUKEY = typeof ICON_TEXT_NEW_MENU_KEY;
|
|
1255
|
+
|
|
1256
|
+
/** 删除页 */
|
|
1257
|
+
declare const REMOVE_MENU_KEY: "icon-remove-page";
|
|
1258
|
+
declare const ICON_TEXT_REMOVE_MENU_KEY: "icon-text-remove-page";
|
|
1259
|
+
declare const BIG_REMOVE_MENU_KEY: "big-remove-page";
|
|
1260
|
+
/** 删除页 */
|
|
1261
|
+
type REMOVE_PAGE_MENUKEY = typeof REMOVE_MENU_KEY;
|
|
1262
|
+
type REMOVE_PAGE_BIG_MENUKEY = typeof BIG_REMOVE_MENU_KEY;
|
|
1263
|
+
type REMOVE_PAGE_ICON_TEXT_MENUKEY = typeof ICON_TEXT_REMOVE_MENU_KEY;
|
|
1264
|
+
|
|
1265
|
+
declare const MENU_KEY$m: "icon-link";
|
|
1266
|
+
declare const BIG_MENU_KEY$i: "big-link";
|
|
1267
|
+
/** link */
|
|
1268
|
+
type INSERT_LINK_ICON_MENUKEY = typeof MENU_KEY$m;
|
|
1269
|
+
type INSERT_LINK_BIG_ICON_MENUKEY = typeof BIG_MENU_KEY$i;
|
|
1270
|
+
|
|
1271
|
+
/** 插入 br */
|
|
1272
|
+
declare const MENU_KEY$l: "icon-insert-br";
|
|
1273
|
+
declare const BIG_MENU_KEY$h: "big-insert-br";
|
|
1274
|
+
/** 插入 br */
|
|
1275
|
+
type INSERT_BR_MENUKEY = typeof MENU_KEY$l;
|
|
1276
|
+
type INSERT_BR_BIG_MENUKEY = typeof BIG_MENU_KEY$h;
|
|
1277
|
+
|
|
1278
|
+
type FindAndReplaceConfig = {
|
|
1279
|
+
/** 查找替换配置 */
|
|
1280
|
+
findAndReplace?: {
|
|
1281
|
+
locale?: {
|
|
1282
|
+
/** 查找 */
|
|
1283
|
+
find_title?: string;
|
|
1284
|
+
/** 在文档内查找 */
|
|
1285
|
+
find_placeholder?: string;
|
|
1286
|
+
/** 替换 */
|
|
1287
|
+
replace_title?: string;
|
|
1288
|
+
/** 替换为 */
|
|
1289
|
+
replace_label?: string;
|
|
1290
|
+
/** 替换全部 */
|
|
1291
|
+
replace_all_title?: string;
|
|
1292
|
+
/** 请输入替换文字 */
|
|
1293
|
+
replace_placeholder?: string;
|
|
1294
|
+
/** 下一个 */
|
|
1295
|
+
next_title?: string;
|
|
1296
|
+
/** 上一个 */
|
|
1297
|
+
prev_title?: string;
|
|
1298
|
+
/** 查找替换 */
|
|
1299
|
+
find_and_replace_bar?: string;
|
|
1300
|
+
};
|
|
1301
|
+
};
|
|
1302
|
+
};
|
|
1303
|
+
|
|
1304
|
+
/** 查找替换 */
|
|
1305
|
+
declare const MENU_KEY$k: "icon-find-and-replace";
|
|
1306
|
+
declare const BIG_MENU_KEY$g: "big-find-and-replace";
|
|
1307
|
+
/** 查找替换 */
|
|
1308
|
+
type FIND_AND_REPLACE_MENUKEY = typeof MENU_KEY$k;
|
|
1309
|
+
type FIND_AND_REPLACE_BIG_MENUKEY = typeof BIG_MENU_KEY$g;
|
|
1310
|
+
|
|
1311
|
+
/** merge cells */
|
|
1312
|
+
declare const MENU_KEY$j: "icon-merge-cells";
|
|
1313
|
+
declare const TEXT_MENU_KEY$5: "icon-text-merge-cells";
|
|
1314
|
+
declare const BIG_MENU_KEY$f: "big-merge-cells";
|
|
1315
|
+
/** merge cells */
|
|
1316
|
+
type MERGE_CELLS_MENUKEY = typeof MENU_KEY$j;
|
|
1317
|
+
type MERGE_CELLS_TEXT_MENUKEY = typeof TEXT_MENU_KEY$5;
|
|
1318
|
+
type MERGE_CELLS_ICON_MENUKEY = typeof BIG_MENU_KEY$f;
|
|
1319
|
+
|
|
1320
|
+
/** delete columns */
|
|
1321
|
+
declare const MENU_KEY$i: "icon-delete-columns";
|
|
1322
|
+
declare const TEXT_MENU_KEY$4: "icon-text-delete-columns";
|
|
1323
|
+
declare const BIG_MENU_KEY$e: "big-delete-columns";
|
|
1324
|
+
/** delete columns */
|
|
1325
|
+
type DELETE_COLUMNS_MENUKEY = typeof MENU_KEY$i;
|
|
1326
|
+
type DELETE_COLUMNS_TEXT_MENUKEY = typeof TEXT_MENU_KEY$4;
|
|
1327
|
+
type DELETE_COLUMNS_ICON_MENUKEY = typeof BIG_MENU_KEY$e;
|
|
1328
|
+
|
|
1329
|
+
/** split cells */
|
|
1330
|
+
declare const MENU_KEY$h: "icon-split-cells";
|
|
1331
|
+
declare const TEXT_MENU_KEY$3: "icon-text-split-cells";
|
|
1332
|
+
declare const BIG_MENU_KEY$d: "big-split-cells";
|
|
1333
|
+
/** split cells */
|
|
1334
|
+
type SPLIT_CELLS_MENUKEY = typeof MENU_KEY$h;
|
|
1335
|
+
type SPLIT_CELLS_TEXT_MENUKEY = typeof TEXT_MENU_KEY$3;
|
|
1336
|
+
type SPLIT_CELLS_ICON_MENUKEY = typeof BIG_MENU_KEY$d;
|
|
1337
|
+
|
|
1338
|
+
/** delete table */
|
|
1339
|
+
declare const MENU_KEY$g: "icon-delete-table";
|
|
1340
|
+
declare const TEXT_MENU_KEY$2: "icon-text-delete-table";
|
|
1341
|
+
declare const BIG_MENU_KEY$c: "big-delete-table";
|
|
1342
|
+
/** delete table */
|
|
1343
|
+
type DELETE_TABLE_MENUKEY = typeof MENU_KEY$g;
|
|
1344
|
+
type DELETE_TABLE_TEXT_MENUKEY = typeof TEXT_MENU_KEY$2;
|
|
1345
|
+
type DELETE_TABLE_ICON_MENUKEY = typeof BIG_MENU_KEY$c;
|
|
1346
|
+
|
|
1347
|
+
/** delete rows */
|
|
1348
|
+
declare const MENU_KEY$f: "icon-delete-rows";
|
|
1349
|
+
declare const TEXT_MENU_KEY$1: "icon-text-delete-rows";
|
|
1350
|
+
declare const BIG_MENU_KEY$b: "big-delete-rows";
|
|
1351
|
+
/** delete rows */
|
|
1352
|
+
type DELETE_ROWS_MENUKEY = typeof MENU_KEY$f;
|
|
1353
|
+
type DELETE_ROWS_TEXT_MENUKEY = typeof TEXT_MENU_KEY$1;
|
|
1354
|
+
type DELETE_ROWS_ICON_MENUKEY = typeof BIG_MENU_KEY$b;
|
|
1355
|
+
|
|
1356
|
+
/** insert row top */
|
|
1357
|
+
declare const TOP_MENU_KEY: "icon-insert-row-top";
|
|
1358
|
+
declare const TOP_TEXT_MENU_KEY: "icon-text-insert-row-top";
|
|
1359
|
+
declare const TOP_BIG_MENU_KEY: "big-insert-row-top";
|
|
1360
|
+
/** insert row top */
|
|
1361
|
+
type INSERT_ROW_TOP_MENUKEY = typeof TOP_MENU_KEY;
|
|
1362
|
+
type INSERT_ROW_TOP_TEXT_MENUKEY = typeof TOP_TEXT_MENU_KEY;
|
|
1363
|
+
type INSERT_ROW_TOP_ICON_MENUKEY = typeof TOP_BIG_MENU_KEY;
|
|
1364
|
+
/** insert row bottom */
|
|
1365
|
+
declare const BOTTOM_MENU_KEY: "icon-insert-row-bottom";
|
|
1366
|
+
declare const BOTTOM_TEXT_MENU_KEY: "icon-text-insert-row-bottom";
|
|
1367
|
+
declare const BOTTOM_BIG_MENU_KEY: "big-insert-row-bottom";
|
|
1368
|
+
/** insert row bottom */
|
|
1369
|
+
type INSERT_ROW_BOTTOM_MENUKEY = typeof BOTTOM_MENU_KEY;
|
|
1370
|
+
type INSERT_ROW_BOTTOM_TEXT_MENUKEY = typeof BOTTOM_TEXT_MENU_KEY;
|
|
1371
|
+
type INSERT_ROW_BOTTOM_ICON_MENUKEY = typeof BOTTOM_BIG_MENU_KEY;
|
|
1372
|
+
|
|
1373
|
+
/** insert column left */
|
|
1374
|
+
declare const LEFT_MENU_KEY: "icon-insert-column-left";
|
|
1375
|
+
declare const LEFT_TEXT_MENU_KEY: "icon-text-insert-column-left";
|
|
1376
|
+
declare const LEFT_BIG_MENU_KEY: "big-insert-column-left";
|
|
1377
|
+
/** insert column left */
|
|
1378
|
+
type INSERT_COLUMN_LEFT_MENUKEY = typeof LEFT_MENU_KEY;
|
|
1379
|
+
type INSERT_COLUMN_LEFT_TEXT_MENUKEY = typeof LEFT_TEXT_MENU_KEY;
|
|
1380
|
+
type INSERT_COLUMN_LEFT_ICON_MENUKEY = typeof LEFT_BIG_MENU_KEY;
|
|
1381
|
+
/** insert column right */
|
|
1382
|
+
declare const RIGHT_MENU_KEY: "icon-insert-column-right";
|
|
1383
|
+
declare const RIGHT_TEXT_MENU_KEY: "icon-text-insert-column-right";
|
|
1384
|
+
declare const RIGHT_BIG_MENU_KEY: "big-insert-column-right";
|
|
1385
|
+
/** insert column right */
|
|
1386
|
+
type INSERT_COLUMN_RIGHT_MENUKEY = typeof RIGHT_MENU_KEY;
|
|
1387
|
+
type INSERT_COLUMN_RIGHT_TEXT_MENUKEY = typeof RIGHT_TEXT_MENU_KEY;
|
|
1388
|
+
type INSERT_COLUMN_RIGHT_ICON_MENUKEY = typeof RIGHT_BIG_MENU_KEY;
|
|
1389
|
+
|
|
1390
|
+
declare const CELL_LEFT_MENU_KEY: "icon-cell-text-align-left";
|
|
1391
|
+
declare const CELL_CENTER_MENU_KEY$1: "icon-cell-text-align-center";
|
|
1392
|
+
declare const CELL_RIGHT_MENU_KEY: "icon-cell-text-align-right";
|
|
1393
|
+
type CELL_TEXT_ALIGN_LEFT_MENUKEY = typeof CELL_LEFT_MENU_KEY;
|
|
1394
|
+
type CELL_TEXT_ALIGN_CENTER_MENUKEY = typeof CELL_CENTER_MENU_KEY$1;
|
|
1395
|
+
type CELL_TEXT_ALIGN_RIGHT_MENUKEY = typeof CELL_RIGHT_MENU_KEY;
|
|
1396
|
+
|
|
1397
|
+
declare const CELL_TOP_MENU_KEY: "icon-cell-vertical-align-top";
|
|
1398
|
+
declare const CELL_CENTER_MENU_KEY: "icon-cell-vertical-align-center";
|
|
1399
|
+
declare const CELL_BOTTOM_MENU_KEY: "icon-cell-vertical-align-bottom";
|
|
1400
|
+
type CELL_VERTICAL_ALIGN_TOP_MENUKEY = typeof CELL_TOP_MENU_KEY;
|
|
1401
|
+
type CELL_VERTICAL_ALIGN_CENTER_MENUKEY = typeof CELL_CENTER_MENU_KEY;
|
|
1402
|
+
type CELL_VERTICAL_ALIGN_BOTTOM_MENUKEY = typeof CELL_BOTTOM_MENU_KEY;
|
|
1403
|
+
|
|
1404
|
+
/** 插入 formula */
|
|
1405
|
+
declare const MENU_KEY$e: "icon-insert-formula";
|
|
1406
|
+
declare const BIG_MENU_KEY$a: "big-insert-formula";
|
|
1407
|
+
/** 插入 formula */
|
|
1408
|
+
type INSERT_FORMULA_MENUKEY = typeof MENU_KEY$e;
|
|
1409
|
+
type INSERT_FORMULA_BIG_MENUKEY = typeof BIG_MENU_KEY$a;
|
|
1410
|
+
|
|
1411
|
+
/** ctext */
|
|
1412
|
+
declare const ICON_MENU_KEY$b: "icon-ctext";
|
|
1413
|
+
/** ctext */
|
|
1414
|
+
type CTEXT_ICON_MENUKEY = typeof ICON_MENU_KEY$b;
|
|
1415
|
+
/** ctext */
|
|
1416
|
+
declare const ICON_TEXT_MENU_KEY$e: "icon-text-ctext";
|
|
1417
|
+
/** ctext */
|
|
1418
|
+
type CTEXT_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$e;
|
|
1419
|
+
|
|
1420
|
+
/** cselect */
|
|
1421
|
+
declare const ICON_MENU_KEY$a: "icon-cselect";
|
|
1422
|
+
/** cselect */
|
|
1423
|
+
type CSELECT_ICON_MENUKEY = typeof ICON_MENU_KEY$a;
|
|
1424
|
+
/** cselect */
|
|
1425
|
+
declare const ICON_TEXT_MENU_KEY$d: "icon-text-cselect";
|
|
1426
|
+
/** cselect */
|
|
1427
|
+
type CSELECT_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$d;
|
|
1428
|
+
|
|
1429
|
+
/** csign */
|
|
1430
|
+
declare const ICON_MENU_KEY$9: "icon-csign";
|
|
1431
|
+
/** csign */
|
|
1432
|
+
type CSIGN_ICON_MENUKEY = typeof ICON_MENU_KEY$9;
|
|
1433
|
+
/** csign */
|
|
1434
|
+
declare const ICON_TEXT_MENU_KEY$c: "icon-text-csign";
|
|
1435
|
+
/** csign */
|
|
1436
|
+
type CSIGN_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$c;
|
|
1437
|
+
|
|
1438
|
+
/** cradio */
|
|
1439
|
+
declare const ICON_MENU_KEY$8: "icon-cradio";
|
|
1440
|
+
/** cradio */
|
|
1441
|
+
type CRADIO_ICON_MENUKEY = typeof ICON_MENU_KEY$8;
|
|
1442
|
+
/** cradio */
|
|
1443
|
+
declare const ICON_TEXT_MENU_KEY$b: "icon-text-cradio";
|
|
1444
|
+
/** cradio */
|
|
1445
|
+
type CRADIO_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$b;
|
|
1446
|
+
|
|
1447
|
+
/** cdate */
|
|
1448
|
+
declare const ICON_MENU_KEY$7: "icon-cdate";
|
|
1449
|
+
/** cdate */
|
|
1450
|
+
type CDATE_ICON_MENUKEY = typeof ICON_MENU_KEY$7;
|
|
1451
|
+
/** cdate */
|
|
1452
|
+
declare const ICON_TEXT_MENU_KEY$a: "icon-text-cdate";
|
|
1453
|
+
/** cdate */
|
|
1454
|
+
type CDATE_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$a;
|
|
1455
|
+
|
|
1456
|
+
/** ccheckbox */
|
|
1457
|
+
declare const ICON_MENU_KEY$6: "icon-ccheckbox";
|
|
1458
|
+
/** ccheckbox */
|
|
1459
|
+
type CCHECKBOX_ICON_MENUKEY = typeof ICON_MENU_KEY$6;
|
|
1460
|
+
/** ccheckbox */
|
|
1461
|
+
declare const ICON_TEXT_MENU_KEY$9: "icon-text-ccheckbox";
|
|
1462
|
+
/** ccheckbox */
|
|
1463
|
+
type CCHECKBOX_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$9;
|
|
1464
|
+
|
|
1465
|
+
/** area */
|
|
1466
|
+
declare const ICON_MENU_KEY$5: "icon-area";
|
|
1467
|
+
/** area */
|
|
1468
|
+
type AREA_ICON_MENUKEY = typeof ICON_MENU_KEY$5;
|
|
1469
|
+
/** area */
|
|
1470
|
+
declare const ICON_TEXT_MENU_KEY$8: "icon-text-area";
|
|
1471
|
+
/** area */
|
|
1472
|
+
type AREA_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$8;
|
|
1473
|
+
|
|
1474
|
+
/** section */
|
|
1475
|
+
declare const ICON_MENU_KEY$4: "icon-section";
|
|
1476
|
+
/** section */
|
|
1477
|
+
type SECTION_ICON_MENUKEY = typeof ICON_MENU_KEY$4;
|
|
1478
|
+
/** section */
|
|
1479
|
+
declare const ICON_TEXT_MENU_KEY$7: "icon-text-section";
|
|
1480
|
+
/** section */
|
|
1481
|
+
type SECTION_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$7;
|
|
1482
|
+
|
|
1483
|
+
/** page-margins */
|
|
1484
|
+
declare const MENU_KEY$d: "icon-page-margins";
|
|
1485
|
+
declare const BIG_MENU_KEY$9: "big-page-margins";
|
|
1486
|
+
/** page-margins */
|
|
1487
|
+
type PAGE_MARGINS_MENUKEY = typeof MENU_KEY$d;
|
|
1488
|
+
type PAGE_MARGINS_BIG_MENUKEY = typeof BIG_MENU_KEY$9;
|
|
1489
|
+
|
|
1490
|
+
/** 方向 */
|
|
1491
|
+
declare const MENU_KEY$c: "icon-page-orientation";
|
|
1492
|
+
declare const BIG_MENU_KEY$8: "big-page-orientation";
|
|
1493
|
+
/** 方向 */
|
|
1494
|
+
type PAGE_ORIENTATION_MENUKEY = typeof MENU_KEY$c;
|
|
1495
|
+
type PAGE_ORIENTATION_BIG_MENUKEY = typeof BIG_MENU_KEY$8;
|
|
1496
|
+
|
|
1497
|
+
/** size */
|
|
1498
|
+
declare const MENU_KEY$b: "icon-page-size";
|
|
1499
|
+
declare const BIG_MENU_KEY$7: "big-page-size";
|
|
1500
|
+
/** size */
|
|
1501
|
+
type PAGE_SIZE_MENUKEY = typeof MENU_KEY$b;
|
|
1502
|
+
type PAGE_SIZE_BIG_MENUKEY = typeof BIG_MENU_KEY$7;
|
|
1503
|
+
|
|
1504
|
+
/** page-size-width */
|
|
1505
|
+
declare const PAGE_SIZE_WIDTH_MENU_KEY: "input-page-size-width";
|
|
1506
|
+
/** page-size-width */
|
|
1507
|
+
type PAGE_SIZE_WIDTH_MENUKEY = typeof PAGE_SIZE_WIDTH_MENU_KEY;
|
|
1508
|
+
/** page-size-height */
|
|
1509
|
+
declare const PAGE_SIZE_HEIGHT_MENU_KEY: "input-page-size-height";
|
|
1510
|
+
/** page-size-height */
|
|
1511
|
+
type PAGE_SIZE_HEIGHT_MENUKEY = typeof PAGE_SIZE_HEIGHT_MENU_KEY;
|
|
1512
|
+
/** page-margins-bottom */
|
|
1513
|
+
declare const PAGE_MARGINS_BOTTOM_MENU_KEY: "input-page-margins-bottom";
|
|
1514
|
+
/** page-margins-top */
|
|
1515
|
+
type PAGE_MARGINS_BOTTOM_MENUKEY = typeof PAGE_MARGINS_BOTTOM_MENU_KEY;
|
|
1516
|
+
/** page-margins-top */
|
|
1517
|
+
declare const PAGE_MARGINS_TOP_MENU_KEY: "input-page-margins-top";
|
|
1518
|
+
/** page-margins-top */
|
|
1519
|
+
type PAGE_MARGINS_TOP_MENUKEY = typeof PAGE_MARGINS_TOP_MENU_KEY;
|
|
1520
|
+
/** page-margins-right */
|
|
1521
|
+
declare const PAGE_MARGINS_RIGHT_MENU_KEY: "input-page-margins-right";
|
|
1522
|
+
/** page-margins-right */
|
|
1523
|
+
type PAGE_MARGINS_RIGHT_MENUKEY = typeof PAGE_MARGINS_RIGHT_MENU_KEY;
|
|
1524
|
+
/** page-margins-left */
|
|
1525
|
+
declare const PAGE_MARGINS_LEFT_MENU_KEY: "input-page-margins-left";
|
|
1526
|
+
/** page-margins-left */
|
|
1527
|
+
type PAGE_MARGINS_LEFT_MENUKEY = typeof PAGE_MARGINS_LEFT_MENU_KEY;
|
|
1528
|
+
|
|
1529
|
+
declare const MENU_KEY$a: "icon-fullscreen";
|
|
1530
|
+
type FULLSCREEN_ICON_MENU_KEY = typeof MENU_KEY$a;
|
|
1531
|
+
|
|
1532
|
+
type InnerStatusBarsConfig<T = string> = {
|
|
1533
|
+
/** 底部状态栏配置 */
|
|
1534
|
+
statusbars?: {
|
|
1535
|
+
locale?: {
|
|
1536
|
+
/** 分页信息:当前{page},共{count}页 */
|
|
1537
|
+
pages_info?: string;
|
|
1538
|
+
/** 分页模式 */
|
|
1539
|
+
paging_mode?: string;
|
|
1540
|
+
/** 无分页 */
|
|
1541
|
+
paging_mode_none?: string;
|
|
1542
|
+
/** 虚拟分页 */
|
|
1543
|
+
paging_mode_line?: string;
|
|
1544
|
+
/** 打印分页 */
|
|
1545
|
+
paging_mode_print?: string;
|
|
1546
|
+
/** 缩放 */
|
|
1547
|
+
zoom?: string;
|
|
1548
|
+
/** 请通过快捷键 Ctrl +/- 缩放 */
|
|
1549
|
+
zoom_placeholder?: string;
|
|
1550
|
+
/** 全屏 */
|
|
1551
|
+
fullscreen?: string;
|
|
1552
|
+
};
|
|
1553
|
+
/** 左侧:页码,字数统计 */
|
|
1554
|
+
leftMenus: T[];
|
|
1555
|
+
/** 右侧:缩放,全屏 */
|
|
1556
|
+
rightMenus: T[];
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
/** 页码状态 */
|
|
1561
|
+
declare const MENU_KEY$9: "page-status";
|
|
1562
|
+
/** 页码状态 */
|
|
1563
|
+
type PAGE_STATUS_MENUKEY = typeof MENU_KEY$9;
|
|
1564
|
+
|
|
1565
|
+
/** 缩放状态 */
|
|
1566
|
+
declare const MENU_KEY$8: "zoom-status";
|
|
1567
|
+
/** 缩放状态 */
|
|
1568
|
+
type ZOOM_STATUS_MENUKEY = typeof MENU_KEY$8;
|
|
1569
|
+
|
|
1570
|
+
type MenuKey$1 = PAGE_STATUS_MENUKEY | ZOOM_STATUS_MENUKEY | FULLSCREEN_ICON_MENU_KEY | PAGING_MODE_MENUKEY;
|
|
1571
|
+
type StatusBarsConfig = InnerStatusBarsConfig<MenuKey$1>;
|
|
1572
|
+
|
|
1573
|
+
/** 分页模式 */
|
|
1574
|
+
declare const MENU_KEY$7: "icon-paging-mode";
|
|
1575
|
+
declare const BIG_MENU_KEY$6: "big-paging-mode";
|
|
1576
|
+
/** 分页模式 */
|
|
1577
|
+
type PAGING_MODE_MENUKEY = typeof MENU_KEY$7;
|
|
1578
|
+
type PAGING_MODE_BIG_MENUKEY = typeof BIG_MENU_KEY$6;
|
|
1579
|
+
|
|
1580
|
+
/** 视图模式 */
|
|
1581
|
+
declare const MENU_KEY$6: "icon-view-mode";
|
|
1582
|
+
declare const BIG_MENU_KEY$5: "big-view-mode";
|
|
1583
|
+
/** 视图模式 */
|
|
1584
|
+
type VIEW_MODE_MENUKEY = typeof MENU_KEY$6;
|
|
1585
|
+
type VIEW_MODE_BIG_MENUKEY = typeof BIG_MENU_KEY$5;
|
|
1586
|
+
|
|
1587
|
+
type PrintConfig = {
|
|
1588
|
+
/** 打印配置 */
|
|
1589
|
+
print?: {
|
|
1590
|
+
locale?: {
|
|
1591
|
+
/** 打印 */
|
|
1592
|
+
print?: string;
|
|
1593
|
+
/** 打印预览 */
|
|
1594
|
+
preview?: string;
|
|
1595
|
+
/** 取消预览 */
|
|
1596
|
+
exitPreview?: string;
|
|
1597
|
+
};
|
|
1598
|
+
};
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1601
|
+
/** 打印预览 */
|
|
1602
|
+
declare const MENU_KEY$5: "icon-preview-print";
|
|
1603
|
+
declare const ICON_TEXT_MENU_KEY$6: "icon-text-preview-print";
|
|
1604
|
+
declare const BIG_MENU_KEY$4: "big-preview-print";
|
|
1605
|
+
/** 打印预览 */
|
|
1606
|
+
type PREVIEW_PRINT_MENUKEY = typeof MENU_KEY$5;
|
|
1607
|
+
type PREVIEW_PRINT_BIG_MENUKEY = typeof BIG_MENU_KEY$4;
|
|
1608
|
+
type PREVIEW_PRINT_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$6;
|
|
1609
|
+
|
|
1610
|
+
/** 直接打印 */
|
|
1611
|
+
declare const MENU_KEY$4: "icon-print";
|
|
1612
|
+
declare const ICON_TEXT_MENU_KEY$5: "icon-text-print";
|
|
1613
|
+
declare const BIG_MENU_KEY$3: "big-print";
|
|
1614
|
+
/** 直接打印 */
|
|
1615
|
+
type PRINT_MENUKEY = typeof MENU_KEY$4;
|
|
1616
|
+
type PRINT_BIG_MENUKEY = typeof BIG_MENU_KEY$3;
|
|
1617
|
+
type PRINT_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$5;
|
|
1618
|
+
|
|
1619
|
+
type CTagConfig = {
|
|
1620
|
+
/** 标签控件 */
|
|
1621
|
+
ctag?: {
|
|
1622
|
+
defaultStyle?: (attrs: CTagAttrs) => Partial<CSSStyleDeclaration>;
|
|
1623
|
+
locale?: {
|
|
1624
|
+
/** 插入标签 */
|
|
1625
|
+
insert_bar?: string;
|
|
1626
|
+
/** Html */
|
|
1627
|
+
html_title?: string;
|
|
1628
|
+
/** 禁删 */
|
|
1629
|
+
not_delete_title?: string;
|
|
1630
|
+
/** 只读 */
|
|
1631
|
+
readonly_title?: string;
|
|
1632
|
+
/** 数据 */
|
|
1633
|
+
data_title?: string;
|
|
1634
|
+
/** 名称 */
|
|
1635
|
+
name_title?: string;
|
|
1636
|
+
/** 编码 */
|
|
1637
|
+
code_title?: string;
|
|
1638
|
+
/** 标签 */
|
|
1639
|
+
panel_title?: string;
|
|
1640
|
+
};
|
|
1641
|
+
/** 单击事件 */
|
|
1642
|
+
onClick?: (event: MouseEvent, attrs: CTagAttrs, update?: (newAttrs: Partial<CTagAttrs>) => Promise<void>) => void;
|
|
1643
|
+
/** 双击事件 */
|
|
1644
|
+
onDblClick?: (event: MouseEvent, attrs: CTagAttrs, update?: (newAttrs: Partial<CTagAttrs>) => Promise<void>) => void;
|
|
1645
|
+
/** 自定义渲染方法 */
|
|
1646
|
+
render?: (attrs: CTagAttrs, update?: (newAttrs: Partial<CTagAttrs>) => Promise<void>) => HTMLElement;
|
|
1647
|
+
} & CtrlRightPanelInputRendered<CTagAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
1648
|
+
};
|
|
1649
|
+
interface DefCTagAttrs extends DefInlineBaseAttrs {
|
|
1650
|
+
/** 自定义 html 结构 */
|
|
1651
|
+
readonly html?: string;
|
|
1652
|
+
/** 自定义结构 */
|
|
1653
|
+
readonly data?: Record<string, any>;
|
|
1654
|
+
}
|
|
1655
|
+
type CTagAttrs = DefCTagAttrs & FoAttrs;
|
|
1656
|
+
type CTagNodeType = NodeJSONType<typeof CTAG_TYPE_NAME, CTagAttrs>;
|
|
1657
|
+
|
|
1658
|
+
/** ctag */
|
|
1659
|
+
declare const ICON_MENU_KEY$3: "icon-ctag";
|
|
1660
|
+
/** ctag */
|
|
1661
|
+
type CTAG_ICON_MENUKEY = typeof ICON_MENU_KEY$3;
|
|
1662
|
+
/** ctag */
|
|
1663
|
+
declare const ICON_TEXT_MENU_KEY$4: "icon-text-ctag";
|
|
1664
|
+
/** ctag */
|
|
1665
|
+
type CTAG_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$4;
|
|
1666
|
+
|
|
1667
|
+
/** auto-column-width */
|
|
1668
|
+
declare const MENU_KEY$3: "icon-auto-column-width";
|
|
1669
|
+
declare const TEXT_MENU_KEY: "icon-text-auto-column-width";
|
|
1670
|
+
declare const BIG_MENU_KEY$2: "big-auto-column-width";
|
|
1671
|
+
/** auto-column-width */
|
|
1672
|
+
type AUTO_COLUMN_WIDTH_MENUKEY = typeof MENU_KEY$3;
|
|
1673
|
+
type AUTO_COLUMN_WIDTH_TEXT_MENUKEY = typeof TEXT_MENU_KEY;
|
|
1674
|
+
type AUTO_COLUMN_WIDTH_ICON_MENUKEY = typeof BIG_MENU_KEY$2;
|
|
1675
|
+
|
|
1676
|
+
/** cqrcode */
|
|
1677
|
+
declare const ICON_MENU_KEY$2: "icon-cqrcode";
|
|
1678
|
+
/** cqrcode */
|
|
1679
|
+
type CQRCODE_ICON_MENUKEY = typeof ICON_MENU_KEY$2;
|
|
1680
|
+
/** cqrcode */
|
|
1681
|
+
declare const ICON_TEXT_MENU_KEY$3: "icon-text-cqrcode";
|
|
1682
|
+
/** cqrcode */
|
|
1683
|
+
type CQRCODE_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$3;
|
|
1684
|
+
/** barcode */
|
|
1685
|
+
declare const BARCODE_ICON_MENU_KEY: "icon-barcode";
|
|
1686
|
+
/** barcode */
|
|
1687
|
+
type BARCODE_ICON_MENUKEY = typeof BARCODE_ICON_MENU_KEY;
|
|
1688
|
+
/** barcode */
|
|
1689
|
+
declare const BARCODE_ICON_TEXT_MENU_KEY: "icon-text-barcode";
|
|
1690
|
+
/** barcode */
|
|
1691
|
+
type BARCODE_ICON_TEXT_MENUKEY = typeof BARCODE_ICON_TEXT_MENU_KEY;
|
|
1692
|
+
|
|
1693
|
+
declare const MENU_KEY$2: "cell-bgcolor";
|
|
1694
|
+
/** 颜色背景色 */
|
|
1695
|
+
type CELL_BGCOLOR_ICON_MENUKEY = typeof MENU_KEY$2;
|
|
1696
|
+
|
|
1697
|
+
/** table border */
|
|
1698
|
+
declare const MENU_KEY$1: "icon-cell-border";
|
|
1699
|
+
declare const BIG_MENU_KEY$1: "big-cell-border";
|
|
1700
|
+
/** table border */
|
|
1701
|
+
type CELL_BORDER_MENUKEY = typeof MENU_KEY$1;
|
|
1702
|
+
type CELL_BORDER_BIG_MENUKEY = typeof BIG_MENU_KEY$1;
|
|
1703
|
+
|
|
1704
|
+
declare const LETTERSPACING_MENU_KEY: "icon-letterspacing";
|
|
1705
|
+
/** 字间距 */
|
|
1706
|
+
type LETTERSPACING_ICON_MENUKEY = typeof LETTERSPACING_MENU_KEY;
|
|
1707
|
+
|
|
1708
|
+
declare const MARGINTOP_MENU_KEY: "icon-marginTop";
|
|
1709
|
+
declare const MARGINBOTTOM_MENU_KEY: "icon-marginBottom";
|
|
1710
|
+
/** 段前距 */
|
|
1711
|
+
type MARGINTOP_ICON_MENUKEY = typeof MARGINTOP_MENU_KEY;
|
|
1712
|
+
/** 段后距 */
|
|
1713
|
+
type MARGINBOTTOM_ICON_MENUKEY = typeof MARGINBOTTOM_MENU_KEY;
|
|
1714
|
+
|
|
1715
|
+
type CustomConfig = {
|
|
1716
|
+
/** 自定义控件 */
|
|
1717
|
+
custom?: {
|
|
1718
|
+
defaultStyle?: (attrs: CustomAttrs) => Partial<CSSStyleDeclaration>;
|
|
1719
|
+
locale?: {
|
|
1720
|
+
/** 自定义控件 */
|
|
1721
|
+
insert_bar?: string;
|
|
1722
|
+
/** 禁删 */
|
|
1723
|
+
not_delete_title?: string;
|
|
1724
|
+
/** 只读 */
|
|
1725
|
+
readonly_title?: string;
|
|
1726
|
+
/** 数据 */
|
|
1727
|
+
data_title?: string;
|
|
1728
|
+
/** 名称 */
|
|
1729
|
+
name_title?: string;
|
|
1730
|
+
/** 编码 */
|
|
1731
|
+
code_title?: string;
|
|
1732
|
+
/** 自定义控件 */
|
|
1733
|
+
panel_title?: string;
|
|
1734
|
+
};
|
|
1735
|
+
/**
|
|
1736
|
+
* 自定义渲染方法
|
|
1737
|
+
* @param attrs 渲染时的节点属性
|
|
1738
|
+
* @param dom 渲染对应的 dom 节点
|
|
1739
|
+
* @param updateAttrs 更新节点属性,readonly 时为空
|
|
1740
|
+
* @returns { dom }
|
|
1741
|
+
*/
|
|
1742
|
+
render: (attrs: CustomAttrs, dom: HTMLElement, updateAttrs?: (newAttrs: CustomAttrs) => void) => {
|
|
1743
|
+
updateDOM: (attrs: CustomAttrs) => void;
|
|
1744
|
+
};
|
|
1745
|
+
} & CtrlRightPanelInputRendered<CustomAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
1746
|
+
};
|
|
1747
|
+
interface DefCustomAttrs extends DefInlineBaseAttrs {
|
|
1748
|
+
/** 自定义结构 */
|
|
1749
|
+
readonly data?: Record<string, any>;
|
|
1750
|
+
}
|
|
1751
|
+
type CustomAttrs = DefCustomAttrs & FoAttrs;
|
|
1752
|
+
|
|
1753
|
+
/** custom */
|
|
1754
|
+
declare const ICON_MENU_KEY$1: "icon-custom";
|
|
1755
|
+
/** custom */
|
|
1756
|
+
type CUSTOM_ICON_MENUKEY = typeof ICON_MENU_KEY$1;
|
|
1757
|
+
/** custom */
|
|
1758
|
+
declare const ICON_TEXT_MENU_KEY$2: "icon-text-custom";
|
|
1759
|
+
/** custom */
|
|
1760
|
+
type CUSTOM_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$2;
|
|
1761
|
+
|
|
1762
|
+
type InlineCustomConfig = {
|
|
1763
|
+
/** 自定义控件 */
|
|
1764
|
+
inlinecustom?: {
|
|
1765
|
+
defaultStyle?: (attrs: InlineCustomAttrs) => Partial<CSSStyleDeclaration>;
|
|
1766
|
+
locale?: {
|
|
1767
|
+
/** 自定义行内控件 */
|
|
1768
|
+
insert_bar?: string;
|
|
1769
|
+
/** 禁删 */
|
|
1770
|
+
not_delete_title?: string;
|
|
1771
|
+
/** 只读 */
|
|
1772
|
+
readonly_title?: string;
|
|
1773
|
+
/** 数据 */
|
|
1774
|
+
data_title?: string;
|
|
1775
|
+
/** 名称 */
|
|
1776
|
+
name_title?: string;
|
|
1777
|
+
/** 编码 */
|
|
1778
|
+
code_title?: string;
|
|
1779
|
+
/** 自定义控件 */
|
|
1780
|
+
panel_title?: string;
|
|
1781
|
+
};
|
|
1782
|
+
/**
|
|
1783
|
+
* 自定义渲染方法
|
|
1784
|
+
* @param attrs 渲染时的节点属性
|
|
1785
|
+
* @param dom 渲染对应的 dom 节点
|
|
1786
|
+
* @param updateAttrs 更新节点属性,readonly 时为空
|
|
1787
|
+
* @returns { dom }
|
|
1788
|
+
*/
|
|
1789
|
+
render: (attrs: InlineCustomAttrs, dom: HTMLElement, updateAttrs?: (newAttrs: InlineCustomAttrs) => void) => {
|
|
1790
|
+
updateDOM: (attrs: InlineCustomAttrs) => void;
|
|
1791
|
+
};
|
|
1792
|
+
} & CtrlRightPanelInputRendered<InlineCustomAttrs, 'code' | 'name'> & CtrlEventConfig;
|
|
1793
|
+
};
|
|
1794
|
+
interface DefInlineCustomAttrs extends DefInlineBaseAttrs {
|
|
1795
|
+
/** 自定义结构 */
|
|
1796
|
+
readonly data?: Record<string, any>;
|
|
1797
|
+
}
|
|
1798
|
+
type InlineCustomAttrs = DefInlineCustomAttrs & FoAttrs;
|
|
1799
|
+
|
|
1800
|
+
/** InlineCustom */
|
|
1801
|
+
declare const ICON_MENU_KEY: "icon-inlinecustom";
|
|
1802
|
+
/** InlineCustom */
|
|
1803
|
+
type INLINECUSTOM_ICON_MENUKEY = typeof ICON_MENU_KEY;
|
|
1804
|
+
/** InlineCustom */
|
|
1805
|
+
declare const ICON_TEXT_MENU_KEY$1: "icon-text-inlinecustom";
|
|
1806
|
+
/** InlineCustom */
|
|
1807
|
+
type INLINECUSTOM_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY$1;
|
|
1808
|
+
|
|
1809
|
+
/** 导出文件 */
|
|
1810
|
+
declare const MENU_KEY: "icon-export-file";
|
|
1811
|
+
declare const ICON_TEXT_MENU_KEY: "icon-text-export-file";
|
|
1812
|
+
declare const BIG_MENU_KEY: "big-export-file";
|
|
1813
|
+
/** 导出文件 */
|
|
1814
|
+
type EXPORT_FILE_MENUKEY = typeof MENU_KEY;
|
|
1815
|
+
type EXPORT_FILE_BIG_MENUKEY = typeof BIG_MENU_KEY;
|
|
1816
|
+
type EXPORT_FILE_ICON_TEXT_MENUKEY = typeof ICON_TEXT_MENU_KEY;
|
|
1817
|
+
|
|
1818
|
+
/** 导出文件 */
|
|
1819
|
+
type MenuKey = DOWNLOAD_FILE_MENUKEY | IMPORT_FILE_MENUKEY | INSERT_TABLE_MENUKEY | INSERT_TABLE_BIG_MENUKEY | INSERT_TABLE_TEXT_MENUKEY | REDO_ICON_MENUKEY | REDO_ICON_TEXT_MENUKEY | UNDO_ICON_MENUKEY | CUT_ICON_TEXT_MENUKEY | CUT_ICON_MENUKEY | COPY_ICON_MENUKEY | PASTE_ICON_MENUKEY | SELECTALL_ICON_MENUKEY | SELECTALL_ICON_TEXT_MENUKEY | PASTE_ICON_TEXT_MENUKEY | COPY_ICON_TEXT_MENUKEY | ITALIC_ICON_MENUKEY | BOLD_ICON_MENUKEY | UNDERLINE_ICON_MENUKEY | SUB_ICON_MENUKEY | SUP_ICON_MENUKEY | INCREASE_FONTSIZE_ICON_MENUKEY | DECREASE_FONTSIZE_ICON_MENUKEY | STRIKE_ICON_MENUKEY | COLOR_ICON_MENUKEY | FONTFAMILY_ICON_MENUKEY | FONTSIZE_ICON_MENUKEY | FORMAT_PAINTER_ICON_MENUKEY | LINEHEIGHT_ICON_MENUKEY | LETTERSPACING_ICON_MENUKEY | MARGINBOTTOM_ICON_MENUKEY | MARGINTOP_ICON_MENUKEY | CLEAR_STYLE_ICON_MENUKEY | PLACEHOLDER_ICON_MENUKEY | DECREASE_INDENT_ICON_MENUKEY | INCREASE_INDENT_ICON_MENUKEY | TEXT_ALIGN_JUSTIFY_ICON_MENUKEY | TEXT_ALIGN_CENTER_ICON_MENUKEY | TEXT_ALIGN_LEFT_ICON_MENUKEY | TEXT_ALIGN_RIGHT_ICON_MENUKEY | INSERT_IMAGE_MENUKEY | NEW_PAGE_MENUKEY | NEW_PAGE_BIG_MENUKEY | NEW_PAGE_ICON_TEXT_MENUKEY | REMOVE_PAGE_MENUKEY | REMOVE_PAGE_BIG_MENUKEY | REMOVE_PAGE_ICON_TEXT_MENUKEY | INSERT_IMAGE_BIG_MENUKEY | INSERT_IMAGE_TEXT_MENUKEY | INSERT_LINK_ICON_MENUKEY | INSERT_LINK_BIG_ICON_MENUKEY | SPECHARS_MENUKEY | SPECHARS_BIG_MENUKEY | INSERT_BR_MENUKEY | INSERT_BR_BIG_MENUKEY | FIND_AND_REPLACE_MENUKEY | FIND_AND_REPLACE_BIG_MENUKEY | MERGE_CELLS_MENUKEY | MERGE_CELLS_TEXT_MENUKEY | MERGE_CELLS_ICON_MENUKEY | SPLIT_CELLS_MENUKEY | SPLIT_CELLS_TEXT_MENUKEY | SPLIT_CELLS_ICON_MENUKEY | DELETE_TABLE_MENUKEY | DELETE_TABLE_TEXT_MENUKEY | DELETE_TABLE_ICON_MENUKEY | DELETE_ROWS_MENUKEY | DELETE_ROWS_TEXT_MENUKEY | DELETE_ROWS_ICON_MENUKEY | DELETE_COLUMNS_MENUKEY | CELL_BGCOLOR_ICON_MENUKEY | CELL_BORDER_BIG_MENUKEY | CELL_BORDER_MENUKEY | DELETE_COLUMNS_TEXT_MENUKEY | DELETE_COLUMNS_ICON_MENUKEY | INSERT_ROW_TOP_MENUKEY | INSERT_ROW_TOP_TEXT_MENUKEY | INSERT_ROW_TOP_ICON_MENUKEY | INSERT_ROW_BOTTOM_MENUKEY | INSERT_ROW_BOTTOM_TEXT_MENUKEY | INSERT_ROW_BOTTOM_ICON_MENUKEY | INSERT_COLUMN_LEFT_MENUKEY | INSERT_COLUMN_LEFT_TEXT_MENUKEY | INSERT_COLUMN_LEFT_ICON_MENUKEY | INSERT_COLUMN_RIGHT_MENUKEY | INSERT_COLUMN_RIGHT_TEXT_MENUKEY | INSERT_COLUMN_RIGHT_ICON_MENUKEY | AUTO_COLUMN_WIDTH_MENUKEY | AUTO_COLUMN_WIDTH_TEXT_MENUKEY | AUTO_COLUMN_WIDTH_ICON_MENUKEY | CELL_TEXT_ALIGN_LEFT_MENUKEY | CELL_TEXT_ALIGN_CENTER_MENUKEY | CELL_TEXT_ALIGN_RIGHT_MENUKEY | CELL_VERTICAL_ALIGN_BOTTOM_MENUKEY | CELL_VERTICAL_ALIGN_CENTER_MENUKEY | CELL_VERTICAL_ALIGN_TOP_MENUKEY | INSERT_FORMULA_MENUKEY | INSERT_FORMULA_BIG_MENUKEY | CTEXT_ICON_MENUKEY | CTEXT_ICON_TEXT_MENUKEY | CSELECT_ICON_MENUKEY | CSELECT_ICON_TEXT_MENUKEY | CSIGN_ICON_MENUKEY | CSIGN_ICON_TEXT_MENUKEY | CRADIO_ICON_MENUKEY | CTAG_ICON_MENUKEY | CUSTOM_ICON_MENUKEY | CUSTOM_ICON_TEXT_MENUKEY | INLINECUSTOM_ICON_MENUKEY | INLINECUSTOM_ICON_TEXT_MENUKEY | CTAG_ICON_TEXT_MENUKEY | CRADIO_ICON_TEXT_MENUKEY | CDATE_ICON_MENUKEY | CDATE_ICON_TEXT_MENUKEY | CCHECKBOX_ICON_MENUKEY | CCHECKBOX_ICON_TEXT_MENUKEY | CQRCODE_ICON_MENUKEY | CQRCODE_ICON_TEXT_MENUKEY | BARCODE_ICON_MENUKEY | BARCODE_ICON_TEXT_MENUKEY | AREA_ICON_MENUKEY | AREA_ICON_TEXT_MENUKEY | SECTION_ICON_MENUKEY | SECTION_ICON_TEXT_MENUKEY | PAGE_MARGINS_MENUKEY | PAGE_MARGINS_BIG_MENUKEY | PAGE_SIZE_MENUKEY | PAGE_SIZE_BIG_MENUKEY | PAGE_ORIENTATION_MENUKEY | PAGE_ORIENTATION_BIG_MENUKEY | PAGE_SIZE_WIDTH_MENUKEY | PAGE_SIZE_HEIGHT_MENUKEY | PAGE_MARGINS_TOP_MENUKEY | PAGE_MARGINS_BOTTOM_MENUKEY | PAGE_MARGINS_LEFT_MENUKEY | PAGE_MARGINS_RIGHT_MENUKEY | PAGING_MODE_MENUKEY | PAGING_MODE_BIG_MENUKEY | VIEW_MODE_MENUKEY | EXPORT_FILE_BIG_MENUKEY | EXPORT_FILE_MENUKEY | EXPORT_FILE_ICON_TEXT_MENUKEY | VIEW_MODE_BIG_MENUKEY | PREVIEW_PRINT_MENUKEY | PREVIEW_PRINT_BIG_MENUKEY | PREVIEW_PRINT_ICON_TEXT_MENUKEY | PRINT_MENUKEY | PRINT_BIG_MENUKEY | PRINT_ICON_TEXT_MENUKEY | UNDO_ICON_TEXT_MENUKEY;
|
|
1820
|
+
type ToolbarsConfig = InnerToolbarsConfig<MenuKey>;
|
|
1821
|
+
|
|
1822
|
+
/** 节点类型 */
|
|
1823
|
+
type InlineNodeType = ImageNodeType | FormulaNodeType | AreaNodeType | CTextNodeType | CSelectNodeType | CDateNodeType | CRadioNodeType | CSignNodeType | CQRCodeNodeType | CCheckboxNodeType | CTagNodeType;
|
|
1824
|
+
|
|
1825
|
+
type CtrlTree = {
|
|
1826
|
+
title: string;
|
|
1827
|
+
type: 'folder';
|
|
1828
|
+
/** child 存在说明是个文件夹,没有插入节点,不具有拖拽功能 */
|
|
1829
|
+
child: CtrlTree[];
|
|
1830
|
+
} | {
|
|
1831
|
+
title: string;
|
|
1832
|
+
type: 'ctrl';
|
|
1833
|
+
/** insert 为空表示文件夹 */
|
|
1834
|
+
insert: {
|
|
1835
|
+
/** 表示为编辑器内容片段,可以是之前文档中创建的片段 */
|
|
1836
|
+
model: 'fragment';
|
|
1837
|
+
/** 插入片段,可以是使用编辑器模版创建 */
|
|
1838
|
+
jsonString: string;
|
|
1839
|
+
} | ({
|
|
1840
|
+
model: 'inline';
|
|
1841
|
+
prefixText?: string;
|
|
1842
|
+
suffixText?: string;
|
|
1843
|
+
} & InlineNodeType);
|
|
1844
|
+
};
|
|
1845
|
+
interface RightPanelConfig {
|
|
1846
|
+
/** 是否启用右侧属性编辑面板 */
|
|
1847
|
+
rightPanel?: {
|
|
1848
|
+
/** 搜索控件树 */
|
|
1849
|
+
searchCtrlTree?: (searchKey?: string) => Promise<CtrlTree[]>;
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
type WatermarkConfig = {
|
|
1854
|
+
/** 水印效果 */
|
|
1855
|
+
watermark?: {
|
|
1856
|
+
/** 水印背景图片图片链接或者 base64 */
|
|
1857
|
+
img?: string;
|
|
1858
|
+
/** 打印时的图片链接或者 base64 */
|
|
1859
|
+
printImg?: string;
|
|
1860
|
+
};
|
|
1861
|
+
};
|
|
1862
|
+
|
|
1863
|
+
type FoCoreConfig$1 = DocConfig & PageConfig & HeaderConfig & MainConfig & FooterConfig & ParagraphConfig & ImageConfig & BrConfig & HistoryConfig & KeymapConfig & MarksConfig & LinkConfig & FormulaConfig & ExportFileConfig & TableConfig & AreaConfig & SectionConfig & CTextConfig & CSelectConfig & CDateConfig & CRadioConfig & CTagConfig & CustomConfig & InlineCustomConfig & CCheckboxConfig & CSignConfig & CQRCodeConfig & PgNumConfig & ToolbarsConfig & StatusBarsConfig & CCPAConfig & FindAndReplaceConfig & RightPanelConfig & ViewModeConfig & PrintConfig & WatermarkConfig & TextConfig;
|
|
1864
|
+
type FoAttrs = {
|
|
1865
|
+
readonly [attr: string]: any;
|
|
1866
|
+
};
|
|
1867
|
+
type NodeJSONType<TypeName = string, NodeAttrs = Attrs> = {
|
|
1868
|
+
type: TypeName;
|
|
1869
|
+
attrs: NodeAttrs;
|
|
1870
|
+
};
|
|
1871
|
+
|
|
1872
|
+
type PageConfig = {
|
|
1873
|
+
/** page 节点配置信息 */
|
|
1874
|
+
page?: {
|
|
1875
|
+
/** page 节点默认样式 */
|
|
1876
|
+
defaultStyle?: (attrs: PageAttrs) => Partial<CSSStyleDeclaration>;
|
|
1877
|
+
/** 国际化 */
|
|
1878
|
+
locale?: {
|
|
1879
|
+
/** 第 {page} 页 */
|
|
1880
|
+
paging_info?: string;
|
|
1881
|
+
/** 新建页 */
|
|
1882
|
+
new_page_bar?: string;
|
|
1883
|
+
/** 删除页 */
|
|
1884
|
+
remove_page_bar?: string;
|
|
1885
|
+
/** 边框 */
|
|
1886
|
+
margins_bar?: string;
|
|
1887
|
+
/** 方向 */
|
|
1888
|
+
orientation_bar?: string;
|
|
1889
|
+
/** 纵向 */
|
|
1890
|
+
orientation_portrait_bar?: string;
|
|
1891
|
+
/** 横向 */
|
|
1892
|
+
orientation_landscape_bar?: string;
|
|
1893
|
+
/** 大小 */
|
|
1894
|
+
size_bar?: string;
|
|
1895
|
+
/** 上边距 */
|
|
1896
|
+
top_title?: string;
|
|
1897
|
+
/** 下边距 */
|
|
1898
|
+
bottom_title?: string;
|
|
1899
|
+
/** 左边距 */
|
|
1900
|
+
left_title?: string;
|
|
1901
|
+
/** 右边距 */
|
|
1902
|
+
right_title?: string;
|
|
1903
|
+
/** 常规 */
|
|
1904
|
+
normal_title?: string;
|
|
1905
|
+
/** 窄 */
|
|
1906
|
+
narrow_title?: string;
|
|
1907
|
+
/** 中等 */
|
|
1908
|
+
moderate_title?: string;
|
|
1909
|
+
/** 宽 */
|
|
1910
|
+
wide_title?: string;
|
|
1911
|
+
/** 自定义 */
|
|
1912
|
+
auto_title?: string;
|
|
1913
|
+
/** 宽度 */
|
|
1914
|
+
input_width?: string;
|
|
1915
|
+
/** 高度 */
|
|
1916
|
+
input_height?: string;
|
|
1917
|
+
/** 页 */
|
|
1918
|
+
panel_title?: string;
|
|
1919
|
+
/** 标题 */
|
|
1920
|
+
title_title?: string;
|
|
1921
|
+
/** 名称 */
|
|
1922
|
+
name_title?: string;
|
|
1923
|
+
/** 编码 */
|
|
1924
|
+
code_title?: string;
|
|
1925
|
+
};
|
|
1926
|
+
};
|
|
1927
|
+
};
|
|
1928
|
+
type PageSizeName = 'Legal' | 'Letter' | 'A3' | 'A4' | 'A5' | 'Auto';
|
|
1929
|
+
interface DefPageAttrs {
|
|
1930
|
+
/** 当前页title */
|
|
1931
|
+
readonly title?: string;
|
|
1932
|
+
/** 当前页名 */
|
|
1933
|
+
readonly name?: string;
|
|
1934
|
+
/** 页面宽高 */
|
|
1935
|
+
readonly pgSz: {
|
|
1936
|
+
name: PageSizeName;
|
|
1937
|
+
w: string;
|
|
1938
|
+
h: string;
|
|
1939
|
+
/** 布局方向,修改时,padding 需要同步修改 'portrait'(纵向,默认) | 'landscape'(横向,margins 也会翻转) */
|
|
1940
|
+
orient: 'portrait' | 'landscape';
|
|
1941
|
+
};
|
|
1942
|
+
/** 内边距 padding */
|
|
1943
|
+
readonly pgMar: {
|
|
1944
|
+
top: string;
|
|
1945
|
+
right: string;
|
|
1946
|
+
bottom: string;
|
|
1947
|
+
left: string;
|
|
1948
|
+
};
|
|
1949
|
+
}
|
|
1950
|
+
type PageAttrs = DefPageAttrs & FoAttrs;
|
|
1951
|
+
|
|
1952
|
+
/** top 指的是相对于 view.dom */
|
|
1953
|
+
type PagePoint = {
|
|
1954
|
+
pos: number;
|
|
1955
|
+
/** 是否为当前 pages 的首页 */
|
|
1956
|
+
isFirst: boolean;
|
|
1957
|
+
width: number;
|
|
1958
|
+
top: number;
|
|
1959
|
+
left: number;
|
|
1960
|
+
};
|
|
1961
|
+
type NonePageMode = {
|
|
1962
|
+
mode: 'none';
|
|
1963
|
+
};
|
|
1964
|
+
type LinePageMode = {
|
|
1965
|
+
mode: 'line';
|
|
1966
|
+
points?: PagePoint[][];
|
|
1967
|
+
};
|
|
1968
|
+
type PrintPageMode = {
|
|
1969
|
+
mode: 'print';
|
|
1970
|
+
points?: PagePoint[][];
|
|
1971
|
+
};
|
|
1972
|
+
type PageStateType = NonePageMode | LinePageMode | PrintPageMode;
|
|
1973
|
+
type PageMode = PageStateType['mode'];
|
|
1974
|
+
|
|
1975
|
+
/** 插件配置 */
|
|
1976
|
+
type FoCoreConfig = FoCoreConfig$1;
|
|
1977
|
+
/** 编辑器初始化配置 */
|
|
1978
|
+
type FoCoreProps = {
|
|
1979
|
+
/** 将编辑器初始化上的 dom 节点 */
|
|
1980
|
+
dom: HTMLElement;
|
|
1981
|
+
/** 插件配置 */
|
|
1982
|
+
config?: FoCoreConfig;
|
|
1983
|
+
/** 编辑器模式,只读也可以用下面的 readOnly 配置。 只读|编辑|设置 默认 edit */
|
|
1984
|
+
mode: ViewModeState['value'];
|
|
1985
|
+
/** 分页模式 */
|
|
1986
|
+
pageMode: PageMode;
|
|
1987
|
+
/** 事件-文档变化时触发,包括光标变化时也会触发 */
|
|
1988
|
+
onChange?: (this: FoCore, params: {
|
|
1989
|
+
docChanged: boolean;
|
|
1990
|
+
}) => void;
|
|
1991
|
+
/** 点击事件 */
|
|
1992
|
+
onClick?: (this: FoCore) => void;
|
|
1993
|
+
/** 双击事件 */
|
|
1994
|
+
onDblClick?: (this: FoCore) => void;
|
|
1995
|
+
/** blur 事件 */
|
|
1996
|
+
onBlur?: (this: FoCore) => void;
|
|
1997
|
+
/** focus 事件 */
|
|
1998
|
+
onFocus?: (this: FoCore) => void;
|
|
1999
|
+
/** 初始化编辑器时的默认 JSON 值 */
|
|
2000
|
+
defaultValue?: string;
|
|
2001
|
+
/** 初始化编辑器时的默认 HTML 值 */
|
|
2002
|
+
defaultHtml?: string;
|
|
2003
|
+
/** 是否只读 */
|
|
2004
|
+
readOnly?: boolean;
|
|
2005
|
+
};
|
|
2006
|
+
/** 编辑器事件 */
|
|
2007
|
+
type EDITOR_EVENT_NAME = 'click' | 'focus' | 'blur' | 'changed' | 'dblclick';
|
|
2008
|
+
/** 部分可查询编辑器节点类型 */
|
|
2009
|
+
type EditorNodeTypeName = typeof PGNUM_TYPE_NAME | typeof LINK_TYPE_NAME | typeof FORMULA_TYPE_NAME | typeof IMAGE_TYPE_NAME | typeof AREA_TYPE_NAME | typeof SECTION_TYPE_NAME | typeof PARAGRAPH_TYPE_NAME | typeof CCHECKBOX_TYPE_NAME | typeof CRADIO_TYPE_NAME | typeof CDATE_TYPE_NAME | typeof CSELECT_TYPE_NAME | typeof CTEXT_TYPE_NAME;
|
|
2010
|
+
type JSONNode = {
|
|
2011
|
+
type: string;
|
|
2012
|
+
attrs: Record<string, any>;
|
|
2013
|
+
content: JSONNode[];
|
|
2014
|
+
};
|
|
2015
|
+
type EditorNodeType = {
|
|
2016
|
+
readonly type: EditorNodeTypeName;
|
|
2017
|
+
/** 设置 text */
|
|
2018
|
+
setText: (text: string) => EditorNodeType;
|
|
2019
|
+
/** 获取 text */
|
|
2020
|
+
getText: () => string;
|
|
2021
|
+
/** 设置 attrs,未赋值属性不予更新 */
|
|
2022
|
+
setAttrs: (attrs: Record<string, any>) => EditorNodeType;
|
|
2023
|
+
/**
|
|
2024
|
+
* 设置 content
|
|
2025
|
+
* @param content content 子元素
|
|
2026
|
+
* @param attrs 属性,会覆盖原来节点的属性值
|
|
2027
|
+
* @returns
|
|
2028
|
+
*/
|
|
2029
|
+
setContent: (content: JSONNode | JSONNode[], attrs?: Record<string, any>) => EditorNodeType;
|
|
2030
|
+
/** 获取 attrs */
|
|
2031
|
+
getAttrs: () => Record<string, any>;
|
|
2032
|
+
/** 删除自身 */
|
|
2033
|
+
remove: () => void;
|
|
2034
|
+
getPos: () => number;
|
|
2035
|
+
getJSON: () => {
|
|
2036
|
+
type: string;
|
|
2037
|
+
attrs: Record<string, any>;
|
|
2038
|
+
content: any[];
|
|
2039
|
+
};
|
|
2040
|
+
/** 替换 node */
|
|
2041
|
+
replace: (jsonNode: {
|
|
2042
|
+
type: string;
|
|
2043
|
+
attrs: Record<string, any>;
|
|
2044
|
+
content: any[];
|
|
2045
|
+
}) => EditorNodeType;
|
|
2046
|
+
/** 设置选中 */
|
|
2047
|
+
setSelection: () => EditorNodeType;
|
|
2048
|
+
};
|
|
2049
|
+
/** ToolbarsCommand 命令集合 */
|
|
2050
|
+
type ToolbarsCommandType = {
|
|
2051
|
+
exportWord: () => void;
|
|
2052
|
+
exportPDF: () => void;
|
|
2053
|
+
};
|
|
2054
|
+
/** 初始化后的编辑器对象 */
|
|
2055
|
+
interface FoCore {
|
|
2056
|
+
/** 页面模式,不分页、虚拟分页、打印分页 */
|
|
2057
|
+
readonly pageMode: PageMode;
|
|
2058
|
+
/** 设置分页模式 */
|
|
2059
|
+
setPageMode: (pageMode: PageMode) => void;
|
|
2060
|
+
/** 设置视图模式(只读|编辑|设置) */
|
|
2061
|
+
setViewMode: (viewMode: ViewModeState['value'], pageMode?: PageMode) => void;
|
|
2062
|
+
/** 在当前光标位置插入字符 */
|
|
2063
|
+
insertText: (text: string) => void;
|
|
2064
|
+
/** 在当前光标位置插入 node */
|
|
2065
|
+
insertNode: (json: string) => void;
|
|
2066
|
+
print: () => void;
|
|
2067
|
+
/** focus 到编辑器 */
|
|
2068
|
+
focus: () => void;
|
|
2069
|
+
/** 获取编辑器文档内容 */
|
|
2070
|
+
toValue: () => string;
|
|
2071
|
+
/** 返回编辑器,推荐使用 toValue */
|
|
2072
|
+
toJSON: () => object;
|
|
2073
|
+
/** Toolbars 命令集 */
|
|
2074
|
+
ToolbarCommands: ToolbarsCommandType;
|
|
2075
|
+
/**
|
|
2076
|
+
* 使用 schema 导出 dom,该 dom 没有任何冗余修饰,可作为 html 格式存储
|
|
2077
|
+
* @param {string | object} json 非必填,可传入 json 获取,如果不传去当前编辑器中的值
|
|
2078
|
+
* @returns HTMLElement | undefined 返回 html 对象
|
|
2079
|
+
*/
|
|
2080
|
+
toSchemaDOM: (json?: string | object) => HTMLElement | undefined;
|
|
2081
|
+
/** 导出当前编辑器中的html */
|
|
2082
|
+
toHTML: () => string;
|
|
2083
|
+
/**
|
|
2084
|
+
* 设置编辑器的值
|
|
2085
|
+
* @param {string | object} value 设置编辑器值,可选,不传认为是清空文档
|
|
2086
|
+
*/
|
|
2087
|
+
setValue: (value?: string | object) => void;
|
|
2088
|
+
/** 是否只读 */
|
|
2089
|
+
isReadOnly: () => boolean;
|
|
2090
|
+
/** 设置只读 */
|
|
2091
|
+
setReadOnly: (readonly: boolean) => void;
|
|
2092
|
+
/** 销毁编辑器 */
|
|
2093
|
+
destroy: () => void;
|
|
2094
|
+
/** 取到光标处的节点 */
|
|
2095
|
+
getFocusNode: () => EditorNodeType | undefined;
|
|
2096
|
+
/** 根据 name 查询 */
|
|
2097
|
+
queryNodesByName: (name: string) => EditorNodeType[];
|
|
2098
|
+
/** 根据 code 查询 */
|
|
2099
|
+
queryNodesByCode: (name: string) => EditorNodeType[];
|
|
2100
|
+
/** 根据类型查询节点 */
|
|
2101
|
+
queryNodesByType: (typeName: EditorNodeTypeName) => EditorNodeType[];
|
|
2102
|
+
/** 根据属性过滤节点 */
|
|
2103
|
+
filterNodes: (predicate: (type: string, attrs: Record<string, any>, text: string) => boolean) => EditorNodeType[];
|
|
2104
|
+
/** 绑定事件 */
|
|
2105
|
+
on: (eventName: EDITOR_EVENT_NAME, fn: (this: FoCore) => void) => void;
|
|
2106
|
+
/** 取消绑定 */
|
|
2107
|
+
off: (eventName: EDITOR_EVENT_NAME, fn: Function) => void;
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* 创建编辑器方法类型
|
|
2111
|
+
* @param {FoCoreProps} props 初始化编辑器属性
|
|
2112
|
+
*/
|
|
2113
|
+
type CreateFoCore = (props: FoCoreProps) => FoCore;
|
|
2114
|
+
interface ExposeFoCoreObjectType {
|
|
2115
|
+
createEditor: CreateFoCore;
|
|
2116
|
+
}
|
|
2117
|
+
/** 编辑器错误类型 */
|
|
2118
|
+
type FoCoreErrorName = 'FO_ERR_PAGE' | 'FO_ERR_SETVALUE';
|
|
2119
|
+
/** 编辑器 Error 类型 */
|
|
2120
|
+
interface FoCoreError<T = FoCoreErrorName> extends Error {
|
|
2121
|
+
code: T;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
type FOEDITOR_EVENT_NAME = EDITOR_EVENT_NAME;
|
|
2125
|
+
/** 编辑器组件返回对象 */
|
|
2126
|
+
type FoEditor = FoCore;
|
|
2127
|
+
/**
|
|
2128
|
+
* 编辑器插件配置
|
|
2129
|
+
* 编辑器由多个插件组成,不同插件采用不同的配置。
|
|
2130
|
+
* 比如 marks 插件中定义了字体字号等下拉默认值
|
|
2131
|
+
* image 插件中有 upload: (file:File) => Promise<{ src: string }> hook 用于上传图片
|
|
2132
|
+
* 等。。。
|
|
2133
|
+
* */
|
|
2134
|
+
type FoEditorConfig = FoCoreConfig;
|
|
2135
|
+
type FoEditorNodeTypeName = EditorNodeTypeName;
|
|
2136
|
+
/** 编辑器初始化配置 */
|
|
2137
|
+
interface FoEditorProps extends FoCoreProps {
|
|
2138
|
+
/** 初始化完成后触发 */
|
|
2139
|
+
ready?: () => void;
|
|
2140
|
+
/** 错误事件,编辑器报错时触发 */
|
|
2141
|
+
onError?: (err: FoEditorErrorType) => void;
|
|
2142
|
+
/** 外部资源跟地址,非必填 */
|
|
2143
|
+
baseUrl?: string;
|
|
2144
|
+
/** 当前版本,默认使用最新版 */
|
|
2145
|
+
version?: string;
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* 初始化编辑器方法类型
|
|
2149
|
+
* @param { FoEditorProps } props 初始化编辑器参数
|
|
2150
|
+
* @returns 返回编辑器实例
|
|
2151
|
+
*/
|
|
2152
|
+
type CreateFoEditor = (props: FoEditorProps) => FoEditor;
|
|
2153
|
+
type ExposeFoEditorObjectType = ExposeFoCoreObjectType;
|
|
2154
|
+
type CustomErrorName = 'FO_ERR_READY';
|
|
2155
|
+
type FoEditorErrorName = FoCoreErrorName | CustomErrorName;
|
|
2156
|
+
interface FoEditorErrorType<T = FoEditorErrorName> extends FoCoreError<T> {
|
|
2157
|
+
code: T;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
/** 默认配置 */
|
|
2161
|
+
declare const defaultConfig: FoEditorConfig;
|
|
2162
|
+
declare const createDefaultEditorConfig: () => FoEditorConfig;
|
|
2163
|
+
|
|
2164
|
+
declare const createFoEditor: CreateFoEditor;
|
|
2165
|
+
|
|
2166
|
+
export { CreateFoEditor, ExposeFoEditorObjectType, FOEDITOR_EVENT_NAME, FoEditor, FoEditorConfig, FoEditorErrorName, FoEditorErrorType, FoEditorNodeTypeName, FoEditorProps, createDefaultEditorConfig, createFoEditor, defaultConfig };
|