@mkt-loitd/react-table-grid-custom 1.3.10 → 1.4.1

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.d.mts CHANGED
@@ -25,26 +25,19 @@ interface useShowHideColumnReturn<T, SR> {
25
25
  declare const useShowHideColumn: <T, SR = unknown>({ nameLocal, columns, ignoreColumns }: useShowHideColumnParameter<T, SR>) => useShowHideColumnReturn<T, SR>;
26
26
 
27
27
  interface IReactTableGridCustom<T = unknown, SR = unknown, K extends Key = Key> {
28
- /** Data */
28
+ classNameWapperTable?: string;
29
+ hiddenSTT?: boolean;
29
30
  data: readonly T[];
30
31
  columns: readonly ColumnOrColumnGroup<T, SR>[];
31
- /** Pagination display */
32
+ rowKeyGetter?: keyof T | ((row: T) => K);
32
33
  page?: number;
33
34
  pageSize?: number;
34
- hiddenSTT?: boolean;
35
- /** Selection */
36
35
  enableSelectRow?: boolean;
37
36
  selectedRows?: ReadonlySet<K>;
38
37
  onSelectedRowsChange?: (rows: ReadonlySet<K>) => void;
39
- /** Sorting */
40
38
  sortColumns?: readonly SortColumn[];
41
39
  onSortColumnsChange?: (sortColumns: readonly SortColumn[]) => void;
42
- /** Row key */
43
- rowKeyGetter?: keyof T | ((row: T) => K);
44
- /** UI */
45
- classNameWapperTable?: string;
46
40
  fetching?: boolean;
47
- /** Events */
48
41
  onRowClick?: (row: T, rowIdx: number) => void;
49
42
  onRowDoubleClick?: (row: T, rowIdx: number) => void;
50
43
  }
package/dist/index.d.ts CHANGED
@@ -25,26 +25,19 @@ interface useShowHideColumnReturn<T, SR> {
25
25
  declare const useShowHideColumn: <T, SR = unknown>({ nameLocal, columns, ignoreColumns }: useShowHideColumnParameter<T, SR>) => useShowHideColumnReturn<T, SR>;
26
26
 
27
27
  interface IReactTableGridCustom<T = unknown, SR = unknown, K extends Key = Key> {
28
- /** Data */
28
+ classNameWapperTable?: string;
29
+ hiddenSTT?: boolean;
29
30
  data: readonly T[];
30
31
  columns: readonly ColumnOrColumnGroup<T, SR>[];
31
- /** Pagination display */
32
+ rowKeyGetter?: keyof T | ((row: T) => K);
32
33
  page?: number;
33
34
  pageSize?: number;
34
- hiddenSTT?: boolean;
35
- /** Selection */
36
35
  enableSelectRow?: boolean;
37
36
  selectedRows?: ReadonlySet<K>;
38
37
  onSelectedRowsChange?: (rows: ReadonlySet<K>) => void;
39
- /** Sorting */
40
38
  sortColumns?: readonly SortColumn[];
41
39
  onSortColumnsChange?: (sortColumns: readonly SortColumn[]) => void;
42
- /** Row key */
43
- rowKeyGetter?: keyof T | ((row: T) => K);
44
- /** UI */
45
- classNameWapperTable?: string;
46
40
  fetching?: boolean;
47
- /** Events */
48
41
  onRowClick?: (row: T, rowIdx: number) => void;
49
42
  onRowDoubleClick?: (row: T, rowIdx: number) => void;
50
43
  }
package/dist/index.js CHANGED
@@ -251,13 +251,13 @@ var ReactTableGridCustomInner = (props) => {
251
251
  } = props;
252
252
  const isSelectRow = enableSelectRow && selectedRows !== void 0;
253
253
  const newColumns = (0, import_react2.useMemo)(() => {
254
- let cols = [...columns];
254
+ const cols = [...columns];
255
255
  if (isSelectRow) {
256
256
  cols.unshift(import_react_data_grid.SelectColumn);
257
257
  }
258
258
  if (!hiddenSTT) {
259
259
  cols.unshift({
260
- key: "index",
260
+ key: "__index__",
261
261
  name: "STT",
262
262
  width: 80,
263
263
  renderCell: ({ rowIdx }) => STT({ page, pageSize }, rowIdx)
@@ -278,7 +278,7 @@ var ReactTableGridCustomInner = (props) => {
278
278
  "div",
279
279
  {
280
280
  className: cn(
281
- "wapper_table flex flex-col h-full min-h-0",
281
+ "wapper_table flex flex-col h-full min-h-0 relative",
282
282
  classNameWapperTable
283
283
  ),
284
284
  children: [
@@ -296,7 +296,7 @@ var ReactTableGridCustomInner = (props) => {
296
296
  onCellDoubleClick: ({ row, rowIdx }) => onRowDoubleClick == null ? void 0 : onRowDoubleClick(row, rowIdx)
297
297
  }
298
298
  ),
299
- fetching && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingIcon, { isSpin: true }) })
299
+ fetching && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-white/60 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingIcon, { isSpin: true }) })
300
300
  ]
301
301
  }
302
302
  );
package/dist/index.mjs CHANGED
@@ -220,13 +220,13 @@ var ReactTableGridCustomInner = (props) => {
220
220
  } = props;
221
221
  const isSelectRow = enableSelectRow && selectedRows !== void 0;
222
222
  const newColumns = useMemo2(() => {
223
- let cols = [...columns];
223
+ const cols = [...columns];
224
224
  if (isSelectRow) {
225
225
  cols.unshift(SelectColumn);
226
226
  }
227
227
  if (!hiddenSTT) {
228
228
  cols.unshift({
229
- key: "index",
229
+ key: "__index__",
230
230
  name: "STT",
231
231
  width: 80,
232
232
  renderCell: ({ rowIdx }) => STT({ page, pageSize }, rowIdx)
@@ -247,7 +247,7 @@ var ReactTableGridCustomInner = (props) => {
247
247
  "div",
248
248
  {
249
249
  className: cn(
250
- "wapper_table flex flex-col h-full min-h-0",
250
+ "wapper_table flex flex-col h-full min-h-0 relative",
251
251
  classNameWapperTable
252
252
  ),
253
253
  children: [
@@ -265,7 +265,7 @@ var ReactTableGridCustomInner = (props) => {
265
265
  onCellDoubleClick: ({ row, rowIdx }) => onRowDoubleClick == null ? void 0 : onRowDoubleClick(row, rowIdx)
266
266
  }
267
267
  ),
268
- fetching && /* @__PURE__ */ jsx2("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx2(LoadingIcon, { isSpin: true }) })
268
+ fetching && /* @__PURE__ */ jsx2("div", { className: "absolute inset-0 flex items-center justify-center bg-white/60 z-10", children: /* @__PURE__ */ jsx2(LoadingIcon, { isSpin: true }) })
269
269
  ]
270
270
  }
271
271
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkt-loitd/react-table-grid-custom",
3
- "version": "1.3.10",
3
+ "version": "1.4.1",
4
4
  "description": "React Table Grid Custom component",
5
5
  "license": "ISC",
6
6
  "private": false,