@majoo-ui/react 1.58.20-rc.2 → 1.58.20-rc.4

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.
@@ -54,9 +54,7 @@ export declare const ModalDialogFooter: import("@stitches/react/types/styled-com
54
54
  }) => {
55
55
  marginBottom: {
56
56
  readonly [$$ScaleValue]: "space";
57
- }; /**
58
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
59
- */
57
+ };
60
58
  };
61
59
  ml: (value: {
62
60
  readonly [$$ScaleValue]: "space";
@@ -152,9 +150,7 @@ export declare const ModalDialogTitle: import("@stitches/react/types/styled-comp
152
150
  }) => {
153
151
  marginBottom: {
154
152
  readonly [$$ScaleValue]: "space";
155
- }; /**
156
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
157
- */
153
+ };
158
154
  };
159
155
  ml: (value: {
160
156
  readonly [$$ScaleValue]: "space";
@@ -250,9 +246,7 @@ export declare const ModalDialogContent: import("@stitches/react/types/styled-co
250
246
  }) => {
251
247
  marginBottom: {
252
248
  readonly [$$ScaleValue]: "space";
253
- }; /**
254
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
255
- */
249
+ };
256
250
  };
257
251
  ml: (value: {
258
252
  readonly [$$ScaleValue]: "space";
@@ -296,7 +290,7 @@ export declare const ModalDialogContent: import("@stitches/react/types/styled-co
296
290
  backgroundColor: string;
297
291
  };
298
292
  }>>;
299
- export declare const ModalDialogTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>, {}, {
293
+ export declare const ModalDialogTrigger: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
300
294
  sm: "(min-width: 359px)";
301
295
  md: "(min-width: 767px)";
302
296
  lg: "(min-width: 1023px)";
@@ -348,9 +342,7 @@ export declare const ModalDialogTrigger: import("@stitches/react/types/styled-co
348
342
  }) => {
349
343
  marginBottom: {
350
344
  readonly [$$ScaleValue]: "space";
351
- }; /**
352
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
353
- */
345
+ };
354
346
  };
355
347
  ml: (value: {
356
348
  readonly [$$ScaleValue]: "space";
@@ -437,7 +429,7 @@ interface ModalDialogProps extends Omit<IDialog, 'children'>, DialogContentProps
437
429
  */
438
430
  declare const ModalDialog: {
439
431
  (props: ModalDialogProps): JSX.Element;
440
- Trigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>, {}, {
432
+ Trigger: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
441
433
  sm: "(min-width: 359px)";
442
434
  md: "(min-width: 767px)";
443
435
  lg: "(min-width: 1023px)";
@@ -489,9 +481,7 @@ declare const ModalDialog: {
489
481
  }) => {
490
482
  marginBottom: {
491
483
  readonly [$$ScaleValue]: "space";
492
- }; /**
493
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
494
- */
484
+ };
495
485
  };
496
486
  ml: (value: {
497
487
  readonly [$$ScaleValue]: "space";
@@ -587,9 +577,7 @@ declare const ModalDialog: {
587
577
  }) => {
588
578
  marginBottom: {
589
579
  readonly [$$ScaleValue]: "space";
590
- }; /**
591
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
592
- */
580
+ };
593
581
  };
594
582
  ml: (value: {
595
583
  readonly [$$ScaleValue]: "space";
@@ -685,9 +673,7 @@ declare const ModalDialog: {
685
673
  }) => {
686
674
  marginBottom: {
687
675
  readonly [$$ScaleValue]: "space";
688
- }; /**
689
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
690
- */
676
+ };
691
677
  };
692
678
  ml: (value: {
693
679
  readonly [$$ScaleValue]: "space";
@@ -783,9 +769,7 @@ declare const ModalDialog: {
783
769
  }) => {
784
770
  marginBottom: {
785
771
  readonly [$$ScaleValue]: "space";
786
- }; /**
787
- * @deprecated Use size or css props css={{width: width css property}} instead. This will be deleted in the future to limit unnecessary props.
788
- */
772
+ };
789
773
  };
790
774
  ml: (value: {
791
775
  readonly [$$ScaleValue]: "space";
@@ -1281,16 +1281,13 @@ export interface TableProps {
1281
1281
  */
1282
1282
  onExpand?: (expanded: object) => void;
1283
1283
  /**
1284
- * Additional id table for unique identifier each table
1285
- */
1286
- id?: string | null;
1287
- /**
1288
- * Option for customize column to show in table <br />
1284
+ * Additional id table for unique identifier each table <br />
1285
+ * if id exist, column in the header can be customize to show in table <br />
1289
1286
  * can be filled with 'string' value eg: 'product_table'
1290
1287
  */
1291
- customizableColumn?: string | null;
1288
+ id?: string | null;
1292
1289
  }
1293
- 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, customizableColumn, }: TableProps): JSX.Element;
1290
+ 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, }: TableProps): JSX.Element;
1294
1291
  export interface TableColumnProps {
1295
1292
  /**
1296
1293
  * Required if accessor is a function<br/>
package/index.esm.js CHANGED
@@ -20611,7 +20611,7 @@ const ModalDialogTitle = styled('div');
20611
20611
  ModalDialogTitle.displayName = 'ModalDialogTitle';
20612
20612
  const ModalDialogContent = styled('div');
20613
20613
  ModalDialogContent.displayName = 'ModalDialogContent';
20614
- const ModalDialogTrigger = styled(DialogTrigger);
20614
+ const ModalDialogTrigger = styled('div');
20615
20615
  ModalDialogTrigger.displayName = 'ModalDialogTrigger';
20616
20616
  const StyledContent$2 = styled(DialogContent, {
20617
20617
  top: 'auto',
@@ -21647,7 +21647,6 @@ function PaginationInfo(_ref) {
21647
21647
  columnNumber: 11
21648
21648
  }
21649
21649
  }, limits == null ? void 0 : limits.map(limit => /*#__PURE__*/React__default.createElement(Flex$1, {
21650
- key: limit.toString(),
21651
21650
  css: {
21652
21651
  height: 44,
21653
21652
  width: '100%',
@@ -22566,25 +22565,7 @@ const cssAfter = {
22566
22565
  pointerEvents: 'none',
22567
22566
  boxSizing: 'border'
22568
22567
  };
22569
- const cssBtnCustom = {
22570
- position: 'sticky',
22571
- top: 0,
22572
- right: 0,
22573
- display: 'flex',
22574
- justifyContent: 'center',
22575
- alignItems: 'center',
22576
- '@sm': {
22577
- zIndex: 3
22578
- },
22579
- '@md': {
22580
- zIndex: 'unset'
22581
- },
22582
- backgroundColor: 'white',
22583
- '&::after': Object.assign(Object.assign({}, cssAfter), {
22584
- right: '50%',
22585
- boxShadow: 'inset -10px 0 10px -10px #00000026'
22586
- })
22587
- };
22568
+
22588
22569
  const stickyShadowStyling = (column, tableScrollPosition, scrollAreaWidth) => {
22589
22570
  if ((column === null || column === void 0 ? void 0 : column.sticky) && (column === null || column === void 0 ? void 0 : column.shadow)) {
22590
22571
  return column.sticky === 'left' ? {
@@ -22712,13 +22693,13 @@ function HeaderMenuOption(props) {
22712
22693
  defaultValue: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.map(item => item.id),
22713
22694
  value: items.length > 0 ? items : visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.map(item => item.id)
22714
22695
  }, {
22715
- children: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.filter(val => typeof val.Header === 'string').map((item, index, row) => jsxs(React.Fragment, {
22696
+ children: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.filter(val => typeof val.Header === 'string').map((item, index, row) => jsxs(Fragment, {
22716
22697
  children: [jsx(InputCheckbox, {
22717
22698
  label: item.Header,
22718
22699
  value: item.id,
22719
22700
  disabled: index === 0
22720
- }, void 0), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22721
- }, item.id))
22701
+ }, index), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22702
+ }, void 0))
22722
22703
  }), void 0)
22723
22704
  }), void 0)
22724
22705
  }), void 0)]
