gt-react 2.0.168 → 2.0.170
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/client/ClientProvider.d.ts +1 -1
- package/dist/client/ClientProvider.d.ts.map +1 -1
- package/dist/client/ClientProvider.js +2 -2
- package/dist/client/ClientProvider.js.map +1 -1
- package/dist/client/GTProvider.d.ts.map +1 -1
- package/dist/client/GTProvider.js +5 -2
- package/dist/client/GTProvider.js.map +1 -1
- package/dist/client/useCurrentLanguage.d.ts +2 -0
- package/dist/client/useCurrentLanguage.d.ts.map +1 -0
- package/dist/client/useCurrentLanguage.js +14 -0
- package/dist/client/useCurrentLanguage.js.map +1 -0
- package/dist/client/useDefaultLanguage.d.ts +2 -0
- package/dist/client/useDefaultLanguage.d.ts.map +1 -0
- package/dist/client/useDefaultLanguage.js +14 -0
- package/dist/client/useDefaultLanguage.js.map +1 -0
- package/dist/client.d.ts +7 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -4
- package/dist/client.js.map +1 -1
- package/dist/config/I18NConfig.d.ts +13 -1
- package/dist/config/I18NConfig.d.ts.map +1 -1
- package/dist/config/I18NConfig.js +17 -2
- package/dist/config/I18NConfig.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/intl/intl.d.ts.map +1 -1
- package/dist/intl/intl.js +3 -0
- package/dist/intl/intl.js.map +1 -1
- package/dist/next.d.ts +5 -2
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +8 -2
- package/dist/next.js.map +1 -1
- package/dist/primitives/numeric/Numeric.d.ts.map +1 -1
- package/dist/primitives/numeric/Numeric.js +2 -1
- package/dist/primitives/numeric/Numeric.js.map +1 -1
- package/dist/primitives/numeric/client/ClientNumeric.d.ts +2 -5
- package/dist/primitives/numeric/client/ClientNumeric.d.ts.map +1 -1
- package/dist/primitives/numeric/client/ClientNumeric.js +10 -8
- package/dist/primitives/numeric/client/ClientNumeric.js.map +1 -1
- package/dist/primitives/numeric/getNumericBranch.d.ts +1 -1
- package/dist/primitives/numeric/getNumericBranch.d.ts.map +1 -1
- package/dist/primitives/numeric/getNumericBranch.js +45 -41
- package/dist/primitives/numeric/getNumericBranch.js.map +1 -1
- package/dist/primitives/value/client/ClientValue.d.ts.map +1 -1
- package/dist/primitives/value/client/ClientValue.js +2 -2
- package/dist/primitives/value/client/ClientValue.js.map +1 -1
- package/dist/primitives/value/client/RenderClientVariable.d.ts +6 -0
- package/dist/primitives/value/client/RenderClientVariable.d.ts.map +1 -0
- package/dist/primitives/value/client/RenderClientVariable.js +67 -0
- package/dist/primitives/value/client/RenderClientVariable.js.map +1 -0
- package/dist/primitives/value/renderVariable.js +1 -1
- package/dist/primitives/value/renderVariable.js.map +1 -1
- package/dist/primitives/variable/currency/ClientCurrency.d.ts +13 -0
- package/dist/primitives/variable/currency/ClientCurrency.d.ts.map +1 -0
- package/dist/primitives/variable/currency/ClientCurrency.js +17 -0
- package/dist/primitives/variable/currency/ClientCurrency.js.map +1 -0
- package/dist/primitives/variable/currency/Currency.d.ts +14 -0
- package/dist/primitives/variable/currency/Currency.d.ts.map +1 -0
- package/dist/primitives/variable/currency/Currency.js +31 -0
- package/dist/primitives/variable/currency/Currency.js.map +1 -0
- package/dist/primitives/variable/date/ClientDate.d.ts +13 -0
- package/dist/primitives/variable/date/ClientDate.d.ts.map +1 -0
- package/dist/primitives/variable/date/ClientDate.js +17 -0
- package/dist/primitives/variable/date/ClientDate.js.map +1 -0
- package/dist/primitives/variable/date/ClientDateVariable.d.ts +13 -0
- package/dist/primitives/variable/date/ClientDateVariable.d.ts.map +1 -0
- package/dist/primitives/variable/date/ClientDateVariable.js +17 -0
- package/dist/primitives/variable/date/ClientDateVariable.js.map +1 -0
- package/dist/primitives/variable/date/Date.d.ts +14 -0
- package/dist/primitives/variable/date/Date.d.ts.map +1 -0
- package/dist/primitives/variable/date/Date.js +34 -0
- package/dist/primitives/variable/date/Date.js.map +1 -0
- package/dist/primitives/variable/date/DateVariable.d.ts +14 -0
- package/dist/primitives/variable/date/DateVariable.d.ts.map +1 -0
- package/dist/primitives/variable/date/DateVariable.js +34 -0
- package/dist/primitives/variable/date/DateVariable.js.map +1 -0
- package/dist/primitives/variable/number/ClientNumber.d.ts +12 -0
- package/dist/primitives/variable/number/ClientNumber.d.ts.map +1 -0
- package/dist/primitives/variable/number/ClientNumber.js +17 -0
- package/dist/primitives/variable/number/ClientNumber.js.map +1 -0
- package/dist/primitives/variable/number/Number.d.ts +13 -0
- package/dist/primitives/variable/number/Number.d.ts.map +1 -0
- package/dist/primitives/variable/number/Number.js +31 -0
- package/dist/primitives/variable/number/Number.js.map +1 -0
- package/dist/primitives/variable/variable/ClientVariable.d.ts +12 -0
- package/dist/primitives/variable/variable/ClientVariable.d.ts.map +1 -0
- package/dist/primitives/variable/variable/ClientVariable.js +16 -0
- package/dist/primitives/variable/variable/ClientVariable.js.map +1 -0
- package/dist/primitives/variable/variable/Variable.d.ts +13 -0
- package/dist/primitives/variable/variable/Variable.d.ts.map +1 -0
- package/dist/primitives/variable/variable/Variable.js +24 -0
- package/dist/primitives/variable/variable/Variable.js.map +1 -0
- package/dist/server/ServerI18N.d.ts.map +1 -1
- package/dist/server/ServerI18N.js +15 -3
- package/dist/server/ServerI18N.js.map +1 -1
- package/dist/server/renderChildren.d.ts +6 -1
- package/dist/server/renderChildren.d.ts.map +1 -1
- package/dist/server/renderChildren.js +21 -20
- package/dist/server/renderChildren.js.map +1 -1
- package/dist/server/resolvers/I18NResolver.d.ts +6 -10
- package/dist/server/resolvers/I18NResolver.d.ts.map +1 -1
- package/dist/server/resolvers/I18NResolver.js +2 -38
- package/dist/server/resolvers/I18NResolver.js.map +1 -1
- package/package.json +2 -2
- package/dist/primitives/value/client/renderClientVariable.d.ts +0 -9
- package/dist/primitives/value/client/renderClientVariable.d.ts.map +0 -1
- package/dist/primitives/value/client/renderClientVariable.js +0 -67
- package/dist/primitives/value/client/renderClientVariable.js.map +0 -1
- package/dist/server/resolvers/renderResolvedChildren.d.ts +0 -19
- package/dist/server/resolvers/renderResolvedChildren.d.ts.map +0 -1
- package/dist/server/resolvers/renderResolvedChildren.js +0 -152
- package/dist/server/resolvers/renderResolvedChildren.js.map +0 -1
|
@@ -8,46 +8,50 @@ exports.default = getNumericBranch;
|
|
|
8
8
|
* @param {Record<string, any>} options - The options containing possible branch names.
|
|
9
9
|
* @returns {string} The determined branch name.
|
|
10
10
|
*/
|
|
11
|
-
function getBranchNameFromNumber(n, options) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (n === 2)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
11
|
+
function getBranchNameFromNumber(n, language, options) {
|
|
12
|
+
const pluralRules = new Intl.PluralRules(language);
|
|
13
|
+
const provisionalBranchName = pluralRules.select(n);
|
|
14
|
+
// aliases
|
|
15
|
+
// 0
|
|
16
|
+
if (n === 0 && options["zero"])
|
|
17
|
+
return "zero"; // override
|
|
18
|
+
// 1
|
|
19
|
+
if (Math.abs(n) === 1 && options["one"])
|
|
20
|
+
return "one"; // override
|
|
21
|
+
if (Math.abs(n) === 1 && options["singular"])
|
|
22
|
+
return "singular"; // override
|
|
23
|
+
if (provisionalBranchName === "one" && options["singular"])
|
|
24
|
+
return "singular";
|
|
25
|
+
// 2
|
|
26
|
+
if (Math.abs(n) === 2 && options["two"])
|
|
27
|
+
return "two"; // override
|
|
28
|
+
if (Math.abs(n) === 2 && options["dual"])
|
|
29
|
+
return "dual"; // override
|
|
30
|
+
if (provisionalBranchName === "two" && options["dual"])
|
|
31
|
+
return "dual";
|
|
32
|
+
if (provisionalBranchName === "two" && options["plural"])
|
|
33
|
+
return "plural";
|
|
34
|
+
if (provisionalBranchName === "two" && options["other"])
|
|
35
|
+
return "other";
|
|
36
|
+
// few
|
|
37
|
+
if (provisionalBranchName === "few" && options["paucal"])
|
|
38
|
+
return "paucal";
|
|
39
|
+
if (provisionalBranchName === "few" && options["other"])
|
|
40
|
+
return "other";
|
|
41
|
+
// many
|
|
42
|
+
if (provisionalBranchName === "many" && options["other"])
|
|
43
|
+
return "plural";
|
|
44
|
+
// default
|
|
45
|
+
if (options[provisionalBranchName])
|
|
46
|
+
return provisionalBranchName;
|
|
47
|
+
if (provisionalBranchName === "few" && options["plural"])
|
|
48
|
+
return "plural";
|
|
49
|
+
if (provisionalBranchName === "many" && options["plural"])
|
|
50
|
+
return "plural";
|
|
51
|
+
// other
|
|
52
|
+
if (provisionalBranchName === "other" && options["plural"])
|
|
49
53
|
return "plural";
|
|
50
|
-
return
|
|
54
|
+
return "";
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Helper function to get the branch from a list of ranges.
|
|
@@ -70,13 +74,13 @@ function getBranchFromRanges(n, ranges) {
|
|
|
70
74
|
* @param {any} branches - The object containing possible branches and their corresponding ranges and options.
|
|
71
75
|
* @returns {any} The determined branch.
|
|
72
76
|
*/
|
|
73
|
-
function getNumericBranch(n, branches) {
|
|
77
|
+
function getNumericBranch(n, language, branches) {
|
|
74
78
|
let branchName = '';
|
|
75
79
|
let branch = null;
|
|
76
80
|
if (typeof n === 'number' && (branches === null || branches === void 0 ? void 0 : branches.ranges))
|
|
77
81
|
branch = getBranchFromRanges(n, branches.ranges);
|
|
78
82
|
if (typeof n === 'number' && !branch && branches)
|
|
79
|
-
branchName = getBranchNameFromNumber(n, branches);
|
|
83
|
+
branchName = getBranchNameFromNumber(n, language, branches);
|
|
80
84
|
if (branchName && !branch)
|
|
81
85
|
branch = branches[branchName];
|
|
82
86
|
return branch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNumericBranch.js","sourceRoot":"","sources":["../../../src/primitives/numeric/getNumericBranch.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getNumericBranch.js","sourceRoot":"","sources":["../../../src/primitives/numeric/getNumericBranch.ts"],"names":[],"mappings":";;AAiEA,mCAOC;AAxED;;;;;;GAMG;AACH,SAAS,uBAAuB,CAAC,CAAS,EAAE,QAAgB,EAAE,OAA4B;IACtF,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,qBAAqB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACpD,UAAU;IACV,IAAI;IACJ,IAAI,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,WAAW;IAC1D,IAAI;IACJ,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,WAAW;IAClE,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC,CAAC,WAAW;IAC5E,IAAI,qBAAqB,KAAK,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IAC9E,IAAI;IACJ,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,WAAW;IAClE,IAAI,IA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AAI,CAAC;YAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;IAChE,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;AACH,SAAwB,gBAAgB,CAAC,CAAS,EAAE,QAAgB,EAAE,QAAa;IAC/E,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,OAAO,CAAC,KAAK,QAAQ,KAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAA;QAAE,MAAM,GAAG,mBAAmB,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChG,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,IAAI,QAAQ;QAAE,UAAU,GAAG,uBAAuB,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9G,IAAI,UAAU,IAAI,CAAC,MAAM;QAAE,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IACzD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientValue.d.ts","sourceRoot":"","sources":["../../../../src/primitives/value/client/ClientValue.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ClientValue.d.ts","sourceRoot":"","sources":["../../../../src/primitives/value/client/ClientValue.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAKlD,KAAK,UAAU,GAAG;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,EAAE,UAAU,GAAG,SAAS,CAoBtF"}
|
|
@@ -18,8 +18,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.default = Value;
|
|
19
19
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
20
|
const react_1 = require("react");
|
|
21
|
-
const renderClientVariable_1 = __importDefault(require("./renderClientVariable"));
|
|
22
21
|
const getValueBranch_1 = __importDefault(require("../getValueBranch"));
|
|
22
|
+
const RenderClientVariable_1 = __importDefault(require("./RenderClientVariable"));
|
|
23
23
|
/**
|
|
24
24
|
* Client-side value variable component that processes the given values and branches,
|
|
25
25
|
* and renders the appropriate content based on the branch logic.
|
|
@@ -38,7 +38,7 @@ function Value(_a) {
|
|
|
38
38
|
return ((typeof values !== 'undefined' && typeof branches !== 'undefined') ? (0, getValueBranch_1.default)(values, branches) : null) || children;
|
|
39
39
|
}, [values, branches, children]);
|
|
40
40
|
const renderedChildren = (0, react_1.useMemo)(() => {
|
|
41
|
-
return (0,
|
|
41
|
+
return (0, jsx_runtime_1.jsx)(RenderClientVariable_1.default, { variables: values ? values : undefined, children: branch });
|
|
42
42
|
}, [branch, values]);
|
|
43
43
|
return ((0, jsx_runtime_1.jsx)("span", { children: renderedChildren }));
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientValue.js","sourceRoot":"","sources":["../../../../src/primitives/value/client/ClientValue.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;AAsBZ,wBAoBC;;AAxCD,
|
|
1
|
+
{"version":3,"file":"ClientValue.js","sourceRoot":"","sources":["../../../../src/primitives/value/client/ClientValue.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;AAsBZ,wBAoBC;;AAxCD,iCAAkD;AAClD,uEAA+C;AAC/C,kFAA0D;AAS1D;;;;;;;;GAQG;AACH,SAAwB,KA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AAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAAG,SAAS,CAanI"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.default = RenderClientVariable;
|
|
31
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
32
|
+
const react_1 = __importStar(require("react"));
|
|
33
|
+
const ClientVariable_1 = __importDefault(require("../../variable/variable/ClientVariable"));
|
|
34
|
+
/**
|
|
35
|
+
* Handles a single child element by cloning it with new properties if it is a valid React element,
|
|
36
|
+
* or wrapping it in a React Fragment if it is a valid React node object.
|
|
37
|
+
*
|
|
38
|
+
* @param {any} child - The child element to handle.
|
|
39
|
+
* @returns {any} The handled child element.
|
|
40
|
+
*/
|
|
41
|
+
function SingleChild({ children, variables }) {
|
|
42
|
+
if (!children || typeof children === 'string' || typeof children === 'number' || typeof children === 'boolean')
|
|
43
|
+
return children;
|
|
44
|
+
if (react_1.default.isValidElement(children)) {
|
|
45
|
+
const { props, type } = children;
|
|
46
|
+
if (variables && props['data-gt-variable-name']) {
|
|
47
|
+
const value = variables[props['data-gt-variable-name']];
|
|
48
|
+
if (value !== null && typeof value !== 'undefined') {
|
|
49
|
+
return (0, jsx_runtime_1.jsx)(ClientVariable_1.default, { defaultValue: value, name: props['data-gt-variable-name'] });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
let newProps = Object.assign({}, props);
|
|
53
|
+
if (props === null || props === void 0 ? void 0 : props.children) {
|
|
54
|
+
newProps.children = react_1.default.Children.map(props.children, child => (0, jsx_runtime_1.jsx)(SingleChild, { variables: variables, children: child }));
|
|
55
|
+
}
|
|
56
|
+
return react_1.default.cloneElement(children, newProps);
|
|
57
|
+
}
|
|
58
|
+
return children;
|
|
59
|
+
}
|
|
60
|
+
function RenderClientVariable({ children, variables }) {
|
|
61
|
+
const [renderedChildren, setRenderedChildren] = (0, react_1.useState)(children);
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
63
|
+
setRenderedChildren(react_1.default.Children.map(children, child => (0, jsx_runtime_1.jsx)(SingleChild, { variables: variables, children: child })));
|
|
64
|
+
}, [children, variables]);
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderedChildren }));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=RenderClientVariable.js.map
|
|
@@ -0,0 +1 @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AY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACjD,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,SAAwB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAsD;IAEpH,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,QAAQ,CAAC,CAAC;IAEnE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,mBAAmB,CAAC,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAC,WAAW,IAAC,SAAS,EAAE,SAAS,YAAG,KAAK,GAAe,CAAC,CAAC,CAAA;IACxH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAA;IAEzB,OAAO,CACH,2DACK,gBAAgB,GAClB,CACN,CAAA;AACL,CAAC"}
|
|
@@ -7,7 +7,7 @@ exports.default = renderVariable;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const isValidReactNode_1 = __importDefault(require("./isValidReactNode"));
|
|
10
|
-
const Variable_1 = __importDefault(require("../variable/Variable"));
|
|
10
|
+
const Variable_1 = __importDefault(require("../variable/variable/Variable"));
|
|
11
11
|
/**
|
|
12
12
|
* Handles a single child element by cloning it with new properties if it is a valid React element,
|
|
13
13
|
* or wrapping it in a React Fragment if it is a valid React node object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderVariable.js","sourceRoot":"","sources":["../../../src/primitives/value/renderVariable.tsx"],"names":[],"mappings":";;;;;AA6CA,iCAGC;;AAhDD,kDAAyB;AACzB,0EAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"renderVariable.js","sourceRoot":"","sources":["../../../src/primitives/value/renderVariable.tsx"],"names":[],"mappings":";;;;;AA6CA,iCAGC;;AAhDD,kDAAyB;AACzB,0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WAAW,IAAI,KAAK,KAAK,IAAI,CAAC,IAAI,IAAA,0BAAgB,EAAC,KAAK,CAAC,EAAE,CAAC;YAC9E,OAAO,uBAAC,kBAAQ,IAAC,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAa,CAAC;QACjE,CAAC;IACL,CAAC;;QACI,OAAO,KAAK,CAAC;AACtB,CAAC,CAAA;AAED;;;;;GAKG;AACH,SAAwB,cAAc,CAAC,QAAa,EAAE,SAA+B;IACjF,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,KAAa,EAAE,EAAE,CAAC,uBAAC,eAAK,CAAC,QAAQ,cAAc,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,IAA3C,KAAK,CAAwD,CAAC,CAAC;;QAC/J,OAAO,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
currency?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const ClientCurrency: {
|
|
9
|
+
({ children, name, defaultValue, currency }: VariableProps): ReactNode;
|
|
10
|
+
gtTransformation: string;
|
|
11
|
+
};
|
|
12
|
+
export default ClientCurrency;
|
|
13
|
+
//# sourceMappingURL=ClientCurrency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientCurrency.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/currency/ClientCurrency.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAIlD,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,QAAA,MAAM,cAAc;iDAAiE,aAAa,GAAG,SAAS;;CAe7G,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_1 = require("../../../client");
|
|
7
|
+
const ClientCurrency = ({ children, name = "cost", defaultValue, currency = "USD" }) => {
|
|
8
|
+
const currentLanguage = (0, client_1.useCurrentLanguage)();
|
|
9
|
+
const formattedValue = (0, react_1.useMemo)(() => {
|
|
10
|
+
let value = (typeof children !== 'undefined' && typeof defaultValue === 'undefined') ? children : defaultValue;
|
|
11
|
+
return typeof value !== 'undefined' ? new Intl.NumberFormat(currentLanguage, { style: 'currency', currency }).format(value) : value;
|
|
12
|
+
}, [children, defaultValue, currentLanguage, currency]);
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, children: formattedValue }));
|
|
14
|
+
};
|
|
15
|
+
ClientCurrency.gtTransformation = "variable";
|
|
16
|
+
exports.default = ClientCurrency;
|
|
17
|
+
//# sourceMappingURL=ClientCurrency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientCurrency.js","sourceRoot":"","sources":["../../../../src/primitives/variable/currency/ClientCurrency.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ,iCAAkD;AAClD,4CAAqD;AAUrD,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,QAAQ,GAAG,KAAK,EAAiB,EAAa,EAAE;IAE7G,MAAM,eAAe,GAAG,IAAA,2BAAkB,GAAE,CAAC;IAE7C,MAAM,cAAc,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,KAAK,GAAG,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC;QAC/G,OAAO,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxI,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExD,OAAO,CACH,0DAA6B,IAAI,YAC5B,cAAc,GACZ,CACV,CAAC;AAEN,CAAC,CAAC;AAEF,cAAc,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAE7C,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
currency?: string;
|
|
7
|
+
"data-generaltranslation"?: Record<string, any> | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Currency: {
|
|
10
|
+
({ children, name, defaultValue, currency, ...props }: VariableProps): ReactNode;
|
|
11
|
+
gtTransformation: string;
|
|
12
|
+
};
|
|
13
|
+
export default Currency;
|
|
14
|
+
//# sourceMappingURL=Currency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/currency/Currency.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CAC/D,CAAA;AAED,QAAA,MAAM,QAAQ;2DAA2E,aAAa,GAAG,SAAS;;CAiBjH,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
const I18NConfig_1 = __importDefault(require("../../../config/I18NConfig"));
|
|
19
|
+
const Currency = (_a) => {
|
|
20
|
+
var { children, name = "cost", defaultValue, currency = "USD" } = _a, props = __rest(_a, ["children", "name", "defaultValue", "currency"]);
|
|
21
|
+
const { "data-generaltranslation": generaltranslation } = props;
|
|
22
|
+
if (typeof children !== 'undefined' && typeof defaultValue === 'undefined')
|
|
23
|
+
defaultValue = children;
|
|
24
|
+
const currentLanguage = I18NConfig_1.default.getCurrentLanguage();
|
|
25
|
+
// Format the number as currency according to the locale
|
|
26
|
+
const formattedValue = (typeof defaultValue !== 'undefined') ? new Intl.NumberFormat(currentLanguage, { style: 'currency', currency }).format(defaultValue) : defaultValue;
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-generaltranslation": generaltranslation, "data-gt-variable-name": name, children: formattedValue }));
|
|
28
|
+
};
|
|
29
|
+
Currency.gtTransformation = "variable";
|
|
30
|
+
exports.default = Currency;
|
|
31
|
+
//# sourceMappingURL=Currency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/primitives/variable/currency/Currency.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4EAAoD;AAWpD,MAAM,QAAQ,GAAG,CAAC,EAAoF,EAAa,EAAE;QAAnG,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,QAAQ,GAAG,KAAK,OAA2B,EAAtB,KAAK,cAAnE,gDAAqE,CAAF;IAEjF,MAAM,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEhE,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,YAAY,KAAK,WAAW;QAAE,YAAY,GAAG,QAAQ,CAAC;IAEpG,MAAM,eAAe,GAAG,oBAAU,CAAC,kBAAkB,EAAE,CAAC;IAExD,wDAAwD;IACxD,MAAM,cAAc,GAAG,CAAC,OAAO,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAE3K,OAAO,CACH,4DAA+B,kBAAkB,2BAAyB,IAAI,YACzE,cAAc,GACZ,CACV,CAAC;AAEN,CAAC,CAAC;AAEF,QAAQ,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAEvC,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: string | number | Date;
|
|
6
|
+
options?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
declare const ClientDate: {
|
|
9
|
+
({ children, name, defaultValue, options }: VariableProps): ReactNode;
|
|
10
|
+
gtTransformation: string;
|
|
11
|
+
};
|
|
12
|
+
export default ClientDate;
|
|
13
|
+
//# sourceMappingURL=ClientDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientDate.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/date/ClientDate.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAIlD,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA;AAED,QAAA,MAAM,UAAU;gDAA6D,aAAa,GAAG,SAAS;;CAcrG,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_1 = require("../../../client");
|
|
7
|
+
const ClientDate = ({ children, name = "date", defaultValue, options = {} }) => {
|
|
8
|
+
const currentLanguage = (0, client_1.useCurrentLanguage)();
|
|
9
|
+
const formattedValue = (0, react_1.useMemo)(() => {
|
|
10
|
+
let dateValue = (typeof defaultValue === 'string' || typeof defaultValue === 'number' || typeof defaultValue === typeof new Date() && typeof defaultValue !== 'undefined') ? new Date(defaultValue) : defaultValue;
|
|
11
|
+
return new Intl.DateTimeFormat(currentLanguage, options).format(dateValue);
|
|
12
|
+
}, [children, defaultValue, options, currentLanguage]);
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, children: formattedValue }));
|
|
14
|
+
};
|
|
15
|
+
ClientDate.gtTransformation = "variable";
|
|
16
|
+
exports.default = ClientDate;
|
|
17
|
+
//# sourceMappingURL=ClientDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientDate.js","sourceRoot":"","sources":["../../../../src/primitives/variable/date/ClientDate.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ,iCAAkD;AAClD,4CAAqD;AAUrD,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,EAAE,EAAiB,EAAa,EAAE;IAErG,MAAM,eAAe,GAAG,IAAA,2BAAkB,GAAE,CAAC;IAE7C,MAAM,cAAc,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,SAAS,GAAG,CAAC,OAAO,YAAY,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,OAAO,IAAI,IAAI,EAAE,IAAI,OAAO,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;QACnN,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/E,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAEvD,OAAO,CACH,0DAA6B,IAAI,YAC5B,cAAc,GACZ,CACV,CAAC;AACN,CAAC,CAAC;AAEF,UAAU,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAEzC,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: string | number | Date;
|
|
6
|
+
options?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
declare const ClientDateVariable: {
|
|
9
|
+
({ children, name, defaultValue, options }: VariableProps): ReactNode;
|
|
10
|
+
gtTransformation: string;
|
|
11
|
+
};
|
|
12
|
+
export default ClientDateVariable;
|
|
13
|
+
//# sourceMappingURL=ClientDateVariable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientDateVariable.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/date/ClientDateVariable.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAIlD,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA;AAED,QAAA,MAAM,kBAAkB;gDAA6D,aAAa,GAAG,SAAS;;CAc7G,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_1 = require("../../../client");
|
|
7
|
+
const ClientDateVariable = ({ children, name = "date", defaultValue, options = {} }) => {
|
|
8
|
+
const currentLanguage = (0, client_1.useCurrentLanguage)();
|
|
9
|
+
const formattedValue = (0, react_1.useMemo)(() => {
|
|
10
|
+
let dateValue = (typeof defaultValue === 'string' || typeof defaultValue === 'number' || typeof defaultValue === typeof new Date() && typeof defaultValue !== 'undefined') ? new Date(defaultValue) : defaultValue;
|
|
11
|
+
return new Intl.DateTimeFormat(currentLanguage, options).format(dateValue);
|
|
12
|
+
}, [children, defaultValue, options, currentLanguage]);
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, children: formattedValue }));
|
|
14
|
+
};
|
|
15
|
+
ClientDateVariable.gtTransformation = "variable";
|
|
16
|
+
exports.default = ClientDateVariable;
|
|
17
|
+
//# sourceMappingURL=ClientDateVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientDateVariable.js","sourceRoot":"","sources":["../../../../src/primitives/variable/date/ClientDateVariable.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ,iCAAkD;AAClD,4CAAqD;AAUrD,MAAM,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,EAAE,EAAiB,EAAa,EAAE;IAE7G,MAAM,eAAe,GAAG,IAAA,2BAAkB,GAAE,CAAC;IAE7C,MAAM,cAAc,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,SAAS,GAAG,CAAC,OAAO,YAAY,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,OAAO,IAAI,IAAI,EAAE,IAAI,OAAO,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;QACnN,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/E,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAEvD,OAAO,CACH,0DAA6B,IAAI,YAC5B,cAAc,GACZ,CACV,CAAC;AACN,CAAC,CAAC;AAEF,kBAAkB,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAEjD,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
options?: Record<string, any>;
|
|
7
|
+
"data-generaltranslation"?: Record<string, any> | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const DateVariable: {
|
|
10
|
+
({ children, name, defaultValue, options, ...props }: VariableProps): ReactNode;
|
|
11
|
+
gtTransformation: string;
|
|
12
|
+
};
|
|
13
|
+
export default DateVariable;
|
|
14
|
+
//# sourceMappingURL=Date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Date.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/date/Date.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAA;CAC9D,CAAA;AAED,QAAA,MAAM,YAAY;0DAAuE,aAAa,GAAG,SAAS;;CAqBjH,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
const I18NConfig_1 = __importDefault(require("../../../config/I18NConfig"));
|
|
19
|
+
const DateVariable = (_a) => {
|
|
20
|
+
var { children, name = "date", defaultValue, options = {} } = _a, props = __rest(_a, ["children", "name", "defaultValue", "options"]);
|
|
21
|
+
const { "data-generaltranslation": generaltranslation } = props;
|
|
22
|
+
if (typeof children !== 'undefined' && typeof defaultValue === 'undefined') {
|
|
23
|
+
defaultValue = children;
|
|
24
|
+
}
|
|
25
|
+
const locale = I18NConfig_1.default.getCurrentLanguage();
|
|
26
|
+
// Convert defaultValue to a Date object if it's a string
|
|
27
|
+
const dateValue = typeof defaultValue === 'string' ? new Date(defaultValue) : defaultValue;
|
|
28
|
+
// Format the date according to the locale and options
|
|
29
|
+
const formattedValue = new Intl.DateTimeFormat(locale, options).format(dateValue);
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-generaltranslation": generaltranslation, "data-gt-variable-name": name, children: formattedValue }));
|
|
31
|
+
};
|
|
32
|
+
DateVariable.gtTransformation = "variable";
|
|
33
|
+
exports.default = DateVariable;
|
|
34
|
+
//# sourceMappingURL=Date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Date.js","sourceRoot":"","sources":["../../../../src/primitives/variable/date/Date.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4EAAoD;AAWpD,MAAM,YAAY,GAAG,CAAC,EAAgF,EAAa,EAAE;QAA/F,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,EAAE,OAA2B,EAAtB,KAAK,cAA/D,+CAAiE,CAAF;IAEjF,MAAM,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEhE,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;QACzE,YAAY,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,MAAM,MAAM,GAAG,oBAAU,CAAC,kBAAkB,EAAE,CAAC;IAE/C,yDAAyD;IACzD,MAAM,SAAS,GAAG,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAE3F,sDAAsD;IACtD,MAAM,cAAc,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAElF,OAAO,CACH,4DAA+B,kBAAkB,2BAAyB,IAAI,YACzE,cAAc,GACZ,CACV,CAAC;AACN,CAAC,CAAC;AAEF,YAAY,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAE3C,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
options?: Record<string, any>;
|
|
7
|
+
"data-generaltranslation"?: Record<string, any> | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const DateVariable: {
|
|
10
|
+
({ children, name, defaultValue, options, ...props }: VariableProps): ReactNode;
|
|
11
|
+
gtTransformation: string;
|
|
12
|
+
};
|
|
13
|
+
export default DateVariable;
|
|
14
|
+
//# sourceMappingURL=DateVariable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateVariable.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/date/DateVariable.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAA;CAC9D,CAAA;AAED,QAAA,MAAM,YAAY;0DAAuE,aAAa,GAAG,SAAS;;CAqBjH,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
const I18NConfig_1 = __importDefault(require("../../../config/I18NConfig"));
|
|
19
|
+
const DateVariable = (_a) => {
|
|
20
|
+
var { children, name = "date", defaultValue, options = {} } = _a, props = __rest(_a, ["children", "name", "defaultValue", "options"]);
|
|
21
|
+
const { "data-generaltranslation": generaltranslation } = props;
|
|
22
|
+
if (typeof children !== 'undefined' && typeof defaultValue === 'undefined') {
|
|
23
|
+
defaultValue = children;
|
|
24
|
+
}
|
|
25
|
+
const locale = I18NConfig_1.default.getCurrentLanguage();
|
|
26
|
+
// Convert defaultValue to a Date object if it's a string
|
|
27
|
+
const dateValue = typeof defaultValue === 'string' ? new Date(defaultValue) : defaultValue;
|
|
28
|
+
// Format the date according to the locale and options
|
|
29
|
+
const formattedValue = new Intl.DateTimeFormat(locale, options).format(dateValue);
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-generaltranslation": generaltranslation, "data-gt-variable-name": name, children: formattedValue }));
|
|
31
|
+
};
|
|
32
|
+
DateVariable.gtTransformation = "variable";
|
|
33
|
+
exports.default = DateVariable;
|
|
34
|
+
//# sourceMappingURL=DateVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateVariable.js","sourceRoot":"","sources":["../../../../src/primitives/variable/date/DateVariable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4EAAoD;AAWpD,MAAM,YAAY,GAAG,CAAC,EAAgF,EAAa,EAAE;QAA/F,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,EAAE,OAA2B,EAAtB,KAAK,cAA/D,+CAAiE,CAAF;IAEjF,MAAM,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEhE,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;QACzE,YAAY,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,MAAM,MAAM,GAAG,oBAAU,CAAC,kBAAkB,EAAE,CAAC;IAE/C,yDAAyD;IACzD,MAAM,SAAS,GAAG,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAE3F,sDAAsD;IACtD,MAAM,cAAc,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAElF,OAAO,CACH,4DAA+B,kBAAkB,2BAAyB,IAAI,YACzE,cAAc,GACZ,CACV,CAAC;AACN,CAAC,CAAC;AAEF,YAAY,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAE3C,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type VariableProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
};
|
|
7
|
+
declare const ClientNumber: {
|
|
8
|
+
({ children, name, defaultValue }: VariableProps): ReactNode;
|
|
9
|
+
gtTransformation: string;
|
|
10
|
+
};
|
|
11
|
+
export default ClientNumber;
|
|
12
|
+
//# sourceMappingURL=ClientNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientNumber.d.ts","sourceRoot":"","sources":["../../../../src/primitives/variable/number/ClientNumber.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAIlD,KAAK,aAAa,GAAG;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAA;AAED,QAAA,MAAM,YAAY;uCAA4C,aAAa,GAAG,SAAS;;CAetF,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_1 = require("../../../client");
|
|
7
|
+
const ClientNumber = ({ children, name = "n", defaultValue }) => {
|
|
8
|
+
const currentLanguage = (0, client_1.useCurrentLanguage)();
|
|
9
|
+
const formattedValue = (0, react_1.useMemo)(() => {
|
|
10
|
+
let value = (typeof children !== 'undefined' && typeof defaultValue === 'undefined') ? children : defaultValue;
|
|
11
|
+
return typeof value !== 'undefined' ? new Intl.NumberFormat(currentLanguage).format(value) : value;
|
|
12
|
+
}, [children, defaultValue, currentLanguage]);
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, children: formattedValue }));
|
|
14
|
+
};
|
|
15
|
+
ClientNumber.gtTransformation = "variable";
|
|
16
|
+
exports.default = ClientNumber;
|
|
17
|
+
//# sourceMappingURL=ClientNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientNumber.js","sourceRoot":"","sources":["../../../../src/primitives/variable/number/ClientNumber.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ,iCAAkD;AAClD,4CAAqD;AASrD,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,GAAG,EAAE,YAAY,EAAiB,EAAa,EAAE;IAEtF,MAAM,eAAe,GAAG,IAAA,2BAAkB,GAAE,CAAC;IAE7C,MAAM,cAAc,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,KAAK,GAAG,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC;QAC/G,OAAO,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvG,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAA;IAE7C,OAAO,CACH,0DAA6B,IAAI,YAC5B,cAAc,GACZ,CACV,CAAC;AAEN,CAAC,CAAC;AAEF,YAAY,CAAC,gBAAgB,GAAG,UAAU,CAAC;AAE3C,kBAAe,YAAY,CAAC"}
|