@hailin-zheng/editor-core 2.2.8 → 2.2.10

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.
@@ -128,7 +128,7 @@ export declare class DocEditor {
128
128
  */
129
129
  private docDblClickHandle;
130
130
  /**
131
- * 获取当前光标所在的数据元
131
+ * 获取当前光标所在的数据元或者数据组
132
132
  * @returns
133
133
  */
134
134
  getCurrentDataElement(): DataElementInlineGroup | DataElementLeaf | null;
@@ -95,7 +95,7 @@ export declare class DocumentChange {
95
95
  /**
96
96
  * 根据选择范围删除
97
97
  */
98
- private onRangeDelete;
98
+ onRangeDelete(): void;
99
99
  private capturingForSelection;
100
100
  private getSelectionRangeStack;
101
101
  /**
@@ -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
  }
@@ -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';
@@ -1,9 +1,11 @@
1
1
  import { DataElementBaseFactory, InlineGroupInputElement } from "./data-element-base-impl";
2
2
  import { InlineGroupRenderObject, RenderObject } from "../../render-define";
3
- import { SerializeProps, ViewOptions, Element } from "../../element-define";
3
+ import { SerializeProps, ViewOptions, Element, LeafElement } from "../../element-define";
4
4
  import { DataElementGroupProps } from "../../element-props";
5
5
  export declare class DataElementGroupElement extends InlineGroupInputElement<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,11 @@ 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
  }
21
+ /**
22
+ * 是否在数据组内部
23
+ * @param control
24
+ * @param offset
25
+ */
26
+ export declare function IsInSideDataGroup(control: LeafElement, offset: number): boolean;
@@ -10,6 +10,7 @@ import { TableRowRenderObject } from "../impl/table/table-row-impl";
10
10
  import { TextGroupElement, TextGroupRenderObject } from "../impl/text/text-impl";
11
11
  import { TrackRunElement, TrackRunTypeEnum } from "../impl/text/track-run-impl";
12
12
  import { BlockContainerRenderObject, BlockContentRenderObject, BorderType, BranchRenderObject, CursorType, InlineGroupRenderObject, LeafRenderObject, RenderObject } from "../render-define";
13
+ import { DataElementGroupElement } from "../impl";
13
14
  declare type PAIR = {
14
15
  x: number;
15
16
  y: number;
@@ -377,6 +378,12 @@ export declare class ElementUtil {
377
378
  * @returns
378
379
  */
379
380
  static getDataElement(ele: Element): DataElementInlineGroup | null;
381
+ /**
382
+ * 向上查找类型为数据元的父级
383
+ * @param ele
384
+ * @returns
385
+ */
386
+ static getDataGroupElement(ele: Element): DataElementGroupElement | null;
380
387
  static getOSPlatform(): 'Windows' | 'Mac' | 'Linux';
381
388
  static getCheckboxPath(x: number, y: number, width: number, height: number): Array<Position>;
382
389
  static getStrokeSvgPath(pathPoints: Array<Position> | string, stroke: string, width: number): any;
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.8",
7
+ "version": "2.2.10",
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
+ }