@activecollab/components 2.0.206 → 2.0.207
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/components/Display/DisplayCurrency.js.map +1 -1
- package/dist/cjs/components/Display/DisplayNumber.js +4 -2
- package/dist/cjs/components/Display/DisplayNumber.js.map +1 -1
- package/dist/cjs/components/Display/types.js.map +1 -1
- package/dist/esm/components/Display/DisplayCurrency.d.ts +1 -1
- package/dist/esm/components/Display/DisplayCurrency.d.ts.map +1 -1
- package/dist/esm/components/Display/DisplayCurrency.js.map +1 -1
- package/dist/esm/components/Display/DisplayNumber.d.ts.map +1 -1
- package/dist/esm/components/Display/DisplayNumber.js +2 -1
- package/dist/esm/components/Display/DisplayNumber.js.map +1 -1
- package/dist/esm/components/Display/types.d.ts +1 -0
- package/dist/esm/components/Display/types.d.ts.map +1 -1
- package/dist/esm/components/Display/types.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayCurrency.js","names":["_react","_interopRequireWildcard","require","_utils","_Tooltip","_Typography","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","DisplayCurrency","exports","forwardRef","_ref","ref","value","_ref$variant","variant","_ref$currencyCode","currencyCode","_ref$currencyPosition","currencyPosition","_ref$thousandSeparato","thousandSeparator","_ref$decimalSeparator","decimalSeparator","_ref$trimDecimals","trimDecimals","_ref$decimalSpaces","decimalSpaces","_ref$format","format","_ref$disableTooltip","disableTooltip","className","_ref$as","as","rest","formattedValue","formatCurrency","formattedLongValue","createElement","Tooltip","title","disable","includes","Typography","displayName"],"sources":["../../../../src/components/Display/DisplayCurrency.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatCurrency } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayCurrency = forwardRef<\n HTMLSpanElement,\n DisplayNumberProps & {
|
|
1
|
+
{"version":3,"file":"DisplayCurrency.js","names":["_react","_interopRequireWildcard","require","_utils","_Tooltip","_Typography","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","DisplayCurrency","exports","forwardRef","_ref","ref","value","_ref$variant","variant","_ref$currencyCode","currencyCode","_ref$currencyPosition","currencyPosition","_ref$thousandSeparato","thousandSeparator","_ref$decimalSeparator","decimalSeparator","_ref$trimDecimals","trimDecimals","_ref$decimalSpaces","decimalSpaces","_ref$format","format","_ref$disableTooltip","disableTooltip","className","_ref$as","as","rest","formattedValue","formatCurrency","formattedLongValue","createElement","Tooltip","title","disable","includes","Typography","displayName"],"sources":["../../../../src/components/Display/DisplayCurrency.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatCurrency } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayCurrency = forwardRef<\n HTMLSpanElement,\n Omit<DisplayNumberProps, \"shortenThreshold\"> & {\n currencyCode?: string;\n currencyPosition?: string;\n }\n>(\n (\n {\n value,\n variant = \"Body 2\",\n currencyCode = \"USD\",\n currencyPosition = \"right\",\n thousandSeparator = \",\",\n decimalSeparator = \".\",\n trimDecimals = true,\n decimalSpaces = 2,\n format = \"long\",\n disableTooltip = false,\n className,\n as = \"span\",\n ...rest\n },\n ref\n ) => {\n const formattedValue = formatCurrency(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"short\",\n currencyCode,\n currencyPosition\n );\n\n const formattedLongValue = formatCurrency(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"long\",\n currencyCode,\n currencyPosition\n );\n\n if (format === \"short\") {\n return (\n <Tooltip\n title={formatCurrency(\n value,\n thousandSeparator,\n decimalSeparator,\n false,\n decimalSpaces,\n \"long\",\n currencyCode,\n currencyPosition\n )}\n disable={\n disableTooltip ||\n (!formattedLongValue.includes(thousandSeparator) &&\n !formattedLongValue.includes(decimalSeparator))\n }\n >\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedValue}\n </Typography>\n </Tooltip>\n );\n }\n\n return (\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedLongValue}\n </Typography>\n );\n }\n);\n\nDisplayCurrency.displayName = \"DisplayCurrency\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAsD,IAAAI,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA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KAAK,OAAO,EAAE;IACtB,oBACEnE,MAAA,CAAAa,OAAA,CAAAgE,aAAA,CAACzE,QAAA,CAAA0E,OAAO;MACNC,KAAK,EAAE,IAAAJ,qBAAc,EACnBxB,KAAK,EACLQ,iBAAiB,EACjBE,gBAAgB,EAChB,KAAK,EACLI,aAAa,EACb,MAAM,EACNV,YAAY,EACZE,gBACF,CAAE;MACFuB,OAAO,EACLX,cAAc,IACb,CAACO,kBAAkB,CAACK,QAAQ,CAACtB,iBAAiB,CAAC,IAC9C,CAACiB,kBAAkB,CAACK,QAAQ,CAACpB,gBAAgB;IAChD,gBAED7D,MAAA,CAAAa,OAAA,CAAAgE,aAAA,CAACxE,WAAA,CAAA6E,UAAU,EAAAtD,QAAA;MACT4C,EAAE,EAAEA,EAAG;MACPnB,OAAO,EAAEA,OAAQ;MACjBiB,SAAS,EAAEA,SAAU;MACrBpB,GAAG,EAAEA;IAAI,GACLuB,IAAI,GAEPC,cACS,CACL,CAAC;EAEd;EAEA,oBACE1E,MAAA,CAAAa,OAAA,CAAAgE,aAAA,CAACxE,WAAA,CAAA6E,UAAU,EAAAtD,QAAA;IACT4C,EAAE,EAAEA,EAAG;IACPnB,OAAO,EAAEA,OAAQ;IACjBiB,SAAS,EAAEA,SAAU;IACrBpB,GAAG,EAAEA;EAAI,GACLuB,IAAI,GAEPG,kBACS,CAAC;AAEjB,CACF,CAAC;AAED9B,eAAe,CAACqC,WAAW,GAAG,iBAAiB"}
|
|
@@ -8,7 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _utils = require("../../utils");
|
|
9
9
|
var _Tooltip = require("../Tooltip");
|
|
10
10
|
var _Typography = require("../Typography/Typography");
|
|
11
|
-
var _excluded = ["value", "variant", "thousandSeparator", "decimalSeparator", "trimDecimals", "decimalSpaces", "format", "disableTooltip", "className", "as"];
|
|
11
|
+
var _excluded = ["value", "variant", "thousandSeparator", "decimalSeparator", "trimDecimals", "decimalSpaces", "format", "disableTooltip", "className", "as", "shortenThreshold"];
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -33,8 +33,10 @@ var DisplayNumber = exports.DisplayNumber = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
33
33
|
className = _ref.className,
|
|
34
34
|
_ref$as = _ref.as,
|
|
35
35
|
as = _ref$as === void 0 ? "span" : _ref$as,
|
|
36
|
+
_ref$shortenThreshold = _ref.shortenThreshold,
|
|
37
|
+
shortenThreshold = _ref$shortenThreshold === void 0 ? 1000 : _ref$shortenThreshold,
|
|
36
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
-
var formattedValue = (0, _utils.formatNumber)(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, format);
|
|
39
|
+
var formattedValue = (0, _utils.formatNumber)(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, format, shortenThreshold);
|
|
38
40
|
var formattedLongValue = (0, _utils.formatNumber)(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long");
|
|
39
41
|
if (format === "short") {
|
|
40
42
|
return /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayNumber.js","names":["_react","_interopRequireWildcard","require","_utils","_Tooltip","_Typography","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","DisplayNumber","exports","forwardRef","_ref","ref","value","_ref$variant","variant","_ref$thousandSeparato","thousandSeparator","_ref$decimalSeparator","decimalSeparator","_ref$trimDecimals","trimDecimals","_ref$decimalSpaces","decimalSpaces","_ref$format","format","_ref$disableTooltip","disableTooltip","className","_ref$as","as","rest","formattedValue","formatNumber","formattedLongValue","createElement","Tooltip","title","disable","includes","Typography","displayName"],"sources":["../../../../src/components/Display/DisplayNumber.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatNumber } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayNumber = forwardRef<HTMLSpanElement, DisplayNumberProps>(\n (\n {\n value,\n variant = \"Body 2\",\n thousandSeparator = \",\",\n decimalSeparator = \".\",\n trimDecimals = true,\n decimalSpaces = 2,\n format = \"long\",\n disableTooltip = false,\n className,\n as = \"span\",\n ...rest\n },\n ref\n ) => {\n const formattedValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n format\n );\n\n const formattedLongValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"long\"\n );\n\n if (format === \"short\") {\n return (\n <Tooltip\n title={formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n false,\n decimalSpaces,\n \"long\"\n )}\n disable={\n disableTooltip ||\n (!formattedLongValue.includes(thousandSeparator) &&\n !formattedLongValue.includes(decimalSeparator))\n }\n >\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedValue}\n </Typography>\n </Tooltip>\n );\n }\n\n return (\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedLongValue}\n </Typography>\n );\n }\n);\n\nDisplayNumber.displayName = \"DisplayNumber\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAsD,IAAAI,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAj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AAA,CAAAI,SAAA,CAAAoB,oBAAA,CAAAlB,IAAA,CAAAS,MAAA,EAAAC,GAAA,aAAAJ,MAAA,CAAAI,GAAA,IAAAD,MAAA,CAAAC,GAAA,cAAAJ,MAAA;AAAA,SAAAQ,8BAAAL,MAAA,EAAAI,QAAA,QAAAJ,MAAA,yBAAAH,MAAA,WAAAa,UAAA,GAAAzB,MAAA,CAAA0B,IAAA,CAAAX,MAAA,OAAAC,GAAA,EAAAT,CAAA,OAAAA,CAAA,MAAAA,CAAA,GAAAkB,UAAA,CAAAX,MAAA,EAAAP,CAAA,MAAAS,GAAA,GAAAS,UAAA,CAAAlB,CAAA,OAAAY,QAAA,CAAAI,OAAA,CAAAP,GAAA,kBAAAJ,MAAA,CAAAI,GAAA,IAAAD,MAAA,CAAAC,GAAA,YAAAJ,MAAA;AAE/C,IAAMe,aAAa,GAAAC,OAAA,CAAAD,aAAA,gBAAG,IAAAE,iBAAU,EACrC,UAAAC,IAAA,
|
|
1
|
+
{"version":3,"file":"DisplayNumber.js","names":["_react","_interopRequireWildcard","require","_utils","_Tooltip","_Typography","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","DisplayNumber","exports","forwardRef","_ref","ref","value","_ref$variant","variant","_ref$thousandSeparato","thousandSeparator","_ref$decimalSeparator","decimalSeparator","_ref$trimDecimals","trimDecimals","_ref$decimalSpaces","decimalSpaces","_ref$format","format","_ref$disableTooltip","disableTooltip","className","_ref$as","as","_ref$shortenThreshold","shortenThreshold","rest","formattedValue","formatNumber","formattedLongValue","createElement","Tooltip","title","disable","includes","Typography","displayName"],"sources":["../../../../src/components/Display/DisplayNumber.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatNumber } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayNumber = forwardRef<HTMLSpanElement, DisplayNumberProps>(\n (\n {\n value,\n variant = \"Body 2\",\n thousandSeparator = \",\",\n decimalSeparator = \".\",\n trimDecimals = true,\n decimalSpaces = 2,\n format = \"long\",\n disableTooltip = false,\n className,\n as = \"span\",\n shortenThreshold = 1000,\n ...rest\n },\n ref\n ) => {\n const formattedValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n format,\n shortenThreshold\n );\n\n const formattedLongValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"long\"\n );\n\n if (format === \"short\") {\n return (\n <Tooltip\n title={formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n false,\n decimalSpaces,\n \"long\"\n )}\n disable={\n disableTooltip ||\n (!formattedLongValue.includes(thousandSeparator) &&\n !formattedLongValue.includes(decimalSeparator))\n }\n >\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedValue}\n </Typography>\n </Tooltip>\n );\n }\n\n return (\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedLongValue}\n </Typography>\n );\n }\n);\n\nDisplayNumber.displayName = \"DisplayNumber\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAsD,IAAAI,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,W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AAM,KAAK,OAAO,EAAE;IACtB,oBACE/D,MAAA,CAAAa,OAAA,CAAA8D,aAAA,CAACvE,QAAA,CAAAwE,OAAO;MACNC,KAAK,EAAE,IAAAJ,mBAAY,EACjBtB,KAAK,EACLI,iBAAiB,EACjBE,gBAAgB,EAChB,KAAK,EACLI,aAAa,EACb,MACF,CAAE;MACFiB,OAAO,EACLb,cAAc,IACb,CAACS,kBAAkB,CAACK,QAAQ,CAACxB,iBAAiB,CAAC,IAC9C,CAACmB,kBAAkB,CAACK,QAAQ,CAACtB,gBAAgB;IAChD,gBAEDzD,MAAA,CAAAa,OAAA,CAAA8D,aAAA,CAACtE,WAAA,CAAA2E,UAAU,EAAApD,QAAA;MACTwC,EAAE,EAAEA,EAAG;MACPf,OAAO,EAAEA,OAAQ;MACjBa,SAAS,EAAEA,SAAU;MACrBhB,GAAG,EAAEA;IAAI,GACLqB,IAAI,GAEPC,cACS,CACL,CAAC;EAEd;EAEA,oBACExE,MAAA,CAAAa,OAAA,CAAA8D,aAAA,CAACtE,WAAA,CAAA2E,UAAU,EAAApD,QAAA;IACTwC,EAAE,EAAEA,EAAG;IACPf,OAAO,EAAEA,OAAQ;IACjBa,SAAS,EAAEA,SAAU;IACrBhB,GAAG,EAAEA;EAAI,GACLqB,IAAI,GAEPG,kBACS,CAAC;AAEjB,CACF,CAAC;AAED5B,aAAa,CAACmC,WAAW,GAAG,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/Display/types.ts"],"sourcesContent":["import { FormatType } from \"../../utils/types\";\nimport { TypographyProps } from \"../Typography/Typography\";\n\nexport interface DisplayNumberProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n}\n\nexport interface DisplayHoursProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimZeroMinutes?: boolean;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n withLeadingZero?: boolean;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/Display/types.ts"],"sourcesContent":["import { FormatType } from \"../../utils/types\";\nimport { TypographyProps } from \"../Typography/Typography\";\n\nexport interface DisplayNumberProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n shortenThreshold?: number;\n}\n\nexport interface DisplayHoursProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimZeroMinutes?: boolean;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n withLeadingZero?: boolean;\n}\n"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DisplayNumberProps } from "./types";
|
|
3
|
-
export declare const DisplayCurrency: React.ForwardRefExoticComponent<Omit<DisplayNumberProps & {
|
|
3
|
+
export declare const DisplayCurrency: React.ForwardRefExoticComponent<Omit<Omit<DisplayNumberProps, "shortenThreshold"> & {
|
|
4
4
|
currencyCode?: string | undefined;
|
|
5
5
|
currencyPosition?: string | undefined;
|
|
6
6
|
}, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayCurrency.d.ts","sourceRoot":"","sources":["../../../../src/components/Display/DisplayCurrency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,eAAe;;;
|
|
1
|
+
{"version":3,"file":"DisplayCurrency.d.ts","sourceRoot":"","sources":["../../../../src/components/Display/DisplayCurrency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,eAAe;;;iDA2F3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayCurrency.js","names":["React","forwardRef","formatCurrency","Tooltip","Typography","DisplayCurrency","_ref","ref","value","variant","currencyCode","currencyPosition","thousandSeparator","decimalSeparator","trimDecimals","decimalSpaces","format","disableTooltip","className","as","rest","formattedValue","formattedLongValue","createElement","title","disable","includes","_extends","displayName"],"sources":["../../../../src/components/Display/DisplayCurrency.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatCurrency } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayCurrency = forwardRef<\n HTMLSpanElement,\n DisplayNumberProps & {
|
|
1
|
+
{"version":3,"file":"DisplayCurrency.js","names":["React","forwardRef","formatCurrency","Tooltip","Typography","DisplayCurrency","_ref","ref","value","variant","currencyCode","currencyPosition","thousandSeparator","decimalSeparator","trimDecimals","decimalSpaces","format","disableTooltip","className","as","rest","formattedValue","formattedLongValue","createElement","title","disable","includes","_extends","displayName"],"sources":["../../../../src/components/Display/DisplayCurrency.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatCurrency } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayCurrency = forwardRef<\n HTMLSpanElement,\n Omit<DisplayNumberProps, \"shortenThreshold\"> & {\n currencyCode?: string;\n currencyPosition?: string;\n }\n>(\n (\n {\n value,\n variant = \"Body 2\",\n currencyCode = \"USD\",\n currencyPosition = \"right\",\n thousandSeparator = \",\",\n decimalSeparator = \".\",\n trimDecimals = true,\n decimalSpaces = 2,\n format = \"long\",\n disableTooltip = false,\n className,\n as = \"span\",\n ...rest\n },\n ref\n ) => {\n const formattedValue = formatCurrency(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"short\",\n currencyCode,\n currencyPosition\n );\n\n const formattedLongValue = formatCurrency(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"long\",\n currencyCode,\n currencyPosition\n );\n\n if (format === \"short\") {\n return (\n <Tooltip\n title={formatCurrency(\n value,\n thousandSeparator,\n decimalSeparator,\n false,\n decimalSpaces,\n \"long\",\n currencyCode,\n currencyPosition\n )}\n disable={\n disableTooltip ||\n (!formattedLongValue.includes(thousandSeparator) &&\n !formattedLongValue.includes(decimalSeparator))\n }\n >\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedValue}\n </Typography>\n </Tooltip>\n );\n }\n\n return (\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedLongValue}\n </Typography>\n );\n }\n);\n\nDisplayCurrency.displayName = \"DisplayCurrency\";\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAGzC,SAASC,cAAc,QAAQ,aAAa;AAC5C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,UAAU,QAAQ,0BAA0B;AAErD,OAAO,MAAMC,eAAe,gBAAGJ,UAAU,CAOvC,CAAAK,IAAA,EAgBEC,GAAG,KACA;EAAA,IAhBH;IACEC,KAAK;IACLC,OAAO,GAAG,QAAQ;IAClBC,YAAY,GAAG,KAAK;IACpBC,gBAAgB,GAAG,OAAO;IAC1BC,iBAAiB,GAAG,GAAG;IACvBC,gBAAgB,GAAG,GAAG;IACtBC,YAAY,GAAG,IAAI;IACnBC,aAAa,GA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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/Display/DisplayNumber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"DisplayNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/Display/DisplayNumber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,aAAa,yGA+EzB,CAAC"}
|
|
@@ -15,9 +15,10 @@ export const DisplayNumber = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
15
15
|
disableTooltip = false,
|
|
16
16
|
className,
|
|
17
17
|
as = "span",
|
|
18
|
+
shortenThreshold = 1000,
|
|
18
19
|
...rest
|
|
19
20
|
} = _ref;
|
|
20
|
-
const formattedValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, format);
|
|
21
|
+
const formattedValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, format, shortenThreshold);
|
|
21
22
|
const formattedLongValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long");
|
|
22
23
|
if (format === "short") {
|
|
23
24
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayNumber.js","names":["React","forwardRef","formatNumber","Tooltip","Typography","DisplayNumber","_ref","ref","value","variant","thousandSeparator","decimalSeparator","trimDecimals","decimalSpaces","format","disableTooltip","className","as","rest","formattedValue","formattedLongValue","createElement","title","disable","includes","_extends","displayName"],"sources":["../../../../src/components/Display/DisplayNumber.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatNumber } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayNumber = forwardRef<HTMLSpanElement, DisplayNumberProps>(\n (\n {\n value,\n variant = \"Body 2\",\n thousandSeparator = \",\",\n decimalSeparator = \".\",\n trimDecimals = true,\n decimalSpaces = 2,\n format = \"long\",\n disableTooltip = false,\n className,\n as = \"span\",\n ...rest\n },\n ref\n ) => {\n const formattedValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n format\n );\n\n const formattedLongValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"long\"\n );\n\n if (format === \"short\") {\n return (\n <Tooltip\n title={formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n false,\n decimalSpaces,\n \"long\"\n )}\n disable={\n disableTooltip ||\n (!formattedLongValue.includes(thousandSeparator) &&\n !formattedLongValue.includes(decimalSeparator))\n }\n >\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedValue}\n </Typography>\n </Tooltip>\n );\n }\n\n return (\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedLongValue}\n </Typography>\n );\n }\n);\n\nDisplayNumber.displayName = \"DisplayNumber\";\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAGzC,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,UAAU,QAAQ,0BAA0B;AAErD,OAAO,MAAMC,aAAa,gBAAGJ,UAAU,CACrC,CAAAK,IAAA,
|
|
1
|
+
{"version":3,"file":"DisplayNumber.js","names":["React","forwardRef","formatNumber","Tooltip","Typography","DisplayNumber","_ref","ref","value","variant","thousandSeparator","decimalSeparator","trimDecimals","decimalSpaces","format","disableTooltip","className","as","shortenThreshold","rest","formattedValue","formattedLongValue","createElement","title","disable","includes","_extends","displayName"],"sources":["../../../../src/components/Display/DisplayNumber.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport { DisplayNumberProps } from \"./types\";\nimport { formatNumber } from \"../../utils\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const DisplayNumber = forwardRef<HTMLSpanElement, DisplayNumberProps>(\n (\n {\n value,\n variant = \"Body 2\",\n thousandSeparator = \",\",\n decimalSeparator = \".\",\n trimDecimals = true,\n decimalSpaces = 2,\n format = \"long\",\n disableTooltip = false,\n className,\n as = \"span\",\n shortenThreshold = 1000,\n ...rest\n },\n ref\n ) => {\n const formattedValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n format,\n shortenThreshold\n );\n\n const formattedLongValue = formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n trimDecimals,\n decimalSpaces,\n \"long\"\n );\n\n if (format === \"short\") {\n return (\n <Tooltip\n title={formatNumber(\n value,\n thousandSeparator,\n decimalSeparator,\n false,\n decimalSpaces,\n \"long\"\n )}\n disable={\n disableTooltip ||\n (!formattedLongValue.includes(thousandSeparator) &&\n !formattedLongValue.includes(decimalSeparator))\n }\n >\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedValue}\n </Typography>\n </Tooltip>\n );\n }\n\n return (\n <Typography\n as={as}\n variant={variant}\n className={className}\n ref={ref}\n {...rest}\n >\n {formattedLongValue}\n </Typography>\n );\n }\n);\n\nDisplayNumber.displayName = \"DisplayNumber\";\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAGzC,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,UAAU,QAAQ,0BAA0B;AAErD,OAAO,MAAMC,aAAa,gBAAGJ,UAAU,CACrC,CAAAK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AAS,EAAEA,SAAU;IACrBT,GAAG,EAAEA;EAAI,GACLY,IAAI,GAEPE,kBACS,CAAC;AAEjB,CACF,CAAC;AAEDhB,aAAa,CAACsB,WAAW,GAAG,eAAe"}
|
|
@@ -8,6 +8,7 @@ export interface DisplayNumberProps extends Omit<TypographyProps<"span">, "child
|
|
|
8
8
|
decimalSpaces?: number;
|
|
9
9
|
format?: FormatType;
|
|
10
10
|
disableTooltip?: boolean;
|
|
11
|
+
shortenThreshold?: number;
|
|
11
12
|
}
|
|
12
13
|
export interface DisplayHoursProps extends Omit<TypographyProps<"span">, "children"> {
|
|
13
14
|
value: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Display/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IACjD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Display/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IACjD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IACjD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/Display/types.ts"],"sourcesContent":["import { FormatType } from \"../../utils/types\";\nimport { TypographyProps } from \"../Typography/Typography\";\n\nexport interface DisplayNumberProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n}\n\nexport interface DisplayHoursProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimZeroMinutes?: boolean;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n withLeadingZero?: boolean;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/Display/types.ts"],"sourcesContent":["import { FormatType } from \"../../utils/types\";\nimport { TypographyProps } from \"../Typography/Typography\";\n\nexport interface DisplayNumberProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n shortenThreshold?: number;\n}\n\nexport interface DisplayHoursProps\n extends Omit<TypographyProps<\"span\">, \"children\"> {\n value: string | number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n trimZeroMinutes?: boolean;\n trimDecimals?: boolean;\n decimalSpaces?: number;\n format?: FormatType;\n disableTooltip?: boolean;\n withLeadingZero?: boolean;\n}\n"],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -17616,7 +17616,7 @@
|
|
|
17616
17616
|
})));
|
|
17617
17617
|
};
|
|
17618
17618
|
|
|
17619
|
-
var _excluded$A = ["value", "variant", "thousandSeparator", "decimalSeparator", "trimDecimals", "decimalSpaces", "format", "disableTooltip", "className", "as"];
|
|
17619
|
+
var _excluded$A = ["value", "variant", "thousandSeparator", "decimalSeparator", "trimDecimals", "decimalSpaces", "format", "disableTooltip", "className", "as", "shortenThreshold"];
|
|
17620
17620
|
var DisplayNumber = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
17621
17621
|
var value = _ref.value,
|
|
17622
17622
|
_ref$variant = _ref.variant,
|
|
@@ -17636,8 +17636,10 @@
|
|
|
17636
17636
|
className = _ref.className,
|
|
17637
17637
|
_ref$as = _ref.as,
|
|
17638
17638
|
as = _ref$as === void 0 ? "span" : _ref$as,
|
|
17639
|
+
_ref$shortenThreshold = _ref.shortenThreshold,
|
|
17640
|
+
shortenThreshold = _ref$shortenThreshold === void 0 ? 1000 : _ref$shortenThreshold,
|
|
17639
17641
|
rest = _objectWithoutProperties(_ref, _excluded$A);
|
|
17640
|
-
var formattedValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, format);
|
|
17642
|
+
var formattedValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, format, shortenThreshold);
|
|
17641
17643
|
var formattedLongValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long");
|
|
17642
17644
|
if (format === "short") {
|
|
17643
17645
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, {
|