@dhis2-ui/table 7.2.6 → 7.2.7

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.
@@ -36,11 +36,10 @@ describe('<DataTableColumnHeader>', () => {
36
36
  expect(wrapper.find(_index.TableHeaderCell).prop('align')).toBe(right);
37
37
  });
38
38
  it('accepts a className prop', () => {
39
- const className = 'test';
40
39
  const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_dataTableColumnHeader.DataTableColumnHeader, {
41
- className: className
40
+ className: "test"
42
41
  }));
43
- expect(wrapper.find(_index.TableHeaderCell).prop('className')).toBe(className);
42
+ expect(wrapper.find(_index.TableHeaderCell).prop('className')).toBe('test DataTableColumnHeader');
44
43
  });
45
44
  it('accepts a colSpan prop', () => {
46
45
  const colSpan = '3';
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _index = require("../table-elements/index.js");
19
19
 
20
- var _dataTableColumnHeaderStyles = _interopRequireDefault(require("./data-table-column-header.styles.js"));
20
+ var _dataTableColumnHeaderStyles = require("./data-table-column-header.styles.js");
21
21
 
22
22
  var _filterHandle = require("./filter-handle.js");
23
23
 
@@ -56,7 +56,7 @@ const DataTableColumnHeader = /*#__PURE__*/(0, _react.forwardRef)(({
56
56
  onSortIconClick
57
57
  }, ref) => /*#__PURE__*/_react.default.createElement(_index.TableHeaderCell, {
58
58
  align: align,
59
- className: className,
59
+ className: (0, _classnames.default)(className, 'DataTableColumnHeader', _dataTableColumnHeaderStyles.resolvedTableHeaderCss.className),
60
60
  colSpan: colSpan,
61
61
  dataTest: dataTest,
62
62
  fixed: fixed,
@@ -69,14 +69,14 @@ const DataTableColumnHeader = /*#__PURE__*/(0, _react.forwardRef)(({
69
69
  top: top,
70
70
  width: width
71
71
  }, /*#__PURE__*/_react.default.createElement("span", {
72
- className: "jsx-3463223249 " + `jsx-${_dataTableColumnHeaderStyles.default.__hash}` + " " + ((0, _classnames.default)('container', {
73
- showFilter
74
- }) || "")
72
+ className: "jsx-3463223249 " + `jsx-${_dataTableColumnHeaderStyles.styles.__hash}` + " " + "container"
75
73
  }, /*#__PURE__*/_react.default.createElement("span", {
76
- className: "jsx-3463223249 " + `jsx-${_dataTableColumnHeaderStyles.default.__hash}` + " " + ((0, _classnames.default)('top', {
74
+ className: "jsx-3463223249 " + `jsx-${_dataTableColumnHeaderStyles.styles.__hash}` + " " + ((0, _classnames.default)('top', {
77
75
  large
78
76
  }) || "")
79
- }, children, sortDirection && /*#__PURE__*/_react.default.createElement(_sorter.Sorter, {
77
+ }, /*#__PURE__*/_react.default.createElement("span", {
78
+ className: "jsx-3463223249 " + `jsx-${_dataTableColumnHeaderStyles.styles.__hash}` + " " + "content"
79
+ }, children), sortDirection && /*#__PURE__*/_react.default.createElement(_sorter.Sorter, {
80
80
  name: name,
81
81
  sortDirection: sortDirection,
82
82
  onClick: onSortIconClick
@@ -84,9 +84,9 @@ const DataTableColumnHeader = /*#__PURE__*/(0, _react.forwardRef)(({
84
84
  name: name,
85
85
  active: showFilter,
86
86
  onClick: onFilterIconClick
87
- })), showFilter && filter), /*#__PURE__*/_react.default.createElement(_style.default, {
88
- id: _dataTableColumnHeaderStyles.default.__hash
89
- }, _dataTableColumnHeaderStyles.default), /*#__PURE__*/_react.default.createElement(_style.default, {
87
+ })), showFilter && filter), _dataTableColumnHeaderStyles.resolvedTableHeaderCss.styles, /*#__PURE__*/_react.default.createElement(_style.default, {
88
+ id: _dataTableColumnHeaderStyles.styles.__hash
89
+ }, _dataTableColumnHeaderStyles.styles), /*#__PURE__*/_react.default.createElement(_style.default, {
90
90
  id: "3463223249"
91
91
  }, [`.label.jsx-3463223249{-webkit-box-pack:${flexboxAlignLookup[align]};-webkit-justify-content:${flexboxAlignLookup[align]};-ms-flex-pack:${flexboxAlignLookup[align]};justify-content:${flexboxAlignLookup[align]};}`])));
92
92
  exports.DataTableColumnHeader = DataTableColumnHeader;
@@ -3,11 +3,21 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.resolvedTableHeaderCss = exports.styles = void 0;
7
7
 
8
- var _uiConstants = require("@dhis2/ui-constants");
8
+ var _style = _interopRequireDefault(require("styled-jsx/style"));
9
9
 
10
- const _defaultExport = ["span.container.jsx-2694284040{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%;}", `span.showFilter.jsx-2694284040{padding-bottom:${_uiConstants.spacers.dp4};}`, "span.top.jsx-2694284040{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:36px;}", "span.top.large.jsx-2694284040{height:48px;}"];
11
- _defaultExport.__hash = "2694284040";
12
- var _default = _defaultExport;
13
- exports.default = _default;
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const styles = ["span.container.jsx-1552921066{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%;}", "span.top.jsx-1552921066{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}", "span.content.jsx-1552921066{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:24px;}"];
15
+ exports.styles = styles;
16
+ styles.__hash = "1552921066";
17
+ const resolvedTableHeaderCss = {
18
+ styles: /*#__PURE__*/_react.default.createElement(_style.default, {
19
+ id: "1231353820"
20
+ }, ["thead>tr>th.DataTableColumnHeader.jsx-1231353820{padding-top:6px;padding-bottom:6px;}", "thead>tr>th.DataTableColumnHeader.large.jsx-1231353820{padding-top:12px;padding-bottom:12px;}"]),
21
+ className: "jsx-1231353820"
22
+ };
23
+ exports.resolvedTableHeaderCss = resolvedTableHeaderCss;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.InlineFiltering = exports.ColumnHeaderSorting = exports.ScrollingDataTableWithToolbars = exports.FixedHeaderAndTwoColumns = exports.FixedFirstColumn = exports.FixedHeader = exports.SelectableRows = exports.ExpandableContent = exports.Toolbars = exports.CellStyling = exports.DraggableRows = exports.LargeCells = exports.BorderedCells = exports.Default = exports.default = void 0;
6
+ exports.LongCellContentLargeCells = exports.LongCellContent = exports.InlineFiltering = exports.ColumnHeaderSorting = exports.ScrollingDataTableWithToolbars = exports.FixedHeaderAndTwoColumns = exports.FixedFirstColumn = exports.FixedHeader = exports.SelectableRows = exports.ExpandableContent = exports.Toolbars = exports.CellStyling = exports.DraggableRows = exports.LargeCells = exports.BorderedCells = exports.Default = exports.default = void 0;
7
7
 
8
8
  var _box = require("@dhis2-ui/box");
9
9
 
@@ -755,4 +755,50 @@ const InlineFiltering = InlineFilteringTemplate.bind({});
755
755
  exports.InlineFiltering = InlineFiltering;
756
756
  InlineFiltering.args = {
757
757
  layout: 'fixed'
758
+ };
759
+
760
+ const LongCellContentTemplate = ({
761
+ large
762
+ }) => /*#__PURE__*/_react.default.createElement(_dataTable.DataTable, null, /*#__PURE__*/_react.default.createElement(_dataTableHead.DataTableHead, null, /*#__PURE__*/_react.default.createElement(_dataTableRow.DataTableRow, null, /*#__PURE__*/_react.default.createElement(_dataTableColumnHeader.DataTableColumnHeader, {
763
+ large: large,
764
+ onSortIconClick: () => {},
765
+ sortDirection: "asc",
766
+ name: "first"
767
+ }, "FIRST - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/_react.default.createElement(_dataTableColumnHeader.DataTableColumnHeader, {
768
+ large: large,
769
+ onFilterIconClick: () => {},
770
+ name: "firstName",
771
+ showFilter: true,
772
+ filter: /*#__PURE__*/_react.default.createElement(_input.Input, {
773
+ dense: true,
774
+ onChange: () => {},
775
+ name: "firstName",
776
+ value: "Filter value"
777
+ })
778
+ }, "SECOND - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/_react.default.createElement(_dataTableColumnHeader.DataTableColumnHeader, {
779
+ large: large,
780
+ onSortIconClick: () => {},
781
+ sortDirection: "asc",
782
+ name: "third"
783
+ }, "Third (short)"), /*#__PURE__*/_react.default.createElement(_dataTableColumnHeader.DataTableColumnHeader, {
784
+ large: large,
785
+ onSortIconClick: () => {},
786
+ sortDirection: "asc",
787
+ name: "fourth"
788
+ }, "Fourth - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"))), /*#__PURE__*/_react.default.createElement(_dataTableBody.DataTableBody, null, /*#__PURE__*/_react.default.createElement(_dataTableRow.DataTableRow, null, /*#__PURE__*/_react.default.createElement(_dataTableCell.DataTableCell, {
789
+ large: large
790
+ }, "FIRST - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/_react.default.createElement(_dataTableCell.DataTableCell, {
791
+ large: large
792
+ }, "SECOND - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/_react.default.createElement(_dataTableCell.DataTableCell, {
793
+ large: large
794
+ }, "Third (short)"), /*#__PURE__*/_react.default.createElement(_dataTableCell.DataTableCell, {
795
+ large: large
796
+ }, "Fourth - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"))));
797
+
798
+ const LongCellContent = LongCellContentTemplate.bind({});
799
+ exports.LongCellContent = LongCellContent;
800
+ const LongCellContentLargeCells = LongCellContentTemplate.bind({});
801
+ exports.LongCellContentLargeCells = LongCellContentLargeCells;
802
+ LongCellContentLargeCells.args = {
803
+ large: 'true'
758
804
  };
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
10
- const _defaultExport = [`td.jsx-773314984{padding:0 12px;font-size:14px;border:1px solid transparant;border-bottom:1px solid ${_uiConstants.colors.grey300};background-color:${_uiConstants.colors.white};color:${_uiConstants.colors.grey900};height:45px;}`, `td.active.jsx-773314984{background-color:${_uiConstants.colors.white};outline:2px solid ${_uiConstants.colors.grey600};outline-offset:-2px;}`, `td.bordered.jsx-773314984{border-right:1px solid ${_uiConstants.colors.grey300};}`, "td.bordered.jsx-773314984:last-child{border-right:1px solid transparent;}", `td.error.jsx-773314984{color:${_uiConstants.colors.red700};}`, `td.muted.jsx-773314984{color:${_uiConstants.colors.grey700};font-style:italic;}`, `td.valid.jsx-773314984{color:${_uiConstants.colors.green700};}`, "td.large.jsx-773314984{font-size:16px;height:60px;}", "tr:last-child td.jsx-773314984{border-bottom:1px solid transparent;}", `tfoot tr:first-child td.jsx-773314984{border-top:1px solid ${_uiConstants.colors.grey300};}`, `tr.selected>td.jsx-773314984{background-color:${_uiConstants.colors.teal100};}`, `tr:hover>td.jsx-773314984:not(.staticStyle){background-color:${_uiConstants.colors.grey100};}`, `tr:active>td.jsx-773314984:not(.staticStyle){background-color:${_uiConstants.colors.grey200};}`, "tr.selected:hover>td.jsx-773314984:not(.staticStyle){background-color:#cdeae8;}"];
11
- _defaultExport.__hash = "773314984";
10
+ const _defaultExport = [`td.jsx-1115472719{padding:14px 12px;font-size:14px;border:1px solid transparant;border-bottom:1px solid ${_uiConstants.colors.grey300};background-color:${_uiConstants.colors.white};color:${_uiConstants.colors.grey900};}`, `td.active.jsx-1115472719{background-color:${_uiConstants.colors.white};outline:2px solid ${_uiConstants.colors.grey600};outline-offset:-2px;}`, `td.bordered.jsx-1115472719{border-right:1px solid ${_uiConstants.colors.grey300};}`, "td.bordered.jsx-1115472719:last-child{border-right:1px solid transparent;}", `td.error.jsx-1115472719{color:${_uiConstants.colors.red700};}`, `td.muted.jsx-1115472719{color:${_uiConstants.colors.grey700};font-style:italic;}`, `td.valid.jsx-1115472719{color:${_uiConstants.colors.green700};}`, "td.large.jsx-1115472719{padding:20px 12px;font-size:16px;}", "tr:last-child td.jsx-1115472719{border-bottom:1px solid transparent;}", `tfoot tr:first-child td.jsx-1115472719{border-top:1px solid ${_uiConstants.colors.grey300};}`, `tr.selected>td.jsx-1115472719{background-color:${_uiConstants.colors.teal100};}`, `tr:hover>td.jsx-1115472719:not(.staticStyle){background-color:${_uiConstants.colors.grey100};}`, `tr:active>td.jsx-1115472719:not(.staticStyle){background-color:${_uiConstants.colors.grey200};}`, "tr.selected:hover>td.jsx-1115472719:not(.staticStyle){background-color:#cdeae8;}"];
11
+ _defaultExport.__hash = "1115472719";
12
12
  var _default = _defaultExport;
13
13
  exports.default = _default;
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
10
- const _defaultExport = [`th.jsx-4210860585{padding:0 12px;border:1px solid transparant;border-bottom:1px solid ${_uiConstants.colors.grey300};color:${_uiConstants.colors.grey800};background-color:${_uiConstants.colors.grey200};font-weight:normal;font-size:14px;height:45px;}`, "thead th.jsx-4210860585{font-size:13px;height:36px;}", `th.jsx-4210860585:last-of-type{border-right:1px solid ${_uiConstants.colors.grey300};}`, `th.active.jsx-4210860585{background-color:${_uiConstants.colors.white};outline:2px solid ${_uiConstants.colors.grey600};outline-offset:-2px;}`, `th.bordered.jsx-4210860585{border-right:1px solid ${_uiConstants.colors.grey300};}`, "th.bordered.jsx-4210860585:last-child{border-right:1px solid transparent;}", `th.error.jsx-4210860585{color:${_uiConstants.colors.red700};}`, `th.muted.jsx-4210860585{color:${_uiConstants.colors.grey700};font-style:italic;}`, `th.valid.jsx-4210860585{color:${_uiConstants.colors.green700};}`, "th.large.jsx-4210860585{font-size:16px;height:60px;}", "thead th.large.jsx-4210860585{font-size:15px;height:48px;}", "th.fixed.jsx-4210860585{position:-webkit-sticky;position:sticky;z-index:1;}", "thead th.fixed.jsx-4210860585{position:-webkit-sticky;position:sticky;z-index:2;}", `thead th.fixedHorizontally.jsx-4210860585{z-index:3;background-color:${_uiConstants.colors.grey300};}`, "tr:last-child th.jsx-4210860585{border-bottom:1px solid transparent;}", `thead tr:last-child th.jsx-4210860585{border-bottom:1px solid ${_uiConstants.colors.grey300};}`, `tbody>tr:hover>th.jsx-4210860585:not(.staticStyle),tfoot>tr:hover>th.jsx-4210860585:not(.staticStyle){background-color:${_uiConstants.colors.grey300};}`, `tbody>tr:active>th.jsx-4210860585:not(.staticStyle){background-color:${_uiConstants.colors.grey200};}`, `tfoot>tr:first-child th.jsx-4210860585{border-top:1px solid ${_uiConstants.colors.grey300};}`];
11
- _defaultExport.__hash = "4210860585";
10
+ const _defaultExport = [`th.jsx-3777082606{padding:12px;border:1px solid transparant;border-bottom:1px solid ${_uiConstants.colors.grey300};color:${_uiConstants.colors.grey800};background-color:${_uiConstants.colors.grey200};font-weight:normal;font-size:14px;vertical-align:top;}`, "thead th.jsx-3777082606{padding:8px 12px;font-size:13px;}", `th.jsx-3777082606:last-of-type{border-right:1px solid ${_uiConstants.colors.grey300};}`, `th.active.jsx-3777082606{background-color:${_uiConstants.colors.white};outline:2px solid ${_uiConstants.colors.grey600};outline-offset:-2px;}`, `th.bordered.jsx-3777082606{border-right:1px solid ${_uiConstants.colors.grey300};}`, "th.bordered.jsx-3777082606:last-child{border-right:1px solid transparent;}", `th.error.jsx-3777082606{color:${_uiConstants.colors.red700};}`, `th.muted.jsx-3777082606{color:${_uiConstants.colors.grey700};font-style:italic;}`, `th.valid.jsx-3777082606{color:${_uiConstants.colors.green700};}`, "th.large.jsx-3777082606{padding:14px 12px;font-size:16px;}", "thead th.large.jsx-3777082606{padding:13px 12px;font-size:15px;}", "th.fixed.jsx-3777082606{position:-webkit-sticky;position:sticky;z-index:1;}", "thead th.fixed.jsx-3777082606{position:-webkit-sticky;position:sticky;z-index:2;}", `thead th.fixedHorizontally.jsx-3777082606{z-index:3;background-color:${_uiConstants.colors.grey300};}`, "tr:last-child th.jsx-3777082606{border-bottom:1px solid transparent;}", `thead tr:last-child th.jsx-3777082606{border-bottom:1px solid ${_uiConstants.colors.grey300};}`, `tbody>tr:hover>th.jsx-3777082606:not(.staticStyle),tfoot>tr:hover>th.jsx-3777082606:not(.staticStyle){background-color:${_uiConstants.colors.grey300};}`, `tbody>tr:active>th.jsx-3777082606:not(.staticStyle){background-color:${_uiConstants.colors.grey200};}`, `tfoot>tr:first-child th.jsx-3777082606{border-top:1px solid ${_uiConstants.colors.grey300};}`];
11
+ _defaultExport.__hash = "3777082606";
12
12
  var _default = _defaultExport;
13
13
  exports.default = _default;
@@ -33,11 +33,11 @@ const TableHeaderCellAction = /*#__PURE__*/(0, _react.forwardRef)(({
33
33
  onClick: onClick,
34
34
  title: title,
35
35
  ref: ref,
36
- className: _style.default.dynamic([["1702694916", [_uiConstants.colors.grey400]]]) + " " + (className || "")
36
+ className: _style.default.dynamic([["997535212", [_uiConstants.colors.grey400]]]) + " " + (className || "")
37
37
  }), children, /*#__PURE__*/_react.default.createElement(_style.default, {
38
- id: "1702694916",
38
+ id: "997535212",
39
39
  dynamic: [_uiConstants.colors.grey400]
40
- }, ["button.__jsx-style-dynamic-selector{border:none;padding:0;background:transparent;width:24px;height:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;cursor:pointer;}", `button.__jsx-style-dynamic-selector:hover,button.__jsx-style-dynamic-selector:focus-visible{background:${_uiConstants.colors.grey400};}`, "button.__jsx-style-dynamic-selector:active,button.__jsx-style-dynamic-selector:focus{outline:none;}"])));
40
+ }, ["button.__jsx-style-dynamic-selector{border:none;padding:0;background:transparent;width:24px;height:24px;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;cursor:pointer;border-radius:4px;margin-left:2px;}", `button.__jsx-style-dynamic-selector:hover,button.__jsx-style-dynamic-selector:focus-visible{background:${_uiConstants.colors.grey400};}`, "button.__jsx-style-dynamic-selector:active,button.__jsx-style-dynamic-selector:focus{outline:none;}"])));
41
41
  exports.TableHeaderCellAction = TableHeaderCellAction;
42
42
  TableHeaderCellAction.displayName = 'TableHeaderCellAction';
43
43
  TableHeaderCellAction.defaultProps = {
@@ -25,11 +25,10 @@ describe('<DataTableColumnHeader>', () => {
25
25
  expect(wrapper.find(TableHeaderCell).prop('align')).toBe(right);
26
26
  });
27
27
  it('accepts a className prop', () => {
28
- const className = 'test';
29
28
  const wrapper = shallow( /*#__PURE__*/React.createElement(DataTableColumnHeader, {
30
- className: className
29
+ className: "test"
31
30
  }));
32
- expect(wrapper.find(TableHeaderCell).prop('className')).toBe(className);
31
+ expect(wrapper.find(TableHeaderCell).prop('className')).toBe('test DataTableColumnHeader');
33
32
  });
34
33
  it('accepts a colSpan prop', () => {
35
34
  const colSpan = '3';
@@ -4,7 +4,7 @@ import cx from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import React, { forwardRef } from 'react';
6
6
  import { TableHeaderCell } from '../table-elements/index.js';
7
- import styles from './data-table-column-header.styles.js';
7
+ import { styles, resolvedTableHeaderCss } from './data-table-column-header.styles.js';
8
8
  import { FilterHandle } from './filter-handle.js';
9
9
  import { Sorter, SORT_DIRECTIONS } from './sorter.js';
10
10
  const flexboxAlignLookup = {
@@ -34,7 +34,7 @@ export const DataTableColumnHeader = /*#__PURE__*/forwardRef(({
34
34
  onSortIconClick
35
35
  }, ref) => /*#__PURE__*/React.createElement(TableHeaderCell, {
36
36
  align: align,
37
- className: className,
37
+ className: cx(className, 'DataTableColumnHeader', resolvedTableHeaderCss.className),
38
38
  colSpan: colSpan,
39
39
  dataTest: dataTest,
40
40
  fixed: fixed,
@@ -47,14 +47,14 @@ export const DataTableColumnHeader = /*#__PURE__*/forwardRef(({
47
47
  top: top,
48
48
  width: width
49
49
  }, /*#__PURE__*/React.createElement("span", {
50
- className: "jsx-3463223249 " + `jsx-${styles.__hash}` + " " + (cx('container', {
51
- showFilter
52
- }) || "")
50
+ className: "jsx-3463223249 " + `jsx-${styles.__hash}` + " " + "container"
53
51
  }, /*#__PURE__*/React.createElement("span", {
54
52
  className: "jsx-3463223249 " + `jsx-${styles.__hash}` + " " + (cx('top', {
55
53
  large
56
54
  }) || "")
57
- }, children, sortDirection && /*#__PURE__*/React.createElement(Sorter, {
55
+ }, /*#__PURE__*/React.createElement("span", {
56
+ className: "jsx-3463223249 " + `jsx-${styles.__hash}` + " " + "content"
57
+ }, children), sortDirection && /*#__PURE__*/React.createElement(Sorter, {
58
58
  name: name,
59
59
  sortDirection: sortDirection,
60
60
  onClick: onSortIconClick
@@ -62,7 +62,7 @@ export const DataTableColumnHeader = /*#__PURE__*/forwardRef(({
62
62
  name: name,
63
63
  active: showFilter,
64
64
  onClick: onFilterIconClick
65
- })), showFilter && filter), /*#__PURE__*/React.createElement(_JSXStyle, {
65
+ })), showFilter && filter), resolvedTableHeaderCss.styles, /*#__PURE__*/React.createElement(_JSXStyle, {
66
66
  id: styles.__hash
67
67
  }, styles), /*#__PURE__*/React.createElement(_JSXStyle, {
68
68
  id: "3463223249"
@@ -1,4 +1,10 @@
1
- import { spacers } from '@dhis2/ui-constants';
2
- const _defaultExport = ["span.container.jsx-2694284040{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%;}", `span.showFilter.jsx-2694284040{padding-bottom:${spacers.dp4};}`, "span.top.jsx-2694284040{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:36px;}", "span.top.large.jsx-2694284040{height:48px;}"];
3
- _defaultExport.__hash = "2694284040";
4
- export default _defaultExport;
1
+ import _JSXStyle from "styled-jsx/style";
2
+ import React from "react";
3
+ export const styles = ["span.container.jsx-1552921066{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%;}", "span.top.jsx-1552921066{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}", "span.content.jsx-1552921066{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:24px;}"];
4
+ styles.__hash = "1552921066";
5
+ export const resolvedTableHeaderCss = {
6
+ styles: /*#__PURE__*/React.createElement(_JSXStyle, {
7
+ id: "1231353820"
8
+ }, ["thead>tr>th.DataTableColumnHeader.jsx-1231353820{padding-top:6px;padding-bottom:6px;}", "thead>tr>th.DataTableColumnHeader.large.jsx-1231353820{padding-top:12px;padding-bottom:12px;}"]),
9
+ className: "jsx-1231353820"
10
+ };
@@ -715,4 +715,48 @@ const InlineFilteringTemplate = args => {
715
715
  export const InlineFiltering = InlineFilteringTemplate.bind({});
716
716
  InlineFiltering.args = {
717
717
  layout: 'fixed'
718
+ };
719
+
720
+ const LongCellContentTemplate = ({
721
+ large
722
+ }) => /*#__PURE__*/React.createElement(DataTable, null, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableColumnHeader, {
723
+ large: large,
724
+ onSortIconClick: () => {},
725
+ sortDirection: "asc",
726
+ name: "first"
727
+ }, "FIRST - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/React.createElement(DataTableColumnHeader, {
728
+ large: large,
729
+ onFilterIconClick: () => {},
730
+ name: "firstName",
731
+ showFilter: true,
732
+ filter: /*#__PURE__*/React.createElement(Input, {
733
+ dense: true,
734
+ onChange: () => {},
735
+ name: "firstName",
736
+ value: "Filter value"
737
+ })
738
+ }, "SECOND - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/React.createElement(DataTableColumnHeader, {
739
+ large: large,
740
+ onSortIconClick: () => {},
741
+ sortDirection: "asc",
742
+ name: "third"
743
+ }, "Third (short)"), /*#__PURE__*/React.createElement(DataTableColumnHeader, {
744
+ large: large,
745
+ onSortIconClick: () => {},
746
+ sortDirection: "asc",
747
+ name: "fourth"
748
+ }, "Fourth - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"))), /*#__PURE__*/React.createElement(DataTableBody, null, /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, {
749
+ large: large
750
+ }, "FIRST - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/React.createElement(DataTableCell, {
751
+ large: large
752
+ }, "SECOND - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"), /*#__PURE__*/React.createElement(DataTableCell, {
753
+ large: large
754
+ }, "Third (short)"), /*#__PURE__*/React.createElement(DataTableCell, {
755
+ large: large
756
+ }, "Fourth - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?"))));
757
+
758
+ export const LongCellContent = LongCellContentTemplate.bind({});
759
+ export const LongCellContentLargeCells = LongCellContentTemplate.bind({});
760
+ LongCellContentLargeCells.args = {
761
+ large: 'true'
718
762
  };
@@ -1,4 +1,4 @@
1
1
  import { colors } from '@dhis2/ui-constants';
2
- const _defaultExport = [`td.jsx-773314984{padding:0 12px;font-size:14px;border:1px solid transparant;border-bottom:1px solid ${colors.grey300};background-color:${colors.white};color:${colors.grey900};height:45px;}`, `td.active.jsx-773314984{background-color:${colors.white};outline:2px solid ${colors.grey600};outline-offset:-2px;}`, `td.bordered.jsx-773314984{border-right:1px solid ${colors.grey300};}`, "td.bordered.jsx-773314984:last-child{border-right:1px solid transparent;}", `td.error.jsx-773314984{color:${colors.red700};}`, `td.muted.jsx-773314984{color:${colors.grey700};font-style:italic;}`, `td.valid.jsx-773314984{color:${colors.green700};}`, "td.large.jsx-773314984{font-size:16px;height:60px;}", "tr:last-child td.jsx-773314984{border-bottom:1px solid transparent;}", `tfoot tr:first-child td.jsx-773314984{border-top:1px solid ${colors.grey300};}`, `tr.selected>td.jsx-773314984{background-color:${colors.teal100};}`, `tr:hover>td.jsx-773314984:not(.staticStyle){background-color:${colors.grey100};}`, `tr:active>td.jsx-773314984:not(.staticStyle){background-color:${colors.grey200};}`, "tr.selected:hover>td.jsx-773314984:not(.staticStyle){background-color:#cdeae8;}"];
3
- _defaultExport.__hash = "773314984";
2
+ const _defaultExport = [`td.jsx-1115472719{padding:14px 12px;font-size:14px;border:1px solid transparant;border-bottom:1px solid ${colors.grey300};background-color:${colors.white};color:${colors.grey900};}`, `td.active.jsx-1115472719{background-color:${colors.white};outline:2px solid ${colors.grey600};outline-offset:-2px;}`, `td.bordered.jsx-1115472719{border-right:1px solid ${colors.grey300};}`, "td.bordered.jsx-1115472719:last-child{border-right:1px solid transparent;}", `td.error.jsx-1115472719{color:${colors.red700};}`, `td.muted.jsx-1115472719{color:${colors.grey700};font-style:italic;}`, `td.valid.jsx-1115472719{color:${colors.green700};}`, "td.large.jsx-1115472719{padding:20px 12px;font-size:16px;}", "tr:last-child td.jsx-1115472719{border-bottom:1px solid transparent;}", `tfoot tr:first-child td.jsx-1115472719{border-top:1px solid ${colors.grey300};}`, `tr.selected>td.jsx-1115472719{background-color:${colors.teal100};}`, `tr:hover>td.jsx-1115472719:not(.staticStyle){background-color:${colors.grey100};}`, `tr:active>td.jsx-1115472719:not(.staticStyle){background-color:${colors.grey200};}`, "tr.selected:hover>td.jsx-1115472719:not(.staticStyle){background-color:#cdeae8;}"];
3
+ _defaultExport.__hash = "1115472719";
4
4
  export default _defaultExport;
@@ -1,4 +1,4 @@
1
1
  import { colors } from '@dhis2/ui-constants';
2
- const _defaultExport = [`th.jsx-4210860585{padding:0 12px;border:1px solid transparant;border-bottom:1px solid ${colors.grey300};color:${colors.grey800};background-color:${colors.grey200};font-weight:normal;font-size:14px;height:45px;}`, "thead th.jsx-4210860585{font-size:13px;height:36px;}", `th.jsx-4210860585:last-of-type{border-right:1px solid ${colors.grey300};}`, `th.active.jsx-4210860585{background-color:${colors.white};outline:2px solid ${colors.grey600};outline-offset:-2px;}`, `th.bordered.jsx-4210860585{border-right:1px solid ${colors.grey300};}`, "th.bordered.jsx-4210860585:last-child{border-right:1px solid transparent;}", `th.error.jsx-4210860585{color:${colors.red700};}`, `th.muted.jsx-4210860585{color:${colors.grey700};font-style:italic;}`, `th.valid.jsx-4210860585{color:${colors.green700};}`, "th.large.jsx-4210860585{font-size:16px;height:60px;}", "thead th.large.jsx-4210860585{font-size:15px;height:48px;}", "th.fixed.jsx-4210860585{position:-webkit-sticky;position:sticky;z-index:1;}", "thead th.fixed.jsx-4210860585{position:-webkit-sticky;position:sticky;z-index:2;}", `thead th.fixedHorizontally.jsx-4210860585{z-index:3;background-color:${colors.grey300};}`, "tr:last-child th.jsx-4210860585{border-bottom:1px solid transparent;}", `thead tr:last-child th.jsx-4210860585{border-bottom:1px solid ${colors.grey300};}`, `tbody>tr:hover>th.jsx-4210860585:not(.staticStyle),tfoot>tr:hover>th.jsx-4210860585:not(.staticStyle){background-color:${colors.grey300};}`, `tbody>tr:active>th.jsx-4210860585:not(.staticStyle){background-color:${colors.grey200};}`, `tfoot>tr:first-child th.jsx-4210860585{border-top:1px solid ${colors.grey300};}`];
3
- _defaultExport.__hash = "4210860585";
2
+ const _defaultExport = [`th.jsx-3777082606{padding:12px;border:1px solid transparant;border-bottom:1px solid ${colors.grey300};color:${colors.grey800};background-color:${colors.grey200};font-weight:normal;font-size:14px;vertical-align:top;}`, "thead th.jsx-3777082606{padding:8px 12px;font-size:13px;}", `th.jsx-3777082606:last-of-type{border-right:1px solid ${colors.grey300};}`, `th.active.jsx-3777082606{background-color:${colors.white};outline:2px solid ${colors.grey600};outline-offset:-2px;}`, `th.bordered.jsx-3777082606{border-right:1px solid ${colors.grey300};}`, "th.bordered.jsx-3777082606:last-child{border-right:1px solid transparent;}", `th.error.jsx-3777082606{color:${colors.red700};}`, `th.muted.jsx-3777082606{color:${colors.grey700};font-style:italic;}`, `th.valid.jsx-3777082606{color:${colors.green700};}`, "th.large.jsx-3777082606{padding:14px 12px;font-size:16px;}", "thead th.large.jsx-3777082606{padding:13px 12px;font-size:15px;}", "th.fixed.jsx-3777082606{position:-webkit-sticky;position:sticky;z-index:1;}", "thead th.fixed.jsx-3777082606{position:-webkit-sticky;position:sticky;z-index:2;}", `thead th.fixedHorizontally.jsx-3777082606{z-index:3;background-color:${colors.grey300};}`, "tr:last-child th.jsx-3777082606{border-bottom:1px solid transparent;}", `thead tr:last-child th.jsx-3777082606{border-bottom:1px solid ${colors.grey300};}`, `tbody>tr:hover>th.jsx-3777082606:not(.staticStyle),tfoot>tr:hover>th.jsx-3777082606:not(.staticStyle){background-color:${colors.grey300};}`, `tbody>tr:active>th.jsx-3777082606:not(.staticStyle){background-color:${colors.grey200};}`, `tfoot>tr:first-child th.jsx-3777082606{border-top:1px solid ${colors.grey300};}`];
3
+ _defaultExport.__hash = "3777082606";
4
4
  export default _defaultExport;
@@ -17,11 +17,11 @@ export const TableHeaderCellAction = /*#__PURE__*/forwardRef(({
17
17
  onClick: onClick,
18
18
  title: title,
19
19
  ref: ref,
20
- className: _JSXStyle.dynamic([["1702694916", [colors.grey400]]]) + " " + (className || "")
20
+ className: _JSXStyle.dynamic([["997535212", [colors.grey400]]]) + " " + (className || "")
21
21
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
22
- id: "1702694916",
22
+ id: "997535212",
23
23
  dynamic: [colors.grey400]
24
- }, ["button.__jsx-style-dynamic-selector{border:none;padding:0;background:transparent;width:24px;height:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;cursor:pointer;}", `button.__jsx-style-dynamic-selector:hover,button.__jsx-style-dynamic-selector:focus-visible{background:${colors.grey400};}`, "button.__jsx-style-dynamic-selector:active,button.__jsx-style-dynamic-selector:focus{outline:none;}"])));
24
+ }, ["button.__jsx-style-dynamic-selector{border:none;padding:0;background:transparent;width:24px;height:24px;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;cursor:pointer;border-radius:4px;margin-left:2px;}", `button.__jsx-style-dynamic-selector:hover,button.__jsx-style-dynamic-selector:focus-visible{background:${colors.grey400};}`, "button.__jsx-style-dynamic-selector:active,button.__jsx-style-dynamic-selector:focus{outline:none;}"])));
25
25
  TableHeaderCellAction.displayName = 'TableHeaderCellAction';
26
26
  TableHeaderCellAction.defaultProps = {
27
27
  dataTest: 'dhis2-uicore-tableheadercellaction'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/table",
3
- "version": "7.2.6",
3
+ "version": "7.2.7",
4
4
  "description": "UI Table",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.0.0-beta.1",
36
- "@dhis2/ui-constants": "7.2.6",
37
- "@dhis2/ui-icons": "7.2.6",
36
+ "@dhis2/ui-constants": "7.2.7",
37
+ "@dhis2/ui-icons": "7.2.7",
38
38
  "classnames": "^2.3.1",
39
39
  "prop-types": "^15.7.2"
40
40
  },