@gct-paas/word 0.1.16 → 0.1.18
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/core/command/commands/MergeCells.d.ts +6 -1
- package/dist/core/command/commands/UnmergeCells.d.ts +6 -1
- package/dist/core/command/types.d.ts +2 -0
- package/dist/core/data/DataManager.d.ts +9 -0
- package/dist/core/event/types.d.ts +1 -1
- package/dist/core/index.d.ts +2 -5
- package/dist/core/interaction/InteractionController.d.ts +3 -0
- package/dist/core/interaction/types.d.ts +2 -0
- package/dist/core/interaction/useInteraction.d.ts +1 -0
- package/dist/core/layout/handlers/ImageHandler.d.ts +1 -0
- package/dist/core/layout/handlers/TextHandler.d.ts +5 -0
- package/dist/core/layout/handlers/base/BaseHandler.d.ts +5 -0
- package/dist/core/layout/handlers/fields/BaseHandler.d.ts +5 -0
- package/dist/core/model/DocModel.d.ts +1 -0
- package/dist/core/model/footers/Wfooter.d.ts +6 -0
- package/dist/core/model/headers/Wheader.d.ts +6 -0
- package/dist/core/model/helpers.d.ts +15 -0
- package/dist/core/model/images/Wimages.d.ts +12 -0
- package/dist/core/utils/expand.d.ts +3 -1
- package/dist/core/view/TableCell.d.ts +2 -0
- package/dist/core/view/base/LayoutNode.d.ts +3 -0
- package/dist/core/widget/widget-state.d.ts +14 -5
- package/dist/index.es.js +1005 -532
- package/dist/runtime/canvas/doc-layout.vue.d.ts +2 -1
- package/dist/runtime/canvas/table/utils/index.d.ts +1 -0
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +1 -0
- package/dist/runtime/designer/main/editable-canvas.vue.d.ts +2 -2
- package/dist/runtime/designer/ribbon/components/sub-table-form-modal.vue.d.ts +6 -6
- package/dist/runtime/factories/modules/useSpecificConfig.d.ts +2 -0
- package/dist/runtime/factories/useRenderData.d.ts +1 -1
- package/dist/runtime/factories/useWidgetInitializer.d.ts +11 -0
- package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +2 -2
- package/dist/sdk/doc-runtime/factories/useDocumentFactory.d.ts +7 -1
- package/dist/sdk/engine/index.d.ts +3 -3
- package/dist/sdk/types/index.d.ts +9 -0
- package/dist/sdk/vue/layouts/doc-render-layout.vue.d.ts +2 -2
- package/dist/{core/sdk → utils/composables}/usePagesToPdf.d.ts +1 -1
- package/dist/utils/func/core.d.ts +26 -9
- package/dist/utils/func/field.d.ts +13 -0
- package/dist/utils/func/file.d.ts +1 -1
- package/dist/utils/func/render.d.ts +10 -1
- package/dist/word.css +114 -114
- package/package.json +1 -2
- package/dist/base/utils/unit-converter-util.d.ts +0 -18
- package/dist/core/render/KonvaRenderer.d.ts +0 -46
- package/dist/core/render/RendererFactory.d.ts +0 -4
- package/dist/core/render/types.d.ts +0 -9
- package/dist/core/sdk/createDoc.d.ts +0 -2
- package/dist/runtime/interface/utils.d.ts +0 -12
- /package/dist/core/{sdk → utils}/DocPubApiContext.d.ts +0 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { CommandBase } from '../base/CommandBase';
|
|
2
2
|
import { Doc } from '../../view/Doc';
|
|
3
|
+
import { WrText } from '../../model/document';
|
|
3
4
|
import { CommandPayloadMap } from '../types';
|
|
4
5
|
export declare class MergeCells extends CommandBase<'mergeCells'> {
|
|
5
6
|
constructor(doc: Doc, payload?: CommandPayloadMap['mergeCells']);
|
|
6
|
-
protected execute(): Promise<
|
|
7
|
+
protected execute(): Promise<{
|
|
8
|
+
wr: WrText | undefined;
|
|
9
|
+
pos: number;
|
|
10
|
+
side: string;
|
|
11
|
+
} | null>;
|
|
7
12
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { CommandBase } from '../base/CommandBase';
|
|
2
2
|
import { Doc } from '../../view/Doc';
|
|
3
|
+
import { WrText } from '../../model/document';
|
|
3
4
|
import { CommandPayloadMap } from '../types';
|
|
4
5
|
export declare class UnmergeCells extends CommandBase<'unmergeCells'> {
|
|
5
6
|
constructor(doc: Doc, payload?: CommandPayloadMap['unmergeCells']);
|
|
6
|
-
protected execute(): Promise<
|
|
7
|
+
protected execute(): Promise<{
|
|
8
|
+
wr: WrText | undefined;
|
|
9
|
+
pos: number;
|
|
10
|
+
side: string;
|
|
11
|
+
} | null | undefined>;
|
|
7
12
|
}
|
|
@@ -3,6 +3,7 @@ import { Doc } from '../view/Doc';
|
|
|
3
3
|
import { WidgetMeta } from '../widget/widget-meta';
|
|
4
4
|
import { WordHighlight } from '../model/types';
|
|
5
5
|
import { PointerHitResult } from '../cursor/hit/types';
|
|
6
|
+
import { FieldMeta } from '@gct-paas/api/apaas';
|
|
6
7
|
export interface CursorMeta {
|
|
7
8
|
nodeId: string;
|
|
8
9
|
offset: number;
|
|
@@ -95,6 +96,7 @@ export type CommandPayloadMap = {
|
|
|
95
96
|
insertField: CommandPayload & {
|
|
96
97
|
widgetMeta: WidgetMeta;
|
|
97
98
|
valuePath: string;
|
|
99
|
+
mainModelFields: FieldMeta[];
|
|
98
100
|
};
|
|
99
101
|
insertPaperWidget: CommandPayload & {
|
|
100
102
|
pageWidgetMeta: WidgetMeta;
|
|
@@ -47,6 +47,15 @@ export declare class DataManager {
|
|
|
47
47
|
* @returns 指定路径的标签值或原值,不存在返回 undefined
|
|
48
48
|
*/
|
|
49
49
|
getLabel<T = any>(path: JsonPath): T | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* 根据 jsonpath 设置数据
|
|
52
|
+
* @param path jsonpath 路径
|
|
53
|
+
* @param value 要设置的值
|
|
54
|
+
* @param x
|
|
55
|
+
* @param y
|
|
56
|
+
* @returns 是否设置成功
|
|
57
|
+
*/
|
|
58
|
+
set2D(path: JsonPath, value: any, x: number, y: number, source?: 'user' | 'dependency'): boolean;
|
|
50
59
|
/**
|
|
51
60
|
* 根据 jsonpath 设置数据
|
|
52
61
|
* @param path jsonpath 路径
|
|
@@ -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' | 'cursor:changed' | 'tableSelection:change' | 'dragHoverId:change' | 'hoverModelId:change' | 'focusModelId:change' | 'panelData:change';
|
|
68
|
+
export type EventBusType = 'autoScroll:start' | 'autoScroll:move' | 'autoScroll:stop' | 'caret:changed' | 'caret:requestScroll' | 'cursor:change' | 'cursor:changed' | 'tableSelection:change' | 'activeTableId:change' | 'dragHoverId:change' | 'hoverModelId:change' | 'focusModelId:change' | 'panelData:change';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { useDocPubApiContext } from './
|
|
3
|
-
export { usePrint } from './sdk/usePagesToPdf';
|
|
1
|
+
export { Doc } from './view/Doc';
|
|
2
|
+
export { useDocPubApiContext } from './utils/DocPubApiContext';
|
|
4
3
|
export { useInteraction } from './interaction/useInteraction';
|
|
5
4
|
export { formulaUtils } from './utils/calculate-formula';
|
|
6
5
|
export { TextUtil } from './view/utils/TextUtil';
|
|
@@ -12,11 +11,9 @@ export { DocumentEventBridge } from './event/DocumentEventBridge';
|
|
|
12
11
|
export { DocModeTypeConst, PageSizeEnumConst, BuiltinComponentTypeConst } from './constants';
|
|
13
12
|
export { default as CursorOverlay } from './cursor/render/cursor-overlay.vue';
|
|
14
13
|
export { default as HiddenInput } from './cursor/render/hidden-input.vue';
|
|
15
|
-
export type { PaperItem } from './sdk/usePagesToPdf';
|
|
16
14
|
export type { DocInitOptions } from './view/Doc';
|
|
17
15
|
export type { WidgetMeta } from './widget/widget-meta';
|
|
18
16
|
export type { DocModeType, CompleteComponentType, BuiltinComponentType } from './constants';
|
|
19
|
-
export type { Doc } from './view/Doc';
|
|
20
17
|
export type { LayoutNode } from './view/base/LayoutNode';
|
|
21
18
|
export type { Page } from './view/Page';
|
|
22
19
|
export type { TextRun } from './view/runs/TextRun';
|
|
@@ -17,6 +17,9 @@ export declare class InteractionController {
|
|
|
17
17
|
}): void;
|
|
18
18
|
clearTableSelection(): void;
|
|
19
19
|
onChangeDragHoverId(hitId: string): void;
|
|
20
|
+
onSetActiveTableId(tableId: string): void;
|
|
21
|
+
clearActiveTableId(): void;
|
|
22
|
+
private syncActiveTableByMeta;
|
|
20
23
|
resolveIntent(id: string | undefined, hitId: string | undefined): void;
|
|
21
24
|
onActivePanelData(payload: {
|
|
22
25
|
type: PanelType;
|
|
@@ -7,6 +7,8 @@ export type ITableSelection = {
|
|
|
7
7
|
export type InteractionState = {
|
|
8
8
|
/** 表格选择(行 / 列 / 全选) */
|
|
9
9
|
tableSelection: ITableSelection | null;
|
|
10
|
+
/** 当前激活表格 id(仅用于 table overlay 显示) */
|
|
11
|
+
activeTableId: string;
|
|
10
12
|
/** 拖拽的id 用来进行处理单个单元格选中 */
|
|
11
13
|
dragHoverId: string;
|
|
12
14
|
/** hover 模型的模型 id */
|
|
@@ -6,6 +6,7 @@ export declare function useInteraction(docRef: Ref<Doc | null>): {
|
|
|
6
6
|
readonly axis: "row" | "col" | "all";
|
|
7
7
|
readonly index: number;
|
|
8
8
|
} | null | undefined;
|
|
9
|
+
readonly activeTableId?: string | undefined;
|
|
9
10
|
readonly dragHoverId?: string | undefined;
|
|
10
11
|
readonly hoverModelId?: string | undefined;
|
|
11
12
|
readonly focusModelId?: string | undefined;
|
|
@@ -2,6 +2,11 @@ import { WrText } from '../../model/document';
|
|
|
2
2
|
import { LayoutContext } from '../LayoutContext';
|
|
3
3
|
export declare class TextHandler {
|
|
4
4
|
static getId(context: LayoutContext, wr: WrText): string;
|
|
5
|
+
static get2DInfo(context: LayoutContext): {
|
|
6
|
+
xDataIndex: number | undefined;
|
|
7
|
+
yDataIndex: number | undefined;
|
|
8
|
+
valuePath2D: string | undefined;
|
|
9
|
+
};
|
|
5
10
|
/**
|
|
6
11
|
* 合并部分run
|
|
7
12
|
* @param context
|
|
@@ -20,7 +20,12 @@ export declare abstract class BaseHandler {
|
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
22
|
getDataIndex(init?: 0 | null): number | null;
|
|
23
|
+
getPaperIndex(): number | null;
|
|
23
24
|
getId(): string;
|
|
25
|
+
get2DInfo(): {
|
|
26
|
+
xDataIndex: number | undefined;
|
|
27
|
+
yDataIndex: number | undefined;
|
|
28
|
+
};
|
|
24
29
|
getLayoutStyle(): ReturnType<typeof TextRun.textStyle2LayoutStyle>;
|
|
25
30
|
abstract layout(): void;
|
|
26
31
|
}
|
|
@@ -9,6 +9,11 @@ export type HandlerContext = {
|
|
|
9
9
|
export declare class BaseHandler {
|
|
10
10
|
static hasValue(value: ValueType): boolean;
|
|
11
11
|
static getId(context: LayoutContext, wr: WrText): string;
|
|
12
|
+
static get2DInfo(context: LayoutContext): {
|
|
13
|
+
xDataIndex: number | undefined;
|
|
14
|
+
yDataIndex: number | undefined;
|
|
15
|
+
valuePath2D: string | undefined;
|
|
16
|
+
};
|
|
12
17
|
static getValue(ctx: HandlerContext, valuePath: string): any;
|
|
13
18
|
static getLabel(ctx: HandlerContext, valuePath: string): any;
|
|
14
19
|
static getNoValueLabel(ctx: HandlerContext): {
|
|
@@ -11,6 +11,21 @@ export declare const removeChildByName: (parent: ElementNode, name: string) => v
|
|
|
11
11
|
export declare const hasChild: (el: ElementNode | undefined, name: string) => boolean;
|
|
12
12
|
export declare const pickElement: (raw: RawElement, name: string) => RawElement | undefined;
|
|
13
13
|
export declare const pickAllElements: (raw: RawElement, name: string) => RawElement[];
|
|
14
|
+
/**
|
|
15
|
+
* OOXML 开关类元素(w:b、w:i、w:strike 等):空节点表示开;w:val="0"|false|off 表示关。
|
|
16
|
+
* 场景 1.{
|
|
17
|
+
"@attrs": {
|
|
18
|
+
"w:val": "0"
|
|
19
|
+
},
|
|
20
|
+
"name": "w:i",
|
|
21
|
+
"type": "element"
|
|
22
|
+
}
|
|
23
|
+
场景 2. {
|
|
24
|
+
"name": "w:i",
|
|
25
|
+
"type": "element"
|
|
26
|
+
}
|
|
27
|
+
*/
|
|
28
|
+
export declare const parseOnOffToggleFromElement: (el: RawElement | undefined) => boolean | undefined;
|
|
14
29
|
export declare const getTextFromRaw: <T extends {
|
|
15
30
|
text: string;
|
|
16
31
|
extra?: any;
|
|
@@ -9,12 +9,19 @@ export interface DocImage {
|
|
|
9
9
|
};
|
|
10
10
|
url: string;
|
|
11
11
|
}
|
|
12
|
+
export type ImageScope = 'body' | 'header' | 'footer';
|
|
13
|
+
export interface ScopedImageQuery {
|
|
14
|
+
imageId: string;
|
|
15
|
+
scope?: ImageScope;
|
|
16
|
+
ownerRelId?: string;
|
|
17
|
+
}
|
|
12
18
|
/**
|
|
13
19
|
* Word 图片管理类
|
|
14
20
|
* 用于保存和管理文档中的所有图片资源
|
|
15
21
|
*/
|
|
16
22
|
export declare class Wimages {
|
|
17
23
|
private images;
|
|
24
|
+
private scopedImages;
|
|
18
25
|
constructor(images?: DocImage[]);
|
|
19
26
|
/**
|
|
20
27
|
* 从 XML JSON 转换为 Wimages 实例
|
|
@@ -22,18 +29,22 @@ export declare class Wimages {
|
|
|
22
29
|
* @returns Wimages 实例
|
|
23
30
|
*/
|
|
24
31
|
static fromXmlJson(json: any): Wimages;
|
|
32
|
+
private rebuildBodyIndex;
|
|
33
|
+
private makeScopedKey;
|
|
25
34
|
/**
|
|
26
35
|
* 根据图片 ID 获取图片信息
|
|
27
36
|
* @param imageId 图片的 Relationship ID
|
|
28
37
|
* @returns 对应的 DocImage 对象,如果不存在返回 undefined
|
|
29
38
|
*/
|
|
30
39
|
getImageById(imageId: string): DocImage | undefined;
|
|
40
|
+
getImageByScopedId(query: ScopedImageQuery): DocImage | undefined;
|
|
31
41
|
/**
|
|
32
42
|
* 根据图片 ID 获取图片 URL
|
|
33
43
|
* @param imageId 图片的 Relationship ID
|
|
34
44
|
* @returns 图片 URL,如果不存在返回 undefined
|
|
35
45
|
*/
|
|
36
46
|
getImageUrlById(imageId: string): string | undefined;
|
|
47
|
+
getImageUrl(query: ScopedImageQuery): string | undefined;
|
|
37
48
|
/**
|
|
38
49
|
* 获取所有图片
|
|
39
50
|
* @returns 所有图片的数组
|
|
@@ -44,6 +55,7 @@ export declare class Wimages {
|
|
|
44
55
|
* @param image 图片对象
|
|
45
56
|
*/
|
|
46
57
|
addImage(image: DocImage): void;
|
|
58
|
+
addScopedImage(query: ScopedImageQuery, image: DocImage): void;
|
|
47
59
|
/**
|
|
48
60
|
* 移除指定 ID 的图片
|
|
49
61
|
* @param imageId 图片的 Relationship ID
|
|
@@ -8,6 +8,8 @@ export type CellFragment = {
|
|
|
8
8
|
rowspan: number;
|
|
9
9
|
colspan: number;
|
|
10
10
|
dataIndex?: number;
|
|
11
|
+
xDataIndex?: number;
|
|
12
|
+
yDataIndex?: number;
|
|
11
13
|
repeatingId?: string;
|
|
12
14
|
_2DTableId?: string;
|
|
13
15
|
boundedId?: string;
|
|
@@ -58,7 +60,7 @@ export declare class TableExpander {
|
|
|
58
60
|
private initializeBoundedItemDataIndex;
|
|
59
61
|
private initializeDataGroup2DDataIndex;
|
|
60
62
|
private initializeRows;
|
|
61
|
-
|
|
63
|
+
getRepeatCount(region: RepeatingRegion | _2DTableRegion): number;
|
|
62
64
|
private initializeRepeatingRowsInRange;
|
|
63
65
|
private initialize2DTableRowsInRange;
|
|
64
66
|
private initializeBoundedRowInRange;
|
|
@@ -19,6 +19,8 @@ export type SubRenderer = {
|
|
|
19
19
|
id: string;
|
|
20
20
|
type: 'dynamic-table' | '2d-table' | 'fixed-table' | 'check-table' | 'table-header';
|
|
21
21
|
dataIndex?: number;
|
|
22
|
+
xDataIndex?: number;
|
|
23
|
+
yDataIndex?: number;
|
|
22
24
|
valuePath: string;
|
|
23
25
|
widgetMeta?: RepeatingWidgetMeta | BoundedWidgetMeta | CheckTableWidgetMeta;
|
|
24
26
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Doc } from '../view/Doc';
|
|
2
|
+
import { FieldPermissionInfo } from '../../sdk/types';
|
|
3
|
+
export type WidgetDisplayStatus = 'readonly-component' | 'edit-component' | 'readonly-text';
|
|
1
4
|
export interface WidgetStateContext {
|
|
2
|
-
|
|
3
|
-
isEditMode: boolean;
|
|
4
|
-
isPrintMode: boolean;
|
|
5
|
-
formType?: string;
|
|
5
|
+
doc: Doc;
|
|
6
6
|
viewState?: string;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
newRequired?: boolean;
|
|
@@ -12,10 +12,19 @@ export interface WidgetStateContext {
|
|
|
12
12
|
newDisabled?: boolean;
|
|
13
13
|
cannotInput?: boolean;
|
|
14
14
|
isLinkedModelField?: boolean;
|
|
15
|
+
fieldLink: string;
|
|
16
|
+
modelLink: string;
|
|
15
17
|
}
|
|
18
|
+
interface ResolveDisplayStatusFromAuthOptions {
|
|
19
|
+
info?: FieldPermissionInfo;
|
|
20
|
+
readonlyString: WidgetDisplayStatus;
|
|
21
|
+
editString: WidgetDisplayStatus;
|
|
22
|
+
}
|
|
23
|
+
export declare function resolveDisplayStatusFromAuth(options: ResolveDisplayStatusFromAuthOptions): WidgetDisplayStatus | null;
|
|
16
24
|
export declare function resolveWidgetState(ctx: WidgetStateContext): {
|
|
17
25
|
required: boolean;
|
|
18
26
|
readonly: boolean;
|
|
19
27
|
disabled: boolean;
|
|
20
|
-
displayStatus:
|
|
28
|
+
displayStatus: WidgetDisplayStatus;
|
|
21
29
|
};
|
|
30
|
+
export {};
|