@@ -22738,8 +22719,8 @@ function HeaderMenuOption(props) {
22738
22719
  portalled: true,
22739
22720
  isMobile: false,
22740
22721
  style: {
22741
- right: '100%',
22742
- left: 'unset'
22722
+ right: 20,
22723
+ left: null
22743
22724
  }
22744
22725
  }, {
22745
22726
  children: jsx(Flex$1, Object.assign({
@@ -22750,10 +22731,9 @@ function HeaderMenuOption(props) {
22750
22731
  boxShadow: '$medium',
22751
22732
  backgroundColor: 'white',
22752
22733
  maxHeight: 440,
22753
- height: rowData.length <= 5 ? 300 : 'fit-content',
22754
22734
  minWidth: 167,
22755
- width: 'fit-content',
22756
- overflowY: visibleHeaders.filter(val => typeof val.Header === 'string').length > 7 || rowData.length <= 5 ? 'scroll' : 'none'
22735
+ width: 'max-content',
22736
+ overflowY: visibleHeaders.filter(val => typeof val.Header === 'string').length > 7 ? 'scroll' : 'none'
22757
22737
  }
22758
22738
  }, {
22759
22739
  children: jsx(CheckboxGroup, Object.assign({
@@ -22762,13 +22742,13 @@ function HeaderMenuOption(props) {
22762
22742
  defaultValue: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.map(item => item.id),
22763
22743
  value: items.length > 0 ? items : visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.map(item => item.id)
22764
22744
  }, {
22765
- children: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.filter(val => typeof val.Header === 'string').map((item, index, row) => jsxs(React.Fragment, {
22745
+ children: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.filter(val => typeof val.Header === 'string').map((item, index, row) => jsxs(Fragment, {
22766
22746
  children: [jsx(InputCheckbox, {
22767
22747
  label: item.Header,
22768
22748
  value: item.id,
22769
22749
  disabled: index === 0
22770
- }, void 0), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22771
- }, item.id))
22750
+ }, index), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22751
+ }, void 0))
22772
22752
  }), void 0)
22773
22753
  }), void 0)
22774
22754
  }), void 0)]
