@trackunit/react-table-base-components 0.0.162 → 0.0.164

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
@@ -222,12 +222,12 @@ const getIconName = (type) => {
222
222
  * @returns {JSX.Element} SiteCell component
223
223
  */
224
224
  const SiteCell = ({ count, sites, dataTestId, className }) => {
225
- var _a, _b, _c, _d, _e;
225
+ var _a, _b;
226
226
  const [isTooltipVisible, setIsTooltipVisible] = react.useState(false);
227
227
  const updateTooltipVisibility = (element) => {
228
228
  setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
229
229
  };
230
- return count > 0 ? (jsxRuntime.jsxs("div", { className: cvaSiteCellWrapper({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(SiteIcon, { size: "small", type: (_a = sites[0]) === null || _a === void 0 ? void 0 : _a.type }), jsxRuntime.jsx("span", { ref: elementRef => updateTooltipVisibility(elementRef), className: cvaSiteCellTooltip(), children: jsxRuntime.jsx(reactComponents.Tooltip, { disabled: !isTooltipVisible, label: (_c = (_b = sites[0]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "", placement: "bottom", className: "inline", children: (_e = (_d = sites[0]) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : "" }) }), jsxRuntime.jsx("span", { className: "text-slate-500", children: count > 1 ? `+${count - 1}` : "" })] })) : null;
230
+ return count && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaSiteCellWrapper({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(SiteIcon, { size: "small", type: sites.type }), jsxRuntime.jsx("span", { ref: elementRef => updateTooltipVisibility(elementRef), className: cvaSiteCellTooltip(), children: jsxRuntime.jsx(reactComponents.Tooltip, { disabled: !isTooltipVisible, label: (_a = sites.name) !== null && _a !== void 0 ? _a : "", placement: "bottom", className: "inline", children: (_b = sites.name) !== null && _b !== void 0 ? _b : "" }) }), jsxRuntime.jsx("span", { className: "text-slate-500", children: count > 1 ? `+${count - 1}` : "" })] })) : null;
231
231
  };
232
232
 
233
233
  /**
package/index.esm.js CHANGED
@@ -218,12 +218,12 @@ const getIconName = (type) => {
218
218
  * @returns {JSX.Element} SiteCell component
219
219
  */
220
220
  const SiteCell = ({ count, sites, dataTestId, className }) => {
221
- var _a, _b, _c, _d, _e;
221
+ var _a, _b;
222
222
  const [isTooltipVisible, setIsTooltipVisible] = useState(false);
223
223
  const updateTooltipVisibility = (element) => {
224
224
  setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
225
225
  };
226
- return count > 0 ? (jsxs("div", { className: cvaSiteCellWrapper({ className }), "data-testid": dataTestId, children: [jsx(SiteIcon, { size: "small", type: (_a = sites[0]) === null || _a === void 0 ? void 0 : _a.type }), jsx("span", { ref: elementRef => updateTooltipVisibility(elementRef), className: cvaSiteCellTooltip(), children: jsx(Tooltip, { disabled: !isTooltipVisible, label: (_c = (_b = sites[0]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "", placement: "bottom", className: "inline", children: (_e = (_d = sites[0]) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : "" }) }), jsx("span", { className: "text-slate-500", children: count > 1 ? `+${count - 1}` : "" })] })) : null;
226
+ return count && count > 0 ? (jsxs("div", { className: cvaSiteCellWrapper({ className }), "data-testid": dataTestId, children: [jsx(SiteIcon, { size: "small", type: sites.type }), jsx("span", { ref: elementRef => updateTooltipVisibility(elementRef), className: cvaSiteCellTooltip(), children: jsx(Tooltip, { disabled: !isTooltipVisible, label: (_a = sites.name) !== null && _a !== void 0 ? _a : "", placement: "bottom", className: "inline", children: (_b = sites.name) !== null && _b !== void 0 ? _b : "" }) }), jsx("span", { className: "text-slate-500", children: count > 1 ? `+${count - 1}` : "" })] })) : null;
227
227
  };
228
228
 
229
229
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table-base-components",
3
- "version": "0.0.162",
3
+ "version": "0.0.164",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -6,8 +6,8 @@ type CellSite = {
6
6
  type?: CellSiteType;
7
7
  };
8
8
  export interface SiteCellProps extends CommonProps {
9
- sites: CellSite[];
10
- count: number;
9
+ sites: CellSite;
10
+ count?: number | null;
11
11
  }
12
12
  /**
13
13
  * The `<SiteCell>` component is used for displaying the sites in a table cell.