UNPKG

igniteui-react-core

Version:
464 lines (463 loc) 16.6 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { FormatSpecifier } from "./FormatSpecifier"; import { Dictionary$2 } from "./Dictionary$2"; import { String_$type, markType } from "./type"; import { stringIsNullOrEmpty } from "./string"; /** * @hidden */ var NumberFormatSpecifier = /** @class */ /*@__PURE__*/ (function (_super) { __extends(NumberFormatSpecifier, _super); function NumberFormatSpecifier() { var _this = _super.call(this) || this; _this.g = new Dictionary$2(String_$type, String_$type, 0); _this._locale = null; _this._compactDisplay = null; _this._currency = null; _this._currencyDisplay = null; _this._currencySign = null; _this._currencyCode = null; _this._localeMatcher = null; _this._notation = null; _this._numberingSystem = null; _this._signDisplay = null; _this._style = null; _this._unit = null; _this._unitDisplay = null; _this._useGrouping = false; _this._minimumIntegerDigits = 0; _this._minimumFractionDigits = 0; _this._maximumFractionDigits = 0; _this._minimumSignificantDigits = 0; _this._maximumSignificantDigits = 0; _this.useGrouping = true; _this.minimumIntegerDigits = -1; _this.minimumFractionDigits = -1; _this.maximumFractionDigits = -1; _this.minimumSignificantDigits = -1; _this.maximumSignificantDigits = -1; _this.z(); return _this; } NumberFormatSpecifier.prototype.z = function () { this.g = new Dictionary$2(String_$type, String_$type, 0); this.g.addItem("ps-AF", "AFN"); this.g.addItem("prs-AF", "AFN"); this.g.addItem("sq-AL", "ALL"); this.g.addItem("ar-DZ", "DZD"); this.g.addItem("es-AR", "ARS"); this.g.addItem("hy-AM", "AMD"); this.g.addItem("pt-AO", "AOA"); this.g.addItem("en-AU", "AUD"); this.g.addItem("de-AT", "EUR"); this.g.addItem("az-AZ", "AZN"); this.g.addItem("Lt-az-AZ", "AZN"); this.g.addItem("Cy-az-AZ", "AZN"); this.g.addItem("ar-BH", "BHD"); this.g.addItem("eu-ES", "EUR"); this.g.addItem("be-BY", "BYN"); this.g.addItem("nl-BE", "EUR"); this.g.addItem("fr-BE", "EUR"); this.g.addItem("en-BZ", "BZD"); this.g.addItem("es-BO", "BOV"); this.g.addItem("pt-BR", "BRL"); this.g.addItem("ms-BN", "USD"); this.g.addItem("bg-BG", "BGN"); this.g.addItem("km-KH", "KHR"); this.g.addItem("en-CA", "CAD"); this.g.addItem("fr-CA", "CAD"); this.g.addItem("en-CB", "USA"); this.g.addItem("ca-ES", "EUR"); this.g.addItem("es-CL", "CLP"); this.g.addItem("zh-CN", "CNY"); this.g.addItem("zh-CHS", "CNY"); this.g.addItem("zh-CHT", "CNY"); this.g.addItem("es-CO", "COU"); this.g.addItem("es-CR", "CRC"); this.g.addItem("hr-HR", "HRK"); this.g.addItem("cs-CZ", "CZK"); this.g.addItem("da-DK", "DKK"); this.g.addItem("es-DO", "DOP"); this.g.addItem("es-EC", "USD"); this.g.addItem("ar-EG", "USD"); this.g.addItem("es-SV", "SVC"); this.g.addItem("et-EE", "EUR"); this.g.addItem("fo-FO", "DKK"); this.g.addItem("kl-GL", "DKK"); this.g.addItem("fi-FI", "EUR"); this.g.addItem("sv-FI", "EUR"); this.g.addItem("fr-FR", "EUR"); this.g.addItem("gl-ES", "EUR"); this.g.addItem("ka-GE", "GEL"); this.g.addItem("de-DE", "EUR"); this.g.addItem("el-GR", "EUR"); this.g.addItem("es-GT", "GTQ"); this.g.addItem("es-HN", "HNL"); this.g.addItem("zh-HK", "HKD"); this.g.addItem("hu-HU", "HUF"); this.g.addItem("is-IS", "ISK"); this.g.addItem("gu-IN", "INR"); this.g.addItem("hi-IN", "INR"); this.g.addItem("kn-IN", "INR"); this.g.addItem("kok-IN", "INR"); this.g.addItem("mr-IN", "INR"); this.g.addItem("pa-IN", "INR"); this.g.addItem("sa-IN", "INR"); this.g.addItem("ta-IN", "INR"); this.g.addItem("te-IN", "INR"); this.g.addItem("id-ID", "IDR"); this.g.addItem("fa-IR", "IRR"); this.g.addItem("ar-IQ", "IQD"); this.g.addItem("en-IE", "EUR"); this.g.addItem("he-IL", "ILS"); this.g.addItem("it-IT", "EUR"); this.g.addItem("en-JM", "JMD"); this.g.addItem("ja-JP", "JPY"); this.g.addItem("ar-JO", "JOD"); this.g.addItem("kk-KZ", "KZT"); this.g.addItem("ky-KZ", "KZT"); this.g.addItem("sw-KE", "KES"); this.g.addItem("ko-KR", "KPW"); this.g.addItem("ar-KW", "KWD"); this.g.addItem("ky-KG", "KGS"); this.g.addItem("lv-LV", "EUR"); this.g.addItem("ar-LB", "LBP"); this.g.addItem("ar-LY", "LYD"); this.g.addItem("de-LI", "CHF"); this.g.addItem("lt-LT", "EUR"); this.g.addItem("fr-LU", "EUR"); this.g.addItem("de-LU", "EUR"); this.g.addItem("zh-MO", "MOP"); this.g.addItem("ms-MY", "MYR"); this.g.addItem("div-MV", "MVR"); this.g.addItem("es-MX", "MXN"); this.g.addItem("fr-MC", "EUR"); this.g.addItem("mn-MN", "MNT"); this.g.addItem("sr-Latn-ME", "EUR"); this.g.addItem("ar-MA", "MAD"); this.g.addItem("mk-MK", "MKD"); this.g.addItem("en-NZ", "NZD"); this.g.addItem("es-NI", "NIO"); this.g.addItem("nb-NO", "NOK"); this.g.addItem("nn-NO", "NOK"); this.g.addItem("ar-OM", "OMR"); this.g.addItem("ur-PK", "PKR"); this.g.addItem("es-PA", "PAB"); this.g.addItem("es-PY", "PYG"); this.g.addItem("es-PE", "PEN"); this.g.addItem("en-PH", "PHP"); this.g.addItem("pl-PL", "PLN"); this.g.addItem("pt-PT", "EUR"); this.g.addItem("es-PR", "USD"); this.g.addItem("ar-QA", "QAR"); this.g.addItem("ro-RO", "RON"); this.g.addItem("ru-RU", "RUB"); this.g.addItem("tt-RU", "RUB"); this.g.addItem("ar-SA", "SAR"); this.g.addItem("sr-SP", "RSD"); this.g.addItem("Lt-sr-SP", "RSD"); this.g.addItem("Cy-sr-SP", "XOF"); this.g.addItem("zh-SG", "SGD"); this.g.addItem("sk-SK", "EUR"); this.g.addItem("sl-SI", "EUR"); this.g.addItem("af-ZA", "ZAR"); this.g.addItem("en-ZA", "ZAR"); this.g.addItem("es-ES", "EUR"); this.g.addItem("sv-SE", "EUR"); this.g.addItem("si-LK", "LKR"); this.g.addItem("fr-CH", "CHF"); this.g.addItem("de-CH", "CHF"); this.g.addItem("it-CH", "CHF"); this.g.addItem("ar-SY", "SYP"); this.g.addItem("syr-SY", "SYP"); this.g.addItem("zh-TW", "TWD"); this.g.addItem("th-TH", "THB"); this.g.addItem("nl-NL", "EUR"); this.g.addItem("en-TT", "TTD"); this.g.addItem("ar-TN", "TND"); this.g.addItem("tr-TR", "TRY"); this.g.addItem("tk-TM", "TMT"); this.g.addItem("uk-UA", "UAH"); this.g.addItem("ar-AE", "AED"); this.g.addItem("en-GB", "GBP"); this.g.addItem("en-US", "USD"); this.g.addItem("es-UY", "UYU"); this.g.addItem("uz-UZ", "UZS"); this.g.addItem("Cy-uz-UZ", "UZS"); this.g.addItem("Lt-uz-UZ", "UZS"); this.g.addItem("es-VE", "VED"); this.g.addItem("vi-VN", "VND"); this.g.addItem("ar-YE", "YER"); this.g.addItem("en-ZW", "ZWL"); }; NumberFormatSpecifier.prototype.toIntl = function () { var a = {}; if (this.compactDisplay != null) { this.aa(a, "compactDisplay", this.compactDisplay); } if (this.currency != null) { this.aa(a, "currency", this.currency); } if (this.currencyDisplay != null) { this.aa(a, "currencyDisplay", this.currencyDisplay); } if (this.currencySign != null) { this.aa(a, "currencySign", this.currencySign); } if (this.localeMatcher != null) { this.aa(a, "localeMatcher", this.localeMatcher); } if (this.notation != null) { this.aa(a, "notation", this.notation); } if (this.numberingSystem != null) { this.aa(a, "numberingSystem", this.numberingSystem); } if (this.signDisplay != null) { this.aa(a, "signDisplay", this.signDisplay); } if (this.style != null) { this.aa(a, "style", this.style); } if (this.unit != null) { this.aa(a, "unit", this.unit); } if (this.unitDisplay != null) { this.aa(a, "unitDisplay", this.unitDisplay); } if (this.useGrouping != true) { this.aa(a, "useGrouping", this.useGrouping); } if (this.minimumIntegerDigits != -1) { this.aa(a, "minimumIntegerDigits", this.minimumIntegerDigits); } if (this.minimumFractionDigits != -1) { this.aa(a, "minimumFractionDigits", this.minimumFractionDigits); } if (this.maximumFractionDigits != -1) { this.aa(a, "maximumFractionDigits", this.maximumFractionDigits); } if (this.minimumSignificantDigits != -1) { this.aa(a, "minimumSignificantDigits", this.minimumSignificantDigits); } if (this.maximumSignificantDigits != -1) { this.aa(a, "maximumSignificantDigits", this.maximumSignificantDigits); } var locale_ = stringIsNullOrEmpty(this.locale) ? this.getLocalCulture() : this.locale; if (this.style == "currency") { if (this.currencyCode != null) { this.aa(a, "currency", this.currencyCode); } else if (this.g.containsKey(locale_)) { this.aa(a, "currency", this.g.item(locale_)); } } var options_ = a; return new Intl.NumberFormat(locale_, options_); }; NumberFormatSpecifier.prototype.aa = function (options_, propertyName_, value_) { options_[propertyName_] = value_; }; NumberFormatSpecifier.prototype.c = function () { return this.toIntl(); }; Object.defineProperty(NumberFormatSpecifier.prototype, "locale", { get: function () { return this._locale; }, set: function (a) { this._locale = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "compactDisplay", { get: function () { return this._compactDisplay; }, set: function (a) { this._compactDisplay = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "currency", { get: function () { return this._currency; }, set: function (a) { this._currency = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "currencyDisplay", { get: function () { return this._currencyDisplay; }, set: function (a) { this._currencyDisplay = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "currencySign", { get: function () { return this._currencySign; }, set: function (a) { this._currencySign = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "currencyCode", { get: function () { return this._currencyCode; }, set: function (a) { this._currencyCode = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "localeMatcher", { get: function () { return this._localeMatcher; }, set: function (a) { this._localeMatcher = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "notation", { get: function () { return this._notation; }, set: function (a) { this._notation = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "numberingSystem", { get: function () { return this._numberingSystem; }, set: function (a) { this._numberingSystem = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "signDisplay", { get: function () { return this._signDisplay; }, set: function (a) { this._signDisplay = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "style", { get: function () { return this._style; }, set: function (a) { this._style = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "unit", { get: function () { return this._unit; }, set: function (a) { this._unit = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "unitDisplay", { get: function () { return this._unitDisplay; }, set: function (a) { this._unitDisplay = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "useGrouping", { get: function () { return this._useGrouping; }, set: function (a) { this._useGrouping = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "minimumIntegerDigits", { get: function () { return this._minimumIntegerDigits; }, set: function (a) { this._minimumIntegerDigits = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "minimumFractionDigits", { get: function () { return this._minimumFractionDigits; }, set: function (a) { this._minimumFractionDigits = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "maximumFractionDigits", { get: function () { return this._maximumFractionDigits; }, set: function (a) { this._maximumFractionDigits = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "minimumSignificantDigits", { get: function () { return this._minimumSignificantDigits; }, set: function (a) { this._minimumSignificantDigits = a; }, enumerable: false, configurable: true }); Object.defineProperty(NumberFormatSpecifier.prototype, "maximumSignificantDigits", { get: function () { return this._maximumSignificantDigits; }, set: function (a) { this._maximumSignificantDigits = a; }, enumerable: false, configurable: true }); NumberFormatSpecifier.$t = markType(NumberFormatSpecifier, 'NumberFormatSpecifier', FormatSpecifier.$); return NumberFormatSpecifier; }(FormatSpecifier)); export { NumberFormatSpecifier };