@helpdice/ui 1.4.3 → 1.4.5
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 +30 -14
- package/dist/table/data-table.d.ts +1 -1
- package/dist/table/index.js +30 -14
- package/dist/table/table-column.d.ts +2 -1
- package/dist/table/table-types.d.ts +3 -2
- package/esm/table/data-table.d.ts +1 -1
- package/esm/table/data-table.js +18 -7
- package/esm/table/table-body.js +3 -3
- package/esm/table/table-column.d.ts +2 -1
- package/esm/table/table-column.js +3 -1
- package/esm/table/table-head.js +6 -3
- package/esm/table/table-types.d.ts +3 -2
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -42217,18 +42217,21 @@ var TableHead = function TableHead(props) {
|
|
|
42217
42217
|
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
42218
42218
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42219
42219
|
}, /*#__PURE__*/React.createElement("tr", {
|
|
42220
|
+
style: {
|
|
42221
|
+
backgroundColor: '#fff'
|
|
42222
|
+
},
|
|
42220
42223
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
42221
42224
|
}, columns.map(function (column, index) {
|
|
42222
42225
|
var _String2;
|
|
42223
42226
|
var dataName = (_String2 = String(column === null || column === undefined ? undefined : column.label)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
42224
42227
|
return /*#__PURE__*/React.createElement("th", {
|
|
42225
|
-
style: {
|
|
42228
|
+
style: _objectSpread2({
|
|
42226
42229
|
// textAlign: `${column?.align} !important`,
|
|
42227
42230
|
// paddingLeft: '0.3rem',
|
|
42228
42231
|
// paddingRight: '0.3rem',
|
|
42229
|
-
|
|
42232
|
+
color: "".concat(column !== null && column !== undefined && column.color ? column === null || column === undefined ? undefined : column.color : '#fff'),
|
|
42230
42233
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
42231
|
-
},
|
|
42234
|
+
}, column === null || column === undefined ? undefined : column.style),
|
|
42232
42235
|
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
42233
42236
|
"data-column": dataName,
|
|
42234
42237
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
@@ -42896,6 +42899,8 @@ function DataTable(_ref) {
|
|
|
42896
42899
|
nextCursor = _ref.nextCursor,
|
|
42897
42900
|
_ref$hasMore = _ref.hasMore,
|
|
42898
42901
|
hasMore = _ref$hasMore === undefined ? false : _ref$hasMore,
|
|
42902
|
+
_ref$stickyHeader = _ref.stickyHeader,
|
|
42903
|
+
stickyHeader = _ref$stickyHeader === undefined ? false : _ref$stickyHeader,
|
|
42899
42904
|
onNextPage = _ref.onNextPage,
|
|
42900
42905
|
onPreviousPage = _ref.onPreviousPage;
|
|
42901
42906
|
var TABLE_ID = _.uniqueId('tbl');
|
|
@@ -42921,9 +42926,9 @@ function DataTable(_ref) {
|
|
|
42921
42926
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
42922
42927
|
openFilter = _useState6[0],
|
|
42923
42928
|
setOpenFilter = _useState6[1];
|
|
42924
|
-
|
|
42929
|
+
function handleShowFilter() {
|
|
42925
42930
|
return setOpenFilter(!openFilter);
|
|
42926
|
-
}
|
|
42931
|
+
}
|
|
42927
42932
|
React.useEffect(function () {
|
|
42928
42933
|
if (selected.length > 0 && onSelected) {
|
|
42929
42934
|
onSelected(selected);
|
|
@@ -42943,8 +42948,8 @@ function DataTable(_ref) {
|
|
|
42943
42948
|
});
|
|
42944
42949
|
}
|
|
42945
42950
|
});
|
|
42946
|
-
}, [hideColumn, cols
|
|
42947
|
-
|
|
42951
|
+
}, [hideColumn, cols]);
|
|
42952
|
+
function handleHideColumnClick(_event, _id) {
|
|
42948
42953
|
var _String2;
|
|
42949
42954
|
var id = (_String2 = String(_id)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
42950
42955
|
var selectedIndex = hideColumn.indexOf(id);
|
|
@@ -42959,7 +42964,7 @@ function DataTable(_ref) {
|
|
|
42959
42964
|
newSelected = newSelected.concat(hideColumn.slice(0, selectedIndex), hideColumn.slice(selectedIndex + 1));
|
|
42960
42965
|
}
|
|
42961
42966
|
setHideColumn(newSelected);
|
|
42962
|
-
}
|
|
42967
|
+
}
|
|
42963
42968
|
|
|
42964
42969
|
// Children change reset selected
|
|
42965
42970
|
React.useEffect(function () {
|
|
@@ -43030,9 +43035,11 @@ function DataTable(_ref) {
|
|
|
43030
43035
|
style: {
|
|
43031
43036
|
display: 'flex',
|
|
43032
43037
|
alignItems: 'center',
|
|
43033
|
-
gap: '1rem'
|
|
43038
|
+
gap: '1rem',
|
|
43039
|
+
fontSize: 'larger'
|
|
43034
43040
|
}
|
|
43035
43041
|
}, children && /*#__PURE__*/React.createElement(Button, {
|
|
43042
|
+
htmlType: "button",
|
|
43036
43043
|
auto: true,
|
|
43037
43044
|
scale: 2 / 3,
|
|
43038
43045
|
px: 0.6,
|
|
@@ -43062,6 +43069,7 @@ function DataTable(_ref) {
|
|
|
43062
43069
|
},
|
|
43063
43070
|
iconRight: /*#__PURE__*/React.createElement(Edit, null),
|
|
43064
43071
|
auto: true,
|
|
43072
|
+
htmlType: "button",
|
|
43065
43073
|
scale: 2 / 3,
|
|
43066
43074
|
px: 0.6
|
|
43067
43075
|
})) : null, onSelectedDelete && selected.length > 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -43078,6 +43086,7 @@ function DataTable(_ref) {
|
|
|
43078
43086
|
auto: true,
|
|
43079
43087
|
scale: 2 / 3,
|
|
43080
43088
|
px: 0.6,
|
|
43089
|
+
htmlType: "button",
|
|
43081
43090
|
iconRight: /*#__PURE__*/React.createElement(Delete$1, null)
|
|
43082
43091
|
})) : null, onRefresh ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
43083
43092
|
text: "Refresh",
|
|
@@ -43087,6 +43096,7 @@ function DataTable(_ref) {
|
|
|
43087
43096
|
py: 0.4,
|
|
43088
43097
|
type: "dark"
|
|
43089
43098
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
43099
|
+
htmlType: "button",
|
|
43090
43100
|
onClick: function onClick() {
|
|
43091
43101
|
return onRefresh();
|
|
43092
43102
|
},
|
|
@@ -43102,6 +43112,7 @@ function DataTable(_ref) {
|
|
|
43102
43112
|
py: 0.4,
|
|
43103
43113
|
type: "dark"
|
|
43104
43114
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
43115
|
+
htmlType: "button",
|
|
43105
43116
|
onClick: handleShowFilter,
|
|
43106
43117
|
auto: true,
|
|
43107
43118
|
scale: 2 / 3,
|
|
@@ -43119,6 +43130,7 @@ function DataTable(_ref) {
|
|
|
43119
43130
|
placement: "bottomEnd",
|
|
43120
43131
|
child: content
|
|
43121
43132
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
43133
|
+
htmlType: "button",
|
|
43122
43134
|
onClick: function onClick() {},
|
|
43123
43135
|
auto: true,
|
|
43124
43136
|
scale: 2 / 3,
|
|
@@ -43156,7 +43168,8 @@ function DataTable(_ref) {
|
|
|
43156
43168
|
width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
|
|
43157
43169
|
}, style)
|
|
43158
43170
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
43159
|
-
stickyHeader:
|
|
43171
|
+
stickyHeader: stickyHeader,
|
|
43172
|
+
readOnly: readOnly,
|
|
43160
43173
|
cursorPagination: cursorPagination,
|
|
43161
43174
|
previousCursor: previousCursor,
|
|
43162
43175
|
nextCursor: nextCursor,
|
|
@@ -43184,6 +43197,7 @@ function DataTable(_ref) {
|
|
|
43184
43197
|
}
|
|
43185
43198
|
}, COLUMNS.map(function (column, index) {
|
|
43186
43199
|
return /*#__PURE__*/React.createElement(Table.Column, {
|
|
43200
|
+
style: column === null || column === undefined ? undefined : column.style,
|
|
43187
43201
|
options: column === null || column === undefined ? undefined : column.options,
|
|
43188
43202
|
fontSize: column === null || column === undefined ? undefined : column.fontSize,
|
|
43189
43203
|
key: "".concat(column.id, "-").concat(index),
|
|
@@ -43292,7 +43306,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
43292
43306
|
}
|
|
43293
43307
|
}
|
|
43294
43308
|
},
|
|
43295
|
-
className: _JSXStyle.dynamic([["
|
|
43309
|
+
className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
|
|
43296
43310
|
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
43297
43311
|
columns: cols,
|
|
43298
43312
|
row: rw,
|
|
@@ -43300,9 +43314,9 @@ var TableBody = function TableBody(_ref) {
|
|
|
43300
43314
|
emptyText: emptyText,
|
|
43301
43315
|
onCellClick: onCell
|
|
43302
43316
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
43303
|
-
id: "
|
|
43317
|
+
id: "787902152",
|
|
43304
43318
|
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
43305
|
-
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(
|
|
43319
|
+
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
43306
43320
|
}
|
|
43307
43321
|
if ((data === null || data === undefined ? undefined : data.length) === 0) {
|
|
43308
43322
|
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
@@ -43381,6 +43395,7 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
43381
43395
|
options = _ref.options,
|
|
43382
43396
|
noWrap = _ref.noWrap,
|
|
43383
43397
|
align = _ref.align,
|
|
43398
|
+
style = _ref.style,
|
|
43384
43399
|
_ref$fontSize = _ref.fontSize,
|
|
43385
43400
|
fontSize = _ref$fontSize === undefined ? 'smaller' : _ref$fontSize,
|
|
43386
43401
|
_ref$className = _ref.className,
|
|
@@ -43403,9 +43418,10 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
43403
43418
|
align: align,
|
|
43404
43419
|
fontSize: fontSize,
|
|
43405
43420
|
className: className,
|
|
43421
|
+
style: style,
|
|
43406
43422
|
renderHandler: function renderHandler() {}
|
|
43407
43423
|
});
|
|
43408
|
-
}, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
43424
|
+
}, [children, noWrap, style, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
43409
43425
|
return null;
|
|
43410
43426
|
};
|
|
43411
43427
|
TableColumn.displayName = 'TableColumn';
|
|
@@ -39,6 +39,6 @@ type DataTableProps = {
|
|
|
39
39
|
onPreviousPage?: (prev?: string) => void;
|
|
40
40
|
};
|
|
41
41
|
declare function DataTable({ cols, rows, readOnly, heading, filter, menu, sideMenu, style, children, onBack, onRefresh, // Function
|
|
42
|
-
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
42
|
+
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, stickyHeader, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
43
43
|
declare const _default: React.MemoExoticComponent<typeof DataTable>;
|
|
44
44
|
export default _default;
|
package/dist/table/index.js
CHANGED
|
@@ -19975,18 +19975,21 @@ var TableHead = function TableHead(props) {
|
|
|
19975
19975
|
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
19976
19976
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19977
19977
|
}, /*#__PURE__*/React.createElement("tr", {
|
|
19978
|
+
style: {
|
|
19979
|
+
backgroundColor: '#fff'
|
|
19980
|
+
},
|
|
19978
19981
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19979
19982
|
}, columns.map(function (column, index) {
|
|
19980
19983
|
var _String2;
|
|
19981
19984
|
var dataName = (_String2 = String(column === null || column === undefined ? undefined : column.label)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
19982
19985
|
return /*#__PURE__*/React.createElement("th", {
|
|
19983
|
-
style: {
|
|
19986
|
+
style: _objectSpread2({
|
|
19984
19987
|
// textAlign: `${column?.align} !important`,
|
|
19985
19988
|
// paddingLeft: '0.3rem',
|
|
19986
19989
|
// paddingRight: '0.3rem',
|
|
19987
|
-
|
|
19990
|
+
color: "".concat(column !== null && column !== undefined && column.color ? column === null || column === undefined ? undefined : column.color : '#fff'),
|
|
19988
19991
|
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
19989
|
-
},
|
|
19992
|
+
}, column === null || column === undefined ? undefined : column.style),
|
|
19990
19993
|
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
19991
19994
|
"data-column": dataName,
|
|
19992
19995
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
@@ -31599,6 +31602,8 @@ function DataTable(_ref) {
|
|
|
31599
31602
|
nextCursor = _ref.nextCursor,
|
|
31600
31603
|
_ref$hasMore = _ref.hasMore,
|
|
31601
31604
|
hasMore = _ref$hasMore === undefined ? false : _ref$hasMore,
|
|
31605
|
+
_ref$stickyHeader = _ref.stickyHeader,
|
|
31606
|
+
stickyHeader = _ref$stickyHeader === undefined ? false : _ref$stickyHeader,
|
|
31602
31607
|
onNextPage = _ref.onNextPage,
|
|
31603
31608
|
onPreviousPage = _ref.onPreviousPage;
|
|
31604
31609
|
var TABLE_ID = _.uniqueId('tbl');
|
|
@@ -31624,9 +31629,9 @@ function DataTable(_ref) {
|
|
|
31624
31629
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
31625
31630
|
openFilter = _useState6[0],
|
|
31626
31631
|
setOpenFilter = _useState6[1];
|
|
31627
|
-
|
|
31632
|
+
function handleShowFilter() {
|
|
31628
31633
|
return setOpenFilter(!openFilter);
|
|
31629
|
-
}
|
|
31634
|
+
}
|
|
31630
31635
|
React.useEffect(function () {
|
|
31631
31636
|
if (selected.length > 0 && onSelected) {
|
|
31632
31637
|
onSelected(selected);
|
|
@@ -31646,8 +31651,8 @@ function DataTable(_ref) {
|
|
|
31646
31651
|
});
|
|
31647
31652
|
}
|
|
31648
31653
|
});
|
|
31649
|
-
}, [hideColumn, cols
|
|
31650
|
-
|
|
31654
|
+
}, [hideColumn, cols]);
|
|
31655
|
+
function handleHideColumnClick(_event, _id) {
|
|
31651
31656
|
var _String2;
|
|
31652
31657
|
var id = (_String2 = String(_id)) === null || _String2 === undefined ? undefined : _String2.replace(' ', '_').toLowerCase();
|
|
31653
31658
|
var selectedIndex = hideColumn.indexOf(id);
|
|
@@ -31662,7 +31667,7 @@ function DataTable(_ref) {
|
|
|
31662
31667
|
newSelected = newSelected.concat(hideColumn.slice(0, selectedIndex), hideColumn.slice(selectedIndex + 1));
|
|
31663
31668
|
}
|
|
31664
31669
|
setHideColumn(newSelected);
|
|
31665
|
-
}
|
|
31670
|
+
}
|
|
31666
31671
|
|
|
31667
31672
|
// Children change reset selected
|
|
31668
31673
|
React.useEffect(function () {
|
|
@@ -31733,9 +31738,11 @@ function DataTable(_ref) {
|
|
|
31733
31738
|
style: {
|
|
31734
31739
|
display: 'flex',
|
|
31735
31740
|
alignItems: 'center',
|
|
31736
|
-
gap: '1rem'
|
|
31741
|
+
gap: '1rem',
|
|
31742
|
+
fontSize: 'larger'
|
|
31737
31743
|
}
|
|
31738
31744
|
}, children && /*#__PURE__*/React.createElement(Button, {
|
|
31745
|
+
htmlType: "button",
|
|
31739
31746
|
auto: true,
|
|
31740
31747
|
scale: 2 / 3,
|
|
31741
31748
|
px: 0.6,
|
|
@@ -31765,6 +31772,7 @@ function DataTable(_ref) {
|
|
|
31765
31772
|
},
|
|
31766
31773
|
iconRight: /*#__PURE__*/React.createElement(Edit, null),
|
|
31767
31774
|
auto: true,
|
|
31775
|
+
htmlType: "button",
|
|
31768
31776
|
scale: 2 / 3,
|
|
31769
31777
|
px: 0.6
|
|
31770
31778
|
})) : null, onSelectedDelete && selected.length > 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -31781,6 +31789,7 @@ function DataTable(_ref) {
|
|
|
31781
31789
|
auto: true,
|
|
31782
31790
|
scale: 2 / 3,
|
|
31783
31791
|
px: 0.6,
|
|
31792
|
+
htmlType: "button",
|
|
31784
31793
|
iconRight: /*#__PURE__*/React.createElement(Delete$1, null)
|
|
31785
31794
|
})) : null, onRefresh ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
31786
31795
|
text: "Refresh",
|
|
@@ -31790,6 +31799,7 @@ function DataTable(_ref) {
|
|
|
31790
31799
|
py: 0.4,
|
|
31791
31800
|
type: "dark"
|
|
31792
31801
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31802
|
+
htmlType: "button",
|
|
31793
31803
|
onClick: function onClick() {
|
|
31794
31804
|
return onRefresh();
|
|
31795
31805
|
},
|
|
@@ -31805,6 +31815,7 @@ function DataTable(_ref) {
|
|
|
31805
31815
|
py: 0.4,
|
|
31806
31816
|
type: "dark"
|
|
31807
31817
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31818
|
+
htmlType: "button",
|
|
31808
31819
|
onClick: handleShowFilter,
|
|
31809
31820
|
auto: true,
|
|
31810
31821
|
scale: 2 / 3,
|
|
@@ -31822,6 +31833,7 @@ function DataTable(_ref) {
|
|
|
31822
31833
|
placement: "bottomEnd",
|
|
31823
31834
|
child: content
|
|
31824
31835
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31836
|
+
htmlType: "button",
|
|
31825
31837
|
onClick: function onClick() {},
|
|
31826
31838
|
auto: true,
|
|
31827
31839
|
scale: 2 / 3,
|
|
@@ -31859,7 +31871,8 @@ function DataTable(_ref) {
|
|
|
31859
31871
|
width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
|
|
31860
31872
|
}, style)
|
|
31861
31873
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
31862
|
-
stickyHeader:
|
|
31874
|
+
stickyHeader: stickyHeader,
|
|
31875
|
+
readOnly: readOnly,
|
|
31863
31876
|
cursorPagination: cursorPagination,
|
|
31864
31877
|
previousCursor: previousCursor,
|
|
31865
31878
|
nextCursor: nextCursor,
|
|
@@ -31887,6 +31900,7 @@ function DataTable(_ref) {
|
|
|
31887
31900
|
}
|
|
31888
31901
|
}, COLUMNS.map(function (column, index) {
|
|
31889
31902
|
return /*#__PURE__*/React.createElement(Table.Column, {
|
|
31903
|
+
style: column === null || column === undefined ? undefined : column.style,
|
|
31890
31904
|
options: column === null || column === undefined ? undefined : column.options,
|
|
31891
31905
|
fontSize: column === null || column === undefined ? undefined : column.fontSize,
|
|
31892
31906
|
key: "".concat(column.id, "-").concat(index),
|
|
@@ -31995,7 +32009,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
31995
32009
|
}
|
|
31996
32010
|
}
|
|
31997
32011
|
},
|
|
31998
|
-
className: _JSXStyle.dynamic([["
|
|
32012
|
+
className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
|
|
31999
32013
|
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
32000
32014
|
columns: cols,
|
|
32001
32015
|
row: rw,
|
|
@@ -32003,9 +32017,9 @@ var TableBody = function TableBody(_ref) {
|
|
|
32003
32017
|
emptyText: emptyText,
|
|
32004
32018
|
onCellClick: onCell
|
|
32005
32019
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
32006
|
-
id: "
|
|
32020
|
+
id: "787902152",
|
|
32007
32021
|
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
32008
|
-
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(
|
|
32022
|
+
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
32009
32023
|
}
|
|
32010
32024
|
if ((data === null || data === undefined ? undefined : data.length) === 0) {
|
|
32011
32025
|
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
@@ -32127,6 +32141,7 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
32127
32141
|
options = _ref.options,
|
|
32128
32142
|
noWrap = _ref.noWrap,
|
|
32129
32143
|
align = _ref.align,
|
|
32144
|
+
style = _ref.style,
|
|
32130
32145
|
_ref$fontSize = _ref.fontSize,
|
|
32131
32146
|
fontSize = _ref$fontSize === undefined ? 'smaller' : _ref$fontSize,
|
|
32132
32147
|
_ref$className = _ref.className,
|
|
@@ -32149,9 +32164,10 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
32149
32164
|
align: align,
|
|
32150
32165
|
fontSize: fontSize,
|
|
32151
32166
|
className: className,
|
|
32167
|
+
style: style,
|
|
32152
32168
|
renderHandler: function renderHandler() {}
|
|
32153
32169
|
});
|
|
32154
|
-
}, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
32170
|
+
}, [children, noWrap, style, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
32155
32171
|
return null;
|
|
32156
32172
|
};
|
|
32157
32173
|
TableColumn.displayName = 'TableColumn';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { TableColumnRender, TableDataItemBase } from './table-types';
|
|
3
3
|
export type TableColumnProps<TableDataItem extends TableDataItemBase> = {
|
|
4
4
|
prop: keyof TableDataItem;
|
|
@@ -9,6 +9,7 @@ export type TableColumnProps<TableDataItem extends TableDataItemBase> = {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
noWrap?: boolean;
|
|
11
11
|
align?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
12
13
|
fontSize?: string | number;
|
|
13
14
|
render?: TableColumnRender<TableDataItem>;
|
|
14
15
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
export type TableDataItemBase = Record<string, any>;
|
|
3
3
|
export type TableColumnRender<Item extends TableDataItemBase> = (value: Item[keyof Item], rowData: Item, rowIndex: number) => JSX.Element | void;
|
|
4
4
|
export type TableAbstractColumn<TableDataItem> = {
|
|
5
|
+
style: CSSProperties | undefined;
|
|
5
6
|
prop: keyof TableDataItem;
|
|
6
7
|
label: React.ReactNode | string;
|
|
7
8
|
text?: React.ReactNode | string;
|
|
8
9
|
filter?: string;
|
|
9
10
|
className: string;
|
|
10
11
|
width?: number;
|
|
11
|
-
align?:
|
|
12
|
+
align?: any;
|
|
12
13
|
color?: string;
|
|
13
14
|
noWrap?: boolean;
|
|
14
15
|
fontSize?: string | number;
|
|
@@ -39,6 +39,6 @@ type DataTableProps = {
|
|
|
39
39
|
onPreviousPage?: (prev?: string) => void;
|
|
40
40
|
};
|
|
41
41
|
declare function DataTable({ cols, rows, readOnly, heading, filter, menu, sideMenu, style, children, onBack, onRefresh, // Function
|
|
42
|
-
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
42
|
+
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, stickyHeader, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
43
43
|
declare const _default: React.MemoExoticComponent<typeof DataTable>;
|
|
44
44
|
export default _default;
|
package/esm/table/data-table.js
CHANGED
|
@@ -58,6 +58,8 @@ function DataTable(_ref) {
|
|
|
58
58
|
nextCursor = _ref.nextCursor,
|
|
59
59
|
_ref$hasMore = _ref.hasMore,
|
|
60
60
|
hasMore = _ref$hasMore === void 0 ? false : _ref$hasMore,
|
|
61
|
+
_ref$stickyHeader = _ref.stickyHeader,
|
|
62
|
+
stickyHeader = _ref$stickyHeader === void 0 ? false : _ref$stickyHeader,
|
|
61
63
|
onNextPage = _ref.onNextPage,
|
|
62
64
|
onPreviousPage = _ref.onPreviousPage;
|
|
63
65
|
var TABLE_ID = _.uniqueId('tbl');
|
|
@@ -83,9 +85,9 @@ function DataTable(_ref) {
|
|
|
83
85
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
84
86
|
openFilter = _useState6[0],
|
|
85
87
|
setOpenFilter = _useState6[1];
|
|
86
|
-
|
|
88
|
+
function handleShowFilter() {
|
|
87
89
|
return setOpenFilter(!openFilter);
|
|
88
|
-
}
|
|
90
|
+
}
|
|
89
91
|
useEffect(function () {
|
|
90
92
|
if (selected.length > 0 && onSelected) {
|
|
91
93
|
onSelected(selected);
|
|
@@ -105,8 +107,8 @@ function DataTable(_ref) {
|
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
109
|
});
|
|
108
|
-
}, [hideColumn, cols
|
|
109
|
-
|
|
110
|
+
}, [hideColumn, cols]);
|
|
111
|
+
function handleHideColumnClick(_event, _id) {
|
|
110
112
|
var _String2;
|
|
111
113
|
var id = (_String2 = String(_id)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
112
114
|
var selectedIndex = hideColumn.indexOf(id);
|
|
@@ -121,7 +123,7 @@ function DataTable(_ref) {
|
|
|
121
123
|
newSelected = newSelected.concat(hideColumn.slice(0, selectedIndex), hideColumn.slice(selectedIndex + 1));
|
|
122
124
|
}
|
|
123
125
|
setHideColumn(newSelected);
|
|
124
|
-
}
|
|
126
|
+
}
|
|
125
127
|
|
|
126
128
|
// Children change reset selected
|
|
127
129
|
useEffect(function () {
|
|
@@ -192,9 +194,11 @@ function DataTable(_ref) {
|
|
|
192
194
|
style: {
|
|
193
195
|
display: 'flex',
|
|
194
196
|
alignItems: 'center',
|
|
195
|
-
gap: '1rem'
|
|
197
|
+
gap: '1rem',
|
|
198
|
+
fontSize: 'larger'
|
|
196
199
|
}
|
|
197
200
|
}, children && /*#__PURE__*/React.createElement(Button, {
|
|
201
|
+
htmlType: "button",
|
|
198
202
|
auto: true,
|
|
199
203
|
scale: 2 / 3,
|
|
200
204
|
px: 0.6,
|
|
@@ -224,6 +228,7 @@ function DataTable(_ref) {
|
|
|
224
228
|
},
|
|
225
229
|
iconRight: /*#__PURE__*/React.createElement(Edit, null),
|
|
226
230
|
auto: true,
|
|
231
|
+
htmlType: "button",
|
|
227
232
|
scale: 2 / 3,
|
|
228
233
|
px: 0.6
|
|
229
234
|
})) : null, onSelectedDelete && selected.length > 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -240,6 +245,7 @@ function DataTable(_ref) {
|
|
|
240
245
|
auto: true,
|
|
241
246
|
scale: 2 / 3,
|
|
242
247
|
px: 0.6,
|
|
248
|
+
htmlType: "button",
|
|
243
249
|
iconRight: /*#__PURE__*/React.createElement(Delete, null)
|
|
244
250
|
})) : null, onRefresh ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
245
251
|
text: "Refresh",
|
|
@@ -249,6 +255,7 @@ function DataTable(_ref) {
|
|
|
249
255
|
py: 0.4,
|
|
250
256
|
type: "dark"
|
|
251
257
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
258
|
+
htmlType: "button",
|
|
252
259
|
onClick: function onClick() {
|
|
253
260
|
return onRefresh();
|
|
254
261
|
},
|
|
@@ -264,6 +271,7 @@ function DataTable(_ref) {
|
|
|
264
271
|
py: 0.4,
|
|
265
272
|
type: "dark"
|
|
266
273
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
274
|
+
htmlType: "button",
|
|
267
275
|
onClick: handleShowFilter,
|
|
268
276
|
auto: true,
|
|
269
277
|
scale: 2 / 3,
|
|
@@ -281,6 +289,7 @@ function DataTable(_ref) {
|
|
|
281
289
|
placement: "bottomEnd",
|
|
282
290
|
child: content
|
|
283
291
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
292
|
+
htmlType: "button",
|
|
284
293
|
onClick: function onClick() {},
|
|
285
294
|
auto: true,
|
|
286
295
|
scale: 2 / 3,
|
|
@@ -318,7 +327,8 @@ function DataTable(_ref) {
|
|
|
318
327
|
width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
|
|
319
328
|
}, style)
|
|
320
329
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
321
|
-
stickyHeader:
|
|
330
|
+
stickyHeader: stickyHeader,
|
|
331
|
+
readOnly: readOnly,
|
|
322
332
|
cursorPagination: cursorPagination,
|
|
323
333
|
previousCursor: previousCursor,
|
|
324
334
|
nextCursor: nextCursor,
|
|
@@ -346,6 +356,7 @@ function DataTable(_ref) {
|
|
|
346
356
|
}
|
|
347
357
|
}, COLUMNS.map(function (column, index) {
|
|
348
358
|
return /*#__PURE__*/React.createElement(Table.Column, {
|
|
359
|
+
style: column === null || column === void 0 ? void 0 : column.style,
|
|
349
360
|
options: column === null || column === void 0 ? void 0 : column.options,
|
|
350
361
|
fontSize: column === null || column === void 0 ? void 0 : column.fontSize,
|
|
351
362
|
key: "".concat(column.id, "-").concat(index),
|
package/esm/table/table-body.js
CHANGED
|
@@ -104,7 +104,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
className: _JSXStyle.dynamic([["
|
|
107
|
+
className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
|
|
108
108
|
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
109
109
|
columns: cols,
|
|
110
110
|
row: rw,
|
|
@@ -112,9 +112,9 @@ var TableBody = function TableBody(_ref) {
|
|
|
112
112
|
emptyText: emptyText,
|
|
113
113
|
onCellClick: onCell
|
|
114
114
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
115
|
-
id: "
|
|
115
|
+
id: "787902152",
|
|
116
116
|
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
117
|
-
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(
|
|
117
|
+
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
118
118
|
}
|
|
119
119
|
if ((data === null || data === void 0 ? void 0 : data.length) === 0) {
|
|
120
120
|
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { TableColumnRender, TableDataItemBase } from './table-types';
|
|
3
3
|
export type TableColumnProps<TableDataItem extends TableDataItemBase> = {
|
|
4
4
|
prop: keyof TableDataItem;
|
|
@@ -9,6 +9,7 @@ export type TableColumnProps<TableDataItem extends TableDataItemBase> = {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
noWrap?: boolean;
|
|
11
11
|
align?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
12
13
|
fontSize?: string | number;
|
|
13
14
|
render?: TableColumnRender<TableDataItem>;
|
|
14
15
|
};
|
|
@@ -13,6 +13,7 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
13
13
|
options = _ref.options,
|
|
14
14
|
noWrap = _ref.noWrap,
|
|
15
15
|
align = _ref.align,
|
|
16
|
+
style = _ref.style,
|
|
16
17
|
_ref$fontSize = _ref.fontSize,
|
|
17
18
|
fontSize = _ref$fontSize === void 0 ? 'smaller' : _ref$fontSize,
|
|
18
19
|
_ref$className = _ref.className,
|
|
@@ -35,9 +36,10 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
35
36
|
align: align,
|
|
36
37
|
fontSize: fontSize,
|
|
37
38
|
className: className,
|
|
39
|
+
style: style,
|
|
38
40
|
renderHandler: function renderHandler() {}
|
|
39
41
|
});
|
|
40
|
-
}, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
42
|
+
}, [children, noWrap, style, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
|
|
41
43
|
return null;
|
|
42
44
|
};
|
|
43
45
|
TableColumn.displayName = 'TableColumn';
|
package/esm/table/table-head.js
CHANGED
|
@@ -129,18 +129,21 @@ var TableHead = function TableHead(props) {
|
|
|
129
129
|
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
130
130
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
131
131
|
}, /*#__PURE__*/React.createElement("tr", {
|
|
132
|
+
style: {
|
|
133
|
+
backgroundColor: '#fff'
|
|
134
|
+
},
|
|
132
135
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
133
136
|
}, columns.map(function (column, index) {
|
|
134
137
|
var _String2;
|
|
135
138
|
var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
136
139
|
return /*#__PURE__*/React.createElement("th", {
|
|
137
|
-
style: {
|
|
140
|
+
style: _extends({
|
|
138
141
|
// textAlign: `${column?.align} !important`,
|
|
139
142
|
// paddingLeft: '0.3rem',
|
|
140
143
|
// paddingRight: '0.3rem',
|
|
141
|
-
|
|
144
|
+
color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : '#fff'),
|
|
142
145
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
143
|
-
},
|
|
146
|
+
}, column === null || column === void 0 ? void 0 : column.style),
|
|
144
147
|
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
145
148
|
"data-column": dataName,
|
|
146
149
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
export type TableDataItemBase = Record<string, any>;
|
|
3
3
|
export type TableColumnRender<Item extends TableDataItemBase> = (value: Item[keyof Item], rowData: Item, rowIndex: number) => JSX.Element | void;
|
|
4
4
|
export type TableAbstractColumn<TableDataItem> = {
|
|
5
|
+
style: CSSProperties | undefined;
|
|
5
6
|
prop: keyof TableDataItem;
|
|
6
7
|
label: React.ReactNode | string;
|
|
7
8
|
text?: React.ReactNode | string;
|
|
8
9
|
filter?: string;
|
|
9
10
|
className: string;
|
|
10
11
|
width?: number;
|
|
11
|
-
align?:
|
|
12
|
+
align?: any;
|
|
12
13
|
color?: string;
|
|
13
14
|
noWrap?: boolean;
|
|
14
15
|
fontSize?: string | number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build:after": "node scripts/move-built-in.js",
|
|
23
23
|
"build:types": "tsc -p ./scripts & tsc -p ./scripts --outDir ./esm",
|
|
24
24
|
"build": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
|
|
25
|
-
"
|
|
25
|
+
"push": "yarn build && yarn publish --access public --non-interactive"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"description": "Modern React UI library.",
|
|
@@ -104,10 +104,12 @@
|
|
|
104
104
|
"lodash": "^4.17.21",
|
|
105
105
|
"lodash-es": "^4.17.21",
|
|
106
106
|
"polished": "^4.3.1",
|
|
107
|
+
"push": "^0.1.1",
|
|
107
108
|
"react-fast-compare": "^3.2.2",
|
|
108
109
|
"react-is": "^19.0.0",
|
|
109
110
|
"react-syntax-highlighter": "^15.6.1",
|
|
110
111
|
"react-transition-group": "^4.4.5",
|
|
112
|
+
"release": "^6.3.1",
|
|
111
113
|
"rollup-plugin-local-resolve": "^1.0.7",
|
|
112
114
|
"styled-components": "^6.1.14",
|
|
113
115
|
"tiny-warning": "^1.0.3",
|