@@ -22818,17 +22798,16 @@ function Table({
22818
22798
  searchQuery,
22819
22799
  additionalExceptionIds = [],
22820
22800
  onExpand,
22821
- id = null,
22822
- customizableColumn = null
22801
+ id = null
22823
22802
  }) {
22824
- var _a, _b, _c, _d;
22803
+ var _a, _b, _c, _d, _e;
22825
22804
  const [openMenu, setOpen] = useState(false);
22826
22805
  const [limit, setLimit] = useState(rowLimit);
22827
22806
  const [dataRow, setDataRow] = useState({});
22828
22807
  const [tableScrollPosition, setTableScrollPosition] = useState('start');
22829
22808
  const [scrollAreaWidth, setScrollAreaWidth] = useState(0);
22830
22809
  const [stateSelectedRowIds, setStateSelectedRowIds] = useState([]);
22831
- const [filterHeader, setFilterHeader] = useLocalStorageState(`menu:${customizableColumn}`, []);
22810
+ const [filterHeader, setFilterHeader] = useLocalStorageState(`menu:${id}`, []);
22832
22811
  const {
22833
22812
  t
22834
22813
  } = useTranslation('MajooUI/table');
@@ -23177,6 +23156,7 @@ function Table({
23177
23156
  const cssTableCell = {
23178
23157
  backgroundColor: 'white'
23179
23158
  };
23159
+ const tableHeight = (_c = document.getElementById('table-container')) === null || _c === void 0 ? void 0 : _c.offsetHeight;
23180
23160
  return jsxs(Box, Object.assign({
23181
23161
  css: {
23182
23162
  position: 'relative',
@@ -23203,8 +23183,9 @@ function Table({
23203
23183
  }, {
23204
23184
  children: "Loading .... "
23205
23185
  }), void 0)
23206
- }), void 0), !isMobile || customizableColumn ? jsxs(Fragment, {
23186
+ }), void 0), !isMobile || id ? jsxs(Fragment, {
23207
23187
  children: [jsxs(TableContainer$3, Object.assign({
23188
+ id: "table-container",
23208
23189
  css: css,
23209
23190
  ref: scrollerRef,
23210
23191
  decoration: Boolean(decoration),
@@ -23234,10 +23215,10 @@ function Table({
23234
23215
  if (filterHeader.length > 0) {
23235
23216
  visibleHeaders = visibleHeaders.filter(item => filterHeader.includes(item.id));
23236
23217
  }
23237
- return jsxs(TableHeadRow$3, Object.assign({
23218
+ return jsx(TableHeadRow$3, Object.assign({
23238
23219
  css: cssTableCell
23239
23220
  }, headerGroup.getHeaderGroupProps(), {
23240
- children: [visibleHeaders.map((column, index) => {
23221
+ children: visibleHeaders.map((column, index) => {
23241
23222
  const headerRender = column.render('Header');
23242
23223
  return jsx(TableHeadCell$3, Object.assign({}, column.getHeaderProps(props => [props, !column.unsortable ? column.getSortByToggleProps({
23243
23224
  title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
@@ -23254,7 +23235,7 @@ function Table({
23254
23235
  }, {
23255
23236
  children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
23256
23237
  isSortedDesc: column.isSortedDesc,
23257
- unsortable: customizableColumn ? true : column.unsortable,
23238
+ unsortable: id ? true : column.unsortable,
23258
23239
  isToggleable: !!column.onToggle,
23259
23240
  isToggled: column.isToggled
23260
23241
  }, {
@@ -23265,38 +23246,7 @@ function Table({
23265
23246
  }), void 0)
23266
23247
  }), void 0) : headerRender
23267
23248
  }), void 0);
23268
- }), customizableColumn && jsx(TableHeadCell$3, Object.assign({
23269
- css: cssBtnCustom
23270
- }, {
23271
- children: jsx(HeaderMenuOption, Object.assign({
23272
- rowData: tableRowData,
23273
- open: openMenu,
23274
- id: customizableColumn,
23275
- onOpenChange: setOpen,
23276
- onChange: useCallback(items => {
23277
- setFilterHeader(items);
23278
- }, [filterHeader]),
23279
- headerGroups: headerGroups,
23280
- filterHeader: filterHeader
23281
- }, {
23282
- children: jsx(IconButton, Object.assign({
23283
- css: {
23284
- '&:hover': {
23285
- backgroundColor: 'unset'
23286
- },
23287
- backgroundColor: '#c0c4c4',
23288
- padding: 0,
23289
- boxShadow: '0px 22px 43px 0px rgba(0, 0, 0, 0.08), 0px 9px 24px 0px rgba(0, 0, 0, 0.09), 0px 3px 9px 0px rgba(0, 0, 0, 0.13)'
23290
- },
23291
- onClick: () => setOpen(!openMenu),
23292
- buttonType: "secondary"
23293
- }, {
23294
- children: jsx(PlusPrimitive, {
23295
- size: "20"
23296
- }, void 0)
23297
- }), void 0)
23298
- }), void 0)
23299
- }), void 0)]
23249
+ })
23300
23250
  }), void 0);
23301
23251
  })
23302
23252
  }), void 0), jsxs(TableBody$3, Object.assign({}, getTableBodyProps(), {
@@ -23306,7 +23256,7 @@ function Table({
23306
23256
  height: `${paddingTop}px`
23307
23257
  }
23308
23258
  }, void 0)
23309
- }, void 0), (_c = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _c === void 0 ? void 0 : _c.call(decoration), decoration && page.map((row, i) => {
23259
+ }, void 0), (_d = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _d === void 0 ? void 0 : _d.call(decoration), decoration && page.map((row, i) => {
23310
23260
  var _a;
23311
23261
  prepareRow(row);
23312
23262
  const isContextMenu = (_a = row.cells.filter(cell => {
@@ -23377,10 +23327,10 @@ function Table({
23377
23327
  variant: "contentButton"
23378
23328
  }, {
23379
23329
  children: row.cells[0].render('Cell')
23380
- }), void 0)), jsxs(TableRow$3, Object.assign({
23330
+ }), void 0)), jsx(TableRow$3, Object.assign({
23381
23331
  css: customStyle
23382
23332
  }, row && row.getRowProps ? row.getRowProps() : {}, {
23383
- children: [row.cells.filter(cell => filterHeader.length > 0 ? filterHeader.includes(cell.column.id) : cell).filter(cell => !cell.column.isSubRow).map(cell => {
23333
+ children: row.cells.filter(cell => filterHeader.length > 0 ? filterHeader.includes(cell.column.id) : cell).filter(cell => !cell.column.isSubRow).map((cell, index, row) => {
23384
23334
  var _a, _b, _c;
23385
23335
  let visibleHeaders = (_a = headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups[0]) === null || _a === void 0 ? void 0 : _a.headers.filter(column => !column.isSubRow);
23386
23336
  if (filterHeader.length > 0) {
@@ -23389,11 +23339,13 @@ function Table({
23389
23339
  const collId = (_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.id;
23390
23340
  const exceptionId = (_c = ['expander', 'multiple-expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _c === void 0 ? void 0 : _c.includes(collId);
23391
23341
  return jsx(TableCell$3, Object.assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
23392
- css: Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), {
23342
+ css: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), {
23393
23343
  padding: !isContextMenu || exceptionId ? collId === 'expander' || collId === 'multiple-expander' ? '20px 4px' : '20px 8px' : '',
23394
23344
  verticalAlign: cell.column.accessor ? cellAlign : 'center',
23395
23345
  cursor: onRowClick ? 'pointer' : 'unset'
23396
- }), stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)),
23346
+ }), stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)), {
23347
+ paddingRight: row.length === index + 1 ? 30 : null
23348
+ }),
23397
23349
  onClick: () => {
23398
23350
  if (!exceptionId) {
23399
23351
  handleRowClick(row, i);
@@ -23426,14 +23378,7 @@ function Table({
23426
23378
  }), void 0)
23427
23379
  }), void 0)
23428
23380
  }), void 0);
23429
- }), customizableColumn && jsx(TableCell$3, {
23430
- css: Object.assign(Object.assign({}, cssBtnCustom), {
23431
- maxHeight: 100,
23432
- '&::after': Object.assign(Object.assign({}, cssBtnCustom['&::after']), {
23433
- height: 100
23434
- })
23435
- })
23436
- }, void 0)]
23381
+ })
23437
23382
  }), void 0), row.isExpanded ? subRowCells.map((cell, index) => jsxs(TableRow$3, Object.assign({
23438
23383
  subRow: true
23439
23384
  }, {
@@ -23485,7 +23430,7 @@ function Table({
23485
23430
  }))]
23486
23431
  }, row.id);
23487
23432
  })
23488
- }), void 0), (_d = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _d === void 0 ? void 0 : _d.call(decoration), isInfiniteScroll && paddingBottom > 0 && jsx("tr", {
23433
+ }), void 0), (_e = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _e === void 0 ? void 0 : _e.call(decoration), isInfiniteScroll && paddingBottom > 0 && jsx("tr", {
23489
23434
  children: jsx("td", {
23490
23435
  style: {
23491
23436
  height: `${paddingBottom}px`
@@ -23494,7 +23439,50 @@ function Table({
23494
23439
  }, void 0)]
23495
23440
  }), void 0)]
23496
23441
  }), void 0)
