@hailin-zheng/editor-core 2.2.6 → 2.2.7

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;
@@ -381,13 +382,15 @@ declare type IVoidFn = () => void;
381
382
  export declare function onceTask(fn: IVoidFn): IVoidFn;
382
383
  export interface IBeginMeasureData {
383
384
  doc: BranchElement;
384
- viewOptions: ViewOptions;
385
- execute: object;
385
+ options: ViewOptions;
386
+ execute: DynamicExecute;
387
+ renderCtx: RenderContextType;
386
388
  createParaFn: () => Element;
387
389
  }
388
390
  export interface ICreateRenderData {
389
391
  options: ViewOptions;
390
392
  renderCtx: RenderContextType;
393
+ execute: DynamicExecute;
391
394
  }
392
395
  export interface FontBoundingBox {
393
396
  fontBoundingBoxAscent: number;
@@ -402,7 +405,7 @@ export interface RefCtxValue {
402
405
  * 需要实现一个可见性表达式的类型,控制目标元素的可见性(sourceElement),targetElement为影响元素,影响元素可能为多个
403
406
  * 例如:sourceElement.visible= targetElement1.value==="1" && targetElement2.value===2等
404
407
  */
405
- export interface IVisibleExpression {
408
+ export interface IParserExpress {
406
409
  compliedCode: string;
407
410
  func: Function;
408
411
  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';
@@ -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;
@@ -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.7",
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
+ }