123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768 |
- /**
- * @licstart The following is the entire license notice for the
- * Javascript code in this page
- *
- * Copyright 2021 Mozilla Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @licend The above is the entire license notice for the
- * Javascript code in this page
- */
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.Value = exports.Text = exports.TemplateNamespace = exports.Template = exports.SetProperty = exports.Items = exports.Field = exports.BindItems = void 0;
- var _xfa_object = require("./xfa_object.js");
- var _namespaces = require("./namespaces.js");
- var _utils = require("./utils.js");
- var _html_utils = require("./html_utils.js");
- var _util = require("../../shared/util.js");
- const TEMPLATE_NS_ID = _namespaces.NamespaceIds.template.id;
- function _setValue(templateNode, value) {
- if (!templateNode.value) {
- const nodeValue = new Value({});
- templateNode[_xfa_object.$appendChild](nodeValue);
- templateNode.value = nodeValue;
- }
- templateNode.value[_xfa_object.$setValue](value);
- }
- class AppearanceFilter extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "appearanceFilter");
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Arc extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "arc", true);
- this.circular = (0, _utils.getInteger)({
- data: attributes.circular,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.hand = (0, _utils.getStringOption)(attributes.hand, ["even", "left", "right"]);
- this.id = attributes.id || "";
- this.startAngle = (0, _utils.getFloat)({
- data: attributes.startAngle,
- defaultValue: 0,
- validate: x => true
- });
- this.sweepAngle = (0, _utils.getFloat)({
- data: attributes.sweepAngle,
- defaultValue: 360,
- validate: x => true
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.edge = null;
- this.fill = null;
- }
- }
- class Area extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "area", true);
- this.colSpan = (0, _utils.getInteger)({
- data: attributes.colSpan,
- defaultValue: 1,
- validate: n => n >= 1
- });
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.x = (0, _utils.getMeasurement)(attributes.x, "0pt");
- this.y = (0, _utils.getMeasurement)(attributes.y, "0pt");
- this.desc = null;
- this.extras = null;
- this.area = new _xfa_object.XFAObjectArray();
- this.draw = new _xfa_object.XFAObjectArray();
- this.exObject = new _xfa_object.XFAObjectArray();
- this.exclGroup = new _xfa_object.XFAObjectArray();
- this.field = new _xfa_object.XFAObjectArray();
- this.subform = new _xfa_object.XFAObjectArray();
- this.subformSet = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$isTransparent]() {
- return true;
- }
- }
- class Assist extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "assist", true);
- this.id = attributes.id || "";
- this.role = attributes.role || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.speak = null;
- this.toolTip = null;
- }
- }
- class Barcode extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "barcode", true);
- this.charEncoding = (0, _utils.getKeyword)({
- data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "",
- defaultValue: "",
- validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-[0-9]{2}/)
- });
- this.checksum = (0, _utils.getStringOption)(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]);
- this.dataColumnCount = (0, _utils.getInteger)({
- data: attributes.dataColumnCount,
- defaultValue: -1,
- validate: x => x >= 0
- });
- this.dataLength = (0, _utils.getInteger)({
- data: attributes.dataLength,
- defaultValue: -1,
- validate: x => x >= 0
- });
- this.dataPrep = (0, _utils.getStringOption)(attributes.dataPrep, ["none", "flateCompress"]);
- this.dataRowCount = (0, _utils.getInteger)({
- data: attributes.dataRowCount,
- defaultValue: -1,
- validate: x => x >= 0
- });
- this.endChar = attributes.endChar || "";
- this.errorCorrectionLevel = (0, _utils.getInteger)({
- data: attributes.errorCorrectionLevel,
- defaultValue: -1,
- validate: x => x >= 0 && x <= 8
- });
- this.id = attributes.id || "";
- this.moduleHeight = (0, _utils.getMeasurement)(attributes.moduleHeight, "5mm");
- this.moduleWidth = (0, _utils.getMeasurement)(attributes.moduleWidth, "0.25mm");
- this.printCheckDigit = (0, _utils.getInteger)({
- data: attributes.printCheckDigit,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.rowColumnRatio = (0, _utils.getRatio)(attributes.rowColumnRatio);
- this.startChar = attributes.startChar || "";
- this.textLocation = (0, _utils.getStringOption)(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]);
- this.truncate = (0, _utils.getInteger)({
- data: attributes.truncate,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.type = (0, _utils.getStringOption)(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]);
- this.upsMode = (0, _utils.getStringOption)(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.wideNarrowRatio = (0, _utils.getRatio)(attributes.wideNarrowRatio);
- this.encrypt = null;
- this.extras = null;
- }
- }
- class Bind extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "bind", true);
- this.match = (0, _utils.getStringOption)(attributes.match, ["once", "dataRef", "global", "none"]);
- this.ref = attributes.ref || "";
- this.picture = null;
- }
- }
- class BindItems extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "bindItems");
- this.connection = attributes.connection || "";
- this.labelRef = attributes.labelRef || "";
- this.ref = attributes.ref || "";
- this.valueRef = attributes.valueRef || "";
- }
- }
- exports.BindItems = BindItems;
- class Bookend extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "bookend");
- this.id = attributes.id || "";
- this.leader = attributes.leader || "";
- this.trailer = attributes.trailer || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class BooleanElement extends _xfa_object.Option01 {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "boolean");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content] === 1;
- }
- }
- class Border extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "border", true);
- this.break = (0, _utils.getStringOption)(attributes.break, ["close", "open"]);
- this.hand = (0, _utils.getStringOption)(attributes.hand, ["even", "left", "right"]);
- this.id = attributes.id || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.corner = new _xfa_object.XFAObjectArray(4);
- this.edge = new _xfa_object.XFAObjectArray(4);
- this.extras = null;
- this.fill = null;
- this.margin = null;
- }
- [_xfa_object.$toStyle](widths, margins) {
- const edgeStyles = this.edge.children.map(node => node[_xfa_object.$toStyle]());
- const cornerStyles = this.edge.children.map(node => node[_xfa_object.$toStyle]());
- let style;
- if (this.margin) {
- style = this.margin[_xfa_object.$toStyle]();
- if (margins) {
- margins.push(this.margin.topInset, this.margin.rightInset, this.margin.bottomInset, this.margin.leftInset);
- }
- } else {
- style = Object.create(null);
- if (margins) {
- margins.push(0, 0, 0, 0);
- }
- }
- if (this.fill) {
- Object.assign(style, this.fill[_xfa_object.$toStyle]());
- }
- if (edgeStyles.length > 0) {
- if (widths) {
- this.edge.children.forEach(node => widths.push(node.thickness));
- if (widths.length < 4) {
- const last = widths[widths.length - 1];
- for (let i = widths.length; i < 4; i++) {
- widths.push(last);
- }
- }
- }
- if (edgeStyles.length === 2 || edgeStyles.length === 3) {
- const last = edgeStyles[edgeStyles.length - 1];
- for (let i = edgeStyles.length; i < 4; i++) {
- edgeStyles.push(last);
- }
- }
- style.borderWidth = edgeStyles.map(s => s.width).join(" ");
- style.borderColor = edgeStyles.map(s => s.color).join(" ");
- style.borderStyle = edgeStyles.map(s => s.style).join(" ");
- } else {
- if (widths) {
- widths.push(0, 0, 0, 0);
- }
- }
- if (cornerStyles.length > 0) {
- if (cornerStyles.length === 2 || cornerStyles.length === 3) {
- const last = cornerStyles[cornerStyles.length - 1];
- for (let i = cornerStyles.length; i < 4; i++) {
- cornerStyles.push(last);
- }
- }
- style.borderRadius = cornerStyles.map(s => s.radius).join(" ");
- }
- switch (this.presence) {
- case "invisible":
- case "hidden":
- style.borderStyle = "";
- break;
- case "inactive":
- style.borderStyle = "none";
- break;
- }
- return style;
- }
- }
- class Break extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "break", true);
- this.after = (0, _utils.getStringOption)(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
- this.afterTarget = attributes.afterTarget || "";
- this.before = (0, _utils.getStringOption)(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
- this.beforeTarget = attributes.beforeTarget || "";
- this.bookendLeader = attributes.bookendLeader || "";
- this.bookendTrailer = attributes.bookendTrailer || "";
- this.id = attributes.id || "";
- this.overflowLeader = attributes.overflowLeader || "";
- this.overflowTarget = attributes.overflowTarget || "";
- this.overflowTrailer = attributes.overflowTrailer || "";
- this.startNew = (0, _utils.getInteger)({
- data: attributes.startNew,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- }
- class BreakAfter extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "breakAfter", true);
- this.id = attributes.id || "";
- this.leader = attributes.leader || "";
- this.startNew = (0, _utils.getInteger)({
- data: attributes.startNew,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.target = attributes.target || "";
- this.targetType = (0, _utils.getStringOption)(attributes.targetType, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
- this.trailer = attributes.trailer || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.script = null;
- }
- }
- class BreakBefore extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "breakBefore", true);
- this.id = attributes.id || "";
- this.leader = attributes.leader || "";
- this.startNew = (0, _utils.getInteger)({
- data: attributes.startNew,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.target = attributes.target || "";
- this.targetType = (0, _utils.getStringOption)(attributes.targetType, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
- this.trailer = attributes.trailer || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.script = null;
- }
- }
- class Button extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "button", true);
- this.highlight = (0, _utils.getStringOption)(attributes.highlight, ["inverted", "none", "outline", "push"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- [_xfa_object.$toHTML]() {
- return {
- name: "button",
- attributes: {
- class: "xfaButton",
- style: {}
- }
- };
- }
- }
- class Calculate extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "calculate", true);
- this.id = attributes.id || "";
- this.override = (0, _utils.getStringOption)(attributes.override, ["disabled", "error", "ignore", "warning"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.message = null;
- this.script = null;
- }
- }
- class Caption extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "caption", true);
- this.id = attributes.id || "";
- this.placement = (0, _utils.getStringOption)(attributes.placement, ["left", "bottom", "inline", "right", "top"]);
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.reserve = (0, _utils.getMeasurement)(attributes.reserve);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.font = null;
- this.margin = null;
- this.para = null;
- this.value = null;
- }
- [_xfa_object.$setValue](value) {
- _setValue(this, value);
- }
- [_xfa_object.$toHTML]() {
- if (!this.value) {
- return null;
- }
- const value = this.value[_xfa_object.$toHTML]();
- if (!value) {
- return null;
- }
- const children = [];
- if (typeof value === "string") {
- children.push({
- name: "#text",
- value
- });
- } else {
- children.push(value);
- }
- const style = (0, _html_utils.toStyle)(this, "font", "margin", "para", "visibility");
- switch (this.placement) {
- case "left":
- case "right":
- style.minWidth = (0, _html_utils.measureToString)(this.reserve);
- break;
- case "top":
- case "bottom":
- style.minHeight = (0, _html_utils.measureToString)(this.reserve);
- break;
- }
- return {
- name: "div",
- attributes: {
- style
- },
- children
- };
- }
- }
- class Certificate extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "certificate");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Certificates extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "certificates", true);
- this.credentialServerPolicy = (0, _utils.getStringOption)(attributes.credentialServerPolicy, ["optional", "required"]);
- this.id = attributes.id || "";
- this.url = attributes.url || "";
- this.urlPolicy = attributes.urlPolicy || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.encryption = null;
- this.issuers = null;
- this.keyUsage = null;
- this.oids = null;
- this.signing = null;
- this.subjectDNs = null;
- }
- }
- class CheckButton extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "checkButton", true);
- this.id = attributes.id || "";
- this.mark = (0, _utils.getStringOption)(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]);
- this.shape = (0, _utils.getStringOption)(attributes.shape, ["square", "round"]);
- this.size = (0, _utils.getMeasurement)(attributes.size, "10pt");
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.extras = null;
- this.margin = null;
- }
- [_xfa_object.$toHTML]() {
- const style = (0, _html_utils.toStyle)(this, "border", "margin");
- const size = (0, _html_utils.measureToString)(this.size);
- style.width = style.height = size;
- let mark, radius;
- if (this.shape === "square") {
- mark = "■";
- radius = "10%";
- } else {
- mark = "●";
- radius = "50%";
- }
- if (!style.borderRadius) {
- style.borderRadius = radius;
- }
- if (this.mark !== "default") {
- switch (this.mark) {
- case "check":
- mark = "✓";
- break;
- case "circle":
- mark = "●";
- break;
- case "cross":
- mark = "✕";
- break;
- case "diamond":
- mark = "♦";
- break;
- case "square":
- mark = "■";
- break;
- case "star":
- mark = "★";
- break;
- }
- }
- if (size !== "10px") {
- style.fontSize = size;
- style.lineHeight = size;
- style.width = size;
- style.height = size;
- }
- return {
- name: "label",
- attributes: {
- class: "xfaLabel"
- },
- children: [{
- name: "input",
- attributes: {
- class: "xfaCheckbox",
- type: "checkbox"
- }
- }, {
- name: "span",
- attributes: {
- class: "xfaCheckboxMark",
- mark,
- style
- }
- }]
- };
- }
- }
- class ChoiceList extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "choiceList", true);
- this.commitOn = (0, _utils.getStringOption)(attributes.commitOn, ["select", "exit"]);
- this.id = attributes.id || "";
- this.open = (0, _utils.getStringOption)(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]);
- this.textEntry = (0, _utils.getInteger)({
- data: attributes.textEntry,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.extras = null;
- this.margin = null;
- }
- [_xfa_object.$toHTML]() {
- const style = (0, _html_utils.toStyle)(this, "border", "margin");
- return {
- name: "label",
- attributes: {
- class: "xfaLabel"
- },
- children: [{
- name: "select",
- attributes: {
- class: "xfaSxelect",
- multiple: this.open === "multiSelect",
- style
- }
- }]
- };
- }
- }
- class Color extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "color", true);
- this.cSpace = (0, _utils.getStringOption)(attributes.cSpace, ["SRGB"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.value = (0, _utils.getColor)(attributes.value);
- this.extras = null;
- }
- [_xfa_object.$hasSettableValue]() {
- return false;
- }
- [_xfa_object.$toStyle]() {
- return _util.Util.makeHexColor(this.value.r, this.value.g, this.value.b);
- }
- }
- class Comb extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "comb");
- this.id = attributes.id || "";
- this.numberOfCells = (0, _utils.getInteger)({
- data: attributes.numberOfCells,
- defaultValue: 0,
- validate: x => x >= 0
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Connect extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "connect", true);
- this.connection = attributes.connection || "";
- this.id = attributes.id || "";
- this.ref = attributes.ref || "";
- this.usage = (0, _utils.getStringOption)(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.picture = null;
- }
- }
- class ContentArea extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "contentArea", true);
- this.h = (0, _utils.getMeasurement)(attributes.h);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.w = (0, _utils.getMeasurement)(attributes.w);
- this.x = (0, _utils.getMeasurement)(attributes.x, "0pt");
- this.y = (0, _utils.getMeasurement)(attributes.y, "0pt");
- this.desc = null;
- this.extras = null;
- }
- [_xfa_object.$toHTML]() {
- const left = (0, _html_utils.measureToString)(this.x);
- const top = (0, _html_utils.measureToString)(this.y);
- const style = {
- position: "absolute",
- left,
- top,
- width: (0, _html_utils.measureToString)(this.w),
- height: (0, _html_utils.measureToString)(this.h)
- };
- return {
- name: "div",
- children: [],
- attributes: {
- style,
- class: "xfaContentarea",
- id: this[_xfa_object.$uid]
- }
- };
- }
- }
- class Corner extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "corner", true);
- this.id = attributes.id || "";
- this.inverted = (0, _utils.getInteger)({
- data: attributes.inverted,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.join = (0, _utils.getStringOption)(attributes.join, ["square", "round"]);
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.radius = (0, _utils.getMeasurement)(attributes.radius);
- this.stroke = (0, _utils.getStringOption)(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
- this.thickness = (0, _utils.getMeasurement)(attributes.thickness, "0.5pt");
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- }
- [_xfa_object.$toStyle]() {
- const style = (0, _html_utils.toStyle)(this, "visibility");
- style.radius = (0, _html_utils.measureToString)(this.radius);
- return style;
- }
- }
- class DateElement extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "date");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- this[_xfa_object.$content] = new Date(this[_xfa_object.$content].trim());
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content].toString();
- }
- }
- class DateTime extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "dateTime");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- this[_xfa_object.$content] = new Date(this[_xfa_object.$content].trim());
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content].toString();
- }
- }
- class DateTimeEdit extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "dateTimeEdit", true);
- this.hScrollPolicy = (0, _utils.getStringOption)(attributes.hScrollPolicy, ["auto", "off", "on"]);
- this.id = attributes.id || "";
- this.picker = (0, _utils.getStringOption)(attributes.picker, ["host", "none"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.comb = null;
- this.extras = null;
- this.margin = null;
- }
- [_xfa_object.$toHTML]() {
- const style = (0, _html_utils.toStyle)(this, "border", "font", "margin");
- const html = {
- name: "input",
- attributes: {
- type: "text",
- class: "xfaTextfield",
- style
- }
- };
- return {
- name: "label",
- attributes: {
- class: "xfaLabel"
- },
- children: [html]
- };
- }
- }
- class Decimal extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "decimal");
- this.fracDigits = (0, _utils.getInteger)({
- data: attributes.fracDigits,
- defaultValue: 2,
- validate: x => true
- });
- this.id = attributes.id || "";
- this.leadDigits = (0, _utils.getInteger)({
- data: attributes.leadDigits,
- defaultValue: -1,
- validate: x => true
- });
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- const number = parseFloat(this[_xfa_object.$content].trim());
- this[_xfa_object.$content] = isNaN(number) ? null : number;
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content] !== null ? this[_xfa_object.$content].toString() : "";
- }
- }
- class DefaultUi extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "defaultUi", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- }
- class Desc extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "desc", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.boolean = new _xfa_object.XFAObjectArray();
- this.date = new _xfa_object.XFAObjectArray();
- this.dateTime = new _xfa_object.XFAObjectArray();
- this.decimal = new _xfa_object.XFAObjectArray();
- this.exData = new _xfa_object.XFAObjectArray();
- this.float = new _xfa_object.XFAObjectArray();
- this.image = new _xfa_object.XFAObjectArray();
- this.integer = new _xfa_object.XFAObjectArray();
- this.text = new _xfa_object.XFAObjectArray();
- this.time = new _xfa_object.XFAObjectArray();
- }
- }
- class DigestMethod extends _xfa_object.OptionObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class DigestMethods extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "digestMethods", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.digestMethod = new _xfa_object.XFAObjectArray();
- }
- }
- class Draw extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "draw", true);
- this.anchorType = (0, _utils.getStringOption)(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
- this.colSpan = (0, _utils.getInteger)({
- data: attributes.colSpan,
- defaultValue: 1,
- validate: x => x >= 1
- });
- this.h = attributes.h ? (0, _utils.getMeasurement)(attributes.h) : "";
- this.hAlign = (0, _utils.getStringOption)(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
- this.id = attributes.id || "";
- this.locale = attributes.locale || "";
- this.maxH = (0, _utils.getMeasurement)(attributes.maxH, "0pt");
- this.maxW = (0, _utils.getMeasurement)(attributes.maxW, "0pt");
- this.minH = (0, _utils.getMeasurement)(attributes.minH, "0pt");
- this.minW = (0, _utils.getMeasurement)(attributes.minW, "0pt");
- this.name = attributes.name || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.rotate = (0, _utils.getInteger)({
- data: attributes.rotate,
- defaultValue: 0,
- validate: x => x % 90 === 0
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.w = attributes.w ? (0, _utils.getMeasurement)(attributes.w) : "";
- this.x = (0, _utils.getMeasurement)(attributes.x, "0pt");
- this.y = (0, _utils.getMeasurement)(attributes.y, "0pt");
- this.assist = null;
- this.border = null;
- this.caption = null;
- this.desc = null;
- this.extras = null;
- this.font = null;
- this.keep = null;
- this.margin = null;
- this.para = null;
- this.traversal = null;
- this.ui = null;
- this.value = null;
- this.setProperty = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$setValue](value) {
- _setValue(this, value);
- }
- [_xfa_object.$toHTML]() {
- if (!this.value) {
- return null;
- }
- const style = (0, _html_utils.toStyle)(this, "font", "dimensions", "position", "presence", "rotate", "anchorType");
- const clazz = ["xfaDraw"];
- if (this.font) {
- clazz.push("xfaFont");
- }
- const attributes = {
- style,
- id: this[_xfa_object.$uid],
- class: clazz.join(" ")
- };
- if (this.name) {
- attributes.xfaName = this.name;
- }
- return {
- name: "div",
- attributes,
- children: []
- };
- }
- }
- class Edge extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "edge", true);
- this.cap = (0, _utils.getStringOption)(attributes.cap, ["square", "butt", "round"]);
- this.id = attributes.id || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.stroke = (0, _utils.getStringOption)(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
- this.thickness = (0, _utils.getMeasurement)(attributes.thickness, "0.5pt");
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- }
- [_xfa_object.$toStyle]() {
- const style = (0, _html_utils.toStyle)(this, "visibility");
- Object.assign(style, {
- linecap: this.cap,
- width: (0, _html_utils.measureToString)(this.thickness),
- color: this.color ? this.color[_xfa_object.$toHTML]() : "#000000",
- style: ""
- });
- if (this.presence !== "visible") {
- style.style = "none";
- } else {
- switch (this.stroke) {
- case "solid":
- style.style = "solid";
- break;
- case "dashDot":
- style.style = "dashed";
- break;
- case "dashDotDot":
- style.style = "dashed";
- break;
- case "dashed":
- style.style = "dashed";
- break;
- case "dotted":
- style.style = "dotted";
- break;
- case "embossed":
- style.style = "ridge";
- break;
- case "etched":
- style.style = "groove";
- break;
- case "lowered":
- style.style = "inset";
- break;
- case "raised":
- style.style = "outset";
- break;
- }
- }
- return style;
- }
- }
- class Encoding extends _xfa_object.OptionObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Encodings extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encodings", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.encoding = new _xfa_object.XFAObjectArray();
- }
- }
- class Encrypt extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encrypt", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.certificate = null;
- }
- }
- class EncryptData extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encryptData", true);
- this.id = attributes.id || "";
- this.operation = (0, _utils.getStringOption)(attributes.operation, ["encrypt", "decrypt"]);
- this.target = attributes.target || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.filter = null;
- this.manifest = null;
- }
- }
- class Encryption extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encryption", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.certificate = new _xfa_object.XFAObjectArray();
- }
- }
- class EncryptionMethod extends _xfa_object.OptionObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class EncryptionMethods extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "encryptionMethods", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.encryptionMethod = new _xfa_object.XFAObjectArray();
- }
- }
- class Event extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "event", true);
- this.activity = (0, _utils.getStringOption)(attributes.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]);
- this.id = attributes.id || "";
- this.listen = (0, _utils.getStringOption)(attributes.listen, ["refOnly", "refAndDescendents"]);
- this.name = attributes.name || "";
- this.ref = attributes.ref || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.encryptData = null;
- this.execute = null;
- this.script = null;
- this.signData = null;
- this.submit = null;
- }
- }
- class ExData extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "exData");
- this.contentType = attributes.contentType || "";
- this.href = attributes.href || "";
- this.id = attributes.id || "";
- this.maxLength = (0, _utils.getInteger)({
- data: attributes.maxLength,
- defaultValue: -1,
- validate: x => x >= -1
- });
- this.name = attributes.name || "";
- this.rid = attributes.rid || "";
- this.transferEncoding = (0, _utils.getStringOption)(attributes.transferEncoding, ["none", "base64", "package"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$onChild](child) {
- if (this.contentType === "text/html" && child[_xfa_object.$namespaceId] === _namespaces.NamespaceIds.xhtml.id) {
- this[_xfa_object.$content] = child;
- return true;
- }
- if (this.contentType === "text/xml") {
- this[_xfa_object.$content] = child;
- return true;
- }
- return false;
- }
- }
- class ExObject extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "exObject", true);
- this.archive = attributes.archive || "";
- this.classId = attributes.classId || "";
- this.codeBase = attributes.codeBase || "";
- this.codeType = attributes.codeType || "";
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.boolean = new _xfa_object.XFAObjectArray();
- this.date = new _xfa_object.XFAObjectArray();
- this.dateTime = new _xfa_object.XFAObjectArray();
- this.decimal = new _xfa_object.XFAObjectArray();
- this.exData = new _xfa_object.XFAObjectArray();
- this.exObject = new _xfa_object.XFAObjectArray();
- this.float = new _xfa_object.XFAObjectArray();
- this.image = new _xfa_object.XFAObjectArray();
- this.integer = new _xfa_object.XFAObjectArray();
- this.text = new _xfa_object.XFAObjectArray();
- this.time = new _xfa_object.XFAObjectArray();
- }
- }
- class ExclGroup extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "exclGroup", true);
- this.access = (0, _utils.getStringOption)(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
- this.accessKey = attributes.accessKey || "";
- this.anchorType = (0, _utils.getStringOption)(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
- this.colSpan = (0, _utils.getInteger)({
- data: attributes.colSpan,
- defaultValue: 1,
- validate: x => x >= 1
- });
- this.h = attributes.h ? (0, _utils.getMeasurement)(attributes.h) : "";
- this.hAlign = (0, _utils.getStringOption)(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
- this.id = attributes.id || "";
- this.layout = (0, _utils.getStringOption)(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]);
- this.maxH = (0, _utils.getMeasurement)(attributes.maxH, "0pt");
- this.maxW = (0, _utils.getMeasurement)(attributes.maxW, "0pt");
- this.minH = (0, _utils.getMeasurement)(attributes.minH, "0pt");
- this.minW = (0, _utils.getMeasurement)(attributes.minW, "0pt");
- this.name = attributes.name || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.w = attributes.w ? (0, _utils.getMeasurement)(attributes.w) : "";
- this.x = (0, _utils.getMeasurement)(attributes.x, "0pt");
- this.y = (0, _utils.getMeasurement)(attributes.y, "0pt");
- this.assist = null;
- this.bind = null;
- this.border = null;
- this.calculate = null;
- this.caption = null;
- this.desc = null;
- this.extras = null;
- this.margin = null;
- this.para = null;
- this.traversal = null;
- this.validate = null;
- this.connect = new _xfa_object.XFAObjectArray();
- this.event = new _xfa_object.XFAObjectArray();
- this.field = new _xfa_object.XFAObjectArray();
- this.setProperty = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$hasSettableValue]() {
- return true;
- }
- [_xfa_object.$setValue](value) {
- for (const field of this.field.children) {
- if (!field.value) {
- const nodeValue = new Value({});
- field[_xfa_object.$appendChild](nodeValue);
- field.value = nodeValue;
- }
- const nodeBoolean = new BooleanElement({});
- nodeBoolean[_xfa_object.$content] = 0;
- for (const item of field.items.children) {
- if (item[_xfa_object.$hasItem](value)) {
- nodeBoolean[_xfa_object.$content] = 1;
- break;
- }
- }
- field.value[_xfa_object.$setValue](nodeBoolean);
- }
- }
- [_xfa_object.$toHTML]() {
- if (!this.value) {
- return null;
- }
- const style = (0, _html_utils.toStyle)(this, "dimensions", "position", "anchorType");
- const attributes = {
- style,
- id: this[_xfa_object.$uid],
- class: "xfaExclgroup"
- };
- const children = this[_xfa_object.$childrenToHTML]({
- filter: new Set(["field"]),
- include: true
- });
- return {
- name: "div",
- attributes,
- children
- };
- }
- }
- class Execute extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "execute");
- this.connection = attributes.connection || "";
- this.executeType = (0, _utils.getStringOption)(attributes.executeType, ["import", "remerge"]);
- this.id = attributes.id || "";
- this.runAt = (0, _utils.getStringOption)(attributes.runAt, ["client", "both", "server"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Extras extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "extras", true);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.boolean = new _xfa_object.XFAObjectArray();
- this.date = new _xfa_object.XFAObjectArray();
- this.dateTime = new _xfa_object.XFAObjectArray();
- this.decimal = new _xfa_object.XFAObjectArray();
- this.exData = new _xfa_object.XFAObjectArray();
- this.extras = new _xfa_object.XFAObjectArray();
- this.float = new _xfa_object.XFAObjectArray();
- this.image = new _xfa_object.XFAObjectArray();
- this.integer = new _xfa_object.XFAObjectArray();
- this.text = new _xfa_object.XFAObjectArray();
- this.time = new _xfa_object.XFAObjectArray();
- }
- }
- class Field extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "field", true);
- this.access = (0, _utils.getStringOption)(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
- this.accessKey = attributes.accessKey || "";
- this.anchorType = (0, _utils.getStringOption)(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
- this.colSpan = (0, _utils.getInteger)({
- data: attributes.colSpan,
- defaultValue: 1,
- validate: x => x >= 1
- });
- this.h = attributes.h ? (0, _utils.getMeasurement)(attributes.h) : "";
- this.hAlign = (0, _utils.getStringOption)(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
- this.id = attributes.id || "";
- this.locale = attributes.locale || "";
- this.maxH = (0, _utils.getMeasurement)(attributes.maxH, "0pt");
- this.maxW = (0, _utils.getMeasurement)(attributes.maxW, "0pt");
- this.minH = (0, _utils.getMeasurement)(attributes.minH, "0pt");
- this.minW = (0, _utils.getMeasurement)(attributes.minW, "0pt");
- this.name = attributes.name || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.rotate = (0, _utils.getInteger)({
- data: attributes.rotate,
- defaultValue: 0,
- validate: x => x % 90 === 0
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.w = attributes.w ? (0, _utils.getMeasurement)(attributes.w) : "";
- this.x = (0, _utils.getMeasurement)(attributes.x, "0pt");
- this.y = (0, _utils.getMeasurement)(attributes.y, "0pt");
- this.assist = null;
- this.bind = null;
- this.border = null;
- this.calculate = null;
- this.caption = null;
- this.desc = null;
- this.extras = null;
- this.font = null;
- this.format = null;
- this.items = new _xfa_object.XFAObjectArray(2);
- this.keep = null;
- this.margin = null;
- this.para = null;
- this.traversal = null;
- this.ui = null;
- this.validate = null;
- this.value = null;
- this.bindItems = new _xfa_object.XFAObjectArray();
- this.connect = new _xfa_object.XFAObjectArray();
- this.event = new _xfa_object.XFAObjectArray();
- this.setProperty = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$setValue](value) {
- _setValue(this, value);
- }
- [_xfa_object.$toHTML]() {
- if (!this.ui) {
- return null;
- }
- const style = (0, _html_utils.toStyle)(this, "font", "dimensions", "position", "rotate", "anchorType", "presence");
- const borderWidths = [];
- const marginWidths = [];
- if (this.border) {
- Object.assign(style, this.border[_xfa_object.$toStyle](borderWidths, marginWidths));
- }
- if (this.margin) {
- style.paddingTop = (0, _html_utils.measureToString)(this.margin.topInset - borderWidths[0] - marginWidths[0]);
- style.paddingRight = (0, _html_utils.measureToString)(this.margin.rightInset - borderWidths[1] - marginWidths[1]);
- style.paddingBottom = (0, _html_utils.measureToString)(this.margin.bottomInset - borderWidths[2] - marginWidths[2]);
- style.paddingLeft = (0, _html_utils.measureToString)(this.margin.leftInset - borderWidths[3] - marginWidths[3]);
- } else {
- style.paddingTop = (0, _html_utils.measureToString)(-borderWidths[0] - marginWidths[0]);
- style.paddingRight = (0, _html_utils.measureToString)(-borderWidths[1] - marginWidths[1]);
- style.paddingBottom = (0, _html_utils.measureToString)(-borderWidths[2] - marginWidths[2]);
- style.paddingLeft = (0, _html_utils.measureToString)(-borderWidths[3] - marginWidths[3]);
- }
- const clazz = ["xfaField"];
- if (this.font) {
- clazz.push("xfaFont");
- }
- const attributes = {
- style,
- id: this[_xfa_object.$uid],
- class: clazz.join(" ")
- };
- if (this.name) {
- attributes.xfaName = this.name;
- }
- const children = [];
- const html = {
- name: "div",
- attributes,
- children
- };
- const ui = this.ui ? this.ui[_xfa_object.$toHTML]() : null;
- if (!ui) {
- return html;
- }
- if (!ui.attributes.style) {
- ui.attributes.style = Object.create(null);
- }
- children.push(ui);
- if (this.value && ui.name !== "button") {
- ui.children[0].attributes.value = this.value[_xfa_object.$toHTML]();
- }
- const caption = this.caption ? this.caption[_xfa_object.$toHTML]() : null;
- if (!caption) {
- return html;
- }
- if (ui.name === "button") {
- ui.attributes.style.background = style.color;
- delete style.color;
- if (caption.name === "div") {
- caption.name = "span";
- }
- ui.children = [caption];
- return html;
- }
- ui.children.splice(0, 0, caption);
- switch (this.caption.placement) {
- case "left":
- ui.attributes.style.flexDirection = "row";
- break;
- case "right":
- ui.attributes.style.flexDirection = "row-reverse";
- break;
- case "top":
- ui.attributes.style.flexDirection = "column";
- break;
- case "bottom":
- ui.attributes.style.flexDirection = "column-reverse";
- break;
- case "inline":
- delete ui.attributes.class;
- caption.attributes.style.float = "left";
- break;
- }
- return html;
- }
- }
- exports.Field = Field;
- class Fill extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "fill", true);
- this.id = attributes.id || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- this.linear = null;
- this.pattern = null;
- this.radial = null;
- this.solid = null;
- this.stipple = null;
- }
- [_xfa_object.$toStyle]() {
- for (const name of Object.getOwnPropertyNames(this)) {
- if (name === "extras" || name === "color") {
- continue;
- }
- const obj = this[name];
- if (!(obj instanceof _xfa_object.XFAObject)) {
- continue;
- }
- return {
- color: obj[_xfa_object.$toStyle](this.color)
- };
- }
- return {
- color: this.color ? this.color[_xfa_object.$toStyle]() : "#000000"
- };
- }
- }
- class Filter extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "filter", true);
- this.addRevocationInfo = (0, _utils.getStringOption)(attributes.addRevocationInfo, ["", "required", "optional", "none"]);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.version = (0, _utils.getInteger)({
- data: this.version,
- defaultValue: 5,
- validate: x => x >= 1 && x <= 5
- });
- this.appearanceFilter = null;
- this.certificates = null;
- this.digestMethods = null;
- this.encodings = null;
- this.encryptionMethods = null;
- this.handler = null;
- this.lockDocument = null;
- this.mdp = null;
- this.reasons = null;
- this.timeStamp = null;
- }
- }
- class Float extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "float");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- const number = parseFloat(this[_xfa_object.$content].trim());
- this[_xfa_object.$content] = isNaN(number) ? null : number;
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content] !== null ? this[_xfa_object.$content].toString() : "";
- }
- }
- class Font extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "font", true);
- this.baselineShift = (0, _utils.getMeasurement)(attributes.baselineShift);
- this.fontHorizontalScale = (0, _utils.getFloat)({
- data: attributes.fontHorizontalScale,
- defaultValue: 100,
- validate: x => x >= 0
- });
- this.fontVerticalScale = (0, _utils.getFloat)({
- data: attributes.fontVerticalScale,
- defaultValue: 100,
- validate: x => x >= 0
- });
- this.id = attributes.id || "";
- this.kerningMode = (0, _utils.getStringOption)(attributes.kerningMode, ["none", "pair"]);
- this.letterSpacing = (0, _utils.getMeasurement)(attributes.letterSpacing, "0");
- this.lineThrough = (0, _utils.getInteger)({
- data: attributes.lineThrough,
- defaultValue: 0,
- validate: x => x === 1 || x === 2
- });
- this.lineThroughPeriod = (0, _utils.getStringOption)(attributes.lineThroughPeriod, ["all", "word"]);
- this.overline = (0, _utils.getInteger)({
- data: attributes.overline,
- defaultValue: 0,
- validate: x => x === 1 || x === 2
- });
- this.overlinePeriod = (0, _utils.getStringOption)(attributes.overlinePeriod, ["all", "word"]);
- this.posture = (0, _utils.getStringOption)(attributes.posture, ["normal", "italic"]);
- this.size = (0, _utils.getMeasurement)(attributes.size, "10pt");
- this.typeface = attributes.typeface || "";
- this.underline = (0, _utils.getInteger)({
- data: attributes.underline,
- defaultValue: 0,
- validate: x => x === 1 || x === 2
- });
- this.underlinePeriod = (0, _utils.getStringOption)(attributes.underlinePeriod, ["all", "word"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.weight = (0, _utils.getStringOption)(attributes.weight, ["normal", "bold"]);
- this.extras = null;
- this.fill = null;
- }
- [_xfa_object.$toStyle]() {
- const style = (0, _html_utils.toStyle)(this, "fill");
- if (style.color) {
- if (!style.color.startsWith("#")) {
- style.backgroundClip = "text";
- style.background = style.color;
- style.color = "transparent";
- } else if (style.color === "#000000") {
- delete style.color;
- }
- }
- if (this.baselineShift) {
- style.verticalAlign = (0, _html_utils.measureToString)(this.baselineShift);
- }
- if (this.kerningMode !== "none") {
- style.fontKerning = "normal";
- }
- if (this.letterSpacing) {
- style.letterSpacing = (0, _html_utils.measureToString)(this.letterSpacing);
- }
- if (this.lineThrough !== 0) {
- style.textDecoration = "line-through";
- if (this.lineThrough === 2) {
- style.textDecorationStyle = "double";
- }
- }
- if (this.overline !== 0) {
- style.textDecoration = "overline";
- if (this.overline === 2) {
- style.textDecorationStyle = "double";
- }
- }
- if (this.posture !== "normal") {
- style.fontStyle = this.posture;
- }
- const fontSize = (0, _html_utils.measureToString)(this.size);
- if (fontSize !== "10px") {
- style.fontSize = fontSize;
- }
- style.fontFamily = this.typeface;
- if (this.underline !== 0) {
- style.textDecoration = "underline";
- if (this.underline === 2) {
- style.textDecorationStyle = "double";
- }
- }
- if (this.weight !== "normal") {
- style.fontWeight = this.weight;
- }
- return style;
- }
- }
- class Format extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "format", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.picture = null;
- }
- }
- class Handler extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "handler");
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Hyphenation extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "hyphenation");
- this.excludeAllCaps = (0, _utils.getInteger)({
- data: attributes.excludeAllCaps,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.excludeInitialCap = (0, _utils.getInteger)({
- data: attributes.excludeInitialCap,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.hyphenate = (0, _utils.getInteger)({
- data: attributes.hyphenate,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.id = attributes.id || "";
- this.pushCharacterCount = (0, _utils.getInteger)({
- data: attributes.pushCharacterCount,
- defaultValue: 3,
- validate: x => x >= 0
- });
- this.remainCharacterCount = (0, _utils.getInteger)({
- data: attributes.remainCharacterCount,
- defaultValue: 3,
- validate: x => x >= 0
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.wordCharacterCount = (0, _utils.getInteger)({
- data: attributes.wordCharacterCount,
- defaultValue: 7,
- validate: x => x >= 0
- });
- }
- }
- class Image extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "image");
- this.aspect = (0, _utils.getStringOption)(attributes.aspect, ["fit", "actual", "height", "none", "width"]);
- this.contentType = attributes.contentType || "";
- this.href = attributes.href || "";
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.transferEncoding = (0, _utils.getStringOption)(attributes.transferEncoding, ["base64", "none", "package"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$toHTML]() {
- const html = {
- name: "img",
- attributes: {
- style: {}
- }
- };
- if (this.href) {
- html.attributes.src = new URL(this.href);
- return html;
- }
- if (this.transferEncoding === "base64") {
- const buffer = Uint8Array.from(atob(this[_xfa_object.$content]), c => c.charCodeAt(0));
- const blob = new Blob([buffer], {
- type: this.contentType
- });
- html.attributes.src = URL.createObjectURL(blob);
- return html;
- }
- return null;
- }
- }
- class ImageEdit extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "imageEdit", true);
- this.data = (0, _utils.getStringOption)(attributes.data, ["link", "embed"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.extras = null;
- this.margin = null;
- }
- }
- class Integer extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "integer");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- const number = parseInt(this[_xfa_object.$content].trim(), 10);
- this[_xfa_object.$content] = isNaN(number) ? null : number;
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content] !== null ? this[_xfa_object.$content].toString() : "";
- }
- }
- class Issuers extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "issuers", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.certificate = new _xfa_object.XFAObjectArray();
- }
- }
- class Items extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "items", true);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.ref = attributes.ref || "";
- this.save = (0, _utils.getInteger)({
- data: attributes.save,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.boolean = new _xfa_object.XFAObjectArray();
- this.date = new _xfa_object.XFAObjectArray();
- this.dateTime = new _xfa_object.XFAObjectArray();
- this.decimal = new _xfa_object.XFAObjectArray();
- this.exData = new _xfa_object.XFAObjectArray();
- this.float = new _xfa_object.XFAObjectArray();
- this.image = new _xfa_object.XFAObjectArray();
- this.integer = new _xfa_object.XFAObjectArray();
- this.text = new _xfa_object.XFAObjectArray();
- this.time = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$hasItem](value) {
- return this.hasOwnProperty(value[_xfa_object.$nodeName]) && this[value[_xfa_object.$nodeName]].children.some(node => node[_xfa_object.$content] === value[_xfa_object.$content]);
- }
- }
- exports.Items = Items;
- class Keep extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "keep", true);
- this.id = attributes.id || "";
- const options = ["none", "contentArea", "pageArea"];
- this.intact = (0, _utils.getStringOption)(attributes.intact, options);
- this.next = (0, _utils.getStringOption)(attributes.next, options);
- this.previous = (0, _utils.getStringOption)(attributes.previous, options);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- }
- class KeyUsage extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "keyUsage");
- const options = ["", "yes", "no"];
- this.crlSign = (0, _utils.getStringOption)(attributes.crlSign, options);
- this.dataEncipherment = (0, _utils.getStringOption)(attributes.dataEncipherment, options);
- this.decipherOnly = (0, _utils.getStringOption)(attributes.decipherOnly, options);
- this.digitalSignature = (0, _utils.getStringOption)(attributes.digitalSignature, options);
- this.encipherOnly = (0, _utils.getStringOption)(attributes.encipherOnly, options);
- this.id = attributes.id || "";
- this.keyAgreement = (0, _utils.getStringOption)(attributes.keyAgreement, options);
- this.keyCertSign = (0, _utils.getStringOption)(attributes.keyCertSign, options);
- this.keyEncipherment = (0, _utils.getStringOption)(attributes.keyEncipherment, options);
- this.nonRepudiation = (0, _utils.getStringOption)(attributes.nonRepudiation, options);
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Line extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "line", true);
- this.hand = (0, _utils.getStringOption)(attributes.hand, ["even", "left", "right"]);
- this.id = attributes.id || "";
- this.slope = (0, _utils.getStringOption)(attributes.slope, ["\\", "/"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.edge = null;
- }
- }
- class Linear extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "linear", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- }
- [_xfa_object.$toStyle](startColor) {
- startColor = startColor ? startColor[_xfa_object.$toStyle]() : "#FFFFFF";
- const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase();
- const endColor = this.color ? this.color[_xfa_object.$toStyle]() : "#000000";
- return `linear-gradient(${transf}, ${startColor}, ${endColor})`;
- }
- }
- class LockDocument extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "lockDocument");
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- this[_xfa_object.$content] = (0, _utils.getStringOption)(this[_xfa_object.$content], ["auto", "0", "1"]);
- }
- }
- class Manifest extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "manifest", true);
- this.action = (0, _utils.getStringOption)(attributes.action, ["include", "all", "exclude"]);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.ref = new _xfa_object.XFAObjectArray();
- }
- }
- class Margin extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "margin", true);
- this.bottomInset = (0, _utils.getMeasurement)(attributes.bottomInset, "0");
- this.id = attributes.id || "";
- this.leftInset = (0, _utils.getMeasurement)(attributes.leftInset, "0");
- this.rightInset = (0, _utils.getMeasurement)(attributes.rightInset, "0");
- this.topInset = (0, _utils.getMeasurement)(attributes.topInset, "0");
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- [_xfa_object.$toStyle]() {
- return {
- marginLeft: (0, _html_utils.measureToString)(this.leftInset),
- marginRight: (0, _html_utils.measureToString)(this.rightInset),
- marginTop: (0, _html_utils.measureToString)(this.topInset),
- marginBottom: (0, _html_utils.measureToString)(this.bottomInset)
- };
- }
- }
- class Mdp extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "mdp");
- this.id = attributes.id || "";
- this.permissions = (0, _utils.getInteger)({
- data: attributes.permissions,
- defaultValue: 2,
- validate: x => x === 1 || x === 3
- });
- this.signatureType = (0, _utils.getStringOption)(attributes.signatureType, ["filler", "author"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Medium extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "medium");
- this.id = attributes.id || "";
- this.imagingBBox = (0, _utils.getBBox)(attributes.imagingBBox);
- this.long = (0, _utils.getMeasurement)(attributes.long);
- this.orientation = (0, _utils.getStringOption)(attributes.orientation, ["portrait", "landscape"]);
- this.short = (0, _utils.getMeasurement)(attributes.short);
- this.stock = attributes.stock || "";
- this.trayIn = (0, _utils.getStringOption)(attributes.trayIn, ["auto", "delegate", "pageFront"]);
- this.trayOut = (0, _utils.getStringOption)(attributes.trayOut, ["auto", "delegate"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Message extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "message", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.text = new _xfa_object.XFAObjectArray();
- }
- }
- class NumericEdit extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "numericEdit", true);
- this.hScrollPolicy = (0, _utils.getStringOption)(attributes.hScrollPolicy, ["auto", "off", "on"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.comb = null;
- this.extras = null;
- this.margin = null;
- }
- [_xfa_object.$toHTML]() {
- const style = (0, _html_utils.toStyle)(this, "border", "font", "margin");
- const html = {
- name: "input",
- attributes: {
- type: "text",
- class: "xfaTextfield",
- style
- }
- };
- return {
- name: "label",
- attributes: {
- class: "xfaLabel"
- },
- children: [html]
- };
- }
- }
- class Occur extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "occur", true);
- this.id = attributes.id || "";
- this.initial = (0, _utils.getInteger)({
- data: attributes.initial,
- defaultValue: 1,
- validate: x => true
- });
- this.max = (0, _utils.getInteger)({
- data: attributes.max,
- defaultValue: 1,
- validate: x => true
- });
- this.min = (0, _utils.getInteger)({
- data: attributes.min,
- defaultValue: 1,
- validate: x => true
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- }
- class Oid extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "oid");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Oids extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "oids", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.oid = new _xfa_object.XFAObjectArray();
- }
- }
- class Overflow extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "overflow");
- this.id = attributes.id || "";
- this.leader = attributes.leader || "";
- this.target = attributes.target || "";
- this.trailer = attributes.trailer || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class PageArea extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "pageArea", true);
- this.blankOrNotBlank = (0, _utils.getStringOption)(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]);
- this.id = attributes.id || "";
- this.initialNumber = (0, _utils.getInteger)({
- data: attributes.initialNumber,
- defaultValue: 1,
- validate: x => true
- });
- this.name = attributes.name || "";
- this.numbered = (0, _utils.getInteger)({
- data: attributes.numbered,
- defaultValue: 1,
- validate: x => true
- });
- this.oddOrEven = (0, _utils.getStringOption)(attributes.oddOrEven, ["any", "even", "odd"]);
- this.pagePosition = (0, _utils.getStringOption)(attributes.pagePosition, ["any", "first", "last", "only", "rest"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.desc = null;
- this.extras = null;
- this.medium = null;
- this.occur = null;
- this.area = new _xfa_object.XFAObjectArray();
- this.contentArea = new _xfa_object.XFAObjectArray();
- this.draw = new _xfa_object.XFAObjectArray();
- this.exclGroup = new _xfa_object.XFAObjectArray();
- this.field = new _xfa_object.XFAObjectArray();
- this.subform = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$toHTML]() {
- if (this.contentArea.children.length === 0) {
- return null;
- }
- const children = this[_xfa_object.$childrenToHTML]({
- filter: new Set(["area", "draw", "field", "subform", "contentArea"]),
- include: true
- });
- const contentArea = children.find(node => node.attributes.class === "xfaContentarea");
- const style = Object.create(null);
- if (this.medium && this.medium.short && this.medium.long) {
- style.width = (0, _html_utils.measureToString)(this.medium.short);
- style.height = (0, _html_utils.measureToString)(this.medium.long);
- } else {}
- return {
- name: "div",
- children,
- attributes: {
- id: this[_xfa_object.$uid],
- style
- },
- contentArea
- };
- }
- }
- class PageSet extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "pageSet", true);
- this.duplexImposition = (0, _utils.getStringOption)(attributes.duplexImposition, ["longEdge", "shortEdge"]);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.relation = (0, _utils.getStringOption)(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.occur = null;
- this.pageArea = new _xfa_object.XFAObjectArray();
- this.pageSet = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$toHTML]() {
- return {
- name: "div",
- children: this[_xfa_object.$childrenToHTML]({
- filter: new Set(["pageArea", "pageSet"]),
- include: true
- }),
- attributes: {
- id: this[_xfa_object.$uid]
- }
- };
- }
- }
- class Para extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "para", true);
- this.hAlign = (0, _utils.getStringOption)(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
- this.id = attributes.id || "";
- this.lineHeight = (0, _utils.getMeasurement)(attributes.lineHeight, "0pt");
- this.marginLeft = (0, _utils.getMeasurement)(attributes.marginLeft, "0");
- this.marginRight = (0, _utils.getMeasurement)(attributes.marginRight, "0");
- this.orphans = (0, _utils.getInteger)({
- data: attributes.orphans,
- defaultValue: 0,
- validate: x => x >= 0
- });
- this.preserve = attributes.preserve || "";
- this.radixOffset = (0, _utils.getMeasurement)(attributes.radixOffset, "0");
- this.spaceAbove = (0, _utils.getMeasurement)(attributes.spaceAbove, "0");
- this.spaceBelow = (0, _utils.getMeasurement)(attributes.spaceBelow, "0");
- this.tabDefault = attributes.tabDefault ? (0, _utils.getMeasurement)(this.tabDefault) : null;
- this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? (0, _utils.getMeasurement)(x) : x);
- this.textIndent = (0, _utils.getMeasurement)(attributes.textIndent, "0");
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.vAlign = (0, _utils.getStringOption)(attributes.vAlign, ["top", "bottom", "middle"]);
- this.widows = (0, _utils.getInteger)({
- data: attributes.widows,
- defaultValue: 0,
- validate: x => x >= 0
- });
- this.hyphenation = null;
- }
- [_xfa_object.$toHTML]() {
- const style = {
- marginLeft: (0, _html_utils.measureToString)(this.marginLeft),
- marginRight: (0, _html_utils.measureToString)(this.marginRight),
- paddingTop: (0, _html_utils.measureToString)(this.spaceAbove),
- paddingBottom: (0, _html_utils.measureToString)(this.spaceBelow),
- textIndent: (0, _html_utils.measureToString)(this.textIndent),
- verticalAlign: this.vAlign
- };
- if (this.lineHeight.value >= 0) {
- style.lineHeight = (0, _html_utils.measureToString)(this.lineHeight);
- }
- if (this.tabDefault) {
- style.tabSize = (0, _html_utils.measureToString)(this.tabDefault);
- }
- if (this.tabStops.length > 0) {}
- if (this.hyphenatation) {
- Object.assign(style, this.hyphenatation[_xfa_object.$toHTML]());
- }
- return style;
- }
- }
- class PasswordEdit extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "passwordEdit", true);
- this.hScrollPolicy = (0, _utils.getStringOption)(attributes.hScrollPolicy, ["auto", "off", "on"]);
- this.id = attributes.id || "";
- this.passwordChar = attributes.passwordChar || "*";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.extras = null;
- this.margin = null;
- }
- }
- class Pattern extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "pattern", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- }
- [_xfa_object.$toStyle](startColor) {
- startColor = startColor ? startColor[_xfa_object.$toStyle]() : "#FFFFFF";
- const endColor = this.color ? this.color[_xfa_object.$toStyle]() : "#000000";
- const width = 5;
- const cmd = "repeating-linear-gradient";
- const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`;
- switch (this.type) {
- case "crossHatch":
- return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`;
- case "crossDiagonal":
- return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`;
- case "diagonalLeft":
- return `${cmd}(45deg,${colors})`;
- case "diagonalRight":
- return `${cmd}(-45deg,${colors})`;
- case "horizontal":
- return `${cmd}(to top,${colors})`;
- case "vertical":
- return `${cmd}(to right,${colors})`;
- }
- return "";
- }
- }
- class Picture extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "picture");
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Proto extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "proto", true);
- this.appearanceFilter = new _xfa_object.XFAObjectArray();
- this.arc = new _xfa_object.XFAObjectArray();
- this.area = new _xfa_object.XFAObjectArray();
- this.assist = new _xfa_object.XFAObjectArray();
- this.barcode = new _xfa_object.XFAObjectArray();
- this.bindItems = new _xfa_object.XFAObjectArray();
- this.bookend = new _xfa_object.XFAObjectArray();
- this.boolean = new _xfa_object.XFAObjectArray();
- this.border = new _xfa_object.XFAObjectArray();
- this.break = new _xfa_object.XFAObjectArray();
- this.breakAfter = new _xfa_object.XFAObjectArray();
- this.breakBefore = new _xfa_object.XFAObjectArray();
- this.button = new _xfa_object.XFAObjectArray();
- this.calculate = new _xfa_object.XFAObjectArray();
- this.caption = new _xfa_object.XFAObjectArray();
- this.certificate = new _xfa_object.XFAObjectArray();
- this.certificates = new _xfa_object.XFAObjectArray();
- this.checkButton = new _xfa_object.XFAObjectArray();
- this.choiceList = new _xfa_object.XFAObjectArray();
- this.color = new _xfa_object.XFAObjectArray();
- this.comb = new _xfa_object.XFAObjectArray();
- this.connect = new _xfa_object.XFAObjectArray();
- this.contentArea = new _xfa_object.XFAObjectArray();
- this.corner = new _xfa_object.XFAObjectArray();
- this.date = new _xfa_object.XFAObjectArray();
- this.dateTime = new _xfa_object.XFAObjectArray();
- this.dateTimeEdit = new _xfa_object.XFAObjectArray();
- this.decimal = new _xfa_object.XFAObjectArray();
- this.defaultUi = new _xfa_object.XFAObjectArray();
- this.desc = new _xfa_object.XFAObjectArray();
- this.digestMethod = new _xfa_object.XFAObjectArray();
- this.digestMethods = new _xfa_object.XFAObjectArray();
- this.draw = new _xfa_object.XFAObjectArray();
- this.edge = new _xfa_object.XFAObjectArray();
- this.encoding = new _xfa_object.XFAObjectArray();
- this.encodings = new _xfa_object.XFAObjectArray();
- this.encrypt = new _xfa_object.XFAObjectArray();
- this.encryptData = new _xfa_object.XFAObjectArray();
- this.encryption = new _xfa_object.XFAObjectArray();
- this.encryptionMethod = new _xfa_object.XFAObjectArray();
- this.encryptionMethods = new _xfa_object.XFAObjectArray();
- this.event = new _xfa_object.XFAObjectArray();
- this.exData = new _xfa_object.XFAObjectArray();
- this.exObject = new _xfa_object.XFAObjectArray();
- this.exclGroup = new _xfa_object.XFAObjectArray();
- this.execute = new _xfa_object.XFAObjectArray();
- this.extras = new _xfa_object.XFAObjectArray();
- this.field = new _xfa_object.XFAObjectArray();
- this.fill = new _xfa_object.XFAObjectArray();
- this.filter = new _xfa_object.XFAObjectArray();
- this.float = new _xfa_object.XFAObjectArray();
- this.font = new _xfa_object.XFAObjectArray();
- this.format = new _xfa_object.XFAObjectArray();
- this.handler = new _xfa_object.XFAObjectArray();
- this.hyphenation = new _xfa_object.XFAObjectArray();
- this.image = new _xfa_object.XFAObjectArray();
- this.imageEdit = new _xfa_object.XFAObjectArray();
- this.integer = new _xfa_object.XFAObjectArray();
- this.issuers = new _xfa_object.XFAObjectArray();
- this.items = new _xfa_object.XFAObjectArray();
- this.keep = new _xfa_object.XFAObjectArray();
- this.keyUsage = new _xfa_object.XFAObjectArray();
- this.line = new _xfa_object.XFAObjectArray();
- this.linear = new _xfa_object.XFAObjectArray();
- this.lockDocument = new _xfa_object.XFAObjectArray();
- this.manifest = new _xfa_object.XFAObjectArray();
- this.margin = new _xfa_object.XFAObjectArray();
- this.mdp = new _xfa_object.XFAObjectArray();
- this.medium = new _xfa_object.XFAObjectArray();
- this.message = new _xfa_object.XFAObjectArray();
- this.numericEdit = new _xfa_object.XFAObjectArray();
- this.occur = new _xfa_object.XFAObjectArray();
- this.oid = new _xfa_object.XFAObjectArray();
- this.oids = new _xfa_object.XFAObjectArray();
- this.overflow = new _xfa_object.XFAObjectArray();
- this.pageArea = new _xfa_object.XFAObjectArray();
- this.pageSet = new _xfa_object.XFAObjectArray();
- this.para = new _xfa_object.XFAObjectArray();
- this.passwordEdit = new _xfa_object.XFAObjectArray();
- this.pattern = new _xfa_object.XFAObjectArray();
- this.picture = new _xfa_object.XFAObjectArray();
- this.radial = new _xfa_object.XFAObjectArray();
- this.reason = new _xfa_object.XFAObjectArray();
- this.reasons = new _xfa_object.XFAObjectArray();
- this.rectangle = new _xfa_object.XFAObjectArray();
- this.ref = new _xfa_object.XFAObjectArray();
- this.script = new _xfa_object.XFAObjectArray();
- this.setProperty = new _xfa_object.XFAObjectArray();
- this.signData = new _xfa_object.XFAObjectArray();
- this.signature = new _xfa_object.XFAObjectArray();
- this.signing = new _xfa_object.XFAObjectArray();
- this.solid = new _xfa_object.XFAObjectArray();
- this.speak = new _xfa_object.XFAObjectArray();
- this.stipple = new _xfa_object.XFAObjectArray();
- this.subform = new _xfa_object.XFAObjectArray();
- this.subformSet = new _xfa_object.XFAObjectArray();
- this.subjectDN = new _xfa_object.XFAObjectArray();
- this.subjectDNs = new _xfa_object.XFAObjectArray();
- this.submit = new _xfa_object.XFAObjectArray();
- this.text = new _xfa_object.XFAObjectArray();
- this.textEdit = new _xfa_object.XFAObjectArray();
- this.time = new _xfa_object.XFAObjectArray();
- this.timeStamp = new _xfa_object.XFAObjectArray();
- this.toolTip = new _xfa_object.XFAObjectArray();
- this.traversal = new _xfa_object.XFAObjectArray();
- this.traverse = new _xfa_object.XFAObjectArray();
- this.ui = new _xfa_object.XFAObjectArray();
- this.validate = new _xfa_object.XFAObjectArray();
- this.value = new _xfa_object.XFAObjectArray();
- this.variables = new _xfa_object.XFAObjectArray();
- }
- }
- class Radial extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "radial", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["toEdge", "toCenter"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- }
- [_xfa_object.$toStyle](startColor) {
- startColor = startColor ? startColor[_xfa_object.$toStyle]() : "#FFFFFF";
- const endColor = this.color ? this.color[_xfa_object.$toStyle]() : "#000000";
- const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`;
- return `radial-gradient(circle to center, ${colors})`;
- }
- }
- class Reason extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "reason");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Reasons extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "reasons", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.reason = new _xfa_object.XFAObjectArray();
- }
- }
- class Rectangle extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "rectangle", true);
- this.hand = (0, _utils.getStringOption)(attributes.hand, ["even", "left", "right"]);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.corner = new _xfa_object.XFAObjectArray(4);
- this.edge = new _xfa_object.XFAObjectArray(4);
- this.fill = null;
- }
- }
- class RefElement extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "ref");
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Script extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "script");
- this.binding = attributes.binding || "";
- this.contentType = attributes.contentType || "";
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.runAt = (0, _utils.getStringOption)(attributes.runAt, ["client", "both", "server"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class SetProperty extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "setProperty");
- this.connection = attributes.connection || "";
- this.ref = attributes.ref || "";
- this.target = attributes.target || "";
- }
- }
- exports.SetProperty = SetProperty;
- class SignData extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "signData", true);
- this.id = attributes.id || "";
- this.operation = (0, _utils.getStringOption)(attributes.operation, ["sign", "clear", "verify"]);
- this.ref = attributes.ref || "";
- this.target = attributes.target || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.filter = null;
- this.manifest = null;
- }
- }
- class Signature extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "signature", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["PDF1.3", "PDF1.6"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.border = null;
- this.extras = null;
- this.filter = null;
- this.manifest = null;
- this.margin = null;
- }
- }
- class Signing extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "signing", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.certificate = new _xfa_object.XFAObjectArray();
- }
- }
- class Solid extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "solid", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- }
- [_xfa_object.$toStyle](startColor) {
- return startColor ? startColor[_xfa_object.$toStyle]() : "#FFFFFF";
- }
- }
- class Speak extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "speak");
- this.disable = (0, _utils.getInteger)({
- data: attributes.disable,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.id = attributes.id || "";
- this.priority = (0, _utils.getStringOption)(attributes.priority, ["custom", "caption", "name", "toolTip"]);
- this.rid = attributes.rid || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Stipple extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "stipple", true);
- this.id = attributes.id || "";
- this.rate = (0, _utils.getInteger)({
- data: attributes.rate,
- defaultValue: 50,
- validate: x => x >= 0 && x <= 100
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.color = null;
- this.extras = null;
- }
- [_xfa_object.$toStyle](bgColor) {
- const alpha = this.rate / 100;
- return _util.Util.makeHexColor(Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha));
- }
- }
- class Subform extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "subform", true);
- this.access = (0, _utils.getStringOption)(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
- this.allowMacro = (0, _utils.getInteger)({
- data: attributes.allowMacro,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.anchorType = (0, _utils.getStringOption)(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
- this.colSpan = (0, _utils.getInteger)({
- data: attributes.colSpan,
- defaultValue: 1,
- validate: x => x >= 1
- });
- this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : (0, _utils.getMeasurement)(x));
- this.h = attributes.h ? (0, _utils.getMeasurement)(attributes.h) : "";
- this.hAlign = (0, _utils.getStringOption)(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
- this.id = attributes.id || "";
- this.layout = (0, _utils.getStringOption)(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]);
- this.locale = attributes.locale || "";
- this.maxH = (0, _utils.getMeasurement)(attributes.maxH, "0pt");
- this.maxW = (0, _utils.getMeasurement)(attributes.maxW, "0pt");
- this.mergeMode = (0, _utils.getStringOption)(attributes.mergeMode, ["consumeData", "matchTemplate"]);
- this.minH = (0, _utils.getMeasurement)(attributes.minH, "0pt");
- this.minW = (0, _utils.getMeasurement)(attributes.minW, "0pt");
- this.name = attributes.name || "";
- this.presence = (0, _utils.getStringOption)(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.restoreState = (0, _utils.getStringOption)(attributes.restoreState, ["manual", "auto"]);
- this.scope = (0, _utils.getStringOption)(attributes.scope, ["name", "none"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.w = attributes.w ? (0, _utils.getMeasurement)(attributes.w) : "";
- this.x = (0, _utils.getMeasurement)(attributes.x, "0pt");
- this.y = (0, _utils.getMeasurement)(attributes.y, "0pt");
- this.assist = null;
- this.bind = null;
- this.bookend = null;
- this.border = null;
- this.break = null;
- this.calculate = null;
- this.desc = null;
- this.extras = null;
- this.keep = null;
- this.margin = null;
- this.occur = null;
- this.overflow = null;
- this.pageSet = null;
- this.para = null;
- this.traversal = null;
- this.validate = null;
- this.variables = null;
- this.area = new _xfa_object.XFAObjectArray();
- this.breakAfter = new _xfa_object.XFAObjectArray();
- this.breakBefore = new _xfa_object.XFAObjectArray();
- this.connect = new _xfa_object.XFAObjectArray();
- this.draw = new _xfa_object.XFAObjectArray();
- this.event = new _xfa_object.XFAObjectArray();
- this.exObject = new _xfa_object.XFAObjectArray();
- this.exclGroup = new _xfa_object.XFAObjectArray();
- this.field = new _xfa_object.XFAObjectArray();
- this.proto = new _xfa_object.XFAObjectArray();
- this.setProperty = new _xfa_object.XFAObjectArray();
- this.subform = new _xfa_object.XFAObjectArray();
- this.subformSet = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$toHTML]() {
- this[_xfa_object.$extra] = Object.create(null);
- const parent = this[_xfa_object.$getParent]();
- let page = null;
- if (parent[_xfa_object.$nodeName] === "template") {
- if (this.pageSet !== null) {
- this[_xfa_object.$extra].pageNumber = 0;
- } else {
- (0, _util.warn)("XFA - No pageSet in root subform");
- }
- } else if (parent[_xfa_object.$extra] && parent[_xfa_object.$extra].pageNumber !== undefined) {
- const pageNumber = parent[_xfa_object.$extra].pageNumber;
- const pageAreas = parent.pageSet.pageArea.children;
- parent[_xfa_object.$extra].pageNumber = (parent[_xfa_object.$extra].pageNumber + 1) % pageAreas.length;
- page = pageAreas[pageNumber][_xfa_object.$toHTML]();
- }
- const style = (0, _html_utils.toStyle)(this, "dimensions", "position", "presence");
- const clazz = ["xfaSubform"];
- const cl = (0, _html_utils.layoutClass)(this);
- if (cl) {
- clazz.push(cl);
- }
- const attributes = {
- style,
- id: this[_xfa_object.$uid],
- class: clazz.join(" ")
- };
- if (this.name) {
- attributes.xfaName = this.name;
- }
- const children = this[_xfa_object.$childrenToHTML]({
- filter: new Set(["area", "draw", "field", "subform", "subformSet"]),
- include: true
- });
- const html = {
- name: "div",
- attributes,
- children
- };
- if (page) {
- page.contentArea.children.push(html);
- delete page.contentArea;
- return page;
- }
- return html;
- }
- }
- class SubformSet extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "subformSet", true);
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.relation = (0, _utils.getStringOption)(attributes.relation, ["ordered", "choice", "unordered"]);
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.bookend = null;
- this.break = null;
- this.desc = null;
- this.extras = null;
- this.occur = null;
- this.overflow = null;
- this.breakAfter = new _xfa_object.XFAObjectArray();
- this.breakBefore = new _xfa_object.XFAObjectArray();
- this.subform = new _xfa_object.XFAObjectArray();
- this.subformSet = new _xfa_object.XFAObjectArray();
- }
- }
- class SubjectDN extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "subjectDN");
- this.delimiter = attributes.delimiter || ",";
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- this[_xfa_object.$content] = new Map(this[_xfa_object.$content].split(this.delimiter).map(kv => {
- kv = kv.split("=", 2);
- kv[0] = kv[0].trim();
- return kv;
- }));
- }
- }
- class SubjectDNs extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "subjectDNs", true);
- this.id = attributes.id || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.subjectDN = new _xfa_object.XFAObjectArray();
- }
- }
- class Submit extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "submit", true);
- this.embedPDF = (0, _utils.getInteger)({
- data: attributes.embedPDF,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.format = (0, _utils.getStringOption)(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]);
- this.id = attributes.id || "";
- this.target = attributes.target || "";
- this.textEncoding = (0, _utils.getKeyword)({
- data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "",
- defaultValue: "",
- validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-[0-9]{2}/)
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.xdpContent = attributes.xdpContent || "";
- this.encrypt = null;
- this.encryptData = new _xfa_object.XFAObjectArray();
- this.signData = new _xfa_object.XFAObjectArray();
- }
- }
- class Template extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "template", true);
- this.baseProfile = (0, _utils.getStringOption)(attributes.baseProfile, ["full", "interactiveForms"]);
- this.extras = null;
- this.subform = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$finalize]() {
- if (this.subform.children.length === 0) {
- (0, _util.warn)("XFA - No subforms in template node.");
- }
- if (this.subform.children.length >= 2) {
- (0, _util.warn)("XFA - Several subforms in template node: please file a bug.");
- }
- }
- [_xfa_object.$toHTML]() {
- if (this.subform.children.length > 0) {
- return this.subform.children[0][_xfa_object.$toHTML]();
- }
- return {
- name: "div",
- children: []
- };
- }
- }
- exports.Template = Template;
- class Text extends _xfa_object.ContentObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "text");
- this.id = attributes.id || "";
- this.maxChars = (0, _utils.getInteger)({
- data: attributes.maxChars,
- defaultValue: 0,
- validate: x => x >= 0
- });
- this.name = attributes.name || "";
- this.rid = attributes.rid || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$onChild](child) {
- if (child[_xfa_object.$namespaceId] === _namespaces.NamespaceIds.xhtml.id) {
- this[_xfa_object.$content] = child;
- return true;
- }
- (0, _util.warn)(`XFA - Invalid content in Text: ${child[_xfa_object.$nodeName]}.`);
- return false;
- }
- [_xfa_object.$toHTML]() {
- if (typeof this[_xfa_object.$content] === "string") {
- return this[_xfa_object.$content];
- }
- return this[_xfa_object.$content][_xfa_object.$toHTML]();
- }
- }
- exports.Text = Text;
- class TextEdit extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "textEdit", true);
- this.allowRichText = (0, _utils.getInteger)({
- data: attributes.allowRichText,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.hScrollPolicy = (0, _utils.getStringOption)(attributes.hScrollPolicy, ["auto", "off", "on"]);
- this.id = attributes.id || "";
- this.multiLine = (0, _utils.getInteger)({
- data: attributes.multiLine,
- defaultValue: 1,
- validate: x => x === 0
- });
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.vScrollPolicy = (0, _utils.getStringOption)(attributes.vScrollPolicy, ["auto", "off", "on"]);
- this.border = null;
- this.comb = null;
- this.extras = null;
- this.margin = null;
- }
- [_xfa_object.$toHTML]() {
- const style = (0, _html_utils.toStyle)(this, "border", "font", "margin");
- let html;
- if (this.multiline === 1) {
- html = {
- name: "textarea",
- attributes: {
- style
- }
- };
- } else {
- html = {
- name: "input",
- attributes: {
- type: "text",
- class: "xfaTextfield",
- style
- }
- };
- }
- return {
- name: "label",
- attributes: {
- class: "xfaLabel"
- },
- children: [html]
- };
- }
- }
- class Time extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "time");
- this.id = attributes.id || "";
- this.name = attributes.name || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- [_xfa_object.$finalize]() {
- this[_xfa_object.$content] = new Date(this[_xfa_object.$content]);
- }
- [_xfa_object.$toHTML]() {
- return this[_xfa_object.$content].toString();
- }
- }
- class TimeStamp extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "timeStamp");
- this.id = attributes.id || "";
- this.server = attributes.server || "";
- this.type = (0, _utils.getStringOption)(attributes.type, ["optional", "required"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class ToolTip extends _xfa_object.StringObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "toolTip");
- this.id = attributes.id || "";
- this.rid = attributes.rid || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- }
- }
- class Traversal extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "traversal", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.traverse = new _xfa_object.XFAObjectArray();
- }
- }
- class Traverse extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "traverse", true);
- this.id = attributes.id || "";
- this.operation = (0, _utils.getStringOption)(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]);
- this.ref = attributes.ref || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.script = null;
- }
- get name() {
- return this.operation;
- }
- [_xfa_object.$isTransparent]() {
- return false;
- }
- }
- class Ui extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "ui", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.picture = null;
- this.barcode = null;
- this.button = null;
- this.checkButton = null;
- this.choiceList = null;
- this.dateTimeEdit = null;
- this.defaultUi = null;
- this.imageEdit = null;
- this.numericEdit = null;
- this.passwordEdit = null;
- this.signature = null;
- this.textEdit = null;
- }
- [_xfa_object.$toHTML]() {
- for (const name of Object.getOwnPropertyNames(this)) {
- if (name === "extras" || name === "picture") {
- continue;
- }
- const obj = this[name];
- if (!(obj instanceof _xfa_object.XFAObject)) {
- continue;
- }
- return obj[_xfa_object.$toHTML]();
- }
- return null;
- }
- }
- class Validate extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "validate", true);
- this.formatTest = (0, _utils.getStringOption)(attributes.formatTest, ["warning", "disabled", "error"]);
- this.id = attributes.id || "";
- this.nullTest = (0, _utils.getStringOption)(attributes.nullTest, ["disabled", "error", "warning"]);
- this.scriptTest = (0, _utils.getStringOption)(attributes.scriptTest, ["error", "disabled", "warning"]);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.extras = null;
- this.message = null;
- this.picture = null;
- this.script = null;
- }
- }
- class Value extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "value", true);
- this.id = attributes.id || "";
- this.override = (0, _utils.getInteger)({
- data: attributes.override,
- defaultValue: 0,
- validate: x => x === 1
- });
- this.relevant = (0, _utils.getRelevant)(attributes.relevant);
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.arc = null;
- this.boolean = null;
- this.date = null;
- this.dateTime = null;
- this.decimal = null;
- this.exData = null;
- this.float = null;
- this.image = null;
- this.integer = null;
- this.line = null;
- this.rectangle = null;
- this.text = null;
- this.time = null;
- }
- [_xfa_object.$setValue](value) {
- const valueName = value[_xfa_object.$nodeName];
- if (this[valueName] !== null) {
- this[valueName][_xfa_object.$content] = value[_xfa_object.$content];
- return;
- }
- for (const name of Object.getOwnPropertyNames(this)) {
- const obj = this[name];
- if (obj instanceof _xfa_object.XFAObject) {
- this[name] = null;
- this[_xfa_object.$removeChild](obj);
- }
- }
- this[value[_xfa_object.$nodeName]] = value;
- this[_xfa_object.$appendChild](value);
- }
- [_xfa_object.$toHTML]() {
- for (const name of Object.getOwnPropertyNames(this)) {
- const obj = this[name];
- if (!(obj instanceof _xfa_object.XFAObject)) {
- continue;
- }
- return obj[_xfa_object.$toHTML]();
- }
- return null;
- }
- }
- exports.Value = Value;
- class Variables extends _xfa_object.XFAObject {
- constructor(attributes) {
- super(TEMPLATE_NS_ID, "variables", true);
- this.id = attributes.id || "";
- this.use = attributes.use || "";
- this.usehref = attributes.usehref || "";
- this.boolean = new _xfa_object.XFAObjectArray();
- this.date = new _xfa_object.XFAObjectArray();
- this.dateTime = new _xfa_object.XFAObjectArray();
- this.decimal = new _xfa_object.XFAObjectArray();
- this.exData = new _xfa_object.XFAObjectArray();
- this.float = new _xfa_object.XFAObjectArray();
- this.image = new _xfa_object.XFAObjectArray();
- this.integer = new _xfa_object.XFAObjectArray();
- this.manifest = new _xfa_object.XFAObjectArray();
- this.script = new _xfa_object.XFAObjectArray();
- this.text = new _xfa_object.XFAObjectArray();
- this.time = new _xfa_object.XFAObjectArray();
- }
- [_xfa_object.$isTransparent]() {
- return true;
- }
- }
- class TemplateNamespace {
- static [_namespaces.$buildXFAObject](name, attributes) {
- if (TemplateNamespace.hasOwnProperty(name)) {
- const node = TemplateNamespace[name](attributes);
- node[_xfa_object.$setSetAttributes](attributes);
- return node;
- }
- return undefined;
- }
- static appearanceFilter(attrs) {
- return new AppearanceFilter(attrs);
- }
- static arc(attrs) {
- return new Arc(attrs);
- }
- static area(attrs) {
- return new Area(attrs);
- }
- static assist(attrs) {
- return new Assist(attrs);
- }
- static barcode(attrs) {
- return new Barcode(attrs);
- }
- static bind(attrs) {
- return new Bind(attrs);
- }
- static bindItems(attrs) {
- return new BindItems(attrs);
- }
- static bookend(attrs) {
- return new Bookend(attrs);
- }
- static boolean(attrs) {
- return new BooleanElement(attrs);
- }
- static border(attrs) {
- return new Border(attrs);
- }
- static break(attrs) {
- return new Break(attrs);
- }
- static breakAfter(attrs) {
- return new BreakAfter(attrs);
- }
- static breakBefore(attrs) {
- return new BreakBefore(attrs);
- }
- static button(attrs) {
- return new Button(attrs);
- }
- static calculate(attrs) {
- return new Calculate(attrs);
- }
- static caption(attrs) {
- return new Caption(attrs);
- }
- static certificate(attrs) {
- return new Certificate(attrs);
- }
- static certificates(attrs) {
- return new Certificates(attrs);
- }
- static checkButton(attrs) {
- return new CheckButton(attrs);
- }
- static choiceList(attrs) {
- return new ChoiceList(attrs);
- }
- static color(attrs) {
- return new Color(attrs);
- }
- static comb(attrs) {
- return new Comb(attrs);
- }
- static connect(attrs) {
- return new Connect(attrs);
- }
- static contentArea(attrs) {
- return new ContentArea(attrs);
- }
- static corner(attrs) {
- return new Corner(attrs);
- }
- static date(attrs) {
- return new DateElement(attrs);
- }
- static dateTime(attrs) {
- return new DateTime(attrs);
- }
- static dateTimeEdit(attrs) {
- return new DateTimeEdit(attrs);
- }
- static decimal(attrs) {
- return new Decimal(attrs);
- }
- static defaultUi(attrs) {
- return new DefaultUi(attrs);
- }
- static desc(attrs) {
- return new Desc(attrs);
- }
- static digestMethod(attrs) {
- return new DigestMethod(attrs);
- }
- static digestMethods(attrs) {
- return new DigestMethods(attrs);
- }
- static draw(attrs) {
- return new Draw(attrs);
- }
- static edge(attrs) {
- return new Edge(attrs);
- }
- static encoding(attrs) {
- return new Encoding(attrs);
- }
- static encodings(attrs) {
- return new Encodings(attrs);
- }
- static encrypt(attrs) {
- return new Encrypt(attrs);
- }
- static encryptData(attrs) {
- return new EncryptData(attrs);
- }
- static encryption(attrs) {
- return new Encryption(attrs);
- }
- static encryptionMethod(attrs) {
- return new EncryptionMethod(attrs);
- }
- static encryptionMethods(attrs) {
- return new EncryptionMethods(attrs);
- }
- static event(attrs) {
- return new Event(attrs);
- }
- static exData(attrs) {
- return new ExData(attrs);
- }
- static exObject(attrs) {
- return new ExObject(attrs);
- }
- static exclGroup(attrs) {
- return new ExclGroup(attrs);
- }
- static execute(attrs) {
- return new Execute(attrs);
- }
- static extras(attrs) {
- return new Extras(attrs);
- }
- static field(attrs) {
- return new Field(attrs);
- }
- static fill(attrs) {
- return new Fill(attrs);
- }
- static filter(attrs) {
- return new Filter(attrs);
- }
- static float(attrs) {
- return new Float(attrs);
- }
- static font(attrs) {
- return new Font(attrs);
- }
- static format(attrs) {
- return new Format(attrs);
- }
- static handler(attrs) {
- return new Handler(attrs);
- }
- static hyphenation(attrs) {
- return new Hyphenation(attrs);
- }
- static image(attrs) {
- return new Image(attrs);
- }
- static imageEdit(attrs) {
- return new ImageEdit(attrs);
- }
- static integer(attrs) {
- return new Integer(attrs);
- }
- static issuers(attrs) {
- return new Issuers(attrs);
- }
- static items(attrs) {
- return new Items(attrs);
- }
- static keep(attrs) {
- return new Keep(attrs);
- }
- static keyUsage(attrs) {
- return new KeyUsage(attrs);
- }
- static line(attrs) {
- return new Line(attrs);
- }
- static linear(attrs) {
- return new Linear(attrs);
- }
- static lockDocument(attrs) {
- return new LockDocument(attrs);
- }
- static manifest(attrs) {
- return new Manifest(attrs);
- }
- static margin(attrs) {
- return new Margin(attrs);
- }
- static mdp(attrs) {
- return new Mdp(attrs);
- }
- static medium(attrs) {
- return new Medium(attrs);
- }
- static message(attrs) {
- return new Message(attrs);
- }
- static numericEdit(attrs) {
- return new NumericEdit(attrs);
- }
- static occur(attrs) {
- return new Occur(attrs);
- }
- static oid(attrs) {
- return new Oid(attrs);
- }
- static oids(attrs) {
- return new Oids(attrs);
- }
- static overflow(attrs) {
- return new Overflow(attrs);
- }
- static pageArea(attrs) {
- return new PageArea(attrs);
- }
- static pageSet(attrs) {
- return new PageSet(attrs);
- }
- static para(attrs) {
- return new Para(attrs);
- }
- static passwordEdit(attrs) {
- return new PasswordEdit(attrs);
- }
- static pattern(attrs) {
- return new Pattern(attrs);
- }
- static picture(attrs) {
- return new Picture(attrs);
- }
- static proto(attrs) {
- return new Proto(attrs);
- }
- static radial(attrs) {
- return new Radial(attrs);
- }
- static reason(attrs) {
- return new Reason(attrs);
- }
- static reasons(attrs) {
- return new Reasons(attrs);
- }
- static rectangle(attrs) {
- return new Rectangle(attrs);
- }
- static ref(attrs) {
- return new RefElement(attrs);
- }
- static script(attrs) {
- return new Script(attrs);
- }
- static setProperty(attrs) {
- return new SetProperty(attrs);
- }
- static signData(attrs) {
- return new SignData(attrs);
- }
- static signature(attrs) {
- return new Signature(attrs);
- }
- static signing(attrs) {
- return new Signing(attrs);
- }
- static solid(attrs) {
- return new Solid(attrs);
- }
- static speak(attrs) {
- return new Speak(attrs);
- }
- static stipple(attrs) {
- return new Stipple(attrs);
- }
- static subform(attrs) {
- return new Subform(attrs);
- }
- static subformSet(attrs) {
- return new SubformSet(attrs);
- }
- static subjectDN(attrs) {
- return new SubjectDN(attrs);
- }
- static subjectDNs(attrs) {
- return new SubjectDNs(attrs);
- }
- static submit(attrs) {
- return new Submit(attrs);
- }
- static template(attrs) {
- return new Template(attrs);
- }
- static text(attrs) {
- return new Text(attrs);
- }
- static textEdit(attrs) {
- return new TextEdit(attrs);
- }
- static time(attrs) {
- return new Time(attrs);
- }
- static timeStamp(attrs) {
- return new TimeStamp(attrs);
- }
- static toolTip(attrs) {
- return new ToolTip(attrs);
- }
- static traversal(attrs) {
- return new Traversal(attrs);
- }
- static traverse(attrs) {
- return new Traverse(attrs);
- }
- static ui(attrs) {
- return new Ui(attrs);
- }
- static validate(attrs) {
- return new Validate(attrs);
- }
- static value(attrs) {
- return new Value(attrs);
- }
- static variables(attrs) {
- return new Variables(attrs);
- }
- }
- exports.TemplateNamespace = TemplateNamespace;
|