File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/currency/install/js/currency/currency-core/dist/currency-core.bundle.min.js
Back
this.BX=this.BX||{};(function(e,r){"use strict";var t=new WeakMap;var n=new WeakMap;var i=function(){function e(r,i){babelHelpers.classCallCheck(this,e);t.set(this,{writable:true,value:""});n.set(this,{writable:true,value:{}});babelHelpers.classPrivateFieldSet(this,t,r);babelHelpers.classPrivateFieldSet(this,n,i)}babelHelpers.createClass(e,[{key:"getCurrency",value:function e(){return babelHelpers.classPrivateFieldGet(this,t)}},{key:"getFormat",value:function e(){return babelHelpers.classPrivateFieldGet(this,n)}},{key:"setFormat",value:function e(r){babelHelpers.classPrivateFieldSet(this,n,r)}}]);return e}();var a=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getCurrencyList",value:function e(){return this.currencies}},{key:"setCurrencyFormat",value:function e(t,n,a){if(!r.Type.isStringFilled(t)||!r.Type.isPlainObject(n)){return}var s=this.getCurrencyIndex(t);if(s>-1&&!a){return}var u=babelHelpers.objectSpread({},this.defaultFormat,n);if(s===-1){this.currencies.push(new i(t,u))}else{this.currencies[s].setFormat(u)}}},{key:"setCurrencies",value:function e(t,n){if(r.Type.isArray(t)){for(var i=0;i<t.length;i++){if(!r.Type.isPlainObject(t[i])||!r.Type.isStringFilled(t[i].CURRENCY)||!r.Type.isPlainObject(t[i].FORMAT)){continue}this.setCurrencyFormat(t[i].CURRENCY,t[i].FORMAT,n)}}}},{key:"getCurrencyFormat",value:function e(r){var t=this.getCurrencyIndex(r);return t>-1?this.getCurrencyList()[t].getFormat():false}},{key:"getCurrencyIndex",value:function e(r){var t=this.getCurrencyList();for(var n=0;n<t.length;n++){if(t[n].getCurrency()===r){return n}}return-1}},{key:"clearCurrency",value:function e(r){var t=this.getCurrencyIndex(r);if(t>-1){this.currencies=BX.util.deleteFromArray(this.currencies,t)}}},{key:"clean",value:function e(){this.currencies=[]}},{key:"currencyFormat",value:function e(t,n,i){var a="";var s=this.getCurrencyFormat(n);if(r.Type.isObject(s)){s.CURRENT_DECIMALS=s.DECIMALS;if(s.HIDE_ZERO==="Y"&&t==parseInt(t,10)){s.CURRENT_DECIMALS=0}a=BX.util.number_format(t,s.CURRENT_DECIMALS,s.DEC_POINT,s.THOUSANDS_SEP);if(i){a=s.FORMAT_STRING.replace(/(^|[^&])#/,"$1"+a)}}return a}},{key:"loadCurrencyFormat",value:function e(r){var t=this;return new Promise(function(e,n){var i=t.getCurrencyIndex(r);if(i>-1){e(t.getCurrencyList()[i].getFormat())}else{BX.ajax.runAction("currency.format.get",{data:{currencyId:r}}).then(function(n){var i=n.data;t.setCurrencyFormat(r,i);e(i)}).catch(function(e){n(e.errors)})}})}}]);return e}();babelHelpers.defineProperty(a,"currencies",[]);babelHelpers.defineProperty(a,"defaultFormat",{FORMAT_STRING:"#",DEC_POINT:".",THOUSANDS_SEP:" ",DECIMALS:2,HIDE_ZERO:"N"});r.Reflection.namespace("BX.Currency").Core=a;e.CurrencyCore=a})(this.BX.Currency=this.BX.Currency||{},BX); //# sourceMappingURL=currency-core.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings