@hailin-zheng/editor-core 2.2.6 → 2.2.8

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.
@@ -34,7 +34,6 @@ export declare class DocEditor {
34
34
  result: boolean;
35
35
  ss: SelectionState;
36
36
  }>;
37
- contentChanged: Subject<void>;
38
37
  onPatchVNodeSubject: Subject<void>;
39
38
  selectionState: SelectionState;
40
39
  onDblClickEvent: Subject<Event>;
@@ -479,6 +478,7 @@ export declare class DocEditor {
479
478
  */
480
479
  private renderSuggestions;
481
480
  insertSuggestion(suggestion: ISuggestionData): void;
481
+ parser(code: string, returnProcess?: boolean): string;
482
482
  }
483
483
  export interface IReaderManager {
484
484
  }
@@ -2,6 +2,7 @@ import { ElementEvent, EventTypes } from "./element-event-define";
2
2
  import { RenderContextType } from "./render-context";
3
3
  import { CursorType, LeafRenderObject, RenderObject } from "./render-define";
4
4
  import { Subject, Subscription } from "./infrastructure/event-subject";
5
+ import { DynamicExecute } from "./code-interpreter/dynamic-execute";
5
6
  export declare class Rect {
6
7
  x: number;
7
8
  y: number;
@@ -73,7 +74,7 @@ export declare abstract class Element<P extends object = any> {
73
74
  disableClick: boolean;
74
75
  disposed: boolean;
75
76
  loaded: boolean;
76
- visibleExpr?: IVisibleExpression;
77
+ visibleExpr?: IParserExpress;
77
78
  attribute?: ElementAttribute;
78
79
  private _parent;
79
80
  get parent(): BranchElement;
@@ -251,12 +252,16 @@ export declare class ViewOptions {
251
252
  defaultColor: string;
252
253
  currentFontSize: number;
253
254
  currentFontName: string;
254
- selectionOverlaysColor: string;
255
- dataEleOverlaysColor: string;
255
+ selectionColor: string;
256
+ dataDecoratorNormalColor: string;
257
+ dataDecoratorMouseEnterColor: string;
258
+ dataDecoratorFocusedColor: string;
259
+ dataEleEmptyBgColor: string;
260
+ dataEleMouseEnterBgColor: string;
261
+ dataEleReadOnlyBgColor: string;
256
262
  dataEleFocusedBgColor: string;
263
+ dataEleNormalBgColor: string;
257
264
  dataEleErrorBgColor: string;
258
- dataEleReadOnlyOverlayColor: string;
259
- dataEleOutlineColor: string;
260
265
  viewBackcolor: string;
261
266
  paraSymbolColor: string;
262
267
  dataGroupColor: string;
@@ -267,7 +272,6 @@ export declare class ViewOptions {
267
272
  showLineRect: boolean;
268
273
  showCharRect: boolean;
269
274
  dataEleDecoratorMode: 'none' | 'outline' | 'overlay';
270
- dataEleDecoratorColor: string;
271
275
  showTabChar: boolean;
272
276
  showSpaceChar: boolean;
273
277
  showLineBreak: boolean;
@@ -381,13 +385,15 @@ declare type IVoidFn = () => void;
381
385
  export declare function onceTask(fn: IVoidFn): IVoidFn;
382
386
  export interface IBeginMeasureData {
383
387
  doc: BranchElement;
384
- viewOptions: ViewOptions;
385
- execute: object;
388
+ options: ViewOptions;
389
+ execute: DynamicExecute;
390
+ renderCtx: RenderContextType;
386
391
  createParaFn: () => Element;
387
392
  }
388
393
  export interface ICreateRenderData {
389
394
  options: ViewOptions;
390
395
  renderCtx: RenderContextType;
396
+ execute: DynamicExecute;
391
397
  }
392
398
  export interface FontBoundingBox {
393
399
  fontBoundingBoxAscent: number;
@@ -402,7 +408,7 @@ export interface RefCtxValue {
402
408
  * 需要实现一个可见性表达式的类型,控制目标元素的可见性(sourceElement),targetElement为影响元素,影响元素可能为多个
403
409
  * 例如:sourceElement.visible= targetElement1.value==="1" && targetElement2.value===2等
404
410
  */
405
- export interface IVisibleExpression {
411
+ export interface IParserExpress {
406
412
  compliedCode: string;
407
413
  func: Function;
408
414
  depItems: Map<string, RefCtxValue>;
@@ -196,6 +196,10 @@ export interface DataEleListOption {
196
196
  export declare class DataEleListProps extends DataEleBaseTextProps {
197
197
  constructor();
198
198
  options: Array<DataEleListOption>;
199
+ /**
200
+ * 是否保存选项到病历文件里面
201
+ */
202
+ saveOptions: boolean;
199
203
  dropDownStyle: 'DropDownList' | 'DropDown';
200
204
  /**
201
205
  * 是否允许多选
@@ -312,12 +316,9 @@ export declare class ValidateProps {
312
316
  msg: string;
313
317
  clone(dest: ValidateProps | null): ValidateProps;
314
318
  }
315
- export declare class DataElementGroupProps extends INotifyPropertyChanged {
316
- id: string;
317
- name: string;
318
- hidden: boolean;
319
+ export declare class DataElementGroupProps extends DataEleBaseProps {
319
320
  clone(dest: DataElementGroupProps | null): void;
320
- getSerializeProps(): NullableType<DataElementGroupProps>;
321
+ getSerializeProps(options: ViewOptions): NullableType<DataEleBaseProps>;
321
322
  }
322
323
  export declare class DataElementBarcodeProps {
323
324
  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,8 +1,9 @@
1
- import { Element, ElementFactory, IBeginMeasureData, InlineGroupElement, LeafElement } from "../../element-define";
1
+ import { Element, ElementFactory, IBeginMeasureData, ICreateRenderData, InlineGroupElement, LeafElement } from "../../element-define";
2
2
  import { IEditorVNodeOptions, InlineGroupRenderObject, RenderObject } from "../../render-define";
3
3
  import { GotCursorEvent } from "../../element-event-define";
4
4
  import { DataEleBaseProps, TextProps } from "../../element-props";
5
5
  import { DataDecorateElement } from "./data-decorate-impl";
6
+ import { DynamicExecute } from "../../code-interpreter/dynamic-execute";
6
7
  /**
7
8
  * 所有的数据元继承上述两个抽象类
8
9
  */
@@ -54,6 +55,21 @@ export declare abstract class DataElementInlineGroup<P extends DataEleBaseProps
54
55
  validate(): string;
55
56
  private expressFn;
56
57
  beginMeasure(data: IBeginMeasureData): void;
58
+ private parserExpress;
59
+ /**
60
+ * 解析可见性表达式
61
+ * @param ele
62
+ * @param execute
63
+ * @private
64
+ */
65
+ parseEleExpression(data: ICreateRenderData): void;
66
+ /**
67
+ * 元素可见行求值
68
+ * @param ele
69
+ * @param executeCtx
70
+ * @private
71
+ */
72
+ evalEleExpr(executeCtx: DynamicExecute): void;
57
73
  /**
58
74
  * 数据元发生更改后,进行数据验证
59
75
  */
@@ -1,10 +1,10 @@
1
- import { Element, SerializeProps, ViewOptions } from "../../element-define";
1
+ import { Element, ICreateRenderData, SerializeProps, ViewOptions } from "../../element-define";
2
2
  import { DataEleBaseTextProps } from "../../element-props";
3
3
  import { RenderObject } from "../../render-define";
4
4
  import { DataElementBaseFactory, DataElementInlineGroup, DataElementRenderObject } from "./data-element-base-impl";
5
5
  export declare class DataElementText extends DataElementInlineGroup<DataEleBaseTextProps> {
6
6
  constructor();
7
- createRenderObject(): RenderObject;
7
+ createRenderObject(data: ICreateRenderData): RenderObject;
8
8
  serialize(viewOptions: ViewOptions): SerializeProps & any;
9
9
  clone(data: boolean): DataElementText;
10
10
  setValue(val: any): void;
@@ -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
@@ -21,6 +21,7 @@ export declare class EditorCalendarVNode {
21
21
  private renderDropContainer;
22
22
  private resizePosition;
23
23
  renderDay(): EditorVNodeObject | null;
24
+ onSave(): void;
24
25
  navigateToToday(): void;
25
26
  onClickDayYearPart(): void;
26
27
  onClickDayItem(day: string): void;
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.6",
7
+ "version": "2.2.8",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "moment": "^2.29.3",