@gct-paas/word 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +274 -15
- package/dist/base/avatar/index.d.ts +1 -0
- package/dist/base/avatar/src/Avatar.vue.d.ts +9 -0
- package/dist/base/avatar/src/utils/useFile.d.ts +3 -0
- package/dist/base/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -1
- package/dist/base/color-picker/index.d.ts +1 -0
- package/dist/base/color-picker/src/ColorPicker.vue.d.ts +88 -0
- package/dist/base/color-picker/src/constant/index.d.ts +6 -0
- package/dist/base/divider/index.d.ts +1 -0
- package/dist/base/divider/src/divider.d.ts +7 -0
- package/dist/base/divider/src/divider.vue.d.ts +19 -0
- package/dist/base/dropdown/src/dropdown-basic-select.vue.d.ts +2 -2
- package/dist/base/empty/index.d.ts +1 -0
- package/dist/base/empty/src/empty.d.ts +8 -0
- package/dist/base/empty/src/empty.vue.d.ts +9 -0
- package/dist/base/index.d.ts +5 -0
- package/dist/base/input/index.d.ts +1 -0
- package/dist/base/input/src/input-number.vue.d.ts +24 -2
- package/dist/base/input/src/input.vue.d.ts +7 -7
- package/dist/base/input/src/text-area.vue.d.ts +65 -0
- package/dist/base/modal/src/ModalRoot.vue.d.ts +1 -1
- package/dist/base/select/src/basic-select.vue.d.ts +4 -3
- package/dist/base/slider/index.d.ts +1 -0
- package/dist/base/slider/src/slider.vue.d.ts +22 -0
- package/dist/base/tree-select/src/tree-select.vue.d.ts +2 -2
- package/dist/base/utils/asset-helper-util.d.ts +23 -2
- package/dist/capabilities/panel/config/types.d.ts +2 -1
- package/dist/capabilities/paper-widget-manifest/types.d.ts +13 -2
- package/dist/core/command/base/SetStyleBase.d.ts +4 -0
- package/dist/core/command/commands/Delete2DTable.d.ts +12 -0
- package/dist/core/command/commands/DeleteCheckTable.d.ts +12 -0
- package/dist/core/command/commands/DeleteDataGroup2D.d.ts +12 -0
- package/dist/core/command/commands/DeleteTableHeader.d.ts +12 -0
- package/dist/core/command/commands/InsertFloatingOverlay.d.ts +9 -0
- package/dist/core/command/commands/InsertPaperWidget.d.ts +2 -42
- package/dist/core/command/commands/ResizeOverlayLayout.d.ts +7 -0
- package/dist/core/command/commands/Set2DTable.d.ts +7 -0
- package/dist/core/command/commands/SetCheckTable.d.ts +7 -0
- package/dist/core/command/commands/SetDataGroup2D.d.ts +25 -0
- package/dist/core/command/commands/SetHeaderFooterConfig.d.ts +11 -0
- package/dist/core/command/commands/SetSubTableHeader.d.ts +8 -0
- package/dist/core/command/commands/SetTableHeader.d.ts +7 -0
- package/dist/core/command/types.d.ts +68 -3
- package/dist/core/constants/index.d.ts +7 -0
- package/dist/core/cursor/CursorController.d.ts +15 -0
- package/dist/core/cursor/hit/OverlayLayoutHitHandler.d.ts +9 -0
- package/dist/core/cursor/hit/types.d.ts +17 -0
- package/dist/core/cursor/layout/baseMeta.d.ts +1 -1
- package/dist/core/data/DataManager.d.ts +5 -0
- package/dist/core/event/DocumentEventBridge.d.ts +5 -1
- package/dist/core/event/EventManager.d.ts +1 -1
- package/dist/core/event/handlers/InteractionHandler.d.ts +3 -0
- package/dist/core/event/handlers/KonvaHandler.d.ts +3 -0
- package/dist/core/index.d.ts +8 -4
- package/dist/core/interaction/InteractionController.d.ts +8 -1
- package/dist/core/interaction/InteractionPolicy.d.ts +2 -0
- package/dist/core/interaction/types.d.ts +8 -0
- package/dist/core/interaction/useInteraction.d.ts +7 -3
- package/dist/core/layout/LayoutContext.d.ts +13 -3
- package/dist/core/layout/LayoutManager.d.ts +14 -0
- package/dist/core/layout/LayoutMapper.d.ts +0 -2
- package/dist/core/layout/handlers/PageWidgetHandler.d.ts +5 -0
- package/dist/core/layout/handlers/TextHandler.d.ts +11 -0
- package/dist/core/layout/handlers/base/BaseHandler.d.ts +26 -0
- package/dist/core/layout/handlers/fields/{ImgHandler.d.ts → ImageHandler.d.ts} +1 -1
- package/dist/core/layout/handlers/fields/index.d.ts +1 -1
- package/dist/core/layout/handlers/index.d.ts +1 -0
- package/dist/core/layout/handlers/pageWidgets/BarcodeHandler.d.ts +11 -0
- package/dist/core/layout/handlers/pageWidgets/DefaultHandler.d.ts +4 -0
- package/dist/core/layout/handlers/pageWidgets/DiagonalHandler.d.ts +4 -0
- package/dist/core/layout/handlers/pageWidgets/ImageHandler.d.ts +4 -0
- package/dist/core/layout/handlers/pageWidgets/LineHandler.d.ts +4 -0
- package/dist/core/layout/handlers/pageWidgets/PaginationHandler.d.ts +7 -0
- package/dist/core/layout/handlers/pageWidgets/QrCodeHandler.d.ts +4 -0
- package/dist/core/layout/handlers/pageWidgets/SerialNumberHandler.d.ts +4 -0
- package/dist/core/layout/handlers/pageWidgets/index.d.ts +8 -0
- package/dist/core/layout/logic/LayoutBuilder.d.ts +7 -3
- package/dist/core/layout/logic/ModelBuilder.d.ts +2 -1
- package/dist/core/layout/providers/TableInfoProvider.d.ts +8 -2
- package/dist/core/layout/types/index.d.ts +7 -0
- package/dist/core/model/DocModel.d.ts +20 -0
- package/dist/core/model/base/ModelNode.d.ts +4 -0
- package/dist/core/model/base/RefManager.d.ts +50 -0
- package/dist/core/model/base/index.d.ts +1 -0
- package/dist/core/model/document/Wbackground.d.ts +22 -0
- package/dist/core/model/document/Wdocument.d.ts +7 -1
- package/dist/core/model/document/Wp.d.ts +8 -1
- package/dist/core/model/document/WrImage.d.ts +2 -0
- package/dist/core/model/document/WrPageWidget.d.ts +8 -0
- package/dist/core/model/document/WrText.d.ts +9 -2
- package/dist/core/model/document/WsecPr.d.ts +66 -1
- package/dist/core/model/document/Wtbl/Calculation.d.ts +12 -0
- package/dist/core/model/document/Wtbl/RegionManager.d.ts +13 -1
- package/dist/core/model/document/Wtbl/RowColumnOps.d.ts +6 -0
- package/dist/core/model/document/Wtbl/Serialization.d.ts +12 -0
- package/dist/core/model/document/Wtbl.d.ts +22 -1
- package/dist/core/model/document/Wtc.d.ts +54 -4
- package/dist/core/model/document/WtrPr.d.ts +1 -0
- package/dist/core/model/document/index.d.ts +2 -0
- package/dist/core/model/footers/Wfooter.d.ts +40 -0
- package/dist/core/model/footers/Wfooters.d.ts +42 -0
- package/dist/core/model/headers/Wheader.d.ts +40 -0
- package/dist/core/model/headers/Wheaders.d.ts +45 -0
- package/dist/core/model/logic/CheckTableRegion.d.ts +44 -0
- package/dist/core/model/logic/DataGroup2DRegion.d.ts +12 -0
- package/dist/core/model/logic/SubTableHeaderRegion.d.ts +22 -0
- package/dist/core/model/logic/TableHeaderRegion.d.ts +16 -0
- package/dist/core/model/logic/_2DTableRegion.d.ts +44 -0
- package/dist/core/model/logic/index.d.ts +14 -1
- package/dist/core/model/overlays/Wlayout.d.ts +70 -0
- package/dist/core/model/overlays/Woverlay.d.ts +41 -0
- package/dist/core/model/overlays/Woverlays.d.ts +45 -0
- package/dist/core/model/settings/Wsettings.d.ts +47 -0
- package/dist/core/model/templates/footer.template.d.ts +75 -0
- package/dist/core/model/templates/header.template.d.ts +75 -0
- package/dist/core/model/templates/layout.template.d.ts +66 -0
- package/dist/core/model/templates/overlay.template.d.ts +22 -0
- package/dist/core/model/templates/paragraph.template.d.ts +46 -0
- package/dist/core/model/templates/trPr.template.d.ts +19 -0
- package/dist/core/model/types/model.d.ts +3 -0
- package/dist/core/model/types/region.d.ts +1 -0
- package/dist/core/sdk/DocPubApiContext.d.ts +14 -12
- package/dist/core/sdk/createDoc.d.ts +1 -3
- package/dist/core/sdk/usePagesToPdf.d.ts +13 -4
- package/dist/core/utils/expand.d.ts +29 -4
- package/dist/core/utils/index.d.ts +4 -0
- package/dist/core/utils/unit-converter-util.d.ts +12 -2
- package/dist/core/view/Doc.d.ts +14 -3
- package/dist/core/view/Page.d.ts +50 -1
- package/dist/core/view/Paragraph.d.ts +2 -0
- package/dist/core/view/Section.d.ts +26 -1
- package/dist/core/view/Table.d.ts +12 -0
- package/dist/core/view/TableCell.d.ts +7 -3
- package/dist/core/view/TableRow.d.ts +2 -0
- package/dist/core/view/base/BandContainer.d.ts +49 -0
- package/dist/core/view/base/LayoutGroup.d.ts +11 -0
- package/dist/core/view/base/LayoutNode.d.ts +3 -0
- package/dist/core/view/base/OverlayContainer.d.ts +31 -0
- package/dist/core/view/base/OverlayLayout.d.ts +19 -0
- package/dist/core/view/base/index.d.ts +2 -0
- package/dist/core/view/runs/ImageRun.d.ts +9 -0
- package/dist/core/view/runs/ImageWidget.d.ts +12 -6
- package/dist/core/view/runs/TextRun.d.ts +26 -3
- package/dist/core/view/runs/TextWidget.d.ts +14 -7
- package/dist/core/view/utils/EventUtil.d.ts +22 -0
- package/dist/core/view/utils/TextUtil.d.ts +47 -0
- package/dist/core/widget/widget-meta.d.ts +5 -0
- package/dist/domain/active/active-types.d.ts +12 -6
- package/dist/domain/constants/enum.d.ts +34 -0
- package/dist/domain/constants/options.d.ts +4 -0
- package/dist/domain/field/field-props-schema-type.d.ts +1 -1
- package/dist/domain/paper-widget/paper-widget-props-schema-type.d.ts +2 -0
- package/dist/domain/paper-widget/paper-widget-type.d.ts +10 -141
- package/dist/domain/paper-widget/widget-binding.d.ts +8 -0
- package/dist/domain/widget/component-type.d.ts +6 -2
- package/dist/index.d.ts +5 -10
- package/dist/index.es.js +57077 -46931
- package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +2 -2
- package/dist/runtime/_register_/context/DesignSuiteContext.d.ts +2 -0
- package/dist/runtime/canvas/__common__/context-menu/index.vue.d.ts +3 -1
- package/dist/runtime/canvas/doc-layout.vue.d.ts +11 -5
- package/dist/runtime/canvas/inline-image/resize-box.vue.d.ts +28 -7
- package/dist/{suites/edhr/panel-schema/paper-widget/widgets/barcode.vue.d.ts → runtime/canvas/node/overlay-layout.vue.d.ts} +2 -3
- package/dist/{suites/edhr/panel-schema/paper-widget/widgets/qrcode.vue.d.ts → runtime/canvas/overlay/page-overlay-group.vue.d.ts} +4 -3
- package/dist/{suites/edhr/panel-schema/paper-widget/widgets/diagonal.vue.d.ts → runtime/canvas/paper/header-footer-guides.vue.d.ts} +2 -3
- package/dist/runtime/canvas/paper/inner-corner-mark.vue.d.ts +2 -5
- package/dist/runtime/canvas/paper/paper-group.vue.d.ts +2 -1
- package/dist/{suites/edhr/panel-schema/paper-widget/widgets/serialnumber.vue.d.ts → runtime/canvas/paper/paper-hit-rect.vue.d.ts} +3 -3
- package/dist/runtime/canvas/table/design/table-structure-overlay/dynamic-label.vue.d.ts +1 -0
- package/dist/runtime/canvas/table/design/table-structure-overlay/placeholder-label.vue.d.ts +1 -0
- package/dist/runtime/canvas/table/utils/index.d.ts +21 -3
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +5 -1
- package/dist/runtime/designer/main/editable-canvas.vue.d.ts +6 -3
- package/dist/runtime/designer/ribbon/components/set-table-header-form-modal.vue.d.ts +18 -0
- package/dist/runtime/designer/ribbon/components/sub-table-form-modal.vue.d.ts +4 -1
- package/dist/runtime/factories/usePwRenderData.d.ts +13 -0
- package/dist/runtime/factories/useRenderData.d.ts +1 -1
- package/dist/runtime/interface/change-diff.d.ts +26 -0
- package/dist/runtime/interface/render.d.ts +18 -0
- package/dist/runtime/renderer/annotation/annotation-comment-item.vue.d.ts +13 -0
- package/dist/runtime/renderer/annotation/annotation-comment-layer.vue.d.ts +2 -0
- package/dist/runtime/renderer/dropdowns/components/tables/rdo-table-dropdown.vue.d.ts +16 -16
- package/dist/runtime/renderer/dropdowns/components/tables/table-dropdown.vue.d.ts +16 -16
- package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +8 -4
- package/dist/sdk/doc-runtime/composables/useDocController.d.ts +17 -0
- package/dist/sdk/doc-runtime/composables/useDocOperations.d.ts +41 -0
- package/dist/sdk/doc-runtime/composables/useDocRuntimeProvider.d.ts +19 -0
- package/dist/sdk/doc-runtime/composables/useDocSuite.d.ts +20 -0
- package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +10 -0
- package/dist/sdk/doc-runtime/factories/document-request-strategy.d.ts +3 -0
- package/dist/sdk/doc-runtime/factories/runtime-json-builder.d.ts +17 -0
- package/dist/{runtime → sdk/doc-runtime}/factories/useDocumentFactory.d.ts +33 -6
- package/dist/sdk/doc-runtime/useWord.d.ts +16 -0
- package/dist/sdk/engine/index.d.ts +14 -0
- package/dist/sdk/index.d.ts +14 -0
- package/dist/sdk/plugins/index.d.ts +15 -0
- package/dist/sdk/setup.d.ts +55 -0
- package/dist/sdk/types/index.d.ts +154 -0
- package/dist/sdk/vue/index.d.ts +7 -0
- package/dist/sdk/vue/layouts/doc-design-layout.d.ts +7 -0
- package/dist/sdk/vue/layouts/doc-design-layout.vue.d.ts +10 -0
- package/dist/{runtime/renderer → sdk/vue/layouts}/doc-render-layout.vue.d.ts +17 -11
- package/dist/suites/edhr/field-manifest/_common_/basic.d.ts +6 -0
- package/dist/suites/edhr/index.d.ts +3 -2
- package/dist/suites/edhr/panel-config/index.d.ts +2 -1
- package/dist/suites/edhr/panel-schema/2d-table/2d-table.basic.d.ts +14 -0
- package/dist/suites/edhr/panel-schema/{paper-widget/widgets/editors/diagonal-name-editor.vue.d.ts → 2d-table/_2DTablePanel.vue.d.ts} +4 -5
- package/dist/suites/edhr/panel-schema/{paper-widget/widgets/image.vue.d.ts → check-table/CheckTablePanel.vue.d.ts} +5 -5
- package/dist/suites/edhr/panel-schema/check-table/check-table.basic.d.ts +14 -0
- package/dist/suites/edhr/panel-schema/data-group-2d/DataGroup2DPanel.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/data-group-2d/data-group-2d.basic.d.ts +14 -0
- package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +26 -2
- package/dist/suites/edhr/panel-schema/data-init/utils/json-schema.d.ts +18 -0
- package/dist/suites/edhr/panel-schema/data-load/DataLoadPanel.vue.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/data-load/ai-tmpl/ai-tmpl-editor.vue.d.ts +6 -0
- package/dist/suites/edhr/panel-schema/data-load/ai-tmpl/identify-param-card.vue.d.ts +14 -0
- package/dist/suites/edhr/panel-schema/data-load/common/add-tmpl-btn.vue.d.ts +16 -0
- package/dist/suites/edhr/panel-schema/data-load/common/decimal-slider.vue.d.ts +21 -0
- package/dist/suites/edhr/panel-schema/data-load/common/form-field-select.vue.d.ts +19 -0
- package/dist/suites/edhr/panel-schema/data-load/common/icon-tooltip.vue.d.ts +10 -0
- package/dist/suites/edhr/panel-schema/data-load/common/remove-icon.vue.d.ts +7 -0
- package/dist/suites/edhr/panel-schema/data-load/common/tmpl-card.vue.d.ts +25 -0
- package/dist/suites/edhr/panel-schema/data-load/data-load.basic.d.ts +5 -0
- package/dist/suites/edhr/panel-schema/data-load/device-tmpl/device-field-status.vue.d.ts +9 -0
- package/dist/suites/edhr/panel-schema/data-load/device-tmpl/device-tmpl-editor.vue.d.ts +6 -0
- package/dist/suites/edhr/panel-schema/data-load/device-tmpl/params-item-card.vue.d.ts +30 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/constant.d.ts +44 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/controller.d.ts +38 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/index.d.ts +3 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/types.d.ts +157 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/form-tmpl-config/form-tmpl-config-controller.d.ts +67 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/form-tmpl-config/index.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/data-load/hooks/form-tmpl-config/use-form-tmpl-config.d.ts +10 -0
- package/dist/suites/edhr/panel-schema/index.d.ts +70 -1
- package/dist/suites/edhr/panel-schema/paper-header-footer/PaperHeaderFooterPanel.vue.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/paper-header-footer/paper-header-footer.basic.d.ts +5 -0
- package/dist/suites/edhr/panel-schema/paper-widget/PaperWidgetPanel.vue.d.ts +7 -1
- package/dist/suites/edhr/panel-schema/paper-widget/paper-widget.basic.d.ts +7 -1
- package/dist/suites/edhr/panel-schema/table-header/TableHeaderPanel.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/table-header/table-header.basic.d.ts +11 -0
- package/dist/suites/edhr/paper-widget-manifest/basic/line-manifest.d.ts +2 -0
- package/dist/suites/edhr/paper-widget-manifest/basic/pagination-manifest.d.ts +2 -0
- package/dist/suites/{edhr/panel-schema/paper-widget/widgets/editors/align-editor.vue.d.ts → shared/panel/config/editor/FormNumberEditor.vue.d.ts} +6 -8
- package/dist/suites/shared/panel/config/editor/single-field-editor/types.d.ts +9 -0
- package/dist/suites/{edhr/panel-schema/paper-widget/widgets/editors/size-editor.vue.d.ts → shared/panel/modules/field-formula-module/field-formula-module.vue.d.ts} +8 -8
- package/dist/suites/shared/panel/modules/table-setting-module.vue.d.ts +5 -4
- package/dist/utils/TriggerUtil.d.ts +1 -1
- package/dist/utils/func/dragdrop.d.ts +6 -1
- package/dist/utils/func/file.d.ts +1 -1
- package/dist/utils/symbol/contextKey.d.ts +7 -1
- package/dist/word.css +9288 -8120
- package/package.json +4 -1
- package/dist/core/sdk/types/public-types.d.ts +0 -78
- package/dist/runtime/designer/doc-design-layout.vue.d.ts +0 -6
- package/dist/runtime/useDocEngine.d.ts +0 -36
- package/dist/setup.d.ts +0 -46
- package/dist/suites/edhr/panel-schema/paper-widget/widgets/editors/img-parser.d.ts +0 -9
- package/dist/suites/edhr/panel-schema/paper-widget/widgets/editors/value-editor.vue.d.ts +0 -46
- /package/dist/suites/edhr/panel-config/{file → field/file}/upload.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Doc } from '../view/Doc';
|
|
2
2
|
import { MoveOpts } from '../event/types';
|
|
3
|
+
import { PointerHitResult } from './hit/types';
|
|
3
4
|
import { Pos } from './session/CursorDragSession';
|
|
4
5
|
export declare class CursorController {
|
|
5
6
|
doc: Doc;
|
|
@@ -47,5 +48,19 @@ export declare class CursorController {
|
|
|
47
48
|
phase?: 'preview' | 'commit';
|
|
48
49
|
syncCaret?: boolean;
|
|
49
50
|
}): void;
|
|
51
|
+
/**
|
|
52
|
+
* 根据鼠标位置,计算命中的页面及坐标信息
|
|
53
|
+
*/
|
|
54
|
+
getPageHitInfo(canvasX: number, canvasY: number): {
|
|
55
|
+
page: import('..').Page;
|
|
56
|
+
canvasX: number;
|
|
57
|
+
canvasY: number;
|
|
58
|
+
relX: number;
|
|
59
|
+
relY: number;
|
|
60
|
+
} | null;
|
|
61
|
+
/**
|
|
62
|
+
* 解析指针命中结果
|
|
63
|
+
*/
|
|
64
|
+
resolvePointerHit(canvasX: number, canvasY: number, pos?: Pos): PointerHitResult | null;
|
|
50
65
|
destroy(): void;
|
|
51
66
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Doc } from '../../view/Doc';
|
|
2
|
+
import { BaseMetaNode } from '../../layout/types';
|
|
3
|
+
import { HitHandler, HitResult } from './types';
|
|
4
|
+
import { HitHandlerRegistry } from './HitHandlerRegistry';
|
|
5
|
+
export declare class OverlayLayoutHitHandler implements HitHandler {
|
|
6
|
+
private registry?;
|
|
7
|
+
constructor(registry?: HitHandlerRegistry);
|
|
8
|
+
handleHitDetection(doc: Doc, node: BaseMetaNode, actualX: number, actualY: number): HitResult | null;
|
|
9
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseMetaNode } from '../../layout/types';
|
|
2
2
|
import { Doc } from '../../view/Doc';
|
|
3
3
|
import { CursorIntent, Side } from '../types/cursor';
|
|
4
|
+
import { Page } from '../../view/Page';
|
|
4
5
|
export interface HitResult {
|
|
5
6
|
id: string;
|
|
6
7
|
offset: number;
|
|
@@ -34,3 +35,19 @@ export interface HitHandler {
|
|
|
34
35
|
/** 是否点中即全选 */
|
|
35
36
|
isClickSelectAll?: (doc: Doc, node: BaseMetaNode) => HitIntent;
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* 指针命中结果(统一数据结构)
|
|
40
|
+
* 所有拖拽 / hover / 点击 / cursor 都应该基于它
|
|
41
|
+
*/
|
|
42
|
+
export interface PointerHitResult {
|
|
43
|
+
/** 命中的页面 */
|
|
44
|
+
page: Page;
|
|
45
|
+
/** 命中的区域 */
|
|
46
|
+
zone: 'header' | 'footer' | 'body';
|
|
47
|
+
/** 画布坐标 */
|
|
48
|
+
canvasX: number;
|
|
49
|
+
canvasY: number;
|
|
50
|
+
/** 相对于 page 的坐标 */
|
|
51
|
+
relX: number;
|
|
52
|
+
relY: number;
|
|
53
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Doc } from '../view/Doc';
|
|
2
2
|
export type Data = Record<string, any>;
|
|
3
|
+
export type PartialData = Partial<Data>;
|
|
3
4
|
type JsonPath = string;
|
|
4
5
|
type SubscriptionCallback = (newValue: any, oldValue: any) => void;
|
|
5
6
|
/**
|
|
@@ -53,6 +54,10 @@ export declare class DataManager {
|
|
|
53
54
|
* @returns 是否设置成功
|
|
54
55
|
*/
|
|
55
56
|
set(path: JsonPath, value: any, source?: 'user' | 'dependency'): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* 将一个部分值对象合进整体
|
|
59
|
+
*/
|
|
60
|
+
patch(data: PartialData): void;
|
|
56
61
|
/**
|
|
57
62
|
* 根据 jsonpath 删除数据
|
|
58
63
|
* @param path jsonpath 路径
|
|
@@ -36,7 +36,11 @@ export declare class DocumentEventBridge {
|
|
|
36
36
|
private onDown;
|
|
37
37
|
private onMove;
|
|
38
38
|
private onUp;
|
|
39
|
-
|
|
39
|
+
emit(type: string, pos: {
|
|
40
|
+
clientX: number;
|
|
41
|
+
clientY: number;
|
|
42
|
+
pointerId: number;
|
|
43
|
+
}): void;
|
|
40
44
|
private onScroll;
|
|
41
45
|
private onRequestScroll;
|
|
42
46
|
private ensureCaretVisibleByHiddenInput;
|
|
@@ -12,4 +12,7 @@ export declare class InteractionHandler implements IEventHandler {
|
|
|
12
12
|
private handleFocusWidget;
|
|
13
13
|
private handleShowValidationComment;
|
|
14
14
|
private handleFocusValidation;
|
|
15
|
+
private handleChangeHeader2footerBool;
|
|
16
|
+
private handleSetAnnotation;
|
|
17
|
+
private handleFocusAnnotation;
|
|
15
18
|
}
|
|
@@ -2,6 +2,7 @@ import { EventHandlerConfig, IEventHandler } from '../types';
|
|
|
2
2
|
import { EventManager } from '../EventManager';
|
|
3
3
|
export declare class KonvaHandler implements IEventHandler {
|
|
4
4
|
private eventManager;
|
|
5
|
+
private dragMode;
|
|
5
6
|
constructor(eventManager: EventManager);
|
|
6
7
|
getHandlers(): EventHandlerConfig[];
|
|
7
8
|
/** 从 Konva shape 向上查找组件id: */
|
|
@@ -13,6 +14,8 @@ export declare class KonvaHandler implements IEventHandler {
|
|
|
13
14
|
private handleDragStart;
|
|
14
15
|
private handleDragMove;
|
|
15
16
|
private handleDragEnd;
|
|
17
|
+
/** 根据 pointer(鼠标/触摸)位置,解析命中结果 */
|
|
18
|
+
private handlePointerResolve;
|
|
16
19
|
/** 光标定位 */
|
|
17
20
|
private handleCaretLocate;
|
|
18
21
|
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { newDoc } from './sdk/createDoc';
|
|
2
2
|
export { useDocPubApiContext } from './sdk/DocPubApiContext';
|
|
3
|
-
export {
|
|
3
|
+
export { usePrint } from './sdk/usePagesToPdf';
|
|
4
4
|
export { useInteraction } from './interaction/useInteraction';
|
|
5
5
|
export { formulaUtils } from './utils/calculate-formula';
|
|
6
|
+
export { TextUtil } from './view/utils/TextUtil';
|
|
6
7
|
export { resolveWidgetState } from './widget/widget-state';
|
|
7
8
|
export { validateTextWidgetMarker } from './layout/logic/LayoutBuilder';
|
|
8
9
|
export { CommandType } from './command/types';
|
|
@@ -11,7 +12,7 @@ export { DocumentEventBridge } from './event/DocumentEventBridge';
|
|
|
11
12
|
export { DocModeTypeConst, PageSizeEnumConst, BuiltinComponentTypeConst } from './constants';
|
|
12
13
|
export { default as CursorOverlay } from './cursor/render/cursor-overlay.vue';
|
|
13
14
|
export { default as HiddenInput } from './cursor/render/hidden-input.vue';
|
|
14
|
-
export type {
|
|
15
|
+
export type { PaperItem } from './sdk/usePagesToPdf';
|
|
15
16
|
export type { DocInitOptions } from './view/Doc';
|
|
16
17
|
export type { WidgetMeta } from './widget/widget-meta';
|
|
17
18
|
export type { DocModeType, CompleteComponentType, BuiltinComponentType } from './constants';
|
|
@@ -22,9 +23,12 @@ export type { TextRun } from './view/runs/TextRun';
|
|
|
22
23
|
export type { ImageRun } from './view/runs/ImageRun';
|
|
23
24
|
export type { ITextWidget } from './view/runs/TextWidget';
|
|
24
25
|
export type { IImageWidget } from './view/runs/ImageWidget';
|
|
26
|
+
export type { TextWidget } from './view/runs/TextWidget';
|
|
27
|
+
export type { WrPageWidget } from './model/document';
|
|
25
28
|
export type { Border, Paragraph } from './view/Paragraph';
|
|
29
|
+
export type { OverlayLayout } from './view/base/OverlayLayout';
|
|
26
30
|
export type { Table } from './view/Table';
|
|
27
31
|
export type { SubRenderer } from './view/TableCell';
|
|
28
32
|
export type { Wtbl } from './model/document';
|
|
29
|
-
export type { BoundedRegion } from './model/logic';
|
|
33
|
+
export type { BoundedRegion, CheckTableRegion, _2DTableRegion } from './model/logic';
|
|
30
34
|
export type { WidgetStateContext } from './widget/widget-state';
|
|
@@ -17,7 +17,7 @@ export declare class InteractionController {
|
|
|
17
17
|
}): void;
|
|
18
18
|
clearTableSelection(): void;
|
|
19
19
|
onChangeDragHoverId(hitId: string): void;
|
|
20
|
-
resolveIntent(id: string | undefined): void;
|
|
20
|
+
resolveIntent(id: string | undefined, hitId: string | undefined): void;
|
|
21
21
|
onActivePanelData(payload: {
|
|
22
22
|
type: PanelType;
|
|
23
23
|
modelId?: string;
|
|
@@ -39,5 +39,12 @@ export declare class InteractionController {
|
|
|
39
39
|
onContextMenu(payload: ContextMenuParams & {
|
|
40
40
|
contextMenuRef: any;
|
|
41
41
|
}): void;
|
|
42
|
+
onChangeHeader2footerBool(visible: boolean): void;
|
|
43
|
+
onSetAnnotation(payload: {
|
|
44
|
+
ids: string[];
|
|
45
|
+
list: any[];
|
|
46
|
+
focus: string | null;
|
|
47
|
+
}): void;
|
|
48
|
+
onFocusAnnotation(payload: string | null): void;
|
|
42
49
|
destroy(): void;
|
|
43
50
|
}
|
|
@@ -11,6 +11,8 @@ export declare class InteractionPolicy {
|
|
|
11
11
|
constructor(doc: Doc);
|
|
12
12
|
/** 是否允许输入 */
|
|
13
13
|
canInput(run?: LayoutNode): boolean;
|
|
14
|
+
/** 是否允许删除 */
|
|
15
|
+
canBackspace(run?: LayoutNode): boolean;
|
|
14
16
|
/** 事件前置拦截 */
|
|
15
17
|
guardEvent(eventName: string, payload: any): boolean;
|
|
16
18
|
/** 全局互斥规则 统一处理变量互斥 */
|
|
@@ -25,5 +25,13 @@ export type InteractionState = {
|
|
|
25
25
|
}>> | null;
|
|
26
26
|
/** 当前 focus 的字段校验批注信息 */
|
|
27
27
|
focusValidation: string | '';
|
|
28
|
+
/** 页眉页脚配置开关 */
|
|
29
|
+
isHeaderFooterEdit: boolean;
|
|
30
|
+
/** 记录变更的字段列表 */
|
|
31
|
+
annotationIds: string[] | null;
|
|
32
|
+
/** 当前点击的记录变更 id */
|
|
33
|
+
focusAnnotationId: string | null;
|
|
34
|
+
/** 记录变更的详情信息列表 */
|
|
35
|
+
annotationList: any[] | null;
|
|
28
36
|
};
|
|
29
37
|
export type InteractionType = keyof InteractionState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
export declare function useInteraction(
|
|
2
|
+
import { Doc } from '../view/Doc';
|
|
3
|
+
export declare function useInteraction(docRef: Ref<Doc | null>): {
|
|
4
4
|
readonly tableSelection?: {
|
|
5
5
|
readonly tableId: string;
|
|
6
6
|
readonly axis: "row" | "col" | "all";
|
|
@@ -12,12 +12,12 @@ export declare function useInteraction(publicDocApi: Ref<EnginePublic | null>):
|
|
|
12
12
|
readonly focusTick?: number | undefined;
|
|
13
13
|
readonly panelData?: {
|
|
14
14
|
readonly panelType: import('../../domain/active/active-types').PanelType;
|
|
15
|
-
readonly widgetId?: string | undefined;
|
|
16
15
|
readonly modelId?: string | undefined;
|
|
17
16
|
readonly context: {
|
|
18
17
|
readonly mainModelKey?: string | undefined;
|
|
19
18
|
readonly subFieldKey?: string | undefined;
|
|
20
19
|
readonly regionId?: string | undefined;
|
|
20
|
+
readonly secRefId?: string | undefined;
|
|
21
21
|
};
|
|
22
22
|
} | null | undefined;
|
|
23
23
|
readonly validationCommentMap?: {
|
|
@@ -28,4 +28,8 @@ export declare function useInteraction(publicDocApi: Ref<EnginePublic | null>):
|
|
|
28
28
|
}[];
|
|
29
29
|
} | null | undefined;
|
|
30
30
|
readonly focusValidation?: string | undefined;
|
|
31
|
+
readonly isHeaderFooterEdit?: boolean | undefined;
|
|
32
|
+
readonly annotationIds?: readonly string[] | null | undefined;
|
|
33
|
+
readonly focusAnnotationId?: string | null | undefined;
|
|
34
|
+
readonly annotationList?: readonly any[] | null | undefined;
|
|
31
35
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Page, PageChild, PageOptions } from '../view/Page';
|
|
2
2
|
import { Paragraph } from '../view/Paragraph';
|
|
3
|
-
import { LayoutNode } from '../view/base';
|
|
3
|
+
import { BandContainer, LayoutNode } from '../view/base';
|
|
4
4
|
import { TableCell } from '../view/TableCell';
|
|
5
5
|
import { Doc } from '../view/Doc';
|
|
6
6
|
import { Section } from '../view/Section';
|
|
7
|
+
import { OverlayLayout } from '../view/base/OverlayLayout';
|
|
7
8
|
interface ContextOptions {
|
|
8
|
-
type: 'page' | 'cell';
|
|
9
|
+
type: 'page' | 'cell' | 'header' | 'footer' | 'overlayLayout';
|
|
9
10
|
doc: Doc;
|
|
10
11
|
section?: Section;
|
|
11
12
|
page?: Page;
|
|
12
13
|
cell?: TableCell;
|
|
13
14
|
paragraph?: PageChild;
|
|
14
15
|
layoutRun?: LayoutNode;
|
|
16
|
+
current?: OverlayLayout;
|
|
17
|
+
onPageCreated?: (page: Page) => void;
|
|
15
18
|
}
|
|
16
19
|
export declare class LayoutContext {
|
|
17
20
|
type: ContextOptions['type'];
|
|
@@ -21,11 +24,14 @@ export declare class LayoutContext {
|
|
|
21
24
|
cell?: TableCell;
|
|
22
25
|
paragraph?: PageChild;
|
|
23
26
|
layoutRun?: LayoutNode;
|
|
27
|
+
current?: OverlayLayout;
|
|
24
28
|
modelRef?: {
|
|
25
29
|
id: string;
|
|
26
30
|
};
|
|
31
|
+
onPageCreated?: (page: Page) => void;
|
|
32
|
+
/** 当前 section 内的页码 */
|
|
27
33
|
constructor(options: ContextOptions);
|
|
28
|
-
get container(): Page | TableCell;
|
|
34
|
+
get container(): Page | TableCell | BandContainer | OverlayLayout;
|
|
29
35
|
updateSection(section: Section): void;
|
|
30
36
|
updatePage(page: Page): void;
|
|
31
37
|
updateParagraph(paragraph: PageChild): void;
|
|
@@ -37,6 +43,10 @@ export declare class LayoutContext {
|
|
|
37
43
|
createNewParagraph(y?: number): Paragraph;
|
|
38
44
|
resetModelRef(id: string): void;
|
|
39
45
|
getRunX(): number;
|
|
46
|
+
/**
|
|
47
|
+
* 获取当前行剩余的空间
|
|
48
|
+
*/
|
|
49
|
+
getParagraphRemainingSize(): number;
|
|
40
50
|
addRun(run: LayoutNode): void;
|
|
41
51
|
/**
|
|
42
52
|
* 根据 dataIndex 替换 path 中的 [n] 为实际值
|
|
@@ -6,6 +6,20 @@ export declare class LayoutManager {
|
|
|
6
6
|
private layoutHandlers;
|
|
7
7
|
constructor(doc: Doc);
|
|
8
8
|
layout(): void;
|
|
9
|
+
/**
|
|
10
|
+
* 当前页创建后,初始化页眉页脚和悬浮层
|
|
11
|
+
*/
|
|
12
|
+
private decorateCurrentPage;
|
|
13
|
+
/**
|
|
14
|
+
* 布局页眉/页脚内部的段落和表格
|
|
15
|
+
*/
|
|
16
|
+
private layoutHeaderFooterChildren;
|
|
17
|
+
/**
|
|
18
|
+
* 所有页布局完成后,在处理悬浮层,主要是要拿到实际总页数
|
|
19
|
+
*/
|
|
20
|
+
private resolveOverlay;
|
|
21
|
+
/** 悬浮层内部的布局和段落 */
|
|
22
|
+
private layoutOverlayChildren;
|
|
9
23
|
/**
|
|
10
24
|
* 统一的表格布局内部方法
|
|
11
25
|
*/
|
|
@@ -14,7 +14,6 @@ export declare class LayoutMapper {
|
|
|
14
14
|
lineCenter: Map<string, LineInfo>;
|
|
15
15
|
lineIdByPage: Map<string, string[]>;
|
|
16
16
|
/** 组件信息中心 */
|
|
17
|
-
widgetMetaIds: Set<string>;
|
|
18
17
|
widgetMetaMap: Map<string, any>;
|
|
19
18
|
modelMap: Map<string, ModelMode>;
|
|
20
19
|
modelSplitMap: Map<string, string[]>;
|
|
@@ -27,7 +26,6 @@ export declare class LayoutMapper {
|
|
|
27
26
|
getAllPageIds(): string[];
|
|
28
27
|
getLineIdsByPageId(pageId: string): string[];
|
|
29
28
|
getLineInfoById(lineId: string): LineInfo | undefined;
|
|
30
|
-
getWidgetMetaIds(): string[];
|
|
31
29
|
getWidgetMetaListById(wId: string): any;
|
|
32
30
|
/**
|
|
33
31
|
* 获取某个节点下的所有子节点
|
|
@@ -2,5 +2,16 @@ 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
|
+
/**
|
|
6
|
+
* 合并部分run
|
|
7
|
+
* @param context
|
|
8
|
+
* @param wr
|
|
9
|
+
*/
|
|
10
|
+
static __layout(context: LayoutContext, wr: WrText): void;
|
|
11
|
+
/**
|
|
12
|
+
* 每个文本独立渲染
|
|
13
|
+
* @param context
|
|
14
|
+
* @param wr
|
|
15
|
+
*/
|
|
5
16
|
static layout(context: LayoutContext, wr: WrText): void;
|
|
6
17
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { WrText } from '../../../model/document';
|
|
2
|
+
import { LayoutContext } from '../../LayoutContext';
|
|
3
|
+
import { TextRun } from '../../../view/runs/TextRun';
|
|
4
|
+
import { TableCell } from '../../../view/TableCell';
|
|
5
|
+
export type HandlerContext = {
|
|
6
|
+
context: LayoutContext;
|
|
7
|
+
wr: WrText;
|
|
8
|
+
};
|
|
9
|
+
export declare abstract class BaseHandler {
|
|
10
|
+
context: LayoutContext;
|
|
11
|
+
wr: WrText;
|
|
12
|
+
constructor(ctx: HandlerContext);
|
|
13
|
+
/**
|
|
14
|
+
* 获取所在单元格
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
getCell(): TableCell | null;
|
|
18
|
+
/**
|
|
19
|
+
* 获取所在子表的数据索引
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
getDataIndex(init?: 0 | null): number | null;
|
|
23
|
+
getId(): string;
|
|
24
|
+
getLayoutStyle(): ReturnType<typeof TextRun.textStyle2LayoutStyle>;
|
|
25
|
+
abstract layout(): void;
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseHandler, HandlerContext } from './BaseHandler';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class ImageHandler extends BaseHandler {
|
|
3
3
|
static layout(ctx: HandlerContext): void;
|
|
4
4
|
static layoutField(ctx: HandlerContext): void;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { BaseHandler, type HandlerContext } from './BaseHandler';
|
|
2
2
|
export { OptionHandler } from './OptionHandler';
|
|
3
|
-
export {
|
|
3
|
+
export { ImageHandler } from './ImageHandler';
|
|
4
4
|
export { SignatureHandler } from './SignatureHandler';
|
|
5
5
|
export { InputHandler } from './InputHandler';
|
|
6
6
|
export { AttachmentHandler } from './AttachmentHandler';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseHandler } from '../base/BaseHandler';
|
|
2
|
+
import { ImageWidgetOptions } from '../../../view/runs/ImageWidget';
|
|
3
|
+
export declare class BarcodeHandler extends BaseHandler {
|
|
4
|
+
getDecorationsInfo(width: number, height: number, label?: string): {
|
|
5
|
+
render: boolean;
|
|
6
|
+
rectWidth: number;
|
|
7
|
+
rectHeight: number;
|
|
8
|
+
decorations?: ImageWidgetOptions['decorations'];
|
|
9
|
+
};
|
|
10
|
+
layout(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { SerialNumberHandler } from './SerialNumberHandler';
|
|
2
|
+
export { DefaultHandler } from './DefaultHandler';
|
|
3
|
+
export { QrCodeHandler } from './QrCodeHandler';
|
|
4
|
+
export { BarcodeHandler } from './BarcodeHandler';
|
|
5
|
+
export { ImageHandler } from './ImageHandler';
|
|
6
|
+
export { DiagonalHandler } from './DiagonalHandler';
|
|
7
|
+
export { PaginationHandler } from './PaginationHandler';
|
|
8
|
+
export { LineHandler } from './LineHandler';
|
|
@@ -6,7 +6,6 @@ export declare function buildLayoutMeta(pages: Page[]): {
|
|
|
6
6
|
dataCenter: Map<string, BaseMetaNode>;
|
|
7
7
|
lineCenter: Map<string, LineInfo>;
|
|
8
8
|
widgetIds: string[];
|
|
9
|
-
widgetMetaIds: Set<string>;
|
|
10
9
|
widgetMetaMap: Map<string, any>;
|
|
11
10
|
};
|
|
12
11
|
/** 是否是原子组件 */
|
|
@@ -14,15 +13,20 @@ export declare function isAtom(component: BuiltinComponentType): boolean;
|
|
|
14
13
|
/** 判断是否为占位符文本原子节点 */
|
|
15
14
|
export declare function isPlaceholderNode(node: any): boolean;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
16
|
+
* 判断是否点击是字段组件节点
|
|
18
17
|
* @param node - 节点
|
|
19
18
|
* @param checkMarker - 是否需要校验 widgetFieldLeftMarker / RightMarker,默认 true
|
|
20
19
|
*/
|
|
21
20
|
export declare function isClickSelectAllNode(node: BaseMetaNode, checkMarker?: boolean): boolean;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* 校验组件是否符合选中规则
|
|
24
23
|
* @param raw - 文本组件原始数据
|
|
25
24
|
* @param checkMarker - 是否校验左右标记位
|
|
26
25
|
* @returns 符合规则返回 true,否则返回 false
|
|
27
26
|
*/
|
|
28
27
|
export declare function validateTextWidgetMarker(raw: TextWidget, checkMarker: boolean): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 判断是否点击是页面组件节点
|
|
30
|
+
* @param node - 节点
|
|
31
|
+
*/
|
|
32
|
+
export declare function isClickPaperWidgetAllNode(node: BaseMetaNode): boolean;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Doc } from '../../view/Doc';
|
|
2
|
+
export declare function generateDocModelMap(doc: Doc): Map<string, any>;
|
|
@@ -2,8 +2,8 @@ import { Wtbl, Wtc, Wtr } from '../../model/document';
|
|
|
2
2
|
import { TableExpander, CellFragment } from '../../utils/expand';
|
|
3
3
|
import { SubRenderer } from '../../view/TableCell';
|
|
4
4
|
export declare class TableInfoProvider {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
wtbl: Wtbl;
|
|
6
|
+
tableExpander: TableExpander;
|
|
7
7
|
constructor(wtbl: Wtbl, tableExpander: TableExpander);
|
|
8
8
|
getRows(): {
|
|
9
9
|
id: string;
|
|
@@ -20,4 +20,10 @@ export declare class TableInfoProvider {
|
|
|
20
20
|
id: string;
|
|
21
21
|
};
|
|
22
22
|
getCellSubRenderer(cell: CellFragment): SubRenderer | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* 获取当前行是都能分割
|
|
25
|
+
* @param rowIndex
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
getAllowRowSplit(rowIndex: number): boolean;
|
|
23
29
|
}
|
|
@@ -4,6 +4,7 @@ import { TextRun } from '../../view/runs/TextRun';
|
|
|
4
4
|
export type LineType = 'paragraph' | 'tablerow' | undefined;
|
|
5
5
|
export interface BuildCtx {
|
|
6
6
|
currentPageId: string;
|
|
7
|
+
area: 'body' | 'header' | 'footer' | 'overlay';
|
|
7
8
|
lineId?: string;
|
|
8
9
|
lineIndex: number;
|
|
9
10
|
lineType?: LineType;
|
|
@@ -24,6 +25,8 @@ export interface LineInfo {
|
|
|
24
25
|
type: 'tablerow' | 'paragraph';
|
|
25
26
|
/** 纸张 id */
|
|
26
27
|
pageId: string;
|
|
28
|
+
/** 所属区域 */
|
|
29
|
+
pageArea: 'body' | 'header' | 'footer' | 'overlay';
|
|
27
30
|
/** 排序 */
|
|
28
31
|
sort: number;
|
|
29
32
|
nextIds: string[];
|
|
@@ -56,8 +59,12 @@ export interface BaseMetaNode {
|
|
|
56
59
|
component: BuiltinComponentType;
|
|
57
60
|
/** 组件节点信息 */
|
|
58
61
|
raw?: LayoutNode;
|
|
62
|
+
/** 章节引用 id */
|
|
63
|
+
secRefId: string;
|
|
59
64
|
/** 纸张 id */
|
|
60
65
|
pageId: string;
|
|
66
|
+
/** 所属区域 */
|
|
67
|
+
pageArea: 'body' | 'header' | 'footer' | 'overlay';
|
|
61
68
|
/** 上级节点 id */
|
|
62
69
|
preId: string;
|
|
63
70
|
/** 宽度 */
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Wdocument } from './document';
|
|
2
2
|
import { Wstyles } from './styles';
|
|
3
3
|
import { Wimages } from './images';
|
|
4
|
+
import { Wsettings } from './settings/Wsettings';
|
|
5
|
+
import { Wheaders } from './headers/Wheaders';
|
|
6
|
+
import { Wfooters } from './footers/Wfooters';
|
|
7
|
+
import { Woverlays } from './overlays/Woverlays';
|
|
4
8
|
import { Wr } from './document/Wp';
|
|
9
|
+
import { Section } from '../view/Section';
|
|
5
10
|
/**
|
|
6
11
|
* Word 文档模型
|
|
7
12
|
* 包含文档的所有组件(document、styles、images 等)
|
|
@@ -15,13 +20,21 @@ import { Wr } from './document/Wp';
|
|
|
15
20
|
*/
|
|
16
21
|
export interface DocModelOptions {
|
|
17
22
|
document: Wdocument;
|
|
23
|
+
headers: Wheaders;
|
|
24
|
+
footers: Wfooters;
|
|
18
25
|
styles: Wstyles;
|
|
19
26
|
images: Wimages;
|
|
27
|
+
settings: Wsettings;
|
|
28
|
+
overlays: Woverlays;
|
|
20
29
|
}
|
|
21
30
|
export declare class DocModel {
|
|
22
31
|
document: Wdocument;
|
|
32
|
+
headers: Wheaders;
|
|
33
|
+
footers: Wfooters;
|
|
23
34
|
styles: Wstyles;
|
|
24
35
|
images: Wimages;
|
|
36
|
+
settings: Wsettings;
|
|
37
|
+
overlays: Woverlays;
|
|
25
38
|
constructor(options: DocModelOptions);
|
|
26
39
|
/**
|
|
27
40
|
* 从原始 DOCX JSON 转换为 DocModel 实例
|
|
@@ -40,4 +53,11 @@ export declare class DocModel {
|
|
|
40
53
|
* @returns Wr 实例数组(包含 widgetMeta 和 valuePath 的文本或图片 run)
|
|
41
54
|
*/
|
|
42
55
|
getWidgetInstances(): Wr[];
|
|
56
|
+
/** 根据 pageIndex 获取页眉实例 */
|
|
57
|
+
getHeader(pageIndex: number, section: Section): import('./headers/Wheader').Wheader | null;
|
|
58
|
+
/** 根据 pageIndex 获取页脚实例 */
|
|
59
|
+
getFooter(pageIndex: number, section: Section): import('./footers/Wfooter').Wfooter | null;
|
|
60
|
+
/** 获取章节对应的浮层实例 */
|
|
61
|
+
getOverlay(section: Section): import('./overlays/Woverlay').Woverlay | null;
|
|
62
|
+
private collectSecPrs;
|
|
43
63
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DocModel } from '../DocModel';
|
|
2
|
+
import { WsecPr, Wtbl, Wp } from '../document';
|
|
2
3
|
export interface ModelNodeOptions {
|
|
3
4
|
id?: string;
|
|
4
5
|
attrs?: Record<string, any>;
|
|
@@ -41,11 +42,14 @@ export declare abstract class ModelNode {
|
|
|
41
42
|
static fromXmlJson(json: any): any;
|
|
42
43
|
remove(): void;
|
|
43
44
|
getCurrentIndex(): number;
|
|
45
|
+
getTopBlock<T extends Wp | Wtbl>(): T;
|
|
46
|
+
getSection<T extends WsecPr | null>(): T;
|
|
44
47
|
/**
|
|
45
48
|
* 获取根节点(顶层 DocModel 对象)
|
|
46
49
|
* @returns DocModel 根节点,如果找不到则返回 null
|
|
47
50
|
*/
|
|
48
51
|
getRoot(): DocModel | null;
|
|
52
|
+
getWlayout(): this | null;
|
|
49
53
|
/**
|
|
50
54
|
* 获取前一个兄弟节点
|
|
51
55
|
* @returns 前一个兄弟节点,如果没有则返回 null
|