23497
- }), void 0), renderContextMenu()]
23442
+ }), void 0), renderContextMenu(), id && jsxs(Fragment, {
23443
+ children: [jsx(HeaderMenuOption, Object.assign({
23444
+ rowData: tableRowData,
23445
+ open: openMenu,
23446
+ id: id,
23447
+ onOpenChange: setOpen,
23448
+ onChange: useCallback(items => {
23449
+ setFilterHeader(items);
23450
+ }, [filterHeader]),
23451
+ headerGroups: headerGroups,
23452
+ filterHeader: filterHeader
23453
+ }, {
23454
+ children: jsx(IconButton, Object.assign({
23455
+ css: {
23456
+ zIndex: '$docked',
23457
+ position: 'fixed',
23458
+ top: 20,
23459
+ right: 10,
23460
+ '&:hover': {
23461
+ backgroundColor: 'unset'
23462
+ },
23463
+ backgroundColor: '#c0c4c4',
23464
+ padding: 0,
23465
+ boxShadow: '0px 22px 43px 0px rgba(0, 0, 0, 0.08), 0px 9px 24px 0px rgba(0, 0, 0, 0.09), 0px 3px 9px 0px rgba(0, 0, 0, 0.13)'
23466
+ },
23467
+ onClick: () => setOpen(!openMenu),
23468
+ buttonType: "secondary"
23469
+ }, {
23470
+ children: jsx(PlusPrimitive, {
23471
+ size: "20"
23472
+ }, void 0)
23473
+ }), void 0)
23474
+ }), void 0), jsx(Box, {
23475
+ css: {
23476
+ backgroundColor: 'white',
23477
+ position: 'fixed',
23478
+ top: 0,
23479
+ height: tableHeight - 1,
23480
+ right: 0,
23481
+ width: 20,
23482
+ boxShadow: ' -2px 0px 5px 0px #00000026'
23483
+ }
23484
+ }, void 0)]
23485
+ }, void 0)]
23498
23486
  }), void 0), !isInfiniteScroll && jsx(Box, Object.assign({
23499
23487
  css: {
23500
23488
  width: '100%'
package/index.umd.js CHANGED
@@ -20911,7 +20911,7 @@
20911
20911
  ModalDialogTitle.displayName = 'ModalDialogTitle';
20912
20912
  var ModalDialogContent = styled('div');
20913
20913
  ModalDialogContent.displayName = 'ModalDialogContent';
20914
- var ModalDialogTrigger = styled(DialogTrigger);
20914
+ var ModalDialogTrigger = styled('div');
20915
20915
  ModalDialogTrigger.displayName = 'ModalDialogTrigger';
20916
20916
  var StyledContent$2 = styled(DialogContent, {
20917
20917
  top: 'auto',
@@ -21948,7 +21948,6 @@
21948
21948
  columnNumber: 11
21949
21949
  }
21950
21950
  }, limits == null ? void 0 : limits.map(limit => /*#__PURE__*/React__default["default"].createElement(Flex$1, {
21951
- key: limit.toString(),
21952
21951
  css: {
21953
21952
  height: 44,
21954
21953
  width: '100%',
@@ -22886,25 +22885,7 @@
22886
22885
  pointerEvents: 'none',
22887
22886
  boxSizing: 'border'
22888
22887
  };
22889
- var cssBtnCustom = {
22890
- position: 'sticky',
22891
- top: 0,
22892
- right: 0,
22893
- display: 'flex',
22894
- justifyContent: 'center',
22895
- alignItems: 'center',
22896
- '@sm': {
22897
- zIndex: 3
22898
- },
22899
- '@md': {
22900
- zIndex: 'unset'
22901
- },
22902
- backgroundColor: 'white',
22903
- '&::after': __assign(__assign({}, cssAfter), {
22904
- right: '50%',
22905
- boxShadow: 'inset -10px 0 10px -10px #00000026'
22906
- })
22907
- };
22888
+
22908
22889
  var stickyShadowStyling = function stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth) {
22909
22890
  if ((column === null || column === void 0 ? void 0 : column.sticky) && (column === null || column === void 0 ? void 0 : column.shadow)) {
22910
22891
  return column.sticky === 'left' ? {
@@ -22999,8 +22980,8 @@
22999
22980
  children = props.children,
23000
22981
  headerGroups = props.headerGroups;
23001
22982
  props.id;
23002
- var items = props.filterHeader,
23003
- rowData = props.rowData;
22983
+ var items = props.filterHeader;
22984
+ props.rowData;
23004
22985
  var headers = (headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups[0]).headers;
23005
22986
  var visibleHeaders = headers.filter(function (column) {
23006
22987
  return !column.isSubRow;
@@ -23043,13 +23024,13 @@
23043
23024
  children: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.filter(function (val) {
23044
23025
  return typeof val.Header === 'string';
23045
23026
  }).map(function (item, index, row) {
23046
- return jsxRuntime.jsxs(React__namespace.Fragment, {
23027
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
23047
23028
  children: [jsxRuntime.jsx(InputCheckbox, {
23048
23029
  label: item.Header,
23049
23030
  value: item.id,
23050
23031
  disabled: index === 0
23051
- }, void 0), row.length !== index + 1 && jsxRuntime.jsx(Separator$2, {}, void 0)]
23052
- }, item.id);
23032
+ }, index), row.length !== index + 1 && jsxRuntime.jsx(Separator$2, {}, void 0)]
23033
+ }, void 0);
23053
23034
  })
23054
23035
  }), void 0)
23055
23036
  }), void 0)
