reportbro-designer
Advanced tools
Comparing version 1.3.4 to 1.4.0
# Changelog | ||
## [1.4.0] - 2020-04-20 | ||
### Features | ||
* dynamic document element panel which allows modifying multiple | ||
document elements (also of different kinds) at once | ||
### Changes | ||
* add selectCallback which is called when an object is selected/deselected | ||
* add isModified API method to return modified flag | ||
* allow image parameter type in list parameter | ||
* add smaller font sizes to drop down (starting from 4) | ||
* show image preview for images specified by url | ||
### Bug Fixes | ||
* fix initialization of ReportBro when called without properties | ||
* fix adding new elements when preview tab exists (Chrome on macOS) | ||
## [1.3.4] - 2019-12-23 | ||
@@ -4,0 +21,0 @@ |
@@ -1,2 +0,2 @@ | ||
/*! JsBarcode v3.9.0 | (c) Johan Lindell | MIT license */ | ||
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function t(e,n){r(this,t),this.data=e,this.text=n.text||e,this.options=n};e.default=o},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var o,i=e.SET_A=0,a=e.SET_B=1,u=e.SET_C=2,f=(e.SHIFT=98,e.START_A=103),c=e.START_B=104,s=e.START_C=105;e.MODULO=103,e.STOP=106,e.FNC1=207,e.SET_BY_CODE=(o={},r(o,f,i),r(o,c,a),r(o,s,u),o),e.SWAP={101:i,100:a,99:u},e.A_START_CHAR=String.fromCharCode(208),e.B_START_CHAR=String.fromCharCode(209),e.C_START_CHAR=String.fromCharCode(210),e.A_CHARS="[\0-_È-Ï]",e.B_CHARS="[ -È-Ï]",e.C_CHARS="(Ï*[0-9]{2}Ï*)",e.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SIDE_BIN="101",e.MIDDLE_BIN="01010",e.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},e.EAN2_STRUCTURE=["LL","LG","GL","GG"],e.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],e.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=function(t,e,n){var o=t.split("").map(function(t,n){return r.BINARIES[e[n]]}).map(function(e,n){return e?e[t[n]]:""});if(n){var i=t.length-1;o=o.map(function(t,e){return e<i?t+n:t})}return o.join("")};e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(0),c=function(t){return t&&t.__esModule?t:{default:t}}(f),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),u(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]),r=n.toString(2);r=a(r,4-r.length);for(var o=0;o<r.length;o++)t+="0"==r[o]?"100":"110"}return t+="1001",{data:t,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),e}(c.default);e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=function(t,e){return r({},t,e)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=n(1),s=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return i.bytes=t.split("").map(function(t){return t.charCodeAt(0)}),i}return i(e,t),a(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=c.SET_BY_CODE[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&t.unshift(c.FNC1);var o=e.next(t,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(n)+o.result+e.getBar((o.checksum+n)%c.MODULO)+e.getBar(c.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||!1;return"string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return c.BARS[t]?c.BARS[t].toString():""}},{key:"correctIndex",value:function(t,e){if(e===c.SET_A){var n=t.shift();return n<32?n+64:n-32}return e===c.SET_B?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return{result:"",checksum:0};var o=void 0,i=void 0;if(t[0]>=200){i=t.shift()-105;var a=c.SWAP[i];void 0!==a?o=e.next(t,n+1,a):(r!==c.SET_A&&r!==c.SET_B||i!==c.SHIFT||(t[0]=r===c.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),o=e.next(t,n+1,r))}else i=e.correctIndex(t,r),o=e.next(t,n+1,r);var u=e.getBar(i),f=i*n;return{result:u+o.result,checksum:f+o.checksum}}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10)}return(10-e%10)%10}function o(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){e+=n[r%n.length]*parseInt(t[t.length-1-r])}return(11-e%11)%11}Object.defineProperty(e,"__esModule",{value:!0}),e.mod10=r,e.mod11=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.name="InvalidInputException",i.symbology=t,i.input=n,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return i(e,t),e}(Error),u=function(t){function e(){r(this,e);var t=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return i(e,t),e}(Error),f=function(t){function e(){r(this,e);var t=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return i(e,t),e}(Error);e.InvalidInputException=a,e.InvalidElementException=u,e.NoElementException=f},function(t,e,n){"use strict";function r(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],"string"==typeof t[n]&&(t[n]=parseInt(t[n],10)));return"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue),t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(2),c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return a(e,t),u(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return(0,s.default)(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return(0,s.default)(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},e={height:this.guardHeight};return[{data:f.SIDE_BIN,options:e},{data:this.leftEncode(),text:this.leftText(),options:t},{data:f.MIDDLE_BIN,options:e},{data:this.rightEncode(),text:this.rightText(),options:t},{data:f.SIDE_BIN,options:e}]}},{key:"encodeFlat",value:function(){return{data:[f.SIDE_BIN,this.leftEncode(),f.MIDDLE_BIN,this.rightEncode(),f.SIDE_BIN].join(""),text:this.text}}}]),e}(p.default);e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10}Object.defineProperty(e,"__esModule",{value:!0});var f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.checksum=u;var c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=u(t));var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return a(e,t),f(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==u(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=(0,s.default)(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=(0,s.default)(this.data.substr(6,6),"RRRRRR"),t+="101",{data:t,text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+(0,s.default)(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:(0,s.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:(0,s.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:(0,s.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),e}(p.default);e.default=d},function(t,e,n){"use strict";function r(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function i(t,e,n){for(var i=0;i<t.length;i++){var a,u=t[i],c=(0,s.default)(e,u.options);a=c.displayValue?f(u.text,c,n):0;var l=u.data.length*c.width;u.width=Math.ceil(Math.max(a,l)),u.height=r(u,c),u.barcodePadding=o(a,l,c)}}function a(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function u(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function f(t,e,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d")}return r.font=e.fontOptions+" "+e.fontSize+"px "+e.font,r.measureText(t).width}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var c=n(5),s=function(t){return t&&t.__esModule?t:{default:t}}(c);e.getMaximumHeightOfEncodings=u,e.getEncodingHeight=r,e.getBarcodePadding=o,e.calculateEncodingAttributes=i,e.getTotalWidthOfEncodings=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),o=n(25),i=n(32),a=n(35),u=n(34),f=n(40),c=n(42),s=n(41),l=n(33);e.default={CODE39:r.CODE39,CODE128:o.CODE128,CODE128A:o.CODE128A,CODE128B:o.CODE128B,CODE128C:o.CODE128C,EAN13:i.EAN13,EAN8:i.EAN8,EAN5:i.EAN5,EAN2:i.EAN2,UPC:i.UPC,UPCE:i.UPCE,ITF14:a.ITF14,ITF:u.ITF,MSI:f.MSI,MSI10:f.MSI10,MSI11:f.MSI11,MSI1010:f.MSI1010,MSI1110:f.MSI1110,pharmacode:c.pharmacode,codabar:s.codabar,GenericBarcode:l.GenericBarcode}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e){r(this,t),this.api=e}return o(t,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(t){return this.handleCatch(t),this.api}}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){if("string"==typeof t)return i(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(o(t[n]));return e}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement)return a(t);if(t&&"svg"===t.nodeName||"undefined"!=typeof SVGElement&&t instanceof SVGElement)return{element:t,options:(0,c.default)(t),renderer:l.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return{element:t,options:(0,c.default)(t),renderer:l.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:l.default.CanvasRenderer};if(t&&"object"===(void 0===t?"undefined":u(t))&&!t.nodeName)return{element:t,renderer:l.default.ObjectRenderer};throw new p.InvalidElementException}function i(t){var e=document.querySelectorAll(t);if(0!==e.length){for(var n=[],r=0;r<e.length;r++)n.push(o(e[r]));return n}}function a(t){var e=document.createElement("canvas");return{element:e,options:(0,c.default)(t),renderer:l.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}Object.defineProperty(e,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=n(43),c=r(f),s=n(45),l=r(s),p=n(8);e.default=o},function(t,e,n){"use strict";function r(t){function e(t){if(Array.isArray(t))for(var r=0;r<t.length;r++)e(t[r]);else t.text=t.text||"",t.data=t.data||"",n.push(t)}var n=[];return e(t),n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new E.InvalidInputException(r.constructor.name,t);var o=r.encode();o=(0,p.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0,s.default)(n,o[i].options);return o}function i(){return f.default.CODE128?"CODE128":Object.keys(f.default)[0]}function a(t,e,n){e=(0,p.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0,s.default)(n,e[r].options),(0,h.default)(e[r].options);(0,h.default)(n),new(0,t.renderer)(t.element,e,n).render(),t.afterRender&&t.afterRender()}var u=n(14),f=r(u),c=n(5),s=r(c),l=n(18),p=r(l),d=n(16),h=r(d),y=n(17),b=r(y),v=n(9),_=r(v),g=n(15),O=r(g),E=n(8),w=n(10),m=r(w),j=function(){},x=function(t,e,n){var r=new j;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=(0,b.default)(t),r._encodings=[],r._options=m.default,r._errorHandler=new O.default(r),void 0!==e&&(n=n||{},n.format||(n.format=i()),r.options(n)[n.format](e,n).render()),r};x.getModule=function(t){return f.default[t]};for(var P in f.default)f.default.hasOwnProperty(P)&&function(t,e){j.prototype[e]=j.prototype[e.toUpperCase()]=j.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){r.text=void 0===r.text?void 0:""+r.text;var a=(0,s.default)(i._options,r);a=(0,_.default)(a);var u=t[e],f=o(n,u,a);return i._encodings.push(f),i})}}(f.default,P);j.prototype.options=function(t){return this._options=(0,s.default)(this._options,t),this},j.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},j.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var n=(0,s.default)(this._options,t.options);"auto"==n.format&&(n.format=i()),this._errorHandler.wrapBarcodeCall(function(){var e=n.value,r=f.default[n.format.toUpperCase()],i=o(e,r,n);a(t,i,n)})}}},j.prototype.render=function(){if(!this._renderProperties)throw new E.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)a(this._renderProperties[t],this._encodings,this._options);else a(this._renderProperties,this._encodings,this._options);return this},j.prototype._defaults=m.default,"undefined"!=typeof window&&(window.JsBarcode=x),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),x(n,t,e)}),t.exports=x},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(6),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=n(1),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c.A_START_CHAR+t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return new RegExp("^"+c.A_CHARS+"+$").test(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(6),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=n(1),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c.B_START_CHAR+t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return new RegExp("^"+c.B_CHARS+"+$").test(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(6),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=n(1),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c.C_START_CHAR+t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return new RegExp("^"+c.C_CHARS+"+$").test(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(6),f=r(u),c=n(24),s=r(c),l=function(t){function e(t,n){if(o(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,s.default)(t),n));else var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i(r)}return a(e,t),e}(f.default);e.default=l},function(t,e,n){"use strict";function r(t,e){var n=e?i.A_CHARS:i.B_CHARS,a=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(a)return a[1]+String.fromCharCode(204)+o(t.substring(a[1].length));var u=t.match(new RegExp("^"+n+"+"))[0];return u.length===t.length?t:u+String.fromCharCode(e?205:206)+r(t.substring(u.length),!e)}function o(t){var e=f(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var o=a(t)>=u(t);return e+String.fromCharCode(o?206:205)+r(t,o)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),a=function(t){return t.match(new RegExp("^"+i.A_CHARS+"*"))[0].length},u=function(t){return t.match(new RegExp("^"+i.B_CHARS+"*"))[0].length},f=function(t){return t.match(new RegExp("^"+i.C_CHARS+"*"))[0]};e.default=function(t){var e=void 0;if(f(t).length>=2)e=i.C_START_CHAR+o(t);else{var n=a(t)>u(t);e=(n?i.A_START_CHAR:i.B_START_CHAR)+r(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.CODE128C=e.CODE128B=e.CODE128A=e.CODE128=void 0;var o=n(23),i=r(o),a=n(20),u=r(a),f=n(21),c=r(f),s=n(22),l=r(s);e.CODE128=i.default,e.CODE128A=u.default,e.CODE128B=c.default,e.CODE128C=l.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){return u(c(t))}function u(t){return b[t].toString(2)}function f(t){return y[t]}function c(t){return y.indexOf(t)}function s(t){for(var e=0,n=0;n<t.length;n++)e+=c(t[n]);return e%=43}Object.defineProperty(e,"__esModule",{value:!0}),e.CODE39=void 0;var l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),p=n(0),d=function(t){return t&&t.__esModule?t:{default:t}}(p),h=function(t){function e(t,n){return r(this,e),t=t.toUpperCase(),n.mod43&&(t+=f(s(t))),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),l(e,[{key:"encode",value:function(){for(var t=a("*"),e=0;e<this.data.length;e++)t+=a(this.data[e])+"0";return t+=a("*"),{data:t,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),e}(d.default),y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],b=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];e.CODE39=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},f=n(2),c=n(11),s=function(t){return t&&t.__esModule?t:{default:t}}(c),l=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+3*e:t+e},0)%10)%10},p=function(t){function e(t,n){r(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=l(t));var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.lastChar=n.lastChar,i}return i(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),n=f.EAN13_STRUCTURE[this.data[0]];return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,n)}},{key:"rightText",value:function(){return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),e}(s.default);e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(2),c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){function e(t,n){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return a(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=f.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,s.default)(this.data,t,"01"),text:this.text}}}]),e}(p.default);e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(2),c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){return t.split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+9*e:t+3*e},0)%10},h=function(t){function e(t,n){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return a(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t=f.EAN5_STRUCTURE[d(this.data)];return{data:"1011"+(0,s.default)(this.data,t,"01"),text:this.text}}}]),e}(p.default);e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},f=n(11),c=function(t){return t&&t.__esModule?t:{default:t}}(f),s=function(t){return(10-t.substr(0,7).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+e:t+3*e},0)%10)%10},l=function(t){function e(t,n){return r(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=s(t)),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===s(this.data)}},{key:"leftText",value:function(){return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),e}(c.default);e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){for(var n=parseInt(t[t.length-1]),r=h[n],o="",i=0,a=0;a<r.length;a++){var u=r[a];o+="X"===u?t[i++]:u}return""+(o=""+e+o)+(0,d.checksum)(o)}Object.defineProperty(e,"__esModule",{value:!0});var f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=n(3),s=r(c),l=n(0),p=r(l),d=n(12),h=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],y=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],b=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,-1!==t.search(/^[0-9]{6}$/))r.middleDigits=t,r.upcA=u(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else{if(-1===t.search(/^[01][0-9]{7}$/))return i(r);if(r.middleDigits=t.substring(1,t.length-1),r.upcA=u(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]!==t[t.length-1])return i(r);r.isValid=!0}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return a(e,t),f(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),t+="010101",{data:t,text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],e=this.upcA[this.upcA.length-1],n=y[parseInt(e)][parseInt(t)];return(0,s.default)(this.middleDigits,n)}}]),e}(p.default);e.default=b},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPCE=e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var o=n(27),i=r(o),a=n(30),u=r(a),f=n(29),c=r(f),s=n(28),l=r(s),p=n(12),d=r(p),h=n(31),y=r(h);e.EAN13=i.default,e.EAN8=u.default,e.EAN5=c.default,e.EAN2=l.default,e.UPC=d.default,e.UPCE=y.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GenericBarcode=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),a(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(f.default);e.GenericBarcode=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ITF=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},i}return i(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){for(var t="1010",e=0;e<this.data.length;e+=2)t+=this.calculatePair(this.data.substr(e,2));return t+="11101",{data:t,text:this.text}}},{key:"calculatePair",value:function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],o=0;o<5;o++)e+="1"==n[o]?"111":"1",e+="1"==r[o]?"000":"0";return e}}]),e}(f.default);e.ITF=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){for(var e=0,n=0;n<13;n++)e+=parseInt(t[n])*(3-n%2*2);return 10*Math.ceil(e/10)-e}Object.defineProperty(e,"__esModule",{value:!0}),e.ITF14=void 0;var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(0),c=function(t){return t&&t.__esModule?t:{default:t}}(f),s=function(t){function e(t,n){r(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=a(t));var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},i}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&this.data[13]==a(this.data)}},{key:"encode",value:function(){for(var t="1010",e=0;e<14;e+=2)t+=this.calculatePair(this.data.substr(e,2));return t+="11101",{data:t,text:this.text}}},{key:"calculatePair",value:function(t){for(var e="",n=this.binaryRepresentation[t[0]],r=this.binaryRepresentation[t[1]],o=0;o<5;o++)e+="1"==n[o]?"111":"1",e+="1"==r[o]?"000":"0";return e}}]),e}(c.default);e.ITF14=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(4),u=function(t){return t&&t.__esModule?t:{default:t}}(a),f=n(7),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,f.mod10)(t),n))}return i(e,t),e}(u.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(4),u=function(t){return t&&t.__esModule?t:{default:t}}(a),f=n(7),c=function(t){function e(t,n){return r(this,e),t+=(0,f.mod10)(t),t+=(0,f.mod10)(t),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),e}(u.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(4),u=function(t){return t&&t.__esModule?t:{default:t}}(a),f=n(7),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,f.mod11)(t),n))}return i(e,t),e}(u.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(4),u=function(t){return t&&t.__esModule?t:{default:t}}(a),f=n(7),c=function(t){function e(t,n){return r(this,e),t+=(0,f.mod11)(t),t+=(0,f.mod10)(t),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),e}(u.default);e.default=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MSI1110=e.MSI1010=e.MSI11=e.MSI10=e.MSI=void 0;var o=n(4),i=r(o),a=n(36),u=r(a),f=n(38),c=r(f),s=n(37),l=r(s),p=n(39),d=r(p);e.MSI=i.default,e.MSI10=u.default,e.MSI11=c.default,e.MSI1010=l.default,e.MSI1110=d.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.codabar=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=function(t){function e(t,n){r(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return i.text=i.options.text||i.text.replace(/[A-D]/g,""),i}return i(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return{text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(f.default);e.codabar=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.pharmacode=void 0;var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(u),c=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.number=parseInt(t,10),i}return i(e,t),a(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return e=e.slice(0,-2),{data:e,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(f.default);e.pharmacode=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e={};for(var n in f.default)f.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,a.default)(e)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),a=r(i),u=n(10),f=r(u);e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(5),a=function(t){return t&&t.__esModule?t:{default:t}}(i),u=n(13),f=function(){function t(e,n,o){r(this,t),this.canvas=e,this.encodings=n,this.options=o}return o(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=(0,a.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,u.calculateEncodingAttributes)(this.encodings,this.options,t);var e=(0,u.getTotalWidthOfEncodings)(this.encodings),n=(0,u.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),o=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var i=0;i<o.length;i++){var a=i*t.width+e.barcodePadding;"1"===o[i]?r.fillRect(a,n,t.width,t.height):o[i]&&r.fillRect(a,n,t.width,t.height*o[i])}}},{key:"drawCanvasText",value:function(t,e){var n=this.canvas.getContext("2d"),r=t.fontOptions+" "+t.fontSize+"px "+t.font;if(t.displayValue){var o,i;i="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,n.font=r,"left"==t.textAlign||e.barcodePadding>0?(o=0,n.textAlign="left"):"right"==t.textAlign?(o=e.width-1,n.textAlign="right"):(o=e.width/2,n.textAlign="center"),n.fillText(e.text,o,i)}}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),t}();e.default=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(44),i=r(o),a=n(47),u=r(a),f=n(46),c=r(f);e.default={CanvasRenderer:i.default,SVGRenderer:u.default,ObjectRenderer:c.default}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,n,o){r(this,t),this.object=e,this.encodings=n,this.options=o}return o(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(5),a=function(t){return t&&t.__esModule?t:{default:t}}(i),u=n(13),f="http://www.w3.org/2000/svg",c=function(){function t(e,n,o){r(this,t),this.svg=e,this.encodings=n,this.options=o,this.document=o.xmlDocument||document}return o(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=(0,a.default)(this.options,n.options),o=this.createGroup(t,r.marginTop,this.svg);this.setGroupOptions(o,r),this.drawSvgBarcode(o,r,n),this.drawSVGText(o,r,n),t+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,u.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,u.getTotalWidthOfEncodings)(this.encodings),e=(0,u.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,e,n){var r,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var i=0,a=0,u=0;u<o.length;u++)a=u*e.width+n.barcodePadding,"1"===o[u]?i++:i>0&&(this.drawRect(a-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&this.drawRect(a-e.width*(i-1),r,e.width*i,e.height,t)}},{key:"drawSVGText",value:function(t,e,n){var r=this.document.createElementNS(f,"text");if(e.displayValue){var o,i;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),i="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(o=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(o=n.width-1,r.setAttribute("text-anchor","end")):(o=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",o),r.setAttribute("y",i),r.appendChild(this.document.createTextNode(n.text)),t.appendChild(r)}}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",f),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(f,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}},{key:"drawRect",value:function(t,e,n,r,o){var i=this.document.createElementNS(f,"rect");return i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i),i}}]),t}();e.default=c}]); | ||
/*! JsBarcode v3.11.0 | (c) Johan Lindell | MIT license */ | ||
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function t(e,n){r(this,t),this.data=e,this.text=n.text||e,this.options=n};e.default=o},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var o,i=e.SET_A=0,u=e.SET_B=1,a=e.SET_C=2,f=(e.SHIFT=98,e.START_A=103),c=e.START_B=104,s=e.START_C=105;e.MODULO=103,e.STOP=106,e.FNC1=207,e.SET_BY_CODE=(o={},r(o,f,i),r(o,c,u),r(o,s,a),o),e.SWAP={101:i,100:u,99:a},e.A_START_CHAR=String.fromCharCode(208),e.B_START_CHAR=String.fromCharCode(209),e.C_START_CHAR=String.fromCharCode(210),e.A_CHARS="[\0-_È-Ï]",e.B_CHARS="[ -È-Ï]",e.C_CHARS="(Ï*[0-9]{2}Ï*)",e.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SIDE_BIN="101",e.MIDDLE_BIN="01010",e.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},e.EAN2_STRUCTURE=["LL","LG","GL","GG"],e.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],e.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=function(t,e,n){var o=t.split("").map(function(t,n){return r.BINARIES[e[n]]}).map(function(e,n){return e?e[t[n]]:""});if(n){var i=t.length-1;o=o.map(function(t,e){return e<i?t+n:t})}return o.join("")};e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(0),c=function(t){return t&&t.__esModule?t:{default:t}}(f),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),a(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]),r=n.toString(2);r=u(r,4-r.length);for(var o=0;o<r.length;o++)t+="0"==r[o]?"100":"110"}return t+="1001",{data:t,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),e}(c.default);e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=function(t,e){return r({},t,e)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=n(1),s=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return i.bytes=t.split("").map(function(t){return t.charCodeAt(0)}),i}return i(e,t),u(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=c.SET_BY_CODE[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&t.unshift(c.FNC1);var o=e.next(t,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(n)+o.result+e.getBar((o.checksum+n)%c.MODULO)+e.getBar(c.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||!1;return"string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return c.BARS[t]?c.BARS[t].toString():""}},{key:"correctIndex",value:function(t,e){if(e===c.SET_A){var n=t.shift();return n<32?n+64:n-32}return e===c.SET_B?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return{result:"",checksum:0};var o=void 0,i=void 0;if(t[0]>=200){i=t.shift()-105;var u=c.SWAP[i];void 0!==u?o=e.next(t,n+1,u):(r!==c.SET_A&&r!==c.SET_B||i!==c.SHIFT||(t[0]=r===c.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),o=e.next(t,n+1,r))}else i=e.correctIndex(t,r),o=e.next(t,n+1,r);var a=e.getBar(i),f=i*n;return{result:a+o.result,checksum:f+o.checksum}}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10)}return(10-e%10)%10}function o(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){e+=n[r%n.length]*parseInt(t[t.length-1-r])}return(11-e%11)%11}Object.defineProperty(e,"__esModule",{value:!0}),e.mod10=r,e.mod11=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.name="InvalidInputException",i.symbology=t,i.input=n,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return i(e,t),e}(Error),a=function(t){function e(){r(this,e);var t=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return i(e,t),e}(Error),f=function(t){function e(){r(this,e);var t=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return i(e,t),e}(Error);e.InvalidInputException=u,e.InvalidElementException=a,e.NoElementException=f},function(t,e,n){"use strict";function r(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],"string"==typeof t[n]&&(t[n]=parseInt(t[n],10)));return"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue),t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(2),c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return u(e,t),a(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return(0,s.default)(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return(0,s.default)(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},e={height:this.guardHeight};return[{data:f.SIDE_BIN,options:e},{data:this.leftEncode(),text:this.leftText(),options:t},{data:f.MIDDLE_BIN,options:e},{data:this.rightEncode(),text:this.rightText(),options:t},{data:f.SIDE_BIN,options:e}]}},{key:"encodeFlat",value:function(){return{data:[f.SIDE_BIN,this.leftEncode(),f.MIDDLE_BIN,this.rightEncode(),f.SIDE_BIN].join(""),text:this.text}}}]),e}(p.default);e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10}Object.defineProperty(e,"__esModule",{value:!0});var f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.checksum=a;var c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){function e(t,n){o(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=a(t));var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return u(e,t),f(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==a(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=(0,s.default)(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=(0,s.default)(this.data.substr(6,6),"RRRRRR"),t+="101",{data:t,text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+(0,s.default)(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:(0,s.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:(0,s.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:(0,s.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),e}(p.default);e.default=d},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(36),f=n(0),c=function(t){return t&&t.__esModule?t:{default:t}}(f),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var t=this,e=this.data.match(/.{2}/g).map(function(e){return t.encodePair(e)}).join("");return{data:a.START_BIN+e+a.END_BIN,text:this.text}}},{key:"encodePair",value:function(t){var e=a.BINARIES[t[1]];return a.BINARIES[t[0]].split("").map(function(t,n){return("1"===t?"111":"1")+("1"===e[n]?"000":"0")}).join("")}}]),e}(c.default);e.default=s},function(t,e,n){"use strict";function r(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function o(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function i(t,e,n){for(var i=0;i<t.length;i++){var u,a=t[i],c=(0,s.default)(e,a.options);u=c.displayValue?f(a.text,c,n):0;var l=a.data.length*c.width;a.width=Math.ceil(Math.max(u,l)),a.height=r(a,c),a.barcodePadding=o(u,l,c)}}function u(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function a(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function f(t,e,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d")}return r.font=e.fontOptions+" "+e.fontSize+"px "+e.font,r.measureText(t).width}Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalWidthOfEncodings=e.calculateEncodingAttributes=e.getBarcodePadding=e.getEncodingHeight=e.getMaximumHeightOfEncodings=void 0;var c=n(5),s=function(t){return t&&t.__esModule?t:{default:t}}(c);e.getMaximumHeightOfEncodings=a,e.getEncodingHeight=r,e.getBarcodePadding=o,e.calculateEncodingAttributes=i,e.getTotalWidthOfEncodings=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(27),o=n(26),i=n(33),u=n(37),a=n(42),f=n(44),c=n(43),s=n(34);e.default={CODE39:r.CODE39,CODE128:o.CODE128,CODE128A:o.CODE128A,CODE128B:o.CODE128B,CODE128C:o.CODE128C,EAN13:i.EAN13,EAN8:i.EAN8,EAN5:i.EAN5,EAN2:i.EAN2,UPC:i.UPC,UPCE:i.UPCE,ITF14:u.ITF14,ITF:u.ITF,MSI:a.MSI,MSI10:a.MSI10,MSI11:a.MSI11,MSI1010:a.MSI1010,MSI1110:a.MSI1110,pharmacode:f.pharmacode,codabar:c.codabar,GenericBarcode:s.GenericBarcode}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e){r(this,t),this.api=e}return o(t,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(t){return this.handleCatch(t),this.api}}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){if("string"==typeof t)return i(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(o(t[n]));return e}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement)return u(t);if(t&&"svg"===t.nodeName||"undefined"!=typeof SVGElement&&t instanceof SVGElement)return{element:t,options:(0,c.default)(t),renderer:l.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return{element:t,options:(0,c.default)(t),renderer:l.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:l.default.CanvasRenderer};if(t&&"object"===(void 0===t?"undefined":a(t))&&!t.nodeName)return{element:t,renderer:l.default.ObjectRenderer};throw new p.InvalidElementException}function i(t){var e=document.querySelectorAll(t);if(0!==e.length){for(var n=[],r=0;r<e.length;r++)n.push(o(e[r]));return n}}function u(t){var e=document.createElement("canvas");return{element:e,options:(0,c.default)(t),renderer:l.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=n(45),c=r(f),s=n(47),l=r(s),p=n(8);e.default=o},function(t,e,n){"use strict";function r(t){function e(t){if(Array.isArray(t))for(var r=0;r<t.length;r++)e(t[r]);else t.text=t.text||"",t.data=t.data||"",n.push(t)}var n=[];return e(t),n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){t=""+t;var r=new e(t,n);if(!r.valid())throw new E.InvalidInputException(r.constructor.name,t);var o=r.encode();o=(0,p.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0,s.default)(n,o[i].options);return o}function i(){return f.default.CODE128?"CODE128":Object.keys(f.default)[0]}function u(t,e,n){e=(0,p.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0,s.default)(n,e[r].options),(0,h.default)(e[r].options);(0,h.default)(n),new(0,t.renderer)(t.element,e,n).render(),t.afterRender&&t.afterRender()}var a=n(15),f=r(a),c=n(5),s=r(c),l=n(19),p=r(l),d=n(17),h=r(d),y=n(18),b=r(y),_=n(9),v=r(_),g=n(16),O=r(g),E=n(8),w=n(10),m=r(w),j=function(){},x=function(t,e,n){var r=new j;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=(0,b.default)(t),r._encodings=[],r._options=m.default,r._errorHandler=new O.default(r),void 0!==e&&(n=n||{},n.format||(n.format=i()),r.options(n)[n.format](e,n).render()),r};x.getModule=function(t){return f.default[t]};for(var P in f.default)f.default.hasOwnProperty(P)&&function(t,e){j.prototype[e]=j.prototype[e.toUpperCase()]=j.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){r.text=void 0===r.text?void 0:""+r.text;var u=(0,s.default)(i._options,r);u=(0,v.default)(u);var a=t[e],f=o(n,a,u);return i._encodings.push(f),i})}}(f.default,P);j.prototype.options=function(t){return this._options=(0,s.default)(this._options,t),this},j.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},j.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var n=(0,s.default)(this._options,t.options);"auto"==n.format&&(n.format=i()),this._errorHandler.wrapBarcodeCall(function(){var e=n.value,r=f.default[n.format.toUpperCase()],i=o(e,r,n);u(t,i,n)})}}},j.prototype.render=function(){if(!this._renderProperties)throw new E.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)u(this._renderProperties[t],this._encodings,this._options);else u(this._renderProperties,this._encodings,this._options);return this},j.prototype._defaults=m.default,"undefined"!=typeof window&&(window.JsBarcode=x),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),x(n,t,e)}),t.exports=x},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(6),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=n(1),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c.A_START_CHAR+t,n))}return i(e,t),u(e,[{key:"valid",value:function(){return new RegExp("^"+c.A_CHARS+"+$").test(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(6),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=n(1),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c.B_START_CHAR+t,n))}return i(e,t),u(e,[{key:"valid",value:function(){return new RegExp("^"+c.B_CHARS+"+$").test(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(6),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=n(1),s=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c.C_START_CHAR+t,n))}return i(e,t),u(e,[{key:"valid",value:function(){return new RegExp("^"+c.C_CHARS+"+$").test(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(6),f=r(a),c=n(25),s=r(c),l=function(t){function e(t,n){if(o(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,s.default)(t),n));else var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i(r)}return u(e,t),e}(f.default);e.default=l},function(t,e,n){"use strict";function r(t,e){var n=e?i.A_CHARS:i.B_CHARS,u=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(u)return u[1]+String.fromCharCode(204)+o(t.substring(u[1].length));var a=t.match(new RegExp("^"+n+"+"))[0];return a.length===t.length?t:a+String.fromCharCode(e?205:206)+r(t.substring(a.length),!e)}function o(t){var e=f(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var o=u(t)>=a(t);return e+String.fromCharCode(o?206:205)+r(t,o)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),u=function(t){return t.match(new RegExp("^"+i.A_CHARS+"*"))[0].length},a=function(t){return t.match(new RegExp("^"+i.B_CHARS+"*"))[0].length},f=function(t){return t.match(new RegExp("^"+i.C_CHARS+"*"))[0]};e.default=function(t){var e=void 0;if(f(t).length>=2)e=i.C_START_CHAR+o(t);else{var n=u(t)>a(t);e=(n?i.A_START_CHAR:i.B_START_CHAR)+r(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.CODE128C=e.CODE128B=e.CODE128A=e.CODE128=void 0;var o=n(24),i=r(o),u=n(21),a=r(u),f=n(22),c=r(f),s=n(23),l=r(s);e.CODE128=i.default,e.CODE128A=a.default,e.CODE128B=c.default,e.CODE128C=l.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){return a(c(t))}function a(t){return b[t].toString(2)}function f(t){return y[t]}function c(t){return y.indexOf(t)}function s(t){for(var e=0,n=0;n<t.length;n++)e+=c(t[n]);return e%=43}Object.defineProperty(e,"__esModule",{value:!0}),e.CODE39=void 0;var l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),p=n(0),d=function(t){return t&&t.__esModule?t:{default:t}}(p),h=function(t){function e(t,n){return r(this,e),t=t.toUpperCase(),n.mod43&&(t+=f(s(t))),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),l(e,[{key:"encode",value:function(){for(var t=u("*"),e=0;e<this.data.length;e++)t+=u(this.data[e])+"0";return t+=u("*"),{data:t,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),e}(d.default),y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],b=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];e.CODE39=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var u=o.get;if(void 0!==u)return u.call(r)},f=n(2),c=n(11),s=function(t){return t&&t.__esModule?t:{default:t}}(c),l=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+3*e:t+e},0)%10)%10},p=function(t){function e(t,n){r(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=l(t));var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.lastChar=n.lastChar,i}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),n=f.EAN13_STRUCTURE[this.data[0]];return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,n)}},{key:"rightText",value:function(){return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),e}(s.default);e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(2),c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){function e(t,n){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return u(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=f.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,s.default)(this.data,t,"01"),text:this.text}}}]),e}(p.default);e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(2),c=n(3),s=r(c),l=n(0),p=r(l),d=function(t){return t.split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+9*e:t+3*e},0)%10},h=function(t){function e(t,n){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return u(e,t),a(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t=f.EAN5_STRUCTURE[d(this.data)];return{data:"1011"+(0,s.default)(this.data,t,"01"),text:this.text}}}]),e}(p.default);e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var u=o.get;if(void 0!==u)return u.call(r)},f=n(11),c=function(t){return t&&t.__esModule?t:{default:t}}(f),s=function(t){return(10-t.substr(0,7).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+e:t+3*e},0)%10)%10},l=function(t){function e(t,n){return r(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=s(t)),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===s(this.data)}},{key:"leftText",value:function(){return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),e}(c.default);e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){for(var n=parseInt(t[t.length-1]),r=h[n],o="",i=0,u=0;u<r.length;u++){var a=r[u];o+="X"===a?t[i++]:a}return""+(o=""+e+o)+(0,d.checksum)(o)}Object.defineProperty(e,"__esModule",{value:!0});var f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=n(3),s=r(c),l=n(0),p=r(l),d=n(12),h=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],y=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],b=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,-1!==t.search(/^[0-9]{6}$/))r.middleDigits=t,r.upcA=a(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else{if(-1===t.search(/^[01][0-9]{7}$/))return i(r);if(r.middleDigits=t.substring(1,t.length-1),r.upcA=a(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]!==t[t.length-1])return i(r);r.isValid=!0}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return u(e,t),f(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),t+="010101",{data:t,text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],e=this.upcA[this.upcA.length-1],n=y[parseInt(e)][parseInt(t)];return(0,s.default)(this.middleDigits,n)}}]),e}(p.default);e.default=b},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.UPCE=e.UPC=e.EAN2=e.EAN5=e.EAN8=e.EAN13=void 0;var o=n(28),i=r(o),u=n(31),a=r(u),f=n(30),c=r(f),s=n(29),l=r(s),p=n(12),d=r(p),h=n(32),y=r(h);e.EAN13=i.default,e.EAN8=a.default,e.EAN5=c.default,e.EAN2=l.default,e.UPC=d.default,e.UPCE=y.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GenericBarcode=void 0;var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),u(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(f.default);e.GenericBarcode=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(13),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=function(t){var e=t.substr(0,13).split("").map(function(t){return parseInt(t,10)}).reduce(function(t,e,n){return t+e*(3-n%2*2)},0);return 10*Math.ceil(e/10)-e},s=function(t){function e(t,n){return r(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=c(t)),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===c(this.data)}}]),e}(f.default);e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.START_BIN="1010",e.END_BIN="11101",e.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.ITF14=e.ITF=void 0;var o=n(13),i=r(o),u=n(35),a=r(u);e.ITF=i.default,e.ITF14=a.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(4),a=function(t){return t&&t.__esModule?t:{default:t}}(u),f=n(7),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,f.mod10)(t),n))}return i(e,t),e}(a.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(4),a=function(t){return t&&t.__esModule?t:{default:t}}(u),f=n(7),c=function(t){function e(t,n){return r(this,e),t+=(0,f.mod10)(t),t+=(0,f.mod10)(t),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),e}(a.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(4),a=function(t){return t&&t.__esModule?t:{default:t}}(u),f=n(7),c=function(t){function e(t,n){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,f.mod11)(t),n))}return i(e,t),e}(a.default);e.default=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(4),a=function(t){return t&&t.__esModule?t:{default:t}}(u),f=n(7),c=function(t){function e(t,n){return r(this,e),t+=(0,f.mod11)(t),t+=(0,f.mod10)(t),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return i(e,t),e}(a.default);e.default=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MSI1110=e.MSI1010=e.MSI11=e.MSI10=e.MSI=void 0;var o=n(4),i=r(o),u=n(38),a=r(u),f=n(40),c=r(f),s=n(39),l=r(s),p=n(41),d=r(p);e.MSI=i.default,e.MSI10=a.default,e.MSI11=c.default,e.MSI1010=l.default,e.MSI1110=d.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.codabar=void 0;var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=function(t){function e(t,n){r(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return i.text=i.options.text||i.text.replace(/[A-D]/g,""),i}return i(e,t),u(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return{text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(f.default);e.codabar=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.pharmacode=void 0;var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(0),f=function(t){return t&&t.__esModule?t:{default:t}}(a),c=function(t){function e(t,n){r(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.number=parseInt(t,10),i}return i(e,t),u(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return e=e.slice(0,-2),{data:e,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(f.default);e.pharmacode=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e={};for(var n in f.default)f.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,u.default)(e)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),u=r(i),a=n(10),f=r(a);e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(5),u=function(t){return t&&t.__esModule?t:{default:t}}(i),a=n(14),f=function(){function t(e,n,o){r(this,t),this.canvas=e,this.encodings=n,this.options=o}return o(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=(0,u.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,a.calculateEncodingAttributes)(this.encodings,this.options,t);var e=(0,a.getTotalWidthOfEncodings)(this.encodings),n=(0,a.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),o=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var i=0;i<o.length;i++){var u=i*t.width+e.barcodePadding;"1"===o[i]?r.fillRect(u,n,t.width,t.height):o[i]&&r.fillRect(u,n,t.width,t.height*o[i])}}},{key:"drawCanvasText",value:function(t,e){var n=this.canvas.getContext("2d"),r=t.fontOptions+" "+t.fontSize+"px "+t.font;if(t.displayValue){var o,i;i="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,n.font=r,"left"==t.textAlign||e.barcodePadding>0?(o=0,n.textAlign="left"):"right"==t.textAlign?(o=e.width-1,n.textAlign="right"):(o=e.width/2,n.textAlign="center"),n.fillText(e.text,o,i)}}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),t}();e.default=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(46),i=r(o),u=n(49),a=r(u),f=n(48),c=r(f);e.default={CanvasRenderer:i.default,SVGRenderer:a.default,ObjectRenderer:c.default}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,n,o){r(this,t),this.object=e,this.encodings=n,this.options=o}return o(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=n(5),u=function(t){return t&&t.__esModule?t:{default:t}}(i),a=n(14),f="http://www.w3.org/2000/svg",c=function(){function t(e,n,o){r(this,t),this.svg=e,this.encodings=n,this.options=o,this.document=o.xmlDocument||document}return o(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=(0,u.default)(this.options,n.options),o=this.createGroup(t,r.marginTop,this.svg);this.setGroupOptions(o,r),this.drawSvgBarcode(o,r,n),this.drawSVGText(o,r,n),t+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,a.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,a.getTotalWidthOfEncodings)(this.encodings),e=(0,a.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,e,n){var r,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var i=0,u=0,a=0;a<o.length;a++)u=a*e.width+n.barcodePadding,"1"===o[a]?i++:i>0&&(this.drawRect(u-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&this.drawRect(u-e.width*(i-1),r,e.width*i,e.height,t)}},{key:"drawSVGText",value:function(t,e,n){var r=this.document.createElementNS(f,"text");if(e.displayValue){var o,i;r.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),i="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(o=0,r.setAttribute("text-anchor","start")):"right"==e.textAlign?(o=n.width-1,r.setAttribute("text-anchor","end")):(o=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",o),r.setAttribute("y",i),r.appendChild(this.document.createTextNode(n.text)),t.appendChild(r)}}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",f),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(f,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}},{key:"drawRect",value:function(t,e,n,r,o){var i=this.document.createElementNS(f,"rect");return i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i),i}}]),t}();e.default=c}]); |
{ | ||
"name": "reportbro-designer", | ||
"version": "1.3.4", | ||
"version": "1.4.0", | ||
"description": "Designer to create pdf and excel report layouts. The reports can be generated with reportbro-lib (a Python package) on the server.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -17,4 +17,5 @@ import Command from './Command'; | ||
*/ | ||
export default class AddDeleteDocElementCmd { | ||
export default class AddDeleteDocElementCmd extends Command { | ||
constructor(add, elementType, initialData, id, parentId, position, rb) { | ||
super(); | ||
this.add = add; | ||
@@ -21,0 +22,0 @@ this.elementType = elementType; |
@@ -9,4 +9,5 @@ import Command from './Command'; | ||
*/ | ||
export default class AddDeleteParameterCmd { | ||
export default class AddDeleteParameterCmd extends Command { | ||
constructor(add, initialData, id, parentId, position, rb) { | ||
super(); | ||
this.add = add; | ||
@@ -13,0 +14,0 @@ this.initialData = initialData; |
@@ -9,4 +9,5 @@ import Command from './Command'; | ||
*/ | ||
export default class AddDeleteStyleCmd { | ||
export default class AddDeleteStyleCmd extends Command { | ||
constructor(add, initialData, id, parentId, position, rb) { | ||
super(); | ||
this.add = add; | ||
@@ -13,0 +14,0 @@ this.initialData = initialData; |
/** | ||
* Interface for all commands. | ||
* Base class for all commands. | ||
* @class | ||
*/ | ||
export default class Command { | ||
constructor() { | ||
} | ||
getName() {} | ||
do() {} | ||
undo() {} | ||
/** | ||
* Returns true if the command can replace the given other command. | ||
* @param {Command} otherCmd | ||
* @returns {boolean} | ||
*/ | ||
allowReplace(otherCmd) { | ||
return false; | ||
} | ||
/** | ||
* Must be called when the command replaces the other command. | ||
* This must only be called if allowReplace for the same command returned true. | ||
* @param {Command} otherCmd | ||
*/ | ||
replace(otherCmd) { | ||
} | ||
} | ||
@@ -10,0 +31,0 @@ |
@@ -0,1 +1,2 @@ | ||
import Command from './Command'; | ||
import SetValueCmd from './SetValueCmd'; | ||
@@ -7,7 +8,11 @@ | ||
*/ | ||
export default class CommandGroupCmd { | ||
export default class CommandGroupCmd extends Command { | ||
constructor(name, rb) { | ||
this.name; | ||
super(); | ||
this.name = name; | ||
this.rb = rb; | ||
this.commands = []; | ||
this.selectObjectIds = []; | ||
// command index in commands list for each entry in selectObjectIds | ||
this.selectionCmdIndex = []; | ||
} | ||
@@ -20,15 +25,50 @@ | ||
do() { | ||
if (this.selectionCmdIndex.length > 0) { | ||
// enable notifyEvent only for SetValue commands of last selected object. | ||
// the change event may only be fired for the last object because in between command execution | ||
// the objects contain different values (although they will be changed to the same value | ||
// with the last command) and this can lead to reseting the cursor caret in an input field | ||
// if the cursor is not at the end of the input text. | ||
let lastSelectionCmdIndex = this.selectionCmdIndex[this.selectionCmdIndex.length - 1]; | ||
for (let i=0; i < this.commands.length; i++) { | ||
let cmd = this.commands[i]; | ||
if (cmd instanceof SetValueCmd) { | ||
cmd.setNotifyChange(i >= lastSelectionCmdIndex); | ||
} | ||
} | ||
} | ||
for (let i=0; i < this.commands.length; i++) { | ||
this.commands[i].do(); | ||
} | ||
this.selectObjects(); | ||
} | ||
undo() { | ||
if (this.selectionCmdIndex.length > 0) { | ||
// enable notifyEvent only for SetValue commands of last selected object. | ||
// the change event may only be fired for the last object because in between command execution | ||
// the objects contain different values (although they will be changed to the same value | ||
// with the last command) and this can lead to reseting the cursor caret in an input field | ||
// if the cursor is not at the end of the input text. | ||
let secondSelectionCmdIndex = this.selectionCmdIndex.length > 1 ? | ||
this.selectionCmdIndex[1] : this.commands.length; | ||
for (let i=this.commands.length - 1; i >= 0; i--) { | ||
let cmd = this.commands[i]; | ||
if (cmd instanceof SetValueCmd) { | ||
cmd.setNotifyChange(i < secondSelectionCmdIndex); | ||
} | ||
} | ||
} | ||
for (let i=this.commands.length - 1; i >= 0; i--) { | ||
this.commands[i].undo(); | ||
} | ||
this.selectObjects(); | ||
} | ||
addCommand(cmd) { | ||
if (this.commands.length > 0 && cmd instanceof SetValueCmd) { | ||
if (cmd instanceof SetValueCmd) { | ||
// disable select for specific command, selection is handled in command group | ||
// when the commands are executed | ||
cmd.disableSelect(); | ||
@@ -39,5 +79,77 @@ } | ||
/** | ||
* Add id of object which should be selected when this command group is executed. | ||
* @param {Number} objId - object id | ||
*/ | ||
addSelection(objId) { | ||
if (this.selectObjectIds.indexOf(objId) === -1) { | ||
this.selectObjectIds.push(objId); | ||
} | ||
// notification of change event will only be enabled for commands after | ||
// the last selection | ||
this.selectionCmdIndex.push(this.commands.length); | ||
} | ||
isEmpty() { | ||
return this.commands.length === 0; | ||
} | ||
getCommands() { | ||
return this.commands; | ||
} | ||
selectObjects() { | ||
let allObjectsSelected = true; | ||
for (let objId of this.selectObjectIds) { | ||
if (!this.rb.isSelectedObject(objId)) { | ||
allObjectsSelected = false; | ||
break; | ||
} | ||
} | ||
if (!allObjectsSelected) { | ||
// only select objects if at least one object is not already selected | ||
let firstSelection = true; | ||
for (let objId of this.selectObjectIds) { | ||
this.rb.selectObject(objId, firstSelection); | ||
firstSelection = false; | ||
} | ||
} | ||
} | ||
/** | ||
* Returns true if the command can replace the given other command. | ||
* | ||
* This information can be useful to avoid separate commands for every keystroke | ||
* in a text field and generate just one command for the whole changed text instead. | ||
* @param {Command} otherCmd | ||
* @returns {boolean} | ||
*/ | ||
allowReplace(otherCmd) { | ||
if (otherCmd instanceof CommandGroupCmd) { | ||
let otherCommands = otherCmd.getCommands(); | ||
if (this.commands.length === otherCommands.length) { | ||
for (let i=0; i < this.commands.length; i++) { | ||
if (!this.commands[i].allowReplace(otherCommands[i])) { | ||
return false; | ||
} | ||
} | ||
// we are allowed to replace all commands of the command group | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
/** | ||
* Must be called when the command replaces the other command. | ||
* This must only be called if allowReplace for the same command returned true. | ||
* @param {Command} otherCmd | ||
*/ | ||
replace(otherCmd) { | ||
let otherCommands = otherCmd.getCommands(); | ||
for (let i=0; i < this.commands.length; i++) { | ||
this.commands[i].replace(otherCommands[i]); | ||
} | ||
} | ||
} |
@@ -10,4 +10,5 @@ import Command from './Command'; | ||
*/ | ||
export default class MovePanelItemCmd { | ||
export default class MovePanelItemCmd extends Command { | ||
constructor(panelItem, moveToParentPanel, moveToPosition, rb) { | ||
super(); | ||
this.objId = panelItem.getId(); | ||
@@ -14,0 +15,0 @@ this.moveToParentId = moveToParentPanel.getId(); |
import Command from './Command'; | ||
import DocElement from '../elements/DocElement'; | ||
@@ -8,6 +7,6 @@ /** | ||
*/ | ||
export default class SetValueCmd { | ||
constructor(objId, tagId, field, value, type, rb) { | ||
export default class SetValueCmd extends Command { | ||
constructor(objId, field, value, type, rb) { | ||
super(); | ||
this.objId = objId; | ||
this.tagId = tagId; | ||
this.field = field; | ||
@@ -22,2 +21,3 @@ this.value = value; | ||
this.select = true; | ||
this.notifyChange = true; | ||
} | ||
@@ -29,2 +29,6 @@ | ||
getObjId() { | ||
return this.objId; | ||
} | ||
do() { | ||
@@ -47,11 +51,4 @@ if (!this.firstExecution && this.select) { | ||
let obj = this.rb.getDataObject(this.objId); | ||
let detailData = this.rb.getDetailData(); | ||
let isShown = (detailData !== null && detailData.getId() === this.objId); | ||
let elSelector = `#${this.tagId}`; | ||
obj.setValue(this.field, value, elSelector, isShown); | ||
obj.setValue(this.field, value); | ||
if (obj instanceof DocElement) { | ||
value = obj.getUpdateValue(this.field, value); | ||
} | ||
if (this.field === 'name') { | ||
@@ -61,30 +58,6 @@ $(`#rbro_menu_item_name${this.objId}`).text(value); | ||
this.rb.notifyEvent(obj, Command.operation.rename); | ||
} else { | ||
} | ||
if (this.notifyChange) { | ||
this.rb.notifyEvent(obj, Command.operation.change, this.field); | ||
} | ||
if (isShown) { | ||
if (this.type === SetValueCmd.type.text || this.type === SetValueCmd.type.select) { | ||
$(elSelector).val(value); | ||
} else if (this.type === SetValueCmd.type.filename) { | ||
$(elSelector).text(value); | ||
if (value === '') { | ||
$(`#${this.tagId}_container`).addClass('rbroHidden'); | ||
} else { | ||
$(`#${this.tagId}_container`).removeClass('rbroHidden'); | ||
} | ||
} else if (this.type === SetValueCmd.type.checkbox) { | ||
$(elSelector).prop('checked', value); | ||
} else if (this.type === SetValueCmd.type.button) { | ||
if (value) { | ||
$(elSelector).addClass('rbroButtonActive'); | ||
} else { | ||
$(elSelector).removeClass('rbroButtonActive'); | ||
} | ||
} else if (this.type === SetValueCmd.type.buttonGroup) { | ||
$(elSelector).find('button').removeClass('rbroButtonActive'); | ||
$(elSelector).find(`button[value="${value}"]`).addClass('rbroButtonActive'); | ||
} else if (this.type === SetValueCmd.type.color) { | ||
$(elSelector).spectrum("set", value); | ||
} | ||
} | ||
} | ||
@@ -100,12 +73,28 @@ | ||
setNotifyChange(notify) { | ||
this.notifyChange = notify; | ||
} | ||
/** | ||
* Returns true if the given command targets the same field. This information can be useful to avoid separate | ||
* commands for every keystroke in a text field and generate just one command for the whole changed text instead. | ||
* @param {SetValueCmd} newCmd | ||
* Returns true if the command can replace the given other command because they target the same field. | ||
* | ||
* This information can be useful to avoid separate commands for every keystroke | ||
* in a text field and generate just one command for the whole changed text instead. | ||
* @param {Command} otherCmd | ||
* @returns {boolean} | ||
*/ | ||
allowReplace(newCmd) { | ||
return (this.type === SetValueCmd.type.text && this.objId === newCmd.objId && | ||
this.tagId === newCmd.tagId && this.field === newCmd.field); | ||
allowReplace(otherCmd) { | ||
return (otherCmd instanceof SetValueCmd && this.type === SetValueCmd.type.text && | ||
this.objId === otherCmd.objId && this.field === otherCmd.field); | ||
} | ||
/** | ||
* Must be called when the command replaces the other command. | ||
* This must only be called if allowReplace for the same command returned true. | ||
* @param {Command} otherCmd | ||
*/ | ||
replace(otherCmd) { | ||
this.oldValue = otherCmd.oldValue; | ||
} | ||
} | ||
@@ -112,0 +101,0 @@ |
import Container from './Container'; | ||
import DocElement from '../elements/DocElement'; | ||
import Document from '../Document'; | ||
import * as utils from '../utils'; | ||
@@ -5,0 +4,0 @@ |
@@ -106,3 +106,3 @@ import SectionElement from '../elements/SectionElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
this[field] = value; | ||
@@ -109,0 +109,0 @@ if (field === 'marginLeft' || field === 'marginTop' || field === 'marginRight' || field === 'marginBottom') { |
@@ -60,2 +60,3 @@ import AddDeleteParameterCmd from '../commands/AddDeleteParameterCmd'; | ||
} | ||
this.updateMenuItemDisplay(); | ||
} | ||
@@ -68,3 +69,4 @@ | ||
getFields() { | ||
return ['id', 'name', 'type', 'arrayItemType', 'eval', 'nullable', 'pattern', 'expression', 'showOnlyNameType', 'testData']; | ||
return ['id', 'name', 'type', 'arrayItemType', 'eval', 'nullable', 'pattern', | ||
'expression', 'showOnlyNameType', 'testData']; | ||
} | ||
@@ -108,10 +110,6 @@ | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
this[field] = value; | ||
if (field === 'type') { | ||
if (isShown && value === Parameter.type.date) { | ||
$('#rbro_parameter_test_data').attr('placeholder', this.rb.getLabel('parameterTestDataDatePattern')); | ||
} else { | ||
$('#rbro_parameter_test_data').attr('placeholder', ''); | ||
} | ||
this.updateMenuItemDisplay(); | ||
} | ||
@@ -121,2 +119,19 @@ } | ||
/** | ||
* Updates visibility of menu panel item (buttons, children) for this parameter. | ||
* | ||
* Must be called initially and when parameter type changes. | ||
*/ | ||
updateMenuItemDisplay() { | ||
if (this.type === Parameter.type.array || this.type === Parameter.type.map) { | ||
$(`#rbro_menu_item_add${this.getId()}`).show(); | ||
$(`#rbro_menu_item_children${this.getId()}`).show(); | ||
$(`#rbro_menu_item_children_toggle${this.getId()}`).show(); | ||
} else { | ||
$(`#rbro_menu_item_add${this.getId()}`).hide(); | ||
$(`#rbro_menu_item_children${this.getId()}`).hide(); | ||
$(`#rbro_menu_item_children_toggle${this.getId()}`).hide(); | ||
} | ||
} | ||
/** | ||
* Returns parent in case parameter is child of a map/array parameter. | ||
@@ -161,3 +176,3 @@ * @returns {[Parameter]} parent parameter if available, null otherwise. | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_parameter_expression', 'expression', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'expression', cmdGroup); | ||
for (let child of this.getChildren()) { | ||
@@ -173,7 +188,6 @@ child.addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup); | ||
* @param {String} newParameterName - new name of the parameter. | ||
* @param {String} tagId | ||
* @param {String} field | ||
* @param {CommandGroupCmd} cmdGroup - possible SetValue command will be added to this command group. | ||
*/ | ||
addCommandForChangedParameterName(parameter, newParameterName, tagId, field, cmdGroup) { | ||
addCommandForChangedParameterName(parameter, newParameterName, field, cmdGroup) { | ||
let paramParent = parameter.getParent(); | ||
@@ -195,3 +209,3 @@ let paramRef = null; | ||
let cmd = new SetValueCmd( | ||
this.id, tagId, field, utils.replaceAll(this.getValue(field), paramRef, newParamRef), | ||
this.id, field, utils.replaceAll(this.getValue(field), paramRef, newParamRef), | ||
SetValueCmd.type.text, this.rb); | ||
@@ -231,4 +245,4 @@ cmdGroup.addCommand(cmd); | ||
if (this.testData !== testDataStr) { | ||
let cmd = new SetValueCmd(this.id, 'rbro_parameter_test_data', 'testData', | ||
testDataStr, SetValueCmd.type.text, this.rb); | ||
let cmd = new SetValueCmd( | ||
this.id, 'testData', testDataStr, SetValueCmd.type.text, this.rb); | ||
cmdGroup.addCommand(cmd); | ||
@@ -235,0 +249,0 @@ } |
import AddDeleteStyleCmd from "../commands/AddDeleteStyleCmd"; | ||
import Command from "../commands/Command"; | ||
import SetValueCmd from "../commands/SetValueCmd"; | ||
@@ -17,3 +18,3 @@ import DocElement from "../elements/DocElement"; | ||
this.errors = []; | ||
this.bold = false; | ||
@@ -88,11 +89,51 @@ this.italic = false; | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
this[field] = value; | ||
if (field.indexOf('border') !== -1) { | ||
Style.setBorderValue(this, field, '', value, elSelector, isShown); | ||
if (field === 'borderWidth') { | ||
this.borderWidthVal = utils.convertInputToNumber(value); | ||
} | ||
Style.setBorderValue(this, field, '', value, this.rb); | ||
} | ||
if (field !== 'name') { | ||
for (let docElement of this.rb.getDocElements(true)) { | ||
docElement.updateChangedStyle(this.getId()); | ||
} | ||
} | ||
} | ||
setBorderAll(fieldPrefix, value) { | ||
this[fieldPrefix + 'borderAll'] = value; | ||
/** | ||
* Adds commands to command group parameter to set changed property value | ||
* for all document elements using this style. | ||
* | ||
* This should be called when a property of this style was changed so the property | ||
* will be updated for all document elements as well. | ||
* | ||
* @param {String} field - changed field of this style. | ||
* @param {Object} value - new value for given field. | ||
* @param {String} type - property type for SetValueCmd. | ||
* @param {CommandGroupCmd} cmdGroup - commands will be added to this command group. | ||
*/ | ||
addCommandsForChangedProperty(field, value, type, cmdGroup) { | ||
let strId = '' + this.getId(); | ||
for (let docElement of this.rb.getDocElements(true)) { | ||
if (docElement.hasProperty('styleId')) { | ||
if (docElement.getValue('styleId') === strId && | ||
docElement.getValue(field) !== value) { | ||
let cmd = new SetValueCmd( | ||
docElement.getId(), field, value, type, this.rb); | ||
cmd.disableSelect(); | ||
cmdGroup.addCommand(cmd); | ||
} | ||
if (docElement.getValue('cs_styleId') === strId && | ||
docElement.getValue('cs_' + field) !== value) { | ||
let cmd = new SetValueCmd( | ||
docElement.getId(), 'cs_' + field, value, type, this.rb); | ||
cmd.disableSelect(); | ||
cmdGroup.addCommand(cmd); | ||
} | ||
} | ||
} | ||
} | ||
@@ -112,3 +153,3 @@ | ||
cmd = new SetValueCmd( | ||
element.getId(), 'rbro_text_element_style_id', 'styleId', '', SetValueCmd.type.text, this.rb); | ||
element.getId(), 'styleId', '', SetValueCmd.type.text, this.rb); | ||
cmdGroup.addCommand(cmd); | ||
@@ -159,29 +200,18 @@ } | ||
* @param {Boolean} value - new value for specified field. | ||
* @param {String} elSelector - jquery selector to specify the DOM element. | ||
* @param {Boolean} isShown - true if the specified object is currently visible in the GUI. | ||
* @param {ReportBro} rb - ReportBro instance. | ||
*/ | ||
static setBorderValue(obj, field, fieldPrefix, value, elSelector, isShown) { | ||
if (field === `${fieldPrefix}borderAll`) { | ||
obj.borderLeft = obj.borderTop = obj.borderRight = obj.borderBottom = value; | ||
if (isShown) { | ||
if (value) { | ||
$(elSelector).parent().find('button').addClass('rbroButtonActive'); | ||
} else { | ||
$(elSelector).parent().find('button').removeClass('rbroButtonActive'); | ||
} | ||
static setBorderValue(obj, field, fieldPrefix, value, rb) { | ||
let fieldWithoutPrefix = field; | ||
if (fieldPrefix.length > 0) { | ||
fieldWithoutPrefix = fieldWithoutPrefix.substr(fieldPrefix.length); | ||
} | ||
if (fieldWithoutPrefix === 'borderLeft' || fieldWithoutPrefix === 'borderTop' || | ||
fieldWithoutPrefix === 'borderRight' || fieldWithoutPrefix === 'borderBottom') { | ||
let borderAll = (obj.getValue(`${fieldPrefix}borderLeft`) && obj.getValue(`${fieldPrefix}borderTop`) && | ||
obj.getValue(`${fieldPrefix}borderRight`) && obj.getValue(`${fieldPrefix}borderBottom`)); | ||
let borderAllField = `${fieldPrefix}borderAll`; | ||
if (borderAll !== obj[borderAllField]) { | ||
obj[borderAllField] = borderAll; | ||
rb.notifyEvent(obj, Command.operation.change, borderAllField); | ||
} | ||
} else if (field === `${fieldPrefix}borderLeft` || field === `${fieldPrefix}borderTop` || | ||
field === `${fieldPrefix}borderRight` || field === `${fieldPrefix}borderBottom`) { | ||
if (obj.getValue(`${fieldPrefix}borderLeft`) && obj.getValue(`${fieldPrefix}borderTop`) && | ||
obj.getValue(`${fieldPrefix}borderRight`) && obj.getValue(`${fieldPrefix}borderBottom`)) { | ||
obj.setBorderAll(fieldPrefix, true); | ||
if (isShown) { | ||
$(elSelector).parent().find(`button[value="${fieldPrefix}borderAll"]`).addClass('rbroButtonActive'); | ||
} | ||
} else { | ||
obj.setBorderAll(fieldPrefix, false); | ||
if (isShown) { | ||
$(elSelector).parent().find(`button[value="${fieldPrefix}borderAll"]`).removeClass('rbroButtonActive'); | ||
} | ||
} | ||
} | ||
@@ -188,0 +218,0 @@ } |
@@ -51,3 +51,3 @@ import AddDeleteDocElementCmd from './commands/AddDeleteDocElementCmd'; | ||
if (this.rb.isDocElementSelected() && !event.shiftKey) { | ||
this.rb.deselectAll(); | ||
this.rb.deselectAll(true); | ||
} | ||
@@ -155,3 +155,3 @@ let offset = this.elDocContent.offset(); | ||
} | ||
processMouseMove(event) { | ||
@@ -233,3 +233,3 @@ if (this.dragging) { | ||
} | ||
processDrag(event) { | ||
@@ -343,3 +343,3 @@ let absPos = getEventAbsPos(event); | ||
$('#rbro_document_pdf').removeClass('rbroHidden'); | ||
$('#rbro_document_pdf_preview').css('z-index', ''); | ||
$('#rbro_document_pdf_preview').css({ 'z-index': '', 'height': '0' }); | ||
$('.rbroElementButtons .rbroMenuButton').removeClass('rbroDisabled').prop('draggable', true); | ||
@@ -350,3 +350,3 @@ $('.rbroActionButtons .rbroActionButton').prop('disabled', false); | ||
$('#rbro_document_pdf').addClass('rbroHidden'); | ||
$('#rbro_document_pdf_preview').css('z-index', '1'); | ||
$('#rbro_document_pdf_preview').css({ 'z-index': '1', 'height': '' }); | ||
$('.rbroElementButtons .rbroMenuButton').addClass('rbroDisabled').prop('draggable', false); | ||
@@ -475,2 +475,15 @@ $('.rbroActionButtons .rbroActionButton').prop('disabled', true); | ||
} | ||
// do not allow to change container of elements when multiple elements are | ||
// dragged together as this could lead to unexpected results for the user | ||
let selectedObjects = this.rb.getSelectedObjects(); | ||
if (selectedObjects.length > 1 && container !== null) { | ||
for (let selectedObj of selectedObjects) { | ||
if (selectedObj.getContainerId() !== container.getId()) { | ||
container = null; | ||
break; | ||
} | ||
} | ||
} | ||
let dragDiff = dragObject.getDragDiff( | ||
@@ -477,0 +490,0 @@ diffX, diffY, this.dragType, (this.dragSnapToGrid && this.isGridVisible()) ? this.getGridSize() : 0); |
@@ -33,4 +33,4 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
if (field === 'content' ||field === 'format' || field === 'displayValue' || field === 'height') { | ||
@@ -43,7 +43,7 @@ this.updateBarCode(); | ||
/** | ||
* Returns all data fields of this object. The fields are used when serializing the object. | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getFields() { | ||
return ['id', 'containerId', 'x', 'y', 'height', 'content', 'format', 'displayValue', | ||
getProperties() { | ||
return ['x', 'y', 'height', 'content', 'format', 'displayValue', | ||
'printIf', 'removeEmptyElement', | ||
@@ -73,14 +73,2 @@ 'spreadsheet_hide', 'spreadsheet_column', 'spreadsheet_colspan', 'spreadsheet_addEmptyRow']; | ||
getXTagId() { | ||
return 'rbro_bar_code_element_position_x'; | ||
} | ||
getYTagId() { | ||
return 'rbro_bar_code_element_position_y'; | ||
} | ||
getHeightTagId() { | ||
return 'rbro_bar_code_element_height'; | ||
} | ||
createElement() { | ||
@@ -144,5 +132,5 @@ this.el = $(`<div id="rbro_el${this.id}" class="rbroDocElement rbroBarCodeElement"></div>`); | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_bar_code_element_content', 'content', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_bar_code_element_print_if', 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'content', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'printIf', cmdGroup); | ||
} | ||
} |
@@ -105,3 +105,3 @@ import MovePanelItemCmd from '../commands/MovePanelItemCmd'; | ||
} else { | ||
this.rb.deselectAll(); | ||
this.rb.deselectAll(true); | ||
} | ||
@@ -325,20 +325,20 @@ } | ||
if (x !== this.xVal && this.getXTagId() !== '') { | ||
let cmd = new SetValueCmd(this.id, this.getXTagId(), 'x', | ||
'' + x, SetValueCmd.type.text, this.rb); | ||
if (x !== this.xVal && this.hasProperty('x')) { | ||
let cmd = new SetValueCmd( | ||
this.id, 'x', '' + x, SetValueCmd.type.text, this.rb); | ||
cmd.disableSelect(); | ||
cmdGroup.addCommand(cmd); | ||
} | ||
if (y !== this.yVal && this.getYTagId() !== '') { | ||
let cmd = new SetValueCmd(this.id, this.getYTagId(), 'y', | ||
'' + y, SetValueCmd.type.text, this.rb); | ||
if (y !== this.yVal && this.hasProperty('y')) { | ||
let cmd = new SetValueCmd( | ||
this.id, 'y', '' + y, SetValueCmd.type.text, this.rb); | ||
cmd.disableSelect(); | ||
cmdGroup.addCommand(cmd); | ||
} | ||
if (width !== this.getDisplayWidth() && this.getWidthTagId() !== '') { | ||
if (width !== this.getDisplayWidth() && this.hasProperty('width')) { | ||
this.addCommandsForChangedWidth(width, true, cmdGroup); | ||
} | ||
if (height !== this.getDisplayHeight() && this.getHeightTagId() !== '') { | ||
let cmd = new SetValueCmd(this.id, this.getHeightTagId(), 'height', | ||
'' + height, SetValueCmd.type.text, this.rb); | ||
if (height !== this.getDisplayHeight() && this.hasProperty('height')) { | ||
let cmd = new SetValueCmd( | ||
this.id, 'height', '' + height, SetValueCmd.type.text, this.rb); | ||
cmd.disableSelect(); | ||
@@ -366,3 +366,3 @@ cmdGroup.addCommand(cmd); | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
this[field] = value; | ||
@@ -423,5 +423,24 @@ if (field === 'x' || field === 'y' || field === 'width' || field === 'height') { | ||
getFields() { | ||
let fields = this.getProperties(); | ||
fields.splice(0, 0, 'id', 'containerId'); | ||
return fields; | ||
} | ||
/** | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getProperties() { | ||
return []; | ||
} | ||
/** | ||
* Returns true if the given property is available for this object. | ||
* @param {String} property - property name. | ||
* @returns {Boolean} | ||
*/ | ||
hasProperty(property) { | ||
return this.getProperties().indexOf(property) !== -1; | ||
} | ||
getElementType() { | ||
@@ -431,6 +450,2 @@ return DocElement.type.none; | ||
setBorderAll(fieldPrefix, value) { | ||
this[fieldPrefix + 'borderAll'] = value; | ||
} | ||
updateDisplay() { | ||
@@ -617,4 +632,4 @@ this.updateDisplayInternal(this.xVal, this.yVal, this.widthVal, this.heightVal); | ||
if (containerChanged) { | ||
let cmd = new SetValueCmd(this.id, null, 'containerId', | ||
dragContainer.getId(), SetValueCmd.type.internal, this.rb); | ||
let cmd = new SetValueCmd( | ||
this.id, 'containerId', dragContainer.getId(), SetValueCmd.type.internal, this.rb); | ||
cmdGroup.addCommand(cmd); | ||
@@ -694,34 +709,2 @@ cmd = new MovePanelItemCmd(this.getPanelItem(), dragContainer.getPanelItem(), | ||
/** | ||
* Returns id for dom element of x value. | ||
* @returns {String} Is empty in case doc element does not have x value. | ||
*/ | ||
getXTagId() { | ||
return ''; | ||
} | ||
/** | ||
* Returns id for dom element of y value. | ||
* @returns {String} Is empty in case doc element does not have y value. | ||
*/ | ||
getYTagId() { | ||
return ''; | ||
} | ||
/** | ||
* Returns id for dom element of width value. | ||
* @returns {String} Is empty in case doc element does not have width value. | ||
*/ | ||
getWidthTagId() { | ||
return ''; | ||
} | ||
/** | ||
* Returns id for dom element of height value. | ||
* @returns {String} Is empty in case doc element does not have height value. | ||
*/ | ||
getHeightTagId() { | ||
return ''; | ||
} | ||
hasBorderSettings() { | ||
@@ -836,7 +819,6 @@ return false; | ||
* @param {String} newParameterName - new name of the parameter. | ||
* @param {String} tagId | ||
* @param {String} field | ||
* @param {CommandGroupCmd} cmdGroup - possible SetValue command will be added to this command group. | ||
*/ | ||
addCommandForChangedParameterName(parameter, newParameterName, tagId, field, cmdGroup) { | ||
addCommandForChangedParameterName(parameter, newParameterName, field, cmdGroup) { | ||
let paramParent = parameter.getParent(); | ||
@@ -885,3 +867,3 @@ let dataSources = []; | ||
let cmd = new SetValueCmd( | ||
this.id, tagId, field, utils.replaceAll(this.getValue(field), paramRef, newParamRef), | ||
this.id, field, utils.replaceAll(this.getValue(field), paramRef, newParamRef), | ||
SetValueCmd.type.text, this.rb); | ||
@@ -911,4 +893,4 @@ cmdGroup.addCommand(cmd); | ||
addCommandsForChangedWidth(newWidth, disableSelect, cmdGroup) { | ||
let cmd = new SetValueCmd(this.id, this.getWidthTagId(), 'width', | ||
'' + newWidth, SetValueCmd.type.text, this.rb); | ||
let cmd = new SetValueCmd( | ||
this.id, 'width', '' + newWidth, SetValueCmd.type.text, this.rb); | ||
if (disableSelect) { | ||
@@ -915,0 +897,0 @@ cmd.disableSelect(); |
@@ -78,6 +78,6 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
if (field.indexOf('border') !== -1) { | ||
// Style.setBorderValue needs to be called before super.setValue because it calls updateStyle() which expects | ||
// the correct border settings | ||
// Style.setBorderValue needs to be called before super.setValue | ||
// because it calls updateStyle() which expects the correct border settings | ||
this[field] = value; | ||
@@ -87,6 +87,6 @@ if (field === 'borderWidth') { | ||
} | ||
Style.setBorderValue(this, field, '', value, elSelector, isShown); | ||
Style.setBorderValue(this, field, '', value, this.rb); | ||
} | ||
super.setValue(field, value, elSelector, isShown); | ||
super.setValue(field, value); | ||
@@ -148,4 +148,13 @@ if (field === 'label') { | ||
getFields() { | ||
return ['id', 'containerId', 'linkedContainerId', 'label', | ||
'x', 'y', 'width', 'height', 'backgroundColor', | ||
let fields = this.getProperties(); | ||
fields.splice(0, 0, 'id', 'containerId', 'linkedContainerId'); | ||
return fields; | ||
} | ||
/** | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getProperties() { | ||
return ['label', 'x', 'y', 'width', 'height', 'backgroundColor', | ||
'borderAll', 'borderLeft', 'borderTop', 'borderRight', 'borderBottom', 'borderColor', 'borderWidth', | ||
@@ -160,18 +169,2 @@ 'printIf', 'removeEmptyElement', 'shrinkToContentHeight', | ||
getXTagId() { | ||
return 'rbro_frame_element_position_x'; | ||
} | ||
getYTagId() { | ||
return 'rbro_frame_element_position_y'; | ||
} | ||
getWidthTagId() { | ||
return 'rbro_frame_element_width'; | ||
} | ||
getHeightTagId() { | ||
return 'rbro_frame_element_height'; | ||
} | ||
createElement() { | ||
@@ -215,4 +208,4 @@ this.el = $(`<div id="rbro_el${this.id}" class="rbroDocElement rbroFrameElement rbroElementContainer"></div>`); | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_frame_element_print_if', 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'printIf', cmdGroup); | ||
} | ||
} |
@@ -33,6 +33,4 @@ import DocElement from './DocElement'; | ||
this.createElement(); | ||
if (this.image !== '') { | ||
// setImage must be called after createElement so load event handler of image element is triggered | ||
this.setImage(this.image); | ||
} | ||
// setImage must be called after createElement so load event handler of image element is triggered | ||
this.setImage(); | ||
this.updateDisplay(); | ||
@@ -43,17 +41,18 @@ this.updateStyle(); | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
if (field === 'source' || field === 'imageFilename') { | ||
this.updateName(); | ||
} else if (field === 'image') { | ||
this.setImage(value); | ||
} | ||
if (field === 'source' || field === 'image') { | ||
this.setImage(); | ||
} | ||
} | ||
/** | ||
* Returns all data fields of this object. The fields are used when serializing the object. | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getFields() { | ||
return ['id', 'containerId', 'x', 'y', 'width', 'height', 'source', 'image', 'imageFilename', | ||
getProperties() { | ||
return ['x', 'y', 'width', 'height', 'source', 'image', 'imageFilename', | ||
'horizontalAlignment', 'verticalAlignment', 'backgroundColor', | ||
@@ -105,18 +104,2 @@ 'printIf', 'removeEmptyElement', 'link', | ||
getXTagId() { | ||
return 'rbro_image_element_position_x'; | ||
} | ||
getYTagId() { | ||
return 'rbro_image_element_position_y'; | ||
} | ||
getWidthTagId() { | ||
return 'rbro_image_element_width'; | ||
} | ||
getHeightTagId() { | ||
return 'rbro_image_element_height'; | ||
} | ||
createElement() { | ||
@@ -142,3 +125,2 @@ this.el = $(`<div id="rbro_el${this.id}" class="rbroDocElement rbroImageElement"></div>`); | ||
this.appendToContainer(); | ||
this.setImage(this.image); | ||
super.registerEventHandlers(); | ||
@@ -152,7 +134,12 @@ } | ||
setImage(imgBase64) { | ||
setImage() { | ||
this.elImg.attr('src', ''); | ||
if (imgBase64 !== '') { | ||
this.elImg.attr('src', imgBase64); | ||
if (this.source.startsWith('https://') || this.source.startsWith('http://')) { | ||
// image specified by url | ||
this.elImg.attr('src', this.source); | ||
} else if (this.image !== '') { | ||
// image base64 encoded | ||
this.elImg.attr('src', this.image); | ||
} else { | ||
// no image preview | ||
this.imageWidth = 0; | ||
@@ -185,5 +172,5 @@ this.imageHeight = 0; | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_image_element_source', 'source', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_image_element_print_if', 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'source', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'printIf', cmdGroup); | ||
} | ||
} |
@@ -21,4 +21,4 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
if (field === 'color') { | ||
@@ -30,7 +30,7 @@ this.updateStyle(); | ||
/** | ||
* Returns all data fields of this object. The fields are used when serializing the object. | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getFields() { | ||
return ['id', 'containerId', 'x', 'y', 'width', 'height', 'color', 'printIf']; | ||
getProperties() { | ||
return ['x', 'y', 'width', 'height', 'color', 'printIf']; | ||
} | ||
@@ -56,18 +56,2 @@ | ||
getXTagId() { | ||
return 'rbro_line_element_position_x'; | ||
} | ||
getYTagId() { | ||
return 'rbro_line_element_position_y'; | ||
} | ||
getWidthTagId() { | ||
return 'rbro_line_element_width'; | ||
} | ||
getHeightTagId() { | ||
return 'rbro_line_element_height'; | ||
} | ||
createElement() { | ||
@@ -87,4 +71,4 @@ this.el = $(`<div id="rbro_el${this.id}" class="rbroDocElement rbroLineElement"></div>`); | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_line_element_print_if', 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'printIf', cmdGroup); | ||
} | ||
} |
@@ -20,12 +20,12 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
} | ||
/** | ||
* Returns all data fields of this object. The fields are used when serializing the object. | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getFields() { | ||
return ['id', 'containerId', 'y']; | ||
getProperties() { | ||
return ['y']; | ||
} | ||
@@ -53,6 +53,2 @@ | ||
getYTagId() { | ||
return 'rbro_page_break_element_position_y'; | ||
} | ||
createElement() { | ||
@@ -59,0 +55,0 @@ this.el = $(`<div id="rbro_el${this.id}" class="rbroDocElement rbroPageBreakElement"></div>`); |
@@ -73,4 +73,4 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
@@ -91,5 +91,17 @@ if (field === 'height') { | ||
getFields() { | ||
let fields = ['id', 'containerId', 'linkedContainerId', 'height', 'alwaysPrintOnSamePage', 'shrinkToContentHeight']; | ||
let fields = this.getProperties(); | ||
fields.splice(0, 0, 'id', 'containerId', 'linkedContainerId'); | ||
return fields; | ||
} | ||
/** | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getProperties() { | ||
let fields; | ||
if (this.bandType === Band.bandType.header) { | ||
fields.push('repeatHeader'); | ||
fields = ['height', 'repeatHeader', 'shrinkToContentHeight']; | ||
} else { | ||
fields = ['height', 'alwaysPrintOnSamePage', 'shrinkToContentHeight']; | ||
} | ||
@@ -121,6 +133,2 @@ return fields; | ||
getHeightTagId() { | ||
return 'rbro_section_band_element_height'; | ||
} | ||
getHeight() { | ||
@@ -127,0 +135,0 @@ return this.heightVal; |
@@ -132,4 +132,4 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
@@ -170,7 +170,7 @@ if (field === 'label' || field === 'dataSource') { | ||
/** | ||
* Returns all data fields of this object. The fields are used when serializing the object. | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getFields() { | ||
return ['id', 'containerId', 'y', 'label', 'dataSource', 'header', 'footer', 'printIf']; | ||
getProperties() { | ||
return ['y', 'label', 'dataSource', 'header', 'footer', 'printIf']; | ||
} | ||
@@ -190,10 +190,2 @@ | ||
getYTagId() { | ||
return 'rbro_section_element_position_y'; | ||
} | ||
getHeightTagId() { | ||
return ''; | ||
} | ||
isDroppingAllowed() { | ||
@@ -310,3 +302,3 @@ return false; | ||
if (this.headerData !== ignoreBandData) { | ||
this.headerData.setValue('y', '' + y, null, true); | ||
this.headerData.setValue('y', '' + y); | ||
} | ||
@@ -316,7 +308,7 @@ y += this.headerData.getValue('heightVal'); | ||
if (this.contentData !== ignoreBandData) { | ||
this.contentData.setValue('y', '' + y, null, true); | ||
this.contentData.setValue('y', '' + y); | ||
} | ||
y += this.contentData.getValue('heightVal'); | ||
if (this.footer && this.footerData !== ignoreBandData) { | ||
this.footerData.setValue('y', '' + y, null, true); | ||
this.footerData.setValue('y', '' + y); | ||
} | ||
@@ -372,4 +364,4 @@ } | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_section_element_data_source', 'dataSource', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_section_element_print_if', 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'dataSource', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'printIf', cmdGroup); | ||
} | ||
@@ -376,0 +368,0 @@ |
@@ -71,3 +71,3 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
this[field] = value; | ||
@@ -79,3 +79,3 @@ if (field === 'height') { | ||
for (let col of this.columnData) { | ||
col.setValue(field, value, elSelector, isShown); | ||
col.setValue(field, value); | ||
} | ||
@@ -96,3 +96,13 @@ let table = this.getParent(); | ||
getFields() { | ||
let fields = ['id', 'height', 'backgroundColor']; | ||
let fields = this.getProperties(); | ||
fields.splice(0, 0, 'id'); | ||
return fields; | ||
} | ||
/** | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getProperties() { | ||
let fields = ['height', 'backgroundColor']; | ||
if (this.bandType === Band.bandType.header) { | ||
@@ -124,6 +134,2 @@ fields.push('repeatHeader'); | ||
getHeightTagId() { | ||
return 'rbro_table_band_element_height'; | ||
} | ||
getHeight() { | ||
@@ -377,3 +383,3 @@ return this.heightVal; | ||
let contentRows = utils.convertInputToNumber(table.getValue('contentRows')) + 1; | ||
table.setValue('contentRows', contentRows, 'rbro_table_element_content_rows', false); | ||
table.setValue('contentRows', contentRows); | ||
@@ -416,3 +422,3 @@ let contentRow = table.getValue('contentDataRows')[rowIndex]; | ||
// decrease content row count of table | ||
table.setValue('contentRows', contentRows - 1, 'rbro_table_element_content_rows', false); | ||
table.setValue('contentRows', contentRows - 1); | ||
@@ -419,0 +425,0 @@ // remove content row |
@@ -127,4 +127,4 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
if (field === 'dataSource') { | ||
@@ -219,4 +219,13 @@ this.updateName(); | ||
getFields() { | ||
return ['id', 'containerId', 'x', 'y', 'width', | ||
'dataSource', 'columns', 'header', 'contentRows', 'footer', | ||
let fields = this.getProperties(); | ||
fields.splice(0, 0, 'id', 'containerId', 'width'); | ||
return fields; | ||
} | ||
/** | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getProperties() { | ||
return ['x', 'y', 'dataSource', 'columns', 'header', 'contentRows', 'footer', | ||
'border', 'borderColor', 'borderWidth', | ||
@@ -247,18 +256,2 @@ 'printIf', 'removeEmptyElement', | ||
getXTagId() { | ||
return 'rbro_table_element_position_x'; | ||
} | ||
getYTagId() { | ||
return 'rbro_table_element_position_y'; | ||
} | ||
getWidthTagId() { | ||
return 'rbro_table_element_width'; | ||
} | ||
getHeightTagId() { | ||
return 'rbro_table_element_height'; | ||
} | ||
isDroppingAllowed() { | ||
@@ -438,3 +431,3 @@ return false; | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_table_element_data_source', 'dataSource', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'dataSource', cmdGroup); | ||
} | ||
@@ -468,9 +461,7 @@ | ||
/** | ||
* Adds commands to command group parameter to recreate table with new column count. | ||
* @param {Number} columns - requested new column count. | ||
* @param {CommandGroupCmd} cmdGroup - possible commands will be added to this command group. | ||
* @returns {Number} either new column count or existing column count in case there is not enough space | ||
* for all column. | ||
* Returns true if there is enough space for the given column count, false otherwise. | ||
* @param {Number} columns - column count to test for available space. | ||
* @returns {Boolean} | ||
*/ | ||
addCommandsForChangedColumns(columns, cmdGroup) { | ||
hasEnoughAvailableSpace(columns) { | ||
let existingColumns = utils.convertInputToNumber(this.columns); | ||
@@ -480,5 +471,22 @@ let maxColumns = Math.floor(this.widthVal / TableElement.getColumnMinWidth()); | ||
// not enough space for all columns | ||
return existingColumns; | ||
return false; | ||
} | ||
return true; | ||
} | ||
/** | ||
* Adds commands to command group parameter to recreate table with new column count. | ||
* | ||
* The commands are only added if there is enough space available for the new columns. | ||
* This should be checked beforehand by calling hasEnoughAvailableSpace. | ||
* | ||
* @param {Number} columns - requested new column count. | ||
* @param {CommandGroupCmd} cmdGroup - possible commands will be added to this command group. | ||
*/ | ||
addCommandsForChangedColumns(columns, cmdGroup) { | ||
if (!this.hasEnoughAvailableSpace(columns)) { | ||
return; | ||
} | ||
let existingColumns = utils.convertInputToNumber(this.columns); | ||
// delete table with current settings and restore below with new columns, necessary for undo/redo | ||
@@ -514,4 +522,2 @@ let cmd = new AddDeleteDocElementCmd(false, this.getPanelItem().getPanelName(), | ||
cmdGroup.addCommand(cmd); | ||
return columns; | ||
} | ||
@@ -529,3 +535,4 @@ | ||
// delete table with current settings and restore below with new columns, necessary for undo/redo | ||
let cmd = new AddDeleteDocElementCmd(false, this.getPanelItem().getPanelName(), | ||
let cmd = new AddDeleteDocElementCmd( | ||
false, this.getPanelItem().getPanelName(), | ||
this.toJS(), this.id, this.getContainerId(), -1, this.rb); | ||
@@ -556,3 +563,4 @@ cmdGroup.addCommand(cmd); | ||
// restore table with new content rows and updated settings | ||
cmd = new AddDeleteDocElementCmd(true, this.getPanelItem().getPanelName(), | ||
cmd = new AddDeleteDocElementCmd( | ||
true, this.getPanelItem().getPanelName(), | ||
this.toJS(), this.id, this.getContainerId(), -1, this.rb); | ||
@@ -559,0 +567,0 @@ cmdGroup.addCommand(cmd); |
@@ -83,5 +83,13 @@ import DocElement from './DocElement'; | ||
setValue(field, value, elSelector, isShown) { | ||
super.setValue(field, value, elSelector, isShown); | ||
getValue(field) { | ||
if (field === 'xReadOnly') { | ||
// offset of this cell relative to table, needed for display in read-only field | ||
return this.getOffsetX(); | ||
} | ||
return super.getValue(field); | ||
} | ||
setValue(field, value) { | ||
super.setValue(field, value); | ||
if (field === 'width') { | ||
@@ -106,4 +114,6 @@ let table = this.getTable(); | ||
* Returns value to use for updating input control. | ||
* Needed for columns with colspan > 1 because internal width is only for 1 cell but | ||
* | ||
* Needed for cells with colspan > 1 because internal width is only for 1 cell but | ||
* displayed width in input field is total width for all cells included in colspan. | ||
* | ||
* @param {Number} field - field name. | ||
@@ -208,8 +218,20 @@ * @param {Number} value - value for update. | ||
getFields() { | ||
let fields = ['id', 'width', 'height', 'content', 'eval', 'colspan', | ||
'styleId', 'bold', 'italic', 'underline', | ||
'horizontalAlignment', 'verticalAlignment', 'textColor', 'backgroundColor', 'font', 'fontSize', 'lineSpacing', | ||
let fields = this.getProperties(); | ||
// remove 'xReadOnly' field and add 'id' | ||
fields.splice(0, 1, 'id'); | ||
return fields; | ||
} | ||
/** | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getProperties() { | ||
let fields = ['xReadOnly', 'width', 'content', 'eval', 'colspan', | ||
'styleId', 'bold', 'italic', 'underline', 'strikethrough', | ||
'horizontalAlignment', 'verticalAlignment', 'textColor', 'backgroundColor', | ||
'font', 'fontSize', 'lineSpacing', | ||
'paddingLeft', 'paddingTop', 'paddingRight', 'paddingBottom', | ||
'removeEmptyElement', 'alwaysPrintOnSamePage', 'pattern', 'link', | ||
'cs_condition', 'cs_styleId', 'cs_bold', 'cs_italic', 'cs_underline', | ||
'pattern', 'link', 'cs_condition', 'cs_styleId', | ||
'cs_bold', 'cs_italic', 'cs_underline', 'cs_strikethrough', | ||
'cs_horizontalAlignment', 'cs_verticalAlignment', 'cs_textColor', 'cs_backgroundColor', | ||
@@ -277,18 +299,2 @@ 'cs_font', 'cs_fontSize', 'cs_lineSpacing', | ||
getXTagId() { | ||
return ''; | ||
} | ||
getYTagId() { | ||
return ''; | ||
} | ||
getWidthTagId() { | ||
return 'rbro_text_element_width'; | ||
} | ||
getHeightTagId() { | ||
return ''; | ||
} | ||
hasBorderSettings() { | ||
@@ -394,4 +400,3 @@ return false; | ||
tableBand.getColumn(this.columnIndex + i).getId(), | ||
this.getWidthTagId(), 'width', '' + widths[i], | ||
SetValueCmd.type.text, this.rb); | ||
'width', '' + widths[i], SetValueCmd.type.text, this.rb); | ||
if (disableSelect || i > 0) { | ||
@@ -423,3 +428,3 @@ cmd.disableSelect(); | ||
let columns = utils.convertInputToNumber(table.getValue('columns')) + 1; | ||
table.setValue('columns', columns, 'rbro_table_element_columns', false); | ||
table.setValue('columns', columns); | ||
@@ -463,3 +468,3 @@ // add a column to each table band | ||
let columns = utils.convertInputToNumber(table.getValue('columns')) - 1; | ||
table.setValue('columns', columns, 'rbro_table_element_columns', false); | ||
table.setValue('columns', columns); | ||
@@ -466,0 +471,0 @@ // remove column from each table band |
import DocElement from './DocElement'; | ||
import SetValueCmd from '../commands/SetValueCmd'; | ||
import Style from '../data/Style'; | ||
@@ -38,3 +39,3 @@ import * as utils from '../utils'; | ||
this.paddingBottom = '2'; | ||
this.cs_condition = ''; | ||
@@ -64,3 +65,3 @@ this.cs_styleId = ''; | ||
this.cs_paddingBottom = '2'; | ||
this.alwaysPrintOnSamePage = true; | ||
@@ -91,3 +92,3 @@ this.pattern = ''; | ||
// focus text content input element and set caret at end of content | ||
let el = $('#rbro_text_element_content').get(0); | ||
let el = $('#rbro_doc_element_content').get(0); | ||
el.focus(); | ||
@@ -99,9 +100,12 @@ if (typeof el.selectionStart === 'number') { | ||
setValue(field, value, elSelector, isShown) { | ||
setValue(field, value) { | ||
if (field.indexOf('border') !== -1) { | ||
// Style.setBorderValue needs to be called before super.setValue because it calls updateStyle() which expects | ||
// the correct border settings | ||
// Style.setBorderValue needs to be called before super.setValue | ||
// because it calls updateStyle() which expects the correct border settings | ||
this[field] = value; | ||
if (field.substr(0, 3) === 'cs_') { | ||
Style.setBorderValue(this, field, 'cs_', value, elSelector, isShown); | ||
if (field === 'cs_borderWidth') { | ||
this.borderWidthVal = utils.convertInputToNumber(value); | ||
} | ||
Style.setBorderValue(this, field, 'cs_', value, this.rb); | ||
} else { | ||
@@ -111,7 +115,7 @@ if (field === 'borderWidth') { | ||
} | ||
Style.setBorderValue(this, field, '', value, elSelector, isShown); | ||
Style.setBorderValue(this, field, '', value, this.rb); | ||
} | ||
} | ||
super.setValue(field, value, elSelector, isShown); | ||
super.setValue(field, value); | ||
@@ -122,14 +126,2 @@ if (field === 'content') { | ||
this.updateDisplay(); | ||
} else if (field === 'styleId') { | ||
if (value !== '') { | ||
$('#rbro_text_element_style_settings').hide(); | ||
} else { | ||
$('#rbro_text_element_style_settings').show(); | ||
} | ||
} else if (field === 'cs_styleId') { | ||
if (value !== '') { | ||
$('#rbro_text_element_cs_style_settings').hide(); | ||
} else { | ||
$('#rbro_text_element_cs_style_settings').show(); | ||
} | ||
} | ||
@@ -139,7 +131,7 @@ } | ||
/** | ||
* Returns all data fields of this object. The fields are used when serializing the object. | ||
* Returns all fields of this object that can be modified in the properties panel. | ||
* @returns {String[]} | ||
*/ | ||
getFields() { | ||
return ['id', 'containerId', 'x', 'y', 'width', 'height', 'content', 'eval', | ||
getProperties() { | ||
return ['x', 'y', 'width', 'height', 'content', 'eval', | ||
'styleId', 'bold', 'italic', 'underline', 'strikethrough', | ||
@@ -152,3 +144,4 @@ 'horizontalAlignment', 'verticalAlignment', 'textColor', 'backgroundColor', 'font', 'fontSize', | ||
'cs_condition', 'cs_styleId', 'cs_bold', 'cs_italic', 'cs_underline', 'cs_strikethrough', | ||
'cs_horizontalAlignment', 'cs_verticalAlignment', 'cs_textColor', 'cs_backgroundColor', 'cs_font', 'cs_fontSize', | ||
'cs_horizontalAlignment', 'cs_verticalAlignment', | ||
'cs_textColor', 'cs_backgroundColor', 'cs_font', 'cs_fontSize', | ||
'cs_lineSpacing', 'cs_borderColor', 'cs_borderWidth', | ||
@@ -189,2 +182,36 @@ 'cs_borderAll', 'cs_borderLeft', 'cs_borderTop', 'cs_borderRight', 'cs_borderBottom', | ||
/** | ||
* Adds commands to command group parameter to set style properties of given style. | ||
* | ||
* This should be called when the style was changed so all style properties | ||
* will be updated as well. | ||
* | ||
* @param {String} styleId - id of new style or empty string if no style was selected. | ||
* @param {String} fieldPrefix - field prefix when accessing properties. | ||
* @param {Object[]} propertyDescriptors - list of all property descriptors to get | ||
* property type for SetValueCmd. | ||
* @param {CommandGroupCmd} cmdGroup - commands will be added to this command group. | ||
*/ | ||
addCommandsForChangedStyle(styleId, fieldPrefix, propertyDescriptors, cmdGroup) { | ||
if (styleId !== '') { | ||
let style = this.rb.getStyleById(styleId); | ||
if (style !== null) { | ||
let fields = style.getFields().slice(2); // get all fields except id and name | ||
for (let field of fields) { | ||
let objField = fieldPrefix + field; | ||
let value = style.getValue(field); | ||
if (value !== this.getValue(objField)) { | ||
let propertyDescriptor = propertyDescriptors[objField]; | ||
let cmd = new SetValueCmd( | ||
this.getId(), objField, value, propertyDescriptor['type'], this.rb); | ||
cmd.disableSelect(); | ||
cmdGroup.addCommand(cmd); | ||
} | ||
} | ||
} | ||
} | ||
cmdGroup.addCommand(new SetValueCmd( | ||
this.getId(), fieldPrefix + 'styleId', styleId, SetValueCmd.type.select, this.rb)); | ||
} | ||
getContentSize(width, height, style) { | ||
@@ -263,18 +290,2 @@ let borderWidth = style.getValue('borderWidthVal'); | ||
getXTagId() { | ||
return 'rbro_text_element_position_x'; | ||
} | ||
getYTagId() { | ||
return 'rbro_text_element_position_y'; | ||
} | ||
getWidthTagId() { | ||
return 'rbro_text_element_width'; | ||
} | ||
getHeightTagId() { | ||
return 'rbro_text_element_height'; | ||
} | ||
hasBorderSettings() { | ||
@@ -318,5 +329,5 @@ return true; | ||
addCommandsForChangedParameterName(parameter, newParameterName, cmdGroup) { | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_text_element_content', 'content', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_text_element_print_if', 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'rbro_text_element_cs_condition', 'cs_condition', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'content', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'printIf', cmdGroup); | ||
this.addCommandForChangedParameterName(parameter, newParameterName, 'cs_condition', cmdGroup); | ||
} | ||
@@ -323,0 +334,0 @@ |
@@ -5,19 +5,36 @@ var locale_de = { | ||
bandHeader: 'Kopfzeile', | ||
barCodeElementContent: 'Inhalt', | ||
barCodeElementDisplayValue: 'Wert anzeigen', | ||
barCodeElementFormat: 'Format', | ||
contentHeight: 'Inhaltshöhe', | ||
contentHeightInfo: 'Höhe des Inhaltsbereichs, um Elemente zu platzieren (betrifft nicht die tatsächliche Seitengröße)', | ||
differentFiles: 'versch. Dateien...', | ||
differentValues: 'versch. Werte...', | ||
docElementAlternateBackgroundColor: 'Abwechselnde Hintergrundfarbe', | ||
docElementAlwaysPrintOnSamePage: 'Immer zusammen auf einer Seite', | ||
docElementBarCode: 'Barcode', | ||
docElementBorderFrame: 'außen', | ||
docElementBorderFrameRow: 'Rahmen und Zeile', | ||
docElementBorderGrid: 'Alle Rahmenlinien', | ||
docElementBorderNone: 'Keiner', | ||
docElementBorderRow: 'Zeilen', | ||
docElementColor: 'Farbe', | ||
docElementColspan: 'Anz. verbundene Zellen', | ||
docElementColumns: 'Spalten', | ||
docElementConditionalStyle: 'Bedingte Formatierung', | ||
docElementConditionalStyleCondition: 'Bedingung', | ||
docElementContent: 'Text', | ||
docElementContentRows: 'Inhaltszeilen', | ||
docElementDataSource: 'Datenquelle', | ||
docElementDisplayValue: 'Wert anzeigen', | ||
docElementEval: 'Auswerten', | ||
docElementFormat: 'Format', | ||
docElementFrame: 'Rahmen', | ||
docElementGroupExpression: 'Gruppen Expression', | ||
docElementHeight: 'Höhe', | ||
docElementImage: 'Bild', | ||
docElementImageFile: 'Bilddatei', | ||
docElementLabel: 'Bezeichnung', | ||
docElementLine: 'Linie', | ||
docElementLink: 'Link', | ||
docElementLoadImageErrorMsg: 'Bild laden fehlgeschlagen', | ||
docElementPageBreak: 'Zeilenumbruch', | ||
docElementPattern: 'Pattern', | ||
docElementPosition: 'Position (x, y)', | ||
@@ -29,6 +46,8 @@ docElementPositionX: 'Position (x)', | ||
docElementRemoveEmptyElement: 'Entfernen wenn nicht vorhanden', | ||
docElementRepeatHeader: 'Auf jeder Seite wiederholen', | ||
docElementRoot: 'Dokument', | ||
docElementSection: 'Sektion', | ||
docElementLink: 'Link', | ||
docElementShrinkToContentHeight: 'Auf Inhaltshöhe reduzieren', | ||
docElementSize: 'Größe (Breite, Höhe)', | ||
docElementSource: 'Bildquelle', | ||
docElementSpreadsheet: 'Tabellenkalkulation', | ||
@@ -39,6 +58,6 @@ docElementSpreadsheetAddEmptyRow: 'Leere Zeile unterhalb einfügen', | ||
docElementSpreadsheetHide: 'Ausblenden', | ||
docElementWidth: 'Breite', | ||
docElementStyle: 'Formatvorlage', | ||
docElementTable: 'Tabelle', | ||
docElementText: 'Text', | ||
docElementWidth: 'Breite', | ||
documentProperties: 'Dokumenteinstellungen', | ||
@@ -64,3 +83,3 @@ documentTabClose: 'Schließen', | ||
errorMsgInvalidImage: 'Ungültige Bilddaten, Bild muss base64 kodiert sein', | ||
errorMsgInvalidImageSource: 'Ungültige Bildquelle, Url muss mit http:// oder https:// beginnen', | ||
errorMsgInvalidImageSource: 'Ungültige Bildquelle, Url beginnend mit http:// bzw. https:// erwartet', | ||
errorMsgInvalidImageSourceParameter: 'Parameter vom Typ Bild oder String (mit einer Url) notwendig', | ||
@@ -88,6 +107,2 @@ errorMsgInvalidMap: 'Ungültige Auflistung', | ||
footerSize: 'Höhe Fußzeile', | ||
frameElementShrinkToContentHeight: 'Auf Inhaltshöhe reduzieren', | ||
imageElementImage: 'Bilddatei', | ||
imageElementLoadErrorMsg: 'Bild laden fehlgeschlagen', | ||
imageElementSource: 'Bildquelle', | ||
header: 'Kopfzeile', | ||
@@ -205,19 +220,5 @@ headerDisplay: 'Anzeige', | ||
styleVAlignmentTop: 'Oben', | ||
styles: 'Formatvorlagen', | ||
tableElementAlternateBackgroundColor: 'Abwechselnde Hintergrundfarbe', | ||
tableElementBorderFrame: 'außen', | ||
tableElementBorderFrameRow: 'Rahmen und Zeile', | ||
tableElementBorderGrid: 'Alle Rahmenlinien', | ||
tableElementBorderNone: 'Keiner', | ||
tableElementBorderRow: 'Zeilen', | ||
tableElementColumns: 'Spalten', | ||
tableElementColspan: 'Anz. verbundene Zellen', | ||
tableElementContentRows: 'Inhaltszeilen', | ||
tableElementGroupExpression: 'Gruppen Expression', | ||
tableElementRepeatHeader: 'Auf jeder Seite wiederholen', | ||
textElementContent: 'Text', | ||
textElementEval: 'Auswerten', | ||
textElementPattern: 'Pattern' | ||
styles: 'Formatvorlagen' | ||
}; | ||
export default locale_de; |
@@ -5,19 +5,36 @@ var locale_en = { | ||
bandHeader: 'Header', | ||
barCodeElementContent: 'Content', | ||
barCodeElementDisplayValue: 'Display value', | ||
barCodeElementFormat: 'Format', | ||
contentHeight: 'Content height', | ||
contentHeightInfo: 'affects only GUI size to place elements and not the real page size', | ||
differentFiles: 'different files...', | ||
differentValues: 'different values...', | ||
docElementAlternateBackgroundColor: 'Alternate background color', | ||
docElementAlwaysPrintOnSamePage: 'Always on same page', | ||
docElementBarCode: 'Bar code', | ||
docElementBorderFrame: 'Frame', | ||
docElementBorderFrameRow: 'Frame and row', | ||
docElementBorderGrid: 'Grid', | ||
docElementBorderNone: 'None', | ||
docElementBorderRow: 'Row', | ||
docElementColor: 'Color', | ||
docElementColspan: 'Colspan', | ||
docElementColumns: 'Columns', | ||
docElementConditionalStyle: 'Conditional style', | ||
docElementConditionalStyleCondition: 'Condition', | ||
docElementContent: 'Text', | ||
docElementContentRows: 'Content rows', | ||
docElementDataSource: 'Data source', | ||
docElementDisplayValue: 'Display value', | ||
docElementEval: 'Evaluate', | ||
docElementFormat: 'Format', | ||
docElementFrame: 'Frame', | ||
docElementGroupExpression: 'Group expression', | ||
docElementHeight: 'Height', | ||
docElementImage: 'Image', | ||
docElementImageFile: 'Image file', | ||
docElementLabel: 'Label', | ||
docElementLine: 'Line', | ||
docElementLink: 'Link', | ||
docElementLoadImageErrorMsg: 'Loading image failed', | ||
docElementPageBreak: 'Page break', | ||
docElementPattern: 'Pattern', | ||
docElementPosition: 'Position (x, y)', | ||
@@ -29,6 +46,8 @@ docElementPositionX: 'Position (x)', | ||
docElementRemoveEmptyElement: 'Remove when empty', | ||
docElementRepeatHeader: 'Repeat header', | ||
docElementRoot: 'Document', | ||
docElementSection: 'Section', | ||
docElementLink: 'Link', | ||
docElementShrinkToContentHeight: 'Shrink to content height', | ||
docElementSize: 'Size (width, height)', | ||
docElementSource: 'Source', | ||
docElementSpreadsheet: 'Spreadsheet', | ||
@@ -39,6 +58,6 @@ docElementSpreadsheetAddEmptyRow: 'Add empty row below', | ||
docElementSpreadsheetHide: 'Hide', | ||
docElementWidth: 'Width', | ||
docElementStyle: 'Style', | ||
docElementTable: 'Table', | ||
docElementText: 'Text', | ||
docElementWidth: 'Width', | ||
documentProperties: 'Document properties', | ||
@@ -64,3 +83,3 @@ documentTabClose: 'Close', | ||
errorMsgInvalidImage: 'Invalid image data, image must be base64 encoded', | ||
errorMsgInvalidImageSource: 'Invalid source, expected url starting with http:// or https://', | ||
errorMsgInvalidImageSource: 'Invalid source, expected url starting with http:// or https:// respectively', | ||
errorMsgInvalidImageSourceParameter: 'Parameter must be an image or string (containing a url)', | ||
@@ -88,6 +107,2 @@ errorMsgInvalidMap: 'Invalid collection', | ||
footerSize: 'Footer size', | ||
frameElementShrinkToContentHeight: 'Shrink to content height', | ||
imageElementImage: 'Image file', | ||
imageElementLoadErrorMsg: 'Loading image failed', | ||
imageElementSource: 'Source', | ||
header: 'Header', | ||
@@ -205,19 +220,5 @@ headerDisplay: 'Display', | ||
styleVAlignmentTop: 'Top', | ||
styles: 'Styles', | ||
tableElementAlternateBackgroundColor: 'Alternate background color', | ||
tableElementBorderFrame: 'Frame', | ||
tableElementBorderFrameRow: 'Frame and row', | ||
tableElementBorderGrid: 'Grid', | ||
tableElementBorderNone: 'None', | ||
tableElementBorderRow: 'Row', | ||
tableElementColumns: 'Columns', | ||
tableElementColspan: 'Colspan', | ||
tableElementContentRows: 'Content rows', | ||
tableElementGroupExpression: 'Group expression', | ||
tableElementRepeatHeader: 'Repeat header', | ||
textElementContent: 'Text', | ||
textElementEval: 'Evaluate', | ||
textElementPattern: 'Pattern' | ||
styles: 'Styles' | ||
}; | ||
export default locale_en; |
@@ -91,3 +91,4 @@ import AddDeleteParameterCmd from '../commands/AddDeleteParameterCmd'; | ||
let cmd = new SetValueCmd(draggedObj.getId(), null, 'containerId', | ||
let cmd = new SetValueCmd( | ||
draggedObj.getId(), 'containerId', | ||
dropInfo.container.getId(), SetValueCmd.type.internal, this.rb); | ||
@@ -104,3 +105,3 @@ cmdGroup.addCommand(cmd); | ||
}); | ||
let nameDiv = $(`<div class="rbroMenuItemText"><span id="rbro_menu_item_name${this.id}">${name}</span></div>`); | ||
@@ -134,6 +135,3 @@ if (this.properties.showAdd) { | ||
this.getData().addCommandsForDelete(cmd); | ||
} else if (panelName === DocElement.type.text || panelName === DocElement.type.image || | ||
panelName === DocElement.type.line || panelName === DocElement.type.table || | ||
panelName === DocElement.type.pageBreak || | ||
panelName === DocElement.type.frame || panelName === DocElement.type.section) { | ||
} else if (this.isDocElementPanel()) { | ||
if (this.getData() instanceof DocElement) { | ||
@@ -160,3 +158,13 @@ cmd = new CommandGroupCmd('Delete', this); | ||
if (this.properties.hasDetails) { | ||
this.rb.selectObject(this.id, true); | ||
if (!this.rb.isSelectedObject(this.id)) { | ||
let clearSelection = true; | ||
if (this.isDocElementPanel()) { | ||
clearSelection = !event.shiftKey; | ||
} | ||
this.rb.selectObject(this.id, clearSelection); | ||
} else { | ||
if (event.shiftKey) { | ||
this.rb.deselectObject(this.id); | ||
} | ||
} | ||
} | ||
@@ -208,9 +216,9 @@ }); | ||
setActive() { | ||
$('.rbroMenuItem').removeClass('rbroMenuItemActive'); | ||
$(`#rbro_menu_item${this.id}`).addClass('rbroMenuItemActive'); | ||
if (this.properties.hasDetails) { | ||
this.rb.setDetailPanel(this.panelName, this.data); | ||
} | ||
} | ||
setInactive() { | ||
$(`#rbro_menu_item${this.id}`).removeClass('rbroMenuItemActive'); | ||
} | ||
getParentIds() { | ||
@@ -411,2 +419,9 @@ let ids = []; | ||
} | ||
isDocElementPanel() { | ||
return this.panelName === DocElement.type.text || this.panelName === DocElement.type.image || | ||
this.panelName === DocElement.type.line || this.panelName === DocElement.type.table || | ||
this.panelName === DocElement.type.pageBreak || this.panelName === DocElement.type.barCode || | ||
this.panelName === DocElement.type.frame || this.panelName === DocElement.type.section; | ||
} | ||
} |
@@ -46,2 +46,3 @@ import Style from '../data/Style'; | ||
this.rb.load(report); | ||
this.rb.setModified(true); | ||
} else { | ||
@@ -263,3 +264,3 @@ alert('Invalid report template data'); | ||
panelRight.append(elElementsDiv); | ||
let elActionsDiv = $('<div class="rbroActionButtons"></div>'); | ||
@@ -266,0 +267,0 @@ let elAlignDiv = $('<div id="rbro_menu_align" style="display: none;"></div>'); |
@@ -1,2 +0,2 @@ | ||
import Command from '../commands/Command'; | ||
import PanelBase from './PanelBase'; | ||
import SetValueCmd from '../commands/SetValueCmd'; | ||
@@ -10,7 +10,80 @@ import DocumentProperties from '../data/DocumentProperties'; | ||
*/ | ||
export default class DocumentPropertiesPanel { | ||
constructor(documentProperties, rootElement, rb) { | ||
this.documentProperties = documentProperties; | ||
this.rootElement = rootElement; | ||
this.rb = rb; | ||
export default class DocumentPropertiesPanel extends PanelBase { | ||
constructor(rootElement, rb) { | ||
super('rbro_document_properties', DocumentProperties, rootElement, rb); | ||
this.propertyDescriptors = { | ||
'pageFormat': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_format' | ||
}, | ||
'pageWidth': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_width' | ||
}, | ||
'pageHeight': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_height' | ||
}, | ||
'unit': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'unit' | ||
}, | ||
'orientation': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'orientation' | ||
}, | ||
'contentHeight': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'content_height' | ||
}, | ||
'marginLeft': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_margin_left' | ||
}, | ||
'marginTop': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_margin_top' | ||
}, | ||
'marginRight': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_margin_right' | ||
}, | ||
'marginBottom': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'page_margin_bottom' | ||
}, | ||
'header': { | ||
'type': SetValueCmd.type.checkbox, | ||
'fieldId': 'header' | ||
}, | ||
'headerSize': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'header_size' | ||
}, | ||
'headerDisplay': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'header_display' | ||
}, | ||
'footer': { | ||
'type': SetValueCmd.type.checkbox, | ||
'fieldId': 'footer' | ||
}, | ||
'footerSize': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'footer_size' | ||
}, | ||
'footerDisplay': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'footer_display' | ||
}, | ||
'patternLocale': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'pattern_locale' | ||
}, | ||
'patternCurrencySymbol': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'pattern_currency_symbol' | ||
} | ||
}; | ||
} | ||
@@ -30,5 +103,9 @@ | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_format', 'pageFormat', | ||
elPageFormat.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'pageFormat', elPageFormat.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -40,5 +117,9 @@ elFormField.append(elPageFormat); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_width', 'pageWidth', | ||
elPageWidth.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'pageWidth', elPageWidth.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -49,5 +130,9 @@ utils.setInputPositiveInteger(elPageWidth); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_height', 'pageHeight', | ||
elPageHeight.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'pageHeight', elPageHeight.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -60,6 +145,9 @@ utils.setInputPositiveInteger(elPageHeight); | ||
</select>`) | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_unit', 'unit', | ||
elUnit.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
.change(event => { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'unit', elUnit.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -71,5 +159,2 @@ elPageSizeDiv.append(elUnit); | ||
panel.append(elDiv); | ||
if (this.documentProperties.getValue('pageFormat') !== DocumentProperties.pageFormat.userDefined) { | ||
elPageSizeDiv.hide(); | ||
} | ||
@@ -84,5 +169,9 @@ elDiv = $('<div class="rbroFormRow"></div>'); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_orientation', 'orientation', | ||
elOrientation.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'orientation', elOrientation.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -98,5 +187,9 @@ elFormField.append(elOrientation); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_content_height', 'contentHeight', | ||
elContentHeight.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'contentHeight', elContentHeight.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -123,5 +216,9 @@ utils.setInputPositiveInteger(elContentHeight); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_pattern_locale', 'patternLocale', | ||
elPatternLocale.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'patternLocale', elPatternLocale.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -137,6 +234,9 @@ elFormField.append(elPatternLocale); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.rb.getDetailData().getId(), | ||
'rbro_document_properties_pattern_currency_symbol', 'patternCurrencySymbol', | ||
elPatternCurrencySymbol.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'patternCurrencySymbol', | ||
elPatternCurrencySymbol.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -148,4 +248,2 @@ elFormField.append(elPatternCurrencySymbol); | ||
$('#rbro_detail_panel').append(panel); | ||
this.updateData(this.documentProperties); | ||
} | ||
@@ -157,9 +255,13 @@ | ||
let elFormField = $('<div class="rbroFormField rbroSmallInput"></div>'); | ||
let elMarginTopDiv = $('<div class="rbroColumnCenter"></div>'); | ||
let elMarginTop = $(`<input id="rbro_document_properties_page_margin_top" placeholder="${this.rb.getLabel('orientationTop')}">`) | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_margin_top', 'marginTop', | ||
elMarginTop.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'marginTop', elMarginTop.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -173,5 +275,9 @@ utils.setInputPositiveInteger(elMarginTop); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_margin_left', 'marginLeft', | ||
elMarginLeft.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'marginLeft', elMarginLeft.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -182,5 +288,9 @@ utils.setInputPositiveInteger(elMarginLeft); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_margin_right', 'marginRight', | ||
elMarginRight.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'marginRight', elMarginRight.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -194,5 +304,9 @@ utils.setInputPositiveInteger(elMarginRight); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_page_margin_bottom', 'marginBottom', | ||
elMarginBottom.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'marginBottom', elMarginBottom.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -214,5 +328,9 @@ utils.setInputPositiveInteger(elMarginBottom); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_header', 'header', | ||
elHeader.is(":checked"), SetValueCmd.type.checkbox, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'header', elHeader.is(":checked"), | ||
SetValueCmd.type.checkbox, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -234,5 +352,9 @@ elHeaderLabel.append(elHeader); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_header_size', 'headerSize', | ||
elHeaderSize.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'headerSize', elHeaderSize.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -252,5 +374,9 @@ utils.setInputPositiveInteger(elHeaderSize); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_header_display', 'headerDisplay', | ||
elHeaderDisplay.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'headerDisplay', elHeaderDisplay.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -270,5 +396,9 @@ elFormField.append(elHeaderDisplay); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_footer', 'footer', | ||
elFooter.is(":checked"), SetValueCmd.type.checkbox, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'footer', elFooter.is(":checked"), | ||
SetValueCmd.type.checkbox, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -290,5 +420,9 @@ elFooterLabel.append(elFooter); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_footer_size', 'footerSize', | ||
elFooterSize.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'footerSize', elFooterSize.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -308,5 +442,9 @@ utils.setInputPositiveInteger(elFooterSize); | ||
.change(event => { | ||
let cmd = new SetValueCmd(this.documentProperties.getId(), 'rbro_document_properties_footer_display', 'footerDisplay', | ||
elFooterDisplay.val(), SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'footerDisplay', elFooterDisplay.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
} | ||
}); | ||
@@ -320,88 +458,52 @@ elFormField.append(elFooterDisplay); | ||
show(data) { | ||
$('#rbro_document_properties_panel').removeClass('rbroHidden'); | ||
this.updateData(data); | ||
} | ||
hide() { | ||
$('#rbro_document_properties_panel').addClass('rbroHidden'); | ||
} | ||
/** | ||
* Is called when the selected element was changed. | ||
* The panel is updated to show the values of the selected data object. | ||
* @param {DocumentProperties} data | ||
* @param {DocumentProperties} obj - currently selected object. | ||
* @param {String} [field] - affected field in case of change operation. | ||
*/ | ||
updateData(data) { | ||
if (data !== null) { | ||
$('#rbro_document_properties_page_format').val(data.getValue('pageFormat')); | ||
$('#rbro_document_properties_page_width').val(data.getValue('pageWidth')); | ||
$('#rbro_document_properties_page_height').val(data.getValue('pageHeight')); | ||
$('#rbro_document_properties_unit').val(data.getValue('unit')); | ||
$('#rbro_document_properties_orientation').val(data.getValue('orientation')); | ||
$('#rbro_document_properties_content_height').val(data.getValue('contentHeight')); | ||
$('#rbro_document_properties_page_margin_top').val(data.getValue('marginTop')); | ||
$('#rbro_document_properties_page_margin_left').val(data.getValue('marginLeft')); | ||
$('#rbro_document_properties_page_margin_right').val(data.getValue('marginRight')); | ||
$('#rbro_document_properties_page_margin_bottom').val(data.getValue('marginBottom')); | ||
$('#rbro_document_properties_header').prop('checked', data.getValue('header')); | ||
$('#rbro_document_properties_header_size').val(data.getValue('headerSize')); | ||
$('#rbro_document_properties_header_display').val(data.getValue('headerDisplay')); | ||
$('#rbro_document_properties_footer').prop('checked', data.getValue('footer')); | ||
$('#rbro_document_properties_footer_size').val(data.getValue('footerSize')); | ||
$('#rbro_document_properties_footer_display').val(data.getValue('footerDisplay')); | ||
$('#rbro_document_properties_pattern_locale').val(data.getValue('patternLocale')); | ||
$('#rbro_document_properties_pattern_currency_symbol').val(data.getValue('patternCurrencySymbol')); | ||
this.updateVisibility(data); | ||
static updateVisibileRows(obj, field) { | ||
if (field === null || field === 'pageFormat') { | ||
if (obj.getValue('pageFormat') === DocumentProperties.pageFormat.userDefined) { | ||
$('#rbro_document_properties_page_size_row').show(); | ||
} else { | ||
$('#rbro_document_properties_page_size_row').hide(); | ||
} | ||
} | ||
this.updateErrors(); | ||
} | ||
/** | ||
* Is called when a data object was modified (including new and deleted data objects). | ||
* @param {*} obj - new/deleted/modified data object. | ||
* @param {String} operation - operation which caused the notification. | ||
*/ | ||
notifyEvent(obj, operation) { | ||
if (obj instanceof DocumentProperties && obj === this.rb.getDetailData() && operation === Command.operation.change) { | ||
this.updateVisibility(obj); | ||
if (field === null || field === 'header') { | ||
if (obj.getValue('header')) { | ||
$('#rbro_document_properties_header_settings').show(); | ||
} else { | ||
$('#rbro_document_properties_header_settings').hide(); | ||
} | ||
} | ||
} | ||
updateVisibility(obj) { | ||
if (obj.getValue('pageFormat') === DocumentProperties.pageFormat.userDefined) { | ||
$('#rbro_document_properties_page_size_row').show(); | ||
} else { | ||
$('#rbro_document_properties_page_size_row').hide(); | ||
if (field === null || field === 'footer') { | ||
if (obj.getValue('footer')) { | ||
$('#rbro_document_properties_footer_settings').show(); | ||
} else { | ||
$('#rbro_document_properties_footer_settings').hide(); | ||
} | ||
} | ||
if (obj.getValue('header')) { | ||
$('#rbro_document_properties_header_settings').show(); | ||
} else { | ||
$('#rbro_document_properties_header_settings').hide(); | ||
} | ||
if (obj.getValue('footer')) { | ||
$('#rbro_document_properties_footer_settings').show(); | ||
} else { | ||
$('#rbro_document_properties_footer_settings').hide(); | ||
} | ||
} | ||
/** | ||
* Updates displayed errors of currently selected data object. | ||
* Is called when the selection is changed or the selected element was changed. | ||
* The panel is updated to show the values of the selected data object. | ||
* @param {[String]} field - affected field in case of change operation. | ||
*/ | ||
updateErrors() { | ||
$('#rbro_document_properties_panel .rbroFormRow').removeClass('rbroError'); | ||
$('#rbro_document_properties_panel .rbroErrorMessage').text(''); | ||
for (let error of this.documentProperties.getErrors()) { | ||
let rowId = 'rbro_document_properties_' + error.field + '_row'; | ||
let errorId = 'rbro_document_properties_' + error.field + '_error'; | ||
let errorMsg = this.rb.getLabel(error.msg_key); | ||
if (error.info) { | ||
errorMsg = errorMsg.replace('${info}', '<span class="rbroErrorMessageInfo">' + | ||
error.info.replace('<', '<').replace('>', '>') + '</span>'); | ||
updateDisplay(field) { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null && selectedObject instanceof DocumentProperties) { | ||
for (let property in this.propertyDescriptors) { | ||
if (this.propertyDescriptors.hasOwnProperty(property) && (field === null || property === field)) { | ||
let propertyDescriptor = this.propertyDescriptors[property]; | ||
let value = selectedObject.getValue(property); | ||
super.setValue(propertyDescriptor, value, false); | ||
} | ||
} | ||
$('#' + rowId).addClass('rbroError'); | ||
$('#' + errorId).html(errorMsg); | ||
DocumentPropertiesPanel.updateVisibileRows(selectedObject, field); | ||
} | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import PanelBase from './PanelBase'; | ||
import Command from '../commands/Command'; | ||
@@ -12,7 +13,40 @@ import CommandGroupCmd from '../commands/CommandGroupCmd'; | ||
*/ | ||
export default class ParameterPanel { | ||
export default class ParameterPanel extends PanelBase { | ||
constructor(rootElement, rb) { | ||
this.rootElement = rootElement; | ||
this.rb = rb; | ||
this.selectedObjId = null; | ||
super('rbro_parameter', Parameter, rootElement, rb); | ||
this.propertyDescriptors = { | ||
'name': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'name' | ||
}, | ||
'type': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'type' | ||
}, | ||
'arrayItemType': { | ||
'type': SetValueCmd.type.select, | ||
'fieldId': 'array_item_type' | ||
}, | ||
'eval': { | ||
'type': SetValueCmd.type.checkbox, | ||
'fieldId': 'eval' | ||
}, | ||
'nullable': { | ||
'type': SetValueCmd.type.checkbox, | ||
'fieldId': 'nullable' | ||
}, | ||
'pattern': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'pattern' | ||
}, | ||
'expression': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'expression' | ||
}, | ||
'testData': { | ||
'type': SetValueCmd.type.text, | ||
'fieldId': 'test_data' | ||
}, | ||
}; | ||
this.parameterTypeOptions = []; | ||
@@ -27,14 +61,16 @@ } | ||
let elParameterName = $('<input id="rbro_parameter_name">') | ||
.change(event => { | ||
let obj = this.rb.getDataObject(this.selectedObjId); | ||
if (obj !== null) { | ||
.on('input', event => { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
if (elParameterName.val().trim() !== '') { | ||
let newParameterName = elParameterName.val(); | ||
let cmdGroup = new CommandGroupCmd('Rename parameter'); | ||
let cmd = new SetValueCmd(this.selectedObjId, 'rbro_parameter_name', 'name', | ||
newParameterName, SetValueCmd.type.text, this.rb); | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'name', newParameterName, | ||
SetValueCmd.type.text, this.rb); | ||
cmdGroup.addCommand(cmd); | ||
let parent = obj.getParent(); | ||
let parent = selectedObject.getParent(); | ||
if (parent !== null) { | ||
parent.addUpdateTestDataCmdForChangedParameter(obj.getName(), newParameterName, cmdGroup); | ||
parent.addUpdateTestDataCmdForChangedParameter( | ||
selectedObject.getName(), newParameterName, cmdGroup); | ||
} | ||
@@ -44,6 +80,8 @@ // add commands to convert all values containing the currently changed parameter | ||
for (let docElement of docElements) { | ||
docElement.addCommandsForChangedParameterName(obj, newParameterName, cmdGroup); | ||
docElement.addCommandsForChangedParameterName( | ||
selectedObject, newParameterName, cmdGroup); | ||
} | ||
for (let parameter of this.rb.getParameters()) { | ||
parameter.addCommandsForChangedParameterName(obj, newParameterName, cmdGroup); | ||
parameter.addCommandsForChangedParameterName( | ||
selectedObject, newParameterName, cmdGroup); | ||
} | ||
@@ -66,10 +104,11 @@ this.rb.executeCommand(cmdGroup); | ||
.change(event => { | ||
let parameter = this.rb.getDataObject(this.selectedObjId); | ||
if (parameter !== null) { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmdGroup = new CommandGroupCmd('Set parameter type'); | ||
let parameterType = elType.val(); | ||
let cmd = new SetValueCmd(this.selectedObjId, 'rbro_parameter_type', | ||
'type', parameterType, SetValueCmd.type.select, this.rb); | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'type', parameterType, | ||
SetValueCmd.type.select, this.rb); | ||
cmdGroup.addCommand(cmd); | ||
parameter.addCommandsForChangedParameterType(parameterType, cmdGroup); | ||
selectedObject.addCommandsForChangedParameterType(parameterType, cmdGroup); | ||
this.rb.executeCommand(cmdGroup); | ||
@@ -93,5 +132,7 @@ } | ||
.change(event => { | ||
if (this.rb.getDataObject(this.selectedObjId) !== null) { | ||
let cmd = new SetValueCmd(this.selectedObjId, 'rbro_parameter_array_item_type', | ||
'arrayItemType', elArrayItemType.val(), SetValueCmd.type.select, this.rb); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'arrayItemType', elArrayItemType.val(), | ||
SetValueCmd.type.select, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -111,6 +152,7 @@ } | ||
.change(event => { | ||
if (this.rb.getDataObject(this.selectedObjId) !== null) { | ||
let cmd = new SetValueCmd(this.selectedObjId, | ||
'rbro_parameter_eval', 'eval', | ||
elEval.is(":checked"), SetValueCmd.type.checkbox, this.rb); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'eval', elEval.is(":checked"), | ||
SetValueCmd.type.checkbox, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -129,6 +171,7 @@ } | ||
.change(event => { | ||
if (this.rb.getDataObject(this.selectedObjId) !== null) { | ||
let cmd = new SetValueCmd(this.selectedObjId, | ||
'rbro_parameter_nullable', 'nullable', | ||
elNullable.is(":checked"), SetValueCmd.type.checkbox, this.rb); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'nullable', elNullable.is(":checked"), | ||
SetValueCmd.type.checkbox, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -146,6 +189,6 @@ } | ||
.on('input', event => { | ||
if (this.rb.getDataObject(this.selectedObjId) !== null) { | ||
let cmd = new SetValueCmd(this.selectedObjId, | ||
'rbro_parameter_pattern', 'pattern', | ||
elPattern.val(), SetValueCmd.type.text, this.rb); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'pattern', elPattern.val(), SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -157,7 +200,8 @@ } | ||
.click(event => { | ||
let selectedObj = this.rb.getDataObject(this.selectedObjId); | ||
if (selectedObj !== null) { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let patterns; | ||
let type = selectedObj.getValue('type'); | ||
let valueType = (type === Parameter.type.simpleArray) ? selectedObj.getValue('arrayItemType') : type; | ||
let type = selectedObject.getValue('type'); | ||
let valueType = (type === Parameter.type.simpleArray) ? | ||
selectedObject.getValue('arrayItemType') : type; | ||
if (valueType === Parameter.type.date) { | ||
@@ -168,3 +212,3 @@ patterns = this.rb.getProperty('patternDates'); | ||
} | ||
this.rb.getPopupWindow().show(patterns, this.selectedObjId, | ||
this.rb.getPopupWindow().show(patterns, selectedObject.getId(), | ||
'rbro_parameter_pattern', 'pattern', PopupWindow.type.pattern); | ||
@@ -183,5 +227,7 @@ } | ||
.on('input', event => { | ||
if (this.rb.getDataObject(this.selectedObjId) !== null) { | ||
let cmd = new SetValueCmd(this.selectedObjId, 'rbro_parameter_expression', 'expression', | ||
elExpression.val(), SetValueCmd.type.text, this.rb); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'expression', elExpression.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -195,16 +241,15 @@ } | ||
.click(event => { | ||
let selectedObj = this.rb.getDataObject(this.selectedObjId); | ||
if (selectedObj !== null) { | ||
let items; | ||
let popupType; | ||
if (selectedObj.getValue('type') === Parameter.type.sum || | ||
selectedObj.getValue('type') === Parameter.type.average) { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let items, popupType; | ||
if (selectedObject.getValue('type') === Parameter.type.sum || | ||
selectedObject.getValue('type') === Parameter.type.average) { | ||
items = this.rb.getArrayFieldParameterItems(Parameter.type.number); | ||
popupType = PopupWindow.type.parameterSet; | ||
} else { | ||
items = this.rb.getParameterItems(selectedObj); | ||
items = this.rb.getParameterItems(selectedObject); | ||
popupType = PopupWindow.type.parameterAppend; | ||
} | ||
this.rb.getPopupWindow().show(items, this.selectedObjId, | ||
'rbro_parameter_expression', 'expression', popupType); | ||
this.rb.getPopupWindow().show( | ||
items, selectedObject.getId(), 'rbro_parameter_expression', 'expression', popupType); | ||
} | ||
@@ -222,5 +267,7 @@ }); | ||
.change(event => { | ||
if (this.rb.getDataObject(this.selectedObjId) !== null) { | ||
let cmd = new SetValueCmd(this.selectedObjId, 'rbro_parameter_test_data', 'testData', | ||
elTestData.val(), SetValueCmd.type.text, this.rb); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let cmd = new SetValueCmd( | ||
selectedObject.getId(), 'testData', elTestData.val(), | ||
SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -236,8 +283,8 @@ } | ||
.click(event => { | ||
let selectedObj = this.rb.getDataObject(this.selectedObjId); | ||
if (selectedObj !== null) { | ||
let rows = selectedObj.getTestDataRows(true); | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null) { | ||
let rows = selectedObject.getTestDataRows(true); | ||
if (rows.length > 0) { | ||
this.rb.getPopupWindow().show( | ||
rows, this.selectedObjId, '', 'testData', PopupWindow.type.testData); | ||
rows, selectedObject.getId(), '', 'testData', PopupWindow.type.testData); | ||
} else { | ||
@@ -256,23 +303,13 @@ alert(this.rb.getLabel('parameterEditTestDataNoFields')); | ||
updateAutosizeInputs() { | ||
autosize.update($('#rbro_parameter_expression')); | ||
} | ||
updateVisibileRows(obj, field) { | ||
let type = obj.getValue('type'); | ||
let valueType = (type === Parameter.type.simpleArray) ? obj.getValue('arrayItemType') : type; | ||
let showOnlyNameType = obj.getValue('showOnlyNameType'); | ||
let parentParameter = null; | ||
if (obj.getPanelItem() !== null && obj.getPanelItem().getParent().getData() instanceof Parameter) { | ||
parentParameter = obj.getPanelItem().getParent().getData(); | ||
} | ||
show(data) { | ||
$('#rbro_parameter_panel').removeClass('rbroHidden'); | ||
this.updateData(data); | ||
} | ||
hide() { | ||
$('#rbro_parameter_panel').addClass('rbroHidden'); | ||
} | ||
/** | ||
* Is called when the selected element was changed. | ||
* The panel is updated to show the values of the selected data object. | ||
* @param {Parameter} data | ||
*/ | ||
updateData(data) { | ||
if (data !== null) { | ||
let editable = data.getValue('editable'); | ||
if (field === null) { | ||
let editable = obj.getValue('editable'); | ||
$('#rbro_parameter_name').prop('disabled', !editable); | ||
@@ -299,157 +336,114 @@ $('#rbro_parameter_type').prop('disabled', !editable); | ||
} | ||
$('#rbro_parameter_test_data').prop('disabled', false); | ||
$('#rbro_parameter_name').val(data.getName()); | ||
$('#rbro_parameter_type').val(data.getValue('type')); | ||
$('#rbro_parameter_eval').prop('checked', data.getValue('eval')); | ||
$('#rbro_parameter_nullable').prop('checked', data.getValue('nullable')); | ||
$('#rbro_parameter_pattern').val(data.getValue('pattern')); | ||
$('#rbro_parameter_expression').val(data.getValue('expression')); | ||
$('#rbro_parameter_test_data').val(data.getValue('testData')); | ||
this.updatePatternPlaceholder(data); | ||
this.updateVisibility(data); | ||
this.selectedObjId = data.getId(); | ||
} else { | ||
$('#rbro_parameter_name').prop('disabled', true); | ||
$('#rbro_parameter_type').prop('disabled', true); | ||
$('#rbro_parameter_eval').prop('disabled', true); | ||
$('#rbro_parameter_nullable').prop('disabled', true); | ||
$('#rbro_parameter_pattern').prop('disabled', true); | ||
$('#rbro_parameter_expression').prop('disabled', true); | ||
$('#rbro_parameter_test_data').prop('disabled', true); | ||
} | ||
this.updateAutosizeInputs(); | ||
this.updateErrors(); | ||
} | ||
/** | ||
* Is called when a data object was modified (including new and deleted data objects). | ||
* @param {*} obj - new/deleted/modified data object. | ||
* @param {String} operation - operation which caused the notification. | ||
*/ | ||
notifyEvent(obj, operation) { | ||
if (obj instanceof Parameter && obj === this.rb.getDetailData() && operation === Command.operation.change) { | ||
this.updateVisibility(obj); | ||
if (field === null || field === 'type') { | ||
if (type === Parameter.type.simpleArray) { | ||
$('#rbro_parameter_array_item_type_row').show(); | ||
} else { | ||
$('#rbro_parameter_array_item_type_row').hide(); | ||
} | ||
if (type === Parameter.type.string || type === Parameter.type.number || | ||
type === Parameter.type.boolean || type === Parameter.type.date || | ||
type === Parameter.type.array || type === Parameter.type.simpleArray || type === Parameter.type.map) { | ||
$('#rbro_parameter_nullable_row').show(); | ||
} else { | ||
$('#rbro_parameter_nullable_row').hide(); | ||
} | ||
} | ||
} | ||
updatePatternPlaceholder(obj) { | ||
if (obj !== null && obj.getValue('type') === Parameter.type.date) { | ||
$('#rbro_parameter_test_data').attr('placeholder', this.rb.getLabel('parameterTestDataDatePattern')); | ||
} else { | ||
$('#rbro_parameter_test_data').attr('placeholder', ''); | ||
if (field === null || field === 'type' || field === 'arrayItemType') { | ||
if ((valueType === Parameter.type.number || valueType === Parameter.type.date || | ||
valueType === Parameter.type.sum || valueType === Parameter.type.average) && !showOnlyNameType) { | ||
$('#rbro_parameter_pattern_row').show(); | ||
} else { | ||
$('#rbro_parameter_pattern_row').hide(); | ||
} | ||
} | ||
} | ||
updateVisibility(obj) { | ||
let type = obj.getValue('type'); | ||
let valueType = (type === Parameter.type.simpleArray) ? obj.getValue('arrayItemType') : type; | ||
let showOnlyNameType = obj.getValue('showOnlyNameType'); | ||
let parentParameter = null; | ||
if (obj.getPanelItem() !== null && obj.getPanelItem().getParent().getData() instanceof Parameter) { | ||
parentParameter = obj.getPanelItem().getParent().getData(); | ||
} | ||
if (type === Parameter.type.simpleArray) { | ||
$('#rbro_parameter_array_item_type_row').show(); | ||
} else { | ||
$('#rbro_parameter_array_item_type_row').hide(); | ||
} | ||
if (type === Parameter.type.string || type === Parameter.type.number || type === Parameter.type.boolean || type === Parameter.type.date || | ||
type === Parameter.type.array || type === Parameter.type.simpleArray || type === Parameter.type.map) { | ||
$('#rbro_parameter_nullable_row').show(); | ||
} else { | ||
$('#rbro_parameter_nullable_row').hide(); | ||
} | ||
if ((valueType === Parameter.type.number || valueType === Parameter.type.date || | ||
valueType === Parameter.type.sum || valueType === Parameter.type.average) && !showOnlyNameType) { | ||
$('#rbro_parameter_pattern_row').show(); | ||
} else { | ||
$('#rbro_parameter_pattern_row').hide(); | ||
} | ||
if (type === Parameter.type.image || type === Parameter.type.sum || type === Parameter.type.average || | ||
if (field === null || field === 'type' || field === 'eval') { | ||
if (type === Parameter.type.image || type === Parameter.type.sum || type === Parameter.type.average || | ||
showOnlyNameType) { | ||
$('#rbro_parameter_eval_row').hide(); | ||
$('#rbro_parameter_test_data_row').hide(); | ||
} else { | ||
if (type === Parameter.type.image || type === Parameter.type.array || type === Parameter.type.simpleArray || type === Parameter.type.map) { | ||
$('#rbro_parameter_eval_row').hide(); | ||
} else { | ||
$('#rbro_parameter_eval_row').show(); | ||
} | ||
if ((parentParameter !== null && parentParameter.getValue('type') === Parameter.type.array) || | ||
type === Parameter.type.map) { | ||
$('#rbro_parameter_test_data_row').hide(); | ||
} else { | ||
if (type === Parameter.type.array || type === Parameter.type.simpleArray || !obj.getValue('eval')) { | ||
$('#rbro_parameter_test_data_row').show(); | ||
if (type === Parameter.type.image || type === Parameter.type.array || | ||
type === Parameter.type.simpleArray || type === Parameter.type.map) { | ||
$('#rbro_parameter_eval_row').hide(); | ||
} else { | ||
$('#rbro_parameter_eval_row').show(); | ||
} | ||
if ((parentParameter !== null && parentParameter.getValue('type') === Parameter.type.array) || | ||
type === Parameter.type.map) { | ||
$('#rbro_parameter_test_data_row').hide(); | ||
} else { | ||
if (type === Parameter.type.array || type === Parameter.type.simpleArray || | ||
!obj.getValue('eval')) { | ||
$('#rbro_parameter_test_data_row').show(); | ||
} else { | ||
$('#rbro_parameter_test_data_row').hide(); | ||
} | ||
} | ||
if (type === Parameter.type.array || type === Parameter.type.simpleArray) { | ||
$('#rbro_parameter_test_data').hide(); | ||
$('#rbro_parameter_edit_test_data').show(); | ||
} else { | ||
$('#rbro_parameter_test_data').show(); | ||
$('#rbro_parameter_edit_test_data').hide(); | ||
} | ||
} | ||
if (type === Parameter.type.array || type === Parameter.type.simpleArray) { | ||
$('#rbro_parameter_test_data').hide(); | ||
$('#rbro_parameter_edit_test_data').show(); | ||
if (((obj.getValue('eval') && (type === Parameter.type.string || type === Parameter.type.number || | ||
type === Parameter.type.boolean || type === Parameter.type.date)) || | ||
(type === Parameter.type.sum || type === Parameter.type.average)) && !showOnlyNameType) { | ||
$('#rbro_parameter_expression_row').show(); | ||
} else { | ||
$('#rbro_parameter_test_data').show(); | ||
$('#rbro_parameter_edit_test_data').hide(); | ||
$('#rbro_parameter_expression_row').hide(); | ||
} | ||
} | ||
if (((obj.getValue('eval') && (type === Parameter.type.string || type === Parameter.type.number || | ||
type === Parameter.type.boolean || type === Parameter.type.date)) || | ||
(type === Parameter.type.sum || type === Parameter.type.average)) && !showOnlyNameType) { | ||
$('#rbro_parameter_expression_row').show(); | ||
} else { | ||
$('#rbro_parameter_expression_row').hide(); | ||
} | ||
let parameterTypeOptions = []; | ||
// do not allow nested array/map (only for top-level parameters) | ||
let topLevelParameter = (obj.getPanelItem() !== null && | ||
obj.getPanelItem().getParent() === this.rb.getMainPanel().getParametersItem()); | ||
// do not allow image and sum/average parameter in list | ||
let listFieldParameter = (parentParameter !== null && | ||
parentParameter.getValue('type') === Parameter.type.array); | ||
if (field === null) { | ||
let parameterTypeOptions = []; | ||
// do not allow nested array/map (only for top-level parameters) | ||
let topLevelParameter = (obj.getPanelItem() !== null && | ||
obj.getPanelItem().getParent() === this.rb.getMainPanel().getParametersItem()); | ||
// do not allow sum/average parameter in list | ||
let listFieldParameter = (parentParameter !== null && | ||
parentParameter.getValue('type') === Parameter.type.array); | ||
parameterTypeOptions.push({ value: 'string', label: this.rb.getLabel('parameterTypeString') }); | ||
parameterTypeOptions.push({ value: 'number', label: this.rb.getLabel('parameterTypeNumber') }); | ||
parameterTypeOptions.push({ value: 'boolean', label: this.rb.getLabel('parameterTypeBoolean') }); | ||
parameterTypeOptions.push({ value: 'date', label: this.rb.getLabel('parameterTypeDate') }); | ||
if (!listFieldParameter) { | ||
parameterTypeOptions.push({ value: 'image', label: this.rb.getLabel('parameterTypeImage') }); | ||
} | ||
if (topLevelParameter) { | ||
parameterTypeOptions.push({ value: 'array', label: this.rb.getLabel('parameterTypeArray') }); | ||
} | ||
parameterTypeOptions.push({ value: 'simple_array', label: this.rb.getLabel('parameterTypeSimpleArray') }); | ||
if (topLevelParameter) { | ||
parameterTypeOptions.push({ value: 'map', label: this.rb.getLabel('parameterTypeMap') }); | ||
} | ||
if (!listFieldParameter) { | ||
parameterTypeOptions.push({ value: 'sum', label: this.rb.getLabel('parameterTypeSum') }); | ||
parameterTypeOptions.push({ value: 'average', label: this.rb.getLabel('parameterTypeAverage') }); | ||
} | ||
parameterTypeOptions.push({value: 'string', label: this.rb.getLabel('parameterTypeString')}); | ||
parameterTypeOptions.push({value: 'number', label: this.rb.getLabel('parameterTypeNumber')}); | ||
parameterTypeOptions.push({value: 'boolean', label: this.rb.getLabel('parameterTypeBoolean')}); | ||
parameterTypeOptions.push({value: 'date', label: this.rb.getLabel('parameterTypeDate')}); | ||
parameterTypeOptions.push({value: 'image', label: this.rb.getLabel('parameterTypeImage')}); | ||
if (topLevelParameter) { | ||
parameterTypeOptions.push({value: 'array', label: this.rb.getLabel('parameterTypeArray')}); | ||
} | ||
parameterTypeOptions.push({value: 'simple_array', label: this.rb.getLabel('parameterTypeSimpleArray')}); | ||
if (topLevelParameter) { | ||
parameterTypeOptions.push({value: 'map', label: this.rb.getLabel('parameterTypeMap')}); | ||
} | ||
if (!listFieldParameter) { | ||
parameterTypeOptions.push({value: 'sum', label: this.rb.getLabel('parameterTypeSum')}); | ||
parameterTypeOptions.push({value: 'average', label: this.rb.getLabel('parameterTypeAverage')}); | ||
} | ||
let parameterTypeOptionsChanged = false; | ||
if (parameterTypeOptions.length !== this.parameterTypeOptions.length) { | ||
parameterTypeOptionsChanged = true; | ||
} else { | ||
for (let i=0; i < parameterTypeOptions.length; i++) { | ||
if (parameterTypeOptions[i].value !== this.parameterTypeOptions[i].value) { | ||
parameterTypeOptionsChanged = true; | ||
break; | ||
let parameterTypeOptionsChanged = false; | ||
if (parameterTypeOptions.length !== this.parameterTypeOptions.length) { | ||
parameterTypeOptionsChanged = true; | ||
} else { | ||
for (let i = 0; i < parameterTypeOptions.length; i++) { | ||
if (parameterTypeOptions[i].value !== this.parameterTypeOptions[i].value) { | ||
parameterTypeOptionsChanged = true; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
if (parameterTypeOptionsChanged) { | ||
// add dom elements for changed options | ||
let elParameterType = $('#rbro_parameter_type'); | ||
elParameterType.empty(); | ||
for (let i=0; i < parameterTypeOptions.length; i++) { | ||
let parameterTypeOption = parameterTypeOptions[i]; | ||
elParameterType.append( | ||
`<option value="${parameterTypeOption.value}">${parameterTypeOption.label}</option>`); | ||
if (parameterTypeOptionsChanged) { | ||
// add dom elements for changed options | ||
let elParameterType = $('#rbro_parameter_type'); | ||
elParameterType.empty(); | ||
for (let i = 0; i < parameterTypeOptions.length; i++) { | ||
let parameterTypeOption = parameterTypeOptions[i]; | ||
elParameterType.append( | ||
`<option value="${parameterTypeOption.value}">${parameterTypeOption.label}</option>`); | ||
} | ||
this.parameterTypeOptions = parameterTypeOptions; | ||
} | ||
this.parameterTypeOptions = parameterTypeOptions; | ||
} | ||
@@ -459,26 +453,43 @@ } | ||
/** | ||
* Updates displayed errors of currently selected data object. | ||
* Is called when the selection is changed or the selected element was changed. | ||
* The panel is updated to show the values of the selected data object. | ||
* @param {String} [field] - affected field in case of change operation. | ||
*/ | ||
updateErrors() { | ||
$('#rbro_parameter_panel .rbroFormRow').removeClass('rbroError'); | ||
$('#rbro_parameter_panel .rbroErrorMessage').text(''); | ||
let selectedObj = this.rb.getDataObject(this.selectedObjId); | ||
if (selectedObj !== null) { | ||
for (let error of selectedObj.getErrors()) { | ||
let rowId = 'rbro_parameter_' + error.field + '_row'; | ||
let errorId = 'rbro_parameter_' + error.field + '_error'; | ||
let errorMsg = this.rb.getLabel(error.msg_key); | ||
if (error.info) { | ||
errorMsg = errorMsg.replace('${info}', '<span class="rbroErrorMessageInfo">' + | ||
error.info.replace('<', '<').replace('>', '>') + '</span>'); | ||
updateDisplay(field) { | ||
let selectedObject = this.rb.getSelectedObject(); | ||
if (selectedObject !== null && selectedObject instanceof Parameter) { | ||
// must be called before setValue so all parameter type options are available | ||
this.updateVisibileRows(selectedObject, field); | ||
for (let property in this.propertyDescriptors) { | ||
if (this.propertyDescriptors.hasOwnProperty(property) && (field === null || property === field)) { | ||
let propertyDescriptor = this.propertyDescriptors[property]; | ||
let value = selectedObject.getValue(property); | ||
super.setValue(propertyDescriptor, value, false); | ||
} | ||
$('#' + rowId).addClass('rbroError'); | ||
$('#' + errorId).html(errorMsg); | ||
} | ||
if (field === null || field === 'type') { | ||
if (selectedObject.getValue('type') === Parameter.type.date) { | ||
$('#rbro_parameter_test_data').attr('placeholder', this.rb.getLabel('parameterTestDataDatePattern')); | ||
} else { | ||
$('#rbro_parameter_test_data').attr('placeholder', ''); | ||
} | ||
} | ||
ParameterPanel.updateAutosizeInputs(field); | ||
} | ||
} | ||
getSelectedObjId() { | ||
return this.selectedObjId; | ||
/** | ||
* Is called when the selected element was changed. | ||
* The panel is updated to show the values of the selected data object. | ||
* @param {String} [field] - affected field in case of change operation. | ||
*/ | ||
static updateAutosizeInputs(field) { | ||
if (field === null || field === 'expression') { | ||
autosize.update($('#rbro_parameter_expression')); | ||
} | ||
} | ||
} |
@@ -43,3 +43,4 @@ import SetValueCmd from './commands/SetValueCmd'; | ||
* optional a description (String) and separator (Boolean). If separator is true the item is not selectable. | ||
* @param {String} objId - id of data object where the field belongs to. | ||
* @param {String} objId - id of data object where the field belongs to, used to set the test data value | ||
* when popup is closed. If this is no testData popup then the objId is not used. | ||
* @param {String} tagId - id of DOM element in the panel for the given field. In case of empty string there is no | ||
@@ -161,4 +162,4 @@ * input element available. | ||
if (obj !== null && obj.getValue('testData') !== testDataStr) { | ||
let cmd = new SetValueCmd(this.objId, 'rbro_parameter_test_data', 'testData', | ||
testDataStr, SetValueCmd.type.text, this.rb); | ||
let cmd = new SetValueCmd( | ||
this.objId, 'testData', testDataStr, SetValueCmd.type.text, this.rb); | ||
this.rb.executeCommand(cmd); | ||
@@ -165,0 +166,0 @@ } |
String.prototype.reverse = function () { return this.split('').reverse().join(''); }; | ||
export function setInputInteger(el) { | ||
el.on('keyup', function() { | ||
var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse(); | ||
if (this.value !== nvalue) this.value = nvalue; | ||
}); | ||
} | ||
export function setInputPositiveInteger(el) { | ||
@@ -11,0 +4,0 @@ el.on('keyup', function() { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4135902
47446
72