@react-fabric/utilities 1.0.0-beta.60 → 1.0.0-beta.62
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/_countries.js +23 -2749
- package/dist/cjs/_format.js +1 -1
- package/dist/cjs/_isEqual.js +3 -2
- package/dist/esm/_countries.js +23 -2749
- package/dist/esm/_format.js +1 -1
- package/dist/esm/_isEqual.js +3 -2
- package/dist/types/_countries.d.ts +49 -40
- package/package.json +3 -2
- package/src/_countries.ts +25 -2966
- package/src/_format.ts +2 -2
- package/src/_isEqual.ts +3 -2
package/dist/esm/_format.js
CHANGED
|
@@ -86,7 +86,7 @@ var Format;
|
|
|
86
86
|
if (isEmpty(value) || value.length < 6 || !/^[\d+\s\-()]+$/.test(value)) return value;
|
|
87
87
|
var phone = getPhone(value, country);
|
|
88
88
|
/* istanbul ignore next */
|
|
89
|
-
return "".concat(useCss ? "<span class=\"
|
|
89
|
+
return "".concat(useCss ? "<span class=\"icon-[circle-flags--".concat(phone.country, "\"></span>") : Countries.emoji((_phone$country = phone.country) !== null && _phone$country !== void 0 ? _phone$country : ""), " ").concat(phone.formatInternational());
|
|
90
90
|
};
|
|
91
91
|
_Format.number = function (number, format) {
|
|
92
92
|
return numberFormat(number, format);
|
package/dist/esm/_isEqual.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { ascii } from './_ascii.js';
|
|
4
|
+
import { getByPath } from './_getByPath.js';
|
|
4
5
|
import { isNil, isString, isNumber, isBoolean, isObject } from './_isType.js';
|
|
5
6
|
|
|
6
7
|
/*
|
|
@@ -117,8 +118,8 @@ var compareValues = function compareValues() {
|
|
|
117
118
|
var order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "asc";
|
|
118
119
|
var key = arguments.length > 1 ? arguments[1] : undefined;
|
|
119
120
|
return function (a, b) {
|
|
120
|
-
var aValue = key && isObject(a) ? a
|
|
121
|
-
var bValue = key && isObject(b) ? b
|
|
121
|
+
var aValue = key && isObject(a) ? getByPath(a, key, "") : a;
|
|
122
|
+
var bValue = key && isObject(b) ? getByPath(b, key, "") : b;
|
|
122
123
|
var bigger = order === "asc" ? 1 : -1;
|
|
123
124
|
var smaller = order === "desc" ? 1 : -1;
|
|
124
125
|
// return 0 when equal, allowing for multiple sorting properties
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
export interface Country {
|
|
5
|
-
continent: string;
|
|
6
|
-
iso2: string;
|
|
7
|
-
iso3: string;
|
|
8
|
-
alt?: string;
|
|
9
|
-
name: string;
|
|
1
|
+
import { type Country as _Ctry } from "world-countries";
|
|
2
|
+
export type Country = _Ctry & {
|
|
10
3
|
alpha: string;
|
|
11
|
-
fullname: string;
|
|
12
|
-
capital: string;
|
|
13
|
-
tld: string;
|
|
14
|
-
currency: string;
|
|
15
4
|
phone: string;
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
iconCode: string;
|
|
6
|
+
currency: {
|
|
7
|
+
code: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
symbol?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
18
12
|
/**
|
|
19
13
|
* Country list with helper functions
|
|
20
14
|
* This is a list of all countries with their details.
|
|
@@ -72,32 +66,47 @@ declare const _default: {
|
|
|
72
66
|
*
|
|
73
67
|
* @type {Country[]}
|
|
74
68
|
*/
|
|
75
|
-
list:
|
|
76
|
-
|
|
77
|
-
iso2: string;
|
|
78
|
-
iso3: string;
|
|
79
|
-
alpha: string;
|
|
80
|
-
name: string;
|
|
81
|
-
fullname: string;
|
|
82
|
-
capital: string;
|
|
83
|
-
tld: string;
|
|
84
|
-
currency: string;
|
|
85
|
-
phone: string;
|
|
86
|
-
emoji: string;
|
|
87
|
-
alt?: undefined;
|
|
88
|
-
} | {
|
|
89
|
-
continent: string;
|
|
90
|
-
iso2: string;
|
|
91
|
-
iso3: string;
|
|
92
|
-
alt: string;
|
|
69
|
+
list: {
|
|
70
|
+
iconCode: string;
|
|
93
71
|
alpha: string;
|
|
94
|
-
name: string;
|
|
95
|
-
fullname: string;
|
|
96
|
-
capital: string;
|
|
97
|
-
tld: string;
|
|
98
|
-
currency: string;
|
|
99
72
|
phone: string;
|
|
100
|
-
|
|
101
|
-
|
|
73
|
+
currency: {
|
|
74
|
+
code: string;
|
|
75
|
+
name?: string | undefined;
|
|
76
|
+
symbol?: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
name: import("world-countries").CountryName;
|
|
79
|
+
tld: string[];
|
|
80
|
+
cca2: string;
|
|
81
|
+
ccn3: string;
|
|
82
|
+
cca3: string;
|
|
83
|
+
cioc: string;
|
|
84
|
+
independent: boolean;
|
|
85
|
+
status: string;
|
|
86
|
+
unMember: boolean;
|
|
87
|
+
unRegionalGroup: "African Group" | "Asia and the Pacific Group" | "Eastern European Group" | "Latin American and Caribbean Group" | "Western European and Others Group" | "";
|
|
88
|
+
currencies: {
|
|
89
|
+
[currencyCode: string]: import("world-countries").Currency;
|
|
90
|
+
};
|
|
91
|
+
idd: import("world-countries").IntlDirectDialingCode;
|
|
92
|
+
capital: string[];
|
|
93
|
+
altSpellings: string[];
|
|
94
|
+
region: string;
|
|
95
|
+
subregion: string;
|
|
96
|
+
languages: {
|
|
97
|
+
[languageCode: string]: string;
|
|
98
|
+
};
|
|
99
|
+
translations: {
|
|
100
|
+
[languageCode: string]: import("world-countries").OfficialAndCommon;
|
|
101
|
+
};
|
|
102
|
+
latlng: [number, number];
|
|
103
|
+
demonyms: {
|
|
104
|
+
[languageCode: string]: import("world-countries").Demonyms;
|
|
105
|
+
};
|
|
106
|
+
landlocked: boolean;
|
|
107
|
+
borders: string[];
|
|
108
|
+
area: number;
|
|
109
|
+
flag: string;
|
|
110
|
+
}[];
|
|
102
111
|
};
|
|
103
112
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/utilities",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.62",
|
|
4
4
|
"description": "RUF: Utility package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"date-fns": "~4.1.0",
|
|
36
36
|
"libphonenumber-js": "~1.12.25",
|
|
37
37
|
"numeral": "~2.0.6",
|
|
38
|
+
"world-countries": "~5.1.0",
|
|
38
39
|
"yup": "~1.7.1"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"node": ">=18.12.0",
|
|
45
46
|
"npm": ">=8.19.0"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9dce2fd9bb753d67e3f8adbf50be257b4bc64242"
|
|
48
49
|
}
|