@@ -23070,8 +23051,8 @@
23070
23051
  portalled: true,
23071
23052
  isMobile: false,
23072
23053
  style: {
23073
- right: '100%',
23074
- left: 'unset'
23054
+ right: 20,
23055
+ left: null
23075
23056
  }
23076
23057
  }, {
23077
23058
  children: jsxRuntime.jsx(Flex$1, __assign({
@@ -23082,12 +23063,11 @@
23082
23063
  boxShadow: '$medium',
23083
23064
  backgroundColor: 'white',
23084
23065
  maxHeight: 440,
23085
- height: rowData.length <= 5 ? 300 : 'fit-content',
23086
23066
  minWidth: 167,
23087
- width: 'fit-content',
23067
+ width: 'max-content',
23088
23068
  overflowY: visibleHeaders.filter(function (val) {
23089
23069
  return typeof val.Header === 'string';
23090
- }).length > 7 || rowData.length <= 5 ? 'scroll' : 'none'
23070
+ }).length > 7 ? 'scroll' : 'none'
23091
23071
  }
23092
23072
  }, {
23093
23073
  children: jsxRuntime.jsx(CheckboxGroup, __assign({
@@ -23103,13 +23083,13 @@
23103
23083
  children: visibleHeaders === null || visibleHeaders === void 0 ? void 0 : visibleHeaders.filter(function (val) {
23104
23084
  return typeof val.Header === 'string';
23105
23085
  }).map(function (item, index, row) {
23106
- return jsxRuntime.jsxs(React__namespace.Fragment, {
23086
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
23107
23087
  children: [jsxRuntime.jsx(InputCheckbox, {
23108
23088
  label: item.Header,
23109
23089
  value: item.id,
23110
23090
  disabled: index === 0
23111
- }, void 0), row.length !== index + 1 && jsxRuntime.jsx(Separator$2, {}, void 0)]
23112
- }, item.id);
23091
+ }, index), row.length !== index + 1 && jsxRuntime.jsx(Separator$2, {}, void 0)]
23092
+ }, void 0);
23113
23093
  })
