es-grid-template 1.8.66 → 1.8.68

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.
Files changed (177) hide show
  1. package/es/grid-component/hooks/constant.d.ts +1 -0
  2. package/es/grid-component/hooks/constant.js +2 -1
  3. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  4. package/es/grid-component/hooks/utils.d.ts +1 -1
  5. package/es/grid-component/index.d.ts +1 -1
  6. package/es/grid-component/type.d.ts +567 -0
  7. package/es/grid-component/type.js +1 -490
  8. package/es/table-component/ColumnsChoose.d.ts +1 -1
  9. package/es/table-component/ColumnsChoose.js +0 -2
  10. package/es/table-component/ContextMenu.d.ts +1 -2
  11. package/es/table-component/ContextMenu.js +0 -1
  12. package/es/table-component/InternalTable.d.ts +1 -2
  13. package/es/table-component/InternalTable.js +1 -32
  14. package/es/table-component/TableContainer.d.ts +1 -1
  15. package/es/table-component/TableContainer.js +4 -2
  16. package/es/table-component/TableContainerEdit.d.ts +1 -1
  17. package/es/table-component/TableContainerEdit.js +6 -129
  18. package/es/table-component/body/EditableCell.d.ts +1 -1
  19. package/es/table-component/body/EditableCell.js +1 -18
  20. package/es/table-component/body/TableBody.d.ts +1 -1
  21. package/es/table-component/body/TableBodyCell.d.ts +1 -1
  22. package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
  23. package/es/table-component/body/TableBodyCellEdit.js +2 -9
  24. package/es/table-component/body/TableBodyRow.d.ts +1 -1
  25. package/es/table-component/components/ControlCheckbox.d.ts +1 -1
  26. package/es/table-component/components/EditForm/EditForm.js +0 -1
  27. package/es/table-component/components/InputControl/InputControl.js +0 -3
  28. package/es/table-component/components/async-select/index.d.ts +1 -1
  29. package/es/table-component/components/async-select/index.js +0 -3
  30. package/es/table-component/components/async-table-select/index.d.ts +1 -1
  31. package/es/table-component/components/async-table-select/index.js +0 -4
  32. package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  33. package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  34. package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  35. package/es/table-component/components/command/Command.d.ts +1 -1
  36. package/es/table-component/components/number/index.d.ts +3 -2
  37. package/es/table-component/components/number/index.js +0 -8
  38. package/es/table-component/components/number-range/index.d.ts +3 -2
  39. package/es/table-component/components/number-range/index.js +0 -3
  40. package/es/table-component/footer/TableFooterRow.js +1 -22
  41. package/es/table-component/header/TableHead.js +0 -20
  42. package/es/table-component/header/TableHeadCell.js +1 -15
  43. package/es/table-component/header/TableHeadCell2.js +5 -3
  44. package/es/table-component/header/TableHeadGroupCell.js +0 -23
  45. package/es/table-component/header/renderFilter.d.ts +1 -1
  46. package/es/table-component/hook/useColumns.d.ts +1 -1
  47. package/es/table-component/hook/useFilterOperator.d.ts +2 -2
  48. package/es/table-component/hook/utils.d.ts +1 -1
  49. package/es/table-component/hook/utils.js +0 -3
  50. package/es/table-component/index.d.ts +1 -1
  51. package/es/table-component/index.js +0 -3
  52. package/es/table-component/table/Grid.d.ts +1 -1
  53. package/es/table-component/table/Grid.js +0 -5
  54. package/es/table-component/table/TableWrapper.d.ts +1 -1
  55. package/es/table-component/useContext.d.ts +2 -1
  56. package/es/table-virtuoso/InternalTable.d.ts +1 -1
  57. package/es/table-virtuoso/InternalTable.js +2 -1
  58. package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  59. package/es/table-virtuoso/body/TableBodyCell.js +1 -1
  60. package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  61. package/es/table-virtuoso/body/TableBodyRow.js +3 -1
  62. package/es/table-virtuoso/header/TableHeadCell.js +1 -3
  63. package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
  64. package/es/table-virtuoso/header/renderFilter.js +0 -4
  65. package/es/table-virtuoso/hook/utils.d.ts +1 -1
  66. package/es/table-virtuoso/style.js +1 -1
  67. package/es/table-virtuoso/table/Grid.d.ts +1 -1
  68. package/es/table-virtuoso/table/Grid.js +0 -24
  69. package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
  70. package/es/table-virtuoso/table/TableContainer.js +0 -2
  71. package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
  72. package/es/table-virtuoso/table/TableWrapper.js +3 -19
  73. package/es/table-virtuoso/useContext.d.ts +1 -1
  74. package/lib/grid-component/hooks/constant.d.ts +1 -0
  75. package/lib/grid-component/hooks/constant.js +3 -2
  76. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  77. package/lib/grid-component/hooks/utils.d.ts +1 -1
  78. package/lib/grid-component/index.d.ts +1 -1
  79. package/lib/grid-component/type.d.ts +567 -0
  80. package/lib/grid-component/type.js +4 -490
  81. package/lib/table-component/ColumnsChoose.d.ts +1 -1
  82. package/lib/table-component/ColumnsChoose.js +0 -2
  83. package/lib/table-component/ContextMenu.d.ts +1 -2
  84. package/lib/table-component/ContextMenu.js +0 -2
  85. package/lib/table-component/InternalTable.d.ts +1 -2
  86. package/lib/table-component/InternalTable.js +1 -28
  87. package/lib/table-component/TableContainer.d.ts +1 -1
  88. package/lib/table-component/TableContainer.js +4 -2
  89. package/lib/table-component/TableContainerEdit.d.ts +1 -1
  90. package/lib/table-component/TableContainerEdit.js +5 -128
  91. package/lib/table-component/body/EditableCell.d.ts +1 -1
  92. package/lib/table-component/body/EditableCell.js +0 -10
  93. package/lib/table-component/body/TableBody.d.ts +1 -1
  94. package/lib/table-component/body/TableBodyCell.d.ts +1 -1
  95. package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
  96. package/lib/table-component/body/TableBodyCellEdit.js +5 -11
  97. package/lib/table-component/body/TableBodyRow.d.ts +1 -1
  98. package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
  99. package/lib/table-component/components/EditForm/EditForm.js +0 -2
  100. package/lib/table-component/components/InputControl/InputControl.js +0 -4
  101. package/lib/table-component/components/async-select/index.d.ts +1 -1
  102. package/lib/table-component/components/async-select/index.js +0 -2
  103. package/lib/table-component/components/async-table-select/index.d.ts +1 -1
  104. package/lib/table-component/components/async-table-select/index.js +0 -4
  105. package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  106. package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  107. package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  108. package/lib/table-component/components/command/Command.d.ts +1 -1
  109. package/lib/table-component/components/number/index.d.ts +3 -2
  110. package/lib/table-component/components/number/index.js +0 -8
  111. package/lib/table-component/components/number-range/index.d.ts +3 -2
  112. package/lib/table-component/components/number-range/index.js +0 -3
  113. package/lib/table-component/footer/TableFooterRow.js +1 -23
  114. package/lib/table-component/header/TableHead.js +0 -21
  115. package/lib/table-component/header/TableHeadCell.js +4 -18
  116. package/lib/table-component/header/TableHeadCell2.js +8 -6
  117. package/lib/table-component/header/TableHeadGroupCell.js +0 -23
  118. package/lib/table-component/header/renderFilter.d.ts +1 -1
  119. package/lib/table-component/hook/useColumns.d.ts +1 -1
  120. package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
  121. package/lib/table-component/hook/utils.d.ts +1 -1
  122. package/lib/table-component/hook/utils.js +0 -4
  123. package/lib/table-component/index.d.ts +1 -1
  124. package/lib/table-component/index.js +0 -1
  125. package/lib/table-component/table/Grid.d.ts +1 -1
  126. package/lib/table-component/table/Grid.js +0 -4
  127. package/lib/table-component/table/TableWrapper.d.ts +1 -1
  128. package/lib/table-component/useContext.d.ts +2 -1
  129. package/lib/table-virtuoso/InternalTable.d.ts +1 -1
  130. package/lib/table-virtuoso/InternalTable.js +3 -1
  131. package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  132. package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
  133. package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  134. package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
  135. package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
  136. package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
  137. package/lib/table-virtuoso/header/renderFilter.js +0 -4
  138. package/lib/table-virtuoso/hook/utils.d.ts +1 -1
  139. package/lib/table-virtuoso/style.js +1 -1
  140. package/lib/table-virtuoso/table/Grid.d.ts +1 -1
  141. package/lib/table-virtuoso/table/Grid.js +0 -24
  142. package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
  143. package/lib/table-virtuoso/table/TableContainer.js +0 -2
  144. package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
  145. package/lib/table-virtuoso/table/TableWrapper.js +3 -19
  146. package/lib/table-virtuoso/useContext.d.ts +1 -1
  147. package/package.json +1 -1
  148. package/es/table-component/hook/constant.d.ts +0 -73
  149. package/es/table-component/hook/constant.js +0 -240
  150. package/es/table-component/type.d.ts +0 -567
  151. package/es/table-component/type.js +0 -1
  152. package/es/table-virtuoso/hook/constant.d.ts +0 -73
  153. package/es/table-virtuoso/hook/constant.js +0 -240
  154. package/es/table-virtuoso/hook/convert.d.ts +0 -1
  155. package/es/table-virtuoso/hook/convert.js +0 -28
  156. package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
  157. package/es/table-virtuoso/hook/useColumns.js +0 -302
  158. package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  159. package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
  160. package/es/table-virtuoso/style.scss +0 -1441
  161. package/es/table-virtuoso/type.d.ts +0 -0
  162. package/es/table-virtuoso/type.js +0 -785
  163. package/lib/table-component/hook/constant.d.ts +0 -73
  164. package/lib/table-component/hook/constant.js +0 -247
  165. package/lib/table-component/type.d.ts +0 -567
  166. package/lib/table-component/type.js +0 -5
  167. package/lib/table-virtuoso/hook/constant.d.ts +0 -73
  168. package/lib/table-virtuoso/hook/constant.js +0 -247
  169. package/lib/table-virtuoso/hook/convert.d.ts +0 -1
  170. package/lib/table-virtuoso/hook/convert.js +0 -34
  171. package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
  172. package/lib/table-virtuoso/hook/useColumns.js +0 -315
  173. package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  174. package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
  175. package/lib/table-virtuoso/style.scss +0 -1441
  176. package/lib/table-virtuoso/type.d.ts +0 -0
  177. package/lib/table-virtuoso/type.js +0 -786
