@activecollab/components 2.0.193 → 2.0.195
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/Autocomplete/Autocomplete.js +2 -0
- package/dist/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/cjs/components/Display/DisplayCurrency.js +1 -1
- package/dist/cjs/components/Display/DisplayCurrency.js.map +1 -1
- package/dist/cjs/components/Display/DisplayNumber.js +1 -1
- package/dist/cjs/components/Display/DisplayNumber.js.map +1 -1
- package/dist/cjs/components/Select/Option/Option.js +3 -1
- package/dist/cjs/components/Select/Option/Option.js.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +2 -0
- package/dist/esm/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/esm/components/Display/DisplayCurrency.d.ts.map +1 -1
- package/dist/esm/components/Display/DisplayCurrency.js +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 +1 -1
- package/dist/esm/components/Display/DisplayNumber.js.map +1 -1
- package/dist/esm/components/Select/Option/Option.d.ts +4 -0
- package/dist/esm/components/Select/Option/Option.d.ts.map +1 -1
- package/dist/esm/components/Select/Option/Option.js +2 -1
- package/dist/esm/components/Select/Option/Option.js.map +1 -1
- package/dist/index.js +7 -3
- 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","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 & { currencyCode?: string; currencyPosition?: string }\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={
|
|
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 & { currencyCode?: string; currencyPosition?: string }\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,CAIvC,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,GAAG,CAAC;IACjBC,MAAM,GAAG,MAAM;IACfC,cAAc,GAAG,KAAK;IACtBC,SAAS;IACTC,EAAE,GAAG,MAAM;IACX,GAAGC;EACL,CAAC,GAAAd,IAAA;EAGD,MAAMe,cAAc,GAAGnB,cAAc,CACnCM,KAAK,EACLI,iBAAiB,EACjBC,gBAAgB,EAChBC,YAAY,EACZC,aAAa,EACb,OAAO,EACPL,YAAY,EACZC,gBACF,CAAC;EAED,MAAMW,kBAAkB,GAAGpB,cAAc,CACvCM,KAAK,EACLI,iBAAiB,EACjBC,gBAAgB,EAChBC,YAAY,EACZC,aAAa,EACb,MAAM,EACNL,YAAY,EACZC,gBACF,CAAC;EAED,IAAIK,MAAM,KAAK,OAAO,EAAE;IACtB,oBACEhB,KAAA,CAAAuB,aAAA,CAACpB,OAAO;MACNqB,KAAK,EAAEtB,cAAc,CACnBM,KAAK,EACLI,iBAAiB,EACjBC,gBAAgB,EAChB,KAAK,EACLE,aAAa,EACb,MAAM,EACNL,YAAY,EACZC,gBACF,CAAE;MACFc,OAAO,EACLR,cAAc,IACb,CAACK,kBAAkB,CAACI,QAAQ,CAACd,iBAAiB,CAAC,IAC9C,CAACU,kBAAkB,CAACI,QAAQ,CAACb,gBAAgB;IAChD,gBAEDb,KAAA,CAAAuB,aAAA,CAACnB,UAAU,EAAAuB,QAAA;MACTR,EAAE,EAAEA,EAAG;MACPV,OAAO,EAAEA,OAAQ;MACjBS,SAAS,EAAEA,SAAU;MACrBX,GAAG,EAAEA;IAAI,GACLa,IAAI,GAEPC,cACS,CACL,CAAC;EAEd;EAEA,oBACErB,KAAA,CAAAuB,aAAA,CAACnB,UAAU,EAAAuB,QAAA;IACTR,EAAE,EAAEA,EAAG;IACPV,OAAO,EAAEA,OAAQ;IACjBS,SAAS,EAAEA,SAAU;IACrBX,GAAG,EAAEA;EAAI,GACLa,IAAI,GAEPE,kBACS,CAAC;AAEjB,CACF,CAAC;AAEDjB,eAAe,CAACuB,WAAW,GAAG,iBAAiB"}
|
|
@@ -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,yGA6EzB,CAAC"}
|
|
@@ -21,7 +21,7 @@ export const DisplayNumber = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
21
21
|
const formattedLongValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long");
|
|
22
22
|
if (format === "short") {
|
|
23
23
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
24
|
-
title:
|
|
24
|
+
title: formatNumber(value, thousandSeparator, decimalSeparator, false, decimalSpaces, "long"),
|
|
25
25
|
disable: disableTooltip || !formattedLongValue.includes(thousandSeparator) && !formattedLongValue.includes(decimalSeparator)
|
|
26
26
|
}, /*#__PURE__*/React.createElement(Typography, _extends({
|
|
27
27
|
as: as,
|
|
@@ -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={
|
|
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,EAcEC,GAAG,KACA;EAAA,IAdH;IACEC,KAAK;IACLC,OAAO,GAAG,QAAQ;IAClBC,iBAAiB,GAAG,GAAG;IACvBC,gBAAgB,GAAG,GAAG;IACtBC,YAAY,GAAG,IAAI;IACnBC,aAAa,GAAG,CAAC;IACjBC,MAAM,GAAG,MAAM;IACfC,cAAc,GAAG,KAAK;IACtBC,SAAS;IACTC,EAAE,GAAG,MAAM;IACX,GAAGC;EACL,CAAC,GAAAZ,IAAA;EAGD,MAAMa,cAAc,GAAGjB,YAAY,CACjCM,KAAK,EACLE,iBAAiB,EACjBC,gBAAgB,EAChBC,YAAY,EACZC,aAAa,EACbC,MACF,CAAC;EAED,MAAMM,kBAAkB,GAAGlB,YAAY,CACrCM,KAAK,EACLE,iBAAiB,EACjBC,gBAAgB,EAChBC,YAAY,EACZC,aAAa,EACb,MACF,CAAC;EAED,IAAIC,MAAM,KAAK,OAAO,EAAE;IACtB,oBACEd,KAAA,CAAAqB,aAAA,CAAClB,OAAO;MACNmB,KAAK,EAAEpB,YAAY,CACjBM,KAAK,EACLE,iBAAiB,EACjBC,gBAAgB,EAChB,KAAK,EACLE,aAAa,EACb,MACF,CAAE;MACFU,OAAO,EACLR,cAAc,IACb,CAACK,kBAAkB,CAACI,QAAQ,CAACd,iBAAiB,CAAC,IAC9C,CAACU,kBAAkB,CAACI,QAAQ,CAACb,gBAAgB;IAChD,gBAEDX,KAAA,CAAAqB,aAAA,CAACjB,UAAU,EAAAqB,QAAA;MACTR,EAAE,EAAEA,EAAG;MACPR,OAAO,EAAEA,OAAQ;MACjBO,SAAS,EAAEA,SAAU;MACrBT,GAAG,EAAEA;IAAI,GACLW,IAAI,GAEPC,cACS,CACL,CAAC;EAEd;EAEA,oBACEnB,KAAA,CAAAqB,aAAA,CAACjB,UAAU,EAAAqB,QAAA;IACTR,EAAE,EAAEA,EAAG;IACPR,OAAO,EAAEA,OAAQ;IACjBO,SAAS,EAAEA,SAAU;IACrBT,GAAG,EAAEA;EAAI,GACLW,IAAI,GAEPE,kBACS,CAAC;AAEjB,CACF,CAAC;AAEDf,aAAa,CAACqB,WAAW,GAAG,eAAe"}
|
|
@@ -4,6 +4,8 @@ export interface IOptionItemProps {
|
|
|
4
4
|
id: string | number;
|
|
5
5
|
/** Label of option */
|
|
6
6
|
name: string;
|
|
7
|
+
/** Content for tooltip */
|
|
8
|
+
tooltip?: string;
|
|
7
9
|
/** Additional info right-side of name */
|
|
8
10
|
additionalInfo?: string;
|
|
9
11
|
/** image url for Avatar or MultiAvatar */
|
|
@@ -20,6 +22,8 @@ interface IAdditionalOptionItemProps {
|
|
|
20
22
|
id?: string | number;
|
|
21
23
|
/** Label of option */
|
|
22
24
|
name: string;
|
|
25
|
+
/** Content for tooltip */
|
|
26
|
+
tooltip?: string;
|
|
23
27
|
/** Hovered state */
|
|
24
28
|
hover?: boolean;
|
|
25
29
|
/** Class name of option */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/Option/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EACjB,SAAS,EAGV,MAAM,OAAO,CAAC;AAMf,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,0BAA0B;IAClC,sBAAsB;IACtB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,qBAAqB;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/Option/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EACjB,SAAS,EAGV,MAAM,OAAO,CAAC;AAMf,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,0BAA0B;IAClC,sBAAsB;IACtB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,qBAAqB;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,MAAM,kGAkClB,CAAC"}
|
|
@@ -5,6 +5,7 @@ export const Option = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
5
5
|
let {
|
|
6
6
|
id,
|
|
7
7
|
name,
|
|
8
|
+
tooltip = "",
|
|
8
9
|
hover,
|
|
9
10
|
className,
|
|
10
11
|
renderOption,
|
|
@@ -18,7 +19,7 @@ export const Option = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
18
19
|
}, [onMouseEnter, id]);
|
|
19
20
|
return /*#__PURE__*/React.createElement(StyledOption, {
|
|
20
21
|
ref: hover ? ref : null,
|
|
21
|
-
title: name,
|
|
22
|
+
title: tooltip ? tooltip : name,
|
|
22
23
|
onMouseEnter: handleOnMouseEnter,
|
|
23
24
|
onTouchStart: handleOnMouseEnter,
|
|
24
25
|
className: classnames("c-option", className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.js","names":["React","forwardRef","useCallback","classnames","StyledOption","Option","_ref","ref","id","name","hover","className","renderOption","onMouseEnter","onClick","handleOnMouseEnter","createElement","title","onTouchStart","displayName"],"sources":["../../../../../src/components/Select/Option/Option.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEventHandler,\n ReactNode,\n Ref,\n useCallback,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledOption } from \"./Styles\";\n\nexport interface IOptionItemProps {\n /** Value of option */\n id: string | number;\n /** Label of option */\n name: string;\n /** Additional info right-side of name */\n additionalInfo?: string;\n /** image url for Avatar or MultiAvatar */\n image?: string | string[];\n /** Hex color for label */\n color?: string;\n /** Color for chip label */\n chipColor?: string;\n /** Value of mixed */\n mixed?: boolean;\n}\n\ninterface IAdditionalOptionItemProps {\n /** Value of option */\n id?: string | number;\n /** Label of option */\n name: string;\n /** Hovered state */\n hover?: boolean;\n /** Class name of option */\n className?: string;\n /** Render option function */\n renderOption?: ReactNode;\n /** On mouse enter callback */\n onMouseEnter?: (e: string | number | undefined) => void;\n /** On mouse click */\n onClick?: MouseEventHandler<HTMLLIElement>;\n}\n\nexport const Option = forwardRef(\n (\n {\n id,\n name,\n hover,\n className,\n renderOption,\n onMouseEnter,\n onClick = () => null,\n }: IAdditionalOptionItemProps,\n ref: Ref<HTMLLIElement>\n ) => {\n const handleOnMouseEnter = useCallback(() => {\n if (onMouseEnter) {\n onMouseEnter(id);\n }\n }, [onMouseEnter, id]);\n\n return (\n <StyledOption\n ref={hover ? ref : null}\n title={name}\n onMouseEnter={handleOnMouseEnter}\n onTouchStart={handleOnMouseEnter}\n className={classnames(\"c-option\", className)}\n hover={hover}\n onClick={onClick}\n >\n {renderOption ? renderOption : name}\n </StyledOption>\n );\n }\n);\n\nOption.displayName = \"Option\";\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,UAAU,EAIVC,WAAW,QACN,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,YAAY,QAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"Option.js","names":["React","forwardRef","useCallback","classnames","StyledOption","Option","_ref","ref","id","name","tooltip","hover","className","renderOption","onMouseEnter","onClick","handleOnMouseEnter","createElement","title","onTouchStart","displayName"],"sources":["../../../../../src/components/Select/Option/Option.tsx"],"sourcesContent":["import React, {\n forwardRef,\n MouseEventHandler,\n ReactNode,\n Ref,\n useCallback,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledOption } from \"./Styles\";\n\nexport interface IOptionItemProps {\n /** Value of option */\n id: string | number;\n /** Label of option */\n name: string;\n /** Content for tooltip */\n tooltip?: string;\n /** Additional info right-side of name */\n additionalInfo?: string;\n /** image url for Avatar or MultiAvatar */\n image?: string | string[];\n /** Hex color for label */\n color?: string;\n /** Color for chip label */\n chipColor?: string;\n /** Value of mixed */\n mixed?: boolean;\n}\n\ninterface IAdditionalOptionItemProps {\n /** Value of option */\n id?: string | number;\n /** Label of option */\n name: string;\n /** Content for tooltip */\n tooltip?: string;\n /** Hovered state */\n hover?: boolean;\n /** Class name of option */\n className?: string;\n /** Render option function */\n renderOption?: ReactNode;\n /** On mouse enter callback */\n onMouseEnter?: (e: string | number | undefined) => void;\n /** On mouse click */\n onClick?: MouseEventHandler<HTMLLIElement>;\n}\n\nexport const Option = forwardRef(\n (\n {\n id,\n name,\n tooltip = \"\",\n hover,\n className,\n renderOption,\n onMouseEnter,\n onClick = () => null,\n }: IAdditionalOptionItemProps,\n ref: Ref<HTMLLIElement>\n ) => {\n const handleOnMouseEnter = useCallback(() => {\n if (onMouseEnter) {\n onMouseEnter(id);\n }\n }, [onMouseEnter, id]);\n\n return (\n <StyledOption\n ref={hover ? ref : null}\n title={tooltip ? tooltip : name}\n onMouseEnter={handleOnMouseEnter}\n onTouchStart={handleOnMouseEnter}\n className={classnames(\"c-option\", className)}\n hover={hover}\n onClick={onClick}\n >\n {renderOption ? renderOption : name}\n </StyledOption>\n );\n }\n);\n\nOption.displayName = \"Option\";\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,UAAU,EAIVC,WAAW,QACN,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,YAAY,QAAQ,UAAU;AAwCvC,OAAO,MAAMC,MAAM,gBAAGJ,UAAU,CAC9B,CAAAK,IAAA,EAWEC,GAAuB,KACpB;EAAA,IAXH;IACEC,EAAE;IACFC,IAAI;IACJC,OAAO,GAAG,EAAE;IACZC,KAAK;IACLC,SAAS;IACTC,YAAY;IACZC,YAAY;IACZC,OAAO,GAAGA,CAAA,KAAM;EACU,CAAC,GAAAT,IAAA;EAG7B,MAAMU,kBAAkB,GAAGd,WAAW,CAAC,MAAM;IAC3C,IAAIY,YAAY,EAAE;MAChBA,YAAY,CAACN,EAAE,CAAC;IAClB;EACF,CAAC,EAAE,CAACM,YAAY,EAAEN,EAAE,CAAC,CAAC;EAEtB,oBACER,KAAA,CAAAiB,aAAA,CAACb,YAAY;IACXG,GAAG,EAAEI,KAAK,GAAGJ,GAAG,GAAG,IAAK;IACxBW,KAAK,EAAER,OAAO,GAAGA,OAAO,GAAGD,IAAK;IAChCK,YAAY,EAAEE,kBAAmB;IACjCG,YAAY,EAAEH,kBAAmB;IACjCJ,SAAS,EAAET,UAAU,CAAC,UAAU,EAAES,SAAS,CAAE;IAC7CD,KAAK,EAAEA,KAAM;IACbI,OAAO,EAAEA;EAAQ,GAEhBF,YAAY,GAAGA,YAAY,GAAGJ,IACnB,CAAC;AAEnB,CACF,CAAC;AAEDJ,MAAM,CAACe,WAAW,GAAG,QAAQ"}
|
package/dist/index.js
CHANGED
|
@@ -14943,6 +14943,8 @@
|
|
|
14943
14943
|
var Option = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
14944
14944
|
var id = _ref.id,
|
|
14945
14945
|
name = _ref.name,
|
|
14946
|
+
_ref$tooltip = _ref.tooltip,
|
|
14947
|
+
tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip,
|
|
14946
14948
|
hover = _ref.hover,
|
|
14947
14949
|
className = _ref.className,
|
|
14948
14950
|
renderOption = _ref.renderOption,
|
|
@@ -14958,7 +14960,7 @@
|
|
|
14958
14960
|
}, [onMouseEnter, id]);
|
|
14959
14961
|
return /*#__PURE__*/React__default["default"].createElement(StyledOption, {
|
|
14960
14962
|
ref: hover ? ref : null,
|
|
14961
|
-
title: name,
|
|
14963
|
+
title: tooltip ? tooltip : name,
|
|
14962
14964
|
onMouseEnter: handleOnMouseEnter,
|
|
14963
14965
|
onTouchStart: handleOnMouseEnter,
|
|
14964
14966
|
className: classNames__default["default"]("c-option", className),
|
|
@@ -15357,6 +15359,7 @@
|
|
|
15357
15359
|
return /*#__PURE__*/React__default["default"].createElement(OptionGroup, {
|
|
15358
15360
|
checked: selectedOptions,
|
|
15359
15361
|
name: item.name,
|
|
15362
|
+
tooltip: item.tooltip,
|
|
15360
15363
|
key: item.id,
|
|
15361
15364
|
setHover: handleHoverCallback,
|
|
15362
15365
|
id: item.id,
|
|
@@ -15373,6 +15376,7 @@
|
|
|
15373
15376
|
name: item.name,
|
|
15374
15377
|
ref: itemRef,
|
|
15375
15378
|
key: index,
|
|
15379
|
+
tooltip: item.tooltip,
|
|
15376
15380
|
onMouseEnter: handleMouseEnter,
|
|
15377
15381
|
onClick: handleClick,
|
|
15378
15382
|
id: item.id,
|
|
@@ -17583,7 +17587,7 @@
|
|
|
17583
17587
|
var formattedLongValue = formatNumber(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long");
|
|
17584
17588
|
if (format === "short") {
|
|
17585
17589
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, {
|
|
17586
|
-
title:
|
|
17590
|
+
title: formatNumber(value, thousandSeparator, decimalSeparator, false, decimalSpaces, "long"),
|
|
17587
17591
|
disable: disableTooltip || !formattedLongValue.includes(thousandSeparator) && !formattedLongValue.includes(decimalSeparator)
|
|
17588
17592
|
}, /*#__PURE__*/React__default["default"].createElement(Typography, _extends({
|
|
17589
17593
|
as: as,
|
|
@@ -17630,7 +17634,7 @@
|
|
|
17630
17634
|
var formattedLongValue = formatCurrency(value, thousandSeparator, decimalSeparator, trimDecimals, decimalSpaces, "long", currencyCode, currencyPosition);
|
|
17631
17635
|
if (format === "short") {
|
|
17632
17636
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, {
|
|
17633
|
-
title:
|
|
17637
|
+
title: formatCurrency(value, thousandSeparator, decimalSeparator, false, decimalSpaces, "long", currencyCode, currencyPosition),
|
|
17634
17638
|
disable: disableTooltip || !formattedLongValue.includes(thousandSeparator) && !formattedLongValue.includes(decimalSeparator)
|
|
17635
17639
|
}, /*#__PURE__*/React__default["default"].createElement(Typography, _extends({
|
|
17636
17640
|
as: as,
|