@synerise/ds-table 0.56.7 → 0.56.8

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/Cell/Action/ActionCell.d.ts +3 -3
  3. package/dist/Cell/Action/ActionCell.js +14 -5
  4. package/dist/Cell/Action/ActionCell.types.d.ts +9 -4
  5. package/dist/Cell/AvatarLabel/AvatarLabel.d.ts +1 -1
  6. package/dist/Cell/AvatarLabel/AvatarLabel.js +9 -3
  7. package/dist/Cell/AvatarLabel/AvatarLabel.types.d.ts +6 -2
  8. package/dist/Cell/Copyable/Copyable.types.d.ts +7 -2
  9. package/dist/Cell/Copyable/CopyableCell.d.ts +3 -3
  10. package/dist/Cell/Copyable/CopyableCell.js +14 -8
  11. package/dist/Cell/Editable/EditableCell.d.ts +3 -3
  12. package/dist/Cell/Editable/EditableCell.js +16 -11
  13. package/dist/Cell/Editable/EditableCell.types.d.ts +8 -3
  14. package/dist/Cell/FlagLabel/FlagLabelCell.d.ts +3 -3
  15. package/dist/Cell/FlagLabel/FlagLabelCell.js +9 -3
  16. package/dist/Cell/FlagLabel/FlagLabelCell.types.d.ts +7 -2
  17. package/dist/Cell/IconLabel/IconLabel.d.ts +3 -3
  18. package/dist/Cell/IconLabel/IconLabel.js +9 -3
  19. package/dist/Cell/IconLabel/IconLabel.types.d.ts +7 -2
  20. package/dist/Cell/IconTooltipCell/IconTooltipCell.d.ts +3 -3
  21. package/dist/Cell/IconTooltipCell/IconTooltipCell.js +9 -3
  22. package/dist/Cell/IconTooltipCell/IconTooltipCell.types.d.ts +7 -2
  23. package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.d.ts +3 -3
  24. package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.js +13 -8
  25. package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.types.d.ts +12 -7
  26. package/dist/Cell/Star/StarCell.d.ts +261 -2
  27. package/dist/Cell/Star/StarCell.js +12 -6
  28. package/dist/Cell/Star/StarCell.types.d.ts +11 -6
  29. package/dist/Cell/StatusLabel/StatusLabel.d.ts +3 -3
  30. package/dist/Cell/StatusLabel/StatusLabel.js +9 -3
  31. package/dist/Cell/StatusLabel/StatusLabel.types.d.ts +10 -5
  32. package/dist/Cell/TagIcon/TagIcon.d.ts +3 -3
  33. package/dist/Cell/TagIcon/TagIcon.js +9 -3
  34. package/dist/Cell/TagIcon/TagIcon.types.d.ts +9 -4
  35. package/dist/Table.js +5 -4
  36. package/dist/Table.types.d.ts +2 -0
  37. package/dist/TableSkeleton/TableSkeleton.d.ts +1 -1
  38. package/dist/TableSkeleton/TableSkeleton.js +10 -2
  39. package/dist/TableSkeleton/TableSkeleton.styles.d.ts +9 -3
  40. package/dist/TableSkeleton/TableSkeleton.styles.js +15 -6
  41. package/dist/TableSkeleton/TableSkeleton.types.d.ts +3 -0
  42. package/dist/TableSkeleton/components/TableSkeletonBody.d.ts +2 -1
  43. package/dist/TableSkeleton/components/TableSkeletonBody.js +3 -1
  44. package/dist/TableSkeleton/components/TableSkeletonHeader.d.ts +3 -1
  45. package/dist/TableSkeleton/components/TableSkeletonSubheader.d.ts +3 -1
  46. package/dist/VirtualTable/VirtualTable.d.ts +1 -0
  47. package/package.json +24 -24
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.56.8](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.56.7...@synerise/ds-table@0.56.8) (2024-09-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **table:** allow htmlattributes on cell divs ([f4cf677](https://github.com/synerise/synerise-design/commit/f4cf6773add2a4e8ce62dc83d42ae93f2c8d27b0))
12
+ * **table:** skeleton dimensions ([1f14222](https://github.com/synerise/synerise-design/commit/1f1422234ad298e8dd406e59bf98982d0e40ad97))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [0.56.7](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.56.6...@synerise/ds-table@0.56.7) (2024-09-11)
7
19
 
8
20
  **Note:** Version bump only for package @synerise/ds-table
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
- import { Props } from './ActionCell.types';
3
- declare const _default: React.NamedExoticComponent<Props>;
1
+ import React from 'react';
2
+ import { ActionCellProps } from './ActionCell.types';
3
+ declare const _default: React.MemoExoticComponent<({ children, gapSize, contentAlign, ...htmlAttributes }: ActionCellProps) => React.JSX.Element>;
4
4
  export default _default;
@@ -1,16 +1,25 @@
1
- import * as React from 'react';
1
+ var _excluded = ["children", "gapSize", "contentAlign"];
2
+
3
+ function _extends() { _extends = Object.assign || 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); }
4
+
5
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
+
7
+ import React from 'react';
2
8
  import * as S from './ActionCell.styles';
9
+ var DEFAULT_GAP_SIZE = 24;
3
10
 
4
11
  var ActionCell = function ActionCell(_ref) {
5
12
  var children = _ref.children,
6
13
  _ref$gapSize = _ref.gapSize,
7
- gapSize = _ref$gapSize === void 0 ? 24 : _ref$gapSize,
14
+ gapSize = _ref$gapSize === void 0 ? DEFAULT_GAP_SIZE : _ref$gapSize,
8
15
  _ref$contentAlign = _ref.contentAlign,
9
- contentAlign = _ref$contentAlign === void 0 ? 'right' : _ref$contentAlign;
10
- return /*#__PURE__*/React.createElement(S.ActionCell, {
16
+ contentAlign = _ref$contentAlign === void 0 ? 'right' : _ref$contentAlign,
17
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
18
+
19
+ return /*#__PURE__*/React.createElement(S.ActionCell, _extends({
11
20
  gapSize: gapSize,
12
21
  contentAlign: contentAlign
13
- }, children);
22
+ }, htmlAttributes), children);
14
23
  };
15
24
 
16
25
  export default React.memo(ActionCell);
@@ -1,7 +1,12 @@
1
- import * as React from 'react';
1
+ import { ReactNode } from 'react';
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
2
3
  export type ContentAlign = 'left' | 'right' | 'center';
3
- export interface Props {
4
- children: React.ReactNode | React.ReactNode[];
4
+ export type ActionCellProps = WithHTMLAttributes<HTMLDivElement, {
5
+ children: ReactNode | ReactNode[];
5
6
  gapSize?: number;
6
7
  contentAlign?: ContentAlign;
7
- }
8
+ }>;
9
+ /**
10
+ * @deprecated
11
+ */
12
+ export type Props = ActionCellProps;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { AvatarLabelProps } from './AvatarLabel.types';
3
- declare const AvatarLabel: ({ avatar, avatarAction, avatarLink, title, labels, icon, ellipsis, maxWidth, avatarSize, loader, }: AvatarLabelProps) => React.JSX.Element;
3
+ declare const AvatarLabel: ({ avatar, avatarAction, avatarLink, title, labels, icon, ellipsis, maxWidth, avatarSize, loader, ...htmlAttributes }: AvatarLabelProps) => React.JSX.Element;
4
4
  export default AvatarLabel;
@@ -1,5 +1,9 @@
1
+ var _excluded = ["avatar", "avatarAction", "avatarLink", "title", "labels", "icon", "ellipsis", "maxWidth", "avatarSize", "loader"];
2
+
1
3
  function _extends() { _extends = Object.assign || 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); }
2
4
 
5
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
+
3
7
  import React from 'react';
4
8
  import { v4 as uuid } from 'uuid';
5
9
  import * as S from './AvatarLabel.styles';
@@ -14,7 +18,9 @@ var AvatarLabel = function AvatarLabel(_ref) {
14
18
  ellipsis = _ref.ellipsis,
15
19
  maxWidth = _ref.maxWidth,
16
20
  avatarSize = _ref.avatarSize,
17
- loader = _ref.loader;
21
+ loader = _ref.loader,
22
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
23
+
18
24
  var titleEllipsisProps = ellipsis ? {
19
25
  ellipsis: {
20
26
  tooltip: title
@@ -43,9 +49,9 @@ var AvatarLabel = function AvatarLabel(_ref) {
43
49
  key: uuid()
44
50
  }, label);
45
51
  })), loader && /*#__PURE__*/React.createElement(S.Loader, null, loader)));