@@ -9,25 +9,17 @@ const TableHeadGroupCell = props => {
9
9
  const {
10
10
  column,
11
11
  header,
12
- // getPopupContainer,
13
12
  table,
14
13
  depth,
15
- // t,
16
- // columnVirtualizer,
17
- // rowHeaderVirtualizer,
18
14
  colSpan,
19
15
  rowSpan
20
16
  } = props;
21
17
  const {
22
- // t,
23
18
  prefix,
24
- // setSorterChange,
25
- // setFilterChange,
26
19
  wrapSettings,
27
20
  selectionSettings,
28
21
  setIsSelectionChange,
29
22
  id
30
- // locale
31
23
  } = useContext(TableContext);
32
24
  const isPinned = column.getIsPinned();
33
25
  const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
@@ -37,14 +29,6 @@ const TableHeadGroupCell = props => {
37
29
  const cellContent = flexRender(column.columnDef.header, header.getContext());
38
30
  const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(React.Fragment, null, cellContent));
39
31
  const hasValue = html.trim().length > 0;
40
-
41
- // const filtered = column.getIsFiltered()
42
-
43
- // const { attributes, isDragging, listeners, setNodeRef, transform } =
44
- // useSortable({
45
- // id: column.id,
46
- // })
47
-
48
32
  const style = {
49
33
  transition: 'width transform 0.2s ease-in-out',
50
34
  whiteSpace: 'nowrap',
@@ -104,13 +88,6 @@ const TableHeadGroupCell = props => {
104
88
  onDoubleClick: () => column.resetSize(),
105
89
  onMouseDown: header.getResizeHandler(),
106
90
  onTouchStart: header.getResizeHandler(),
107
- // onMouseUp: () => {
108
- // requestAnimationFrame(() => {
109
- // columnVirtualizer.measure()
110
- // // rowHeaderVirtualizer.measure()
111
- // })
112
- // },
113
-
114
91
  className: `resizer ${column.getIsResizing() ? 'isResizing' : ''}`
115
92
  }));
