es-grid-template 1.8.67 → 1.8.69

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 (167) hide show
  1. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  2. package/es/grid-component/hooks/utils.d.ts +1 -1
  3. package/es/grid-component/index.d.ts +1 -1
  4. package/es/grid-component/type.d.ts +570 -0
  5. package/es/grid-component/type.js +1 -490
  6. package/es/table-component/ColumnsChoose.d.ts +1 -1
  7. package/es/table-component/ColumnsChoose.js +0 -2
  8. package/es/table-component/ContextMenu.d.ts +1 -2
  9. package/es/table-component/ContextMenu.js +0 -1
  10. package/es/table-component/InternalTable.d.ts +1 -2
  11. package/es/table-component/InternalTable.js +1 -32
  12. package/es/table-component/TableContainer.d.ts +1 -1
  13. package/es/table-component/TableContainer.js +4 -2
  14. package/es/table-component/TableContainerEdit.d.ts +1 -1
  15. package/es/table-component/TableContainerEdit.js +4 -2
  16. package/es/table-component/body/EditableCell.d.ts +1 -1
  17. package/es/table-component/body/EditableCell.js +1 -18
  18. package/es/table-component/body/TableBody.d.ts +1 -1
  19. package/es/table-component/body/TableBodyCell.d.ts +1 -1
  20. package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
  21. package/es/table-component/body/TableBodyRow.d.ts +1 -1
  22. package/es/table-component/components/ControlCheckbox.d.ts +1 -1
  23. package/es/table-component/components/EditForm/EditForm.js +0 -1
  24. package/es/table-component/components/InputControl/InputControl.js +0 -3
  25. package/es/table-component/components/async-select/index.d.ts +1 -1
  26. package/es/table-component/components/async-select/index.js +0 -3
  27. package/es/table-component/components/async-table-select/index.d.ts +1 -1
  28. package/es/table-component/components/async-table-select/index.js +0 -4
  29. package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  30. package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  31. package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  32. package/es/table-component/components/command/Command.d.ts +1 -1
  33. package/es/table-component/components/number/index.d.ts +3 -2
  34. package/es/table-component/components/number/index.js +0 -8
  35. package/es/table-component/components/number-range/index.d.ts +3 -2
  36. package/es/table-component/components/number-range/index.js +0 -3
  37. package/es/table-component/footer/TableFooterRow.js +1 -22
  38. package/es/table-component/header/TableHead.js +0 -20
  39. package/es/table-component/header/TableHeadCell.js +0 -5
  40. package/es/table-component/header/TableHeadCell2.js +4 -2
  41. package/es/table-component/header/TableHeadGroupCell.js +0 -23
  42. package/es/table-component/header/renderFilter.d.ts +1 -1
  43. package/es/table-component/hook/useColumns.d.ts +1 -1
  44. package/es/table-component/hook/useFilterOperator.d.ts +2 -2
  45. package/es/table-component/hook/utils.d.ts +1 -1
  46. package/es/table-component/hook/utils.js +0 -3
  47. package/es/table-component/index.d.ts +1 -1
  48. package/es/table-component/index.js +0 -3
  49. package/es/table-component/table/Grid.d.ts +1 -1
  50. package/es/table-component/table/Grid.js +3 -7
  51. package/es/table-component/table/TableWrapper.d.ts +1 -1
  52. package/es/table-component/useContext.d.ts +2 -1
  53. package/es/table-virtuoso/InternalTable.d.ts +1 -1
  54. package/es/table-virtuoso/InternalTable.js +2 -1
  55. package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  56. package/es/table-virtuoso/body/TableBodyCell.js +1 -1
  57. package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  58. package/es/table-virtuoso/body/TableBodyRow.js +3 -1
  59. package/es/table-virtuoso/header/TableHeadCell.js +1 -3
  60. package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
  61. package/es/table-virtuoso/header/renderFilter.js +0 -4
  62. package/es/table-virtuoso/hook/utils.d.ts +1 -1
  63. package/es/table-virtuoso/style.js +1 -1
  64. package/es/table-virtuoso/table/Grid.d.ts +1 -1
  65. package/es/table-virtuoso/table/Grid.js +2 -25
  66. package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
  67. package/es/table-virtuoso/table/TableContainer.js +0 -2
  68. package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
  69. package/es/table-virtuoso/table/TableWrapper.js +3 -19
  70. package/es/table-virtuoso/useContext.d.ts +1 -1
  71. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  72. package/lib/grid-component/hooks/utils.d.ts +1 -1
  73. package/lib/grid-component/index.d.ts +1 -1
  74. package/lib/grid-component/type.d.ts +570 -0
  75. package/lib/grid-component/type.js +4 -490
  76. package/lib/table-component/ColumnsChoose.d.ts +1 -1
  77. package/lib/table-component/ColumnsChoose.js +0 -2
  78. package/lib/table-component/ContextMenu.d.ts +1 -2
  79. package/lib/table-component/ContextMenu.js +0 -2
  80. package/lib/table-component/InternalTable.d.ts +1 -2
  81. package/lib/table-component/InternalTable.js +1 -28
  82. package/lib/table-component/TableContainer.d.ts +1 -1
  83. package/lib/table-component/TableContainer.js +4 -2
  84. package/lib/table-component/TableContainerEdit.d.ts +1 -1
  85. package/lib/table-component/TableContainerEdit.js +4 -2
  86. package/lib/table-component/body/EditableCell.d.ts +1 -1
  87. package/lib/table-component/body/EditableCell.js +0 -10
  88. package/lib/table-component/body/TableBody.d.ts +1 -1
  89. package/lib/table-component/body/TableBodyCell.d.ts +1 -1
  90. package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
  91. package/lib/table-component/body/TableBodyRow.d.ts +1 -1
  92. package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
  93. package/lib/table-component/components/EditForm/EditForm.js +0 -2
  94. package/lib/table-component/components/InputControl/InputControl.js +0 -4
  95. package/lib/table-component/components/async-select/index.d.ts +1 -1
  96. package/lib/table-component/components/async-select/index.js +0 -2
  97. package/lib/table-component/components/async-table-select/index.d.ts +1 -1
  98. package/lib/table-component/components/async-table-select/index.js +0 -4
  99. package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  100. package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  101. package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  102. package/lib/table-component/components/command/Command.d.ts +1 -1
  103. package/lib/table-component/components/number/index.d.ts +3 -2
  104. package/lib/table-component/components/number/index.js +0 -8
  105. package/lib/table-component/components/number-range/index.d.ts +3 -2
  106. package/lib/table-component/components/number-range/index.js +0 -3
  107. package/lib/table-component/footer/TableFooterRow.js +1 -23
  108. package/lib/table-component/header/TableHead.js +0 -21
  109. package/lib/table-component/header/TableHeadCell.js +0 -5
  110. package/lib/table-component/header/TableHeadCell2.js +4 -2
  111. package/lib/table-component/header/TableHeadGroupCell.js +0 -23
  112. package/lib/table-component/header/renderFilter.d.ts +1 -1
  113. package/lib/table-component/hook/useColumns.d.ts +1 -1
  114. package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
  115. package/lib/table-component/hook/utils.d.ts +1 -1
  116. package/lib/table-component/hook/utils.js +0 -4
  117. package/lib/table-component/index.d.ts +1 -1
  118. package/lib/table-component/index.js +0 -1
  119. package/lib/table-component/table/Grid.d.ts +1 -1
  120. package/lib/table-component/table/Grid.js +3 -6
  121. package/lib/table-component/table/TableWrapper.d.ts +1 -1
  122. package/lib/table-component/useContext.d.ts +2 -1
  123. package/lib/table-virtuoso/InternalTable.d.ts +1 -1
  124. package/lib/table-virtuoso/InternalTable.js +3 -1
  125. package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  126. package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
  127. package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  128. package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
  129. package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
  130. package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
  131. package/lib/table-virtuoso/header/renderFilter.js +0 -4
  132. package/lib/table-virtuoso/hook/utils.d.ts +1 -1
  133. package/lib/table-virtuoso/style.js +1 -1
  134. package/lib/table-virtuoso/table/Grid.d.ts +1 -1
  135. package/lib/table-virtuoso/table/Grid.js +2 -25
  136. package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
  137. package/lib/table-virtuoso/table/TableContainer.js +0 -2
  138. package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
  139. package/lib/table-virtuoso/table/TableWrapper.js +3 -19
  140. package/lib/table-virtuoso/useContext.d.ts +1 -1
  141. package/package.json +1 -1
  142. package/es/table-component/type.d.ts +0 -567
  143. package/es/table-component/type.js +0 -1
  144. package/es/table-virtuoso/hook/constant.d.ts +0 -73
  145. package/es/table-virtuoso/hook/constant.js +0 -240
  146. package/es/table-virtuoso/hook/convert.d.ts +0 -1
  147. package/es/table-virtuoso/hook/convert.js +0 -28
  148. package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
  149. package/es/table-virtuoso/hook/useColumns.js +0 -302
  150. package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  151. package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
  152. package/es/table-virtuoso/style.scss +0 -1441
  153. package/es/table-virtuoso/type.d.ts +0 -0
  154. package/es/table-virtuoso/type.js +0 -785
  155. package/lib/table-component/type.d.ts +0 -567
  156. package/lib/table-component/type.js +0 -5
  157. package/lib/table-virtuoso/hook/constant.d.ts +0 -73
  158. package/lib/table-virtuoso/hook/constant.js +0 -247
  159. package/lib/table-virtuoso/hook/convert.d.ts +0 -1
  160. package/lib/table-virtuoso/hook/convert.js +0 -34
  161. package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
  162. package/lib/table-virtuoso/hook/useColumns.js +0 -315
  163. package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  164. package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
  165. package/lib/table-virtuoso/style.scss +0 -1441
  166. package/lib/table-virtuoso/type.d.ts +0 -0
  167. package/lib/table-virtuoso/type.js +0 -786
