@gct-paas/word 0.1.9 → 0.1.10

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.
Files changed (72) hide show
  1. package/dist/base/index.d.ts +1 -0
  2. package/dist/base/modal/src/modal.type.d.ts +2 -2
  3. package/dist/base/select/src/basic-select.vue.d.ts +6 -0
  4. package/dist/base/table/index.d.ts +1 -0
  5. package/dist/base/table/src/table.vue.d.ts +73 -0
  6. package/dist/base/utils/asset-helper-util.d.ts +1 -0
  7. package/dist/core/command/commands/DeleteTable.d.ts +11 -0
  8. package/dist/core/command/commands/InsertTable.d.ts +3 -5
  9. package/dist/core/command/commands/SetHighlight.d.ts +11 -0
  10. package/dist/core/command/types.d.ts +15 -6
  11. package/dist/core/event/handlers/InteractionHandler.d.ts +2 -0
  12. package/dist/core/event/types.d.ts +1 -1
  13. package/dist/core/index.d.ts +1 -0
  14. package/dist/core/interaction/InteractionController.d.ts +6 -0
  15. package/dist/core/interaction/types.d.ts +8 -0
  16. package/dist/core/interaction/useInteraction.d.ts +8 -1
  17. package/dist/core/layout/LayoutMapper.d.ts +1 -0
  18. package/dist/core/layout/handlers/ImageHandler.d.ts +3 -1
  19. package/dist/core/layout/handlers/TextHandler.d.ts +1 -0
  20. package/dist/core/model/base/ModelNode.d.ts +1 -0
  21. package/dist/core/model/document/WrField.d.ts +6 -1
  22. package/dist/core/model/document/WrImage.d.ts +5 -0
  23. package/dist/core/model/document/WrText.d.ts +7 -2
  24. package/dist/core/model/types/style.d.ts +2 -3
  25. package/dist/core/view/Doc.d.ts +7 -0
  26. package/dist/core/view/runs/ImageWidget.d.ts +26 -0
  27. package/dist/core/view/runs/TextRun.d.ts +1 -0
  28. package/dist/domain/active/active-types.d.ts +2 -1
  29. package/dist/index.es.js +12537 -8319
  30. package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +0 -1
  31. package/dist/runtime/canvas/__common__/widget-container/overlay-design.vue.d.ts +9 -3
  32. package/dist/runtime/canvas/__common__/widget-container/overlay-render.vue.d.ts +10 -4
  33. package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +8 -1
  34. package/dist/runtime/designer/ribbon/components/marker-color-select.vue.d.ts +5 -1
  35. package/dist/runtime/designer/toolkit/toolkit-item.vue.d.ts +2 -0
  36. package/dist/runtime/designer/toolkit/toolkit.vue.d.ts +12 -2
  37. package/dist/runtime/{interface/validate.d.ts → factories/createValidateFactory.d.ts} +0 -1
  38. package/dist/runtime/factories/useFormValidator.d.ts +4 -0
  39. package/dist/runtime/factories/useRenderData.d.ts +4 -2
  40. package/dist/runtime/interface/computed.d.ts +1 -1
  41. package/dist/runtime/renderer/dialogs/upload-file/base-upload-file.vue.d.ts +15 -0
  42. package/dist/runtime/renderer/dialogs/upload-file/upload-file-dialog.vue.d.ts +17 -0
  43. package/dist/runtime/renderer/dialogs/upload-file/utils.d.ts +16 -0
  44. package/dist/runtime/renderer/validation/validation-comment-item.vue.d.ts +12 -0
  45. package/dist/runtime/renderer/validation/validation-comment-layer.vue.d.ts +2 -0
  46. package/dist/suites/edhr/panel-schema/data-init/DataInitPanel.vue.d.ts +2 -0
  47. package/dist/suites/edhr/panel-schema/data-init/add-button.vue.d.ts +11 -0
  48. package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-modal.vue.d.ts +8 -0
  49. package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-field/add-builtin-field-select.vue.d.ts +10 -0
  50. package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-modal.vue.d.ts +8 -0
  51. package/dist/suites/edhr/panel-schema/data-init/common/add-builtin-param/add-builtin-param-select.vue.d.ts +11 -0
  52. package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-modal.vue.d.ts +16 -0
  53. package/dist/suites/edhr/panel-schema/data-init/common/add-field/add-field-select.vue.d.ts +23 -0
  54. package/dist/suites/edhr/panel-schema/data-init/common/add-field/useField.d.ts +25 -0
  55. package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/input-param-modal.vue.d.ts +10 -0
  56. package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/ipaas-param-config.vue.d.ts +10 -0
  57. package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/json-param-editor.vue.d.ts +14 -0
  58. package/dist/suites/edhr/panel-schema/data-init/common/add-ipaas/out-param-modal.vue.d.ts +7 -0
  59. package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-input.vue.d.ts +11 -0
  60. package/dist/suites/edhr/panel-schema/data-init/common/add-sql/add-sql-modal.vue.d.ts +8 -0
  61. package/dist/suites/edhr/panel-schema/data-init/common/data-source-field-map.vue.d.ts +11 -0
  62. package/dist/suites/edhr/panel-schema/data-init/common/data-source-model-link.vue.d.ts +39 -0
  63. package/dist/suites/edhr/panel-schema/data-init/common/data-source-title.vue.d.ts +19 -0
  64. package/dist/suites/edhr/panel-schema/data-init/common/param-field-link.vue.d.ts +10 -0
  65. package/dist/suites/edhr/panel-schema/data-init/common/param-key-select.vue.d.ts +18 -0
  66. package/dist/suites/edhr/panel-schema/data-init/data-init.basic.d.ts +5 -0
  67. package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +197 -0
  68. package/dist/suites/edhr/panel-schema/data-init/utils/json-param-logic.d.ts +53 -0
  69. package/dist/suites/edhr/panel-schema/data-init/utils/sql.d.ts +4 -0
  70. package/dist/suites/edhr/panel-schema/index.d.ts +5 -0
  71. package/dist/word.css +1790 -331
  72. package/package.json +2 -2
