@hailin-zheng/editor-core 2.1.0 → 2.1.2

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.
@@ -414,6 +414,7 @@ export declare class DocEditor {
414
414
  * @private
415
415
  */
416
416
  private renderDataListVNode;
417
+ private resizePosition;
417
418
  private renderCalendar;
418
419
  private renderContextmenu;
419
420
  /**
@@ -64,5 +64,6 @@ export declare class CommonUtil {
64
64
  static toArray<T>(item: Array<T> | T): Array<T>;
65
65
  static removeChild(ele: HTMLElement): void;
66
66
  static findParent(curr: HTMLElement | null, predicate: (parent: HTMLElement) => boolean): HTMLElement | null;
67
+ static isIntersect(rect1: Rect, rect2: Rect): boolean;
67
68
  }
68
69
  export {};
@@ -147,6 +147,14 @@ export declare class DocumentChange {
147
147
  * @returns
148
148
  */
149
149
  private removeElement;
150
+ /**
151
+ * 处理在表单模式下光标定位的问题
152
+ * @param target
153
+ * @param targetOffset
154
+ * @param deleteTarget
155
+ * @private
156
+ */
157
+ private setSelectionStateByDeleteEvent;
150
158
  /**
151
159
  * 回车事件
152
160
  */
@@ -12,6 +12,12 @@ export declare class DocumentSvg {
12
12
  constructor(viewOptions: ViewOptions, selectedSets: Map<Element, SelectionContentRange>, renderCtx: RenderContext);
13
13
  getVNode(render: RenderObject, selectionRects: Array<Rect>, parentPos: Position): EditorVNodeObject | Array<EditorVNodeObject> | null | string;
14
14
  getHTMLVNode(docRenders: Array<DocumentRenderObject>): Array<EditorVNodeObject>;
15
+ /**
16
+ * 判断当前元素是否在视窗内
17
+ * @param rect
18
+ * @private
19
+ */
20
+ private checkInViewBox;
15
21
  getPageSvgVNode(item: DocumentRenderObject): EditorVNodeObject;
16
22
  private counterMap;
17
23
  getCounter(key: string): number;
@@ -1,11 +1,12 @@
1
1
  import { EditorVNodeObject } from "./render-define";
2
2
  import { Subject } from "./event-subject";
3
3
  import { ISignal } from "../editor-core";
4
- import { Rect } from "./element-define";
4
+ import { Rect, ViewOptions } from "./element-define";
5
5
  /**
6
6
  * 渲染日历虚拟节点处理类
7
7
  */
8
8
  export declare class EditorCalendarVNode {
9
+ viewOptions: ViewOptions;
9
10
  currYear: ISignal<number>;
10
11
  currMonth: ISignal<number>;
11
12
  currCalendarMode: ISignal<'year' | 'month' | 'day'>;
@@ -14,10 +15,11 @@ export declare class EditorCalendarVNode {
14
15
  onSetValue: Subject<string | Date>;
15
16
  currTime: ISignal<string | null>;
16
17
  selectedTime: ISignal<string | null>;
17
- constructor();
18
+ constructor(viewOptions: ViewOptions);
18
19
  reset(): void;
19
20
  render(position: Omit<Rect, 'width'>, dataValue: string): EditorVNodeObject | null;
20
21
  private renderDropContainer;
22
+ private resizePosition;
21
23
  renderDay(): EditorVNodeObject | null;
22
24
  navigateToToday(): void;
23
25
  onClickDayYearPart(): void;
@@ -249,6 +249,7 @@ export declare class ViewOptions {
249
249
  paraSymbolColor: string;
250
250
  dataGroupColor: string;
251
251
  defaultLineHeight: number;
252
+ virtualViewMode: boolean;
252
253
  trackInsColor: string;
253
254
  trackDelColor: string;
254
255
  showLineRect: boolean;
@@ -271,6 +272,7 @@ export declare class ViewOptions {
271
272
  private _fullPageView;
272
273
  ruleHeight: number;
273
274
  printHeaderFooterLine: boolean;
275
+ showEnterSymbol: boolean;
274
276
  get fullPageView(): boolean;
275
277
  set fullPageView(value: boolean);
276
278
  mmToPixelsRatio: number;
@@ -123,16 +123,6 @@ export declare class ElementUtil {
123
123
  */
124
124
  static getControlIndex(control: Element): number;
125
125
  static getControlIndex(control: Element, pure: boolean): number;
126
- /**
127
- * 根据全局索引位置获取元素
128
- * @param control
129
- * @param counter
130
- * @returns
131
- */
132
- static getControlByIndex(control: Element, counter: {
133
- currIndex: number;
134
- index: number;
135
- }): Element | null;
136
126
  static getControlByIndex(control: Element, counter: {
137
127
  currIndex: number;
138
128
  index: number;
@@ -16,7 +16,6 @@ export declare class DataElementBarcode extends DataElementLeaf<DataElementBarco
16
16
  setValue(val: string): void;
17
17
  getValue(): string;
18
18
  drawBarcode(renderCtx: RenderContextType, pos: Position): void;
19
- createBarcodeCache(): void;
20
19
  }
21
20
  export declare class DataElementBarcodeRenderObject extends ResizeLeafRenderObject {
22
21
  render(e: IRenderData): void;
@@ -0,0 +1,32 @@
1
+ import { ICreateRenderData, LeafElement, ViewOptions, Element, SerializeProps, ElementFactory, readElementProps } from "../../element-define";
2
+ import { INotifyPropertyChanged } from "../../element-props";
3
+ import { IEditorVNodeOptions, IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
4
+ /**
5
+ * 恒牙牙位图
6
+ */
7
+ export declare class PermanentTeethElement extends LeafElement<PermanentTeethProps> {
8
+ constructor();
9
+ clone(data: boolean): Element;
10
+ createRenderObject(data: ICreateRenderData): RenderObject | null;
11
+ serialize(viewOptions: ViewOptions): SerializeProps | null;
12
+ }
13
+ export declare class PermanentTeethRenderObject extends LeafRenderObject<PermanentTeethElement> {
14
+ render(e: IRenderData): void;
15
+ clone(): RenderObject;
16
+ exportHTML(event: IEditorVNodeOptions): any;
17
+ }
18
+ export declare class PermanentTeethFactory extends ElementFactory<PermanentTeethProps> {
19
+ match(type: string): boolean;
20
+ createElement(data: readElementProps<PermanentTeethProps>): Element;
21
+ }
22
+ /**
23
+ * 恒牙牙位图属性
24
+ */
25
+ export declare class PermanentTeethProps extends INotifyPropertyChanged {
26
+ topLeft: string;
27
+ topRight: string;
28
+ bottomLeft: string;
29
+ bottomRight: string;
30
+ getSerializeProps(viewOptions: ViewOptions): any;
31
+ clone(dest?: PermanentTeethProps): PermanentTeethProps;
32
+ }
@@ -1,5 +1,5 @@
1
1
  import { Element, ElementFactory, LeafElement, SerializeProps } from "../../element-define";
2
- import { IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
2
+ import { IEditorVNodeOptions, IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
3
3
  import { TextProps } from "../../element-props";
4
4
  export declare class BreakElement extends LeafElement {
5
5
  textProps: TextProps;
@@ -10,6 +10,7 @@ export declare class BreakElement extends LeafElement {
10
10
  }
11
11
  export declare class BreakRenderObject extends LeafRenderObject<BreakElement> {
12
12
  render(e: IRenderData): void;
13
+ exportHTML(event: IEditorVNodeOptions): any;
13
14
  clone(): RenderObject;
14
15
  }
15
16
  export declare class BreakFactory extends ElementFactory<null> {
@@ -1,5 +1,5 @@
1
1
  import { Element, LeafElement, SerializeProps } from "../../element-define";
2
- import { IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
2
+ import { IEditorVNodeOptions, IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
3
3
  import { TextProps } from "../../element-props";
4
4
  export declare class PSymbolElement extends LeafElement {
5
5
  textProps: TextProps;
@@ -12,5 +12,6 @@ export declare class PSymbolElement extends LeafElement {
12
12
  }
13
13
  export declare class PSymbolRenderObject extends LeafRenderObject<PSymbolElement> {
14
14
  render(e: IRenderData): void;
15
+ exportHTML(event: IEditorVNodeOptions): any;
15
16
  clone(): RenderObject;
16
17
  }
package/package.json CHANGED
@@ -4,10 +4,9 @@
4
4
  "author": "hailin-zheng",
5
5
  "private": false,
6
6
  "license": "ISC",
7
- "version": "2.1.0",
7
+ "version": "2.1.2",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
- "bwip-js": "^3.0.5",
11
10
  "moment": "^2.29.3",
12
11
  "nanoid": "^3.1.30",
13
12
  "acorn": "^8.8.0",