es-grid-template 1.8.67 → 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.
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/utils.d.ts +1 -1
- package/es/grid-component/index.d.ts +1 -1
- package/es/grid-component/type.d.ts +567 -0
- package/es/grid-component/type.js +1 -490
- package/es/table-component/ColumnsChoose.d.ts +1 -1
- package/es/table-component/ColumnsChoose.js +0 -2
- package/es/table-component/ContextMenu.d.ts +1 -2
- package/es/table-component/ContextMenu.js +0 -1
- package/es/table-component/InternalTable.d.ts +1 -2
- package/es/table-component/InternalTable.js +1 -32
- package/es/table-component/TableContainer.d.ts +1 -1
- package/es/table-component/TableContainer.js +4 -2
- package/es/table-component/TableContainerEdit.d.ts +1 -1
- package/es/table-component/TableContainerEdit.js +4 -2
- package/es/table-component/body/EditableCell.d.ts +1 -1
- package/es/table-component/body/EditableCell.js +1 -18
- package/es/table-component/body/TableBody.d.ts +1 -1
- package/es/table-component/body/TableBodyCell.d.ts +1 -1
- package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
- package/es/table-component/body/TableBodyRow.d.ts +1 -1
- package/es/table-component/components/ControlCheckbox.d.ts +1 -1
- package/es/table-component/components/EditForm/EditForm.js +0 -1
- package/es/table-component/components/InputControl/InputControl.js +0 -3
- package/es/table-component/components/async-select/index.d.ts +1 -1
- package/es/table-component/components/async-select/index.js +0 -3
- package/es/table-component/components/async-table-select/index.d.ts +1 -1
- package/es/table-component/components/async-table-select/index.js +0 -4
- package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
- package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
- package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
- package/es/table-component/components/command/Command.d.ts +1 -1
- package/es/table-component/components/number/index.d.ts +3 -2
- package/es/table-component/components/number/index.js +0 -8
- package/es/table-component/components/number-range/index.d.ts +3 -2
- package/es/table-component/components/number-range/index.js +0 -3
- package/es/table-component/footer/TableFooterRow.js +1 -22
- package/es/table-component/header/TableHead.js +0 -20
- package/es/table-component/header/TableHeadCell.js +0 -5
- package/es/table-component/header/TableHeadCell2.js +4 -2
- package/es/table-component/header/TableHeadGroupCell.js +0 -23
- package/es/table-component/header/renderFilter.d.ts +1 -1
- package/es/table-component/hook/useColumns.d.ts +1 -1
- package/es/table-component/hook/useFilterOperator.d.ts +2 -2
- package/es/table-component/hook/utils.d.ts +1 -1
- package/es/table-component/hook/utils.js +0 -3
- package/es/table-component/index.d.ts +1 -1
- package/es/table-component/index.js +0 -3
- package/es/table-component/table/Grid.d.ts +1 -1
- package/es/table-component/table/Grid.js +0 -5
- package/es/table-component/table/TableWrapper.d.ts +1 -1
- package/es/table-component/useContext.d.ts +2 -1
- package/es/table-virtuoso/InternalTable.d.ts +1 -1
- package/es/table-virtuoso/InternalTable.js +2 -1
- package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
- package/es/table-virtuoso/body/TableBodyCell.js +1 -1
- package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
- package/es/table-virtuoso/body/TableBodyRow.js +3 -1
- package/es/table-virtuoso/header/TableHeadCell.js +1 -3
- package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
- package/es/table-virtuoso/header/renderFilter.js +0 -4
- package/es/table-virtuoso/hook/utils.d.ts +1 -1
- package/es/table-virtuoso/style.js +1 -1
- package/es/table-virtuoso/table/Grid.d.ts +1 -1
- package/es/table-virtuoso/table/Grid.js +0 -24
- package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
- package/es/table-virtuoso/table/TableContainer.js +0 -2
- package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
- package/es/table-virtuoso/table/TableWrapper.js +3 -19
- package/es/table-virtuoso/useContext.d.ts +1 -1
- package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/lib/grid-component/hooks/utils.d.ts +1 -1
- package/lib/grid-component/index.d.ts +1 -1
- package/lib/grid-component/type.d.ts +567 -0
- package/lib/grid-component/type.js +4 -490
- package/lib/table-component/ColumnsChoose.d.ts +1 -1
- package/lib/table-component/ColumnsChoose.js +0 -2
- package/lib/table-component/ContextMenu.d.ts +1 -2
- package/lib/table-component/ContextMenu.js +0 -2
- package/lib/table-component/InternalTable.d.ts +1 -2
- package/lib/table-component/InternalTable.js +1 -28
- package/lib/table-component/TableContainer.d.ts +1 -1
- package/lib/table-component/TableContainer.js +4 -2
- package/lib/table-component/TableContainerEdit.d.ts +1 -1
- package/lib/table-component/TableContainerEdit.js +4 -2
- package/lib/table-component/body/EditableCell.d.ts +1 -1
- package/lib/table-component/body/EditableCell.js +0 -10
- package/lib/table-component/body/TableBody.d.ts +1 -1
- package/lib/table-component/body/TableBodyCell.d.ts +1 -1
- package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
- package/lib/table-component/body/TableBodyRow.d.ts +1 -1
- package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
- package/lib/table-component/components/EditForm/EditForm.js +0 -2
- package/lib/table-component/components/InputControl/InputControl.js +0 -4
- package/lib/table-component/components/async-select/index.d.ts +1 -1
- package/lib/table-component/components/async-select/index.js +0 -2
- package/lib/table-component/components/async-table-select/index.d.ts +1 -1
- package/lib/table-component/components/async-table-select/index.js +0 -4
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
- package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
- package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
- package/lib/table-component/components/command/Command.d.ts +1 -1
- package/lib/table-component/components/number/index.d.ts +3 -2
- package/lib/table-component/components/number/index.js +0 -8
- package/lib/table-component/components/number-range/index.d.ts +3 -2
- package/lib/table-component/components/number-range/index.js +0 -3
- package/lib/table-component/footer/TableFooterRow.js +1 -23
- package/lib/table-component/header/TableHead.js +0 -21
- package/lib/table-component/header/TableHeadCell.js +0 -5
- package/lib/table-component/header/TableHeadCell2.js +4 -2
- package/lib/table-component/header/TableHeadGroupCell.js +0 -23
- package/lib/table-component/header/renderFilter.d.ts +1 -1
- package/lib/table-component/hook/useColumns.d.ts +1 -1
- package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
- package/lib/table-component/hook/utils.d.ts +1 -1
- package/lib/table-component/hook/utils.js +0 -4
- package/lib/table-component/index.d.ts +1 -1
- package/lib/table-component/index.js +0 -1
- package/lib/table-component/table/Grid.d.ts +1 -1
- package/lib/table-component/table/Grid.js +0 -4
- package/lib/table-component/table/TableWrapper.d.ts +1 -1
- package/lib/table-component/useContext.d.ts +2 -1
- package/lib/table-virtuoso/InternalTable.d.ts +1 -1
- package/lib/table-virtuoso/InternalTable.js +3 -1
- package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
- package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
- package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
- package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
- package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
- package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
- package/lib/table-virtuoso/header/renderFilter.js +0 -4
- package/lib/table-virtuoso/hook/utils.d.ts +1 -1
- package/lib/table-virtuoso/style.js +1 -1
- package/lib/table-virtuoso/table/Grid.d.ts +1 -1
- package/lib/table-virtuoso/table/Grid.js +0 -24
- package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
- package/lib/table-virtuoso/table/TableContainer.js +0 -2
- package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
- package/lib/table-virtuoso/table/TableWrapper.js +3 -19
- package/lib/table-virtuoso/useContext.d.ts +1 -1
- package/package.json +1 -1
- package/es/table-component/type.d.ts +0 -567
- package/es/table-component/type.js +0 -1
- package/es/table-virtuoso/hook/constant.d.ts +0 -73
- package/es/table-virtuoso/hook/constant.js +0 -240
- package/es/table-virtuoso/hook/convert.d.ts +0 -1
- package/es/table-virtuoso/hook/convert.js +0 -28
- package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
- package/es/table-virtuoso/hook/useColumns.js +0 -302
- package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
- package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
- package/es/table-virtuoso/style.scss +0 -1441
- package/es/table-virtuoso/type.d.ts +0 -0
- package/es/table-virtuoso/type.js +0 -785
- package/lib/table-component/type.d.ts +0 -567
- package/lib/table-component/type.js +0 -5
- package/lib/table-virtuoso/hook/constant.d.ts +0 -73
- package/lib/table-virtuoso/hook/constant.js +0 -247
- package/lib/table-virtuoso/hook/convert.d.ts +0 -1
- package/lib/table-virtuoso/hook/convert.js +0 -34
- package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
- package/lib/table-virtuoso/hook/useColumns.js +0 -315
- package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
- package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
- package/lib/table-virtuoso/style.scss +0 -1441
- package/lib/table-virtuoso/type.d.ts +0 -0
- 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
|
-
|
|
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 { Cell, Table } from "@tanstack/react-table";
|
|
2
|
-
import type { CommandClick } from "
|
|
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 "
|
|
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 "
|
|
3
|
+
import type { CommandClick } from "../../grid-component/type";
|
|
4
4
|
import React from "react";
|
|
5
5
|
interface TableBodyRowProps<T> {
|
|
6
6
|
tableId: string;
|
|
@@ -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 '
|
|
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 '
|
|
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.
|
|
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 '
|
|
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 "
|
|
5
|
+
// import type {AnyObject} from "./../grid-component/type"
|
|
6
6
|
|
|
7
7
|
const FilterSearch = props => {
|
|
8
8
|
const {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
|
2
|
-
import
|
|
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 => {
|
|
@@ -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 "
|
|
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 '
|
|
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 '
|
|
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 "
|
|
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 '
|
|
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,5 @@
|
|
|
1
1
|
import type { ColumnDef, ColumnPinningState, ExpandedState, VisibilityState } from '@tanstack/react-table';
|
|
2
|
-
import type { ColumnsTable, Sorter, TableProps } from '
|
|
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 "
|
|
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 "
|
|
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 '../
|
|
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
|
|
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 "../../
|
|
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 "../../
|
|
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
|
-
|
|
13
|
-
|
|
11
|
+
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
|
|
14
12
|
const TableHeadCell = props => {
|
|
15
13
|
const {
|
|
16
14
|
header,
|