@@ -1,24 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useContext } from "react";
3
3
  import { ColorPicker, DatePicker, Divider, Input, TimePicker, Row, Col } from "antd";
4
- // import type {ColumnTable, ColumnSelectTable, IFormat} from "./type"
5
-
6
- import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs,
7
- // convertDayjsToDate,
8
- convertLabelToTitle,
9
- // customWeekStartEndFormat,
10
- getDatepickerFormat,
11
- // getTemplate,
12
- isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat
13
- // isEditable,
14
- // convertDayjsToDate
15
- } from "../hook/utils";
16
- // import moment from "moment";
17
- // import dayjs from "dayjs";
18
- // import {TreeSelect} from "antd";
4
+ import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs, convertLabelToTitle, getDatepickerFormat, isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat } from "../hook/utils";
19
5
  import classNames from "classnames";
20
6
  import { NumericFormat } from "react-numeric-component";
21
- // import {TableContext} from "./useContext"
22
7
  import dayjs from "dayjs";
23
8
  import moment from "moment";
24
9
  import { Controller } from "react-hook-form";
@@ -28,8 +13,6 @@ import { AsyncTableSelect } from "../components/async-table-select";
28
13
  import { cyan, green, red, blue } from '@ant-design/colors';
29
14
  import { EditForm } from "../components/EditForm";