116
93
  };
@@ -1,6 +1,6 @@
1
1
  import type { ColumnDef } from "@tanstack/react-table";
2
2
  import React from "react";
3
- import type { IFormat } from "../type";
3
+ import type { IFormat } from "../../grid-component/type";
4
4
  type RenderFilterProps<RecordType> = {
5
5
  column: ColumnDef<RecordType, unknown>;
6
6
  selectedKeys: any[];
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch, SetStateAction } from "react";
2
- import type { ColumnsTable, ColumnTable, IFormat, SelectionSettings } from '../type';
2
+ import type { ColumnsTable, ColumnTable, IFormat, SelectionSettings } from '../../grid-component/type';
3
3
  import type { Cell, ColumnDef } from '@tanstack/react-table';
4
4
  export declare const renderValueCell: <T>(column: ColumnTable<T>, value: any, record: T, rowIndex: number, colIndex: number, format?: IFormat, editAble?: boolean) => any;
5
5
  export declare function convertToTanStackColumns<T>({ t, columns, format, editAble }: {
@@ -1,5 +1,5 @@
1
- import { Table } from '@tanstack/react-table';
2
- import type { FilterOperator } from '../type';
1
+ import type { Table } from '@tanstack/react-table';
2
+ import type { FilterOperator } from '../../grid-component/type';
3
3
  export declare function useFilterOperator(table: Table<any>): {
4
4
  setFilterOperator: (columnId: string, operator: FilterOperator) => void;
5
5
  getFilterOperator: (columnId: string) => FilterOperator;
@@ -1,7 +1,7 @@
1
1
  import type { Row, Table } from "@tanstack/react-table";
2
2
  import { type Column } from "@tanstack/react-table";
3
3
  import type { VirtualItem } from "@tanstack/react-virtual";
4
- import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../type";
4
+ import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../../grid-component/type";
5
5
  import type { Key } from "react";
6
6
  import { type CSSProperties } from "react";
7
7
  import dayjs from "dayjs";
@@ -1,8 +1,5 @@
1
- // import { SELECTION_COLUMN } from "rc-master-ui/es/table/hooks/useSelection"
2
1
  import { v4 as uuidv4 } from 'uuid';
3
2
  import { presetPalettes } from "@ant-design/colors";
4
- // import moment from "moment/moment"
5
-
6
3
  import dayjs from "dayjs";
7
4
  import moment from "moment";
8
5
  export const newGuid = () => {
@@ -1,4 +1,4 @@
1
1
  import InternalTable from './InternalTable';
2
- import type { ColumnsTable, TableProps, ColumnTable, ContextMenuItem } from './type';
2
+ import type { ColumnsTable, TableProps, ColumnTable, ContextMenuItem } from './../grid-component/type';
3
3
  export type { ColumnsTable, TableProps, ColumnTable, ContextMenuItem };
4
4
  export default InternalTable;
@@ -1,5 +1,2 @@
1
1
  import InternalTable from "./InternalTable";
2
-
3
- // import type {ToolbarItem} from "rc-master-ui/es/toolbar"
4
-
5
2
  export default InternalTable;
@@ -1,5 +1,5 @@
1
1
  import type { ColumnDef, ColumnPinningState, ExpandedState, VisibilityState } from '@tanstack/react-table';
2
- import type { ColumnsTable, Sorter, TableProps } from '../type';
2
+ import type { ColumnsTable, Sorter, TableProps } from '../../grid-component/type';
3
3
  import type { Dispatch, Key, SetStateAction } from 'react';
4
4
  import React from 'react';
5
5
  type Props<T> = Omit<TableProps<T>, 'columns'> & {
@@ -11,11 +11,6 @@ useReactTable } from '@tanstack/react-table';
11
11
  import { DndContext, KeyboardSensor, MouseSensor, TouchSensor, closestCenter, useSensor, useSensors } from '@dnd-kit/core';
12
12
  import { restrictToHorizontalAxis } from '@dnd-kit/modifiers';
13
13
  import { arrayMove } from '@dnd-kit/sortable';
14
-
15
- // import { flattenArray, getFixedFields, getInvisibleColumns, unFlattenData, updateOrInsert } from './hook/utils'
16
-
17
- // import { faker } from '@faker-js/faker'
18
-
19
14
  import React, { Fragment } from 'react';
20
15
  import TableContainer from "../TableContainer";
21
16
  import { OperatorFeature } from "../features/operator";
@@ -1,5 +1,5 @@
1
1
  import { type Table } from "@tanstack/react-table";
2
- import type { CommandClick, ContextInfo, ContextMenuItem, PaginationConfig } from "../type";
2
+ import type { CommandClick, ContextInfo, ContextMenuItem, PaginationConfig } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  import type { Virtualizer } from "@tanstack/react-virtual";
5
5
  import type { Column } from "@tanstack/react-table";
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch, SetStateAction } from 'react';
2
- import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings } from "./type";
2
+ import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings, SourceFilter } from "./../grid-component/type";
3
3
  import type { SubmitHandler } from "react-hook-form";
4
4
  import type { ExpandedState, Row, Table } from '@tanstack/react-table';
5
5
  export type IPositionCell = {
@@ -82,6 +82,7 @@ export interface IContext<T> {
82
82
  onRowStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | ((data: T, row: Row<T>) => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
83
83
  onRowHeaderStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
84
84
  onRowFooterStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
85
+ dataSourceFilter?: SourceFilter[];
85
86
  }
86
87
  export declare const TableContext: import("react").Context<IContext<any>>;
87
88
  export type ContextCellChange = {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import 'react-resizable/css/styles.css';
3
3
  import 'dayjs/locale/es';
4
4
  import 'dayjs/locale/vi';
5
- import type { TableProps } from '../table-component/type';
5
+ import type { TableProps } from '../grid-component/type';
6
6
  export declare const SELECTION_COLUMN: {};
7
7
  declare const InternalTable: <RecordType extends object>(props: TableProps<RecordType>) => React.JSX.Element;
8
8
  export default InternalTable;
@@ -9,11 +9,12 @@ import { faker } from '@faker-js/faker';
9
9
  import useMergedState from "rc-util/es/hooks/useMergedState";
10
10
  import { getCoreRowModel, getExpandedRowModel, getGroupedRowModel, getPaginationRowModel, useReactTable } from '@tanstack/react-table';
11
11
  import { addRowIdArray, convertFlatColumn1, convertToObj, convertToObjTrue, filterDataByColumns, findAllChildrenKeys2, flatColumns2, getAllRowKey, getDiffent2Array, getFixedFields, getInvisibleColumns, groupArrayByColumns, isTreeArray, removeKeys } from "./hook/utils";
12
- import { convertToTanStackColumns } from "./hook/useColumns";
12
+ // import { convertToTanStackColumns } from './hook/useColumns'
13
13
  import { removeInvisibleColumns } from "../grid-component/hooks";
14
14
  import Grid from "./table/Grid";
15
15
  import { removeColumns } from "../table-component/hook/utils";
16
16
  import { OperatorFeature } from "../table-component/features/operator";
17
+ import { convertToTanStackColumns } from "../table-component/hook/useColumns";
17
18
  dayjs.extend(customParseFormat);
18
19
  export const SELECTION_COLUMN = {};
19
20
  const InternalTable = props => {
@@ -1,5 +1,5 @@
1
1
  import type { Cell, Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../../table-component/type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  import type { VirtualItem } from "@tanstack/react-virtual";
5
5
  interface TableBodyCellProps<T> {
@@ -6,8 +6,8 @@ import Checkbox from "rc-master-ui/es/checkbox/Checkbox";
6
6
  import classNames from "classnames";
7
7
  import React from "react";
8
8
  import { TableContext } from "../useContext";
9
- import { toggleRowSelection } from "../hook/useColumns";
10
9
  import Command from "../../table-component/components/command/Command";
10
+ import { toggleRowSelection } from "../../table-component/hook/useColumns";
11
11
  const renderCellIndex = props => {
12
12
  const {
13
13
  cell,
@@ -1,5 +1,5 @@
1
1
  import { type Row, type Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../../table-component/type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  interface TableBodyRowProps<T> {
5
5
  tableId: string;
@@ -9,5 +9,5 @@ interface TableBodyRowProps<T> {
9
9
  editAble?: boolean;
10
10
  [key: string]: any;
11
11
  }
12
- declare const TableBodyRow: <RecordType extends object>({ tableId, table, row, virtualRow, commandClick, contextMenuItems, onContextMenu, ...rest }: TableBodyRowProps<RecordType>) => React.JSX.Element;
12
+ declare const TableBodyRow: <RecordType extends object>({ tableId, table, row, virtualRow, commandClick, contextMenuItems, onContextMenu, rowheight, ...rest }: TableBodyRowProps<RecordType>) => React.JSX.Element;
13
13
  export default TableBodyRow;
@@ -12,6 +12,7 @@ const TableBodyRow = ({
12
12
  commandClick,
13
13
  contextMenuItems,
14
14
  onContextMenu,
15
+ rowheight,
15
16
  ...rest
16
17
  }) => {
17
18
  const {
@@ -36,7 +37,8 @@ const TableBodyRow = ({
36
37
  [`${prefix}-grid-row-parent`]: row.subRows && row.subRows.length > 0
37
38
  }),
38
39
  style: {
39
- ...rowStyles
40
+ ...rowStyles,
41
+ height: rowheight
40
42
  },
41
43
  onDoubleClick: e => {
42
44
  recordDoubleClick?.({
@@ -4,13 +4,11 @@ import { Button, Space } from 'antd';
4
4
  import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
5
5
  import classNames from 'classnames';
6
6
  import { Checkbox, Dropdown, Select } from 'rc-master-ui';
7
- import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../hook/constant";
8
7
  import { extendsObject, getCommonPinningHeaderStyles, getDefaultOperator, getTypeFilter } from "../hook/utils";
9
8
  import { renderFilter } from "./renderFilter";
10
9
  import ReactDOMServer from 'react-dom/server';
11
10
  import { TableContext } from "../useContext";
12
- // import type { MenuProps } from 'rc-master-ui/es'
13
-
11
+ import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
14
12
  const TableHeadCell = props => {
15
13
  const {
16
14
  header,
@@ -1,6 +1,6 @@
1
1
  import type { ColumnDef } from "@tanstack/react-table";
2
2
  import React from "react";
3
- import type { IFormat } from "../../table-component/type";
3
+ import type { IFormat } from "../../grid-component/type";
4
4
  type RenderFilterProps<RecordType> = {
5
5
  column: ColumnDef<RecordType, unknown>;
6
6
  selectedKeys: any[];
@@ -1,7 +1,3 @@
1
- // import type { IFormat } from "../../tanstack-table/type";
2
-
3
- // import type { AnyObject } from './type';
4
-
5
1
  import React, { Fragment } from "react";
6
2
  import moment from "moment/moment";
7
3
  import { CustomProvider, DatePicker, DateRangePicker, Empty, Input, Select } from "rc-master-ui";
@@ -1,7 +1,7 @@
1
1
  import type { Row, Table } from "@tanstack/react-table";
2
2
  import { type Column } from "@tanstack/react-table";
3
3
  import type { VirtualItem } from "@tanstack/react-virtual";
4
- import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "../../table-component/type";
4
+ import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "../../grid-component/type";
5
5
  import type { Key } from "react";
6
6
  import { type CSSProperties } from "react";
7
7
  import dayjs from "dayjs";
@@ -9,4 +9,4 @@ const colorDark = "#e6e4f3e6";
9
9
  export const GridStyle = styled.div.withConfig({
10
10
  displayName: "GridStyle",
11
11
  componentId: "es-grid-template__sc-rs980s-0"
12
- })(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";}}}.", "-grid-cell{padding:7px 8px;.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;outline:1px solid ", ";border:0;&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;outline:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:#33335d !important;}&.disable{background-color:#272A2F;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border:0;outline:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
12
+ })(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";}}}.", "-grid-cell{padding:7px 8px;.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:#33335d !important;}&.disable{background-color:#272A2F;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
@@ -1,5 +1,5 @@
1
1
  import type { ColumnDef, ColumnFiltersState, ColumnPinningState, ColumnSizingInfoState, ColumnSizingState, ExpandedState, Table, VisibilityState } from '@tanstack/react-table';
2
- import type { ColumnsTable, Sorter, TableProps } from '../../table-component/type';
2
+ import type { ColumnsTable, Sorter, TableProps } from '../../grid-component/type';
3
3
  import type { Dispatch, Key, SetStateAction } from 'react';
4
4
  import React from 'react';
5
5
  type Props<T> = Omit<TableProps<T>, 'columns'> & {
@@ -54,30 +54,6 @@ const Grid = props => {
54
54
  rowSelection,
55
55
  ...rest
56
56
  } = props;
57
-
58
- // const [columnResizeMode] = React.useState<ColumnResizeMode>('onChange')
59
-
60
- // const [columnResizeDirection] = React.useState<ColumnResizeDirection>('ltr')
61
-
62
- // const [paginationState, setPagination] = React.useState<PaginationState>({
63
- // pageIndex: pagination && pagination.currentPage ? pagination.currentPage - 1 : 0,
64
- // pageSize: pagination && pagination.pageSize ? pagination.pageSize : 20
65
- // })
66
-
67
- // const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({})
68
-
69
- // const [grouping, setGrouping] = React.useState<GroupingState>([])
70
-
71
- // const [columnSizing, setColumnSizing] = React.useState<ColumnSizingState>({})
72
- // const [columnSizingInfo, setColumnSizingInfo] = React.useState<ColumnSizingInfoState>({} as ColumnSizingInfoState)
73
-
74
- // const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>([])
75
-
76
- // const [operator, setOperator] = React.useState<ColumnOperatorState>([])
77
- // const [sorting, setSorting] = React.useState<SortingState>([])
78
-
79
- // const [columnOrder, setColumnOrder] = React.useState<string[]>(() => columns.map(c => c.id!))
80
-
81
57
  const [isSelectionChange, setIsSelectionChange] = React.useState({
82
58
  isChange: false,
83
59
  type: '',
@@ -1,7 +1,7 @@
1
1
  import type { Dispatch, SetStateAction } from 'react';
2
2
  import React from 'react';
3
3
  import type { ColumnDef, ColumnSizingInfoState, ColumnSizingState, Table } from '@tanstack/react-table';
4
- import type { ColumnsTable, TableProps } from '../../table-component/type';
4
+ import type { ColumnsTable, TableProps } from '../../grid-component/type';
5
5
  type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
6
6
  table: Table<T>;
7
7
  prefix: string;
@@ -1,6 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- // import type { Dispatch, SetStateAction } from 'react'
3
-
4
2
  import React from 'react';
5
3
  import classNames from 'classnames';
6
4
  import Pagination from 'rc-master-ui/es/pagination';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ColumnDef, Table } from "@tanstack/react-table";
3
- import type { CommandClick } from '../../table-component/type';
3
+ import type { CommandClick } from '../../grid-component/type';
4
4
  type Props<T> = {
5
5
  tableContainerRef: React.RefObject<HTMLDivElement>;
6
6
  table: Table<T>;
@@ -22,7 +22,6 @@ import TableFooterCell from "../footer/TableFooterCell";
22
22
  const TableWrapper = props => {
23
23
  const {
24
24
  table,
25
- // columns,
26
25
  height,
27
26
  id,
28
27
  commandClick
@@ -42,7 +41,6 @@ const TableWrapper = props => {
42
41
  ref: scrollRef,
43
42
  style: {
44
43
  overflow: "auto",
45
- // border: "1px solid #ccc",
46
44
  height,
47
45
  position: "relative"
48
46
  }
@@ -81,12 +79,14 @@ const TableWrapper = props => {
81
79
  })),
82
80
  TableRow: props => {
83
81
  const index = props["data-index"];
82
+ const rowheight = props["data-known-size"];
84
83
  const row = rows[index];
85
84
  return /*#__PURE__*/React.createElement(TableBodyRow, _extends({
86
85
  tableId: id,
87
86
  row: row,
88
87
  table: table,
89
- commandClick: commandClick
88
+ commandClick: commandClick,
89
+ rowheight: rowheight
90
90
  }, props));
91
91
  }
92
92
  }
@@ -140,22 +140,6 @@ const TableWrapper = props => {
140
140
  });
141
141
  }));
142
142
  }
143
-
144
- // itemContent={(index) => {
145
-
146
- // const row = rows[index]
147
- // return (
148
-
149
- // <TableBodyRow
150
- // tableId={id}
151
- // row={row}
152
- // table={table}
153
- // // {...props}
154
-
155
- // />
156
-
157
- // )
158
- // }}
159
143
  })));
160
144
  };
161
145
  export default TableWrapper;
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch, SetStateAction } from 'react';
2
- import type { ColumnTable, ExpandableConfig, IFormat, IGroupSetting, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings } from "../table-component/type";
2
+ import type { ColumnTable, ExpandableConfig, IFormat, IGroupSetting, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings } from "../grid-component/type";
3
3
  import type { SubmitHandler } from "react-hook-form";
4
4
  import type { ExpandedState, Row, Table } from '@tanstack/react-table';
5
5
  export type IPositionCell = {
@@ -70,3 +70,4 @@ export declare const booleanToValue: {
70
70
  true: number;
71
71
  false: number;
72
72
  };
73
+ export declare const nonActionColumn: string[];
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
6
+ exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.nonActionColumn = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
7
7
  const defaultWidth = exports.defaultWidth = 100;
8
8
  const defaultRowHeight = exports.defaultRowHeight = 35;
9
9
  const numberOperator = exports.numberOperator = [{
@@ -243,4 +243,5 @@ const valueToBoolean = exports.valueToBoolean = {
243
243
  const booleanToValue = exports.booleanToValue = {
244
244
  true: 1,
245
245
  false: 0
246
- };
246
+ };
247
+ const nonActionColumn = exports.nonActionColumn = ['#', 'command', 'selection_column'];
@@ -1,4 +1,4 @@
1
1
  import type { Key } from "react";
2
- import type { AnyObject, GetRowKey } from '../../table-component/type';
2
+ import type { AnyObject, GetRowKey } from '../type';
3
3
  declare const useLazyKVMap: <RecordType extends AnyObject = AnyObject>(data: readonly RecordType[], childrenColumnName: string, getRowKey: GetRowKey<RecordType>) => readonly [(key: Key) => RecordType];
4
4
  export default useLazyKVMap;
@@ -3,7 +3,7 @@ import dayjs from "dayjs";
3
3
  import type { EditType, IColumnType, TypeFilter } from "rc-master-ui";
4
4
  import type { Key } from "react";
5
5
  import type { ColumnsTable } from "./../index";
6
- import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../../table-component/type";
6
+ import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../type";
7
7
  export declare const newGuid: () => any;
8
8
  export declare const sumDataByField: (data: any[], field: string) => any;
9
9
  export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  import TempTable from './TempTable';
2
- import type { ColumnsTable, TableProps, ColumnTable, CommandItem, ContextMenuItem } from '../table-component/type';
2
+ import type { ColumnsTable, TableProps, ColumnTable, CommandItem, ContextMenuItem } from './type';
3
3
  import type { ToolbarItem } from "rc-master-ui/es/toolbar";
4
4
  export type { ColumnsTable, TableProps, ColumnTable, ToolbarItem, CommandItem, ContextMenuItem };
5
5
  export default TempTable;