@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
162 lines • 7.72 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Field = void 0;
const index_1 = require("./../index");
class Field {
constructor(data) {
let alternateNameDefault = "";
this.alternateName = typeof (data === null || data === void 0 ? void 0 : data.alternateName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.alternateName : alternateNameDefault;
this.annotation = (data.annotation || []).map(index_1.Annotation.fromJson);
let contentDefault = "";
this.content = typeof (data === null || data === void 0 ? void 0 : data.content) !== "undefined" ? data === null || data === void 0 ? void 0 : data.content : contentDefault;
let fullyQualifiedNameDefault = "";
this.fullyQualifiedName = typeof (data === null || data === void 0 ? void 0 : data.fullyQualifiedName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fullyQualifiedName : fullyQualifiedNameDefault;
let isRichTextDefault = false;
this.isRichText = typeof (data === null || data === void 0 ? void 0 : data.isRichText) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isRichText : isRichTextDefault;
let mappingNameDefault = "";
this.mappingName = typeof (data === null || data === void 0 ? void 0 : data.mappingName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.mappingName : mappingNameDefault;
let multiSelectDefault = false;
this.multiSelect = typeof (data === null || data === void 0 ? void 0 : data.multiSelect) !== "undefined" ? data === null || data === void 0 ? void 0 : data.multiSelect : multiSelectDefault;
let nameDefault = "";
this.name = typeof (data === null || data === void 0 ? void 0 : data.name) !== "undefined" ? data === null || data === void 0 ? void 0 : data.name : nameDefault;
let noExportDefault = false;
this.noExport = typeof (data === null || data === void 0 ? void 0 : data.noExport) !== "undefined" ? data === null || data === void 0 ? void 0 : data.noExport : noExportDefault;
let objectKeyDefault = "";
this.objectKey = typeof (data === null || data === void 0 ? void 0 : data.objectKey) !== "undefined" ? data === null || data === void 0 ? void 0 : data.objectKey : objectKeyDefault;
let readOnlyDefault = false;
this.readOnly = typeof (data === null || data === void 0 ? void 0 : data.readOnly) !== "undefined" ? data === null || data === void 0 ? void 0 : data.readOnly : readOnlyDefault;
let requiredDefault = false;
this.required = typeof (data === null || data === void 0 ? void 0 : data.required) !== "undefined" ? data === null || data === void 0 ? void 0 : data.required : requiredDefault;
this.signature = index_1.MetadataSignature.fromJson(data === null || data === void 0 ? void 0 : data.signature);
let subTypeDefault = "";
this.subType = typeof (data === null || data === void 0 ? void 0 : data.subType) !== "undefined" ? data === null || data === void 0 ? void 0 : data.subType : subTypeDefault;
let typeDefault = "";
this.type = typeof (data === null || data === void 0 ? void 0 : data.type) !== "undefined" ? data === null || data === void 0 ? void 0 : data.type : typeDefault;
this.value = (data.value || []).map(index_1.FormValueStyle.fromJson);
}
static getAlternateNameDefault() {
return "";
}
static getAlternateNameDescription() {
return "The alternate name of the form field.";
}
static getAnnotationDefault() {
return [];
}
static getAnnotationDescription() {
return "Selects the visible representation (widget annotation) for the form field.";
}
static getContentDefault() {
return "";
}
static getContentDescription() {
return "The textual content of the form field. A single string or a comma-separated list of string values for list types.";
}
static getFullyQualifiedNameDefault() {
return "";
}
static getFullyQualifiedNameDescription() {
return "The fully qualified name of the form field.";
}
static getIsRichTextDefault() {
return false;
}
static getIsRichTextDescription() {
return "When set to true, the field contains rich text formatted content.";
}
static getMappingNameDefault() {
return "";
}
static getMappingNameDescription() {
return "The mapping name of the form field.";
}
static getMultiSelectDefault() {
return false;
}
static getMultiSelectDescription() {
return "When set to true, the form field allows multiple items to be seleted.";
}
static getNameDefault() {
return "";
}
static getNameDescription() {
return "The partial name of the form field.";
}
static getNoExportDefault() {
return false;
}
static getNoExportDescription() {
return "When set to true, the form field shall not be included in exports of the document's form data.";
}
static getObjectKeyDefault() {
return "";
}
static getObjectKeyDescription() {
return "The object ID of the form field. **Info:** A PDF object ID consists of two numbers, where the first number selects the object's number and the second the \"generation\" of the object. The object ID shall always be unique within the context of the document and can be used to select a specific object.";
}
static getReadOnlyDefault() {
return false;
}
static getReadOnlyDescription() {
return "When set to true, the form field's contents may be displayed but not altered.";
}
static getRequiredDefault() {
return false;
}
static getRequiredDescription() {
return "When set to true, the form field must be filled in.";
}
static getSignatureDescription() {
return "";
}
static getSubTypeDefault() {
return "";
}
static getSubTypeDescription() {
return "The implementation name of the the form field.";
}
static getTypeDefault() {
return "";
}
static getTypeDescription() {
return "Indicates the type of the form field.\n\n* Btn = Button\n* Tx = Textfield\n* Ch = Choicefield\n* Sig = Signaturefield";
}
static getValueDefault() {
return [];
}
static getValueDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new Field(data);
}
toJson() {
var _a, _b, _c;
return {
'alternateName': this.alternateName,
'annotation': (_a = this.annotation) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()),
'content': this.content,
'fullyQualifiedName': this.fullyQualifiedName,
'isRichText': this.isRichText,
'mappingName': this.mappingName,
'multiSelect': this.multiSelect,
'name': this.name,
'noExport': this.noExport,
'objectKey': this.objectKey,
'readOnly': this.readOnly,
'required': this.required,
'signature': (_b = this.signature) === null || _b === void 0 ? void 0 : _b.toJson(),
'subType': this.subType,
'type': this.type,
'value': (_c = this.value) === null || _c === void 0 ? void 0 : _c.map((data) => data.toJson()),
};
}
clone() {
return Field.fromJson(this.toJson());
}
}
exports.Field = Field;
//# sourceMappingURL=Field.js.map