@hailin-zheng/editor-core 2.2.7 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,7 +57,9 @@ export declare class DocumentContext {
57
57
  private ss;
58
58
  constructor(ctx: BranchElement, ss: SelectionState);
59
59
  getControlIDList(): Array<string>;
60
- getControlInstanceList(): Array<DataElementInlineGroup | DataElementLeaf>;
60
+ getControlInstanceList(options?: {
61
+ includeChildren: boolean;
62
+ }): Array<DataElementInlineGroup | DataElementLeaf>;
61
63
  getControlById(id: string): DataElementInlineGroup | DataElementLeaf;
62
64
  getControlByName(name: string): DataElementInlineGroup | DataElementLeaf;
63
65
  /**
@@ -68,7 +70,9 @@ export declare class DocumentContext {
68
70
  * 获取数据元结构以及get\set闭包调用函数
69
71
  * @returns
70
72
  */
71
- getDataElementModelList(): Array<DataCheckEleModel | DataInputEleModel | DataLeafEleModel>;
73
+ getDataElementModelList(options?: {
74
+ includeChildren: boolean;
75
+ }): Array<DataCheckEleModel | DataInputEleModel | DataLeafEleModel>;
72
76
  /**
73
77
  * 获取复选框数据元结构列表
74
78
  * @param dataCheckList
@@ -137,7 +137,9 @@ export declare abstract class BranchElement<P extends object = any> extends Elem
137
137
  getChildIndex(child: Element): number;
138
138
  getChildLength(): number;
139
139
  getSelfLength(pure: boolean): number;
140
- treeFilter(predicate: (item: Element) => boolean): Array<Element>;
140
+ treeFilter(predicate: (item: Element) => boolean, options?: {
141
+ includeChildren: boolean;
142
+ }): Array<Element>;
141
143
  treeFind(predicate: (item: Element) => boolean): Element | null;
142
144
  pubOnChange(selfChange: pubChangeType): void;
143
145
  }
@@ -252,12 +254,16 @@ export declare class ViewOptions {
252
254
  defaultColor: string;
253
255
  currentFontSize: number;
254
256
  currentFontName: string;
255
- selectionOverlaysColor: string;
256
- dataEleOverlaysColor: string;
257
+ selectionColor: string;
258
+ dataDecoratorNormalColor: string;
259
+ dataDecoratorMouseEnterColor: string;
260
+ dataDecoratorFocusedColor: string;
261
+ dataEleEmptyBgColor: string;
262
+ dataEleMouseEnterBgColor: string;
263
+ dataEleReadOnlyBgColor: string;
257
264
  dataEleFocusedBgColor: string;
265
+ dataEleNormalBgColor: string;
258
266
  dataEleErrorBgColor: string;
259
- dataEleReadOnlyOverlayColor: string;
260
- dataEleOutlineColor: string;
261
267
  viewBackcolor: string;
262
268
  paraSymbolColor: string;
263
269
  dataGroupColor: string;
@@ -268,7 +274,6 @@ export declare class ViewOptions {
268
274
  showLineRect: boolean;
269
275
  showCharRect: boolean;
270
276
  dataEleDecoratorMode: 'none' | 'outline' | 'overlay';
271
- dataEleDecoratorColor: string;
272
277
  showTabChar: boolean;
273
278
  showSpaceChar: boolean;
274
279
  showLineBreak: boolean;
@@ -316,9 +316,7 @@ export declare class ValidateProps {
316
316
  msg: string;
317
317
  clone(dest: ValidateProps | null): ValidateProps;
318
318
  }
319
- export declare class DataElementGroupProps extends DataEleBaseProps {
320
- clone(dest: DataElementGroupProps | null): void;
321
- getSerializeProps(options: ViewOptions): NullableType<DataEleBaseProps>;
319
+ export declare class DataElementGroupProps extends DataEleBaseTextProps {
322
320
  }
323
321
  export declare class DataElementBarcodeProps {
324
322
  type: 'ena13' | 'code128' | 'code39' | 'qrcode';
@@ -10,7 +10,7 @@ export declare class ElementSerialize {
10
10
  static serializeString(element: Element, options?: {
11
11
  all: boolean;
12
12
  }): string;
13
- static serializeAttribute(element: Element): any;
13
+ static serializeObject(obj: object | undefined | null): any;
14
14
  /**
15
15
  * 获取选中的结构
16
16
  * @param ss
@@ -1,5 +1,6 @@
1
- import { BlockContainerElement, Element, ElementFactory, IBeginMeasureData, readElementProps, SerializeProps } from "../../element-define";
2
- import { IEditorVNodeOptions, MuiltBlockLineRenderObject, RenderObject } from "../../render-define";
1
+ import { BlockContainerElement, Element, ElementFactory, IBeginMeasureData, NullableType, readElementProps, SerializeProps, ViewOptions } from "../../element-define";
2
+ import { DataEleBaseProps } from "../../element-props";
3
+ import { IEditorVNodeOptions, MultiBlockLineRenderObject, RenderObject } from "../../render-define";
3
4
  /**
4
5
  * 数据块容器,包裹多个段落
5
6
  */
@@ -7,10 +8,10 @@ export declare class DataContainerElement extends BlockContainerElement<DataCont
7
8
  constructor();
8
9
  createRenderObject(): DataContainerRenderObject;
9
10
  beginMeasure(data: IBeginMeasureData): void;
10
- serialize(): SerializeProps;
11
+ serialize(viewOptions: ViewOptions): SerializeProps | null;
11
12
  clone(data: boolean): DataContainerElement;
12
13
  }
