@helpdice/ui 1.3.6 → 1.3.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.
package/dist/index.js CHANGED
@@ -23391,7 +23391,7 @@ var PopoverComponent = function PopoverComponent(_ref) {
23391
23391
  PopoverComponent.displayName = 'Popover';
23392
23392
  var Popover = withScale(PopoverComponent);
23393
23393
 
23394
- var _excluded$n = ["children", "line", "showTitle", "className", "onClick", "disableAutoClose"];
23394
+ var _excluded$n = ["children", "line", "showTitle", "className", "onClick", "selected", "disableAutoClose"];
23395
23395
  var PopoverItemComponent = function PopoverItemComponent(_ref) {
23396
23396
  var children = _ref.children,
23397
23397
  _ref$line = _ref.line,
@@ -23401,6 +23401,8 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
23401
23401
  _ref$className = _ref.className,
23402
23402
  className = _ref$className === undefined ? '' : _ref$className,
23403
23403
  onClick = _ref.onClick,
23404
+ _ref$selected = _ref.selected,
23405
+ selected = _ref$selected === undefined ? false : _ref$selected,
23404
23406
  _ref$disableAutoClose = _ref.disableAutoClose,
23405
23407
  disableAutoClose = _ref$disableAutoClose === undefined ? false : _ref$disableAutoClose,
23406
23408
  props = _objectWithoutProperties(_ref, _excluded$n);
@@ -23424,6 +23426,9 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
23424
23426
  onItemClick(event);
23425
23427
  };
23426
23428
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
23429
+ style: {
23430
+ backgroundColor: selected ? '#efefef' : ''
23431
+ },
23427
23432
  onClick: clickHandler
23428
23433
  }, props, {
23429
23434
  className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
@@ -42260,7 +42265,7 @@ var TableCell = function TableCell(_ref) {
42260
42265
  color: "".concat(column === null || column === undefined ? undefined : column.color),
42261
42266
  whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
42262
42267
  }, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
42263
- "data-column": column.label,
42268
+ "data-column": String(column.label).toLowerCase(),
42264
42269
  key: "row-td-".concat(index, "-").concat(column.prop.toString()),
42265
42270
  onClick: function onClick() {
42266
42271
  return onCellClick && onCellClick(currentRowValue, rowIndex, index);
@@ -42910,11 +42915,11 @@ function DataTable(_ref) {
42910
42915
  React.useEffect(function () {
42911
42916
  cols.forEach(function (col) {
42912
42917
  if (hideColumn.includes(col.name)) {
42913
- document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
42914
- el.style.display = 'none';
42918
+ document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
42919
+ el.style.display = 'none !important';
42915
42920
  });
42916
42921
  } else {
42917
- document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
42922
+ document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
42918
42923
  el.style.display = '';
42919
42924
  });
42920
42925
  }
@@ -42975,10 +42980,10 @@ function DataTable(_ref) {
42975
42980
  var content = function content() {
42976
42981
  return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
42977
42982
  var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
42983
+ var isSelected = !hideColumn.includes(option.name);
42978
42984
  return /*#__PURE__*/React.createElement(Popover.Item, {
42979
- key: colunqid
42980
- // selected={!hideColumn.includes(option.name as never)}
42981
- ,
42985
+ selected: isSelected,
42986
+ key: colunqid,
42982
42987
  onClick: function onClick(e) {
42983
42988
  return handleHideColumnClick(e, option.name);
42984
42989
  }
@@ -42986,6 +42991,7 @@ function DataTable(_ref) {
42986
42991
  }));
42987
42992
  };
42988
42993
  return /*#__PURE__*/React.createElement(GridContainer, {
42994
+ className: "helpdice-ui-table-container",
42989
42995
  direction: "column"
42990
42996
  }, /*#__PURE__*/React.createElement(Grid.Container, {
42991
42997
  style: {
@@ -1806,7 +1806,7 @@ var PopoverComponent = function PopoverComponent(_ref) {
1806
1806
  PopoverComponent.displayName = 'Popover';
1807
1807
  var Popover = withScale(PopoverComponent);
1808
1808
 
1809
- var _excluded = ["children", "line", "showTitle", "className", "onClick", "disableAutoClose"];
1809
+ var _excluded = ["children", "line", "showTitle", "className", "onClick", "selected", "disableAutoClose"];
1810
1810
  var PopoverItemComponent = function PopoverItemComponent(_ref) {
1811
1811
  var children = _ref.children,
1812
1812
  _ref$line = _ref.line,
@@ -1816,6 +1816,8 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
1816
1816
  _ref$className = _ref.className,
1817
1817
  className = _ref$className === undefined ? '' : _ref$className,
1818
1818
  onClick = _ref.onClick,
1819
+ _ref$selected = _ref.selected,
1820
+ selected = _ref$selected === undefined ? false : _ref$selected,
1819
1821
  _ref$disableAutoClose = _ref.disableAutoClose,
1820
1822
  disableAutoClose = _ref$disableAutoClose === undefined ? false : _ref$disableAutoClose,
1821
1823
  props = _objectWithoutProperties(_ref, _excluded);
@@ -1839,6 +1841,9 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
1839
1841
  onItemClick(event);
1840
1842
  };
1841
1843
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
1844
+ style: {
1845
+ backgroundColor: selected ? '#efefef' : ''
1846
+ },
1842
1847
  onClick: clickHandler
1843
1848
  }, props, {
1844
1849
  className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
@@ -3,6 +3,7 @@ interface Props {
3
3
  line?: boolean;
4
4
  showTitle?: boolean;
5
5
  disableAutoClose?: boolean;
6
+ selected?: boolean;
6
7
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
7
8
  }
8
9
  type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
@@ -20023,7 +20023,7 @@ var TableCell = function TableCell(_ref) {
20023
20023
  color: "".concat(column === null || column === undefined ? undefined : column.color),
20024
20024
  whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
20025
20025
  }, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
20026
- "data-column": column.label,
20026
+ "data-column": String(column.label).toLowerCase(),
20027
20027
  key: "row-td-".concat(index, "-").concat(column.prop.toString()),
20028
20028
  onClick: function onClick() {
20029
20029
  return onCellClick && onCellClick(currentRowValue, rowIndex, index);
@@ -31488,7 +31488,7 @@ var PopoverComponent = function PopoverComponent(_ref) {
31488
31488
  PopoverComponent.displayName = 'Popover';
31489
31489
  var Popover = withScale(PopoverComponent);
31490
31490
 
31491
- var _excluded$5 = ["children", "line", "showTitle", "className", "onClick", "disableAutoClose"];
31491
+ var _excluded$5 = ["children", "line", "showTitle", "className", "onClick", "selected", "disableAutoClose"];
31492
31492
  var PopoverItemComponent = function PopoverItemComponent(_ref) {
31493
31493
  var children = _ref.children,
31494
31494
  _ref$line = _ref.line,
@@ -31498,6 +31498,8 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
31498
31498
  _ref$className = _ref.className,
31499
31499
  className = _ref$className === undefined ? '' : _ref$className,
31500
31500
  onClick = _ref.onClick,
31501
+ _ref$selected = _ref.selected,
31502
+ selected = _ref$selected === undefined ? false : _ref$selected,
31501
31503
  _ref$disableAutoClose = _ref.disableAutoClose,
31502
31504
  disableAutoClose = _ref$disableAutoClose === undefined ? false : _ref$disableAutoClose,
31503
31505
  props = _objectWithoutProperties(_ref, _excluded$5);
@@ -31521,6 +31523,9 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
31521
31523
  onItemClick(event);
31522
31524
  };
31523
31525
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
31526
+ style: {
31527
+ backgroundColor: selected ? '#efefef' : ''
31528
+ },
31524
31529
  onClick: clickHandler
31525
31530
  }, props, {
31526
31531
  className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
@@ -31613,11 +31618,11 @@ function DataTable(_ref) {
31613
31618
  React.useEffect(function () {
31614
31619
  cols.forEach(function (col) {
31615
31620
  if (hideColumn.includes(col.name)) {
31616
- document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
31617
- el.style.display = 'none';
31621
+ document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
31622
+ el.style.display = 'none !important';
31618
31623
  });
31619
31624
  } else {
31620
- document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
31625
+ document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
31621
31626
  el.style.display = '';
31622
31627
  });
31623
31628
  }
@@ -31678,10 +31683,10 @@ function DataTable(_ref) {
31678
31683
  var content = function content() {
31679
31684
  return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
31680
31685
  var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
31686
+ var isSelected = !hideColumn.includes(option.name);
31681
31687
  return /*#__PURE__*/React.createElement(Popover.Item, {
31682
- key: colunqid
31683
- // selected={!hideColumn.includes(option.name as never)}
31684
- ,
31688
+ selected: isSelected,
31689
+ key: colunqid,
31685
31690
  onClick: function onClick(e) {
31686
31691
  return handleHideColumnClick(e, option.name);
31687
31692
  }
@@ -31689,6 +31694,7 @@ function DataTable(_ref) {
31689
31694
  }));
31690
31695
  };
31691
31696
  return /*#__PURE__*/React.createElement(GridContainer, {
31697
+ className: "helpdice-ui-table-container",
31692
31698
  direction: "column"
31693
31699
  }, /*#__PURE__*/React.createElement(Grid.Container, {
31694
31700
  style: {
@@ -3,6 +3,7 @@ interface Props {
3
3
  line?: boolean;
4
4
  showTitle?: boolean;
5
5
  disableAutoClose?: boolean;
6
+ selected?: boolean;
6
7
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
7
8
  }
8
9
  type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["children", "line", "showTitle", "className", "onClick", "disableAutoClose"];
3
+ var _excluded = ["children", "line", "showTitle", "className", "onClick", "selected", "disableAutoClose"];
4
4
  import _JSXStyle from "../styled-jsx.es.js";
5
5
  import React from 'react';
6
6
  import useTheme from '../use-theme';
@@ -16,6 +16,8 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
16
16
  _ref$className = _ref.className,
17
17
  className = _ref$className === void 0 ? '' : _ref$className,
18
18
  onClick = _ref.onClick,
19
+ _ref$selected = _ref.selected,
20
+ selected = _ref$selected === void 0 ? false : _ref$selected,
19
21
  _ref$disableAutoClose = _ref.disableAutoClose,
20
22
  disableAutoClose = _ref$disableAutoClose === void 0 ? false : _ref$disableAutoClose,
21
23
  props = _objectWithoutProperties(_ref, _excluded);
@@ -39,6 +41,9 @@ var PopoverItemComponent = function PopoverItemComponent(_ref) {
39
41
  onItemClick(event);
40
42
  };
41
43
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
44
+ style: {
45
+ backgroundColor: selected ? '#efefef' : ''
46
+ },
42
47
  onClick: clickHandler
43
48
  }, props, {
44
49
  className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
@@ -86,11 +86,11 @@ function DataTable(_ref) {
86
86
  useEffect(function () {
87
87
  cols.forEach(function (col) {
88
88
  if (hideColumn.includes(col.name)) {
89
- document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
90
- el.style.display = 'none';
89
+ document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
90
+ el.style.display = 'none !important';
91
91
  });
92
92
  } else {
93
- document.querySelectorAll("[data-column=\"".concat(col.name, "\"]")).forEach(function (el) {
93
+ document.querySelectorAll("[data-column=\"".concat(String(col.name).toLowerCase(), "\"]")).forEach(function (el) {
94
94
  el.style.display = '';
95
95
  });
96
96
  }
@@ -151,10 +151,10 @@ function DataTable(_ref) {
151
151
  var content = function content() {
152
152
  return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
153
153
  var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
154
+ var isSelected = !hideColumn.includes(option.name);
154
155
  return /*#__PURE__*/React.createElement(Popover.Item, {
155
- key: colunqid
156
- // selected={!hideColumn.includes(option.name as never)}
157
- ,
156
+ selected: isSelected,
157
+ key: colunqid,
158
158
  onClick: function onClick(e) {
159
159
  return handleHideColumnClick(e, option.name);
160
160
  }
@@ -162,6 +162,7 @@ function DataTable(_ref) {
162
162
  }));
163
163
  };
164
164
  return /*#__PURE__*/React.createElement(Container, {
165
+ className: "helpdice-ui-table-container",
165
166
  direction: "column"
166
167
  }, /*#__PURE__*/React.createElement(Grid.Container, {
167
168
  style: {
@@ -20,7 +20,7 @@ var TableCell = function TableCell(_ref) {
20
20
  color: "".concat(column === null || column === void 0 ? void 0 : column.color),
21
21
  whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
22
22
  }, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
23
- "data-column": column.label,
23
+ "data-column": String(column.label).toLowerCase(),
24
24
  key: "row-td-".concat(index, "-").concat(column.prop.toString()),
25
25
  onClick: function onClick() {
26
26
  return onCellClick && onCellClick(currentRowValue, rowIndex, index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",