/* istanbul ignore next */
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
define(["require", "exports", "./multiple-value-field"], function (require, exports, multiple_value_field_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var PdfCompositeField = (function (_super) {
__extends(PdfCompositeField, _super);
function PdfCompositeField(font, brush, text) {
var list = [];
for (var _i = 3; _i < arguments.length; _i++) {
list[_i - 3] = arguments[_i];
}
var _this = _super.call(this) || this;
_this.internalAutomaticFields = null;
_this.internalText = '';
_this.font = font;
_this.brush = brush;
_this.text = text;
_this.automaticFields = list;
return _this;
}
Object.defineProperty(PdfCompositeField.prototype, "text", {
get: function () {
return this.internalText;
},
set: function (value) {
this.internalText = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(PdfCompositeField.prototype, "automaticFields", {
get: function () {
return this.internalAutomaticFields;
},
set: function (value) {
this.internalAutomaticFields = value;
},
enumerable: true,
configurable: true
});
PdfCompositeField.prototype.getValue = function (graphics) {
var values = [];
var text = this.text.toString();
Eif (typeof this.automaticFields !== 'undefined' && this.automaticFields != null && this.automaticFields.length > 0) {
for (var i = 0; i < this.automaticFields.length; i++) {
var automaticField = this.automaticFields[i];
text = text.replace('{' + i + '}', automaticField.getValue(graphics));
}
}
return text;
};
return PdfCompositeField;
}(multiple_value_field_1.PdfMultipleValueField));
exports.PdfCompositeField = PdfCompositeField;
});
|