@hailin-zheng/editor-core 2.0.4 → 2.0.5

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.
@@ -29,11 +29,11 @@ export declare class CommonUtil {
29
29
  borderType: BorderType;
30
30
  } | null;
31
31
  /**
32
- * 整形符合连线要求
33
- * @param points
34
- * @param width
35
- * @param strokeColor
36
- */
32
+ * 整形符合连线要求
33
+ * @param points
34
+ * @param width
35
+ * @param strokeColor
36
+ */
37
37
  static resharpPoints(points: Array<Position>): Array<Position>;
38
38
  static getOffsetX(node: HTMLElement): number;
39
39
  static randomColor(): string;
@@ -62,5 +62,6 @@ export declare class CommonUtil {
62
62
  static cloneValue(val: any): any;
63
63
  static isConstructor(f: any): boolean;
64
64
  static toArray<T>(item: Array<T> | T): Array<T>;
65
+ static removeChild(ele: HTMLElement): void;
65
66
  }
66
67
  export {};
@@ -12,6 +12,8 @@ export declare class EditorCalendarVNode {
12
12
  selectedDate: ISignal<string | null>;
13
13
  currentDate: string;
14
14
  onSetValue: Subject<string | Date>;
15
+ currTime: ISignal<string | null>;
16
+ selectedTime: ISignal<string | null>;
15
17
  constructor();
16
18
  reset(): void;
17
19
  render(position: Position, dataValue: string): EditorVNodeObject | null;
@@ -1,13 +1,15 @@
1
1
  import { Element, ElementFactory, Position, readElementProps, ResizeLeafRenderObject, SerializeProps, ViewOptions } from "../../element-define";
2
2
  import { DataElementBarcodeProps } from "../../element-props";
3
3
  import { RenderContextType } from "../../render-context";
4
- import { IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
4
+ import { IEditorVNodeOptions, IRenderData, LeafRenderObject, RenderObject } from "../../render-define";
5
5
  import { DataElementLeaf } from "./data-element-base-impl";
6
+ import { qrcodegen } from "./qrcode";
6
7
  export declare class DataElementBarcode extends DataElementLeaf<DataElementBarcodeProps> {
7
8
  resizeable: boolean;
8
9
  private barCodeCanvas;
9
10
  private cache;
10
11
  constructor();
12
+ get resizeMode(): boolean;
11
13
  createRenderObject(): LeafRenderObject;
12
14
  serialize(options: ViewOptions): SerializeProps;
13
15
  clone(data: boolean): Element;
@@ -21,6 +23,8 @@ export declare class DataElementBarcodeRenderObject extends ResizeLeafRenderObje
21
23
  clone(): RenderObject;
22
24
  pagePaintCompleted(e: IRenderData): void;
23
25
  private drawResizeCircle;
26
+ exportHTML(event: IEditorVNodeOptions): any;
27
+ toSvgString(qr: qrcodegen.QrCode, border: number, lightColor: string, darkColor: string): any;
24
28
  }
25
29
  export declare class DataElementBarcodeFactory extends ElementFactory<DataElementBarcodeProps> {
26
30
  match(type: string): boolean;
@@ -0,0 +1,93 @@
1
+ export declare namespace qrcodegen {
2
+ type bit = number;
3
+ type byte = number;
4
+ type int = number;
5
+ export class QrCode {
6
+ readonly version: int;
7
+ readonly errorCorrectionLevel: QrCode.Ecc;
8
+ static encodeText(text: string, ecl: QrCode.Ecc): QrCode;
9
+ static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode;
10
+ static encodeSegments(segs: Readonly<Array<QrSegment>>, ecl: QrCode.Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
11
+ readonly size: int;
12
+ readonly mask: int;
13
+ private readonly modules;
14
+ private readonly isFunction;
15
+ constructor(version: int, errorCorrectionLevel: QrCode.Ecc, dataCodewords: Readonly<Array<byte>>, msk: int);
16
+ getModule(x: int, y: int): boolean;
17
+ private drawFunctionPatterns;
18
+ private drawFormatBits;
19
+ private drawVersion;
20
+ private drawFinderPattern;
21
+ private drawAlignmentPattern;
22
+ private setFunctionModule;
23
+ private addEccAndInterleave;
24
+ private drawCodewords;
25
+ private applyMask;
26
+ private getPenaltyScore;
27
+ private getAlignmentPatternPositions;
28
+ private static getNumRawDataModules;
29
+ private static getNumDataCodewords;
30
+ private static reedSolomonComputeDivisor;
31
+ private static reedSolomonComputeRemainder;
32
+ private static reedSolomonMultiply;
33
+ private finderPenaltyCountPatterns;
34
+ private finderPenaltyTerminateAndCount;
35
+ private finderPenaltyAddHistory;
36
+ static readonly MIN_VERSION: int;
37
+ static readonly MAX_VERSION: int;
38
+ private static readonly PENALTY_N1;
39
+ private static readonly PENALTY_N2;
40
+ private static readonly PENALTY_N3;
41
+ private static readonly PENALTY_N4;
42
+ private static readonly ECC_CODEWORDS_PER_BLOCK;
43
+ private static readonly NUM_ERROR_CORRECTION_BLOCKS;
44
+ }
45
+ export class QrSegment {
46
+ readonly mode: QrSegment.Mode;
47
+ readonly numChars: int;
48
+ private readonly bitData;
49
+ static makeBytes(data: Readonly<Array<byte>>): QrSegment;
50
+ static makeNumeric(digits: string): QrSegment;
51
+ static makeAlphanumeric(text: string): QrSegment;
52
+ static makeSegments(text: string): Array<QrSegment>;
53
+ static makeEci(assignVal: int): QrSegment;
54
+ static isNumeric(text: string): boolean;
55
+ static isAlphanumeric(text: string): boolean;
56
+ constructor(mode: QrSegment.Mode, numChars: int, bitData: Array<bit>);
57
+ getData(): Array<bit>;
58
+ static getTotalBits(segs: Readonly<Array<QrSegment>>, version: int): number;
59
+ private static toUtf8ByteArray;
60
+ private static readonly NUMERIC_REGEX;
61
+ private static readonly ALPHANUMERIC_REGEX;
62
+ private static readonly ALPHANUMERIC_CHARSET;
63
+ }
64
+ export {};
65
+ }
66
+ export declare namespace qrcodegen.QrCode {
67
+ type int = number;
68
+ export class Ecc {
69
+ readonly ordinal: int;
70
+ readonly formatBits: int;
71
+ static readonly LOW: Ecc;
72
+ static readonly MEDIUM: Ecc;
73
+ static readonly QUARTILE: Ecc;
74
+ static readonly HIGH: Ecc;
75
+ private constructor();
76
+ }
77
+ export {};
78
+ }
79
+ export declare namespace qrcodegen.QrSegment {
80
+ type int = number;
81
+ export class Mode {
82
+ readonly modeBits: int;
83
+ private readonly numBitsCharCount;
84
+ static readonly NUMERIC: Mode;
85
+ static readonly ALPHANUMERIC: Mode;
86
+ static readonly BYTE: Mode;
87
+ static readonly KANJI: Mode;
88
+ static readonly ECI: Mode;
89
+ private constructor();
90
+ numCharCountBits(ver: int): int;
91
+ }
92
+ export {};
93
+ }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "hailin-zheng",
5
5
  "private": false,
6
6
  "license": "ISC",
7
- "version": "2.0.4",
7
+ "version": "2.0.5",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "bwip-js": "^3.0.5",
@@ -14,6 +14,7 @@
14
14
  "astring": "^1.8.3",
15
15
  "estraverse": "^5.3.0",
16
16
  "snabbdom": "^3.5.1",
17
- "snabbdom-to-html": "^7.1.0"
17
+ "snabbdom-to-html": "^7.1.0",
18
+ "jsbarcode": "^3.11.5"
18
19
  }
19
20
  }