30
15
  import { TableContext } from "../useContext";
31
- // import moment from "moment";
32
-
33
16
  const {
34
17
  SHOW_PARENT
35
18
  } = TreeSelect;
@@ -1,5 +1,5 @@
1
1
  import { type Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  interface TableBodyProps<T> {
5
5
  table: Table<T>;
@@ -1,5 +1,5 @@
1
1
  import type { Cell, Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
5
5
  interface TableBodyCellProps<T> {
@@ -1,5 +1,5 @@
1
1
  import type { Cell, Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
5
5
  interface TableBodyCellProps<T> {
@@ -1,6 +1,6 @@
1
1
  import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
2
2
  import { type Column, type Row, type Table } from "@tanstack/react-table";
3
- import type { CommandClick } from "../type";
3
+ import type { CommandClick } from "../../grid-component/type";
4
4
  import React from "react";
5
5
  interface TableBodyRowProps<T> {
6
6
  tableId: string;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { ColumnTable } from "../type";
2
+ import type { ColumnTable } from "../../grid-component/type";
3
3
  type Props = {
4
4
  column: ColumnTable;
5
5
  record?: any;
@@ -3,7 +3,6 @@ import styled from "styled-components";
3
3
  import { useForm } from "react-hook-form";
4
4
  import { yupResolver } from "@hookform/resolvers/yup";
5
5
  import { Col, Row } from "rc-master-ui/es/grid";
6
- // import InputControl from "../control/InputControl/InputControl";
7
6
  import { isNullOrUndefined, isObjEmpty } from "../../hook/utils";
8
7
  import { Input } from "rc-master-ui";
9
8
  import { Dropdown } from "antd";
@@ -4,11 +4,8 @@ import { Input } from "rc-master-ui";
4
4
  import { Typography } from "antd";
5
5
  import classnames from "classnames";
6
6
  import React, { Fragment } from "react";
7
- // import {isNullOrUndefined} from "../../hooks";
8
7
  import { Col, Row } from "rc-master-ui/es/grid";
9
8
  import { isNullOrUndefined } from "../../hook/utils";
10
- // import {isNullOrUndefined} from "../../../hooks"
11
-
12
9
  const {
13
10
  Text
14
11
  } = Typography;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { BaseOptionType, DefaultOptionType } from "rc-select/lib/Select";
3
3
  import type { SelectProps } from "rc-master-ui/es/select";
4
- import type { LoadOptionsArgs } from '../../type';
4
+ import type { LoadOptionsArgs } from '../../../grid-component/type';
5
5
  export interface DebounceSelectProps<OptionType extends BaseOptionType = DefaultOptionType> extends SelectProps {
6
6
  loadOptions?: (search: string, callback: (newOptions: OptionType[]) => void, args?: LoadOptionsArgs) => void;
7
7
  debounceTimeout?: number;
@@ -2,9 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useEffect, useMemo, useState } from 'react';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { Select } from "rc-master-ui";
5
-
6
- // import type {LoadOptionsArgs} from "../type";
7
-
8
5
  export function AsyncSelect({
9
6
  loadOptions,
10
7
  debounceTimeout = 500,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { BaseOptionType, DefaultOptionType } from "rc-select/lib/Select";
3
3
  import type { TableSelectProps } from "rc-master-ui";
4
- import type { LoadOptionsArgs } from '../../type';
4
+ import type { LoadOptionsArgs } from '../../../grid-component/type';
5
5
  export interface DebounceSelectProps<OptionType extends BaseOptionType = DefaultOptionType> extends TableSelectProps {
6
6
  loadOptions?: (search: string, callback: (newOptions: OptionType[]) => void, args?: LoadOptionsArgs) => void;
7
7
  debounceTimeout?: number;
@@ -2,10 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useEffect, useMemo, useState } from 'react';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { TableSelect } from "rc-master-ui";
5
- // import type {TableSelectProps} from "rc-master-ui/es/table-select"
6
-
7
- // import type {LoadOptionsArgs} from "../type";
8
-
9
5
  export function AsyncTableSelect({
10
6
  loadOptions,
11
7
  debounceTimeout = 500,
@@ -128,7 +128,7 @@ const CheckboxFilter = props => {
128
128
  }) => (filters || []).map((filter, index) => {
129
129
  const key = String(filter.value);
130
130
  const item = {
131
- title: filter.text,
131
+ title: filter.label,
132
132
  key: filter.value !== undefined ? key : String(index)
133
133
  };
134
134
  if (filter.children) {
@@ -213,7 +213,11 @@ const CheckboxFilter = props => {
213
213
  return filterSearch(searchValue, getFilterData(node));
214
214
  }
215
215
  return searchValueMatched(searchValue, node.title);
216
- } : undefined
216
+ } : undefined,
217
+ rootStyle: {
218
+ background: 'none',
219
+ boxShadow: 'none'
220
+ }
217
221
  })));
218
222
  }
219
223
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FilterSearch, {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { FilterSearchType, TableLocale } from "antd/es/table/interface";
3
- import type { AnyObject } from '../../type';
3
+ import type { AnyObject } from '../../../grid-component/type';
4
4
  interface FilterSearchProps<RecordType = AnyObject> {
5
5
  value: string;
6
6
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import SearchOutlined from '@ant-design/icons/SearchOutlined';
3
3
  import { Input } from 'rc-master-ui';
4
4
 
5
- // import type {AnyObject} from "./type"
5
+ // import type {AnyObject} from "./../grid-component/type"
6
6
 
7
7
  const FilterSearch = props => {
8
8
  const {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { CommandItem } from "../../type";
2
+ import type { CommandItem } from "../../../grid-component/type";
3
3
  type Props<T> = {
4
4
  id: string;
5
5
  record: T;
@@ -1,5 +1,6 @@
1
- import React, { KeyboardEventHandler } from "react";
2
- import type { IFormat } from "../../type";
1
+ import type { KeyboardEventHandler } from "react";
2
+ import React from "react";
3
+ import type { IFormat } from "../../../grid-component/type";
3
4
  type Props = {
4
5
  t?: any;
5
6
  format?: IFormat;
@@ -2,9 +2,6 @@ import React, { Fragment } from "react";
2
2
  import { NumericFormat } from "react-numeric-component";
3
3
  import { Input } from "rc-master-ui";
4
4
  import { checkDecimalSeparator, checkThousandSeparator } from "../../hook/utils";
5
- // import type {IFormat} from "../type"
6
- // import {checkDecimalSeparator, checkThousandSeparator} from "../hooks"
7
-
8
5
  const NumberInput = props => {
9
6
  const {
10
7
  t,
@@ -14,11 +11,6 @@ const NumberInput = props => {
14
11
  onPressEnter
15
12
  } = props;
16
13
  const values = React.useMemo(() => [value], [value]);
17
-
18
- // const [values, setValues] = React.useState<any[]>(() =>
19
- // mergedValues,
20
- // );
21
-
22
14
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(NumericFormat, {
23
15
  value: values[0] ?? ''
24
16
  // value={min}
@@ -1,5 +1,6 @@
1
- import React, { KeyboardEventHandler } from "react";
2
- import type { IFormat } from "../../type";
1
+ import type { KeyboardEventHandler } from "react";
2
+ import React from "react";
3
+ import type { IFormat } from "../../../grid-component/type";
3
4
  type Props = {
4
5
  t?: any;
5
6
  format?: IFormat;
@@ -2,9 +2,6 @@ import React, { Fragment } from "react";
2
2
  import { NumericFormat } from "react-numeric-component";
3
3
  import { Input } from "rc-master-ui";
4
4
  import { checkDecimalSeparator, checkThousandSeparator } from "../../hook/utils";
5
- // import type {IFormat} from "../type"
6
- // import {checkDecimalSeparator, checkThousandSeparator} from "../hooks"
7
-
8
5
  const NumberRange = props => {
9
6
  const {
10
7
  t,
@@ -1,33 +1,15 @@
1
- // import type { Virtualizer } from "@tanstack/react-virtual";
2
- // import type { Person } from "../makeData";
3
1
  import TableFooterCell from "./TableFooterCell";
4
2
  import React from "react";
5
3
  import { TableContext } from "../useContext";
6
- // import type { Person } from "../../tanstack-table/makeData";
7
- // import TableHeadCell from "./TableHeadCell";
8
-
9
4
  const TableFooterRow = ({
10
5
  table,
11
- // columnVirtualizer,
12
6
  headerGroup
13
- // virtualPaddingLeft,
14
- // virtualPaddingRight,
15
- // fixedLeftColumns,
16
- // fixedRightColumns,
17
- // virtualColumns,
18
- // columnVirtualizer
19
7
  }) => {
20
- // const virtualColumns = columnVirtualizer.getVirtualItems();
21
-
22
- // const a = table.getVisibleFlatColumns()
23
8
  const visibleColumns = table.getVisibleLeafColumns();
24
9
  const {
25
10
  onRowFooterStyles
26
11
  } = React.useContext(TableContext);
27
12
  const rowStyles = typeof onRowFooterStyles === 'function' ? onRowFooterStyles() : onRowFooterStyles;
28
-
29
- // const
30
-
31
13
  return /*#__PURE__*/React.createElement("div", {
32
14
  key: headerGroup.id,
33
15
  style: {
@@ -40,11 +22,8 @@ const TableFooterRow = ({
40
22
  className: "ui-rc-grid-footer-row"
41
23
  }, visibleColumns.map(header => {
42
24
  return /*#__PURE__*/React.createElement(TableFooterCell, {
43
- key: header.id
44
- // header={header as any}
45
- ,
25
+ key: header.id,
46
26
  column: header
47
- // columnVirtualizer={columnVirtualizer}
48
27
  });
49
28
  }));
50
29
  };
@@ -1,27 +1,10 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { TableContext } from "../useContext";
3
- // import TableHeadRow from './TableHeadRow'
4
3
  import TableHeadCell2 from "./TableHeadCell2";
5
4
  import TableHeadGroupCell from "./TableHeadGroupCell";
6
- // import { getCommonPinningStyles } from '../hook/utils'
7
-
8
- // const getVisibleChildCount = <T,>(column: Column<T>): number => {
9
- // if (!column.columns?.length) return 0;
10
-
11
- // return column.columns.reduce((count: number, col: Column<T>) => {
12
- // const selfCount = col.getIsVisible() ? 1 : 0;
13
- // const childrenCount = getVisibleChildCount(col);
14
- // return count + selfCount + (childrenCount ? childrenCount - 1 : childrenCount);
15
- // }, 0);
16
- // }
17
-
18
5
  const TableHead = ({
19
6
  columnVirtualizer,
20
7
  table
21
- // virtualPaddingLeft,
22
- // virtualPaddingRight,
23
- // fixedLeftColumns,
24
- // fixedRightColumns
25
8
  }) => {
26
9
  const {
27
10
  prefix,
@@ -29,7 +12,6 @@ const TableHead = ({
29
12
  } = useContext(TableContext);
30
13
  const headerGroups = table.getFlatHeaders();
31
14
  const leafColumns = table.getVisibleFlatColumns();
32
- // const leafColumns11 = table.getIsAllColumnsVisible();
33
15
  const headerDepth = table.getHeaderGroups().length;
34
16
  const rowStyles = typeof onRowHeaderStyles === 'function' ? onRowHeaderStyles() : onRowHeaderStyles;
35
17
  return /*#__PURE__*/React.createElement("div", {
@@ -40,8 +22,6 @@ const TableHead = ({
40
22
  position: 'sticky',
41
23
  top: 0,
42
24
  zIndex: 1,
43
- // gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
44
- // gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
45
25
  gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
46
26
  }
47
27
  }, leafColumns.map(column => {
@@ -14,11 +14,6 @@ const TableHeadCell = props => {
14
14
  header,
15
15
  getPopupContainer,
16
16
  table
17
- // t,
18
- // columnVirtualizer,
19
- // rowHeaderVirtualizer,
20
- // colSpan,
21
- // rowSpan
22
17
  } = props;
23
18
  const {
24
19
  t,
@@ -30,7 +30,8 @@ const TableHeadCell2 = props => {
30
30
  setIsSelectionChange,
31
31
  id,
32
32
  locale,
33
- format
33
+ format,
34
+ dataSourceFilter
34
35
  } = useContext(TableContext);
35
36
  const isPinned = column.getIsPinned();
36
37
  const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
@@ -156,7 +157,8 @@ const TableHeadCell2 = props => {
156
157
  selectedKeys,
157
158
  setSelectedKeys,
158
159
  doFilter,
159
- format
160
+ format,
161
+ dataSourceFilter
160
162
 
161
163
  // selectedKeys: (column.getFilterValue() ?? []) as string[],
162
164
  // setSelectedKeys: column.setFilterValue,
@@ -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";
@@ -60,6 +55,7 @@ const Grid = props => {
60
55
  allowResizing,
61
56
  windowSize,
62
57
  fullScreenTitle,
58
+ classNames: tableClassNames,
63
59
  ...rest
64
60
  } = props;
65
61
  const [columnResizeMode] = React.useState('onChange');
@@ -263,7 +259,7 @@ const Grid = props => {
263
259
  theme: theme?.theme,
264
260
  ...theme
265
261
  },
266
- className: classNames(`${prefix}-grid`, {
262
+ className: classNames(`${prefix}-grid ${tableClassNames}`, {
267
263
  [`${prefix}-grid-light`]: !theme || theme.theme === 'light',
268
264
  [`${prefix}-grid-dark`]: theme?.theme === 'dark'
269
265
  }),
@@ -342,7 +338,7 @@ const Grid = props => {
342
338
  theme: theme?.theme,
343
339
  ...theme
344
340
  },
345
- className: classNames(`${prefix}-grid`, {
341
+ className: classNames(`${prefix}-grid ${tableClassNames}`, {
346
342
  [`${prefix}-grid-light`]: !theme || theme.theme === 'light',
347
343
  [`${prefix}-grid-dark`]: theme?.theme === 'dark'
348
344
  }),
@@ -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;