all files / structured-elements/grid/styles/ pdf-borders.js

64.47% Statements 49/76
20% Branches 1/5
56% Functions 14/25
64.47% Lines 49/76
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162   226× 226× 226× 226× 226× 226× 226× 226× 226× 226× 226× 226×     1120×                 671×                 1123×                 896×                                         226×                                     670×                   448×                   670×                   448×                                          
define(["require", "exports", "./../../../graphics/pdf-pen", "./../../../graphics/enum", "./../../../graphics/pdf-color"], function (require, exports, pdf_pen_1, enum_1, pdf_color_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PdfBorders = (function () {
        function PdfBorders() {
            var defaultBorderPenLeft = new pdf_pen_1.PdfPen(new pdf_color_1.PdfColor(0, 0, 0));
            defaultBorderPenLeft.dashStyle = enum_1.PdfDashStyle.Solid;
            var defaultBorderPenRight = new pdf_pen_1.PdfPen(new pdf_color_1.PdfColor(0, 0, 0));
            defaultBorderPenRight.dashStyle = enum_1.PdfDashStyle.Solid;
            var defaultBorderPenTop = new pdf_pen_1.PdfPen(new pdf_color_1.PdfColor(0, 0, 0));
            defaultBorderPenTop.dashStyle = enum_1.PdfDashStyle.Solid;
            var defaultBorderPenBottom = new pdf_pen_1.PdfPen(new pdf_color_1.PdfColor(0, 0, 0));
            defaultBorderPenBottom.dashStyle = enum_1.PdfDashStyle.Solid;
            this.leftPen = defaultBorderPenLeft;
            this.rightPen = defaultBorderPenRight;
            this.topPen = defaultBorderPenTop;
            this.bottomPen = defaultBorderPenBottom;
        }
        Object.defineProperty(PdfBorders.prototype, "left", {
            get: function () {
                return this.leftPen;
            },
            set: function (value) {
                this.leftPen = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfBorders.prototype, "right", {
            get: function () {
                return this.rightPen;
            },
            set: function (value) {
                this.rightPen = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfBorders.prototype, "top", {
            get: function () {
                return this.topPen;
            },
            set: function (value) {
                this.topPen = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfBorders.prototype, "bottom", {
            get: function () {
                return this.bottomPen;
            },
            set: function (value) {
                this.bottomPen = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfBorders.prototype, "all", {
            set: function (value) {
                this.leftPen = this.rightPen = this.topPen = this.bottomPen = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfBorders.prototype, "isAll", {
            get: function () {
                return ((this.leftPen === this.rightPen) && (this.leftPen === this.topPen) && (this.leftPen === this.bottomPen));
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfBorders, "default", {
            get: function () {
                return new PdfBorders();
            },
            enumerable: true,
            configurable: true
        });
        return PdfBorders;
    }());
    exports.PdfBorders = PdfBorders;
    var PdfPaddings = (function () {
        function PdfPaddings(left, right, top, bottom) {
            this.hasLeftPad = false;
            this.hasRightPad = false;
            this.hasTopPad = false;
            this.hasBottomPad = false;
            Eif (typeof left === 'undefined') {
                this.bottomPad = this.topPad = this.leftPad = this.rightPad = 0.5;
            }
            else {
                this.leftPad = left;
                this.rightPad = right;
                this.topPad = top;
                this.bottomPad = bottom;
                this.hasLeftPad = true;
                this.hasRightPad = true;
                this.hasTopPad = true;
                this.hasBottomPad = true;
            }
        }
        Object.defineProperty(PdfPaddings.prototype, "left", {
            get: function () {
                return this.leftPad;
            },
            set: function (value) {
                this.leftPad = value;
                this.hasLeftPad = true;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfPaddings.prototype, "right", {
            get: function () {
                return this.rightPad;
            },
            set: function (value) {
                this.rightPad = value;
                this.hasRightPad = true;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfPaddings.prototype, "top", {
            get: function () {
                return this.topPad;
            },
            set: function (value) {
                this.topPad = value;
                this.hasTopPad = true;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfPaddings.prototype, "bottom", {
            get: function () {
                return this.bottomPad;
            },
            set: function (value) {
                this.bottomPad = value;
                this.hasBottomPad = true;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfPaddings.prototype, "all", {
            set: function (value) {
                this.leftPad = this.rightPad = this.topPad = this.bottomPad = value;
                this.hasLeftPad = true;
                this.hasRightPad = true;
                this.hasTopPad = true;
                this.hasBottomPad = true;
            },
            enumerable: true,
            configurable: true
        });
        return PdfPaddings;
    }());
    exports.PdfPaddings = PdfPaddings;
});