labsense-ui-kit 1.4.50 → 1.4.52

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.
@@ -10,6 +10,9 @@ interface HeaderCellConfig {
10
10
  alignment?: string;
11
11
  CustomFunction?: React.ReactElement;
12
12
  groupTitle?: string;
13
+ sortable?: boolean;
14
+ sortDirection?: 'asc' | 'desc';
15
+ onSortClick?: () => void;
13
16
  }
14
17
  interface HeaderConfig {
15
18
  headercolor?: string;
package/dist/index.js CHANGED
@@ -8529,12 +8529,10 @@ var ButtonComponent = function ButtonComponent(_ref21) {
8529
8529
  icon: icon,
8530
8530
  weight: iconWeight,
8531
8531
  size: iconSize ? iconSize : size === 'small' ? 6 : size === 'medium' ? 8 : 10,
8532
- onClick: function onClick(e) {
8533
- if (iconClick) {
8534
- e.stopPropagation();
8535
- iconClick === null || iconClick === void 0 ? void 0 : iconClick();
8536
- }
8537
- },
8532
+ onClick: iconClick ? function (e) {
8533
+ e.stopPropagation();
8534
+ iconClick();
8535
+ } : undefined,
8538
8536
  cursor: disabled ? 'not-allowed' : iconClick ? 'pointer' : 'default',
8539
8537
  color: getIconColor()
8540
8538
  }), text && React__default.createElement(ButtonText, {
@@ -13261,7 +13259,7 @@ var Table = function Table(_ref9) {
13261
13259
  onChange: toggleSelectAll,
13262
13260
  "$borderSize": 2
13263
13261
  })), tableheaderconfig.headerdata.map(function (columndata, index, allCols) {
13264
- var _allCols, _columndata$maintext;
13262
+ var _allCols, _columndata$maintext, _columndata$maintext2;
13265
13263
  var currentGroupTitle = columndata.groupTitle || '';
13266
13264
  var prevGroupTitle = index > 0 ? allCols[index - 1].groupTitle || '' : '';
13267
13265
  var isFirstOfGroup = currentGroupTitle && currentGroupTitle !== prevGroupTitle;
@@ -13289,8 +13287,23 @@ var Table = function Table(_ref9) {
13289
13287
  "$lineHeight": 'normal'
13290
13288
  }, currentGroupTitle), React__default.createElement(LegendDivider, null)) : React__default.createElement(LegendDivider, {
13291
13289
  "$marginRight": currentGroupTitle !== (((_allCols = allCols[index + 1]) === null || _allCols === void 0 ? void 0 : _allCols.groupTitle) || '') ? '8px' : '0px'
13292
- })) : null), React__default.createElement(TableCell, {
13290
+ })) : null), columndata.sortable ? React__default.createElement(Container, {
13291
+ "$width": '100%',
13292
+ "$alignItems": 'center',
13293
+ "$gap": '6px',
13294
+ "$cursor": 'pointer',
13295
+ "$justifyContent": columndata.alignment === 'end' ? 'flex-end' : columndata.alignment === 'center' ? 'center' : 'flex-start',
13296
+ onClick: columndata.onSortClick
13297
+ }, React__default.createElement(TableCell, {
13293
13298
  maintext: (_columndata$maintext = columndata.maintext) != null ? _columndata$maintext : '',
13299
+ alignment: columndata.alignment
13300
+ }), React__default.createElement(Icon, {
13301
+ icon: columndata.sortDirection === 'desc' ? 'ArrowDown' : 'ArrowUp',
13302
+ size: 10,
13303
+ color: 'currentColor',
13304
+ cursor: 'pointer'
13305
+ })) : React__default.createElement(TableCell, {
13306
+ maintext: (_columndata$maintext2 = columndata.maintext) != null ? _columndata$maintext2 : '',
13294
13307
  width: columndata.width,
13295
13308
  minWidth: columndata.minWidth,
13296
13309
  maxWidth: columndata.maxWidth,