@qrvey/utils 1.16.1-1 → 1.16.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/format/definition.d.ts +1 -0
- package/dist/cjs/format/definition.js +27 -27
- package/dist/cjs/format/helpers/isDefaultCurrent.js +1 -2
- package/dist/cjs/format/localization.js +1 -1
- package/dist/format/definition.d.ts +1 -0
- package/dist/format/definition.js +27 -27
- package/dist/format/helpers/isDefaultCurrent.js +1 -2
- package/dist/format/localization.js +1 -1
- package/package.json +1 -1
|
@@ -77,33 +77,33 @@ const isTextColumn = (column) => exports.textFields.includes(column.type) ||
|
|
|
77
77
|
column.formulaType === "boolean";
|
|
78
78
|
exports.isTextColumn = isTextColumn;
|
|
79
79
|
exports.currencyISO = [
|
|
80
|
-
{ text: "Default", label: "USD" },
|
|
81
|
-
{ text: "$ (USD)", label: "USD" },
|
|
82
|
-
{ text: "€ (EUR)", label: "EUR" },
|
|
83
|
-
{ text: "¥ (JPY)", label: "JPY" },
|
|
84
|
-
{ text: "£ (GBP)", label: "GBP" },
|
|
85
|
-
{ text: "₩ (WON)", label: "WON" },
|
|
86
|
-
{ text: "$ (AUD)", label: "AUD" },
|
|
87
|
-
{ text: "$ (CAD)", label: "CAD" },
|
|
88
|
-
{ text: "CHF (CHF)", label: "CHF" },
|
|
89
|
-
{ text: "¥ (CNY)", label: "CNY" },
|
|
90
|
-
{ text: "kr (SEK)", label: "SEK" },
|
|
91
|
-
{ text: "$ (MXN)", label: "MXN" },
|
|
92
|
-
{ text: "$ (NZD)", label: "NZD" },
|
|
93
|
-
{ text: "$ (SGD)", label: "SGD" },
|
|
94
|
-
{ text: "$ (HKD)", label: "HKD" },
|
|
95
|
-
{ text: "kr (NOK)", label: "NOK" },
|
|
96
|
-
{ text: "₩ (KRW)", label: "KRW" },
|
|
97
|
-
{ text: "₺ (TRY)", label: "TRY" },
|
|
98
|
-
{ text: "₹ (INR)", label: "INR" },
|
|
99
|
-
{ text: "₽ (RUB)", label: "RUB" },
|
|
100
|
-
{ text: "R$ (BRL)", label: "BRL" },
|
|
101
|
-
{ text: "R (ZAR)", label: "ZAR" },
|
|
102
|
-
{ text: "kr (DKK)", label: "DKK" },
|
|
103
|
-
{ text: "zł (PLN)", label: "PLN" },
|
|
104
|
-
{ text: "NT$ (TWD)", label: "TWD" },
|
|
105
|
-
{ text: "฿ (THB)", label: "THB" },
|
|
106
|
-
{ text: "RM (MYR)", label: "MYR" },
|
|
80
|
+
{ text: "Default", label: "USD", key: "default" },
|
|
81
|
+
{ text: "$ (USD)", label: "USD", key: 'usd' },
|
|
82
|
+
{ text: "€ (EUR)", label: "EUR", key: 'eur' },
|
|
83
|
+
{ text: "¥ (JPY)", label: "JPY", key: 'jpy' },
|
|
84
|
+
{ text: "£ (GBP)", label: "GBP", key: 'gbp' },
|
|
85
|
+
{ text: "₩ (WON)", label: "WON", key: 'won' },
|
|
86
|
+
{ text: "$ (AUD)", label: "AUD", key: 'aud' },
|
|
87
|
+
{ text: "$ (CAD)", label: "CAD", key: 'cad' },
|
|
88
|
+
{ text: "CHF (CHF)", label: "CHF", key: 'chf' },
|
|
89
|
+
{ text: "¥ (CNY)", label: "CNY", key: 'cny' },
|
|
90
|
+
{ text: "kr (SEK)", label: "SEK", key: 'sek' },
|
|
91
|
+
{ text: "$ (MXN)", label: "MXN", key: 'mxn' },
|
|
92
|
+
{ text: "$ (NZD)", label: "NZD", key: 'nzd' },
|
|
93
|
+
{ text: "$ (SGD)", label: "SGD", key: 'sgd' },
|
|
94
|
+
{ text: "$ (HKD)", label: "HKD", key: 'hkd' },
|
|
95
|
+
{ text: "kr (NOK)", label: "NOK", key: 'nok' },
|
|
96
|
+
{ text: "₩ (KRW)", label: "KRW", key: 'krw' },
|
|
97
|
+
{ text: "₺ (TRY)", label: "TRY", key: 'try' },
|
|
98
|
+
{ text: "₹ (INR)", label: "INR", key: 'inr' },
|
|
99
|
+
{ text: "₽ (RUB)", label: "RUB", key: 'rub' },
|
|
100
|
+
{ text: "R$ (BRL)", label: "BRL", key: 'brl' },
|
|
101
|
+
{ text: "R (ZAR)", label: "ZAR", key: 'zar' },
|
|
102
|
+
{ text: "kr (DKK)", label: "DKK", key: 'dkk' },
|
|
103
|
+
{ text: "zł (PLN)", label: "PLN", key: 'pln' },
|
|
104
|
+
{ text: "NT$ (TWD)", label: "TWD", key: 'twd' },
|
|
105
|
+
{ text: "฿ (THB)", label: "THB", key: 'thb' },
|
|
106
|
+
{ text: "RM (MYR)", label: "MYR", key: 'myr' },
|
|
107
107
|
];
|
|
108
108
|
exports.STANDARD_NUMERIC_FORMATS = [
|
|
109
109
|
"Decimal",
|
|
@@ -7,7 +7,6 @@ exports.isDefaultCurrent = void 0;
|
|
|
7
7
|
* @returns true if the currency is the default currency, false otherwise
|
|
8
8
|
*/
|
|
9
9
|
function isDefaultCurrent(currency) {
|
|
10
|
-
return (((currency === null || currency === void 0 ? void 0 : currency.key) == null || (currency === null || currency === void 0 ? void 0 : currency.key) === "default")
|
|
11
|
-
((currency === null || currency === void 0 ? void 0 : currency.text) == null || (currency === null || currency === void 0 ? void 0 : currency.text) === "Default"));
|
|
10
|
+
return (((currency === null || currency === void 0 ? void 0 : currency.key) == null || (currency === null || currency === void 0 ? void 0 : currency.key) === "default"));
|
|
12
11
|
}
|
|
13
12
|
exports.isDefaultCurrent = isDefaultCurrent;
|
|
@@ -103,7 +103,7 @@ function getLocaleOptions(outputFormat) {
|
|
|
103
103
|
case "Currency" /* LOCALE_FORMATS.CURRENCY */: {
|
|
104
104
|
let iso = (0, isEmpty_1.isEmpty)(currency)
|
|
105
105
|
? definition_1.CURRENCY_DEFAULT
|
|
106
|
-
: definition_1.currencyISO.find((item) => item.
|
|
106
|
+
: definition_1.currencyISO.find((item) => item.label === currency.label);
|
|
107
107
|
if ((0, isEmpty_1.isEmpty)(iso)) {
|
|
108
108
|
iso = definition_1.currencyISO.find((item) => {
|
|
109
109
|
const symbol = item.text.split(" ")[0];
|
|
@@ -70,33 +70,33 @@ export const isTextColumn = (column) => textFields.includes(column.type) ||
|
|
|
70
70
|
column.formulaType === "string" ||
|
|
71
71
|
column.formulaType === "boolean";
|
|
72
72
|
export const currencyISO = [
|
|
73
|
-
{ text: "Default", label: "USD" },
|
|
74
|
-
{ text: "$ (USD)", label: "USD" },
|
|
75
|
-
{ text: "€ (EUR)", label: "EUR" },
|
|
76
|
-
{ text: "¥ (JPY)", label: "JPY" },
|
|
77
|
-
{ text: "£ (GBP)", label: "GBP" },
|
|
78
|
-
{ text: "₩ (WON)", label: "WON" },
|
|
79
|
-
{ text: "$ (AUD)", label: "AUD" },
|
|
80
|
-
{ text: "$ (CAD)", label: "CAD" },
|
|
81
|
-
{ text: "CHF (CHF)", label: "CHF" },
|
|
82
|
-
{ text: "¥ (CNY)", label: "CNY" },
|
|
83
|
-
{ text: "kr (SEK)", label: "SEK" },
|
|
84
|
-
{ text: "$ (MXN)", label: "MXN" },
|
|
85
|
-
{ text: "$ (NZD)", label: "NZD" },
|
|
86
|
-
{ text: "$ (SGD)", label: "SGD" },
|
|
87
|
-
{ text: "$ (HKD)", label: "HKD" },
|
|
88
|
-
{ text: "kr (NOK)", label: "NOK" },
|
|
89
|
-
{ text: "₩ (KRW)", label: "KRW" },
|
|
90
|
-
{ text: "₺ (TRY)", label: "TRY" },
|
|
91
|
-
{ text: "₹ (INR)", label: "INR" },
|
|
92
|
-
{ text: "₽ (RUB)", label: "RUB" },
|
|
93
|
-
{ text: "R$ (BRL)", label: "BRL" },
|
|
94
|
-
{ text: "R (ZAR)", label: "ZAR" },
|
|
95
|
-
{ text: "kr (DKK)", label: "DKK" },
|
|
96
|
-
{ text: "zł (PLN)", label: "PLN" },
|
|
97
|
-
{ text: "NT$ (TWD)", label: "TWD" },
|
|
98
|
-
{ text: "฿ (THB)", label: "THB" },
|
|
99
|
-
{ text: "RM (MYR)", label: "MYR" },
|
|
73
|
+
{ text: "Default", label: "USD", key: "default" },
|
|
74
|
+
{ text: "$ (USD)", label: "USD", key: 'usd' },
|
|
75
|
+
{ text: "€ (EUR)", label: "EUR", key: 'eur' },
|
|
76
|
+
{ text: "¥ (JPY)", label: "JPY", key: 'jpy' },
|
|
77
|
+
{ text: "£ (GBP)", label: "GBP", key: 'gbp' },
|
|
78
|
+
{ text: "₩ (WON)", label: "WON", key: 'won' },
|
|
79
|
+
{ text: "$ (AUD)", label: "AUD", key: 'aud' },
|
|
80
|
+
{ text: "$ (CAD)", label: "CAD", key: 'cad' },
|
|
81
|
+
{ text: "CHF (CHF)", label: "CHF", key: 'chf' },
|
|
82
|
+
{ text: "¥ (CNY)", label: "CNY", key: 'cny' },
|
|
83
|
+
{ text: "kr (SEK)", label: "SEK", key: 'sek' },
|
|
84
|
+
{ text: "$ (MXN)", label: "MXN", key: 'mxn' },
|
|
85
|
+
{ text: "$ (NZD)", label: "NZD", key: 'nzd' },
|
|
86
|
+
{ text: "$ (SGD)", label: "SGD", key: 'sgd' },
|
|
87
|
+
{ text: "$ (HKD)", label: "HKD", key: 'hkd' },
|
|
88
|
+
{ text: "kr (NOK)", label: "NOK", key: 'nok' },
|
|
89
|
+
{ text: "₩ (KRW)", label: "KRW", key: 'krw' },
|
|
90
|
+
{ text: "₺ (TRY)", label: "TRY", key: 'try' },
|
|
91
|
+
{ text: "₹ (INR)", label: "INR", key: 'inr' },
|
|
92
|
+
{ text: "₽ (RUB)", label: "RUB", key: 'rub' },
|
|
93
|
+
{ text: "R$ (BRL)", label: "BRL", key: 'brl' },
|
|
94
|
+
{ text: "R (ZAR)", label: "ZAR", key: 'zar' },
|
|
95
|
+
{ text: "kr (DKK)", label: "DKK", key: 'dkk' },
|
|
96
|
+
{ text: "zł (PLN)", label: "PLN", key: 'pln' },
|
|
97
|
+
{ text: "NT$ (TWD)", label: "TWD", key: 'twd' },
|
|
98
|
+
{ text: "฿ (THB)", label: "THB", key: 'thb' },
|
|
99
|
+
{ text: "RM (MYR)", label: "MYR", key: 'myr' },
|
|
100
100
|
];
|
|
101
101
|
export const STANDARD_NUMERIC_FORMATS = [
|
|
102
102
|
"Decimal",
|
|
@@ -4,6 +4,5 @@
|
|
|
4
4
|
* @returns true if the currency is the default currency, false otherwise
|
|
5
5
|
*/
|
|
6
6
|
export function isDefaultCurrent(currency) {
|
|
7
|
-
return (((currency === null || currency === void 0 ? void 0 : currency.key) == null || (currency === null || currency === void 0 ? void 0 : currency.key) === "default")
|
|
8
|
-
((currency === null || currency === void 0 ? void 0 : currency.text) == null || (currency === null || currency === void 0 ? void 0 : currency.text) === "Default"));
|
|
7
|
+
return (((currency === null || currency === void 0 ? void 0 : currency.key) == null || (currency === null || currency === void 0 ? void 0 : currency.key) === "default"));
|
|
9
8
|
}
|
|
@@ -97,7 +97,7 @@ function getLocaleOptions(outputFormat) {
|
|
|
97
97
|
case "Currency" /* LOCALE_FORMATS.CURRENCY */: {
|
|
98
98
|
let iso = isEmpty(currency)
|
|
99
99
|
? CURRENCY_DEFAULT
|
|
100
|
-
: currencyISO.find((item) => item.
|
|
100
|
+
: currencyISO.find((item) => item.label === currency.label);
|
|
101
101
|
if (isEmpty(iso)) {
|
|
102
102
|
iso = currencyISO.find((item) => {
|
|
103
103
|
const symbol = item.text.split(" ")[0];
|