@majoo-ui/react 1.60.14-rc.3 → 1.60.14-rc.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.
@@ -1410,15 +1410,11 @@ export interface TableProps {
1410
1410
  */
1411
1411
  virtualized?: boolean;
1412
1412
  /**
1413
- * Set custom table header component
1413
+ * Add additional table header component
1414
1414
  */
1415
- customHeader?: React.ReactNode;
1416
- /**
1417
- * Hide table header row.
1418
- */
1419
- hideHeaderRow?: boolean;
1415
+ additionalHeader?: React.ReactNode;
1420
1416
  }
1421
- export declare function Table({ columns, data: rawData, keyId, pageIndex: controlledPageIndex, totalPage, totalData, fetchData, hideDataInfo, rowsPerPageOptions, emptyDataMessage, customEmptyDataProps: emptyDataProps, isLoading, css, headerCss, hideHeader, onSelectedChange, isInfiniteScroll, hasMoreItems, rowLimit, cellAlign, selectedIds, rowGroup, decoration, hiddenColumns, columnOrder, customRowsStyle, isMobileLayout, showDuplicatedData, onRowClick, hidePagination, searchQuery, additionalExceptionIds, onExpand, id, onColumnChange, virtualized, withoutLimit, customHeader, hideHeaderRow, }: TableProps): JSX.Element;
1417
+ export declare function Table({ columns, data: rawData, keyId, pageIndex: controlledPageIndex, totalPage, totalData, fetchData, hideDataInfo, rowsPerPageOptions, emptyDataMessage, customEmptyDataProps: emptyDataProps, isLoading, css, headerCss, hideHeader, onSelectedChange, isInfiniteScroll, hasMoreItems, rowLimit, cellAlign, selectedIds, rowGroup, decoration, hiddenColumns, columnOrder, customRowsStyle, isMobileLayout, showDuplicatedData, onRowClick, hidePagination, searchQuery, additionalExceptionIds, onExpand, id, onColumnChange, virtualized, withoutLimit, additionalHeader, }: TableProps): JSX.Element;
1422
1418
  export interface TableColumnProps {
1423
1419
  /**
1424
1420
  * Required if accessor is a function<br/>
package/index.esm.js CHANGED
@@ -23266,8 +23266,7 @@ function Table({
23266
23266
  onColumnChange,
23267
23267
  virtualized = true,
23268
23268
  withoutLimit = false,
23269
- customHeader,
23270
- hideHeaderRow
23269
+ additionalHeader
23271
23270
  }) {
23272
23271
  var _a, _b, _c, _d;
23273
23272
  const [openMenu, setOpen] = useState(false);
@@ -23700,45 +23699,46 @@ function Table({
23700
23699
  if (filteredHeader.length > 0 || filterHeader.length > 0) {
23701
23700
  visibleHeaders = visibleHeaders.filter(item => filteredHeader.includes(item.id) || filterHeader.includes(item.id));
23702
23701
  }
23703
- return jsxs(Fragment, {
23704
- children: [!hideHeaderRow && jsx(TableHeadRow$3, Object.assign({
23705
- css: cssTableCell
23706
- }, headerGroup.getHeaderGroupProps(), {
23707
- children: visibleHeaders.map((column, index) => {
23708
- const headerRender = column.render('Header');
23709
- return jsx(TableHeadCell$3, Object.assign({}, column.getHeaderProps(props => [props, !column.unsortable ? column.getSortByToggleProps({
23710
- title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
23711
- }) : {
23712
- onClick: column.onToggle
23713
- }, {
23714
- style: {
23702
+ return jsx(TableHeadRow$3, Object.assign({
23703
+ css: cssTableCell
23704
+ }, headerGroup.getHeaderGroupProps(), {
23705
+ children: visibleHeaders.map((column, index) => {
23706
+ const headerRender = column.render('Header');
23707
+ return jsx(TableHeadCell$3, Object.assign({}, column.getHeaderProps(props => [props, !column.unsortable ? column.getSortByToggleProps({
23708
+ title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
23709
+ }) : {
23710
+ onClick: column.onToggle
23711
+ }, {
23712
+ style: {
23713
+ width: column.colWidth,
23714
+ maxWidth: column.colMaxWidth,
23715
+ minWidth: column.colMinWidth
23716
+ }
23717
+ }]), {
23718
+ css: Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss)
23719
+ }, {
23720
+ children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
23721
+ isSortedDesc: column.isSortedDesc,
23722
+ unsortable: id ? true : column.unsortable,
23723
+ isToggleable: !!column.onToggle,
23724
+ isToggled: column.isToggled,
23725
+ css: {
23715
23726
  width: column.colWidth,
23716
23727
  maxWidth: column.colMaxWidth,
23717
23728
  minWidth: column.colMinWidth
23718
23729
  }
23719
- }]), {
23720
- css: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss), tableRowData.length === 0 && {
23721
- position: 'unset !important'
23722
- })
23723
23730
  }, {
23724
- children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
23725
- isSortedDesc: column.isSortedDesc,
23726
- unsortable: id ? true : column.unsortable,
23727
- isToggleable: !!column.onToggle,
23728
- isToggled: column.isToggled
23731
+ children: jsx(TableHeadCellContent, Object.assign({
23732
+ heading: "headerTable"
23729
23733
  }, {
23730
- children: jsx(TableHeadCellContent, Object.assign({
23731
- heading: "headerTable"
23732
- }, {
23733
- children: headerRender.toUpperCase()
23734
- }), void 0)
23735
- }), void 0) : headerRender
23736
- }), void 0);
23737
- })
23738
- }), void 0), customHeader]
23739
- }, void 0);
23734
+ children: headerRender.toUpperCase()
23735
+ }), void 0)
23736
+ }), void 0) : headerRender
23737
+ }), void 0);
23738
+ })
23739
+ }), void 0);
23740
23740
  })
23741
- }), void 0), jsxs(TableBody$3, Object.assign({}, getTableBodyProps(), {
23741
+ }), void 0), additionalHeader, jsxs(TableBody$3, Object.assign({}, getTableBodyProps(), {
23742
23742
  children: [isInfiniteScroll && paddingTop > 0 && jsx("tr", {
23743
23743
  children: jsx("td", {
23744
23744
  style: {
@@ -23755,7 +23755,7 @@ function Table({
23755
23755
  return i < 1 && renderRowDecorationReference(row, isContextMenu, i);
23756
23756
  }), jsx(ConditionalWrapper, Object.assign({
23757
23757
  condition: Boolean(decoration),
23758
- wrapper: child => jsx(TableRow$3, Object.assign({
23758
+ wrapper: child => tableRowData && tableRowData.length > 0 ? jsx(TableRow$3, Object.assign({
23759
23759
  css: {
23760
23760
  '&:hover': {
23761
23761
  backgroundColor: 'unset'
@@ -23774,7 +23774,7 @@ function Table({
23774
23774
  children: renderInfiniteScrollWrapper(renderTableDecorationChild(child))
23775
23775
  }), void 0)
23776
23776
  }), void 0)
23777
- }), void 0)
23777
+ }), void 0) : null
23778
23778
  }, {
23779
23779
  children: tableRowData.map((dataRow, i) => {
23780
23780
  var _a, _b, _c, _d;
package/index.umd.js CHANGED
@@ -23655,8 +23655,7 @@
23655
23655
  virtualized = _v === void 0 ? true : _v,
23656
23656
  _w = _a.withoutLimit,
23657
23657
  withoutLimit = _w === void 0 ? false : _w,
23658
- customHeader = _a.customHeader,
23659
- hideHeaderRow = _a.hideHeaderRow;
23658
+ additionalHeader = _a.additionalHeader;
23660
23659
  var _x = React.useState(false),
23661
23660
  openMenu = _x[0],
23662
23661
  setOpen = _x[1];
@@ -24136,47 +24135,48 @@
24136
24135
  return filteredHeader.includes(item.id) || filterHeader.includes(item.id);
24137
24136
  });
24138
24137
  }
24139
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
24140
- children: [!hideHeaderRow && jsxRuntime.jsx(TableHeadRow$3, __assign({
24141
- css: cssTableCell
24142
- }, headerGroup.getHeaderGroupProps(), {
24143
- children: visibleHeaders.map(function (column, index) {
24144
- var headerRender = column.render('Header');
24145
- return jsxRuntime.jsx(TableHeadCell$3, __assign({}, column.getHeaderProps(function (props) {
24146
- return [props, !column.unsortable ? column.getSortByToggleProps({
24147
- title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
24148
- }) : {
24149
- onClick: column.onToggle
24150
- }, {
24151
- style: {
24152
- width: column.colWidth,
24153
- maxWidth: column.colMaxWidth,
24154
- minWidth: column.colMinWidth
24155
- }
24156
- }];
24157
- }), {
24158
- css: __assign(__assign(__assign(__assign(__assign({}, cssTableCell), stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss), tableRowData.length === 0 && {
24159
- position: 'unset !important'
24160
- })
24138
+ return jsxRuntime.jsx(TableHeadRow$3, __assign({
24139
+ css: cssTableCell
24140
+ }, headerGroup.getHeaderGroupProps(), {
24141
+ children: visibleHeaders.map(function (column, index) {
24142
+ var headerRender = column.render('Header');
24143
+ return jsxRuntime.jsx(TableHeadCell$3, __assign({}, column.getHeaderProps(function (props) {
24144
+ return [props, !column.unsortable ? column.getSortByToggleProps({
24145
+ title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
24146
+ }) : {
24147
+ onClick: column.onToggle
24161
24148
  }, {
24162
- children: typeof headerRender === 'string' ? jsxRuntime.jsx(TableHeaderCellContainer, __assign({
24163
- isSortedDesc: column.isSortedDesc,
24164
- unsortable: id ? true : column.unsortable,
24165
- isToggleable: !!column.onToggle,
24166
- isToggled: column.isToggled
24149
+ style: {
24150
+ width: column.colWidth,
24151
+ maxWidth: column.colMaxWidth,
24152
+ minWidth: column.colMinWidth
24153
+ }
24154
+ }];
24155
+ }), {
24156
+ css: __assign(__assign(__assign(__assign({}, cssTableCell), stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss)
24157
+ }, {
24158
+ children: typeof headerRender === 'string' ? jsxRuntime.jsx(TableHeaderCellContainer, __assign({
24159
+ isSortedDesc: column.isSortedDesc,
24160
+ unsortable: id ? true : column.unsortable,
24161
+ isToggleable: !!column.onToggle,
24162
+ isToggled: column.isToggled,
24163
+ css: {
24164
+ width: column.colWidth,
24165
+ maxWidth: column.colMaxWidth,
24166
+ minWidth: column.colMinWidth
24167
+ }
24168
+ }, {
24169
+ children: jsxRuntime.jsx(TableHeadCellContent, __assign({
24170
+ heading: "headerTable"
24167
24171
  }, {
24168
- children: jsxRuntime.jsx(TableHeadCellContent, __assign({
24169
- heading: "headerTable"
24170
- }, {
24171
- children: headerRender.toUpperCase()
24172
- }), void 0)
24173
- }), void 0) : headerRender
24174
- }), void 0);
24175
- })
24176
- }), void 0), customHeader]
24177
- }, void 0);
24172
+ children: headerRender.toUpperCase()
24173
+ }), void 0)
24174
+ }), void 0) : headerRender
24175
+ }), void 0);
24176
+ })
24177
+ }), void 0);
24178
24178
  })
24179
- }), void 0), jsxRuntime.jsxs(TableBody$3, __assign({}, getTableBodyProps(), {
24179
+ }), void 0), additionalHeader, jsxRuntime.jsxs(TableBody$3, __assign({}, getTableBodyProps(), {
24180
24180
  children: [isInfiniteScroll && paddingTop > 0 && jsxRuntime.jsx("tr", {
24181
24181
  children: jsxRuntime.jsx("td", {
24182
24182
  style: {
@@ -24194,7 +24194,7 @@
24194
24194
  }), jsxRuntime.jsx(ConditionalWrapper, __assign({
24195
24195
  condition: Boolean(decoration),
24196
24196
  wrapper: function (child) {
24197
- return jsxRuntime.jsx(TableRow$3, __assign({
24197
+ return tableRowData && tableRowData.length > 0 ? jsxRuntime.jsx(TableRow$3, __assign({
24198
24198
  css: {
24199
24199
  '&:hover': {
24200
24200
  backgroundColor: 'unset'
@@ -24213,7 +24213,7 @@
24213
24213
  children: renderInfiniteScrollWrapper(renderTableDecorationChild(child))
24214
24214
  }), void 0)
24215
24215
  }), void 0)
24216
- }), void 0);
24216
+ }), void 0) : null;
24217
24217
  }
24218
24218
  }, {
24219
24219
  children: tableRowData.map(function (dataRow, i) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.60.14-rc.3",
3
+ "version": "1.60.14-rc.5",
4
4
  "dependencies": {
5
5
  "@majoo-ui/core": "^1.31.3",
6
6
  "@majoo-ui/helpers": "^1.30.5",