es-grid-template 1.8.66 → 1.8.67
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/table-component/TableContainerEdit.js +2 -127
- package/es/table-component/body/TableBodyCellEdit.js +2 -9
- package/es/table-component/header/TableHeadCell.js +1 -10
- package/es/table-component/header/TableHeadCell2.js +1 -1
- package/es/table-component/type.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/table-component/TableContainerEdit.js +1 -126
- package/lib/table-component/body/TableBodyCellEdit.js +5 -11
- package/lib/table-component/header/TableHeadCell.js +4 -13
- package/lib/table-component/header/TableHeadCell2.js +4 -4
- package/lib/table-component/type.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/lib/table-component/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
|
@@ -13,7 +13,7 @@ import { TableContext } from "./useContext";
|
|
|
13
13
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
14
14
|
import { Toolbar } from "rc-master-ui";
|
|
15
15
|
import classNames from "classnames";
|
|
16
|
-
import { Maximize, Minimize
|
|
16
|
+
import { Maximize, Minimize } from "becoxy-icons";
|
|
17
17
|
import { ColumnsChoose } from "./ColumnsChoose";
|
|
18
18
|
import TableWrapper from "./table/TableWrapper";
|
|
19
19
|
import withReactContent from "sweetalert2-react-content";
|
|
@@ -77,7 +77,7 @@ const TableContainerEdit = props => {
|
|
|
77
77
|
isSelectionChange,
|
|
78
78
|
setIsSelectionChange,
|
|
79
79
|
// onContextMenu,
|
|
80
|
-
contextMenuItems
|
|
80
|
+
contextMenuItems,
|
|
81
81
|
setSorterChange,
|
|
82
82
|
setFilterChange,
|
|
83
83
|
onCellPaste,
|
|
@@ -117,7 +117,6 @@ const TableContainerEdit = props => {
|
|
|
117
117
|
contextMenuOpen,
|
|
118
118
|
contextMenuClick,
|
|
119
119
|
contextMenuHidden,
|
|
120
|
-
showDefaultContext,
|
|
121
120
|
commandSettings,
|
|
122
121
|
isDataTree,
|
|
123
122
|
onCellClick,
|
|
@@ -141,123 +140,6 @@ const TableContainerEdit = props => {
|
|
|
141
140
|
|
|
142
141
|
// const columnSizingState = table.getState().columnSizing;
|
|
143
142
|
|
|
144
|
-
const defaultContext = React.useMemo(() => {
|
|
145
|
-
return [{
|
|
146
|
-
key: 'INSERT_BEFORE',
|
|
147
|
-
// label: 'Thêm dòng bên trên',
|
|
148
|
-
// label: `${t ? t(locale?.add_rows_before ?? 'Add rows before') : 'Add rows before'}`,
|
|
149
|
-
label: locale?.add_rows_before ?? 'Add rows before',
|
|
150
|
-
icon: /*#__PURE__*/React.createElement(Plus, {
|
|
151
|
-
fontSize: 14
|
|
152
|
-
}),
|
|
153
|
-
children: [{
|
|
154
|
-
parentKey: 'INSERT_BEFORE',
|
|
155
|
-
key: 'INSERT_BEFORE_1',
|
|
156
|
-
label: locale?.add_1 ?? 'Add 1 rows',
|
|
157
|
-
row: 1
|
|
158
|
-
}, {
|
|
159
|
-
parentKey: 'INSERT_BEFORE',
|
|
160
|
-
key: 'INSERT_BEFORE_10',
|
|
161
|
-
label: locale?.add_10 ?? 'Add 10 rows',
|
|
162
|
-
row: 10
|
|
163
|
-
}, {
|
|
164
|
-
parentKey: 'INSERT_BEFORE',
|
|
165
|
-
key: 'INSERT_BEFORE_50',
|
|
166
|
-
label: locale?.add_50 ?? 'Add 50 rows',
|
|
167
|
-
row: 50
|
|
168
|
-
}, {
|
|
169
|
-
parentKey: 'INSERT_BEFORE',
|
|
170
|
-
key: 'INSERT_BEFORE_100',
|
|
171
|
-
label: locale?.add_100 ?? 'Add 100 rows',
|
|
172
|
-
row: 100
|
|
173
|
-
}, {
|
|
174
|
-
parentKey: 'INSERT_BEFORE',
|
|
175
|
-
key: 'INSERT_BEFORE_ADV',
|
|
176
|
-
label: locale?.custom ?? 'Custom'
|
|
177
|
-
}]
|
|
178
|
-
}, {
|
|
179
|
-
key: 'INSERT_AFTER',
|
|
180
|
-
label: locale?.add_rows_after ?? 'Add rows after',
|
|
181
|
-
icon: /*#__PURE__*/React.createElement(Plus, {
|
|
182
|
-
fontSize: 14
|
|
183
|
-
}),
|
|
184
|
-
children: [{
|
|
185
|
-
parentKey: 'INSERT_AFTER',
|
|
186
|
-
key: 'INSERT_AFTER_1',
|
|
187
|
-
label: locale?.add_1 ?? 'Add 1 rows',
|
|
188
|
-
row: 1
|
|
189
|
-
}, {
|
|
190
|
-
parentKey: 'INSERT_AFTER',
|
|
191
|
-
key: 'INSERT_AFTER_10',
|
|
192
|
-
label: locale?.add_10 ?? 'Add 10 rows',
|
|
193
|
-
row: 10
|
|
194
|
-
}, {
|
|
195
|
-
parentKey: 'INSERT_AFTER',
|
|
196
|
-
key: 'INSERT_AFTER_50',
|
|
197
|
-
label: locale?.add_50 ?? 'Add 50 rows',
|
|
198
|
-
row: 50
|
|
199
|
-
}, {
|
|
200
|
-
parentKey: 'INSERT_AFTER',
|
|
201
|
-
key: 'INSERT_AFTER_100',
|
|
202
|
-
label: locale?.add_100 ?? 'Add 100 rows',
|
|
203
|
-
row: 100
|
|
204
|
-
}, {
|
|
205
|
-
parentKey: 'INSERT_AFTER',
|
|
206
|
-
key: 'INSERT_AFTER_ADV',
|
|
207
|
-
label: locale?.custom ?? 'Custom'
|
|
208
|
-
}]
|
|
209
|
-
}, {
|
|
210
|
-
key: 'INSERT_CHILDREN',
|
|
211
|
-
// label: 'Insert item children',
|
|
212
|
-
label: locale?.add_children ?? 'Add children',
|
|
213
|
-
icon: /*#__PURE__*/React.createElement(Plus, {
|
|
214
|
-
fontSize: 14
|
|
215
|
-
})
|
|
216
|
-
// children: [
|
|
217
|
-
// {
|
|
218
|
-
// parentKey: 'INSERT_AFTER',
|
|
219
|
-
// key: 'INSERT_AFTER_1',
|
|
220
|
-
// label: 'Thêm 1 dòng',
|
|
221
|
-
// row: 1
|
|
222
|
-
// },
|
|
223
|
-
// {
|
|
224
|
-
// parentKey: 'INSERT_AFTER',
|
|
225
|
-
// key: 'INSERT_AFTER_10',
|
|
226
|
-
// label: 'Thêm 10 dòng',
|
|
227
|
-
// row: 10
|
|
228
|
-
// },
|
|
229
|
-
// {
|
|
230
|
-
// parentKey: 'INSERT_AFTER',
|
|
231
|
-
// key: 'INSERT_AFTER_50',
|
|
232
|
-
// label: 'Thêm 50 dòng',
|
|
233
|
-
// row: 50
|
|
234
|
-
// },
|
|
235
|
-
// {
|
|
236
|
-
// parentKey: 'INSERT_AFTER',
|
|
237
|
-
// key: 'INSERT_AFTER_100',
|
|
238
|
-
// label: 'Thêm 100 dòng',
|
|
239
|
-
// row: 100
|
|
240
|
-
// },
|
|
241
|
-
// {
|
|
242
|
-
// parentKey: 'INSERT_AFTER',
|
|
243
|
-
// key: 'INSERT_AFTER_ADV',
|
|
244
|
-
// label: 'Tùy chỉnh'
|
|
245
|
-
// }
|
|
246
|
-
// ]
|
|
247
|
-
}, {
|
|
248
|
-
key: 'DELETE_CONTENT',
|
|
249
|
-
label: locale?.delete_content ?? 'Delete content',
|
|
250
|
-
icon: /*#__PURE__*/React.createElement(Trash2, {
|
|
251
|
-
fontSize: 14
|
|
252
|
-
})
|
|
253
|
-
}, {
|
|
254
|
-
key: 'DELETE_ROWS',
|
|
255
|
-
label: locale?.delete_rows ?? 'Delete rows',
|
|
256
|
-
icon: /*#__PURE__*/React.createElement(Trash2, {
|
|
257
|
-
fontSize: 14
|
|
258
|
-
})
|
|
259
|
-
}];
|
|
260
|
-
}, [locale]);
|
|
261
143
|
const itemsAdd = React.useMemo(() => {
|
|
262
144
|
return [{
|
|
263
145
|
key: '10',
|
|
@@ -270,13 +152,6 @@ const TableContainerEdit = props => {
|
|
|
270
152
|
label: `100 ${t ? t('rows') : 'rows'}`
|
|
271
153
|
}];
|
|
272
154
|
}, [t]);
|
|
273
|
-
const contextMenuItems = React.useMemo(() => {
|
|
274
|
-
const a = showDefaultContext !== false ? [...defaultContext] : [];
|
|
275
|
-
const b = propsContext && propsContext.length > 0 ? [...propsContext, {
|
|
276
|
-
type: 'divider'
|
|
277
|
-
}] : [];
|
|
278
|
-
return [...b, ...a];
|
|
279
|
-
}, [defaultContext, propsContext, showDefaultContext]);
|
|
280
155
|
const [dataErrors, setDataErrors] = React.useState([]);
|
|
281
156
|
React.useEffect(() => {
|
|
282
157
|
if (validate && dataSource && dataSource.length) {
|
|
@@ -2,21 +2,14 @@ import { flexRender } from "@tanstack/react-table";
|
|
|
2
2
|
import Space from "rc-master-ui/es/space";
|
|
3
3
|
import Command from "../components/command/Command";
|
|
4
4
|
import ReactDOMServer from 'react-dom/server';
|
|
5
|
-
import { addRowsDown, addRowsDownWithCtrl, addRowsUp, addRowsUpWithCtrl, findFirst, flattenArray, flattenData,
|
|
6
|
-
// getCellsByPosition,
|
|
7
|
-
getColIdsBetween, getCommonPinningStyles, getEditType, getRowIdsBetween, getSelectedCellMatrix, isEditable, isObjEmpty, isObjEqual, newGuid, unFlattenData, updateOrInsert } from "../hook/utils";
|
|
8
|
-
// import { nonActionColumn } from "../hook/constant";
|
|
5
|
+
import { addRowsDown, addRowsDownWithCtrl, addRowsUp, addRowsUpWithCtrl, findFirst, flattenArray, flattenData, getColIdsBetween, getCommonPinningStyles, getEditType, getRowIdsBetween, getSelectedCellMatrix, isEditable, isObjEmpty, isObjEqual, newGuid, unFlattenData, updateOrInsert } from "../hook/utils";
|
|
9
6
|
import Checkbox from "rc-master-ui/es/checkbox/Checkbox";
|
|
10
7
|
import classNames from "classnames";
|
|
11
|
-
// import type { Dispatch, SetStateAction } from "react";
|
|
12
|
-
|
|
13
8
|
import React from "react";
|
|
14
9
|
import { TableContext } from "../useContext";
|
|
15
10
|
import EditableCell from "./EditableCell";
|
|
16
|
-
import { nonActionColumn } from "
|
|
11
|
+
import { nonActionColumn } from "../../grid-component/hooks";
|
|
17
12
|
import { toggleRowSelection } from "../hook/useColumns";
|
|
18
|
-
// import { nonActionColumn } from "../hook/constant";
|
|
19
|
-
|
|
20
13
|
const renderCellIndex = props => {
|
|
21
14
|
const {
|
|
22
15
|
parrents,
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
// import { useSortable } from "@dnd-kit/sortable"
|
|
2
|
-
|
|
3
1
|
import { flexRender } from '@tanstack/react-table';
|
|
4
2
|
import React, { useContext } from 'react';
|
|
5
|
-
// import { CSS } from '@dnd-kit/utilities'
|
|
6
|
-
// import type { Virtualizer } from '@tanstack/react-virtual'
|
|
7
3
|
import { Button, Space } from 'antd';
|
|
8
4
|
import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
|
|
9
5
|
import classNames from 'classnames';
|
|
10
6
|
import { Checkbox, Dropdown, Select } from 'rc-master-ui';
|
|
11
|
-
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "
|
|
7
|
+
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
|
|
12
8
|
import { extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter } from "../hook/utils";
|
|
13
9
|
import { TableContext } from "../useContext";
|
|
14
10
|
import { renderFilter } from "./renderFilter";
|
|
15
11
|
import ReactDOMServer from 'react-dom/server';
|
|
16
|
-
|
|
17
|
-
// import { ColumnTable } from "../type";
|
|
18
|
-
|
|
19
|
-
// import { Tooltip } from 'react-tooltip'
|
|
20
|
-
|
|
21
12
|
const TableHeadCell = props => {
|
|
22
13
|
const {
|
|
23
14
|
header,
|
|
@@ -4,11 +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 { excludeItems, extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter, removeDuplicatesByKey } from "../hook/utils";
|
|
9
8
|
import { TableContext } from "../useContext";
|
|
10
9
|
import { renderFilter } from "./renderFilter";
|
|
11
10
|
import ReactDOMServer from 'react-dom/server';
|
|
11
|
+
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
|
|
12
12
|
const TableHeadCell2 = props => {
|
|
13
13
|
const {
|
|
14
14
|
column,
|
|
@@ -2,9 +2,9 @@ import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
|
|
|
2
2
|
import type { ItemType } from 'rc-master-ui/es/menu/interface';
|
|
3
3
|
import type { Cell, Header, OnChangeFn, Row } from '@tanstack/react-table';
|
|
4
4
|
import type { ReactElement, ReactNode } from 'react';
|
|
5
|
-
import type { IOperator } from './hook/constant';
|
|
6
5
|
import type { ColorPickerProps } from 'antd';
|
|
7
6
|
import type { TableLocale } from "rc-master-ui/lib/table/interface";
|
|
7
|
+
import type { IOperator } from '../grid-component/hooks';
|
|
8
8
|
declare module "@tanstack/table-core" {
|
|
9
9
|
interface ColumnMeta<any, any> extends ColumnTable {
|
|
10
10
|
rowSpan?: number;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
|
|
6
|
+
exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.nonActionColumn = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
|
|
7
7
|
const defaultWidth = exports.defaultWidth = 100;
|
|
8
8
|
const defaultRowHeight = exports.defaultRowHeight = 35;
|
|
9
9
|
const numberOperator = exports.numberOperator = [{
|
|
@@ -243,4 +243,5 @@ const valueToBoolean = exports.valueToBoolean = {
|
|
|
243
243
|
const booleanToValue = exports.booleanToValue = {
|
|
244
244
|
true: 1,
|
|
245
245
|
false: 0
|
|
246
|
-
};
|
|
246
|
+
};
|
|
247
|
+
const nonActionColumn = exports.nonActionColumn = ['#', 'command', 'selection_column'];
|
|
@@ -84,7 +84,7 @@ const TableContainerEdit = props => {
|
|
|
84
84
|
isSelectionChange,
|
|
85
85
|
setIsSelectionChange,
|
|
86
86
|
// onContextMenu,
|
|
87
|
-
contextMenuItems
|
|
87
|
+
contextMenuItems,
|
|
88
88
|
setSorterChange,
|
|
89
89
|
setFilterChange,
|
|
90
90
|
onCellPaste,
|
|
@@ -124,7 +124,6 @@ const TableContainerEdit = props => {
|
|
|
124
124
|
contextMenuOpen,
|
|
125
125
|
contextMenuClick,
|
|
126
126
|
contextMenuHidden,
|
|
127
|
-
showDefaultContext,
|
|
128
127
|
commandSettings,
|
|
129
128
|
isDataTree,
|
|
130
129
|
onCellClick,
|
|
@@ -148,123 +147,6 @@ const TableContainerEdit = props => {
|
|
|
148
147
|
|
|
149
148
|
// const columnSizingState = table.getState().columnSizing;
|
|
150
149
|
|
|
151
|
-
const defaultContext = _react.default.useMemo(() => {
|
|
152
|
-
return [{
|
|
153
|
-
key: 'INSERT_BEFORE',
|
|
154
|
-
// label: 'Thêm dòng bên trên',
|
|
155
|
-
// label: `${t ? t(locale?.add_rows_before ?? 'Add rows before') : 'Add rows before'}`,
|
|
156
|
-
label: locale?.add_rows_before ?? 'Add rows before',
|
|
157
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
|
|
158
|
-
fontSize: 14
|
|
159
|
-
}),
|
|
160
|
-
children: [{
|
|
161
|
-
parentKey: 'INSERT_BEFORE',
|
|
162
|
-
key: 'INSERT_BEFORE_1',
|
|
163
|
-
label: locale?.add_1 ?? 'Add 1 rows',
|
|
164
|
-
row: 1
|
|
165
|
-
}, {
|
|
166
|
-
parentKey: 'INSERT_BEFORE',
|
|
167
|
-
key: 'INSERT_BEFORE_10',
|
|
168
|
-
label: locale?.add_10 ?? 'Add 10 rows',
|
|
169
|
-
row: 10
|
|
170
|
-
}, {
|
|
171
|
-
parentKey: 'INSERT_BEFORE',
|
|
172
|
-
key: 'INSERT_BEFORE_50',
|
|
173
|
-
label: locale?.add_50 ?? 'Add 50 rows',
|
|
174
|
-
row: 50
|
|
175
|
-
}, {
|
|
176
|
-
parentKey: 'INSERT_BEFORE',
|
|
177
|
-
key: 'INSERT_BEFORE_100',
|
|
178
|
-
label: locale?.add_100 ?? 'Add 100 rows',
|
|
179
|
-
row: 100
|
|
180
|
-
}, {
|
|
181
|
-
parentKey: 'INSERT_BEFORE',
|
|
182
|
-
key: 'INSERT_BEFORE_ADV',
|
|
183
|
-
label: locale?.custom ?? 'Custom'
|
|
184
|
-
}]
|
|
185
|
-
}, {
|
|
186
|
-
key: 'INSERT_AFTER',
|
|
187
|
-
label: locale?.add_rows_after ?? 'Add rows after',
|
|
188
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
|
|
189
|
-
fontSize: 14
|
|
190
|
-
}),
|
|
191
|
-
children: [{
|
|
192
|
-
parentKey: 'INSERT_AFTER',
|
|
193
|
-
key: 'INSERT_AFTER_1',
|
|
194
|
-
label: locale?.add_1 ?? 'Add 1 rows',
|
|
195
|
-
row: 1
|
|
196
|
-
}, {
|
|
197
|
-
parentKey: 'INSERT_AFTER',
|
|
198
|
-
key: 'INSERT_AFTER_10',
|
|
199
|
-
label: locale?.add_10 ?? 'Add 10 rows',
|
|
200
|
-
row: 10
|
|
201
|
-
}, {
|
|
202
|
-
parentKey: 'INSERT_AFTER',
|
|
203
|
-
key: 'INSERT_AFTER_50',
|
|
204
|
-
label: locale?.add_50 ?? 'Add 50 rows',
|
|
205
|
-
row: 50
|
|
206
|
-
}, {
|
|
207
|
-
parentKey: 'INSERT_AFTER',
|
|
208
|
-
key: 'INSERT_AFTER_100',
|
|
209
|
-
label: locale?.add_100 ?? 'Add 100 rows',
|
|
210
|
-
row: 100
|
|
211
|
-
}, {
|
|
212
|
-
parentKey: 'INSERT_AFTER',
|
|
213
|
-
key: 'INSERT_AFTER_ADV',
|
|
214
|
-
label: locale?.custom ?? 'Custom'
|
|
215
|
-
}]
|
|
216
|
-
}, {
|
|
217
|
-
key: 'INSERT_CHILDREN',
|
|
218
|
-
// label: 'Insert item children',
|
|
219
|
-
label: locale?.add_children ?? 'Add children',
|
|
220
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
|
|
221
|
-
fontSize: 14
|
|
222
|
-
})
|
|
223
|
-
// children: [
|
|
224
|
-
// {
|
|
225
|
-
// parentKey: 'INSERT_AFTER',
|
|
226
|
-
// key: 'INSERT_AFTER_1',
|
|
227
|
-
// label: 'Thêm 1 dòng',
|
|
228
|
-
// row: 1
|
|
229
|
-
// },
|
|
230
|
-
// {
|
|
231
|
-
// parentKey: 'INSERT_AFTER',
|
|
232
|
-
// key: 'INSERT_AFTER_10',
|
|
233
|
-
// label: 'Thêm 10 dòng',
|
|
234
|
-
// row: 10
|
|
235
|
-
// },
|
|
236
|
-
// {
|
|
237
|
-
// parentKey: 'INSERT_AFTER',
|
|
238
|
-
// key: 'INSERT_AFTER_50',
|
|
239
|
-
// label: 'Thêm 50 dòng',
|
|
240
|
-
// row: 50
|
|
241
|
-
// },
|
|
242
|
-
// {
|
|
243
|
-
// parentKey: 'INSERT_AFTER',
|
|
244
|
-
// key: 'INSERT_AFTER_100',
|
|
245
|
-
// label: 'Thêm 100 dòng',
|
|
246
|
-
// row: 100
|
|
247
|
-
// },
|
|
248
|
-
// {
|
|
249
|
-
// parentKey: 'INSERT_AFTER',
|
|
250
|
-
// key: 'INSERT_AFTER_ADV',
|
|
251
|
-
// label: 'Tùy chỉnh'
|
|
252
|
-
// }
|
|
253
|
-
// ]
|
|
254
|
-
}, {
|
|
255
|
-
key: 'DELETE_CONTENT',
|
|
256
|
-
label: locale?.delete_content ?? 'Delete content',
|
|
257
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Trash2, {
|
|
258
|
-
fontSize: 14
|
|
259
|
-
})
|
|
260
|
-
}, {
|
|
261
|
-
key: 'DELETE_ROWS',
|
|
262
|
-
label: locale?.delete_rows ?? 'Delete rows',
|
|
263
|
-
icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Trash2, {
|
|
264
|
-
fontSize: 14
|
|
265
|
-
})
|
|
266
|
-
}];
|
|
267
|
-
}, [locale]);
|
|
268
150
|
const itemsAdd = _react.default.useMemo(() => {
|
|
269
151
|
return [{
|
|
270
152
|
key: '10',
|
|
@@ -277,13 +159,6 @@ const TableContainerEdit = props => {
|
|
|
277
159
|
label: `100 ${t ? t('rows') : 'rows'}`
|
|
278
160
|
}];
|
|
279
161
|
}, [t]);
|
|
280
|
-
const contextMenuItems = _react.default.useMemo(() => {
|
|
281
|
-
const a = showDefaultContext !== false ? [...defaultContext] : [];
|
|
282
|
-
const b = propsContext && propsContext.length > 0 ? [...propsContext, {
|
|
283
|
-
type: 'divider'
|
|
284
|
-
}] : [];
|
|
285
|
-
return [...b, ...a];
|
|
286
|
-
}, [defaultContext, propsContext, showDefaultContext]);
|
|
287
162
|
const [dataErrors, setDataErrors] = _react.default.useState([]);
|
|
288
163
|
_react.default.useEffect(() => {
|
|
289
164
|
if (validate && dataSource && dataSource.length) {
|
|
@@ -15,14 +15,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _useContext = require("../useContext");
|
|
17
17
|
var _EditableCell = _interopRequireDefault(require("./EditableCell"));
|
|
18
|
-
var
|
|
18
|
+
var _hooks = require("../../grid-component/hooks");
|
|
19
19
|
var _useColumns = require("../hook/useColumns");
|
|
20
|
-
// import { nonActionColumn } from "../hook/constant";
|
|
21
|
-
|
|
22
|
-
// import type { Dispatch, SetStateAction } from "react";
|
|
23
|
-
|
|
24
|
-
// import { nonActionColumn } from "../hook/constant";
|
|
25
|
-
|
|
26
20
|
const renderCellIndex = props => {
|
|
27
21
|
const {
|
|
28
22
|
parrents,
|
|
@@ -646,7 +640,7 @@ const TableBodyCellEdit = props => {
|
|
|
646
640
|
if (e.key === 'ArrowRight') {
|
|
647
641
|
e.preventDefault();
|
|
648
642
|
e.stopPropagation();
|
|
649
|
-
const allCols = table.getVisibleLeafColumns().filter(it => !
|
|
643
|
+
const allCols = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
650
644
|
const currentColIndex = allCols.findIndex(it => it.id === cell.column.id);
|
|
651
645
|
const nextCol = allCols[currentColIndex + 1];
|
|
652
646
|
if (nextCol) {
|
|
@@ -677,7 +671,7 @@ const TableBodyCellEdit = props => {
|
|
|
677
671
|
}
|
|
678
672
|
if (e.key === 'ArrowLeft') {
|
|
679
673
|
e.preventDefault();
|
|
680
|
-
const allCols = table.getVisibleLeafColumns().filter(it => !
|
|
674
|
+
const allCols = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
681
675
|
|
|
682
676
|
// const currentColIndex = table.getColumn(colId)?.getIndex() ?? 0;
|
|
683
677
|
const currentColIndex = allCols.findIndex(it => it.id === cell.column.id);
|
|
@@ -825,7 +819,7 @@ const TableBodyCellEdit = props => {
|
|
|
825
819
|
}
|
|
826
820
|
const handleMouseDownIndex = rowId => {
|
|
827
821
|
setIsSelecting?.(true);
|
|
828
|
-
const allColumns = table.getVisibleLeafColumns().filter(it => !
|
|
822
|
+
const allColumns = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
829
823
|
const firstCOl = (0, _utils.findFirst)(allColumns);
|
|
830
824
|
const startCol = allColumns[0].id;
|
|
831
825
|
const endCol = allColumns[allColumns.length - 1].id;
|
|
@@ -853,7 +847,7 @@ const TableBodyCellEdit = props => {
|
|
|
853
847
|
};
|
|
854
848
|
const handleMouseEnterIndex = rowId => {
|
|
855
849
|
if (isSelecting) {
|
|
856
|
-
const allColumns = table.getVisibleLeafColumns().filter(it => !
|
|
850
|
+
const allColumns = table.getVisibleLeafColumns().filter(it => !_hooks.nonActionColumn.includes(it.id));
|
|
857
851
|
|
|
858
852
|
// const firstCOl = findFirst(allColumns)
|
|
859
853
|
|
|
@@ -11,22 +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
|
|
14
|
+
var _hooks = require("../../grid-component/hooks");
|
|
15
15
|
var _utils = require("../hook/utils");
|
|
16
16
|
var _useContext = require("../useContext");
|
|
17
17
|
var _renderFilter = require("./renderFilter");
|
|
18
18
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
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 { useSortable } from "@dnd-kit/sortable"
|
|
22
|
-
|
|
23
|
-
// import { CSS } from '@dnd-kit/utilities'
|
|
24
|
-
// import type { Virtualizer } from '@tanstack/react-virtual'
|
|
25
|
-
|
|
26
|
-
// import { ColumnTable } from "../type";
|
|
27
|
-
|
|
28
|
-
// import { Tooltip } from 'react-tooltip'
|
|
29
|
-
|
|
30
21
|
const TableHeadCell = props => {
|
|
31
22
|
const {
|
|
32
23
|
header,
|
|
@@ -149,7 +140,7 @@ const TableHeadCell = props => {
|
|
|
149
140
|
dropdownRender: () => {
|
|
150
141
|
const type = (0, _utils.getTypeFilter)(originalColumn);
|
|
151
142
|
const operatorValue = header.column.getFilterOperator() ?? (0, _utils.getDefaultOperator)(originalColumn);
|
|
152
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
143
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
153
144
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
154
145
|
// className='ui-rc-table-filter-dropdown'
|
|
155
146
|
|
|
@@ -163,7 +154,7 @@ const TableHeadCell = props => {
|
|
|
163
154
|
}, /*#__PURE__*/_react.default.createElement("div", null), column.meta?.showOperator !== false && column.meta?.typeFilter !== 'DateRange' && column.meta?.typeFilter !== 'NumberRange' && /*#__PURE__*/_react.default.createElement("div", {
|
|
164
155
|
className: 'mb-1'
|
|
165
156
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
166
|
-
options: (0,
|
|
157
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
167
158
|
style: {
|
|
168
159
|
width: '100%',
|
|
169
160
|
marginBottom: 8
|
|
@@ -271,7 +262,7 @@ const TableHeadCell = props => {
|
|
|
271
262
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
272
263
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
273
264
|
})
|
|
274
|
-
}, cellContent)), !
|
|
265
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(header.column.id) && header.subHeaders.length < 2 && /*#__PURE__*/_react.default.createElement("span", {
|
|
275
266
|
className: "ui-rc-header-trigger"
|
|
276
267
|
}, header.column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
277
268
|
style: {
|
|
@@ -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 => {
|
|
@@ -133,7 +133,7 @@ const TableHeadCell2 = props => {
|
|
|
133
133
|
dropdownRender: () => {
|
|
134
134
|
const type = (0, _utils.getTypeFilter)(originalColumn);
|
|
135
135
|
const operatorValue = column.getFilterOperator() ?? (0, _utils.getDefaultOperator)(originalColumn);
|
|
136
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ?
|
|
136
|
+
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? _hooks.booleanOperator : !type || type === 'Text' ? _hooks.stringOperator : _hooks.numberOperator;
|
|
137
137
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
138
|
// className='ui-rc-table-filter-dropdown'
|
|
139
139
|
|
|
@@ -147,7 +147,7 @@ const TableHeadCell2 = props => {
|
|
|
147
147
|
}, /*#__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
148
|
className: 'mb-1'
|
|
149
149
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Select, {
|
|
150
|
-
options: (0,
|
|
150
|
+
options: (0, _hooks.translateOption)(operatorOptions, t),
|
|
151
151
|
style: {
|
|
152
152
|
width: '100%',
|
|
153
153
|
marginBottom: 8
|
|
@@ -266,7 +266,7 @@ const TableHeadCell2 = props => {
|
|
|
266
266
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
267
267
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')
|
|
268
268
|
})
|
|
269
|
-
}, cellContent)), !
|
|
269
|
+
}, cellContent)), !_hooks.nonActionColumn.includes(column.id) && column.columns.length < 1 && /*#__PURE__*/_react.default.createElement("span", {
|
|
270
270
|
className: "ui-rc-header-trigger"
|
|
271
271
|
}, column.getCanSort() && /*#__PURE__*/_react.default.createElement("div", {
|
|
272
272
|
style: {
|
|
@@ -2,9 +2,9 @@ import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
|
|
|
2
2
|
import type { ItemType } from 'rc-master-ui/es/menu/interface';
|
|
3
3
|
import type { Cell, Header, OnChangeFn, Row } from '@tanstack/react-table';
|
|
4
4
|
import type { ReactElement, ReactNode } from 'react';
|
|
5
|
-
import type { IOperator } from './hook/constant';
|
|
6
5
|
import type { ColorPickerProps } from 'antd';
|
|
7
6
|
import type { TableLocale } from "rc-master-ui/lib/table/interface";
|
|
7
|
+
import type { IOperator } from '../grid-component/hooks';
|
|
8
8
|
declare module "@tanstack/table-core" {
|
|
9
9
|
interface ColumnMeta<any, any> extends ColumnTable {
|
|
10
10
|
rowSpan?: number;
|
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[];
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
export const defaultWidth = 100;
|
|
2
|
-
export const defaultRowHeight = 35;
|
|
3
|
-
export const numberOperator = [{
|
|
4
|
-
value: 'equal',
|
|
5
|
-
label: 'Equal',
|
|
6
|
-
key: '=='
|
|
7
|
-
}, {
|
|
8
|
-
value: 'greaterthan',
|
|
9
|
-
label: 'Greater than',
|
|
10
|
-
key: '>'
|
|
11
|
-
}, {
|
|
12
|
-
value: 'greaterthanorequal',
|
|
13
|
-
label: 'Greater than or equal',
|
|
14
|
-
key: '>='
|
|
15
|
-
}, {
|
|
16
|
-
value: 'lessthan',
|
|
17
|
-
label: 'Less than',
|
|
18
|
-
key: '<'
|
|
19
|
-
}, {
|
|
20
|
-
value: 'lessthanorequal',
|
|
21
|
-
label: 'Less than or equal',
|
|
22
|
-
key: '<='
|
|
23
|
-
}, {
|
|
24
|
-
value: 'notequal',
|
|
25
|
-
label: 'Not equal',
|
|
26
|
-
key: '!='
|
|
27
|
-
}];
|
|
28
|
-
export const stringOperator = [{
|
|
29
|
-
value: 'startswith',
|
|
30
|
-
key: '_=',
|
|
31
|
-
label: 'Starts with'
|
|
32
|
-
}, {
|
|
33
|
-
value: 'endswith',
|
|
34
|
-
key: '|=',
|
|
35
|
-
label: 'Ends with'
|
|
36
|
-
}, {
|
|
37
|
-
value: 'contains',
|
|
38
|
-
key: '~=',
|
|
39
|
-
label: 'Contains'
|
|
40
|
-
}, {
|
|
41
|
-
value: 'equal',
|
|
42
|
-
key: '==',
|
|
43
|
-
label: 'Equal'
|
|
44
|
-
}, {
|
|
45
|
-
value: 'notequal',
|
|
46
|
-
key: '!=',
|
|
47
|
-
label: 'Not equal'
|
|
48
|
-
}];
|
|
49
|
-
export const dateOperator = [{
|
|
50
|
-
value: 'equal',
|
|
51
|
-
key: '==',
|
|
52
|
-
label: 'Equal'
|
|
53
|
-
}, {
|
|
54
|
-
value: 'notequal',
|
|
55
|
-
key: '!=',
|
|
56
|
-
label: 'Not equal'
|
|
57
|
-
}, {
|
|
58
|
-
value: 'greaterthan',
|
|
59
|
-
key: '>',
|
|
60
|
-
label: 'Greater than'
|
|
61
|
-
}, {
|
|
62
|
-
value: 'lessthan',
|
|
63
|
-
key: '<',
|
|
64
|
-
label: 'Less than'
|
|
65
|
-
}];
|
|
66
|
-
export const dateTimeOperator = [{
|
|
67
|
-
value: 'equal',
|
|
68
|
-
key: '==',
|
|
69
|
-
label: 'Equal'
|
|
70
|
-
}, {
|
|
71
|
-
value: 'notequal',
|
|
72
|
-
key: '!=',
|
|
73
|
-
label: 'Not equal'
|
|
74
|
-
}, {
|
|
75
|
-
value: 'greaterthan',
|
|
76
|
-
key: '>',
|
|
77
|
-
label: 'Greater than'
|
|
78
|
-
}, {
|
|
79
|
-
value: 'lessthan',
|
|
80
|
-
key: '<',
|
|
81
|
-
label: 'Less than'
|
|
82
|
-
}];
|
|
83
|
-
export const booleanOperator = [{
|
|
84
|
-
value: 'equal',
|
|
85
|
-
key: '==',
|
|
86
|
-
label: 'Equal'
|
|
87
|
-
}, {
|
|
88
|
-
value: 'notequal',
|
|
89
|
-
key: '!=',
|
|
90
|
-
label: 'Not equal'
|
|
91
|
-
}];
|
|
92
|
-
export const translateOption = (options, t) => {
|
|
93
|
-
if (!t) {
|
|
94
|
-
return options;
|
|
95
|
-
}
|
|
96
|
-
return options.map(it => ({
|
|
97
|
-
...it,
|
|
98
|
-
label: t(it.label)
|
|
99
|
-
}));
|
|
100
|
-
};
|
|
101
|
-
export const transferFontSize = {
|
|
102
|
-
6: 8,
|
|
103
|
-
7: 9,
|
|
104
|
-
8: 11,
|
|
105
|
-
9: 12,
|
|
106
|
-
10: 13,
|
|
107
|
-
11: 15,
|
|
108
|
-
12: 16,
|
|
109
|
-
13: 17,
|
|
110
|
-
14: 19,
|
|
111
|
-
15: 20,
|
|
112
|
-
16: 21,
|
|
113
|
-
17: 23,
|
|
114
|
-
18: 24,
|
|
115
|
-
19: 25,
|
|
116
|
-
20: 27,
|
|
117
|
-
21: 28,
|
|
118
|
-
22: 29,
|
|
119
|
-
24: 32,
|
|
120
|
-
26: 35,
|
|
121
|
-
27: 36,
|
|
122
|
-
28: 37
|
|
123
|
-
};
|
|
124
|
-
export const defaultDateFormat = 'd/m/Y';
|
|
125
|
-
export const defaultDateTimeFormat = 'd/m/Y H:i';
|
|
126
|
-
export const defaultTimeFormat = 'H:i';
|
|
127
|
-
export const defaultPageSizes = [20, 30, 50, 100];
|
|
128
|
-
export const alignToFlex = {
|
|
129
|
-
center: 'center',
|
|
130
|
-
left: 'start',
|
|
131
|
-
right: 'end'
|
|
132
|
-
};
|
|
133
|
-
export const optionsSize = [{
|
|
134
|
-
label: 'letter',
|
|
135
|
-
value: 'letter',
|
|
136
|
-
width: 21.59,
|
|
137
|
-
height: 27.94
|
|
138
|
-
}, {
|
|
139
|
-
label: 'A3',
|
|
140
|
-
value: 'a3',
|
|
141
|
-
width: 27.94,
|
|
142
|
-
height: 42
|
|
143
|
-
}, {
|
|
144
|
-
label: 'A4',
|
|
145
|
-
value: 'a4',
|
|
146
|
-
width: 21,
|
|
147
|
-
height: 29.7
|
|
148
|
-
}];
|
|
149
|
-
export const paperSize = {
|
|
150
|
-
a4: {
|
|
151
|
-
width: 21,
|
|
152
|
-
height: 29.7
|
|
153
|
-
},
|
|
154
|
-
a3: {
|
|
155
|
-
width: 27.94,
|
|
156
|
-
height: 42
|
|
157
|
-
},
|
|
158
|
-
letter: {
|
|
159
|
-
width: 21.59,
|
|
160
|
-
height: 27.94
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
export const optionFont = [{
|
|
164
|
-
value: 'Times New Roman',
|
|
165
|
-
label: 'Times New Roman'
|
|
166
|
-
}, {
|
|
167
|
-
value: 'Calibri',
|
|
168
|
-
label: 'Calibri (Body)'
|
|
169
|
-
}];
|
|
170
|
-
// portrait' | 'landscape'
|
|
171
|
-
export const optionsPaperOrientation = [{
|
|
172
|
-
value: 'portrait',
|
|
173
|
-
label: 'portrait'
|
|
174
|
-
}, {
|
|
175
|
-
value: 'landscape',
|
|
176
|
-
label: 'landscape'
|
|
177
|
-
}];
|
|
178
|
-
export const optionFontSize = [{
|
|
179
|
-
value: 8,
|
|
180
|
-
label: '8'
|
|
181
|
-
}, {
|
|
182
|
-
value: 9,
|
|
183
|
-
label: '9'
|
|
184
|
-
}, {
|
|
185
|
-
value: 10,
|
|
186
|
-
label: '10'
|
|
187
|
-
}, {
|
|
188
|
-
value: 11,
|
|
189
|
-
label: '11'
|
|
190
|
-
}, {
|
|
191
|
-
value: 12,
|
|
192
|
-
label: '12'
|
|
193
|
-
}, {
|
|
194
|
-
value: 13,
|
|
195
|
-
label: '13'
|
|
196
|
-
}, {
|
|
197
|
-
value: 14,
|
|
198
|
-
label: '14'
|
|
199
|
-
}, {
|
|
200
|
-
value: 16,
|
|
201
|
-
label: '16'
|
|
202
|
-
}, {
|
|
203
|
-
value: 18,
|
|
204
|
-
label: '18'
|
|
205
|
-
}, {
|
|
206
|
-
value: 24,
|
|
207
|
-
label: '24'
|
|
208
|
-
}, {
|
|
209
|
-
value: 36,
|
|
210
|
-
label: '36'
|
|
211
|
-
}, {
|
|
212
|
-
value: 48,
|
|
213
|
-
label: '48'
|
|
214
|
-
}];
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Sort order for BaseTable
|
|
218
|
-
*/
|
|
219
|
-
const SortOrder = {
|
|
220
|
-
/**
|
|
221
|
-
* Sort data in ascending order
|
|
222
|
-
*/
|
|
223
|
-
ascend: 'Ascending',
|
|
224
|
-
/**
|
|
225
|
-
* Sort data in descending order
|
|
226
|
-
*/
|
|
227
|
-
descend: 'Descending'
|
|
228
|
-
};
|
|
229
|
-
export default SortOrder;
|
|
230
|
-
export const valueToBoolean = {
|
|
231
|
-
true: true,
|
|
232
|
-
false: false,
|
|
233
|
-
1: true,
|
|
234
|
-
0: false
|
|
235
|
-
};
|
|
236
|
-
export const booleanToValue = {
|
|
237
|
-
true: 1,
|
|
238
|
-
false: 0
|
|
239
|
-
};
|
|
240
|
-
export const nonActionColumn = ['#', 'command', 'selection_column'];
|
|
@@ -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[];
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.nonActionColumn = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
|
|
7
|
-
const defaultWidth = exports.defaultWidth = 100;
|
|
8
|
-
const defaultRowHeight = exports.defaultRowHeight = 35;
|
|
9
|
-
const numberOperator = exports.numberOperator = [{
|
|
10
|
-
value: 'equal',
|
|
11
|
-
label: 'Equal',
|
|
12
|
-
key: '=='
|
|
13
|
-
}, {
|
|
14
|
-
value: 'greaterthan',
|
|
15
|
-
label: 'Greater than',
|
|
16
|
-
key: '>'
|
|
17
|
-
}, {
|
|
18
|
-
value: 'greaterthanorequal',
|
|
19
|
-
label: 'Greater than or equal',
|
|
20
|
-
key: '>='
|
|
21
|
-
}, {
|
|
22
|
-
value: 'lessthan',
|
|
23
|
-
label: 'Less than',
|
|
24
|
-
key: '<'
|
|
25
|
-
}, {
|
|
26
|
-
value: 'lessthanorequal',
|
|
27
|
-
label: 'Less than or equal',
|
|
28
|
-
key: '<='
|
|
29
|
-
}, {
|
|
30
|
-
value: 'notequal',
|
|
31
|
-
label: 'Not equal',
|
|
32
|
-
key: '!='
|
|
33
|
-
}];
|
|
34
|
-
const stringOperator = exports.stringOperator = [{
|
|
35
|
-
value: 'startswith',
|
|
36
|
-
key: '_=',
|
|
37
|
-
label: 'Starts with'
|
|
38
|
-
}, {
|
|
39
|
-
value: 'endswith',
|
|
40
|
-
key: '|=',
|
|
41
|
-
label: 'Ends with'
|
|
42
|
-
}, {
|
|
43
|
-
value: 'contains',
|
|
44
|
-
key: '~=',
|
|
45
|
-
label: 'Contains'
|
|
46
|
-
}, {
|
|
47
|
-
value: 'equal',
|
|
48
|
-
key: '==',
|
|
49
|
-
label: 'Equal'
|
|
50
|
-
}, {
|
|
51
|
-
value: 'notequal',
|
|
52
|
-
key: '!=',
|
|
53
|
-
label: 'Not equal'
|
|
54
|
-
}];
|
|
55
|
-
const dateOperator = exports.dateOperator = [{
|
|
56
|
-
value: 'equal',
|
|
57
|
-
key: '==',
|
|
58
|
-
label: 'Equal'
|
|
59
|
-
}, {
|
|
60
|
-
value: 'notequal',
|
|
61
|
-
key: '!=',
|
|
62
|
-
label: 'Not equal'
|
|
63
|
-
}, {
|
|
64
|
-
value: 'greaterthan',
|
|
65
|
-
key: '>',
|
|
66
|
-
label: 'Greater than'
|
|
67
|
-
}, {
|
|
68
|
-
value: 'lessthan',
|
|
69
|
-
key: '<',
|
|
70
|
-
label: 'Less than'
|
|
71
|
-
}];
|
|
72
|
-
const dateTimeOperator = exports.dateTimeOperator = [{
|
|
73
|
-
value: 'equal',
|
|
74
|
-
key: '==',
|
|
75
|
-
label: 'Equal'
|
|
76
|
-
}, {
|
|
77
|
-
value: 'notequal',
|
|
78
|
-
key: '!=',
|
|
79
|
-
label: 'Not equal'
|
|
80
|
-
}, {
|
|
81
|
-
value: 'greaterthan',
|
|
82
|
-
key: '>',
|
|
83
|
-
label: 'Greater than'
|
|
84
|
-
}, {
|
|
85
|
-
value: 'lessthan',
|
|
86
|
-
key: '<',
|
|
87
|
-
label: 'Less than'
|
|
88
|
-
}];
|
|
89
|
-
const booleanOperator = exports.booleanOperator = [{
|
|
90
|
-
value: 'equal',
|
|
91
|
-
key: '==',
|
|
92
|
-
label: 'Equal'
|
|
93
|
-
}, {
|
|
94
|
-
value: 'notequal',
|
|
95
|
-
key: '!=',
|
|
96
|
-
label: 'Not equal'
|
|
97
|
-
}];
|
|
98
|
-
const translateOption = (options, t) => {
|
|
99
|
-
if (!t) {
|
|
100
|
-
return options;
|
|
101
|
-
}
|
|
102
|
-
return options.map(it => ({
|
|
103
|
-
...it,
|
|
104
|
-
label: t(it.label)
|
|
105
|
-
}));
|
|
106
|
-
};
|
|
107
|
-
exports.translateOption = translateOption;
|
|
108
|
-
const transferFontSize = exports.transferFontSize = {
|
|
109
|
-
6: 8,
|
|
110
|
-
7: 9,
|
|
111
|
-
8: 11,
|
|
112
|
-
9: 12,
|
|
113
|
-
10: 13,
|
|
114
|
-
11: 15,
|
|
115
|
-
12: 16,
|
|
116
|
-
13: 17,
|
|
117
|
-
14: 19,
|
|
118
|
-
15: 20,
|
|
119
|
-
16: 21,
|
|
120
|
-
17: 23,
|
|
121
|
-
18: 24,
|
|
122
|
-
19: 25,
|
|
123
|
-
20: 27,
|
|
124
|
-
21: 28,
|
|
125
|
-
22: 29,
|
|
126
|
-
24: 32,
|
|
127
|
-
26: 35,
|
|
128
|
-
27: 36,
|
|
129
|
-
28: 37
|
|
130
|
-
};
|
|
131
|
-
const defaultDateFormat = exports.defaultDateFormat = 'd/m/Y';
|
|
132
|
-
const defaultDateTimeFormat = exports.defaultDateTimeFormat = 'd/m/Y H:i';
|
|
133
|
-
const defaultTimeFormat = exports.defaultTimeFormat = 'H:i';
|
|
134
|
-
const defaultPageSizes = exports.defaultPageSizes = [20, 30, 50, 100];
|
|
135
|
-
const alignToFlex = exports.alignToFlex = {
|
|
136
|
-
center: 'center',
|
|
137
|
-
left: 'start',
|
|
138
|
-
right: 'end'
|
|
139
|
-
};
|
|
140
|
-
const optionsSize = exports.optionsSize = [{
|
|
141
|
-
label: 'letter',
|
|
142
|
-
value: 'letter',
|
|
143
|
-
width: 21.59,
|
|
144
|
-
height: 27.94
|
|
145
|
-
}, {
|
|
146
|
-
label: 'A3',
|
|
147
|
-
value: 'a3',
|
|
148
|
-
width: 27.94,
|
|
149
|
-
height: 42
|
|
150
|
-
}, {
|
|
151
|
-
label: 'A4',
|
|
152
|
-
value: 'a4',
|
|
153
|
-
width: 21,
|
|
154
|
-
height: 29.7
|
|
155
|
-
}];
|
|
156
|
-
const paperSize = exports.paperSize = {
|
|
157
|
-
a4: {
|
|
158
|
-
width: 21,
|
|
159
|
-
height: 29.7
|
|
160
|
-
},
|
|
161
|
-
a3: {
|
|
162
|
-
width: 27.94,
|
|
163
|
-
height: 42
|
|
164
|
-
},
|
|
165
|
-
letter: {
|
|
166
|
-
width: 21.59,
|
|
167
|
-
height: 27.94
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
const optionFont = exports.optionFont = [{
|
|
171
|
-
value: 'Times New Roman',
|
|
172
|
-
label: 'Times New Roman'
|
|
173
|
-
}, {
|
|
174
|
-
value: 'Calibri',
|
|
175
|
-
label: 'Calibri (Body)'
|
|
176
|
-
}];
|
|
177
|
-
// portrait' | 'landscape'
|
|
178
|
-
const optionsPaperOrientation = exports.optionsPaperOrientation = [{
|
|
179
|
-
value: 'portrait',
|
|
180
|
-
label: 'portrait'
|
|
181
|
-
}, {
|
|
182
|
-
value: 'landscape',
|
|
183
|
-
label: 'landscape'
|
|
184
|
-
}];
|
|
185
|
-
const optionFontSize = exports.optionFontSize = [{
|
|
186
|
-
value: 8,
|
|
187
|
-
label: '8'
|
|
188
|
-
}, {
|
|
189
|
-
value: 9,
|
|
190
|
-
label: '9'
|
|
191
|
-
}, {
|
|
192
|
-
value: 10,
|
|
193
|
-
label: '10'
|
|
194
|
-
}, {
|
|
195
|
-
value: 11,
|
|
196
|
-
label: '11'
|
|
197
|
-
}, {
|
|
198
|
-
value: 12,
|
|
199
|
-
label: '12'
|
|
200
|
-
}, {
|
|
201
|
-
value: 13,
|
|
202
|
-
label: '13'
|
|
203
|
-
}, {
|
|
204
|
-
value: 14,
|
|
205
|
-
label: '14'
|
|
206
|
-
}, {
|
|
207
|
-
value: 16,
|
|
208
|
-
label: '16'
|
|
209
|
-
}, {
|
|
210
|
-
value: 18,
|
|
211
|
-
label: '18'
|
|
212
|
-
}, {
|
|
213
|
-
value: 24,
|
|
214
|
-
label: '24'
|
|
215
|
-
}, {
|
|
216
|
-
value: 36,
|
|
217
|
-
label: '36'
|
|
218
|
-
}, {
|
|
219
|
-
value: 48,
|
|
220
|
-
label: '48'
|
|
221
|
-
}];
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Sort order for BaseTable
|
|
225
|
-
*/
|
|
226
|
-
const SortOrder = {
|
|
227
|
-
/**
|
|
228
|
-
* Sort data in ascending order
|
|
229
|
-
*/
|
|
230
|
-
ascend: 'Ascending',
|
|
231
|
-
/**
|
|
232
|
-
* Sort data in descending order
|
|
233
|
-
*/
|
|
234
|
-
descend: 'Descending'
|
|
235
|
-
};
|
|
236
|
-
var _default = exports.default = SortOrder;
|
|
237
|
-
const valueToBoolean = exports.valueToBoolean = {
|
|
238
|
-
true: true,
|
|
239
|
-
false: false,
|
|
240
|
-
1: true,
|
|
241
|
-
0: false
|
|
242
|
-
};
|
|
243
|
-
const booleanToValue = exports.booleanToValue = {
|
|
244
|
-
true: 1,
|
|
245
|
-
false: 0
|
|
246
|
-
};
|
|
247
|
-
const nonActionColumn = exports.nonActionColumn = ['#', 'command', 'selection_column'];
|