@trackunit/react-table-base-components 1.4.25 → 1.4.27

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/index.cjs.js CHANGED
@@ -174,12 +174,12 @@ const cvaMultiValueTextCellTooltip = cssClassVarianceUtilities.cvaMerge([
174
174
  * @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component
175
175
  * @returns {ReactElement} MultiValueTextCell component
176
176
  */
177
- const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, dataTestId, className, }) => {
177
+ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, dataTestId, className, onMouseEnter, }) => {
178
178
  const [isTooltipVisible, setIsTooltipVisible] = react.useState(false);
179
179
  const updateTooltipVisibility = (element) => {
180
180
  setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
181
181
  };
182
- return count && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, children: [icon ? (jsxRuntime.jsx(reactComponents.Tooltip, { className: "inline-flex items-center", dataTestId: dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsxRuntime.jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsxRuntime.jsx(reactComponents.Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: content ?? "" }) }), count > 1 ? (jsxRuntime.jsx(reactComponents.Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxRuntime.jsxs(reactComponents.Tag, { color: "neutral", size: "small", children: ["+", count - 1] }) })) : null] })) : null;
182
+ return count && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, children: [icon ? (jsxRuntime.jsx(reactComponents.Tooltip, { className: "inline-flex items-center", dataTestId: dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsxRuntime.jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsxRuntime.jsx(reactComponents.Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: content ?? "" }) }), count > 1 ? (jsxRuntime.jsx(reactComponents.Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxRuntime.jsxs(reactComponents.Tag, { color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
183
183
  };
184
184
 
185
185
  /**
package/index.esm.js CHANGED
@@ -172,12 +172,12 @@ const cvaMultiValueTextCellTooltip = cvaMerge([
172
172
  * @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component
173
173
  * @returns {ReactElement} MultiValueTextCell component
174
174
  */
175
- const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, dataTestId, className, }) => {
175
+ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, dataTestId, className, onMouseEnter, }) => {
176
176
  const [isTooltipVisible, setIsTooltipVisible] = useState(false);
177
177
  const updateTooltipVisibility = (element) => {
178
178
  setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
179
179
  };
180
- return count && count > 0 ? (jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, children: [icon ? (jsx(Tooltip, { className: "inline-flex items-center", dataTestId: dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsx(Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: content ?? "" }) }), count > 1 ? (jsx(Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxs(Tag, { color: "neutral", size: "small", children: ["+", count - 1] }) })) : null] })) : null;
180
+ return count && count > 0 ? (jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, children: [icon ? (jsx(Tooltip, { className: "inline-flex items-center", dataTestId: dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsx(Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: content ?? "" }) }), count > 1 ? (jsx(Tooltip, { className: "inline", dataTestId: dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxs(Tag, { color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
181
181
  };
182
182
 
183
183
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table-base-components",
3
- "version": "1.4.25",
3
+ "version": "1.4.27",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,9 +9,9 @@
9
9
  "dependencies": {
10
10
  "react": "19.0.0",
11
11
  "@js-temporal/polyfill": "^0.4.4",
12
- "@trackunit/react-components": "1.5.22",
12
+ "@trackunit/react-components": "1.5.23",
13
13
  "@trackunit/ui-icons": "1.4.15",
14
- "@trackunit/react-form-components": "1.4.25",
14
+ "@trackunit/react-form-components": "1.4.27",
15
15
  "@trackunit/css-class-variance-utilities": "1.4.15",
16
16
  "@trackunit/date-and-time-utils": "1.4.15",
17
17
  "@trackunit/shared-utils": "1.6.15",
@@ -1,11 +1,12 @@
1
1
  import { CommonProps } from "@trackunit/react-components";
2
- import { ReactElement, ReactNode } from "react";
2
+ import { MouseEventHandler, ReactElement, ReactNode } from "react";
3
3
  export interface MultiValueTextCellProps extends CommonProps {
4
4
  icon?: ReactElement;
5
5
  iconTooltip?: string;
6
6
  content?: string;
7
7
  count?: number | null;
8
8
  countTooltip?: ReactNode;
9
+ onMouseEnter?: MouseEventHandler<HTMLDivElement>;
9
10
  }
10
11
  /**
11
12
  * The `<MultiValueTextCell>` component is used for displaying the text values with multiple values in a table cell. First element is displayed as a text, the rest of the values are displayed as a number. Icon can be passed as an optional prop.
@@ -14,4 +15,4 @@ export interface MultiValueTextCellProps extends CommonProps {
14
15
  * @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component
15
16
  * @returns {ReactElement} MultiValueTextCell component
16
17
  */
17
- export declare const MultiValueTextCell: ({ content, count, countTooltip, icon, iconTooltip, dataTestId, className, }: MultiValueTextCellProps) => import("react/jsx-runtime").JSX.Element | null;
18
+ export declare const MultiValueTextCell: ({ content, count, countTooltip, icon, iconTooltip, dataTestId, className, onMouseEnter, }: MultiValueTextCellProps) => import("react/jsx-runtime").JSX.Element | null;