gt-next 5.2.39-alpha.9 → 5.2.39
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/CHANGELOG.md +9 -0
- package/LICENSE.md +1 -1
- package/dist/config-dir/DictionaryManager.js +1 -1
- package/dist/config-dir/DictionaryManager.js.map +1 -1
- package/dist/config-dir/I18NConfiguration.d.ts.map +1 -1
- package/dist/config-dir/I18NConfiguration.js +3 -2
- package/dist/config-dir/I18NConfiguration.js.map +1 -1
- package/dist/config-dir/TranslationManager.js +2 -2
- package/dist/config-dir/TranslationManager.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/dictionary/getDictionary.d.ts.map +1 -1
- package/dist/dictionary/getDictionary.js +1 -1
- package/dist/dictionary/getDictionary.js.map +1 -1
- package/dist/errors/createErrors.js +1 -1
- package/dist/errors/createErrors.js.map +1 -1
- package/dist/middleware-dir/createNextMiddleware.d.ts.map +1 -1
- package/dist/middleware-dir/createNextMiddleware.js +5 -6
- package/dist/middleware-dir/createNextMiddleware.js.map +1 -1
- package/dist/middleware-dir/utils.d.ts.map +1 -1
- package/dist/middleware-dir/utils.js +9 -9
- package/dist/middleware-dir/utils.js.map +1 -1
- package/dist/next/getNextLocale.js +1 -1
- package/dist/next/getNextLocale.js.map +1 -1
- package/dist/provider/ClientProviderWrapper.js +2 -2
- package/dist/provider/ClientProviderWrapper.js.map +1 -1
- package/dist/provider/GTProvider.js.map +1 -1
- package/dist/server-dir/buildtime/T.js +2 -2
- package/dist/server-dir/buildtime/T.js.map +1 -1
- package/dist/server-dir/buildtime/getGT.d.ts +2 -2
- package/dist/server-dir/buildtime/getGT.d.ts.map +1 -1
- package/dist/server-dir/buildtime/getGT.js +17 -20
- package/dist/server-dir/buildtime/getGT.js.map +1 -1
- package/dist/server-dir/buildtime/getTranslations.d.ts.map +1 -1
- package/dist/server-dir/buildtime/getTranslations.js +13 -20
- package/dist/server-dir/buildtime/getTranslations.js.map +1 -1
- package/dist/server-dir/runtime/_Tx.js +1 -1
- package/dist/server-dir/runtime/_Tx.js.map +1 -1
- package/dist/server-dir/runtime/tx.d.ts +1 -1
- package/dist/server-dir/runtime/tx.d.ts.map +1 -1
- package/dist/server-dir/runtime/tx.js +13 -15
- package/dist/server-dir/runtime/tx.js.map +1 -1
- package/dist/variables/Currency.d.ts +1 -18
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/Currency.js +2 -18
- package/dist/variables/Currency.js.map +1 -1
- package/dist/variables/DateTime.d.ts +1 -18
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/DateTime.js +20 -21
- package/dist/variables/DateTime.js.map +1 -1
- package/dist/variables/Num.d.ts +3 -5
- package/dist/variables/Num.d.ts.map +1 -1
- package/dist/variables/Num.js +4 -5
- package/dist/variables/Num.js.map +1 -1
- package/package.json +4 -4
package/dist/variables/Num.js
CHANGED
|
@@ -15,6 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var generaltranslation_1 = require("generaltranslation");
|
|
18
19
|
var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
19
20
|
var getLocale_1 = require("../request/getLocale");
|
|
20
21
|
/**
|
|
@@ -30,22 +31,20 @@ var getLocale_1 = require("../request/getLocale");
|
|
|
30
31
|
* </Num>
|
|
31
32
|
* ```
|
|
32
33
|
*
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {string[]} [locales] - Optional locales to use for number formatting. If not provided, the library will default to the user's locale.
|
|
34
|
+
* @param {any} [children] - Optional content (typically a number) to render inside the component.
|
|
35
35
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
|
36
36
|
* @returns {Promise<React.JSX.Element>} The formatted number component.
|
|
37
37
|
*/
|
|
38
38
|
function Num(_a) {
|
|
39
|
-
var children = _a.children, locales = _a.locales, _b = _a.options, options = _b === void 0 ? {} : _b;
|
|
39
|
+
var children = _a.children, name = _a.name, locales = _a.locales, _b = _a.options, options = _b === void 0 ? {} : _b;
|
|
40
40
|
if (!locales) {
|
|
41
41
|
locales = [(0, getLocale_1.useLocale)(), (0, getI18NConfig_1.default)().getDefaultLocale()];
|
|
42
42
|
}
|
|
43
|
-
var gt = (0, getI18NConfig_1.default)().getGTClass();
|
|
44
43
|
// Determine the value to be used
|
|
45
44
|
var renderedValue = typeof children === 'string' ? parseFloat(children) : children;
|
|
46
45
|
// Format the number according to the locale
|
|
47
46
|
var formattedValue = typeof renderedValue === 'number'
|
|
48
|
-
?
|
|
47
|
+
? (0, generaltranslation_1.formatNum)(renderedValue, __assign({ locales: locales }, options))
|
|
49
48
|
: renderedValue;
|
|
50
49
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue });
|
|
51
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Num.js","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8EAAwD;AACxD,kDAAiD;
|
|
1
|
+
{"version":3,"file":"Num.js","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAA+C;AAC/C,8EAAwD;AACxD,kDAAiD;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,GAAG,CAAC,EAUZ;QATC,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA;IAOZ,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,CAAC,IAAA,qBAAS,GAAE,EAAE,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,iCAAiC;IACjC,IAAM,aAAa,GACjB,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEjE,4CAA4C;IAC5C,IAAM,cAAc,GAClB,OAAO,aAAa,KAAK,QAAQ;QAC/B,CAAC,CAAC,IAAA,8BAAS,EAAC,aAAa,aAAI,OAAO,SAAA,IAAK,OAAO,EAAG;QACnD,CAAC,CAAC,aAAa,CAAC;IAEpB,OAAO,2DAAG,cAAc,GAAI,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;AAEzC,kBAAe,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-next",
|
|
3
|
-
"version": "5.2.39
|
|
3
|
+
"version": "5.2.39",
|
|
4
4
|
"description": "A Next.js library for automatic internationalization.",
|
|
5
5
|
"main": "dist/index.server.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"CHANGELOG.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@generaltranslation/supported-locales": "^2.0.
|
|
17
|
-
"generaltranslation": "^
|
|
18
|
-
"gt-react": "^9.2.
|
|
16
|
+
"@generaltranslation/supported-locales": "^2.0.10",
|
|
17
|
+
"generaltranslation": "^6.3.2",
|
|
18
|
+
"gt-react": "^9.2.30"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"patch": "npm version patch",
|