@gct-paas/word 0.1.9 → 0.1.11
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/base/index.d.ts +1 -0
- package/dist/base/modal/src/modal.type.d.ts +2 -2
- package/dist/base/select/src/basic-select.vue.d.ts +6 -0
- package/dist/base/table/index.d.ts +1 -0
- package/dist/base/table/src/table.vue.d.ts +73 -0
- package/dist/base/utils/asset-helper-util.d.ts +1 -0
- package/dist/core/command/commands/DeleteTable.d.ts +11 -0
- package/dist/core/command/commands/InsertField.d.ts +0 -8
- package/dist/core/command/commands/InsertTable.d.ts +3 -5
- package/dist/core/command/commands/SetHighlight.d.ts +11 -0
- package/dist/core/command/types.d.ts +15 -6
- package/dist/core/event/handlers/InteractionHandler.d.ts +2 -0
- package/dist/core/event/types.d.ts +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/interaction/InteractionController.d.ts +6 -0
- package/dist/core/interaction/types.d.ts +8 -0
- package/dist/core/interaction/useInteraction.d.ts +8 -1
- package/dist/core/layout/LayoutManager.d.ts +1 -0
- package/dist/core/layout/LayoutMapper.d.ts +1 -0
- package/dist/core/layout/handlers/FieldHandler.d.ts +20 -2
- package/dist/core/layout/handlers/ImageHandler.d.ts +1 -1
- package/dist/core/layout/handlers/TextHandler.d.ts +1 -21
- package/dist/core/model/base/ModelNode.d.ts +1 -0
- package/dist/core/model/document/WrField.d.ts +6 -1
- package/dist/core/model/document/WrText.d.ts +7 -2
- package/dist/core/model/types/style.d.ts +2 -3
- package/dist/core/view/Doc.d.ts +7 -0
- package/dist/core/view/runs/ImageWidget.d.ts +26 -0
- package/dist/core/view/runs/TextRun.d.ts +1 -7
- package/dist/domain/active/active-types.d.ts +2 -1
- package/dist/index.es.js +13913 -9424
- package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +0 -1
- package/dist/runtime/canvas/__common__/widget-container/overlay-design.vue.d.ts +9 -3
- package/dist/runtime/canvas/__common__/widget-container/overlay-render.vue.d.ts +10 -4
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +8 -1
- package/dist/runtime/designer/ribbon/components/marker-color-select.vue.d.ts +5 -1
- package/dist/runtime/designer/toolkit/toolkit-item.vue.d.ts +2 -0
- package/dist/runtime/designer/toolkit/toolkit.vue.d.ts +12 -2
- package/dist/runtime/{interface/validate.d.ts → factories/createValidateFactory.d.ts} +0 -1
- package/dist/runtime/factories/useFormValidator.d.ts +4 -0
- package/dist/runtime/factories/useRenderData.d.ts +4 -2
- package/dist/runtime/interface/computed.d.ts +1 -1
- package/dist/runtime/renderer/dialogs/upload-file/base-upload-file.vue.d.ts +15 -0
- package/dist/runtime/renderer/dialogs/upload-file/upload-file-dialog.vue.d.ts +17 -0
- package/dist/runtime/renderer/dialogs/upload-file/utils.d.ts +16 -0
- package/dist/runtime/renderer/validation/validation-comment-item.vue.d.ts +12 -0
- package/dist/runtime/renderer/validation/validation-comment-layer.vue.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/data-init/DataInitPanel.vue.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/data-init/add-button.vue.d.ts +11 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-modal.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-select.vue.d.ts +10 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-modal.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-select.vue.d.ts +11 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-modal.vue.d.ts +16 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-select.vue.d.ts +23 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-field/useField.d.ts +25 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/input-param-modal.vue.d.ts +10 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/ipaas-param-config.vue.d.ts +10 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/json-param-editor.vue.d.ts +14 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/out-param-modal.vue.d.ts +7 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-input.vue.d.ts +11 -0
- package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-modal.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/data-init/common/data-source-field-map.vue.d.ts +11 -0
- package/dist/suites/edhr/panel-schema/data-init/common/data-source-model-link.vue.d.ts +39 -0
- package/dist/suites/edhr/panel-schema/data-init/common/data-source-title.vue.d.ts +19 -0
- package/dist/suites/edhr/panel-schema/data-init/common/param-field-link.vue.d.ts +10 -0
- package/dist/suites/edhr/panel-schema/data-init/common/param-key-select.vue.d.ts +18 -0
- package/dist/suites/edhr/panel-schema/data-init/data-init.basic.d.ts +5 -0
- package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +197 -0
- package/dist/suites/edhr/panel-schema/data-init/utils/json-param-logic.d.ts +53 -0
- package/dist/suites/edhr/panel-schema/data-init/utils/sql.d.ts +4 -0
- package/dist/suites/edhr/panel-schema/index.d.ts +5 -0
- package/dist/word.css +1790 -331
- package/package.json +2 -2
package/dist/base/index.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ type __VLS_Props = {
|
|
|
14
14
|
/** 下拉框宽度 */
|
|
15
15
|
popperWidth?: number;
|
|
16
16
|
dropdownExtraProps?: Record<string, any>;
|
|
17
|
+
/** 选择项额外的 class */
|
|
18
|
+
class?: string;
|
|
19
|
+
/** 是否只读 */
|
|
20
|
+
readonly?: boolean;
|
|
21
|
+
/** 不显示右侧箭头 */
|
|
22
|
+
noArrow?: boolean;
|
|
17
23
|
};
|
|
18
24
|
declare function __VLS_template(): {
|
|
19
25
|
attrs: Partial<{}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GctTable } from './src/table.vue';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
interface Column {
|
|
2
|
+
key: string;
|
|
3
|
+
title: string;
|
|
4
|
+
align?: string;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
}
|
|
7
|
+
interface Row {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
stripe?: boolean;
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
height?: number | string;
|
|
14
|
+
columns?: Column[];
|
|
15
|
+
dataSource?: Row[];
|
|
16
|
+
selectedRowKeys?: (string | number)[];
|
|
17
|
+
rowHeight?: number;
|
|
18
|
+
visibleRowCount?: number;
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
getRowKey?: (row: Row) => string | number;
|
|
21
|
+
};
|
|
22
|
+
declare function __VLS_template(): {
|
|
23
|
+
attrs: Partial<{}>;
|
|
24
|
+
slots: {
|
|
25
|
+
title?(_: {}): any;
|
|
26
|
+
bodyCell?(_: {
|
|
27
|
+
row: Row;
|
|
28
|
+
rowIndex: number;
|
|
29
|
+
text: any;
|
|
30
|
+
column: Column;
|
|
31
|
+
}): any;
|
|
32
|
+
};
|
|
33
|
+
refs: {
|
|
34
|
+
wrapperRef: HTMLDivElement;
|
|
35
|
+
};
|
|
36
|
+
rootEl: any;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
39
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
40
|
+
select: (key: string | number) => any;
|
|
41
|
+
selectAll: (keys: (string | number)[]) => any;
|
|
42
|
+
scrollToBottom: () => any;
|
|
43
|
+
selectChange: (keys: (string | number)[]) => any;
|
|
44
|
+
selectCancel: (key: string | number) => any;
|
|
45
|
+
clearAll: () => any;
|
|
46
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
47
|
+
onSelect?: ((key: string | number) => any) | undefined;
|
|
48
|
+
onSelectAll?: ((keys: (string | number)[]) => any) | undefined;
|
|
49
|
+
onScrollToBottom?: (() => any) | undefined;
|
|
50
|
+
onSelectChange?: ((keys: (string | number)[]) => any) | undefined;
|
|
51
|
+
onSelectCancel?: ((key: string | number) => any) | undefined;
|
|
52
|
+
onClearAll?: (() => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
height: number | string;
|
|
55
|
+
columns: Column[];
|
|
56
|
+
rowHeight: number;
|
|
57
|
+
stripe: boolean;
|
|
58
|
+
selectable: boolean;
|
|
59
|
+
dataSource: Row[];
|
|
60
|
+
selectedRowKeys: (string | number)[];
|
|
61
|
+
visibleRowCount: number;
|
|
62
|
+
isLoading: boolean;
|
|
63
|
+
getRowKey: (row: Row) => string | number;
|
|
64
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
65
|
+
wrapperRef: HTMLDivElement;
|
|
66
|
+
}, any>;
|
|
67
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
68
|
+
export default _default;
|
|
69
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
70
|
+
new (): {
|
|
71
|
+
$slots: S;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Doc } from '../../view/Doc';
|
|
2
|
+
import { CommandPayloadMap } from '../types';
|
|
3
|
+
import { CommandBase, PostCommandContext } from '../base/CommandBase';
|
|
4
|
+
/**
|
|
5
|
+
* 表格删除命令
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare class DeleteTable extends CommandBase<'deleteTable'> {
|
|
9
|
+
constructor(doc: Doc, payload?: CommandPayloadMap['deleteTable']);
|
|
10
|
+
protected execute(): Promise<PostCommandContext>;
|
|
11
|
+
}
|
|
@@ -7,18 +7,10 @@ type InsertFieldCommandOptions = CommandPayloadMap['insertField'];
|
|
|
7
7
|
export declare class InsertField extends CommandBase<'insertField'> {
|
|
8
8
|
constructor(doc: Doc, payload: InsertFieldCommandOptions);
|
|
9
9
|
protected execute(): Promise<PostCommandContext>;
|
|
10
|
-
/**
|
|
11
|
-
* 处理折叠状态下的图片插入
|
|
12
|
-
*/
|
|
13
|
-
private handleCollapseImage;
|
|
14
10
|
/**
|
|
15
11
|
* 处理折叠状态下的文本(字段)插入
|
|
16
12
|
*/
|
|
17
13
|
private handleCollapseText;
|
|
18
|
-
/**
|
|
19
|
-
* 处理选区下的图片插入
|
|
20
|
-
*/
|
|
21
|
-
private handleSelectionImage;
|
|
22
14
|
/**
|
|
23
15
|
* 处理选区下的文本(字段)插入
|
|
24
16
|
*/
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Doc } from '../../view/Doc';
|
|
2
|
-
import {
|
|
3
|
-
import { CommandBase } from '../base/CommandBase';
|
|
2
|
+
import { CommandPayloadMap } from '../types';
|
|
3
|
+
import { CommandBase, PostCommandContext } from '../base/CommandBase';
|
|
4
4
|
import { Wtbl } from '../../model/document';
|
|
5
5
|
export declare class InsertTable extends CommandBase<'insertTable'> {
|
|
6
|
-
private wpid?;
|
|
7
6
|
constructor(doc: Doc, payload?: CommandPayloadMap['insertTable']);
|
|
8
7
|
protected createTable(width: number, rowCount?: number, colCount?: number): Wtbl;
|
|
9
|
-
protected execute(): Promise<
|
|
10
|
-
protected afterDo(): CommandResult;
|
|
8
|
+
protected execute(): Promise<PostCommandContext>;
|
|
11
9
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SetStyleBase } from '../base/SetStyleBase';
|
|
2
|
+
import { Doc } from '../../view/Doc';
|
|
3
|
+
import { WrText } from '../../model/document/WrText';
|
|
4
|
+
import { CommandPayloadMap } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* 设置高亮
|
|
7
|
+
*/
|
|
8
|
+
export declare class SetHighlight extends SetStyleBase<'setHighlight'> {
|
|
9
|
+
constructor(doc: Doc, payload: CommandPayloadMap['setHighlight']);
|
|
10
|
+
protected applyStyle(run: WrText): void;
|
|
11
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VOrientationType } from '../../domain/constants/enum';
|
|
2
2
|
import { Doc } from '../view/Doc';
|
|
3
3
|
import { WidgetMeta } from '../widget/widget-meta';
|
|
4
|
+
import { WordHighlight } from '../model/types';
|
|
4
5
|
export interface CursorMeta {
|
|
5
6
|
nodeId: string;
|
|
6
7
|
offset: number;
|
|
@@ -34,6 +35,7 @@ export declare const CommandType: {
|
|
|
34
35
|
readonly delete: "delete";
|
|
35
36
|
readonly backspace: "backspace";
|
|
36
37
|
readonly enter: "enter";
|
|
38
|
+
readonly setHighlight: "setHighlight";
|
|
37
39
|
readonly setColor: "setColor";
|
|
38
40
|
readonly setBold: "setBold";
|
|
39
41
|
readonly setItalic: "setItalic";
|
|
@@ -52,6 +54,7 @@ export declare const CommandType: {
|
|
|
52
54
|
readonly insertCol: "insertCol";
|
|
53
55
|
readonly deleteRow: "deleteRow";
|
|
54
56
|
readonly deleteCol: "deleteCol";
|
|
57
|
+
readonly deleteTable: "deleteTable";
|
|
55
58
|
readonly mergeCells: "mergeCells";
|
|
56
59
|
readonly unmergeCells: "unmergeCells";
|
|
57
60
|
readonly snapshot: "snapshot";
|
|
@@ -87,6 +90,15 @@ export type CommandPayloadMap = {
|
|
|
87
90
|
delete: CommandPayload & Record<string, never>;
|
|
88
91
|
backspace: CommandPayload & Record<string, never>;
|
|
89
92
|
enter: CommandPayload & Record<string, never>;
|
|
93
|
+
setOrient: CommandPayload & {
|
|
94
|
+
orient: VOrientationType;
|
|
95
|
+
};
|
|
96
|
+
setPadding: CommandPayload & {
|
|
97
|
+
padding: [number, number, number, number];
|
|
98
|
+
};
|
|
99
|
+
setHighlight: CommandPayload & {
|
|
100
|
+
highlight: WordHighlight;
|
|
101
|
+
};
|
|
90
102
|
setColor: CommandPayload & {
|
|
91
103
|
color: string;
|
|
92
104
|
};
|
|
@@ -96,12 +108,6 @@ export type CommandPayloadMap = {
|
|
|
96
108
|
setItalic: CommandPayload & {
|
|
97
109
|
italic?: boolean;
|
|
98
110
|
};
|
|
99
|
-
setOrient: CommandPayload & {
|
|
100
|
-
orient: VOrientationType;
|
|
101
|
-
};
|
|
102
|
-
setPadding: CommandPayload & {
|
|
103
|
-
padding: [number, number, number, number];
|
|
104
|
-
};
|
|
105
111
|
setFont: CommandPayload & {
|
|
106
112
|
fontFamily: string;
|
|
107
113
|
};
|
|
@@ -158,6 +164,9 @@ export type CommandPayloadMap = {
|
|
|
158
164
|
tableId: string;
|
|
159
165
|
colIndex: number;
|
|
160
166
|
};
|
|
167
|
+
deleteTable: CommandPayload & {
|
|
168
|
+
tableId: string;
|
|
169
|
+
};
|
|
161
170
|
mergeCells: CommandPayload & Record<string, never>;
|
|
162
171
|
unmergeCells: CommandPayload & Record<string, never>;
|
|
163
172
|
snapshot: CommandPayload & Record<string, never>;
|
|
@@ -65,4 +65,4 @@ export type MoveOpts = Pick<KeydownOpts, 'dir' | 'shift' | 'ctrl'>;
|
|
|
65
65
|
* 定义了系统中所有需要进行分发/调度的事件类型标识
|
|
66
66
|
*/
|
|
67
67
|
export type DispatchEventType = 'ime:compositionstart' | 'ime:compositionupdate' | 'ime:compositionend' | 'ime:input' | 'ime:paste' | 'ime:focus' | 'ime:blur' | 'ime:keydown' | 'caret:locate' | 'konva:click' | 'konva:dragstart' | 'konva:dragmove' | 'konva:dragend' | 'konva:contextmenu' | 'inter:str' | 'inter:stc' | 'inter:stall' | 'inter:active' | 'inter:chg-hmid';
|
|
68
|
-
export type EventBusType = 'autoScroll:start' | 'autoScroll:move' | 'autoScroll:stop' | 'caret:changed' | 'caret:requestScroll' | 'cursor:change' | 'tableSelection:change' | 'dragHoverId:change' | 'hoverModelId:change' | 'panelData:change';
|
|
68
|
+
export type EventBusType = 'autoScroll:start' | 'autoScroll:move' | 'autoScroll:stop' | 'caret:changed' | 'caret:requestScroll' | 'cursor:change' | 'tableSelection:change' | 'dragHoverId:change' | 'hoverModelId:change' | 'focusModelId:change' | 'panelData:change';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { Page } from './view/Page';
|
|
|
18
18
|
export type { TextRun } from './view/runs/TextRun';
|
|
19
19
|
export type { ImageRun } from './view/runs/ImageRun';
|
|
20
20
|
export type { ITextWidget } from './view/runs/TextWidget';
|
|
21
|
+
export type { IImageWidget } from './view/runs/ImageWidget';
|
|
21
22
|
export type { Border, Paragraph } from './view/Paragraph';
|
|
22
23
|
export type { Table } from './view/Table';
|
|
23
24
|
export type { SubRenderer } from './view/TableCell';
|
|
@@ -30,6 +30,12 @@ export declare class InteractionController {
|
|
|
30
30
|
modelId: string;
|
|
31
31
|
focusTick: number;
|
|
32
32
|
}): void;
|
|
33
|
+
onShowValidationComment(payload: Record<string, {
|
|
34
|
+
field: string;
|
|
35
|
+
fieldValue: any;
|
|
36
|
+
message: string;
|
|
37
|
+
}[]> | null): void;
|
|
38
|
+
onFocusValidation(payload: string): void;
|
|
33
39
|
onContextMenu(payload: ContextMenuParams & {
|
|
34
40
|
contextMenuRef: any;
|
|
35
41
|
}): void;
|
|
@@ -17,5 +17,13 @@ export type InteractionState = {
|
|
|
17
17
|
focusTick: number | undefined;
|
|
18
18
|
/** 当前点击的组件 右侧面板 */
|
|
19
19
|
panelData: ActivePanelData | null;
|
|
20
|
+
/** 字段校验批注信息集合 */
|
|
21
|
+
validationCommentMap: Record<string, Array<{
|
|
22
|
+
field: string;
|
|
23
|
+
fieldValue: any;
|
|
24
|
+
message: string;
|
|
25
|
+
}>> | null;
|
|
26
|
+
/** 当前 focus 的字段校验批注信息 */
|
|
27
|
+
focusValidation: string | '';
|
|
20
28
|
};
|
|
21
29
|
export type InteractionType = keyof InteractionState;
|
|
@@ -18,8 +18,15 @@ export declare function useInteraction(publicDocApi: Ref<EnginePublic | null>):
|
|
|
18
18
|
readonly pageName?: string | undefined;
|
|
19
19
|
readonly mainModelKey?: string | undefined;
|
|
20
20
|
readonly subFieldKey?: string | undefined;
|
|
21
|
-
readonly valuePath?: string | undefined;
|
|
22
21
|
readonly regionId?: string | undefined;
|
|
23
22
|
};
|
|
24
23
|
} | null | undefined;
|
|
24
|
+
readonly validationCommentMap?: {
|
|
25
|
+
readonly [x: string]: readonly {
|
|
26
|
+
readonly field: string;
|
|
27
|
+
readonly fieldValue: any;
|
|
28
|
+
readonly message: string;
|
|
29
|
+
}[];
|
|
30
|
+
} | null | undefined;
|
|
31
|
+
readonly focusValidation?: string | undefined;
|
|
25
32
|
};
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WrText } from '../../model/document';
|
|
2
2
|
import { LayoutContext } from '../LayoutContext';
|
|
3
|
+
type ValueType = string | number | undefined | null;
|
|
4
|
+
type WidgetOption = {
|
|
5
|
+
value: any;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
3
8
|
export declare class FieldHandler {
|
|
4
|
-
static
|
|
9
|
+
static getValue(context: LayoutContext, wr: WrText): ValueType;
|
|
10
|
+
static hasValue(value: ValueType): boolean;
|
|
11
|
+
static layout(context: LayoutContext, wr: WrText): void;
|
|
12
|
+
static getId(context: LayoutContext, wr: WrText): string;
|
|
13
|
+
static layoutRun(context: LayoutContext, wr: WrText): void;
|
|
14
|
+
private static addOptionSpacing;
|
|
15
|
+
private static addOptionLabel;
|
|
16
|
+
private static addOptionIcon;
|
|
17
|
+
static layoutWidgetOption(context: LayoutContext, wr: WrText, option: WidgetOption, optionIndex: number): void;
|
|
18
|
+
static layoutWidgetOptions(context: LayoutContext, wr: WrText): void;
|
|
19
|
+
static layoutWidgetLabel(context: LayoutContext, wr: WrText): void;
|
|
20
|
+
static layoutWidgetInput(context: LayoutContext, wr: WrText): void;
|
|
21
|
+
static layoutWidgetImage(context: LayoutContext, wr: WrText): void;
|
|
5
22
|
}
|
|
23
|
+
export {};
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import { WrText } from '../../model/document';
|
|
2
2
|
import { LayoutContext } from '../LayoutContext';
|
|
3
|
-
/**
|
|
4
|
-
* 文本 Run 布局策略
|
|
5
|
-
* 负责文本的测量和布局(逐字符处理)
|
|
6
|
-
*/
|
|
7
|
-
type ValueType = string | number | undefined | null;
|
|
8
|
-
type WidgetOption = {
|
|
9
|
-
value: any;
|
|
10
|
-
label: string;
|
|
11
|
-
};
|
|
12
3
|
export declare class TextHandler {
|
|
13
|
-
static
|
|
14
|
-
static hasValue(value: ValueType): boolean;
|
|
4
|
+
static getId(context: LayoutContext, wr: WrText): string;
|
|
15
5
|
static layout(context: LayoutContext, wr: WrText): void;
|
|
16
|
-
static layoutRun(context: LayoutContext, wr: WrText): void;
|
|
17
|
-
private static addOptionSpacing;
|
|
18
|
-
private static addOptionLabel;
|
|
19
|
-
private static addOptionIcon;
|
|
20
|
-
static layoutWidgetOption(context: LayoutContext, wr: WrText, option: WidgetOption, optionIndex: number): void;
|
|
21
|
-
static layoutWidgetOptions(context: LayoutContext, wr: WrText): void;
|
|
22
|
-
static layoutWidgetLabel(context: LayoutContext, wr: WrText): void;
|
|
23
|
-
static layoutWidgetInput(context: LayoutContext, wr: WrText): void;
|
|
24
|
-
static layoutWidget(context: LayoutContext, wr: WrText): void;
|
|
25
6
|
}
|
|
26
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Wp } from './Wp';
|
|
2
|
-
import { TextStyle, RawElement } from '../types';
|
|
2
|
+
import { TextStyle, RawElement, WordHighlight } from '../types';
|
|
3
3
|
import { WidgetMeta } from '../../widget/widget-meta';
|
|
4
4
|
import { WrPr } from './WrPr';
|
|
5
5
|
import { ModelNode, ModelNodeOptions } from '../base';
|
|
@@ -52,6 +52,11 @@ export declare class WrField extends ModelNode {
|
|
|
52
52
|
* 确保 rPr 实例存在,如果不存在则创建一个新的 WrPr 实例
|
|
53
53
|
*/
|
|
54
54
|
private ensureRPr;
|
|
55
|
+
/**
|
|
56
|
+
* 设置高亮
|
|
57
|
+
* @param highlight 颜色值(hex 格式,如 '#ff0000')
|
|
58
|
+
*/
|
|
59
|
+
setHighlight(highlight: WordHighlight): void;
|
|
55
60
|
/**
|
|
56
61
|
* 设置文本颜色
|
|
57
62
|
* @param color 颜色值(hex 格式,如 '#ff0000')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Wp } from './Wp';
|
|
2
|
-
import { RawElement } from '../types';
|
|
2
|
+
import { RawElement, WordHighlight } from '../types';
|
|
3
3
|
import { WidgetMeta } from '../../widget/widget-meta';
|
|
4
4
|
import { WrPr } from './WrPr';
|
|
5
5
|
import { ModelNode, ModelNodeOptions } from '../base';
|
|
@@ -18,8 +18,8 @@ export declare class WrText extends ModelNode {
|
|
|
18
18
|
isComposition?: boolean;
|
|
19
19
|
isPlaceholder?: boolean;
|
|
20
20
|
elements?: IElement[];
|
|
21
|
-
widgetMeta?: WidgetMeta;
|
|
22
21
|
valuePath?: string;
|
|
22
|
+
widgetMeta?: WidgetMeta;
|
|
23
23
|
constructor(options: ModelNodeOptions & {
|
|
24
24
|
text: string;
|
|
25
25
|
rPr?: WrPr;
|
|
@@ -52,6 +52,11 @@ export declare class WrText extends ModelNode {
|
|
|
52
52
|
* 确保 rPr 实例存在,如果不存在则创建一个新的 WrPr 实例
|
|
53
53
|
*/
|
|
54
54
|
private ensureRPr;
|
|
55
|
+
/**
|
|
56
|
+
* 设置高亮
|
|
57
|
+
* @param highlight 颜色值(hex 格式,如 '#ff0000')
|
|
58
|
+
*/
|
|
59
|
+
setHighlight(highlight: WordHighlight): void;
|
|
55
60
|
/**
|
|
56
61
|
* 设置文本颜色
|
|
57
62
|
* @param color 颜色值(hex 格式,如 '#ff0000')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type WordHighlight = 'yellow' | 'green' | 'cyan' | 'magenta' | 'blue' | 'red' | 'darkBlue' | 'darkCyan' | 'darkGreen' | 'darkMagenta' | 'darkRed' | 'darkYellow' | 'lightGray' | 'darkGray' | 'black' | 'none';
|
|
1
|
+
export type WordHighlight = 'yellow' | 'green' | 'cyan' | 'magenta' | 'blue' | 'red' | 'darkBlue' | 'darkCyan' | 'darkGreen' | 'darkMagenta' | 'darkRed' | 'darkYellow' | 'lightGray' | 'darkGray' | 'black' | 'none';
|
|
2
2
|
/**
|
|
3
3
|
* 样式类型定义
|
|
4
4
|
*/
|
|
@@ -11,8 +11,8 @@ export type TextStyle = {
|
|
|
11
11
|
caps?: boolean;
|
|
12
12
|
smallCaps?: boolean;
|
|
13
13
|
vertAlign?: 'superscript' | 'subscript';
|
|
14
|
-
color?: string;
|
|
15
14
|
highlight?: WordHighlight;
|
|
15
|
+
color?: string;
|
|
16
16
|
shd?: {
|
|
17
17
|
fill?: string;
|
|
18
18
|
val?: string;
|
|
@@ -53,4 +53,3 @@ export type ParagraphStyle = {
|
|
|
53
53
|
eastAsia?: string;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
-
export {};
|
package/dist/core/view/Doc.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommandManager } from '../command/CommandManager';
|
|
2
2
|
import { Page } from './Page';
|
|
3
|
+
import { LayoutNode } from './base';
|
|
3
4
|
import { Section } from './Section';
|
|
4
5
|
import { LayoutManager } from '../layout/LayoutManager';
|
|
5
6
|
import { LayoutMapper } from '../layout/LayoutMapper';
|
|
@@ -55,6 +56,7 @@ export declare class Doc {
|
|
|
55
56
|
[k: string]: {
|
|
56
57
|
top: number;
|
|
57
58
|
left: number;
|
|
59
|
+
width: number;
|
|
58
60
|
};
|
|
59
61
|
};
|
|
60
62
|
/** 最大的纸张宽度(带安全距离) */
|
|
@@ -94,4 +96,9 @@ export declare class Doc {
|
|
|
94
96
|
/** 是否是打印模式 */
|
|
95
97
|
isInPrintMode(): boolean;
|
|
96
98
|
bumpUpdateTick(): void;
|
|
99
|
+
/**
|
|
100
|
+
* 获取所有同时存在 widgetMeta 和 valuePath 的实例
|
|
101
|
+
* @returns Wr 实例数组(包含 widgetMeta 和 valuePath 的文本或图片 run)
|
|
102
|
+
*/
|
|
103
|
+
getWidgetInstances(): LayoutNode[];
|
|
97
104
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { WidgetMeta } from '../../widget/widget-meta';
|
|
2
|
+
import { ImageRun, IImageRun, ImageRunOptions } from './ImageRun';
|
|
3
|
+
/**
|
|
4
|
+
* 图片运行接口
|
|
5
|
+
*/
|
|
6
|
+
export interface IImageWidget extends IImageRun {
|
|
7
|
+
/** 值路径 */
|
|
8
|
+
valuePath: string;
|
|
9
|
+
/** 组件元数据 */
|
|
10
|
+
widgetMeta: WidgetMeta;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageWidgetOptions extends ImageRunOptions {
|
|
13
|
+
/** 值路径 */
|
|
14
|
+
valuePath: string;
|
|
15
|
+
/** 组件元数据 */
|
|
16
|
+
widgetMeta: WidgetMeta;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 图片运行类
|
|
20
|
+
* 用于处理文档中的图片
|
|
21
|
+
*/
|
|
22
|
+
export declare class ImageWidget extends ImageRun implements IImageWidget {
|
|
23
|
+
valuePath: string;
|
|
24
|
+
widgetMeta: WidgetMeta;
|
|
25
|
+
constructor(options: ImageWidgetOptions);
|
|
26
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutNode, LayoutNodeOptions } from '../base';
|
|
2
|
-
import { WrText } from '../../model/document';
|
|
3
2
|
import { TextStyle } from '../../model/types/style';
|
|
4
3
|
import { default as Konva } from 'konva';
|
|
5
4
|
import { Doc } from '../Doc';
|
|
@@ -56,6 +55,7 @@ export interface TextRunOptions extends LayoutNodeOptions {
|
|
|
56
55
|
valuePath?: string;
|
|
57
56
|
ascent: number;
|
|
58
57
|
descent: number;
|
|
58
|
+
style?: TextStyle;
|
|
59
59
|
}
|
|
60
60
|
export declare class TextRun extends LayoutNode implements ITextRun {
|
|
61
61
|
component: "text";
|
|
@@ -98,10 +98,4 @@ export declare class TextRun extends LayoutNode implements ITextRun {
|
|
|
98
98
|
* @returns TextRun 的样式属性
|
|
99
99
|
*/
|
|
100
100
|
static textStyle2LayoutStyle(textStyle: TextStyle): Partial<TextRun>;
|
|
101
|
-
/**
|
|
102
|
-
* @deprecated 使用 textStyle2LayoutStyle 代替
|
|
103
|
-
* 将 document 模型的样式转换为 Layout 层的样式的文本样式
|
|
104
|
-
* @returns TextRun 的样式属性
|
|
105
|
-
*/
|
|
106
|
-
static modelStyle2LayoutStyle(rPr: WrText['rPr']): Partial<TextRun>;
|
|
107
101
|
}
|
|
@@ -6,6 +6,8 @@ export type PanelType =
|
|
|
6
6
|
| 'panel:paper-header'
|
|
7
7
|
/** 页脚 */
|
|
8
8
|
| 'panel:paper-footer'
|
|
9
|
+
/** 数据初始化 */
|
|
10
|
+
| 'panel:data-init'
|
|
9
11
|
/** 动态表 */
|
|
10
12
|
| 'panel:dynamic-table'
|
|
11
13
|
/** 固定表 */
|
|
@@ -20,7 +22,6 @@ type ActiveContext = {
|
|
|
20
22
|
pageName: string;
|
|
21
23
|
mainModelKey: string;
|
|
22
24
|
subFieldKey: string | undefined;
|
|
23
|
-
valuePath: string;
|
|
24
25
|
regionId: string;
|
|
25
26
|
};
|
|
26
27
|
/** 选中的面板信息 */
|