13
- export declare class DataContainerRenderObject extends MuiltBlockLineRenderObject<DataContainerElement> {
14
+ export declare class DataContainerRenderObject extends MultiBlockLineRenderObject<DataContainerElement> {
14
15
  clone(cloneData?: boolean): RenderObject;
15
16
  exportSVG(event: IEditorVNodeOptions): any;
16
17
  }
@@ -18,8 +19,7 @@ export declare class DataContainerFactory extends ElementFactory<DataContainerPr
18
19
  match(type: string): boolean;
19
20
  createElement(data: readElementProps<DataContainerProps>): Element<any>;
20
21
  }
21
- export declare class DataContainerProps {
22
- caption: string;
23
- id: string;
24
- name: string;
22
+ export declare class DataContainerProps extends DataEleBaseProps {
23
+ clone(dest: DataContainerProps | null): void;
24
+ getSerializeProps(options: ViewOptions): NullableType<DataEleBaseProps>;
25
25
  }
@@ -1,9 +1,11 @@
1
- import { DataElementBaseFactory, InlineGroupInputElement } from "./data-element-base-impl";
1
+ import { DataElementBaseFactory, DataElementInlineGroup } from "./data-element-base-impl";
2
2
  import { InlineGroupRenderObject, RenderObject } from "../../render-define";
3
3
  import { SerializeProps, ViewOptions, Element } from "../../element-define";
4
4
  import { DataElementGroupProps } from "../../element-props";
5
- export declare class DataElementGroupElement extends InlineGroupInputElement<DataElementGroupProps> {
5
+ export declare class DataElementGroupElement extends DataElementInlineGroup<DataElementGroupProps> {
6
6
  constructor();
7
+ setValue(val: any): void;
8
+ getValue(): string;
7
9
  clone(data: boolean): Element;
8
10
  createRenderObject(): RenderObject | null;
9
11
  serialize(viewOptions: ViewOptions): SerializeProps | null;
@@ -14,4 +16,5 @@ export declare class DataElementGroupRenderObject extends InlineGroupRenderObjec
14
16
  export declare class DataElementGroupFactory extends DataElementBaseFactory<DataElementGroupProps> {
15
17
  match(type: string): boolean;
16
18
  createElement(data: any): Element;
19
+ createDataEleProps(dest: DataElementGroupProps, props: DataElementGroupProps): DataElementGroupProps;
17
20
  }
@@ -1,6 +1,6 @@
1
1
  import { BlockContainerElement, Element, ElementFactory, IBeginMeasureData, SerializeProps } from "../../element-define";
2
2
  import { MouseElementEvent } from "../../element-event-define";
3
- import { IEditorVNodeOptions, MuiltBlockLineRenderObject, RenderObject } from "../../render-define";
3
+ import { IEditorVNodeOptions, MultiBlockLineRenderObject, RenderObject } from "../../render-define";
4
4
  export declare class DocumentBodyElement extends BlockContainerElement {
5
5
  constructor();
6
6
  createRenderObject(): DocumentBodyRenderObject;
@@ -9,7 +9,7 @@ export declare class DocumentBodyElement extends BlockContainerElement {
9
9
  clone(data: boolean): DocumentBodyElement;
10
10
  beginMeasure(data: IBeginMeasureData): void;
11
11
  }
12
- export declare class DocumentBodyRenderObject extends MuiltBlockLineRenderObject {
12
+ export declare class DocumentBodyRenderObject extends MultiBlockLineRenderObject {
13
13
  clone(cloneData?: boolean): RenderObject;
14
14
  exportSVG(event: IEditorVNodeOptions): any;
15
15
  }
@@ -1,5 +1,5 @@
1
1
  import { BlockContainerElement, SerializeProps, Element, readElementProps, ElementFactory } from "../../element-define";
2
- import { IEditorVNodeOptions, MuiltBlockLineRenderObject, RenderObject } from "../../render-define";
2
+ import { IEditorVNodeOptions, MultiBlockLineRenderObject, RenderObject } from "../../render-define";
3
3
  import { BodyPartProps } from "../../element-props";
4
4
  /**
5
5
  * 用于合并病程录,每个part包含每份病程录body
@@ -12,7 +12,7 @@ export declare class DocumentBodyPartElement extends BlockContainerElement<BodyP
12
12
  serialize(): SerializeProps;
13
13
  clone(data: boolean): DocumentBodyPartElement;
14
14
  }
15
- export declare class DocumentBodyPartRenderObject extends MuiltBlockLineRenderObject {
15
+ export declare class DocumentBodyPartRenderObject extends MultiBlockLineRenderObject {
16
16
  clone(cloneData?: boolean): RenderObject;
17
17
  exportSVG(event: IEditorVNodeOptions): any;
18
18
  }
@@ -1,7 +1,7 @@
1
1
  import { BlockContentElement, Element, ElementFactory, readElementProps, SerializeProps, ViewOptions } from "../../element-define";
2
2
  import { ParagraphProps } from "../../element-props";
3
3
  import { RenderContextType } from "../../render-context";
4
- import { BlockLineRectRenderObject, IEditorVNodeOptions, IRenderData, MuiltBlockLineRenderObject, RenderObject } from "../../render-define";
4
+ import { BlockLineRectRenderObject, IEditorVNodeOptions, IRenderData, MultiBlockLineRenderObject, RenderObject } from "../../render-define";
5
5
  export declare class ParagraphElement extends BlockContentElement<ParagraphProps> {
6
6
  constructor();
7
7
  /**
@@ -15,7 +15,7 @@ export declare class ParagraphElement extends BlockContentElement<ParagraphProps
15
15
  clone(data: boolean): Element;
16
16
  static createElement(): ParagraphElement;
17
17
  }
18
- export declare class ParagraphRenderObject extends MuiltBlockLineRenderObject<ParagraphElement> {
18
+ export declare class ParagraphRenderObject extends MultiBlockLineRenderObject<ParagraphElement> {
19
19
  /**
20
20
  * 绘制项目符号
21
21
  */
@@ -1,6 +1,6 @@
1
1
  import { BlockContainerElement, Element, ElementFactory, IBeginMeasureData, ICreateRenderData, SerializeProps, ViewOptions } from "../../element-define";
2
2
  import { TableProps } from "../../element-props";
3
- import { IEditorVNodeOptions, MuiltBlockLineRenderObject, RenderObject } from "../../render-define";
3
+ import { IEditorVNodeOptions, MultiBlockLineRenderObject, RenderObject } from "../../render-define";
4
4
  export declare class TableElement extends BlockContainerElement<TableProps> {
5
5
  private _actualColsProps;
6
6
  constructor();
@@ -28,7 +28,7 @@ export declare class TableElement extends BlockContainerElement<TableProps> {
28
28
  beginMeasure(data: IBeginMeasureData): void;
29
29
  serialize(options: ViewOptions): SerializeProps;
30
30
  }
31
- export declare class TableRenderObject extends MuiltBlockLineRenderObject<TableElement> {
31
+ export declare class TableRenderObject extends MultiBlockLineRenderObject<TableElement> {
32
32
  setRenderWidth(maxWidth: number): void;
33
33
  private exportTableBorder;
34
34
  clone(): RenderObject;
@@ -1,6 +1,6 @@
1
1
  import { BlockContainerElement, Element, ElementFactory, IBeginMeasureData, readElementProps, SerializeProps, ViewOptions } from "../../element-define";
2
2
  import { TableRowProps } from "../../element-props";
3
- import { MuiltBlockLineRenderObject, RenderObject } from "../../render-define";
3
+ import { MultiBlockLineRenderObject, RenderObject } from "../../render-define";
4
4
  export declare const RowMinHeight = 20;
5
5
  export declare class TableRowElement extends BlockContainerElement<TableRowProps> {
6
6
  constructor();
@@ -15,7 +15,7 @@ export declare class TableRowElement extends BlockContainerElement<TableRowProps
15
15
  clone(data: boolean): Element;
16
16
  static createRow(cols: number): TableRowElement;
17
17
  }
18
- export declare class TableRowRenderObject extends MuiltBlockLineRenderObject<TableRowElement> {
18
+ export declare class TableRowRenderObject extends MultiBlockLineRenderObject<TableRowElement> {
19
19
  remeasureState: boolean;
20
20
  hasMergeCells: boolean | undefined;
21
21
  minHeight: number;
@@ -1,4 +1,4 @@
1
- import { Rect, Element, MarginProps, PaddingProps, Position, ViewOptions } from './element-define';
1
+ import { Rect, Element, MarginProps, PaddingProps, Position, ViewOptions, BranchElement } from './element-define';
2
2
  import { RenderContext, RenderContextType } from './render-context';
3
3
  import { EditorContext } from "./document-context";
4
4
  /**
@@ -69,8 +69,7 @@ export interface IRenderData {
69
69
  export declare abstract class BlockContentRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
70
70
  setRenderWidth(maxWidth: number): void;
71
71
  }
72
- export declare abstract class InlineGroupRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
73
- paintPos: Position;
72
+ export declare abstract class InlineGroupRenderObject<T extends BranchElement = BranchElement> extends BranchRenderObject<T> {
74
73
  }
75
74
  /**
76
75
  * 包含块级渲染元素的容器元素,例如body、table-cell等
@@ -81,18 +80,18 @@ export declare abstract class BlockContainerRenderObject<T extends Element = Ele
81
80
  /**
82
81
  * 多级 ‘BlockLineRectRenderObject’ 包裹元素,例如 p、table
83
82
  */
84
- export declare abstract class MuiltBlockLineRenderObject<T extends Element = Element> extends BlockContentRenderObject<T> {
83
+ export declare abstract class MultiBlockLineRenderObject<T extends Element = Element> extends BlockContentRenderObject<T> {
85
84
  }
86
85
  /**
87
86
  * 容器-子内容为多个行内块级元素,例如table-row
88
87
  */
89
- export declare abstract class InlineBlockContainer extends MuiltBlockLineRenderObject {
88
+ export declare abstract class InlineBlockContainer extends MultiBlockLineRenderObject {
90
89
  }
91
90
  /**
92
91
  * 服务于table-cell
93
92
  * 可被多级拆分的元素
94
93
  */
95
- export declare abstract class InlineMuiltBlockLineRenderObject<T extends Element = Element> extends MuiltBlockLineRenderObject<T> {
94
+ export declare abstract class InlineMuiltBlockLineRenderObject<T extends Element = Element> extends MultiBlockLineRenderObject<T> {
96
95
  }
97
96
  /**
98
97
  * 最小不可分割单位的块级行框,例如 p-line
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "hailin-zheng",
5
5
  "private": false,
6
6
  "license": "ISC",
7
- "version": "2.2.7",
7
+ "version": "2.2.9",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "moment": "^2.29.3",
@@ -16,4 +16,4 @@
16
16
  "snabbdom-to-html": "^7.1.0",
17
17
  "jsbarcode": "^3.11.5"
18
18
  }
19
- }
19
+ }