@helpdice/ui 1.6.6 → 1.6.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 +9 -15
- package/dist/table/index.js +9 -15
- package/esm/table/data-table.js +8 -12
- package/esm/table/table-cell.js +1 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26483,11 +26483,9 @@ var TableCell = function TableCell(_ref) {
|
|
|
26483
26483
|
onCellClick = _ref.onCellClick;
|
|
26484
26484
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
26485
26485
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, columns.map(function (column, index) {
|
|
26486
|
-
var _String;
|
|
26487
26486
|
var currentRowValue = row[column.prop];
|
|
26488
26487
|
var cellValue = currentRowValue || emptyText;
|
|
26489
26488
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
26490
|
-
var dataName = (_String = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
26491
26489
|
return /*#__PURE__*/React$1.createElement("td", {
|
|
26492
26490
|
style: _objectSpread2({
|
|
26493
26491
|
fontSize: "".concat(column === null || column === void 0 ? void 0 : column.fontSize),
|
|
@@ -26498,7 +26496,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
26498
26496
|
boxSizing: 'border-box',
|
|
26499
26497
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
26500
26498
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
26501
|
-
"data-column":
|
|
26499
|
+
"data-column": column.prop,
|
|
26502
26500
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
26503
26501
|
onClick: function onClick() {
|
|
26504
26502
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
@@ -44374,22 +44372,20 @@ function DataTable(_ref) {
|
|
|
44374
44372
|
}
|
|
44375
44373
|
React$1.useEffect(function () {
|
|
44376
44374
|
cols.forEach(function (col) {
|
|
44377
|
-
var _String2;
|
|
44378
|
-
var dataName = (_String2 = String(col === null || col === void 0 ? void 0 : col.name)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
44379
44375
|
if (hideColumn.includes(col.name)) {
|
|
44380
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
44376
|
+
document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
|
|
44381
44377
|
el.style.display = 'none !important';
|
|
44382
44378
|
});
|
|
44383
44379
|
} else {
|
|
44384
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
44380
|
+
document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
|
|
44385
44381
|
el.style.display = '';
|
|
44386
44382
|
});
|
|
44387
44383
|
}
|
|
44388
44384
|
});
|
|
44389
44385
|
}, [hideColumn, cols]);
|
|
44390
44386
|
function handleHideColumnClick(_event, _id) {
|
|
44391
|
-
var
|
|
44392
|
-
var id = (
|
|
44387
|
+
var _String2;
|
|
44388
|
+
var id = (_String2 = String(_id)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
44393
44389
|
var selectedIndex = hideColumn.indexOf(id);
|
|
44394
44390
|
var newSelected = [];
|
|
44395
44391
|
if (selectedIndex === -1) {
|
|
@@ -44501,16 +44497,14 @@ function DataTable(_ref) {
|
|
|
44501
44497
|
|
|
44502
44498
|
var content = function content() {
|
|
44503
44499
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, cols.map(function (option, _index) {
|
|
44504
|
-
var _String4;
|
|
44505
44500
|
// const colunqid = _.uniqueId(`${option.name}-${index}`);
|
|
44506
|
-
var
|
|
44507
|
-
var isSelected = !hideColumn.includes(dataName);
|
|
44501
|
+
var isSelected = !hideColumn.includes(option.id);
|
|
44508
44502
|
return /*#__PURE__*/React$1.createElement(Popover.Item, {
|
|
44509
44503
|
selected: isSelected
|
|
44510
44504
|
// key={colunqid}
|
|
44511
44505
|
,
|
|
44512
44506
|
onClick: function onClick(e) {
|
|
44513
|
-
return handleHideColumnClick(e, option.
|
|
44507
|
+
return handleHideColumnClick(e, option.id);
|
|
44514
44508
|
}
|
|
44515
44509
|
}, /*#__PURE__*/React$1.createElement("span", null, option.name));
|
|
44516
44510
|
}));
|
|
@@ -44528,7 +44522,7 @@ function DataTable(_ref) {
|
|
|
44528
44522
|
// )
|
|
44529
44523
|
|
|
44530
44524
|
var SELECTED = React$1.useMemo(function () {
|
|
44531
|
-
if (
|
|
44525
|
+
if (onSelected) {
|
|
44532
44526
|
return onSelected(selected);
|
|
44533
44527
|
}
|
|
44534
44528
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null);
|
|
@@ -44569,7 +44563,7 @@ function DataTable(_ref) {
|
|
|
44569
44563
|
},
|
|
44570
44564
|
justify: "flex-end",
|
|
44571
44565
|
alignContent: "center"
|
|
44572
|
-
}, menu, !children && !readOnly ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
44566
|
+
}, menu, !children && !readOnly ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
44573
44567
|
text: "Edit Selected",
|
|
44574
44568
|
placement: "bottom",
|
|
44575
44569
|
font: 0.8,
|
package/dist/table/index.js
CHANGED
|
@@ -2814,11 +2814,9 @@ var TableCell = function TableCell(_ref) {
|
|
|
2814
2814
|
onCellClick = _ref.onCellClick;
|
|
2815
2815
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
2816
2816
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
2817
|
-
var _String;
|
|
2818
2817
|
var currentRowValue = row[column.prop];
|
|
2819
2818
|
var cellValue = currentRowValue || emptyText;
|
|
2820
2819
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
2821
|
-
var dataName = (_String = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
2822
2820
|
return /*#__PURE__*/React.createElement("td", {
|
|
2823
2821
|
style: _objectSpread2({
|
|
2824
2822
|
fontSize: "".concat(column === null || column === void 0 ? void 0 : column.fontSize),
|
|
@@ -2829,7 +2827,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
2829
2827
|
boxSizing: 'border-box',
|
|
2830
2828
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
2831
2829
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
2832
|
-
"data-column":
|
|
2830
|
+
"data-column": column.prop,
|
|
2833
2831
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
2834
2832
|
onClick: function onClick() {
|
|
2835
2833
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
@@ -31652,22 +31650,20 @@ function DataTable(_ref) {
|
|
|
31652
31650
|
}
|
|
31653
31651
|
React.useEffect(function () {
|
|
31654
31652
|
cols.forEach(function (col) {
|
|
31655
|
-
var _String2;
|
|
31656
|
-
var dataName = (_String2 = String(col === null || col === void 0 ? void 0 : col.name)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
31657
31653
|
if (hideColumn.includes(col.name)) {
|
|
31658
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
31654
|
+
document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
|
|
31659
31655
|
el.style.display = 'none !important';
|
|
31660
31656
|
});
|
|
31661
31657
|
} else {
|
|
31662
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
31658
|
+
document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
|
|
31663
31659
|
el.style.display = '';
|
|
31664
31660
|
});
|
|
31665
31661
|
}
|
|
31666
31662
|
});
|
|
31667
31663
|
}, [hideColumn, cols]);
|
|
31668
31664
|
function handleHideColumnClick(_event, _id) {
|
|
31669
|
-
var
|
|
31670
|
-
var id = (
|
|
31665
|
+
var _String2;
|
|
31666
|
+
var id = (_String2 = String(_id)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
31671
31667
|
var selectedIndex = hideColumn.indexOf(id);
|
|
31672
31668
|
var newSelected = [];
|
|
31673
31669
|
if (selectedIndex === -1) {
|
|
@@ -31779,16 +31775,14 @@ function DataTable(_ref) {
|
|
|
31779
31775
|
|
|
31780
31776
|
var content = function content() {
|
|
31781
31777
|
return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, _index) {
|
|
31782
|
-
var _String4;
|
|
31783
31778
|
// const colunqid = _.uniqueId(`${option.name}-${index}`);
|
|
31784
|
-
var
|
|
31785
|
-
var isSelected = !hideColumn.includes(dataName);
|
|
31779
|
+
var isSelected = !hideColumn.includes(option.id);
|
|
31786
31780
|
return /*#__PURE__*/React.createElement(Popover.Item, {
|
|
31787
31781
|
selected: isSelected
|
|
31788
31782
|
// key={colunqid}
|
|
31789
31783
|
,
|
|
31790
31784
|
onClick: function onClick(e) {
|
|
31791
|
-
return handleHideColumnClick(e, option.
|
|
31785
|
+
return handleHideColumnClick(e, option.id);
|
|
31792
31786
|
}
|
|
31793
31787
|
}, /*#__PURE__*/React.createElement("span", null, option.name));
|
|
31794
31788
|
}));
|
|
@@ -31806,7 +31800,7 @@ function DataTable(_ref) {
|
|
|
31806
31800
|
// )
|
|
31807
31801
|
|
|
31808
31802
|
var SELECTED = React.useMemo(function () {
|
|
31809
|
-
if (
|
|
31803
|
+
if (onSelected) {
|
|
31810
31804
|
return onSelected(selected);
|
|
31811
31805
|
}
|
|
31812
31806
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -31847,7 +31841,7 @@ function DataTable(_ref) {
|
|
|
31847
31841
|
},
|
|
31848
31842
|
justify: "flex-end",
|
|
31849
31843
|
alignContent: "center"
|
|
31850
|
-
}, menu, !children && !readOnly ? /*#__PURE__*/React.createElement(React.Fragment, null, SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
31844
|
+
}, menu, !children && !readOnly ? /*#__PURE__*/React.createElement(React.Fragment, null, (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
31851
31845
|
text: "Edit Selected",
|
|
31852
31846
|
placement: "bottom",
|
|
31853
31847
|
font: 0.8,
|
package/esm/table/data-table.js
CHANGED
|
@@ -100,22 +100,20 @@ function DataTable(_ref) {
|
|
|
100
100
|
}
|
|
101
101
|
useEffect(function () {
|
|
102
102
|
cols.forEach(function (col) {
|
|
103
|
-
var _String2;
|
|
104
|
-
var dataName = (_String2 = String(col === null || col === void 0 ? void 0 : col.name)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
105
103
|
if (hideColumn.includes(col.name)) {
|
|
106
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
104
|
+
document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
|
|
107
105
|
el.style.display = 'none !important';
|
|
108
106
|
});
|
|
109
107
|
} else {
|
|
110
|
-
document.querySelectorAll("[data-column=\"".concat(
|
|
108
|
+
document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
|
|
111
109
|
el.style.display = '';
|
|
112
110
|
});
|
|
113
111
|
}
|
|
114
112
|
});
|
|
115
113
|
}, [hideColumn, cols]);
|
|
116
114
|
function handleHideColumnClick(_event, _id) {
|
|
117
|
-
var
|
|
118
|
-
var id = (
|
|
115
|
+
var _String2;
|
|
116
|
+
var id = (_String2 = String(_id)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
119
117
|
var selectedIndex = hideColumn.indexOf(id);
|
|
120
118
|
var newSelected = [];
|
|
121
119
|
if (selectedIndex === -1) {
|
|
@@ -227,16 +225,14 @@ function DataTable(_ref) {
|
|
|
227
225
|
|
|
228
226
|
var content = function content() {
|
|
229
227
|
return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, _index) {
|
|
230
|
-
var _String4;
|
|
231
228
|
// const colunqid = _.uniqueId(`${option.name}-${index}`);
|
|
232
|
-
var
|
|
233
|
-
var isSelected = !hideColumn.includes(dataName);
|
|
229
|
+
var isSelected = !hideColumn.includes(option.id);
|
|
234
230
|
return /*#__PURE__*/React.createElement(Popover.Item, {
|
|
235
231
|
selected: isSelected
|
|
236
232
|
// key={colunqid}
|
|
237
233
|
,
|
|
238
234
|
onClick: function onClick(e) {
|
|
239
|
-
return handleHideColumnClick(e, option.
|
|
235
|
+
return handleHideColumnClick(e, option.id);
|
|
240
236
|
}
|
|
241
237
|
}, /*#__PURE__*/React.createElement("span", null, option.name));
|
|
242
238
|
}));
|
|
@@ -254,7 +250,7 @@ function DataTable(_ref) {
|
|
|
254
250
|
// )
|
|
255
251
|
|
|
256
252
|
var SELECTED = useMemo(function () {
|
|
257
|
-
if (
|
|
253
|
+
if (onSelected) {
|
|
258
254
|
return onSelected(selected);
|
|
259
255
|
}
|
|
260
256
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -295,7 +291,7 @@ function DataTable(_ref) {
|
|
|
295
291
|
},
|
|
296
292
|
justify: "flex-end",
|
|
297
293
|
alignContent: "center"
|
|
298
|
-
}, menu, !children && !readOnly ? /*#__PURE__*/React.createElement(React.Fragment, null, SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
294
|
+
}, menu, !children && !readOnly ? /*#__PURE__*/React.createElement(React.Fragment, null, (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
299
295
|
text: "Edit Selected",
|
|
300
296
|
placement: "bottom",
|
|
301
297
|
font: 0.8,
|
package/esm/table/table-cell.js
CHANGED
|
@@ -8,11 +8,9 @@ var TableCell = function TableCell(_ref) {
|
|
|
8
8
|
onCellClick = _ref.onCellClick;
|
|
9
9
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
10
10
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
11
|
-
var _String;
|
|
12
11
|
var currentRowValue = row[column.prop];
|
|
13
12
|
var cellValue = currentRowValue || emptyText;
|
|
14
13
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
15
|
-
var dataName = (_String = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
16
14
|
return /*#__PURE__*/React.createElement("td", {
|
|
17
15
|
style: _extends({
|
|
18
16
|
fontSize: "".concat(column === null || column === void 0 ? void 0 : column.fontSize),
|
|
@@ -23,7 +21,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
23
21
|
boxSizing: 'border-box',
|
|
24
22
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
25
23
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
26
|
-
"data-column":
|
|
24
|
+
"data-column": column.prop,
|
|
27
25
|
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
28
26
|
onClick: function onClick() {
|
|
29
27
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|