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.
- package/es/grid-component/hooks/constant.d.ts +1 -0
- package/es/grid-component/hooks/constant.js +2 -1
- 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 +6 -129
- 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/TableBodyCellEdit.js +2 -9
- 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 +1 -15
- package/es/table-component/header/TableHeadCell2.js +5 -3
- 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/constant.d.ts +1 -0
- package/lib/grid-component/hooks/constant.js +3 -2
- 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 +5 -128
- 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/TableBodyCellEdit.js +5 -11
- 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 +4 -18
- package/lib/table-component/header/TableHeadCell2.js +8 -6
- 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/hook/constant.d.ts +0 -73
- package/es/table-component/hook/constant.js +0 -240
- 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/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
- 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
|
@@ -11,11 +11,11 @@ var _antd = require("antd");
|
|
|
11
11
|
var _becoxyIcons = require("becoxy-icons");
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _rcMasterUi = require("rc-master-ui");
|
|
14
|
-
var _constant = require("../hook/constant");
|
|
15
14
|
var _utils = require("../hook/utils");
|
|
16
15
|
var _useContext = require("../useContext");
|
|
17
16
|
var _renderFilter = require("./renderFilter");
|
|
18
17
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
18
|
+
var _hooks = require("../../grid-component/hooks");
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
const TableHeadCell2 = props => {
|
|
@@ -39,7 +39,8 @@ const TableHeadCell2 = props => {
|
|
|
39
39
|
setIsSelectionChange,
|
|
40
40
|
id,
|
|
41
41
|
locale,
|
|
42
|
-
format
|
|
42
|
+
format,
|
|
43
|
+
dataSourceFilter
|
|
43
44
|
} = (0, _react.useContext)(_useContext.TableContext);
|
|
44
45
|
const isPinned = column.getIsPinned();
|
|
45
46
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
@@ -133,7 +134,7 @@ const TableHeadCell2 = props => {
|
|
|
133
134
|
dropdownRender: () => {
|
|
134
135
|
const type = (0, _utils.getTypeFilter)(originalColumn);
|
|
135
136
|
const operatorValue = column.getFilterOperator() ?? (0, _utils.getDefaultOperator)(originalColumn);
|
|
136
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
137
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
137
138
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
139
|
// className='ui-rc-table-filter-dropdown'
|
|
139
140
|
|
|
@@ -147,7 +148,7 @@ const TableHeadCell2 = props => {
|
|
|
147
148
|
}, /*#__PURE__*/_react.default.createElement("div", null), column.columnDef?.meta?.showOperator !== false && column.columnDef?.meta?.typeFilter !== 'DateRange' && column.columnDef?.meta?.typeFilter !== 'NumberRange' && /*#__PURE__*/_react.default.createElement("div", {
|
|
148
149
|
className: 'mb-1'
|
|
149
150
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
150
|
-
options: (0,
|
|
151
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
151
152
|
style: {
|
|
152
153
|
width: '100%',
|
|
153
154
|
marginBottom: 8
|
|
@@ -165,7 +166,8 @@ const TableHeadCell2 = props => {
|
|
|
165
166
|
selectedKeys,
|
|
166
167
|
setSelectedKeys,
|
|
167
168
|
doFilter,
|
|
168
|
-
format
|
|
169
|
+
format,
|
|
170
|
+
dataSourceFilter
|
|
169
171
|
|
|
170
172
|
// selectedKeys: (column.getFilterValue() ?? []) as string[],
|
|
171
173
|
// setSelectedKeys: column.setFilterValue,
|
|
@@ -266,7 +268,7 @@ const TableHeadCell2 = props => {
|
|
|
266
268
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
267
269
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
268
270
|
})
|
|
269
|
-
}, cellContent)), !
|
|
271
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(column.id) && column.columns.length < 1 && /*#__PURE__*/_react.default.createElement("span", {
|
|
270
272
|
className: "ui-rc-header-trigger"
|
|
271
273
|
}, column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
272
274
|
style: {
|
|
@@ -18,25 +18,17 @@ const TableHeadGroupCell = props => {
|
|
|
18
18
|
const {
|
|
19
19
|
column,
|
|
20
20
|
header,
|
|
21
|
-
// getPopupContainer,
|
|
22
21
|
table,
|
|
23
22
|
depth,
|
|
24
|
-
// t,
|
|
25
|
-
// columnVirtualizer,
|
|
26
|
-
// rowHeaderVirtualizer,
|
|
27
23
|
colSpan,
|
|
28
24
|
rowSpan
|
|
29
25
|
} = props;
|
|
30
26
|
const {
|
|
31
|
-
// t,
|
|
32
27
|
prefix,
|
|
33
|
-
// setSorterChange,
|
|
34
|
-
// setFilterChange,
|
|
35
28
|
wrapSettings,
|
|
36
29
|
selectionSettings,
|
|
37
30
|
setIsSelectionChange,
|
|
38
31
|
id
|
|
39
|
-
// locale
|
|
40
32
|
} = (0, _react.useContext)(_useContext.TableContext);
|
|
41
33
|
const isPinned = column.getIsPinned();
|
|
42
34
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
@@ -46,14 +38,6 @@ const TableHeadGroupCell = props => {
|
|
|
46
38
|
const cellContent = (0, _reactTable.flexRender)(column.columnDef.header, header.getContext());
|
|
47
39
|
const html = _server.default.renderToStaticMarkup( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, cellContent));
|
|
48
40
|
const hasValue = html.trim().length > 0;
|
|
49
|
-
|
|
50
|
-
// const filtered = column.getIsFiltered()
|
|
51
|
-
|
|
52
|
-
// const { attributes, isDragging, listeners, setNodeRef, transform } =
|
|
53
|
-
// useSortable({
|
|
54
|
-
// id: column.id,
|
|
55
|
-
// })
|
|
56
|
-
|
|
57
41
|
const style = {
|
|
58
42
|
transition: 'width transform 0.2s ease-in-out',
|
|
59
43
|
whiteSpace: 'nowrap',
|
|
@@ -113,13 +97,6 @@ const TableHeadGroupCell = props => {
|
|
|
113
97
|
onDoubleClick: () => column.resetSize(),
|
|
114
98
|
onMouseDown: header.getResizeHandler(),
|
|
115
99
|
onTouchStart: header.getResizeHandler(),
|
|
116
|
-
// onMouseUp: () => {
|
|
117
|
-
// requestAnimationFrame(() => {
|
|
118
|
-
// columnVirtualizer.measure()
|
|
119
|
-
// // rowHeaderVirtualizer.measure()
|
|
120
|
-
// })
|
|
121
|
-
// },
|
|
122
|
-
|
|
123
100
|
className: `resizer ${column.getIsResizing() ? 'isResizing' : ''}`
|
|
124
101
|
}));
|
|
125
102
|
};
|
|
@@ -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";
|
|
@@ -68,10 +68,6 @@ var _uuid = require("uuid");
|
|
|
68
68
|
var _colors = require("@ant-design/colors");
|
|
69
69
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
70
70
|
var _moment = _interopRequireDefault(require("moment"));
|
|
71
|
-
// import { SELECTION_COLUMN } from "rc-master-ui/es/table/hooks/useSelection"
|
|
72
|
-
|
|
73
|
-
// import moment from "moment/moment"
|
|
74
|
-
|
|
75
71
|
const newGuid = () => {
|
|
76
72
|
for (let i = 0; i < 20; i++) {
|
|
77
73
|
// @ts-ignore
|
|
@@ -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;
|
|
@@ -6,5 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _InternalTable = _interopRequireDefault(require("./InternalTable"));
|
|
9
|
-
// import type {ToolbarItem} from "rc-master-ui/es/toolbar"
|
|
10
9
|
var _default = exports.default = _InternalTable.default;
|
|
@@ -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'> & {
|
|
@@ -23,10 +23,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
24
|
// import { makeData } from "../default/makeData";
|
|
25
25
|
|
|
26
|
-
// import { flattenArray, getFixedFields, getInvisibleColumns, unFlattenData, updateOrInsert } from './hook/utils'
|
|
27
|
-
|
|
28
|
-
// import { faker } from '@faker-js/faker'
|
|
29
|
-
|
|
30
26
|
const Grid = props => {
|
|
31
27
|
const {
|
|
32
28
|
theme,
|
|
@@ -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;
|
|
@@ -16,13 +16,15 @@ var _faker = require("@faker-js/faker");
|
|
|
16
16
|
var _useMergedState = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
|
|
17
17
|
var _reactTable = require("@tanstack/react-table");
|
|
18
18
|
var _utils = require("./hook/utils");
|
|
19
|
-
var _useColumns = require("./hook/useColumns");
|
|
20
19
|
var _hooks = require("../grid-component/hooks");
|
|
21
20
|
var _Grid = _interopRequireDefault(require("./table/Grid"));
|
|
22
21
|
var _utils2 = require("../table-component/hook/utils");
|
|
23
22
|
var _operator = require("../table-component/features/operator");
|
|
23
|
+
var _useColumns = require("../table-component/hook/useColumns");
|
|
24
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
// import { convertToTanStackColumns } from './hook/useColumns'
|
|
27
|
+
|
|
26
28
|
_dayjs.default.extend(_customParseFormat.default);
|
|
27
29
|
const SELECTION_COLUMN = exports.SELECTION_COLUMN = {};
|
|
28
30
|
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> {
|
|
@@ -13,8 +13,8 @@ var _Checkbox = _interopRequireDefault(require("rc-master-ui/lib/checkbox/Checkb
|
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _useContext = require("../useContext");
|
|
16
|
-
var _useColumns = require("../hook/useColumns");
|
|
17
16
|
var _Command = _interopRequireDefault(require("../../table-component/components/command/Command"));
|
|
17
|
+
var _useColumns = require("../../table-component/hook/useColumns");
|
|
18
18
|
const renderCellIndex = props => {
|
|
19
19
|
const {
|
|
20
20
|
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;
|
|
@@ -19,6 +19,7 @@ const TableBodyRow = ({
|
|
|
19
19
|
commandClick,
|
|
20
20
|
contextMenuItems,
|
|
21
21
|
onContextMenu,
|
|
22
|
+
rowheight,
|
|
22
23
|
...rest
|
|
23
24
|
}) => {
|
|
24
25
|
const {
|
|
@@ -43,7 +44,8 @@ const TableBodyRow = ({
|
|
|
43
44
|
[`${prefix}-grid-row-parent`]: row.subRows && row.subRows.length > 0
|
|
44
45
|
}),
|
|
45
46
|
style: {
|
|
46
|
-
...rowStyles
|
|
47
|
+
...rowStyles,
|
|
48
|
+
height: rowheight
|
|
47
49
|
},
|
|
48
50
|
onDoubleClick: e => {
|
|
49
51
|
recordDoubleClick?.({
|
|
@@ -11,15 +11,13 @@ var _antd = require("antd");
|
|
|
11
11
|
var _becoxyIcons = require("becoxy-icons");
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _rcMasterUi = require("rc-master-ui");
|
|
14
|
-
var _constant = require("../hook/constant");
|
|
15
14
|
var _utils = require("../hook/utils");
|
|
16
15
|
var _renderFilter = require("./renderFilter");
|
|
17
16
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
18
17
|
var _useContext = require("../useContext");
|
|
18
|
+
var _hooks = require("../../grid-component/hooks");
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
-
// import type { MenuProps } from 'rc-master-ui/es'
|
|
22
|
-
|
|
23
21
|
const TableHeadCell = props => {
|
|
24
22
|
const {
|
|
25
23
|
header,
|
|
@@ -124,7 +122,7 @@ const TableHeadCell = props => {
|
|
|
124
122
|
|
|
125
123
|
// const operatorValue = (header.column.getFilterOperator() ?? getDefaultOperator(originalColumn)) as string
|
|
126
124
|
|
|
127
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
125
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
128
126
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
129
127
|
className: (0, _classnames.default)(`${prefix}-grid-filter-dropdown`, {}),
|
|
130
128
|
style: {}
|
|
@@ -136,7 +134,7 @@ const TableHeadCell = props => {
|
|
|
136
134
|
}, column.meta?.showOperator !== false && column.meta?.typeFilter !== 'DateRange' && column.meta?.typeFilter !== 'NumberRange' && /*#__PURE__*/_react.default.createElement("div", {
|
|
137
135
|
className: 'mb-1'
|
|
138
136
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
139
|
-
options: (0,
|
|
137
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
140
138
|
style: {
|
|
141
139
|
width: '100%',
|
|
142
140
|
marginBottom: 8
|
|
@@ -230,7 +228,7 @@ const TableHeadCell = props => {
|
|
|
230
228
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
231
229
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
232
230
|
})
|
|
233
|
-
}, cellContent)), !
|
|
231
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(header.column.id) && header.subHeaders.length < 2 && /*#__PURE__*/_react.default.createElement("span", {
|
|
234
232
|
className: "ui-rc-header-trigger"
|
|
235
233
|
}, header.column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
236
234
|
style: {
|
|
@@ -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[];
|
|
@@ -15,10 +15,6 @@ var _number = _interopRequireDefault(require("../../table-component/components/n
|
|
|
15
15
|
var _numberRange = _interopRequireDefault(require("../../table-component/components/number-range"));
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
// import type { IFormat } from "../../tanstack-table/type";
|
|
19
|
-
|
|
20
|
-
// import type { AnyObject } from './type';
|
|
21
|
-
|
|
22
18
|
const renderFilter = args => {
|
|
23
19
|
const {
|
|
24
20
|
column,
|
|
@@ -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";
|
|
@@ -16,4 +16,4 @@ const colorDark = "#e6e4f3e6";
|
|
|
16
16
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
17
17
|
displayName: "GridStyle",
|
|
18
18
|
componentId: "es-grid-template__sc-rs980s-0"
|
|
19
|
-
})(["&.", "-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;
|
|
19
|
+
})(["&.", "-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 '../../
|
|
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'> & {
|
|
@@ -63,30 +63,6 @@ const Grid = props => {
|
|
|
63
63
|
rowSelection,
|
|
64
64
|
...rest
|
|
65
65
|
} = props;
|
|
66
|
-
|
|
67
|
-
// const [columnResizeMode] = React.useState<ColumnResizeMode>('onChange')
|
|
68
|
-
|
|
69
|
-
// const [columnResizeDirection] = React.useState<ColumnResizeDirection>('ltr')
|
|
70
|
-
|
|
71
|
-
// const [paginationState, setPagination] = React.useState<PaginationState>({
|
|
72
|
-
// pageIndex: pagination && pagination.currentPage ? pagination.currentPage - 1 : 0,
|
|
73
|
-
// pageSize: pagination && pagination.pageSize ? pagination.pageSize : 20
|
|
74
|
-
// })
|
|
75
|
-
|
|
76
|
-
// const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({})
|
|
77
|
-
|
|
78
|
-
// const [grouping, setGrouping] = React.useState<GroupingState>([])
|
|
79
|
-
|
|
80
|
-
// const [columnSizing, setColumnSizing] = React.useState<ColumnSizingState>({})
|
|
81
|
-
// const [columnSizingInfo, setColumnSizingInfo] = React.useState<ColumnSizingInfoState>({} as ColumnSizingInfoState)
|
|
82
|
-
|
|
83
|
-
// const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>([])
|
|
84
|
-
|
|
85
|
-
// const [operator, setOperator] = React.useState<ColumnOperatorState>([])
|
|
86
|
-
// const [sorting, setSorting] = React.useState<SortingState>([])
|
|
87
|
-
|
|
88
|
-
// const [columnOrder, setColumnOrder] = React.useState<string[]>(() => columns.map(c => c.id!))
|
|
89
|
-
|
|
90
66
|
const [isSelectionChange, setIsSelectionChange] = _react.default.useState({
|
|
91
67
|
isChange: false,
|
|
92
68
|
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 '../../
|
|
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;
|
|
@@ -18,8 +18,6 @@ var _utils = require("../hook/utils");
|
|
|
18
18
|
var _useContext = require("../useContext");
|
|
19
19
|
var _utils2 = require("../../table-component/hook/utils");
|
|
20
20
|
var _ColumnsGroup = require("../ColumnsGroup");
|
|
21
|
-
// import type { Dispatch, SetStateAction } from 'react'
|
|
22
|
-
|
|
23
21
|
// import { ColumnsGroup } from '../../grid-component/ColumnsGroup';
|
|
24
22
|
|
|
25
23
|
const TableContainer = props => {
|
|
@@ -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 '../../
|
|
3
|
+
import type { CommandClick } from '../../grid-component/type';
|
|
4
4
|
type Props<T> = {
|
|
5
5
|
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
6
6
|
table: Table<T>;
|
|
@@ -27,7 +27,6 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
27
27
|
const TableWrapper = props => {
|
|
28
28
|
const {
|
|
29
29
|
table,
|
|
30
|
-
// columns,
|
|
31
30
|
height,
|
|
32
31
|
id,
|
|
33
32
|
commandClick
|
|
@@ -47,7 +46,6 @@ const TableWrapper = props => {
|
|
|
47
46
|
ref: scrollRef,
|
|
48
47
|
style: {
|
|
49
48
|
overflow: "auto",
|
|
50
|
-
// border: "1px solid #ccc",
|
|
51
49
|
height,
|
|
52
50
|
position: "relative"
|
|
53
51
|
}
|
|
@@ -86,12 +84,14 @@ const TableWrapper = props => {
|
|
|
86
84
|
})),
|
|
87
85
|
TableRow: props => {
|
|
88
86
|
const index = props["data-index"];
|
|
87
|
+
const rowheight = props["data-known-size"];
|
|
89
88
|
const row = rows[index];
|
|
90
89
|
return /*#__PURE__*/_react.default.createElement(_TableBodyRow.default, (0, _extends2.default)({
|
|
91
90
|
tableId: id,
|
|
92
91
|
row: row,
|
|
93
92
|
table: table,
|
|
94
|
-
commandClick: commandClick
|
|
93
|
+
commandClick: commandClick,
|
|
94
|
+
rowheight: rowheight
|
|
95
95
|
}, props));
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -145,22 +145,6 @@ const TableWrapper = props => {
|
|
|
145
145
|
});
|
|
146
146
|
}));
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
// itemContent={(index) => {
|
|
150
|
-
|
|
151
|
-
// const row = rows[index]
|
|
152
|
-
// return (
|
|
153
|
-
|
|
154
|
-
// <TableBodyRow
|
|
155
|
-
// tableId={id}
|
|
156
|
-
// row={row}
|
|
157
|
-
// table={table}
|
|
158
|
-
// // {...props}
|
|
159
|
-
|
|
160
|
-
// />
|
|
161
|
-
|
|
162
|
-
// )
|
|
163
|
-
// }}
|
|
164
148
|
})));
|
|
165
149
|
};
|
|
166
150
|
var _default = exports.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 "../
|
|
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 = {
|
package/package.json
CHANGED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export declare const defaultWidth: number;
|
|
2
|
-
export declare const defaultRowHeight: number;
|
|
3
|
-
export type IOperator = {
|
|
4
|
-
value: string;
|
|
5
|
-
label: string;
|
|
6
|
-
key: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const numberOperator: IOperator[];
|
|
9
|
-
export declare const stringOperator: IOperator[];
|
|
10
|
-
export declare const dateOperator: IOperator[];
|
|
11
|
-
export declare const dateTimeOperator: IOperator[];
|
|
12
|
-
export declare const booleanOperator: IOperator[];
|
|
13
|
-
export declare const translateOption: (options: IOperator[], t: any) => any[];
|
|
14
|
-
export declare const transferFontSize: any;
|
|
15
|
-
export declare const defaultDateFormat = "d/m/Y";
|
|
16
|
-
export declare const defaultDateTimeFormat = "d/m/Y H:i";
|
|
17
|
-
export declare const defaultTimeFormat = "H:i";
|
|
18
|
-
export declare const defaultPageSizes: number[];
|
|
19
|
-
export declare const alignToFlex: any;
|
|
20
|
-
export declare const optionsSize: {
|
|
21
|
-
label: string;
|
|
22
|
-
value: string;
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
}[];
|
|
26
|
-
export declare const paperSize: {
|
|
27
|
-
a4: {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
};
|
|
31
|
-
a3: {
|
|
32
|
-
width: number;
|
|
33
|
-
height: number;
|
|
34
|
-
};
|
|
35
|
-
letter: {
|
|
36
|
-
width: number;
|
|
37
|
-
height: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export declare const optionFont: {
|
|
41
|
-
value: string;
|
|
42
|
-
label: string;
|
|
43
|
-
}[];
|
|
44
|
-
export declare const optionsPaperOrientation: any[];
|
|
45
|
-
export declare const optionFontSize: {
|
|
46
|
-
value: number;
|
|
47
|
-
label: string;
|
|
48
|
-
}[];
|
|
49
|
-
/**
|
|
50
|
-
* Sort order for BaseTable
|
|
51
|
-
*/
|
|
52
|
-
declare const SortOrder: {
|
|
53
|
-
/**
|
|
54
|
-
* Sort data in ascending order
|
|
55
|
-
*/
|
|
56
|
-
ascend: string;
|
|
57
|
-
/**
|
|
58
|
-
* Sort data in descending order
|
|
59
|
-
*/
|
|
60
|
-
descend: string;
|
|
61
|
-
};
|
|
62
|
-
export default SortOrder;
|
|
63
|
-
export declare const valueToBoolean: {
|
|
64
|
-
true: boolean;
|
|
65
|
-
false: boolean;
|
|
66
|
-
1: boolean;
|
|
67
|
-
0: boolean;
|
|
68
|
-
};
|
|
69
|
-
export declare const booleanToValue: {
|
|
70
|
-
true: number;
|
|
71
|
-
false: number;
|
|
72
|
-
};
|
|
73
|
-
export declare const nonActionColumn: string[];
|