refactor: add prettier and format
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { BlockType } from '../dataset/enum/Block'
|
||||
|
||||
export interface IIFrameBlock {
|
||||
src: string;
|
||||
src: string
|
||||
}
|
||||
|
||||
export interface IVideoBlock {
|
||||
src: string;
|
||||
src: string
|
||||
}
|
||||
|
||||
export interface IBlock {
|
||||
type: BlockType;
|
||||
iframeBlock?: IIFrameBlock;
|
||||
videoBlock?: IVideoBlock;
|
||||
}
|
||||
type: BlockType
|
||||
iframeBlock?: IIFrameBlock
|
||||
videoBlock?: IVideoBlock
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { TitleLevel } from '../dataset/enum/Title'
|
||||
|
||||
export interface ICatalogItem {
|
||||
id: string;
|
||||
name: string;
|
||||
level: TitleLevel;
|
||||
subCatalog: ICatalogItem[];
|
||||
id: string
|
||||
name: string
|
||||
level: TitleLevel
|
||||
subCatalog: ICatalogItem[]
|
||||
}
|
||||
|
||||
export type ICatalog = ICatalogItem[]
|
||||
export type ICatalog = ICatalogItem[]
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
export interface ICheckbox {
|
||||
value: boolean | null;
|
||||
code?: string;
|
||||
disabled?: boolean;
|
||||
value: boolean | null
|
||||
code?: string
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
export interface ICheckboxOption {
|
||||
width?: number;
|
||||
height?: number;
|
||||
gap?: number;
|
||||
lineWidth?: number;
|
||||
fillStyle?: string;
|
||||
fontStyle?: string;
|
||||
}
|
||||
width?: number
|
||||
height?: number
|
||||
gap?: number
|
||||
lineWidth?: number
|
||||
fillStyle?: string
|
||||
fontStyle?: string
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
export type Primitive = string | number | boolean | bigint | symbol | undefined | null
|
||||
export type Primitive =
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| bigint
|
||||
| symbol
|
||||
| undefined
|
||||
| null
|
||||
|
||||
export type Builtin = Primitive | Function | Date | Error | RegExp
|
||||
|
||||
@@ -25,5 +32,5 @@ export type DeepRequired<T> = T extends Error
|
||||
: Required<T>
|
||||
|
||||
export type DeepPartial<T> = {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
}
|
||||
[P in keyof T]?: DeepPartial<T[P]>
|
||||
}
|
||||
|
||||
@@ -3,64 +3,63 @@ import { ICheckbox } from './Checkbox'
|
||||
import { IElement } from './Element'
|
||||
|
||||
export interface IValueSet {
|
||||
value: string;
|
||||
code: string;
|
||||
value: string
|
||||
code: string
|
||||
}
|
||||
|
||||
export interface IControlSelect {
|
||||
code: string | null;
|
||||
valueSets: IValueSet[];
|
||||
code: string | null
|
||||
valueSets: IValueSet[]
|
||||
}
|
||||
|
||||
export interface IControlCheckbox {
|
||||
code: string | null;
|
||||
min?: number;
|
||||
max?: number;
|
||||
valueSets: IValueSet[];
|
||||
checkbox?: ICheckbox;
|
||||
code: string | null
|
||||
min?: number
|
||||
max?: number
|
||||
valueSets: IValueSet[]
|
||||
checkbox?: ICheckbox
|
||||
}
|
||||
|
||||
export interface IControlBasic {
|
||||
type: ControlType;
|
||||
value: IElement[] | null;
|
||||
placeholder?: string;
|
||||
conceptId?: string;
|
||||
prefix?: string;
|
||||
postfix?: string;
|
||||
type: ControlType
|
||||
value: IElement[] | null
|
||||
placeholder?: string
|
||||
conceptId?: string
|
||||
prefix?: string
|
||||
postfix?: string
|
||||
}
|
||||
|
||||
export type IControl = IControlBasic
|
||||
& Partial<IControlSelect>
|
||||
& Partial<IControlCheckbox>
|
||||
|
||||
export type IControl = IControlBasic &
|
||||
Partial<IControlSelect> &
|
||||
Partial<IControlCheckbox>
|
||||
|
||||
export interface IControlOption {
|
||||
placeholderColor?: string;
|
||||
bracketColor?: string;
|
||||
prefix?: string;
|
||||
postfix?: string;
|
||||
placeholderColor?: string
|
||||
bracketColor?: string
|
||||
prefix?: string
|
||||
postfix?: string
|
||||
}
|
||||
|
||||
export interface IControlInitOption {
|
||||
index: number;
|
||||
isTable?: boolean;
|
||||
trIndex?: number;
|
||||
tdIndex?: number;
|
||||
tdValueIndex?: number;
|
||||
index: number
|
||||
isTable?: boolean
|
||||
trIndex?: number
|
||||
tdIndex?: number
|
||||
tdValueIndex?: number
|
||||
}
|
||||
|
||||
export interface IControlInitResult {
|
||||
newIndex: number;
|
||||
newIndex: number
|
||||
}
|
||||
|
||||
export interface IControlInstance {
|
||||
getElement(): IElement;
|
||||
getElement(): IElement
|
||||
|
||||
getValue(): IElement[];
|
||||
getValue(): IElement[]
|
||||
|
||||
setValue(data: IElement[]): number;
|
||||
setValue(data: IElement[]): number
|
||||
|
||||
keydown(evt: KeyboardEvent): number;
|
||||
keydown(evt: KeyboardEvent): number
|
||||
|
||||
cut(): number;
|
||||
}
|
||||
cut(): number
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export interface ICursorOption {
|
||||
width?: number;
|
||||
color?: string;
|
||||
dragWidth?: number;
|
||||
dragColor?: string;
|
||||
}
|
||||
width?: number
|
||||
color?: string
|
||||
dragWidth?: number
|
||||
dragColor?: string
|
||||
}
|
||||
|
||||
@@ -3,44 +3,44 @@ import { IElement, IElementPosition } from './Element'
|
||||
import { IRow } from './Row'
|
||||
|
||||
export interface IDrawOption {
|
||||
curIndex?: number;
|
||||
isSetCursor?: boolean;
|
||||
isSubmitHistory?: boolean;
|
||||
isCompute?: boolean;
|
||||
isLazy?: boolean;
|
||||
curIndex?: number
|
||||
isSetCursor?: boolean
|
||||
isSubmitHistory?: boolean
|
||||
isCompute?: boolean
|
||||
isLazy?: boolean
|
||||
}
|
||||
|
||||
export interface IDrawImagePayload {
|
||||
width: number;
|
||||
height: number;
|
||||
value: string;
|
||||
width: number
|
||||
height: number
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface IDrawRowPayload {
|
||||
elementList: IElement[];
|
||||
positionList: IElementPosition[];
|
||||
rowList: IRow[];
|
||||
pageNo: number;
|
||||
startIndex: number;
|
||||
innerWidth: number;
|
||||
zone?: EditorZone;
|
||||
elementList: IElement[]
|
||||
positionList: IElementPosition[]
|
||||
rowList: IRow[]
|
||||
pageNo: number
|
||||
startIndex: number
|
||||
innerWidth: number
|
||||
zone?: EditorZone
|
||||
}
|
||||
|
||||
export interface IDrawPagePayload {
|
||||
elementList: IElement[];
|
||||
positionList: IElementPosition[];
|
||||
rowList: IRow[];
|
||||
pageNo: number;
|
||||
elementList: IElement[]
|
||||
positionList: IElementPosition[]
|
||||
rowList: IRow[]
|
||||
pageNo: number
|
||||
}
|
||||
|
||||
export interface IPainterOption {
|
||||
isDblclick: boolean;
|
||||
isDblclick: boolean
|
||||
}
|
||||
|
||||
export interface IGetValueOption {
|
||||
pageNo?: number;
|
||||
pageNo?: number
|
||||
}
|
||||
|
||||
export interface IAppendElementListOption {
|
||||
isPrepend?: boolean;
|
||||
}
|
||||
isPrepend?: boolean
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { IElement } from '..'
|
||||
import { EditorMode, PageMode, PaperDirection, WordBreak } from '../dataset/enum/Editor'
|
||||
import {
|
||||
EditorMode,
|
||||
PageMode,
|
||||
PaperDirection,
|
||||
WordBreak
|
||||
} from '../dataset/enum/Editor'
|
||||
import { ICheckboxOption } from './Checkbox'
|
||||
import { IControlOption } from './Control'
|
||||
import { ICursorOption } from './Cursor'
|
||||
@@ -12,64 +17,64 @@ import { ITitleOption } from './Title'
|
||||
import { IWatermark } from './Watermark'
|
||||
|
||||
export interface IEditorData {
|
||||
header?: IElement[];
|
||||
main: IElement[];
|
||||
footer?: IElement[];
|
||||
header?: IElement[]
|
||||
main: IElement[]
|
||||
footer?: IElement[]
|
||||
}
|
||||
|
||||
export interface IEditorOption {
|
||||
mode?: EditorMode;
|
||||
defaultType?: string;
|
||||
defaultFont?: string;
|
||||
defaultSize?: number;
|
||||
minSize?: number;
|
||||
maxSize?: number;
|
||||
defaultBasicRowMarginHeight?: number;
|
||||
defaultRowMargin?: number;
|
||||
defaultTabWidth?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
scale?: number;
|
||||
pageGap?: number;
|
||||
underlineColor?: string;
|
||||
strikeoutColor?: string;
|
||||
rangeColor?: string;
|
||||
rangeAlpha?: number;
|
||||
rangeMinWidth?: number;
|
||||
searchMatchColor?: string;
|
||||
searchNavigateMatchColor?: string;
|
||||
searchMatchAlpha?: number;
|
||||
highlightAlpha?: number;
|
||||
resizerColor?: string;
|
||||
resizerSize?: number;
|
||||
marginIndicatorSize?: number;
|
||||
marginIndicatorColor?: string,
|
||||
margins?: IMargin,
|
||||
pageMode?: PageMode;
|
||||
tdPadding?: number;
|
||||
defaultTrMinHeight?: number;
|
||||
defaultColMinWidth?: number;
|
||||
defaultHyperlinkColor?: string;
|
||||
paperDirection?: PaperDirection;
|
||||
inactiveAlpha?: number;
|
||||
historyMaxRecordCount?: number;
|
||||
wordBreak?: WordBreak;
|
||||
header?: IHeader;
|
||||
footer?: IFooter;
|
||||
pageNumber?: IPageNumber;
|
||||
watermark?: IWatermark;
|
||||
control?: IControlOption;
|
||||
checkbox?: ICheckboxOption;
|
||||
cursor?: ICursorOption;
|
||||
title?: ITitleOption;
|
||||
placeholder?: IPlaceholder;
|
||||
mode?: EditorMode
|
||||
defaultType?: string
|
||||
defaultFont?: string
|
||||
defaultSize?: number
|
||||
minSize?: number
|
||||
maxSize?: number
|
||||
defaultBasicRowMarginHeight?: number
|
||||
defaultRowMargin?: number
|
||||
defaultTabWidth?: number
|
||||
width?: number
|
||||
height?: number
|
||||
scale?: number
|
||||
pageGap?: number
|
||||
underlineColor?: string
|
||||
strikeoutColor?: string
|
||||
rangeColor?: string
|
||||
rangeAlpha?: number
|
||||
rangeMinWidth?: number
|
||||
searchMatchColor?: string
|
||||
searchNavigateMatchColor?: string
|
||||
searchMatchAlpha?: number
|
||||
highlightAlpha?: number
|
||||
resizerColor?: string
|
||||
resizerSize?: number
|
||||
marginIndicatorSize?: number
|
||||
marginIndicatorColor?: string
|
||||
margins?: IMargin
|
||||
pageMode?: PageMode
|
||||
tdPadding?: number
|
||||
defaultTrMinHeight?: number
|
||||
defaultColMinWidth?: number
|
||||
defaultHyperlinkColor?: string
|
||||
paperDirection?: PaperDirection
|
||||
inactiveAlpha?: number
|
||||
historyMaxRecordCount?: number
|
||||
wordBreak?: WordBreak
|
||||
header?: IHeader
|
||||
footer?: IFooter
|
||||
pageNumber?: IPageNumber
|
||||
watermark?: IWatermark
|
||||
control?: IControlOption
|
||||
checkbox?: ICheckboxOption
|
||||
cursor?: ICursorOption
|
||||
title?: ITitleOption
|
||||
placeholder?: IPlaceholder
|
||||
}
|
||||
|
||||
export interface IEditorResult {
|
||||
version: string;
|
||||
width: number;
|
||||
height: number;
|
||||
margins: IMargin;
|
||||
watermark?: IWatermark;
|
||||
data: IEditorData;
|
||||
}
|
||||
version: string
|
||||
width: number
|
||||
height: number
|
||||
margins: IMargin
|
||||
watermark?: IWatermark
|
||||
data: IEditorData
|
||||
}
|
||||
|
||||
@@ -11,86 +11,86 @@ import { IColgroup } from './table/Colgroup'
|
||||
import { ITr } from './table/Tr'
|
||||
|
||||
export interface IElementBasic {
|
||||
id?: string;
|
||||
type?: ElementType;
|
||||
value: string;
|
||||
id?: string
|
||||
type?: ElementType
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface IElementStyle {
|
||||
font?: string;
|
||||
size?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
bold?: boolean;
|
||||
color?: string;
|
||||
highlight?: string;
|
||||
italic?: boolean;
|
||||
underline?: boolean;
|
||||
strikeout?: boolean;
|
||||
rowFlex?: RowFlex;
|
||||
rowMargin?: number;
|
||||
letterSpacing?: number;
|
||||
font?: string
|
||||
size?: number
|
||||
width?: number
|
||||
height?: number
|
||||
bold?: boolean
|
||||
color?: string
|
||||
highlight?: string
|
||||
italic?: boolean
|
||||
underline?: boolean
|
||||
strikeout?: boolean
|
||||
rowFlex?: RowFlex
|
||||
rowMargin?: number
|
||||
letterSpacing?: number
|
||||
}
|
||||
|
||||
export interface ITitleElement {
|
||||
valueList?: IElement[];
|
||||
level?: TitleLevel;
|
||||
titleId?: string;
|
||||
valueList?: IElement[]
|
||||
level?: TitleLevel
|
||||
titleId?: string
|
||||
}
|
||||
|
||||
export interface IListElement {
|
||||
valueList?: IElement[];
|
||||
listType?: ListType;
|
||||
listStyle?: ListStyle;
|
||||
listId?: string;
|
||||
listWrap?: boolean;
|
||||
valueList?: IElement[]
|
||||
listType?: ListType
|
||||
listStyle?: ListStyle
|
||||
listId?: string
|
||||
listWrap?: boolean
|
||||
}
|
||||
|
||||
export interface ITableAttr {
|
||||
colgroup?: IColgroup[];
|
||||
trList?: ITr[];
|
||||
borderType?: TableBorder;
|
||||
colgroup?: IColgroup[]
|
||||
trList?: ITr[]
|
||||
borderType?: TableBorder
|
||||
}
|
||||
|
||||
export interface ITableElement {
|
||||
tdId?: string;
|
||||
trId?: string;
|
||||
tableId?: string;
|
||||
tdId?: string
|
||||
trId?: string
|
||||
tableId?: string
|
||||
}
|
||||
|
||||
export type ITable = ITableAttr & ITableElement
|
||||
|
||||
export interface IHyperlinkElement {
|
||||
valueList?: IElement[];
|
||||
url?: string;
|
||||
hyperlinkId?: string;
|
||||
valueList?: IElement[]
|
||||
url?: string
|
||||
hyperlinkId?: string
|
||||
}
|
||||
|
||||
export interface ISuperscriptSubscript {
|
||||
actualSize?: number;
|
||||
actualSize?: number
|
||||
}
|
||||
|
||||
export interface ISeparator {
|
||||
dashArray?: number[];
|
||||
dashArray?: number[]
|
||||
}
|
||||
|
||||
export interface IControlElement {
|
||||
control?: IControl;
|
||||
controlId?: string;
|
||||
controlComponent?: ControlComponent;
|
||||
control?: IControl
|
||||
controlId?: string
|
||||
controlComponent?: ControlComponent
|
||||
}
|
||||
|
||||
export interface ICheckboxElement {
|
||||
checkbox?: ICheckbox;
|
||||
checkbox?: ICheckbox
|
||||
}
|
||||
|
||||
export interface ILaTexElement {
|
||||
laTexSVG?: string;
|
||||
laTexSVG?: string
|
||||
}
|
||||
|
||||
export interface IDateElement {
|
||||
dateFormat?: string;
|
||||
dateId?: string;
|
||||
dateFormat?: string
|
||||
dateId?: string
|
||||
}
|
||||
|
||||
export interface IImageElement {
|
||||
@@ -98,52 +98,52 @@ export interface IImageElement {
|
||||
}
|
||||
|
||||
export interface IBlockElement {
|
||||
block?: IBlock;
|
||||
block?: IBlock
|
||||
}
|
||||
|
||||
export type IElement = IElementBasic
|
||||
& IElementStyle
|
||||
& ITable
|
||||
& IHyperlinkElement
|
||||
& ISuperscriptSubscript
|
||||
& ISeparator
|
||||
& IControlElement
|
||||
& ICheckboxElement
|
||||
& ILaTexElement
|
||||
& IDateElement
|
||||
& IImageElement
|
||||
& IBlockElement
|
||||
& ITitleElement
|
||||
& IListElement
|
||||
export type IElement = IElementBasic &
|
||||
IElementStyle &
|
||||
ITable &
|
||||
IHyperlinkElement &
|
||||
ISuperscriptSubscript &
|
||||
ISeparator &
|
||||
IControlElement &
|
||||
ICheckboxElement &
|
||||
ILaTexElement &
|
||||
IDateElement &
|
||||
IImageElement &
|
||||
IBlockElement &
|
||||
ITitleElement &
|
||||
IListElement
|
||||
|
||||
export interface IElementMetrics {
|
||||
width: number;
|
||||
height: number;
|
||||
boundingBoxAscent: number;
|
||||
boundingBoxDescent: number;
|
||||
width: number
|
||||
height: number
|
||||
boundingBoxAscent: number
|
||||
boundingBoxDescent: number
|
||||
}
|
||||
|
||||
export interface IElementPosition {
|
||||
pageNo: number;
|
||||
index: number;
|
||||
value: string,
|
||||
rowIndex: number;
|
||||
rowNo: number;
|
||||
ascent: number;
|
||||
lineHeight: number;
|
||||
metrics: IElementMetrics;
|
||||
isLastLetter: boolean,
|
||||
pageNo: number
|
||||
index: number
|
||||
value: string
|
||||
rowIndex: number
|
||||
rowNo: number
|
||||
ascent: number
|
||||
lineHeight: number
|
||||
metrics: IElementMetrics
|
||||
isLastLetter: boolean
|
||||
coordinate: {
|
||||
leftTop: number[];
|
||||
leftBottom: number[];
|
||||
rightTop: number[];
|
||||
rightBottom: number[];
|
||||
leftTop: number[]
|
||||
leftBottom: number[]
|
||||
rightTop: number[]
|
||||
rightBottom: number[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface IElementFillRect {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
x: number
|
||||
y: number
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MaxHeightRatio } from '../dataset/enum/Common'
|
||||
|
||||
export interface IFooter {
|
||||
bottom?: number;
|
||||
maxHeightRadio?: MaxHeightRatio;
|
||||
disabled?: boolean;
|
||||
}
|
||||
bottom?: number
|
||||
maxHeightRadio?: MaxHeightRatio
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MaxHeightRatio } from '../dataset/enum/Common'
|
||||
|
||||
export interface IHeader {
|
||||
top?: number;
|
||||
maxHeightRadio?: MaxHeightRatio;
|
||||
disabled?: boolean;
|
||||
}
|
||||
top?: number
|
||||
maxHeightRadio?: MaxHeightRatio
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
@@ -1,27 +1,34 @@
|
||||
import { EditorZone, ElementType, ListStyle, ListType, PageMode, TitleLevel } from '..'
|
||||
import {
|
||||
EditorZone,
|
||||
ElementType,
|
||||
ListStyle,
|
||||
ListType,
|
||||
PageMode,
|
||||
TitleLevel
|
||||
} from '..'
|
||||
import { RowFlex } from '../dataset/enum/Row'
|
||||
import { IControl } from './Control'
|
||||
import { IEditorResult } from './Editor'
|
||||
|
||||
export interface IRangeStyle {
|
||||
type: ElementType | null;
|
||||
undo: boolean;
|
||||
redo: boolean;
|
||||
painter: boolean;
|
||||
font: string;
|
||||
size: number;
|
||||
bold: boolean;
|
||||
italic: boolean;
|
||||
underline: boolean;
|
||||
strikeout: boolean;
|
||||
color: string | null;
|
||||
highlight: string | null;
|
||||
rowFlex: RowFlex | null;
|
||||
rowMargin: number;
|
||||
dashArray: number[];
|
||||
level: TitleLevel | null;
|
||||
listType: ListType | null;
|
||||
listStyle: ListStyle | null;
|
||||
type: ElementType | null
|
||||
undo: boolean
|
||||
redo: boolean
|
||||
painter: boolean
|
||||
font: string
|
||||
size: number
|
||||
bold: boolean
|
||||
italic: boolean
|
||||
underline: boolean
|
||||
strikeout: boolean
|
||||
color: string | null
|
||||
highlight: string | null
|
||||
rowFlex: RowFlex | null
|
||||
rowMargin: number
|
||||
dashArray: number[]
|
||||
level: TitleLevel | null
|
||||
listType: ListType | null
|
||||
listStyle: ListStyle | null
|
||||
}
|
||||
|
||||
export type IRangeStyleChange = (payload: IRangeStyle) => void
|
||||
@@ -42,4 +49,4 @@ export type IControlChange = (payload: IControl | null) => void
|
||||
|
||||
export type IPageModeChange = (payload: PageMode) => void
|
||||
|
||||
export type IZoneChange = (payload: EditorZone) => void
|
||||
export type IZoneChange = (payload: EditorZone) => void
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type IMargin = [top: number, right: number, bottom: number, left: number]
|
||||
export type IMargin = [top: number, right: number, bottom: number, left: number]
|
||||
|
||||
@@ -2,14 +2,14 @@ import { NumberType } from '../dataset/enum/Common'
|
||||
import { RowFlex } from '../dataset/enum/Row'
|
||||
|
||||
export interface IPageNumber {
|
||||
bottom?: number;
|
||||
size?: number;
|
||||
font?: string;
|
||||
color?: string;
|
||||
rowFlex?: RowFlex;
|
||||
format?: string;
|
||||
numberType?: NumberType;
|
||||
disabled?: boolean;
|
||||
startPageNo?: number;
|
||||
fromPageNo?: number;
|
||||
}
|
||||
bottom?: number
|
||||
size?: number
|
||||
font?: string
|
||||
color?: string
|
||||
rowFlex?: RowFlex
|
||||
format?: string
|
||||
numberType?: NumberType
|
||||
disabled?: boolean
|
||||
startPageNo?: number
|
||||
fromPageNo?: number
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export interface IPlaceholder {
|
||||
data: string;
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
size?: number;
|
||||
font?: string;
|
||||
}
|
||||
data: string
|
||||
color?: string
|
||||
opacity?: number
|
||||
size?: number
|
||||
font?: string
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import Editor from '..'
|
||||
|
||||
export type PluginFunction<Options> = (editor: Editor, options?: Options) => any;
|
||||
export type PluginFunction<Options> = (editor: Editor, options?: Options) => any
|
||||
|
||||
export type UsePlugin = <Options>(pluginFunction: PluginFunction<Options>, options?: Options) => void;
|
||||
export type UsePlugin = <Options>(
|
||||
pluginFunction: PluginFunction<Options>,
|
||||
options?: Options
|
||||
) => void
|
||||
|
||||
@@ -5,56 +5,56 @@ import { IRow } from './Row'
|
||||
import { ITd } from './table/Td'
|
||||
|
||||
export interface ICurrentPosition {
|
||||
index: number;
|
||||
isCheckbox?: boolean;
|
||||
isControl?: boolean;
|
||||
isImage?: boolean;
|
||||
isTable?: boolean;
|
||||
isDirectHit?: boolean;
|
||||
trIndex?: number;
|
||||
tdIndex?: number;
|
||||
tdValueIndex?: number;
|
||||
tdId?: string;
|
||||
trId?: string;
|
||||
tableId?: string;
|
||||
zone?: EditorZone;
|
||||
index: number
|
||||
isCheckbox?: boolean
|
||||
isControl?: boolean
|
||||
isImage?: boolean
|
||||
isTable?: boolean
|
||||
isDirectHit?: boolean
|
||||
trIndex?: number
|
||||
tdIndex?: number
|
||||
tdValueIndex?: number
|
||||
tdId?: string
|
||||
trId?: string
|
||||
tableId?: string
|
||||
zone?: EditorZone
|
||||
}
|
||||
|
||||
export interface IGetPositionByXYPayload {
|
||||
x: number;
|
||||
y: number;
|
||||
isTable?: boolean;
|
||||
td?: ITd;
|
||||
tablePosition?: IElementPosition;
|
||||
elementList?: IElement[];
|
||||
positionList?: IElementPosition[];
|
||||
x: number
|
||||
y: number
|
||||
isTable?: boolean
|
||||
td?: ITd
|
||||
tablePosition?: IElementPosition
|
||||
elementList?: IElement[]
|
||||
positionList?: IElementPosition[]
|
||||
}
|
||||
|
||||
export interface IPositionContext {
|
||||
isTable: boolean;
|
||||
isCheckbox?: boolean;
|
||||
isControl?: boolean;
|
||||
index?: number;
|
||||
trIndex?: number;
|
||||
tdIndex?: number;
|
||||
tdId?: string;
|
||||
trId?: string;
|
||||
tableId?: string;
|
||||
isTable: boolean
|
||||
isCheckbox?: boolean
|
||||
isControl?: boolean
|
||||
index?: number
|
||||
trIndex?: number
|
||||
tdIndex?: number
|
||||
tdId?: string
|
||||
trId?: string
|
||||
tableId?: string
|
||||
}
|
||||
|
||||
export interface IComputePageRowPositionPayload {
|
||||
positionList: IElementPosition[];
|
||||
rowList: IRow[];
|
||||
pageNo: number;
|
||||
startRowIndex: number;
|
||||
startIndex: number;
|
||||
startX: number;
|
||||
startY: number;
|
||||
innerWidth: number;
|
||||
positionList: IElementPosition[]
|
||||
rowList: IRow[]
|
||||
pageNo: number
|
||||
startRowIndex: number
|
||||
startIndex: number
|
||||
startX: number
|
||||
startY: number
|
||||
innerWidth: number
|
||||
}
|
||||
|
||||
export interface IComputePageRowPositionResult {
|
||||
x: number;
|
||||
y: number;
|
||||
index: number;
|
||||
}
|
||||
x: number
|
||||
y: number
|
||||
index: number
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { IElement } from './Element'
|
||||
|
||||
export interface IPreviewerCreateResult {
|
||||
resizerSelection: HTMLDivElement;
|
||||
resizerHandleList: HTMLDivElement[];
|
||||
resizerImageContainer: HTMLDivElement;
|
||||
resizerImage: HTMLImageElement;
|
||||
resizerSelection: HTMLDivElement
|
||||
resizerHandleList: HTMLDivElement[]
|
||||
resizerImageContainer: HTMLDivElement
|
||||
resizerImage: HTMLImageElement
|
||||
}
|
||||
|
||||
export interface IPreviewerDrawOption {
|
||||
mime?: 'png' | 'jpg' | 'jpeg' | 'svg';
|
||||
srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>;
|
||||
}
|
||||
mime?: 'png' | 'jpg' | 'jpeg' | 'svg'
|
||||
srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ import { EditorZone } from '../dataset/enum/Editor'
|
||||
import { IElement } from './Element'
|
||||
|
||||
export interface IRange {
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
isCrossRowCol?: boolean;
|
||||
tableId?: string;
|
||||
startTdIndex?: number;
|
||||
endTdIndex?: number;
|
||||
startTrIndex?: number;
|
||||
endTrIndex?: number;
|
||||
zone?: EditorZone;
|
||||
startIndex: number
|
||||
endIndex: number
|
||||
isCrossRowCol?: boolean
|
||||
tableId?: string
|
||||
startTdIndex?: number
|
||||
endTdIndex?: number
|
||||
startTrIndex?: number
|
||||
endTrIndex?: number
|
||||
zone?: EditorZone
|
||||
}
|
||||
|
||||
export type RangeRowArray = Map<number, number[]>
|
||||
@@ -18,9 +18,9 @@ export type RangeRowArray = Map<number, number[]>
|
||||
export type RangeRowMap = Map<number, Set<number>>
|
||||
|
||||
export type RangeContext = {
|
||||
isCollapsed: boolean;
|
||||
startElement: IElement;
|
||||
endElement: IElement;
|
||||
startPageNo: number;
|
||||
endPageNo: number;
|
||||
}
|
||||
isCollapsed: boolean
|
||||
startElement: IElement
|
||||
endElement: IElement
|
||||
startPageNo: number
|
||||
endPageNo: number
|
||||
}
|
||||
|
||||
+12
-12
@@ -2,19 +2,19 @@ import { RowFlex } from '../dataset/enum/Row'
|
||||
import { IElement, IElementMetrics } from './Element'
|
||||
|
||||
export type IRowElement = IElement & {
|
||||
metrics: IElementMetrics;
|
||||
style: string;
|
||||
metrics: IElementMetrics
|
||||
style: string
|
||||
}
|
||||
|
||||
export interface IRow {
|
||||
width: number;
|
||||
height: number;
|
||||
ascent: number;
|
||||
rowFlex?: RowFlex;
|
||||
startIndex: number;
|
||||
isPageBreak?: boolean;
|
||||
isList?: boolean;
|
||||
listIndex?: number;
|
||||
offsetX?: number;
|
||||
elementList: IRowElement[];
|
||||
width: number
|
||||
height: number
|
||||
ascent: number
|
||||
rowFlex?: RowFlex
|
||||
startIndex: number
|
||||
isPageBreak?: boolean
|
||||
isList?: boolean
|
||||
listIndex?: number
|
||||
offsetX?: number
|
||||
elementList: IRowElement[]
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { EditorContext } from '../dataset/enum/Editor'
|
||||
|
||||
export interface ISearchResultBasic {
|
||||
type: EditorContext;
|
||||
index: number;
|
||||
groupId: string;
|
||||
type: EditorContext
|
||||
index: number
|
||||
groupId: string
|
||||
}
|
||||
|
||||
export interface ISearchResultRestArgs {
|
||||
tableIndex?: number;
|
||||
trIndex?: number;
|
||||
tdIndex?: number;
|
||||
tdId?: string;
|
||||
startIndex?: number;
|
||||
tableIndex?: number
|
||||
trIndex?: number
|
||||
tdIndex?: number
|
||||
tdId?: string
|
||||
startIndex?: number
|
||||
}
|
||||
|
||||
export type ISearchResult = ISearchResultBasic & ISearchResultRestArgs
|
||||
export type ISearchResult = ISearchResultBasic & ISearchResultRestArgs
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
export interface ITitleSizeOption {
|
||||
defaultFirstSize?: number;
|
||||
defaultSecondSize?: number;
|
||||
defaultThirdSize?: number;
|
||||
defaultFourthSize?: number;
|
||||
defaultFifthSize?: number;
|
||||
defaultSixthSize?: number;
|
||||
defaultFirstSize?: number
|
||||
defaultSecondSize?: number
|
||||
defaultThirdSize?: number
|
||||
defaultFourthSize?: number
|
||||
defaultFifthSize?: number
|
||||
defaultSixthSize?: number
|
||||
}
|
||||
|
||||
export type ITitleOption = ITitleSizeOption & {}
|
||||
export type ITitleOption = ITitleSizeOption & {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export interface IWatermark {
|
||||
data: string;
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
size?: number;
|
||||
font?: string;
|
||||
}
|
||||
data: string
|
||||
color?: string
|
||||
opacity?: number
|
||||
size?: number
|
||||
font?: string
|
||||
}
|
||||
|
||||
@@ -2,62 +2,62 @@ import { Command } from '../../core/command/Command'
|
||||
import { IElement } from '../Element'
|
||||
|
||||
export interface IContextMenuContext {
|
||||
startElement: IElement | null;
|
||||
endElement: IElement | null;
|
||||
isReadonly: boolean;
|
||||
editorHasSelection: boolean;
|
||||
editorTextFocus: boolean;
|
||||
isInTable: boolean;
|
||||
isCrossRowCol: boolean;
|
||||
startElement: IElement | null
|
||||
endElement: IElement | null
|
||||
isReadonly: boolean
|
||||
editorHasSelection: boolean
|
||||
editorTextFocus: boolean
|
||||
isInTable: boolean
|
||||
isCrossRowCol: boolean
|
||||
}
|
||||
|
||||
export interface IRegisterContextMenu {
|
||||
i18nPath?: string;
|
||||
isDivider?: boolean;
|
||||
icon?: string;
|
||||
name?: string;
|
||||
shortCut?: string;
|
||||
when?: (payload: IContextMenuContext) => boolean;
|
||||
callback?: (command: Command, context: IContextMenuContext) => any;
|
||||
childMenus?: IRegisterContextMenu[];
|
||||
i18nPath?: string
|
||||
isDivider?: boolean
|
||||
icon?: string
|
||||
name?: string
|
||||
shortCut?: string
|
||||
when?: (payload: IContextMenuContext) => boolean
|
||||
callback?: (command: Command, context: IContextMenuContext) => any
|
||||
childMenus?: IRegisterContextMenu[]
|
||||
}
|
||||
|
||||
export interface IContextmenuLang {
|
||||
global: {
|
||||
cut: string;
|
||||
copy: string;
|
||||
paste: string;
|
||||
selectAll: string;
|
||||
print: string;
|
||||
};
|
||||
cut: string
|
||||
copy: string
|
||||
paste: string
|
||||
selectAll: string
|
||||
print: string
|
||||
}
|
||||
control: {
|
||||
delete: string;
|
||||
};
|
||||
delete: string
|
||||
}
|
||||
hyperlink: {
|
||||
delete: string;
|
||||
cancel: string;
|
||||
edit: string;
|
||||
};
|
||||
delete: string
|
||||
cancel: string
|
||||
edit: string
|
||||
}
|
||||
image: {
|
||||
change: string;
|
||||
saveAs: string;
|
||||
textWrap: string;
|
||||
change: string
|
||||
saveAs: string
|
||||
textWrap: string
|
||||
textWrapType: {
|
||||
embed: string;
|
||||
upDown: string;
|
||||
embed: string
|
||||
upDown: string
|
||||
}
|
||||
};
|
||||
}
|
||||
table: {
|
||||
insertRowCol: string;
|
||||
insertTopRow: string;
|
||||
insertBottomRow: string;
|
||||
insertLeftCol: string;
|
||||
insertRightCol: string;
|
||||
deleteRowCol: string;
|
||||
deleteRow: string;
|
||||
deleteCol: string;
|
||||
deleteTable: string;
|
||||
mergeCell: string;
|
||||
mergeCancelCell: string;
|
||||
};
|
||||
}
|
||||
insertRowCol: string
|
||||
insertTopRow: string
|
||||
insertBottomRow: string
|
||||
insertLeftCol: string
|
||||
insertRightCol: string
|
||||
deleteRowCol: string
|
||||
deleteRow: string
|
||||
deleteCol: string
|
||||
deleteTable: string
|
||||
mergeCell: string
|
||||
mergeCancelCell: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ import { IDatePickerLang } from '../../core/draw/particle/date/DatePicker'
|
||||
import { IContextmenuLang } from '../contextmenu/ContextMenu'
|
||||
|
||||
export interface ILang {
|
||||
contextmenu: IContextmenuLang;
|
||||
datePicker: IDatePickerLang;
|
||||
contextmenu: IContextmenuLang
|
||||
datePicker: IDatePickerLang
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ import { Command } from '../../core/command/Command'
|
||||
import { KeyMap } from '../../dataset/enum/KeyMap'
|
||||
|
||||
export interface IRegisterShortcut {
|
||||
key: KeyMap;
|
||||
ctrl?: boolean;
|
||||
meta?: boolean;
|
||||
mod?: boolean; // windows:ctrl || mac:command
|
||||
shift?: boolean;
|
||||
alt?: boolean; // windows:alt || mac:option
|
||||
isGlobal?: boolean;
|
||||
callback: (command: Command) => any;
|
||||
}
|
||||
key: KeyMap
|
||||
ctrl?: boolean
|
||||
meta?: boolean
|
||||
mod?: boolean // windows:ctrl || mac:command
|
||||
shift?: boolean
|
||||
alt?: boolean // windows:alt || mac:option
|
||||
isGlobal?: boolean
|
||||
callback: (command: Command) => any
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface IColgroup {
|
||||
id?: string;
|
||||
width: number;
|
||||
}
|
||||
id?: string
|
||||
width: number
|
||||
}
|
||||
|
||||
@@ -3,24 +3,24 @@ import { IElement, IElementPosition } from '../Element'
|
||||
import { IRow } from '../Row'
|
||||
|
||||
export interface ITd {
|
||||
id?: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
colspan: number;
|
||||
rowspan: number;
|
||||
value: IElement[];
|
||||
isLastRowTd?: boolean;
|
||||
isLastColTd?: boolean;
|
||||
isLastTd?: boolean;
|
||||
rowIndex?: number;
|
||||
colIndex?: number;
|
||||
rowList?: IRow[];
|
||||
positionList?: IElementPosition[];
|
||||
verticalAlign?: VerticalAlign;
|
||||
backgroundColor?: string;
|
||||
mainHeight?: number; // 内容 + 内边距高度
|
||||
realHeight?: number; // 真实高度(包含跨列)
|
||||
realMinHeight?: number; // 真实最小高度(包含跨列)
|
||||
}
|
||||
id?: string
|
||||
x?: number
|
||||
y?: number
|
||||
width?: number
|
||||
height?: number
|
||||
colspan: number
|
||||
rowspan: number
|
||||
value: IElement[]
|
||||
isLastRowTd?: boolean
|
||||
isLastColTd?: boolean
|
||||
isLastTd?: boolean
|
||||
rowIndex?: number
|
||||
colIndex?: number
|
||||
rowList?: IRow[]
|
||||
positionList?: IElementPosition[]
|
||||
verticalAlign?: VerticalAlign
|
||||
backgroundColor?: string
|
||||
mainHeight?: number // 内容 + 内边距高度
|
||||
realHeight?: number // 真实高度(包含跨列)
|
||||
realMinHeight?: number // 真实最小高度(包含跨列)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ITd } from './Td'
|
||||
|
||||
export interface ITr {
|
||||
id?: string;
|
||||
height: number;
|
||||
tdList: ITd[];
|
||||
minHeight?: number;
|
||||
}
|
||||
id?: string
|
||||
height: number
|
||||
tdList: ITd[]
|
||||
minHeight?: number
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user