Skip to main content

Class: Form

Hierarchy

  • PreviewUI

    Form

Constructors

constructor

new Form(props)

Parameters

NameType
propsObject
props.domContainerHTMLElement
props.inputsRecord<string, string>[]
props.options?Object
props.options.font?Record<string, { data: ArrayBuffer | Uint8Array ; fallback?: boolean ; subset?: boolean }>
props.options.lang?"en" | "ja"
props.templateObject
props.template.basePdfstring | ArrayBuffer | Uint8Array
props.template.columns?string[]
props.template.sampledata?Record<string, string>[]
props.template.schemasRecord<string, { alignment?: "left" | "center" | "right" ; backgroundColor?: string ; characterSpacing?: number ; fontColor?: string ; fontName?: string ; fontSize?: number ; height: number ; lineHeight?: number ; position: { x: number ; y: number } ; rotate?: number ; type: "text" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "image" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce" ; width: number }>[]

Overrides

PreviewUI.constructor

Defined in

ui/src/Form.tsx:12

Properties

domContainer

Protected domContainer: null | HTMLElement

Inherited from

PreviewUI.domContainer

Defined in

ui/src/class.ts:58


inputs

Protected inputs: { [key: string]: string; }[]

Inherited from

PreviewUI.inputs

Defined in

ui/src/class.ts:143


onChangeInputCallback

Private Optional onChangeInputCallback: (arg: { index: number ; key: string ; value: string }) => void

Type declaration

▸ (arg): void

Parameters
NameType
argObject
arg.indexnumber
arg.keystring
arg.valuestring
Returns

void

Defined in

ui/src/Form.tsx:10


size

Protected size: Object

Type declaration

NameType
heightnumber
widthnumber

Inherited from

PreviewUI.size

Defined in

ui/src/class.ts:62


template

Protected template: Object

Type declaration

NameType
basePdfstring | ArrayBuffer | Uint8Array
columns?string[]
sampledata?Record<string, string>[]
schemasRecord<string, { alignment?: "left" | "center" | "right" ; backgroundColor?: string ; characterSpacing?: number ; fontColor?: string ; fontName?: string ; fontSize?: number ; height: number ; lineHeight?: number ; position: { x: number ; y: number } ; rotate?: number ; type: "text" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "image" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce" ; width: number }>[]

Inherited from

PreviewUI.template

Defined in

ui/src/class.ts:60

Methods

destroy

destroy(): void

Returns

void

Inherited from

PreviewUI.destroy

Defined in

ui/src/class.ts:133


getFont

Protected getFont(): Record<string, { data: ArrayBuffer | Uint8Array ; fallback?: boolean ; subset?: boolean }>

Returns

Record<string, { data: ArrayBuffer | Uint8Array ; fallback?: boolean ; subset?: boolean }>

Inherited from

PreviewUI.getFont

Defined in

ui/src/class.ts:102


getI18n

Protected getI18n(): (key: "field" | "cancel" | "fieldName" | "require" | "uniq" | "inputExample" | "edit" | "plsSelect" | "plsInputName" | "plsAddNewField" | "fieldMustUniq" | "notUniq" | "noKeyName" | "fieldsList" | "addNewField" | "editField" | "type" | "goToFirst" | "goToPrevious" | "goToNext" | "goToEnd" | "select" | "zoomIn" | "zoomOut" | "errorOccurred" | "errorBulkUpdateFieldName" | "commitBulkUpdateFieldName" | "bulkUpdateFieldName") => string

Returns

fn

▸ (key): string

Parameters
NameType
key"field" | "cancel" | "fieldName" | "require" | "uniq" | "inputExample" | "edit" | "plsSelect" | "plsInputName" | "plsAddNewField" | "fieldMustUniq" | "notUniq" | "noKeyName" | "fieldsList" | "addNewField" | "editField" | "type" | "goToFirst" | "goToPrevious" | "goToNext" | "goToEnd" | "select" | "zoomIn" | "zoomOut" | "errorOccurred" | "errorBulkUpdateFieldName" | "commitBulkUpdateFieldName" | "bulkUpdateFieldName"
Returns

string

Inherited from

PreviewUI.getI18n

Defined in

ui/src/class.ts:98


getInputs

getInputs(): { [key: string]: string; }[]

Returns

{ [key: string]: string; }[]

Inherited from

PreviewUI.getInputs

Defined in

ui/src/class.ts:152


getTemplate

getTemplate(): Object

Returns

Object

NameType
basePdfstring | ArrayBuffer | Uint8Array
columns?string[]
sampledata?Record<string, string>[]
schemasRecord<string, { alignment?: "left" | "center" | "right" ; backgroundColor?: string ; characterSpacing?: number ; fontColor?: string ; fontName?: string ; fontSize?: number ; height: number ; lineHeight?: number ; position: { x: number ; y: number } ; rotate?: number ; type: "text" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "image" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce" ; width: number }>[]

Inherited from

PreviewUI.getTemplate

Defined in

ui/src/class.ts:106


onChangeInput

onChangeInput(cb): void

Parameters

NameType
cb(arg: { index: number ; key: string ; value: string }) => void

Returns

void

Defined in

ui/src/Form.tsx:17


render

Protected render(): void

Returns

void

Overrides

PreviewUI.render

Defined in

ui/src/Form.tsx:21


setInputs

setInputs(inputs): void

Parameters

NameType
inputs{ [key: string]: string; }[]

Returns

void

Inherited from

PreviewUI.setInputs

Defined in

ui/src/class.ts:158


updateOptions

updateOptions(options): void

Parameters

NameType
optionsObject
options.font?Record<string, { data: ArrayBuffer | Uint8Array ; fallback?: boolean ; subset?: boolean }>
options.lang?"en" | "ja"

Returns

void

Inherited from

PreviewUI.updateOptions

Defined in

ui/src/class.ts:120


updateTemplate

updateTemplate(template): void

Parameters

NameType
templateObject
template.basePdfstring | ArrayBuffer | Uint8Array
template.columns?string[]
template.sampledata?Record<string, string>[]
template.schemasRecord<string, { alignment?: "left" | "center" | "right" ; backgroundColor?: string ; characterSpacing?: number ; fontColor?: string ; fontName?: string ; fontSize?: number ; height: number ; lineHeight?: number ; position: { x: number ; y: number } ; rotate?: number ; type: "text" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "image" ; width: number } | { height: number ; position: { x: number ; y: number } ; rotate?: number ; type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce" ; width: number }>[]

Returns

void

Inherited from

PreviewUI.updateTemplate

Defined in

ui/src/class.ts:112