23114
23094
  }), void 0)
23115
23095
  }), void 0)
@@ -23129,37 +23109,37 @@
23129
23109
  return [state, setState];
23130
23110
  };
23131
23111
  function Table(_a) {
23132
- var _b, _c, _d, _e;
23112
+ var _b, _c, _d, _e, _f;
23133
23113
  var columns = _a.columns,
23134
23114
  rawData = _a.data,
23135
- _f = _a.keyId,
23136
- keyId = _f === void 0 ? 'id' : _f,
23137
- _g = _a.pageIndex,
23138
- controlledPageIndex = _g === void 0 ? 0 : _g,
23115
+ _g = _a.keyId,
23116
+ keyId = _g === void 0 ? 'id' : _g,
23117
+ _h = _a.pageIndex,
23118
+ controlledPageIndex = _h === void 0 ? 0 : _h,
23139
23119
  totalPage = _a.totalPage,
23140
- _h = _a.totalData,
23141
- totalData = _h === void 0 ? 0 : _h,
23120
+ _j = _a.totalData,
23121
+ totalData = _j === void 0 ? 0 : _j,
23142
23122
  fetchData = _a.fetchData,
23143
- _j = _a.hideDataInfo,
23144
- hideDataInfo = _j === void 0 ? false : _j,
23145
- _k = _a.rowsPerPageOptions,
23146
- rowsPerPageOptions = _k === void 0 ? [10, 25, 50, 100] : _k;
23123
+ _k = _a.hideDataInfo,
23124
+ hideDataInfo = _k === void 0 ? false : _k,
23125
+ _l = _a.rowsPerPageOptions,
23126
+ rowsPerPageOptions = _l === void 0 ? [10, 25, 50, 100] : _l;
23147
23127
  _a.emptyDataMessage;
23148
23128
  var emptyDataProps = _a.customEmptyDataProps,
23149
- _m = _a.isLoading,
23150
- isLoading = _m === void 0 ? false : _m,
23129
+ _o = _a.isLoading,
23130
+ isLoading = _o === void 0 ? false : _o,
23151
23131
  css = _a.css,
23152
23132
  headerCss = _a.headerCss,
23153
23133
  hideHeader = _a.hideHeader,
23154
23134
  onSelectedChange = _a.onSelectedChange,
23155
- _o = _a.isInfiniteScroll,
23156
- isInfiniteScroll = _o === void 0 ? false : _o,
23157
- _p = _a.hasMoreItems,
23158
- hasMoreItems = _p === void 0 ? true : _p,
23159
- _q = _a.rowLimit,
23160
- rowLimit = _q === void 0 ? 10 : _q,
23161
- _r = _a.cellAlign,
23162
- cellAlign = _r === void 0 ? 'center' : _r,
23135
+ _p = _a.isInfiniteScroll,
23136
+ isInfiniteScroll = _p === void 0 ? false : _p,
23137
+ _q = _a.hasMoreItems,
23138
+ hasMoreItems = _q === void 0 ? true : _q,
23139
+ _r = _a.rowLimit,
23140
+ rowLimit = _r === void 0 ? 10 : _r,
23141
+ _s = _a.cellAlign,
23142
+ cellAlign = _s === void 0 ? 'center' : _s,
23163
23143
  selectedIds = _a.selectedIds,
23164
23144
  rowGroup = _a.rowGroup,
23165
23145
  decoration = _a.decoration,
@@ -23169,15 +23149,14 @@
23169
23149
  isMobileLayout = _a.isMobileLayout,
23170
23150
  showDuplicatedData = _a.showDuplicatedData,
23171
23151
  onRowClick = _a.onRowClick,
23172
- _s = _a.hidePagination,
23173
- hidePagination = _s === void 0 ? false : _s,
23152
+ _t = _a.hidePagination,
23153
+ hidePagination = _t === void 0 ? false : _t,
23174
23154
  searchQuery = _a.searchQuery,
23175
- _t = _a.additionalExceptionIds,
23176
- additionalExceptionIds = _t === void 0 ? [] : _t,
23177
- onExpand = _a.onExpand;
23178
- _a.id;
23179
- var _v = _a.customizableColumn,
23180
- customizableColumn = _v === void 0 ? null : _v;
23155
+ _u = _a.additionalExceptionIds,
23156
+ additionalExceptionIds = _u === void 0 ? [] : _u,
23157
+ onExpand = _a.onExpand,
23158
+ _v = _a.id,
23159
+ id = _v === void 0 ? null : _v;
23181
23160
  var _w = React.useState(false),
23182
23161
  openMenu = _w[0],
23183
23162
  setOpen = _w[1];
@@ -23196,7 +23175,7 @@
23196
23175
  var _1 = React.useState([]),
23197
23176
  stateSelectedRowIds = _1[0],
23198
23177
  setStateSelectedRowIds = _1[1];
23199
- var _2 = useLocalStorageState("menu:".concat(customizableColumn), []),
23178
+ var _2 = useLocalStorageState("menu:".concat(id), []),
23200
23179
  filterHeader = _2[0],
23201
23180
  setFilterHeader = _2[1];
23202
23181
  var t = reactI18next.useTranslation('MajooUI/table').t;
@@ -23574,6 +23553,7 @@
23574
23553
  var cssTableCell = {
23575
23554
  backgroundColor: 'white'
23576
23555
  };
23556
+ var tableHeight = (_d = document.getElementById('table-container')) === null || _d === void 0 ? void 0 : _d.offsetHeight;
23577
23557
  return jsxRuntime.jsxs(Box, __assign({
23578
23558
  css: {
23579
23559
  position: 'relative',
@@ -23600,8 +23580,9 @@
23600
23580
  }, {
23601
23581
  children: "Loading .... "
23602
23582
  }), void 0)
23603
- }), void 0), !isMobile || customizableColumn ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
23583
+ }), void 0), !isMobile || id ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
23604
23584
  children: [jsxRuntime.jsxs(TableContainer$3, __assign({
23585
+ id: "table-container",
23605
23586
  css: css,
23606
23587
  ref: scrollerRef,
23607
23588
  decoration: Boolean(decoration),
@@ -23637,10 +23618,10 @@
23637
23618
  return filterHeader.includes(item.id);
23638
23619
  });
23639
23620
  }
23640
- return jsxRuntime.jsxs(TableHeadRow$3, __assign({
23621
+ return jsxRuntime.jsx(TableHeadRow$3, __assign({
23641
23622
  css: cssTableCell
23642
23623
  }, headerGroup.getHeaderGroupProps(), {
23643
- children: [visibleHeaders.map(function (column, index) {
23624
+ children: visibleHeaders.map(function (column, index) {
23644
23625
  var headerRender = column.render('Header');
23645
23626
  return jsxRuntime.jsx(TableHeadCell$3, __assign({}, column.getHeaderProps(function (props) {
23646
23627
  return [props, !column.unsortable ? column.getSortByToggleProps({
@@ -23659,7 +23640,7 @@
23659
23640
  }, {
23660
23641
  children: typeof headerRender === 'string' ? jsxRuntime.jsx(TableHeaderCellContainer, __assign({
23661
23642
  isSortedDesc: column.isSortedDesc,
23662
- unsortable: customizableColumn ? true : column.unsortable,
23643
+ unsortable: id ? true : column.unsortable,
23663
23644
  isToggleable: !!column.onToggle,
23664
23645
  isToggled: column.isToggled
23665
23646
  }, {
@@ -23670,40 +23651,7 @@
23670
23651
  }), void 0)
23671
23652
  }), void 0) : headerRender
23672
23653
  }), void 0);
23673
- }), customizableColumn && jsxRuntime.jsx(TableHeadCell$3, __assign({
23674
- css: cssBtnCustom
23675
- }, {
23676
- children: jsxRuntime.jsx(HeaderMenuOption, __assign({
23677
- rowData: tableRowData,
23678
- open: openMenu,
23679
- id: customizableColumn,
23680
- onOpenChange: setOpen,
23681
- onChange: React.useCallback(function (items) {
23682
- setFilterHeader(items);
23683
- }, [filterHeader]),
23684
- headerGroups: headerGroups,
23685
- filterHeader: filterHeader
23686
- }, {
23687
- children: jsxRuntime.jsx(IconButton, __assign({
23688
- css: {
23689
- '&:hover': {
23690
- backgroundColor: 'unset'
23691
- },
23692
- backgroundColor: '#c0c4c4',
23693
- padding: 0,
23694
- boxShadow: '0px 22px 43px 0px rgba(0, 0, 0, 0.08), 0px 9px 24px 0px rgba(0, 0, 0, 0.09), 0px 3px 9px 0px rgba(0, 0, 0, 0.13)'
23695
- },
23696
- onClick: function () {
23697
- return setOpen(!openMenu);
23698
- },
23699
- buttonType: "secondary"
23700
- }, {
23701
- children: jsxRuntime.jsx(icons.PlusPrimitive, {
23702
- size: "20"
23703
- }, void 0)
23704
- }), void 0)
23705
- }), void 0)
23706
- }), void 0)]
23654
+ })
23707
23655
  }), void 0);
23708
23656
  })
23709
23657
  }), void 0), jsxRuntime.jsxs(TableBody$3, __assign({}, getTableBodyProps(), {
@@ -23713,7 +23661,7 @@
23713
23661
  height: "".concat(paddingTop, "px")
23714
23662
  }
23715
23663
  }, void 0)
