-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmart.numberformatpanel.js
6 lines (4 loc) · 20.4 KB
/
smart.numberformatpanel.js
1
2
3
4
5
6
/* Smart UI v15.2.0 (2023-04-20)
Copyright (c) 2011-2023 jQWidgets.
License: https://htmlelements.com/license/ */ //
Smart.Utilities.Assign("CurrencyFormatPanel",class{constructor(e,n="en",a=""){const r=this;r.currencies=[{currency:"US Dollar",sign:"$",abbreviation:"USD"},{currency:"Afghan Afghani",sign:"Af.",abbreviation:"AFN"},{currency:"Albanian Lek",sign:"Lek",abbreviation:"ALL"},{currency:"Algerian Dinar",sign:"din",abbreviation:"DZD"},{currency:"Angolan Kwanza",sign:"Kz",abbreviation:"AOA"},{currency:"Argentine Peso",sign:"$",abbreviation:"ARS"},{currency:"Armenian Dram",sign:"Dram",abbreviation:"AMD"},{currency:"Aruban Florin",sign:"Afl.",abbreviation:"AWG"},{currency:"Australian Dollar",sign:"$",abbreviation:"AUD"},{currency:"Azerbaijani Manat",sign:"₼",abbreviation:"AZN"},{currency:"Bahamian Dollar",sign:"$",abbreviation:"BSD"},{currency:"Bahraini Dinar",sign:"din",abbreviation:"BHD"},{currency:"Bangladeshi Taka",sign:"৳",abbreviation:"BDT"},{currency:"Barbadian Dollar",sign:"$",abbreviation:"BBD"},{currency:"Belarusian Ruble",sign:"р.",abbreviation:"BYN"},{currency:"Belarusian Ruble",sign:"р.",abbreviation:"BYR"},{currency:"Belize Dollar",sign:"$",abbreviation:"BZD"},{currency:"Bermudan Dollar",sign:"$",abbreviation:"BMD"},{currency:"Bhutanese Ngultrum",sign:"Nu.",abbreviation:"BTN"},{currency:"Bolivian Boliviano",sign:"Bs",abbreviation:"BOB"},{currency:"Bosnia-Herzegovina Convertible Mark",sign:"KM",abbreviation:"BAM"},{currency:"Botswanan Pula",sign:"P",abbreviation:"BWP"},{currency:"Brazilian Real",sign:"R$",abbreviation:"BRL"},{currency:"British Pound Sterling",sign:"£",abbreviation:"GBP"},{currency:"Brunei Dollar",sign:"$",abbreviation:"BND"},{currency:"Bulgarian Lev",sign:"lev",abbreviation:"BGN"},{currency:"Burundian Franc",sign:"FBu",abbreviation:"BIF"},{currency:"Cambodian Riel",sign:"Riel",abbreviation:"KHR"},{currency:"Canadian Dollar",sign:"$",abbreviation:"CAD"},{currency:"Cape Verdean Escudo",sign:"CVE",abbreviation:"CVE"},{currency:"Cayman Islands Dollar",sign:"$",abbreviation:"KYD"},{currency:"CFA Franc BCEAO",sign:"CFA",abbreviation:"XOF"},{currency:"CFA Franc BEAC",sign:"FCFA",abbreviation:"XAF"},{currency:"CFP Franc",sign:"FCFP",abbreviation:"XPF"},{currency:"Chilean Peso",sign:"$",abbreviation:"CLP"},{currency:"Chinese Yuan",sign:"¥",abbreviation:"CNY"},{currency:"Chinese Yuan (offshore)",sign:"¥",abbreviation:"RMB"},{currency:"Colombian Peso",sign:"$",abbreviation:"COP"},{currency:"Comorian Franc",sign:"CF",abbreviation:"KMF"},{currency:"Congolese Franc",sign:"FrCD",abbreviation:"CDF"},{currency:"Costa Rican Colon",sign:"₡",abbreviation:"CRC"},{currency:"Croatian Kuna",sign:"kn",abbreviation:"HRK"},{currency:"Cuban Convertible Peso",sign:"$",abbreviation:"CUC"},{currency:"Cuban Peso",sign:"$",abbreviation:"CUP"},{currency:"Czech Republic Koruna",sign:"Kč",abbreviation:"CZK"},{currency:"Danish Krone",sign:"kr.",abbreviation:"DKK"},{currency:"Djiboutian Franc",sign:"Fdj",abbreviation:"DJF"},{currency:"Dominican Peso",sign:"RD$",abbreviation:"DOP"},{currency:"East Caribbean Dollar",sign:"$",abbreviation:"XCD"},{currency:"Egyptian Pound",sign:"£",abbreviation:"EGP"},{currency:"Eritrean Nakfa",sign:"Nfk",abbreviation:"ERN"},{currency:"Ethiopian Birr",sign:"Birr",abbreviation:"ETB"},{currency:"Euro",sign:"€",abbreviation:"EUR"},{currency:"Falkland Islands Pound",sign:"£",abbreviation:"FKP"},{currency:"Fijian Dollar",sign:"$",abbreviation:"FJD"},{currency:"Gambian Dalasi",sign:"GMD",abbreviation:"GMD"},{currency:"Georgian Lari",sign:"GEL",abbreviation:"GEL"},{currency:"Ghanaian Cedi",sign:"GHS",abbreviation:"GHS"},{currency:"Gibraltar Pound",sign:"£",abbreviation:"GIP"},{currency:"Guatemalan Quetzal",sign:"Q",abbreviation:"GTQ"},{currency:"Guinean Franc",sign:"FG",abbreviation:"GNF"},{currency:"Guyanaese Dollar",sign:"$",abbreviation:"GYD"},{currency:"Haitian Gourde",sign:"HTG",abbreviation:"HTG"},{currency:"Honduran Lempira",sign:"L",abbreviation:"HNL"},{currency:"Hong Kong Dollar",sign:"$",abbreviation:"HKD"},{currency:"Hungarian Forint",sign:"Ft",abbreviation:"HUF"},{currency:"Icelandic Krona",sign:"kr",abbreviation:"ISK"},{currency:"Indian Rupee",sign:"₹",abbreviation:"INR"},{currency:"Indonesian Rupiah",sign:"Rp",abbreviation:"IDR"},{currency:"Iranian Rial",sign:"Rial",abbreviation:"IRR"},{currency:"Iraqi Dinar",sign:"din",abbreviation:""},{currency:"Israeli New Sheqel",sign:" ₪",abbreviation:"ILS"},{currency:"Jamaican Dollar",sign:"$",abbreviation:"JMD"},{currency:"Japanese Yen",sign:"¥",abbreviation:"JPY"},{currency:"Jordanian Dinar",sign:"din",abbreviation:"JOD"},{currency:"Kazakhstani Tenge",sign:"₸",abbreviation:"KZT"},{currency:"Kenyan Shilling",sign:"Ksh",abbreviation:"KES"},{currency:"Kuwaiti Dinar",sign:"din",abbreviation:"KWD"},{currency:"Kyrgystani Som",sign:"KGS",abbreviation:"KGS"},{currency:"Laotian Kip",sign:"₭",abbreviation:"LAK"},{currency:"Lebanese Pound",sign:"L£",abbreviation:"LBP"},{currency:"Lesotho Loti",sign:"LSL",abbreviation:"LSL"},{currency:"Liberian Dollar",sign:"$",abbreviation:"LRD"},{currency:"Libyan Dinar",sign:"din",abbreviation:"LYD"},{currency:"Lithuanian Litas",sign:"Lt",abbreviation:"LTL"},{currency:"Macanese Pataca",sign:"MOP",abbreviation:"MOP"},{currency:"Macedonian Denar",sign:"din",abbreviation:"MKD"},{currency:"Malagasy Ariary",sign:"Ar",abbreviation:"MGA"},{currency:"Malawian Kwacha",sign:"MWK",abbreviation:"MWK"},{currency:"Malaysian Ringgit",sign:"RM",abbreviation:"MYR"},{currency:"Maldivian Rufiyaa",sign:"Rf",abbreviation:"MVR"},{currency:"Mauritanian Ouguiya",sign:"MRO",abbreviation:"MRO"},{currency:"Mauritian Rupee",sign:"MURs",abbreviation:"MUR"},{currency:"Mexican Peso",sign:"$",abbreviation:"MXN"},{currency:"Moldovan Leu",sign:"MDL",abbreviation:"MDL"},{currency:"Mongolian Tugrik",sign:"₮",abbreviation:"MNT"},{currency:"Moroccan Dirham",sign:"dh",abbreviation:"MAD"},{currency:"Mozambican Metical",sign:"MTn",abbreviation:"MZN"},{currency:"Myanma Kyat",sign:"K",abbreviation:"MMK"},{currency:"Namibian Dollar",sign:"$",abbreviation:"NAD"},{currency:"Nepalese Rupee",sign:"Rs",abbreviation:"NPR"},{currency:"Netherlands Antillean Guilder",sign:"NAf.",abbreviation:"ANG"},{currency:"New Taiwan Dollar",sign:"NT$",abbreviation:"TWD"},{currency:"New Zealand Dollar",sign:"$",abbreviation:"NZD"},{currency:"Nicaraguan Cordoba",sign:"C$",abbreviation:"NIO"},{currency:"Nigerian Naira",sign:"₦",abbreviation:"NGN"},{currency:"North Korean Won",sign:"₩KP",abbreviation:"KPW"},{currency:"Norwegian Krone",sign:"kr",abbreviation:"NOK"},{currency:"Omani Rial",sign:"Rial",abbreviation:"OMR"},{currency:"Pakistani Rupee",sign:"Rs",abbreviation:"PKR"},{currency:"Panamanian Balboa",sign:"B/.",abbreviation:"PAB"},{currency:"Papua New Guinean Kina",sign:"PGK",abbreviation:"PGK"},{currency:"Paraguayan Guarani",sign:"Gs.",abbreviation:"PYG"},{currency:"Peruvian Nuevo Sol",sign:"S/.",abbreviation:"PEN"},{currency:"Philippine Peso",sign:"₱",abbreviation:"PHP"},{currency:"Polish Zloty",sign:"zł",abbreviation:"PLN"},{currency:"Qatari Rial",sign:"Rial",abbreviation:"QAR"},{currency:"Romanian Leu",sign:"RON",abbreviation:"RON"},{currency:"Russian Ruble",sign:"₽",abbreviation:"RUB"},{currency:"Rwandan Franc",sign:"RF",abbreviation:"RWF"},{currency:"Saint Helena Pound",sign:"£",abbreviation:"SHP"},{currency:"Samoan Tala",sign:"WST",abbreviation:"WST"},{currency:"Sao Tomean Dobra",sign:"Db",abbreviation:"STD"},{currency:"Saudi Riyal",sign:"Rial",abbreviation:"SAR"},{currency:"Serbian Dinar",sign:"din",abbreviation:"RSD"},{currency:"Seychellois Rupee",sign:"SCR",abbreviation:"SCR"},{currency:"Sierra Leonean Leone",sign:"SLL",abbreviation:"SLL"},{currency:"Singapore Dollar",sign:"$",abbreviation:"SGD"},{currency:"Solomon Islands Dollar",sign:"$",abbreviation:"SBD"},{currency:"Somali Shilling",sign:"SOS",abbreviation:"SOS"},{currency:"South African Rand",sign:"R",abbreviation:"ZAR"},{currency:"South Korean Won",sign:"₩",abbreviation:"KRW"},{currency:"South Sudanese Pound",sign:"£",abbreviation:"SSP"},{currency:"Sri Lankan Rupee",sign:"Rs",abbreviation:"LKR"},{currency:"Sudanese Pound",sign:"SDG",abbreviation:"SDG"},{currency:"Surinamese Dollar",sign:"$",abbreviation:"SRD"},{currency:"Swazi Lilangeni",sign:"SZL",abbreviation:"SZL"},{currency:"Swedish Krona",sign:"kr",abbreviation:"SEK"},{currency:"Swiss Franc",sign:"CHF",abbreviation:"CHF"},{currency:"Syrian Pound",sign:"£",abbreviation:"SYP"},{currency:"Tajikistani Somoni",sign:"Som",abbreviation:"TJS"},{currency:"Tanzanian Shilling",sign:"TSh",abbreviation:"TZS"},{currency:"Thai Baht",sign:"฿",abbreviation:"THB"},{currency:"Tongan Pa'anga",sign:"T$",abbreviation:"TOP"},{currency:"Trinidad and Tobago Dollar",sign:"$",abbreviation:"TTD"},{currency:"Tunisian Dinar",sign:"din",abbreviation:"TND"},{currency:"Turkish Lira",sign:"₺",abbreviation:"TRY"},{currency:"Turkmenistani Manat",sign:"m",abbreviation:"TMT"},{currency:"Ugandan Shilling",sign:"UGX",abbreviation:"UGX"},{currency:"Ukrainian Hryvnia",sign:"грн.",abbreviation:"UAH"},{currency:"United Arab Emirates Dirham",sign:"dh",abbreviation:"AED"},{currency:"Uruguayan Peso",sign:"$",abbreviation:"UYU"},{currency:"Uzbekistan Som",sign:"soʼm",abbreviation:"UZS"},{currency:"Vanuatu Vatu",sign:"VUV",abbreviation:"VUV"},{currency:"Venezuelan Bolivar",sign:"Bs",abbreviation:"VEF"},{currency:"Venezuelan Bolivar",sign:"Bs",abbreviation:"VES"},{currency:"Vietnamese Dong",sign:"₫",abbreviation:"VND"},{currency:"Yemeni Rial",sign:"Rial",abbreviation:"YER"},{currency:"Zambian Kwacha",sign:"ZMW",abbreviation:"ZMW"},{currency:"Zimbabwean Dollar",sign:"$",abbreviation:"ZWD"}],r.mainContainer=document.querySelector(e),r.selectedCurrencyFullValue="1,000.00",r.selectedCurrencyValue="1,000",r.demoContainerHolder=document.createElement("div"),r.demoContainerHolder.classList.add("currency-format-panel-demo-container"),r._setLocalizationSettings(n,a),r._generateSelectedCurrencyHolderAndApply(),r._generateCurrencyHolder(),r.mainContainer.appendChild(r.demoContainerHolder)}_setLocalizationSettings(e,n){const a=this;a.locale=e,a.messages=n,a.defaultLocale="en",a.defaultMessages={en:{apply:"apply"}},a.messages||(a.messages=a.defaultMessages),a.messages[a.locale]||(a.messages[a.defaultLocale]||(a.messages=a.defaultMessages),a.locale=a.defaultLocale)}_generateSelectedCurrencyHolderAndApply(){const e=this;let n=document.createElement("div");n.classList.add("selected-currency-holder-and-apply-holder");let a=document.createElement("div");a.classList.add("selected-currency-holder");let r=document.createElement("div");r.classList.add("currency-sign-input-holder"),e.currencySignTextBox=document.createElement("smart-text-box"),e.currencySignTextBox.classList.add("currency-sign-input");const i=()=>e._filterCurrencies();e.currencySignTextBox.addEventListener("keyup",i),e.currencySignTextBox["currency-sign-input"]=i,r.appendChild(e.currencySignTextBox),a.appendChild(r);let t=document.createElement("div");t.classList.add("currency-smart-input-holder"),e.inputCurrencyFormats=document.createElement("smart-input"),e.inputCurrencyFormats.dropDownWidth="auto",e.inputCurrencyFormats.dropDownButtonPosition="right",e.inputCurrencyFormats.readonly=!0,e.inputCurrencyFormats.classList.add("input-currency-formats"),t.appendChild(e.inputCurrencyFormats),a.appendChild(t);let o=document.createElement("div");o.classList.add("apply-button-holder"),e.applyButton=document.createElement("smart-button"),e.applyButton.classList.add("use-format-button"),e.applyButton.classList.add("success"),e.applyButton.innerHTML=e.messages[e.locale].apply?e.messages[e.locale].apply:e.defaultMessages[e.defaultLocale].apply;const s=()=>e.value=e.getFormat();e.applyButton.addEventListener("click",s),e.applyButton["apply-button-event-listener"]=s,o.appendChild(e.applyButton),n.appendChild(a),n.appendChild(o),e.demoContainerHolder.appendChild(n)}detach(){this._removeEventListeners()}_removeEventListeners(){const e=this;e.currencySignTextBox.removeEventListener("keyup",e.currencySignTextBox["currency-sign-input"]),delete e.currencySignTextBox["currency-sign-input"],e.applyButton.removeEventListener("click",e.applyButton["apply-button-event-listener"]),delete e.applyButton["apply-button-event-listener"];let n=document.querySelectorAll(".currency-item");for(let e=0;e<n.length;e++){let a=n[e],r=n[e].dataset.currency;a.removeEventListener("click",a[r]),delete a[r]}}getFormat(){const e=this;let n,a=e.inputCurrencyFormats.value;return a.includes(e.selectedCurrencyFullValue)?n=a.replace(e.selectedCurrencyFullValue,'"#,#.00"'):a.includes(e.selectedCurrencyValue)&&(n=a.replace(e.selectedCurrencyValue,'"#,#"')),n}_generateCurrencyHolder(){const e=this;e.currencyHolder=document.createElement("div"),e.currencyHolder.classList.add("currency-list"),e._setCurrencies(e.currencies),e.demoContainerHolder.appendChild(e.currencyHolder)}_setCurrencies(e){const n=this;n.currencyHolder.innerHTML="";for(let a=0;a<e.length;a++){let r=e[a],i=e[a].currency,t=e[a].sign,o=document.createElement("div");o.classList.add("currency-item"),o.innerHTML=i,o.dataset.currency=i.replace(" ","_")+"_"+a;let s=document.createElement("div");s.classList.add("currency-item-default-format"),s.innerHTML=t+" "+n.selectedCurrencyFullValue,o.appendChild(s),n.currencyHolder.appendChild(o),0===a&&n.useThisFormat(r);const c=()=>n.useThisFormat(r);o.addEventListener("click",c),o[i.replace(" ","_")+"_"+a]=c}}_filterCurrencies(){const e=this;let n=e.currencySignTextBox.value.toLowerCase(),a=[];for(let r=0;r<e.currencies.length;r++)-1!==e.currencies[r].currency.toLowerCase().indexOf(n)&&a.push(e.currencies[r]);e._setCurrencies(a);let r=[];0!==n.length&&(r.push(n+e.selectedCurrencyFullValue),r.push(n+e.selectedCurrencyValue)),r.push(e.selectedCurrencyFullValue+n),r.push(e.selectedCurrencyValue+n),e.inputCurrencyFormats.dataSource=r,e.inputCurrencyFormats.value=r[0]}useThisFormat(e){const n=this;let a=e.sign,r=e.abbreviation;n.currencySignTextBox.value=a;let i=[];i.push(a+n.selectedCurrencyFullValue),i.push(r+" "+a+n.selectedCurrencyFullValue),i.push(a+n.selectedCurrencyValue),i.push(n.selectedCurrencyFullValue+a),i.push(n.selectedCurrencyValue+a),n.inputCurrencyFormats.dataSource=i,n.inputCurrencyFormats.value=i[0]}}),Smart.Utilities.Assign("NumberFormatPanel",class{constructor(e,n="en",a=""){const r=this;r.formats=["0","0.00","#,##0","#,##0.00","#,##0_);(#,##0)","$#,##0_);($#,##0)","#,##0.00_);(#,##0.00)","$#,##0.00_);($#,##0.00)","@","0%","0.00%","0.00E+00","##0.0E+0","# ?/?","# ??/??",'_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)','_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)','_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)','_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'],r.sampleDemoValue=1234.56,r.mainContainer=document.querySelector(e),r.demoContainerHolder=document.createElement("div"),r.demoContainerHolder.classList.add("number-format-panel-demo-container"),r._setLocalizationSettings(n,a),r._generateSelectedNumberFormatHolderAndApply(),r._generateExampleContainer(),r._generateCustomFormatsHolder(),r.useThisFormat(r.initialCustomNumberFormatValue),r.mainContainer.appendChild(r.demoContainerHolder)}_setLocalizationSettings(e,n){const a=this;a.locale=e,a.messages=n,a.defaultLocale="en",a.defaultMessages={en:{apply:"apply",sample:"Sample",positive:"Positive",negative:"Negative",zero:"Zero",text:"Text"}},a.messages||(a.messages=a.defaultMessages),a.messages[a.locale]||(a.messages[a.defaultLocale]||(a.messages=a.defaultMessages),a.locale=a.defaultLocale)}_generateSelectedNumberFormatHolderAndApply(){const e=this;let n=document.createElement("div");n.classList.add("selected-custom-number-format-holder-and-apply-holder");let a=document.createElement("div");a.classList.add("selected-custom-number-format-holder");let r=document.createElement("div");r.classList.add("custom-number-format-input-holder"),e.customNumberFormatTextBox=document.createElement("smart-text-box"),e.customNumberFormatTextBox.classList.add("custom-number-format-input");const i=()=>e._filterCustomFormat();e.customNumberFormatTextBox.addEventListener("keyup",i),e.customNumberFormatTextBox["custom-number-format-input"]=i,r.appendChild(e.customNumberFormatTextBox),a.appendChild(r);let t=document.createElement("div");t.classList.add("apply-button-holder"),e.applyButton=document.createElement("smart-button"),e.applyButton.classList.add("use-number-format-button"),e.applyButton.classList.add("success"),e.applyButton.innerHTML=e.messages[e.locale].apply?e.messages[e.locale].apply:e.defaultMessages[e.defaultLocale].apply;const o=()=>e.value=e.getFormat();e.applyButton.addEventListener("click",o),e.applyButton["apply-button-event-listener"]=o,t.appendChild(e.applyButton),n.appendChild(a),n.appendChild(t),e.demoContainerHolder.appendChild(n)}detach(){this._removeEventListeners()}_removeEventListeners(){const e=this;e.customNumberFormatTextBox.removeEventListener("keyup",e.customNumberFormatTextBox["custom-number-format-input"]),delete e.customNumberFormatTextBox["custom-number-format-input"],e.applyButton.removeEventListener("click",e.applyButton["apply-button-event-listener"]),delete e.applyButton["apply-button-event-listener"];let n=document.querySelectorAll(".custom-number-format-item");for(let e=0;e<n.length;e++){let a=n[e];a.removeEventListener("click",a[e]),delete a[e]}}getFormat(){return this.customNumberFormatTextBox.value}_generateExampleContainer(){const e=this;let n=document.createElement("div");n.classList.add("sample-container"),e.sampleTextHolder=document.createElement("div"),e.sampleTextHolder.classList.add("sample-text-container"),e.positiveTextHolder=document.createElement("div"),e.positiveTextHolder.classList.add("positive-text-container"),e.negativeTextHolder=document.createElement("div"),e.negativeTextHolder.classList.add("negative-text-container"),e.zeroTextHolder=document.createElement("div"),e.zeroTextHolder.classList.add("zero-text-container"),e.textHolder=document.createElement("div"),e.textHolder.classList.add("text-container"),n.appendChild(e.sampleTextHolder),n.appendChild(e.positiveTextHolder),n.appendChild(e.negativeTextHolder),n.appendChild(e.zeroTextHolder),n.appendChild(e.textHolder),e.demoContainerHolder.appendChild(n)}_generateCustomFormatsHolder(){const e=this;e.customNumberFormatHolder=document.createElement("div"),e.customNumberFormatHolder.classList.add("custom-number-format-list"),e._setNumberFormats(e.formats),e.demoContainerHolder.appendChild(e.customNumberFormatHolder)}_setNumberFormats(e){const n=this;n.customNumberFormatHolder.innerHTML="";for(let a=0;a<e.length;a++){let r=e[a],i=document.createElement("div");i.classList.add("custom-number-format-item"),i.innerHTML=r;let t=document.createElement("div");t.classList.add("custom-number-format-item-default-format"),t.innerHTML=(new Smart.Utilities.NumberRenderer).formatNumber(n.sampleDemoValue,r),i.appendChild(t),n.customNumberFormatHolder.appendChild(i),0===a&&(n.initialCustomNumberFormatValue=r);const o=()=>n.useThisFormat(r);i.addEventListener("click",o),i[a]=o}}_filterCustomFormat(){const e=this;let n=e.customNumberFormatTextBox.value,a=[];for(let r=0;r<e.formats.length;r++)-1!==e.formats[r].indexOf(n)&&a.push(e.formats[r]);e._setNumberFormats(a),e.useThisFormat(n)}useThisFormat(e){const n=this;let a="",r="",i="",t="",o="",s=(n.messages[n.locale].sample?n.messages[n.locale].sample:n.defaultMessages[n.defaultLocale].sample)+": "+(new Smart.Utilities.NumberRenderer).formatNumber(n.sampleDemoValue,e),c=(n.messages[n.locale].positive?n.messages[n.locale].positive:n.defaultMessages[n.defaultLocale].positive)+": "+(new Smart.Utilities.NumberRenderer).formatNumber(Math.abs(n.sampleDemoValue),e),l=(n.messages[n.locale].negative?n.messages[n.locale].negative:n.defaultMessages[n.defaultLocale].negative)+": "+(new Smart.Utilities.NumberRenderer).formatNumber(-Math.abs(n.sampleDemoValue),e),u=(n.messages[n.locale].zero?n.messages[n.locale].zero:n.defaultMessages[n.defaultLocale].zero)+": "+(new Smart.Utilities.NumberRenderer).formatNumber(0,e),b=(n.messages[n.locale].text?n.messages[n.locale].text:n.defaultMessages[n.defaultLocale].text)+": "+(new Smart.Utilities.NumberRenderer).formatNumber(n.messages[n.locale].text.toLowerCase()?n.messages[n.locale].text.toLowerCase():n.defaultMessages[n.defaultLocale].text.toLowerCase(),e);var d=(e.match(/;/g)||[]).length;if(0===d?a=s:1===d?(r=c,i=l):2===d?(r=c,i=l,t=u):(r=c,i=l,t=u,o=b),n.sampleTextHolder.innerHTML=a,n.positiveTextHolder.innerHTML=r,n.negativeTextHolder.innerHTML=i,n.zeroTextHolder.innerHTML=t,n.textHolder.innerHTML=o,n.customNumberFormatTextBox.value=e,null===n.demoContainerHolder.querySelector(".custom-number-format-item"))n.demoContainerHolder.querySelector(".custom-number-format-list").classList.add("smart-hidden");else{let e=n.demoContainerHolder.querySelector(".custom-number-format-list").classList;for(let n=0;n<e.length;n++)"smart-hidden"!==e[n]||e.remove("smart-hidden")}}});