@@ -17,5 +17,6 @@ export * from './scrollbar';
17
17
  export * from './segment-slider';
18
18
  export * from './select';
19
19
  export * from './switch';
20
+ export * from './table';
20
21
  export * from './tooltip';
21
22
  export * from './date-time-picker';
@@ -1,6 +1,6 @@
1
- import { Component } from 'vue';
1
+ import { Component, Ref } from 'vue';
2
2
  export interface IModalInstance {
3
- bodyRef: any;
3
+ bodyRef: Ref<any>;
4
4
  close: () => void;
5
5
  setLoading: (v: boolean) => void;
6
6
  }
@@ -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
+ };
@@ -6,6 +6,7 @@ export interface UploadFile {
6
6
  controller?: AbortController;
7
7
  status: 'uploading' | 'done' | 'error';
8
8
  url?: string;
9
+ size?: number;
9
10
  preview?: string;
10
11
  timer?: number;
11
12
  realProgress?: number;
@@ -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
+ }
@@ -1,11 +1,9 @@
1
1
  import { Doc } from '../../view/Doc';
2
- import { CommandResult, CommandPayloadMap } from '../types';
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<void>;
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>;
@@ -10,4 +10,6 @@ export declare class InteractionHandler implements IEventHandler {
10
10
  private handleActivePanelData;
11
11
  private handleChangeHoverModelId;
12
12
  private handleFocusWidget;
13
+ private handleShowValidationComment;
14
+ private handleFocusValidation;
13
15
  }
@@ -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';
@@ -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
  };
@@ -41,6 +41,7 @@ export declare class LayoutMapper {
41
41
  [k: string]: {
42
42
  top: number;
43
43
  left: number;
44
+ width: number;
44
45
  };
45
46
  };
46
47
  /** 获取每一页的偏移量 */
@@ -6,5 +6,7 @@ import { LayoutContext } from '../LayoutContext';
6
6
  */
7
7
  export declare class ImageHandler {
8
8
  static emuToPixels(emu: number): number;
9
- static layout(context: LayoutContext, runData: WrImage): void;
9
+ static layout(context: LayoutContext, wr: WrImage): void;
10
+ static layoutRun(context: LayoutContext, wr: WrImage): void;
11
+ static layoutWidget(context: LayoutContext, wr: WrImage): void;
10
12
  }
@@ -13,6 +13,7 @@ export declare class TextHandler {
13
13
  static getValue(context: LayoutContext, wr: WrText): ValueType;
14
14
  static hasValue(value: ValueType): boolean;
15
15
  static layout(context: LayoutContext, wr: WrText): void;
16
+ static getId(context: LayoutContext, wr: WrText): string;
16
17
  static layoutRun(context: LayoutContext, wr: WrText): void;
17
18
  private static addOptionSpacing;
18
19
  private static addOptionLabel;
@@ -59,6 +59,7 @@ export declare abstract class ModelNode {
59
59
  /**
60
60
  * 基于 toXmlJson 的克隆实现
61
61
  * 将实例转换为 XML JSON,再从 XML JSON 创建新实例
62
+ * 使用深拷贝确保克隆的实例完全独立
62
63
  * @returns 克隆后的新实例
63
64
  */
64
65
  clone<T extends this>(this: T, options?: Partial<T>): T;
@@ -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')
@@ -2,6 +2,7 @@ import { RawElement } from '../types/raw';
2
2
  import { Wp } from './Wp';
3
3
  import { Wimages } from '../images';
4
4
  import { ModelNode, ModelNodeOptions } from '../base';
5
+ import { WidgetMeta } from '../../widget/widget-meta';
5
6
  import { WrPr } from './WrPr';
6
7
  type drawingData = {
7
8
  id: string;
@@ -20,9 +21,13 @@ export declare class WrImage extends ModelNode {
20
21
  parent?: Wp;
21
22
  rPr?: WrPr;
22
23
  drawing?: drawingData;
24
+ valuePath?: string;
25
+ widgetMeta?: WidgetMeta;
23
26
  constructor(options: ModelNodeOptions & {
24
27
  rPr?: WrPr;
25
28
  drawing?: drawingData;
29
+ valuePath?: string;
30
+ widgetMeta?: WidgetMeta;
26
31
  });
27
32
  /**
28
33
  * 调整图片尺寸
@@ -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 {};
@@ -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
+ }
@@ -56,6 +56,7 @@ export interface TextRunOptions extends LayoutNodeOptions {
56
56
  valuePath?: string;
57
57
  ascent: number;
58
58
  descent: number;
59
+ style?: TextStyle;
59
60
  }
60
61
  export declare class TextRun extends LayoutNode implements ITextRun {
61
62
  component: "text";
@@ -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
  /** 选中的面板信息 */