23716
- }, void 0), (_d = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _d === void 0 ? void 0 : _d.call(decoration), decoration && page.map(function (row, i) {
23664
+ }, void 0), (_e = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _e === void 0 ? void 0 : _e.call(decoration), decoration && page.map(function (row, i) {
23717
23665
  var _a;
23718
23666
  prepareRow(row);
23719
23667
  var isContextMenu = (_a = row.cells.filter(function (cell) {
@@ -23794,14 +23742,14 @@
23794
23742
  variant: "contentButton"
23795
23743
  }, {
23796
23744
  children: row.cells[0].render('Cell')
23797
- }), void 0)), jsxRuntime.jsxs(TableRow$3, __assign({
23745
+ }), void 0)), jsxRuntime.jsx(TableRow$3, __assign({
23798
23746
  css: customStyle
23799
23747
  }, row && row.getRowProps ? row.getRowProps() : {}, {
23800
- children: [row.cells.filter(function (cell) {
23748
+ children: row.cells.filter(function (cell) {
23801
23749
  return filterHeader.length > 0 ? filterHeader.includes(cell.column.id) : cell;
23802
23750
  }).filter(function (cell) {
23803
23751
  return !cell.column.isSubRow;
23804
- }).map(function (cell) {
23752
+ }).map(function (cell, index, row) {
23805
23753
  var _a, _b, _c;
23806
23754
  var visibleHeaders = (_a = headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups[0]) === null || _a === void 0 ? void 0 : _a.headers.filter(function (column) {
23807
23755
  return !column.isSubRow;
@@ -23814,11 +23762,13 @@
23814
23762
  var collId = (_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.id;
23815
23763
  var exceptionId = (_c = ['expander', 'multiple-expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _c === void 0 ? void 0 : _c.includes(collId);
23816
23764
  return jsxRuntime.jsx(TableCell$3, __assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
23817
- css: __assign(__assign(__assign(__assign({}, cssTableCell), {
23765
+ css: __assign(__assign(__assign(__assign(__assign({}, cssTableCell), {
23818
23766
  padding: !isContextMenu || exceptionId ? collId === 'expander' || collId === 'multiple-expander' ? '20px 4px' : '20px 8px' : '',
23819
23767
  verticalAlign: cell.column.accessor ? cellAlign : 'center',
23820
23768
  cursor: onRowClick ? 'pointer' : 'unset'
23821
- }), stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)),
23769
+ }), stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)), {
23770
+ paddingRight: row.length === index + 1 ? 30 : null
23771
+ }),
23822
23772
  onClick: function () {
23823
23773
  if (!exceptionId) {
23824
23774
  handleRowClick(row, i);
@@ -23855,14 +23805,7 @@
23855
23805
  }), void 0)
23856
23806
  }), void 0)
23857
23807
  }), void 0);
23858
- }), customizableColumn && jsxRuntime.jsx(TableCell$3, {
23859
- css: __assign(__assign({}, cssBtnCustom), {
23860
- maxHeight: 100,
23861
- '&::after': __assign(__assign({}, cssBtnCustom['&::after']), {
23862
- height: 100
23863
- })
23864
- })
23865
- }, void 0)]
23808
+ })
23866
23809
  }), void 0), row.isExpanded ? subRowCells.map(function (cell, index) {
23867
23810
  return jsxRuntime.jsxs(TableRow$3, __assign({
23868
23811
  subRow: true
@@ -23920,7 +23863,7 @@
23920
23863
  }))]
23921
23864
  }, row.id);