46
- return /*#__PURE__*/React.createElement(S.AvatarLabel, {
52
+ return /*#__PURE__*/React.createElement(S.AvatarLabel, _extends({}, htmlAttributes, {
47
53
  onClick: avatarAction
48
- }, avatarLink ? /*#__PURE__*/React.createElement(S.AvatarLink, {
54
+ }), avatarLink ? /*#__PURE__*/React.createElement(S.AvatarLink, {
49
55
  href: avatarLink,
50
56
  onClick: handleLinkClick
51
57
  }, cellContent) : cellContent);
@@ -1,5 +1,6 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- export type AvatarLabelProps = {
2
+ import type { WithHTMLAttributes } from '@synerise/ds-utils';
3
+ export type AvatarLabelProps = WithHTMLAttributes<HTMLDivElement, {
3
4
  avatar: ReactElement;
4
5
  avatarAction?: () => void;
5
6
  avatarLink?: string;
@@ -11,5 +12,8 @@ export type AvatarLabelProps = {
11
12
  maxWidth?: number;
12
13
  avatarSize?: string | 'large';
13
14
  loader?: ReactElement;
14
- };
15
+ }>;
16
+ /**
17
+ * @deprecated
18
+ */
15
19
  export type Props = AvatarLabelProps;
@@ -1,5 +1,10 @@
1
- export interface Props {
1
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
2
+ export type CopyableCellProps = WithHTMLAttributes<HTMLDivElement, {
2
3
  value: string;
3
4
  confirmMessage: string;
4
5
  tooltipTimeout: number;
5
- }
6
+ }>;
7
+ /**
8
+ * @deprecated
9
+ */
10
+ export type Props = CopyableCellProps;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
- import { Props } from './Copyable.types';
3
- declare const CopyableCell: React.FC<Props>;
1
+ import React from 'react';
2
+ import { CopyableCellProps } from './Copyable.types';
3
+ declare const CopyableCell: ({ value, confirmMessage, tooltipTimeout, ...htmlAttributes }: CopyableCellProps) => React.JSX.Element;
4
4
  export default CopyableCell;
@@ -1,20 +1,26 @@
1
- import * as React from 'react';
1
+ var _excluded = ["value", "confirmMessage", "tooltipTimeout"];
2
+
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+
5
+ import React, { useState, useCallback, useEffect } from 'react';
2
6
  import * as copy from 'copy-to-clipboard';
3
7
  import Icon, { CopyClipboardM } from '@synerise/ds-icon';
4
8
  import Tooltip from '@synerise/ds-tooltip';
5
9
  import * as S from './Copyable.styles';
10
+ var DEFAULT_TIMEOUT = 2000;
6
11
 
7
12
  var CopyableCell = function CopyableCell(_ref) {
8
13
  var value = _ref.value,
9
14
  confirmMessage = _ref.confirmMessage,
10
15
  _ref$tooltipTimeout = _ref.tooltipTimeout,
11
- tooltipTimeout = _ref$tooltipTimeout === void 0 ? 2000 : _ref$tooltipTimeout;
16
+ tooltipTimeout = _ref$tooltipTimeout === void 0 ? DEFAULT_TIMEOUT : _ref$tooltipTimeout,
17
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
12
18
 
13
- var _React$useState = React.useState(false),
14
- tooltipVisible = _React$useState[0],
15
- setTooltipVisible = _React$useState[1];
19
+ var _useState = useState(false),
20
+ tooltipVisible = _useState[0],
21
+ setTooltipVisible = _useState[1];
16
22
 
17
- React.useEffect(function () {
23
+ useEffect(function () {
18
24
  var timer = setTimeout(function () {
19
25
  setTooltipVisible(false);
20
26
  }, tooltipTimeout);
@@ -22,10 +28,10 @@ var CopyableCell = function CopyableCell(_ref) {
22
28
  return clearTimeout(timer);
23
29
  };
24
30
  }, [tooltipVisible, setTooltipVisible, tooltipTimeout]);
25
- var handleCopy = React.useCallback(function () {
31
+ var handleCopy = useCallback(function () {
26
32
  if (copy(value)) setTooltipVisible(true);
27
33
  }, [value]);
28
- return /*#__PURE__*/React.createElement(S.Copyable, null, /*#__PURE__*/React.createElement("span", null, value), /*#__PURE__*/React.createElement(Tooltip, {
34
+ return /*#__PURE__*/React.createElement(S.Copyable, htmlAttributes, /*#__PURE__*/React.createElement("span", null, value), /*#__PURE__*/React.createElement(Tooltip, {
29
35
  visible: tooltipVisible,
30
36
  title: confirmMessage,
31
37
  placement: "left"
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
- import { Props } from './EditableCell.types';
3
- declare const EditableCell: React.FC<Props>;
1
+ import React from 'react';
2
+ import { EditableCellProps } from './EditableCell.types';
3
+ declare const EditableCell: ({ value, onChange, placeholder, ...htmlAttributes }: EditableCellProps) => React.JSX.Element;
4
4
  export default EditableCell;
@@ -1,4 +1,8 @@
1
- import * as React from 'react';
1
+ var _excluded = ["value", "onChange", "placeholder"];
2
+
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+
5
+ import React, { useMemo, useCallback, useState } from 'react';
2
6
  import Icon, { EditNolineS } from '@synerise/ds-icon';
3
7
  import { Input } from '@synerise/ds-input';
4
8
  import * as S from './EditableCell.styles';
@@ -6,20 +10,21 @@ import * as S from './EditableCell.styles';
6
10
  var EditableCell = function EditableCell(_ref) {
7
11
  var value = _ref.value,
8
12
  onChange = _ref.onChange,
9
- placeholder = _ref.placeholder;
13
+ placeholder = _ref.placeholder,
14
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
10
15
 
11
- var _React$useState = React.useState(false),
12
- editMode = _React$useState[0],
13
- setEditMode = _React$useState[1];
16
+ var _useState = useState(false),
17
+ editMode = _useState[0],
18
+ setEditMode = _useState[1];
14
19
 
15
- var _React$useState2 = React.useState(value || ''),
16
- editValue = _React$useState2[0],
17
- setEditValue = _React$useState2[1];
20
+ var _useState2 = useState(value || ''),
21
+ editValue = _useState2[0],
22
+ setEditValue = _useState2[1];
18
23
 
19
- var enterEditMode = React.useCallback(function () {
24
+ var enterEditMode = useCallback(function () {
20
25
  setEditMode(true);
21
26
  }, [setEditMode]);
22
- var render = React.useMemo(function () {
27
+ var render = useMemo(function () {
23
28
  return editMode ?
24
29
  /*#__PURE__*/
25
30
  // eslint-disable-next-line react/jsx-handler-names
@@ -42,7 +47,7 @@ var EditableCell = function EditableCell(_ref) {
42
47
  component: /*#__PURE__*/React.createElement(EditNolineS, null)
43
48
  }));
44
49
  }, [editMode, value, enterEditMode, editValue, setEditValue, onChange, placeholder]);
45
- return /*#__PURE__*/React.createElement(S.EditableCell, null, render);
50
+ return /*#__PURE__*/React.createElement(S.EditableCell, htmlAttributes, render);
46
51
  };
47
52
 
48
53
  export default EditableCell;
@@ -1,5 +1,10 @@
1
- export interface Props {
2
- value: string | undefined;
1
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
2
+ export type EditableCellProps = WithHTMLAttributes<HTMLDivElement, {
3
+ value?: string;
3
4
  onChange: (newValue: string) => void;
4
5
  placeholder?: string;
5
- }
6
+ }>;
7
+ /**
8
+ * @deprecated
9
+ */
10
+ export type Props = EditableCellProps;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
- import { Props } from './FlagLabelCell.types';
3
- declare const FlagLabelCell: React.FC<Props>;
1
+ import React from 'react';
2
+ import { FlagLabelProps } from './FlagLabelCell.types';
3
+ declare const FlagLabelCell: ({ countryCode, label, ...htmlAttributes }: FlagLabelProps) => React.JSX.Element;
4
4
  export default FlagLabelCell;
@@ -1,11 +1,17 @@
1
+ var _excluded = ["countryCode", "label"];
2
+
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+
5
+ import React from 'react';
1
6
  import DSFlag from '@synerise/ds-flag';
2
- import * as React from 'react';
3
7
  import * as S from './FlagLabelCell.styles';
4
8
 
5
9
  var FlagLabelCell = function FlagLabelCell(_ref) {
6
10
  var countryCode = _ref.countryCode,
7
- label = _ref.label;
8
- return /*#__PURE__*/React.createElement(S.FlagLabel, null, /*#__PURE__*/React.createElement(DSFlag, {
11
+ label = _ref.label,
12
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
13
+
14
+ return /*#__PURE__*/React.createElement(S.FlagLabel, htmlAttributes, /*#__PURE__*/React.createElement(DSFlag, {
9
15
  country: countryCode,
10
16
  size: 20
11
17
  }), /*#__PURE__*/React.createElement("span", null, label));
@@ -1,5 +1,10 @@
1
1
  import { CountryCode } from '@synerise/ds-flag/dist/Flag.types';
2
- export interface Props {
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
3
+ export type FlagLabelProps = WithHTMLAttributes<HTMLDivElement, {
3
4
  countryCode: CountryCode;
4
5
  label: string;
5
- }
6
+ }>;
7
+ /**
8
+ * @deprecated
9
+ */
10
+ export type Props = FlagLabelProps;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
- import { Props } from './IconLabel.types';
3
- declare const IconLabelCell: React.FC<Props>;
1
+ import React from 'react';
2
+ import { IconLabelProps } from './IconLabel.types';
3
+ declare const IconLabelCell: ({ label, icon, ...htmlAttributes }: IconLabelProps) => React.JSX.Element;
4
4
  export default IconLabelCell;
@@ -1,11 +1,17 @@
1
- import * as React from 'react';
1
+ var _excluded = ["label", "icon"];
2
+
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+
5
+ import React from 'react';
2
6
  import Icon from '@synerise/ds-icon';
3
7
  import * as S from './IconLabel.styles';
4
8
 
5
9
  var IconLabelCell = function IconLabelCell(_ref) {
6
10
  var label = _ref.label,
7
- icon = _ref.icon;
8
- return /*#__PURE__*/React.createElement(S.IconLabelCell, null, /*#__PURE__*/React.createElement(Icon, icon), /*#__PURE__*/React.createElement("span", null, label));
11
+ icon = _ref.icon,
12
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
13
+
14
+ return /*#__PURE__*/React.createElement(S.IconLabelCell, htmlAttributes, /*#__PURE__*/React.createElement(Icon, icon), /*#__PURE__*/React.createElement("span", null, label));
9
15
  };
10
16
 
11
17
  export default IconLabelCell;
@@ -1,5 +1,10 @@
1
1
  import { IconProps } from '@synerise/ds-icon';
2
- export interface Props {
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
3
+ export type IconLabelProps = WithHTMLAttributes<HTMLDivElement, {
3
4
  label: string;
4
5
  icon: IconProps;
5
- }
6
+ }>;
7
+ /**
8
+ * @deprecated
9
+ */
10
+ export type Props = IconLabelProps;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
- import { Props } from './IconTooltipCell.types';
3
- declare const IconTooltipCell: React.FC<Props>;
1
+ import React from 'react';
2
+ import { IconTooltipCellProps } from './IconTooltipCell.types';
3
+ declare const IconTooltipCell: ({ label, icon, tooltip, tooltipIcon, ...htmlAttributes }: IconTooltipCellProps) => React.JSX.Element;
4
4
  export default IconTooltipCell;
@@ -1,6 +1,10 @@
1
+ var _excluded = ["label", "icon", "tooltip", "tooltipIcon"];
2
+
1
3
  function _extends() { _extends = Object.assign || 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); }
2
4
 
3
- import * as React from 'react';
5
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
+
7
+ import React from 'react';
4
8
  import Icon from '@synerise/ds-icon';
5
9
  import Tooltip from '@synerise/ds-tooltip';
6
10
  import * as S from './IconTooltipCell.styles';
@@ -12,8 +16,10 @@ var IconTooltipCell = function IconTooltipCell(_ref) {
12
16
  _ref$tooltip = _ref.tooltip,
13
17
  tooltip = _ref$tooltip === void 0 ? {} : _ref$tooltip,
14
18
  _ref$tooltipIcon = _ref.tooltipIcon,
15
- tooltipIcon = _ref$tooltipIcon === void 0 ? {} : _ref$tooltipIcon;
16
- return /*#__PURE__*/React.createElement(S.IconTooltipCell, null, !!icon && /*#__PURE__*/React.createElement(Icon, _extends({
19
+ tooltipIcon = _ref$tooltipIcon === void 0 ? {} : _ref$tooltipIcon,
20
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
21
+
22
+ return /*#__PURE__*/React.createElement(S.IconTooltipCell, htmlAttributes, !!icon && /*#__PURE__*/React.createElement(Icon, _extends({
17
23
  className: "main-icon"
18
24
  }, icon)), !!label && /*#__PURE__*/React.createElement(S.Label, null, label), tooltipIcon && /*#__PURE__*/React.createElement(Tooltip, tooltip, /*#__PURE__*/React.createElement(Icon, _extends({
19
25
  className: "tooltip-icon"
@@ -1,9 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import { IconProps } from '@synerise/ds-icon';
3
3
  import TooltipExtendedProps from '@synerise/ds-tooltip/dist/Tooltip.types';
4
- export interface Props {
4
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
5
+ export type IconTooltipCellProps = WithHTMLAttributes<HTMLDivElement, {
5
6
  label?: React.ReactNode;
6
7
  icon?: IconProps;
7
8
  tooltipIcon?: IconProps;
8
9
  tooltip?: TooltipExtendedProps;
9
- }
10
+ }>;
11
+ /**
12
+ * @deprecated
13
+ */
14
+ export type Props = IconTooltipCellProps;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { Props } from './LabelsWithShowMore.types';
1
+ import React from 'react';
2
+ import { LabelsWithShowMoreProps } from './LabelsWithShowMore.types';
3
3
  import { DataSourceType } from './Modal/Modal.types';
4
- declare const LabelsWithShowMore: React.FC<Props<DataSourceType>>;
4
+ declare const LabelsWithShowMore: ({ items, numberOfVisibleItems, renderItem, labelKey, texts, loading, ...htmlAttributes }: LabelsWithShowMoreProps<DataSourceType>) => React.JSX.Element;
5
5
  export default LabelsWithShowMore;
@@ -1,4 +1,8 @@
1
- import * as React from 'react';
1
+ var _excluded = ["items", "numberOfVisibleItems", "renderItem", "labelKey", "texts", "loading"];
2
+
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+
5
+ import React, { useState, useMemo } from 'react';
2
6
  import Tooltip from '@synerise/ds-tooltip';
3
7
  import * as S from './LabelsWithShowMore.styles';
4
8
  import DetailsModal from './Modal/Modal';
@@ -9,21 +13,22 @@ var LabelsWithShowMore = function LabelsWithShowMore(_ref) {
9
13
  renderItem = _ref.renderItem,
10
14
  labelKey = _ref.labelKey,
11
15
  texts = _ref.texts,
12
- loading = _ref.loading;
16
+ loading = _ref.loading,
17
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
13
18
 
14
- var _React$useState = React.useState(false),
15
- modalVisible = _React$useState[0],
16
- setModalVisible = _React$useState[1];
19
+ var _useState = useState(false),
20
+ modalVisible = _useState[0],
21
+ setModalVisible = _useState[1];
17
22
 
18
- var diff = React.useMemo(function () {
23
+ var diff = useMemo(function () {
19
24
  return items.length - numberOfVisibleItems;
20
25
  }, [items, numberOfVisibleItems]);
21
- var labels = React.useMemo(function () {
26
+ var labels = useMemo(function () {
22
27
  return items.slice(0, numberOfVisibleItems).map(function (item) {
23
28
  return item[labelKey];
24
29
  }).join(', ');
25
30
  }, [items, labelKey, numberOfVisibleItems]);
26
- return /*#__PURE__*/React.createElement(S.CellWrapper, null, /*#__PURE__*/React.createElement(S.Labels, null, labels), diff > 0 && /*#__PURE__*/React.createElement(Tooltip, {
31
+ return /*#__PURE__*/React.createElement(S.CellWrapper, htmlAttributes, /*#__PURE__*/React.createElement(S.Labels, null, labels), diff > 0 && /*#__PURE__*/React.createElement(Tooltip, {
27
32
  title: "" + texts.tooltip
28
33
  }, /*#__PURE__*/React.createElement(S.MoreInfo, {
29
34
  onClick: function onClick() {
@@ -1,16 +1,21 @@
1
- import * as React from 'react';
1
+ import { ReactNode, Component } from 'react';
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
2
3
  export type ShowMoreTexts = {
3
- tooltip: string | React.ReactNode;
4
+ tooltip: ReactNode;
4
5
  searchPlaceholder: string;
5
6
  searchClear: string;
6
- modalTitle: string | React.ReactNode;
7
- records: string | React.ReactNode;
7
+ modalTitle: ReactNode;
8
+ records: ReactNode;
8
9
  };
9
- export type Props<T extends object> = {
10
+ export type LabelsWithShowMoreProps<T extends object> = WithHTMLAttributes<HTMLDivElement, {
10
11
  items: T[];
11
12
  numberOfVisibleItems: number;
12
13
  labelKey: string;
13
- renderItem: (label: string, item: T) => JSX.Element | React.Component;
14
+ renderItem: (label: string, item: T) => JSX.Element | Component;
14
15
  texts: ShowMoreTexts;
15
16
  loading?: boolean;
16
- };
17
+ }>;
18
+ /**
19
+ * @deprecated
20
+ */
21
+ export type Props<T extends object> = LabelsWithShowMoreProps<T>;