gt-react 4.2.0 → 4.2.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/provider/rendering/renderTranslatedChildren.js +4 -4
- package/dist/provider/rendering/renderTranslatedChildren.js.map +1 -1
- package/dist/variables/Currency.d.ts +3 -3
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/Currency.js +6 -6
- package/dist/variables/Currency.js.map +1 -1
- package/dist/variables/DateTime.d.ts +3 -3
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/DateTime.js +3 -3
- package/dist/variables/DateTime.js.map +1 -1
- package/dist/variables/Num.d.ts +3 -3
- package/dist/variables/Num.d.ts.map +1 -1
- package/dist/variables/Num.js +6 -6
- package/dist/variables/Num.js.map +1 -1
- package/dist/variables/Var.d.ts +7 -7
- package/dist/variables/Var.d.ts.map +1 -1
- package/dist/variables/Var.js +7 -7
- package/dist/variables/Var.js.map +1 -1
- package/dist/variables/_getVariableProps.js +2 -2
- package/dist/variables/_getVariableProps.js.map +1 -1
- package/package.json +1 -1
|
@@ -30,15 +30,15 @@ var internal_1 = require("../../internal");
|
|
|
30
30
|
function renderVariable(_a) {
|
|
31
31
|
var variableType = _a.variableType, variableName = _a.variableName, variableValue = _a.variableValue, variableOptions = _a.variableOptions;
|
|
32
32
|
if (variableType === "number") {
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(Num_1.default, { name: variableName,
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(Num_1.default, { name: variableName, value: variableValue, options: variableOptions }));
|
|
34
34
|
}
|
|
35
35
|
else if (variableType === "datetime") {
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(DateTime_1.default, { name: variableName,
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(DateTime_1.default, { name: variableName, value: variableValue, options: variableOptions }));
|
|
37
37
|
}
|
|
38
38
|
else if (variableType === "currency") {
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(Currency_1.default, { name: variableName,
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(Currency_1.default, { name: variableName, value: variableValue, options: variableOptions }));
|
|
40
40
|
}
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(Var_1.default, { name: variableName,
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(Var_1.default, { name: variableName, value: variableValue }));
|
|
42
42
|
}
|
|
43
43
|
function renderTranslatedElement(_a) {
|
|
44
44
|
var sourceElement = _a.sourceElement, targetElement = _a.targetElement, _b = _a.variables, variables = _b === void 0 ? {} : _b, _c = _a.variablesOptions, variablesOptions = _c === void 0 ? {} : _c, _d = _a.locales, locales = _d === void 0 ? [primitives_1.libraryDefaultLocale] : _d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderTranslatedChildren.js","sourceRoot":"","sources":["../../../src/provider/rendering/renderTranslatedChildren.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,wCAoCC;AAmED,2CAsHC;;AA1OD,gDAAuE;AAEvE,4DAAsC;AACtC,4DAAsC;AACtC,sEAAgD;AAChD,sEAAgD;AAChD,iFAA2D;AAC3D,mEAA6C;AAC7C,wFAAiE;AAEjE,0DAAmE;AACnE,2CAAiD;AAEjD,SAAgB,cAAc,CAAC,EAO9B;QANG,YAAY,kBAAA,EAAE,YAAY,kBAAA,EAAE,aAAa,mBAAA,EAAE,eAAe,qBAAA;IAO1D,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,CACH,uBAAC,aAAG,IACA,IAAI,EAAE,YAAY,EAClB,
|
|
1
|
+
{"version":3,"file":"renderTranslatedChildren.js","sourceRoot":"","sources":["../../../src/provider/rendering/renderTranslatedChildren.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,wCAoCC;AAmED,2CAsHC;;AA1OD,gDAAuE;AAEvE,4DAAsC;AACtC,4DAAsC;AACtC,sEAAgD;AAChD,sEAAgD;AAChD,iFAA2D;AAC3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gBAChC,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC;gBAC5C,eAAe,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAAG,CAAC;aACxD,CAAC,CAAA;QACN,CAAC;IAEL,CAAC;IAED,2GAA2G;IAC3G,gFAAgF;AAEpF,CAAC"}
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @param {any} [children] - Optional content to render inside the currency component.
|
|
16
16
|
* @param {string} [name] - Optional name for the currency field.
|
|
17
|
-
* @param {any} [
|
|
17
|
+
* @param {any} [value] - The default value to be used.
|
|
18
18
|
* @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
|
|
19
19
|
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
|
20
20
|
* @returns {JSX.Element} The formatted currency component.
|
|
21
21
|
*/
|
|
22
|
-
declare function Currency({ children, name,
|
|
22
|
+
declare function Currency({ children, name, value, currency, options }?: {
|
|
23
23
|
children?: any;
|
|
24
24
|
name?: string;
|
|
25
|
-
|
|
25
|
+
value?: any;
|
|
26
26
|
currency?: string;
|
|
27
27
|
options?: Intl.NumberFormatOptions;
|
|
28
28
|
}): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAa,EAAE,KAAK,EAAE,QAAgB,EAAE,OAAY,EAAE,GAAE;IAClF,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;CACnB,GAAG,GAAG,CAAC,OAAO,CAiBjC;kBAvBQ,QAAQ;;;AA4BjB,eAAe,QAAQ,CAAC"}
|
|
@@ -35,21 +35,21 @@ var useDefaultLocale_1 = __importDefault(require("../hooks/useDefaultLocale"));
|
|
|
35
35
|
*
|
|
36
36
|
* @param {any} [children] - Optional content to render inside the currency component.
|
|
37
37
|
* @param {string} [name] - Optional name for the currency field.
|
|
38
|
-
* @param {any} [
|
|
38
|
+
* @param {any} [value] - The default value to be used.
|
|
39
39
|
* @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
|
|
40
40
|
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
|
41
41
|
* @returns {JSX.Element} The formatted currency component.
|
|
42
42
|
*/
|
|
43
43
|
function Currency(_a) {
|
|
44
|
-
var _b = _a === void 0 ? { name: "cost" } : _a, children = _b.children, _c = _b.name, name = _c === void 0 ? "cost" : _c,
|
|
44
|
+
var _b = _a === void 0 ? { name: "cost" } : _a, children = _b.children, _c = _b.name, name = _c === void 0 ? "cost" : _c, value = _b.value, _d = _b.currency, currency = _d === void 0 ? "USD" : _d, _e = _b.options, options = _e === void 0 ? {} : _e;
|
|
45
45
|
var locales = [(0, useLocale_1.default)(), (0, useDefaultLocale_1.default)()];
|
|
46
|
-
var
|
|
47
|
-
|
|
46
|
+
var renderedValue = (typeof children !== 'undefined' && typeof value === 'undefined') ? children : value;
|
|
47
|
+
renderedValue = (typeof renderedValue === 'string') ? parseFloat(renderedValue) : renderedValue;
|
|
48
48
|
// Format the value using Intl.NumberFormat
|
|
49
49
|
if (typeof value === 'number') {
|
|
50
|
-
|
|
50
|
+
renderedValue = (0, generaltranslation_1.formatCurrency)({ value: value, languages: locales, currency: currency, options: options });
|
|
51
51
|
}
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, "data-gt-variable-type": "currency", "data-gt-variable-options": __assign({ style: 'currency', currency: currency }, options), children:
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, "data-gt-variable-type": "currency", "data-gt-variable-options": __assign({ style: 'currency', currency: currency }, options), children: renderedValue }));
|
|
53
53
|
}
|
|
54
54
|
;
|
|
55
55
|
// Static property to indicate the transformation type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;AAEZ,yDAAoD;AACpD,iEAA2C;AAC3C,+EAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,QAAQ,CAAC,EAME;QANF,qBAMd,EAAE,IAAI,EAAE,MAAM,EAAE,KAAA,EANA,QAAQ,cAAA,EAAE,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;AAEZ,yDAAoD;AACpD,iEAA2C;AAC3C,+EAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,QAAQ,CAAC,EAME;QANF,qBAMd,EAAE,IAAI,EAAE,MAAM,EAAE,KAAA,EANA,QAAQ,cAAA,EAAE,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EAAE,KAAK,WAAA,EAAE,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA;IAQ9E,IAAM,OAAO,GAAG,CAAC,IAAA,mBAAS,GAAE,EAAE,IAAA,0BAAgB,GAAE,CAAC,CAAA;IAEjD,IAAI,aAAa,GAAG,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IACzG,aAAa,GAAG,CAAC,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IAChG,2CAA2C;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,aAAa,GAAG,IAAA,mCAAc,EAAC,EAAE,KAAK,OAAA,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,UAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,CACH,0DAA6B,IAAI,2BAAyB,UAAU,yCAA8B,KAAK,EAAE,UAAU,EAAE,QAAQ,UAAA,IAAK,OAAO,aACpI,aAAa,GACX,CACV,CAAC;AAEN,CAAC;AAAA,CAAC;AAEF,sDAAsD;AACtD,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;AAEhD,kBAAe,QAAQ,CAAC"}
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @param {any} [children] - Optional content (typically a date) to render inside the component.
|
|
16
16
|
* @param {string} [name="date"] - Optional name for the date field, used for metadata purposes.
|
|
17
|
-
* @param {string|number|Date} [
|
|
17
|
+
* @param {string|number|Date} [value] - The default value for the date. Can be a string, number (timestamp), or `Date` object.
|
|
18
18
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
|
19
19
|
* @returns {JSX.Element} The formatted date or time component.
|
|
20
20
|
*/
|
|
21
|
-
declare function DateTime({ children, name,
|
|
21
|
+
declare function DateTime({ children, name, value, options }?: {
|
|
22
22
|
children?: any;
|
|
23
23
|
name?: string;
|
|
24
|
-
|
|
24
|
+
value?: any;
|
|
25
25
|
options?: Intl.DateTimeFormatOptions;
|
|
26
26
|
}): JSX.Element;
|
|
27
27
|
declare namespace DateTime {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAa,EAAE,KAAK,EAAE,OAAY,EAAE,GAAE;IAChE,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAyBjC;kBA9BQ,QAAQ;;;AAmCjB,eAAe,QAAQ,CAAC"}
|
|
@@ -24,16 +24,16 @@ var useDefaultLocale_1 = __importDefault(require("../hooks/useDefaultLocale"));
|
|
|
24
24
|
*
|
|
25
25
|
* @param {any} [children] - Optional content (typically a date) to render inside the component.
|
|
26
26
|
* @param {string} [name="date"] - Optional name for the date field, used for metadata purposes.
|
|
27
|
-
* @param {string|number|Date} [
|
|
27
|
+
* @param {string|number|Date} [value] - The default value for the date. Can be a string, number (timestamp), or `Date` object.
|
|
28
28
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
|
29
29
|
* @returns {JSX.Element} The formatted date or time component.
|
|
30
30
|
*/
|
|
31
31
|
function DateTime(_a) {
|
|
32
|
-
var _b = _a === void 0 ? { name: "date" } : _a, children = _b.children, _c = _b.name, name = _c === void 0 ? "date" : _c,
|
|
32
|
+
var _b = _a === void 0 ? { name: "date" } : _a, children = _b.children, _c = _b.name, name = _c === void 0 ? "date" : _c, value = _b.value, _d = _b.options, options = _d === void 0 ? {} : _d;
|
|
33
33
|
var locales = [(0, useLocale_1.default)(), (0, useDefaultLocale_1.default)()];
|
|
34
34
|
var final;
|
|
35
35
|
var dateValue;
|
|
36
|
-
defaultValue = (typeof children !== 'undefined' && typeof
|
|
36
|
+
var defaultValue = (typeof children !== 'undefined' && typeof value === 'undefined') ? children : value;
|
|
37
37
|
if (typeof defaultValue === 'number') {
|
|
38
38
|
dateValue = new Date(defaultValue);
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;AAEZ,yDAAoD;AACpD,iEAA2C;AAC3C,+EAAyD;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,QAAQ,CAAC,EAKE;QALF,qBAKd,EAAE,IAAI,EAAE,MAAM,EAAE,KAAA,EALA,QAAQ,cAAA,EAAE,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;AAEZ,yDAAoD;AACpD,iEAA2C;AAC3C,+EAAyD;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,QAAQ,CAAC,EAKE;QALF,qBAKd,EAAE,IAAI,EAAE,MAAM,EAAE,KAAA,EALA,QAAQ,cAAA,EAAE,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EAAE,KAAK,WAAA,EAAE,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA;IAO5D,IAAM,OAAO,GAAG,CAAC,IAAA,mBAAS,GAAE,EAAE,IAAA,0BAAgB,GAAE,CAAC,CAAA;IAEjD,IAAI,KAAK,CAAC;IAEV,IAAI,SAA2B,CAAC;IAChC,IAAI,YAAY,GAAG,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IACxG,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACnC,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC1C,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,YAAY,YAAY,IAAI,EAAE,CAAC;QACtC,SAAS,GAAG,YAAY,CAAC;IAC7B,CAAC;IACD,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;QACnC,KAAK,GAAG,CAAC,IAAA,mCAAc,EAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACrH,CAAC;IAED,kDAAkD;IAClD,OAAO,CACH,0DAA6B,IAAI,2BAAyB,MAAM,8BAA4B,OAAO,YAC9F,KAAK,GACH,CACV,CAAC;AACN,CAAC;AAAA,CAAC;AAEF,0CAA0C;AAC1C,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;AAEhD,kBAAe,QAAQ,CAAC"}
|
package/dist/variables/Num.d.ts
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @param {any} [children] - Optional content (typically a number) to render inside the component.
|
|
17
17
|
* @param {string} [name="n"] - Optional name for the number field, used for metadata purposes.
|
|
18
|
-
* @param {string|number} [
|
|
18
|
+
* @param {string|number} [value] - The default value for the number. Can be a string or number. Strings will be parsed to numbers.
|
|
19
19
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
|
20
20
|
* @returns {JSX.Element} The formatted number component.
|
|
21
21
|
*/
|
|
22
|
-
declare function Num({ children, name,
|
|
22
|
+
declare function Num({ children, name, value, options }?: {
|
|
23
23
|
children?: any;
|
|
24
24
|
name?: string;
|
|
25
|
-
|
|
25
|
+
value?: any;
|
|
26
26
|
options?: Intl.NumberFormatOptions;
|
|
27
27
|
}): JSX.Element;
|
|
28
28
|
declare namespace Num {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAU,EAAE,KAAK,EAAE,OAAY,EAAE,GAAE;IACxD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAA;CACrB,GAAG,GAAG,CAAC,OAAO,CAgB9B;kBArBQ,GAAG;;;AAyBZ,eAAe,GAAG,CAAC"}
|
package/dist/variables/Num.js
CHANGED
|
@@ -25,18 +25,18 @@ var useDefaultLocale_1 = __importDefault(require("../hooks/useDefaultLocale"));
|
|
|
25
25
|
*
|
|
26
26
|
* @param {any} [children] - Optional content (typically a number) to render inside the component.
|
|
27
27
|
* @param {string} [name="n"] - Optional name for the number field, used for metadata purposes.
|
|
28
|
-
* @param {string|number} [
|
|
28
|
+
* @param {string|number} [value] - The default value for the number. Can be a string or number. Strings will be parsed to numbers.
|
|
29
29
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
|
30
30
|
* @returns {JSX.Element} The formatted number component.
|
|
31
31
|
*/
|
|
32
32
|
function Num(_a) {
|
|
33
|
-
var _b = _a === void 0 ? { name: "n" } : _a, children = _b.children, _c = _b.name, name = _c === void 0 ? "n" : _c,
|
|
33
|
+
var _b = _a === void 0 ? { name: "n" } : _a, children = _b.children, _c = _b.name, name = _c === void 0 ? "n" : _c, value = _b.value, _d = _b.options, options = _d === void 0 ? {} : _d;
|
|
34
34
|
var locales = [(0, useLocale_1.default)(), (0, useDefaultLocale_1.default)()];
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
if (typeof
|
|
35
|
+
var renderedValue = (typeof children !== 'undefined' && typeof value === 'undefined') ? children : value;
|
|
36
|
+
renderedValue = (typeof renderedValue === 'string') ? parseFloat(renderedValue) : renderedValue;
|
|
37
|
+
if (typeof renderedValue === 'number') {
|
|
38
38
|
// Using Intl.NumberFormat for consistent number formatting
|
|
39
|
-
|
|
39
|
+
renderedValue = (0, generaltranslation_1.formatNum)({ value: renderedValue, languages: locales, options: options });
|
|
40
40
|
}
|
|
41
41
|
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, "data-gt-variable-type": "number", "data-gt-variable-options": JSON.stringify(options), children: value }));
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Num.js","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;AAEZ,yDAA+C;AAC/C,iEAA2C;AAC3C,+EAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,GAAG,CAAC,EAKI;QALJ,qBAKT,EAAE,IAAI,EAAE,GAAG,EAAE,KAAA,EALF,QAAQ,cAAA,EAAE,YAAU,EAAV,IAAI,mBAAG,GAAG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|
|
|
1
1
|
/**
|
|
2
|
-
* The `<Var>` component renders a variable value, which can either be passed as `children` or a `
|
|
3
|
-
* If `children` is provided, it will be used; otherwise, the `
|
|
2
|
+
* The `<Var>` component renders a variable value, which can either be passed as `children` or a `value`.
|
|
3
|
+
* If `children` is provided, it will be used; otherwise, the `value` is rendered.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```jsx
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
* </Var>
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `
|
|
14
|
+
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
|
15
15
|
* @param {string} [name] - Optional name for the variable, used for metadata purposes.
|
|
16
|
-
* @param {any} [
|
|
17
|
-
* @returns {JSX.Element} The rendered variable component with either `children` or `
|
|
16
|
+
* @param {any} [value] - The default value to be displayed if `children` is not provided.
|
|
17
|
+
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
|
18
18
|
*/
|
|
19
|
-
declare function Var({ children, name,
|
|
19
|
+
declare function Var({ children, name, value }: {
|
|
20
20
|
children?: any;
|
|
21
21
|
name?: string;
|
|
22
|
-
|
|
22
|
+
value?: any;
|
|
23
23
|
}): JSX.Element;
|
|
24
24
|
declare namespace Var {
|
|
25
25
|
var gtTransformation: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IACpC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;CACf,GAAG,GAAG,CAAC,OAAO,CAUd;kBAdQ,GAAG;;;AAkBZ,eAAe,GAAG,CAAC"}
|
package/dist/variables/Var.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
/**
|
|
6
|
-
* The `<Var>` component renders a variable value, which can either be passed as `children` or a `
|
|
7
|
-
* If `children` is provided, it will be used; otherwise, the `
|
|
6
|
+
* The `<Var>` component renders a variable value, which can either be passed as `children` or a `value`.
|
|
7
|
+
* If `children` is provided, it will be used; otherwise, the `value` is rendered.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```jsx
|
|
@@ -15,14 +15,14 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
* </Var>
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `
|
|
18
|
+
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
|
19
19
|
* @param {string} [name] - Optional name for the variable, used for metadata purposes.
|
|
20
|
-
* @param {any} [
|
|
21
|
-
* @returns {JSX.Element} The rendered variable component with either `children` or `
|
|
20
|
+
* @param {any} [value] - The default value to be displayed if `children` is not provided.
|
|
21
|
+
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
|
22
22
|
*/
|
|
23
23
|
function Var(_a) {
|
|
24
|
-
var children = _a.children, name = _a.name,
|
|
25
|
-
var final = typeof children !== 'undefined' ? children :
|
|
24
|
+
var children = _a.children, name = _a.name, value = _a.value;
|
|
25
|
+
var final = typeof children !== 'undefined' ? children : value;
|
|
26
26
|
return ((0, jsx_runtime_1.jsx)("span", { "data-gt-variable-name": name, "data-gt-variable-type": "variable", children: final }));
|
|
27
27
|
}
|
|
28
28
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Var.js","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,GAAG,CAAC,EAIZ;QAJc,QAAQ,cAAA,EAAE,IAAI,UAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"Var.js","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,GAAG,CAAC,EAIZ;QAJc,QAAQ,cAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA;IAMhC,IAAI,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IAE/D,OAAO,CACH,0DAA6B,IAAI,2BAAyB,UAAU,YAC/D,KAAK,GACH,CACV,CAAC;AAEN,CAAC;AAAA,CAAC;AAEF,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;AAE3C,kBAAe,GAAG,CAAC"}
|
|
@@ -12,8 +12,8 @@ function getVariableProps(props) {
|
|
|
12
12
|
variableType: variableType,
|
|
13
13
|
variableName: props.name || props['data-gt-variable-name'] || _defaultVariableNames_1.default[variableType],
|
|
14
14
|
variableValue: (function () {
|
|
15
|
-
if (typeof props.
|
|
16
|
-
return props.
|
|
15
|
+
if (typeof props.value !== 'undefined')
|
|
16
|
+
return props.value;
|
|
17
17
|
if (typeof props['data-gt-unformatted-value'] !== 'undefined')
|
|
18
18
|
return props['data-gt-unformatted-value'];
|
|
19
19
|
if (typeof props.children !== 'undefined')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_getVariableProps.js","sourceRoot":"","sources":["../../src/variables/_getVariableProps.ts"],"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