23922
23865
  })
23923
- }), void 0), (_e = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _e === void 0 ? void 0 : _e.call(decoration), isInfiniteScroll && paddingBottom > 0 && jsxRuntime.jsx("tr", {
23866
+ }), void 0), (_f = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _f === void 0 ? void 0 : _f.call(decoration), isInfiniteScroll && paddingBottom > 0 && jsxRuntime.jsx("tr", {
23924
23867
  children: jsxRuntime.jsx("td", {
23925
23868
  style: {
23926
23869
  height: "".concat(paddingBottom, "px")
@@ -23929,7 +23872,52 @@
23929
23872
  }, void 0)]
23930
23873
  }), void 0)]
23931
23874
  }), void 0)
23932
- }), void 0), renderContextMenu()]
23875
+ }), void 0), renderContextMenu(), id && jsxRuntime.jsxs(jsxRuntime.Fragment, {
23876
+ children: [jsxRuntime.jsx(HeaderMenuOption, __assign({
23877
+ rowData: tableRowData,
23878
+ open: openMenu,
23879
+ id: id,
23880
+ onOpenChange: setOpen,
23881
+ onChange: React.useCallback(function (items) {
23882
+ setFilterHeader(items);
23883
+ }, [filterHeader]),
23884
+ headerGroups: headerGroups,
23885
+ filterHeader: filterHeader
23886
+ }, {
23887
+ children: jsxRuntime.jsx(IconButton, __assign({
23888
+ css: {
23889
+ zIndex: '$docked',
23890
+ position: 'fixed',
23891
+ top: 20,
23892
+ right: 10,
23893
+ '&:hover': {
23894
+ backgroundColor: 'unset'
23895
+ },
23896
+ backgroundColor: '#c0c4c4',
23897
+ padding: 0,
23898
+ boxShadow: '0px 22px 43px 0px rgba(0, 0, 0, 0.08), 0px 9px 24px 0px rgba(0, 0, 0, 0.09), 0px 3px 9px 0px rgba(0, 0, 0, 0.13)'
23899
+ },
23900
+ onClick: function () {
23901
+ return setOpen(!openMenu);
23902
+ },
23903
+ buttonType: "secondary"
23904
+ }, {
23905
+ children: jsxRuntime.jsx(icons.PlusPrimitive, {
23906
+ size: "20"
23907
+ }, void 0)
23908
+ }), void 0)
23909
+ }), void 0), jsxRuntime.jsx(Box, {
23910
+ css: {
23911
+ backgroundColor: 'white',
23912
+ position: 'fixed',
23913
+ top: 0,
23914
+ height: tableHeight - 1,
23915
+ right: 0,
23916
+ width: 20,
23917
+ boxShadow: ' -2px 0px 5px 0px #00000026'
23918
+ }
23919
+ }, void 0)]
23920
+ }, void 0)]
23933
23921
  }), void 0), !isInfiniteScroll && jsxRuntime.jsx(Box, __assign({
23934
23922
  css: {
23935
23923
  width: '100%'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.58.20-rc.2",
3
+ "version": "1.58.20-rc.4",
4
4
  "dependencies": {
5
5
  "@majoo-ui/core": "^1.31.3",
6
6
  "@majoo-ui/helpers": "^1.30.5",