es-grid-template 1.9.13 → 1.9.14
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/ali-table/Grid.js +3 -1
- package/es/ali-table/InternalTable.js +2 -0
- package/es/ali-table/base-table/table.d.ts +2 -2
- package/es/ali-table/base-table/table.js +5 -5
- package/es/ali-table/pipeline/features/columnCustom.d.ts +1 -0
- package/es/ali-table/pipeline/features/columnCustom.js +4 -3
- package/es/grid-component/type.d.ts +1 -0
- package/es/group-component/hook/utils.d.ts +3 -3
- package/es/group-component/table/TableWrapper.d.ts +1 -0
- package/es/group-component/table/TableWrapper.js +2 -1
- package/es/table-component/body/EditableCell.js +33 -9
- package/es/table-component/table/TableWrapper.d.ts +1 -0
- package/es/table-component/table/TableWrapper.js +2 -1
- package/lib/ali-table/Grid.js +3 -1
- package/lib/ali-table/InternalTable.js +2 -0
- package/lib/ali-table/base-table/table.d.ts +2 -2
- package/lib/ali-table/base-table/table.js +5 -5
- package/lib/ali-table/pipeline/features/columnCustom.d.ts +1 -0
- package/lib/ali-table/pipeline/features/columnCustom.js +4 -3
- package/lib/grid-component/type.d.ts +1 -0
- package/lib/group-component/table/TableWrapper.d.ts +1 -0
- package/lib/group-component/table/TableWrapper.js +2 -1
- package/lib/table-component/body/EditableCell.js +32 -8
- package/lib/table-component/table/TableWrapper.d.ts +1 -0
- package/lib/table-component/table/TableWrapper.js +2 -1
- package/package.json +1 -1
package/es/ali-table/Grid.js
CHANGED
|
@@ -53,7 +53,8 @@ const Grid = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
53
53
|
footerDataSource,
|
|
54
54
|
loading,
|
|
55
55
|
useVirtual,
|
|
56
|
-
useOuterBorder = true
|
|
56
|
+
useOuterBorder = true,
|
|
57
|
+
showHeader = true
|
|
57
58
|
|
|
58
59
|
// onRowFooterStyles,
|
|
59
60
|
// onRowHeaderStyles
|
|
@@ -218,6 +219,7 @@ const Grid = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
218
219
|
}, typeof title === 'function' ? title?.(dataSource) : title)), /*#__PURE__*/React.createElement(WebsiteBaseTable, _extends({
|
|
219
220
|
ref: ref,
|
|
220
221
|
id: id,
|
|
222
|
+
showHeader: showHeader,
|
|
221
223
|
commandClick: commandClick,
|
|
222
224
|
isLoading: loading,
|
|
223
225
|
useVirtual: useVirtual,
|
|
@@ -23,6 +23,7 @@ const InternalTable = props => {
|
|
|
23
23
|
dataSource,
|
|
24
24
|
allowFiltering,
|
|
25
25
|
allowSortering,
|
|
26
|
+
allowResizing,
|
|
26
27
|
groupAble,
|
|
27
28
|
groupColumns,
|
|
28
29
|
groupSetting,
|
|
@@ -193,6 +194,7 @@ const InternalTable = props => {
|
|
|
193
194
|
disableUserSelectWhenResizing: true,
|
|
194
195
|
allowFiltering,
|
|
195
196
|
allowSortering,
|
|
197
|
+
allowResizing,
|
|
196
198
|
tableLocal,
|
|
197
199
|
locale,
|
|
198
200
|
prefix,
|
|
@@ -60,7 +60,7 @@ export type BaseTableProps = {
|
|
|
60
60
|
/** Custom inline styles */
|
|
61
61
|
style?: CSSProperties & BaseTableCSSVariables;
|
|
62
62
|
/** Whether the table has a header */
|
|
63
|
-
|
|
63
|
+
showHeader?: boolean;
|
|
64
64
|
/** Whether table has a horizontal sticky scrollbar */
|
|
65
65
|
hasStickyScroll?: boolean;
|
|
66
66
|
/** Height of the sticky horizontal scrollbar */
|
|
@@ -128,7 +128,7 @@ interface BaseTableState {
|
|
|
128
128
|
}
|
|
129
129
|
export declare class BaseTable extends React.Component<BaseTableProps, BaseTableState> {
|
|
130
130
|
static defaultProps: {
|
|
131
|
-
|
|
131
|
+
showHeader: boolean;
|
|
132
132
|
isStickyHeader: boolean;
|
|
133
133
|
stickyTop: number;
|
|
134
134
|
footerDataSource: any[];
|
|
@@ -21,7 +21,7 @@ function warnEmptyContentIsDeprecated() {
|
|
|
21
21
|
}
|
|
22
22
|
export class BaseTable extends React.Component {
|
|
23
23
|
static defaultProps = {
|
|
24
|
-
|
|
24
|
+
showHeader: true,
|
|
25
25
|
isStickyHeader: true,
|
|
26
26
|
stickyTop: 0,
|
|
27
27
|
footerDataSource: [],
|
|
@@ -106,13 +106,13 @@ export class BaseTable extends React.Component {
|
|
|
106
106
|
renderTableHeader(info) {
|
|
107
107
|
const {
|
|
108
108
|
stickyTop,
|
|
109
|
-
|
|
109
|
+
showHeader
|
|
110
110
|
} = this.props;
|
|
111
111
|
return /*#__PURE__*/React.createElement("div", {
|
|
112
112
|
className: cx(Classes.tableHeader, 'no-scrollbar'),
|
|
113
113
|
style: {
|
|
114
114
|
top: stickyTop === 0 ? undefined : stickyTop,
|
|
115
|
-
display:
|
|
115
|
+
display: showHeader ? undefined : 'none'
|
|
116
116
|
}
|
|
117
117
|
}, /*#__PURE__*/React.createElement(TableHeader, {
|
|
118
118
|
info: info
|
|
@@ -334,7 +334,7 @@ export class BaseTable extends React.Component {
|
|
|
334
334
|
dataSource,
|
|
335
335
|
className,
|
|
336
336
|
style,
|
|
337
|
-
|
|
337
|
+
showHeader,
|
|
338
338
|
useOuterBorder,
|
|
339
339
|
// isStickyHead,
|
|
340
340
|
isStickyHeader,
|
|
@@ -347,7 +347,7 @@ export class BaseTable extends React.Component {
|
|
|
347
347
|
'use-outer-border': useOuterBorder,
|
|
348
348
|
empty: dataSource.length === 0,
|
|
349
349
|
lock: info.hasLockColumn,
|
|
350
|
-
'has-header':
|
|
350
|
+
'has-header': showHeader,
|
|
351
351
|
'sticky-header': isStickyHeader,
|
|
352
352
|
'has-footer': footerDataSource && footerDataSource.length > 0,
|
|
353
353
|
'sticky-footer': isStickyFooter
|
|
@@ -28,6 +28,7 @@ export function columnCustom(opts) {
|
|
|
28
28
|
const maxSize = opts.maxSize ?? 1000;
|
|
29
29
|
const allowFiltering = opts.allowFiltering !== false;
|
|
30
30
|
const allowSortering = opts.allowSortering !== false;
|
|
31
|
+
const allowResizing = opts.allowResizing !== false;
|
|
31
32
|
const {
|
|
32
33
|
prefix,
|
|
33
34
|
id,
|
|
@@ -396,7 +397,7 @@ export function columnCustom(opts) {
|
|
|
396
397
|
...col,
|
|
397
398
|
lock: !!col.fixed,
|
|
398
399
|
width: sizes[startIndex],
|
|
399
|
-
title: /*#__PURE__*/React.createElement(React.Fragment, null, col.headerTemplate ? /*#__PURE__*/React.createElement(React.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle), /*#__PURE__*/React.createElement(Resizer, {
|
|
400
|
+
title: /*#__PURE__*/React.createElement(React.Fragment, null, col.headerTemplate ? /*#__PURE__*/React.createElement(React.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle), allowResizing && /*#__PURE__*/React.createElement(Resizer, {
|
|
400
401
|
width: col.width,
|
|
401
402
|
columnKey: col.field,
|
|
402
403
|
columnIndex: startIndex
|
|
@@ -436,7 +437,7 @@ export function columnCustom(opts) {
|
|
|
436
437
|
...col,
|
|
437
438
|
lock: !!col.fixed,
|
|
438
439
|
width: sizes[startIndex],
|
|
439
|
-
title: /*#__PURE__*/React.createElement(React.Fragment, null, col.headerTemplate ? /*#__PURE__*/React.createElement(React.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle), /*#__PURE__*/React.createElement(Resizer, {
|
|
440
|
+
title: /*#__PURE__*/React.createElement(React.Fragment, null, col.headerTemplate ? /*#__PURE__*/React.createElement(React.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle), allowResizing && /*#__PURE__*/React.createElement(Resizer, {
|
|
440
441
|
width: col.width,
|
|
441
442
|
columnKey: col.field,
|
|
442
443
|
columnIndex: startIndex
|
|
@@ -517,7 +518,7 @@ export function columnCustom(opts) {
|
|
|
517
518
|
className: classNames(`ui-rc-table-column-sorter-cancel toolbar-icon`, {
|
|
518
519
|
active: true
|
|
519
520
|
})
|
|
520
|
-
})), canFilter && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Dropdown, mergedDropdownProps)))), /*#__PURE__*/React.createElement(Resizer, {
|
|
521
|
+
})), canFilter && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Dropdown, mergedDropdownProps)))), allowResizing && /*#__PURE__*/React.createElement(Resizer, {
|
|
521
522
|
width: col.width,
|
|
522
523
|
columnKey: col.field,
|
|
523
524
|
columnIndex: startIndex
|
|
@@ -233,6 +233,7 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
233
233
|
color?: string;
|
|
234
234
|
};
|
|
235
235
|
useOuterBorder?: boolean;
|
|
236
|
+
showHeader?: boolean;
|
|
236
237
|
className?: string;
|
|
237
238
|
title?: ReactNode | ((data: RecordType) => ReactNode);
|
|
238
239
|
fullScreenTitle?: ReactNode | (() => ReactNode);
|
|
@@ -208,9 +208,9 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
|
|
|
208
208
|
ellipsis?: boolean;
|
|
209
209
|
allowResizing?: boolean;
|
|
210
210
|
allowSelection?: boolean | ((rowData: RecordType) => boolean);
|
|
211
|
-
onCellStyles?: Omit<CSSProperties, "
|
|
212
|
-
onCellHeaderStyles?: Omit<CSSProperties, "
|
|
213
|
-
onCellFooterStyles?: Omit<CSSProperties, "
|
|
211
|
+
onCellStyles?: Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth">);
|
|
212
|
+
onCellHeaderStyles?: Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth">);
|
|
213
|
+
onCellFooterStyles?: Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth">);
|
|
214
214
|
sumGroup?: boolean;
|
|
215
215
|
getValue?: (row: any, rowIndex: number) => any;
|
|
216
216
|
getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
|
|
@@ -11,6 +11,7 @@ const TableWrapper = props => {
|
|
|
11
11
|
const {
|
|
12
12
|
id,
|
|
13
13
|
prefix,
|
|
14
|
+
showHeader = true,
|
|
14
15
|
tableContainerRef,
|
|
15
16
|
height,
|
|
16
17
|
minHeight,
|
|
@@ -209,7 +210,7 @@ const TableWrapper = props => {
|
|
|
209
210
|
display: 'grid',
|
|
210
211
|
minWidth: table.getTotalSize()
|
|
211
212
|
}
|
|
212
|
-
}, /*#__PURE__*/React.createElement(TableHead, {
|
|
213
|
+
}, showHeader && /*#__PURE__*/React.createElement(TableHead, {
|
|
213
214
|
tableContainerRef: tableContainerRef,
|
|
214
215
|
table: table,
|
|
215
216
|
columnVirtualizer: columnVirtualizer,
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { useContext } from "react";
|
|
3
3
|
import { DatePicker, TimePicker } from "rc-master-ui";
|
|
4
4
|
import { Divider, Row, Col, Input, ColorPicker, Button } from "antd";
|
|
5
|
-
import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs, convertLabelToTitle, getDatepickerFormat, isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat } from "../hook/utils";
|
|
5
|
+
import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs, convertLabelToTitle, getDatepickerFormat, isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat, removeVietnameseTones } from "../hook/utils";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { NumericFormat } from "react-numeric-component";
|
|
8
8
|
import dayjs from "dayjs";
|
|
@@ -79,6 +79,7 @@ const EditableCell = props => {
|
|
|
79
79
|
fieldNames,
|
|
80
80
|
toolbarItems,
|
|
81
81
|
filterOption,
|
|
82
|
+
filterKey,
|
|
82
83
|
inputKey,
|
|
83
84
|
toolbarClick,
|
|
84
85
|
loadOptions,
|
|
@@ -416,7 +417,14 @@ const EditableCell = props => {
|
|
|
416
417
|
return /*#__PURE__*/React.createElement(React.Fragment, null, " ", menu);
|
|
417
418
|
}
|
|
418
419
|
},
|
|
419
|
-
filterOption:
|
|
420
|
+
filterOption: filterKey ? (input, option) => {
|
|
421
|
+
const searchValue = removeVietnameseTones(input.toLowerCase() ?? '');
|
|
422
|
+
const filterValues = filterKey.some(k => {
|
|
423
|
+
const val = option?.[k];
|
|
424
|
+
return removeVietnameseTones((val ?? '').toString().toLowerCase()).includes(searchValue);
|
|
425
|
+
});
|
|
426
|
+
return filterValues;
|
|
427
|
+
} : filterOption,
|
|
420
428
|
fieldNames: fieldNames ? fieldNames : {
|
|
421
429
|
value: keySelect,
|
|
422
430
|
label: inputKey ?? 'label'
|
|
@@ -517,13 +525,21 @@ const EditableCell = props => {
|
|
|
517
525
|
placeholder: t && column.placeholder ? t(column.placeholder) : tableLocal?.selectPlaceholder,
|
|
518
526
|
allowClear: column.isClearable ?? false,
|
|
519
527
|
maxTagCount: 'responsive',
|
|
520
|
-
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
521
|
-
optionFilterProp
|
|
528
|
+
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
529
|
+
// optionFilterProp="label"
|
|
530
|
+
,
|
|
522
531
|
popupClassName: 'be-popup-container',
|
|
523
532
|
status: isInvalid ? 'error' : undefined,
|
|
524
|
-
filterOption:
|
|
533
|
+
filterOption: filterKey ? (input, option) => {
|
|
534
|
+
const searchValue = removeVietnameseTones(input.toLowerCase() ?? '');
|
|
535
|
+
const filterValues = filterKey.some(k => {
|
|
536
|
+
const val = option?.[k];
|
|
537
|
+
return removeVietnameseTones((val ?? '').toString().toLowerCase()).includes(searchValue);
|
|
538
|
+
});
|
|
539
|
+
return filterValues;
|
|
540
|
+
} : filterOption,
|
|
525
541
|
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
526
|
-
fieldNames:
|
|
542
|
+
fieldNames: {
|
|
527
543
|
value: keySelect,
|
|
528
544
|
label: inputKey ?? 'label'
|
|
529
545
|
},
|
|
@@ -648,8 +664,9 @@ const EditableCell = props => {
|
|
|
648
664
|
placeholder: t && column.placeholder ? t(column.placeholder) : tableLocal?.selectPlaceholder,
|
|
649
665
|
allowClear: column.isClearable ?? false,
|
|
650
666
|
maxTagCount: 'responsive',
|
|
651
|
-
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
652
|
-
optionFilterProp
|
|
667
|
+
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
668
|
+
// optionFilterProp="label"
|
|
669
|
+
,
|
|
653
670
|
popupClassName: 'be-popup-container',
|
|
654
671
|
loadOptions: loadOptions,
|
|
655
672
|
status: isInvalid ? 'error' : undefined,
|
|
@@ -678,7 +695,14 @@ const EditableCell = props => {
|
|
|
678
695
|
}
|
|
679
696
|
},
|
|
680
697
|
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
681
|
-
filterOption:
|
|
698
|
+
filterOption: filterKey ? (input, option) => {
|
|
699
|
+
const searchValue = removeVietnameseTones(input.toLowerCase() ?? '');
|
|
700
|
+
const filterValues = filterKey.some(k => {
|
|
701
|
+
const val = option?.[k];
|
|
702
|
+
return removeVietnameseTones((val ?? '').toString().toLowerCase()).includes(searchValue);
|
|
703
|
+
});
|
|
704
|
+
return filterValues;
|
|
705
|
+
} : filterOption,
|
|
682
706
|
fieldNames: fieldNames ? fieldNames : {
|
|
683
707
|
value: keySelect,
|
|
684
708
|
label: inputKey ?? 'label'
|
|
@@ -13,6 +13,7 @@ const TableWrapper = props => {
|
|
|
13
13
|
id,
|
|
14
14
|
prefix,
|
|
15
15
|
tableContainerRef,
|
|
16
|
+
showHeader = true,
|
|
16
17
|
height,
|
|
17
18
|
minHeight,
|
|
18
19
|
summary,
|
|
@@ -198,7 +199,7 @@ const TableWrapper = props => {
|
|
|
198
199
|
display: 'grid',
|
|
199
200
|
minWidth: table.getTotalSize()
|
|
200
201
|
}
|
|
201
|
-
}, /*#__PURE__*/React.createElement(TableHead, {
|
|
202
|
+
}, showHeader && /*#__PURE__*/React.createElement(TableHead, {
|
|
202
203
|
tableContainerRef: tableContainerRef,
|
|
203
204
|
table: table,
|
|
204
205
|
columnVirtualizer: columnVirtualizer,
|
package/lib/ali-table/Grid.js
CHANGED
|
@@ -63,7 +63,8 @@ const Grid = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
63
63
|
footerDataSource,
|
|
64
64
|
loading,
|
|
65
65
|
useVirtual,
|
|
66
|
-
useOuterBorder = true
|
|
66
|
+
useOuterBorder = true,
|
|
67
|
+
showHeader = true
|
|
67
68
|
|
|
68
69
|
// onRowFooterStyles,
|
|
69
70
|
// onRowHeaderStyles
|
|
@@ -228,6 +229,7 @@ const Grid = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
228
229
|
}, typeof title === 'function' ? title?.(dataSource) : title)), /*#__PURE__*/_react.default.createElement(_WebsiteBaseTable.WebsiteBaseTable, (0, _extends2.default)({
|
|
229
230
|
ref: ref,
|
|
230
231
|
id: id,
|
|
232
|
+
showHeader: showHeader,
|
|
231
233
|
commandClick: commandClick,
|
|
232
234
|
isLoading: loading,
|
|
233
235
|
useVirtual: useVirtual,
|
|
@@ -30,6 +30,7 @@ const InternalTable = props => {
|
|
|
30
30
|
dataSource,
|
|
31
31
|
allowFiltering,
|
|
32
32
|
allowSortering,
|
|
33
|
+
allowResizing,
|
|
33
34
|
groupAble,
|
|
34
35
|
groupColumns,
|
|
35
36
|
groupSetting,
|
|
@@ -200,6 +201,7 @@ const InternalTable = props => {
|
|
|
200
201
|
disableUserSelectWhenResizing: true,
|
|
201
202
|
allowFiltering,
|
|
202
203
|
allowSortering,
|
|
204
|
+
allowResizing,
|
|
203
205
|
tableLocal,
|
|
204
206
|
locale,
|
|
205
207
|
prefix,
|
|
@@ -60,7 +60,7 @@ export type BaseTableProps = {
|
|
|
60
60
|
/** Custom inline styles */
|
|
61
61
|
style?: CSSProperties & BaseTableCSSVariables;
|
|
62
62
|
/** Whether the table has a header */
|
|
63
|
-
|
|
63
|
+
showHeader?: boolean;
|
|
64
64
|
/** Whether table has a horizontal sticky scrollbar */
|
|
65
65
|
hasStickyScroll?: boolean;
|
|
66
66
|
/** Height of the sticky horizontal scrollbar */
|
|
@@ -128,7 +128,7 @@ interface BaseTableState {
|
|
|
128
128
|
}
|
|
129
129
|
export declare class BaseTable extends React.Component<BaseTableProps, BaseTableState> {
|
|
130
130
|
static defaultProps: {
|
|
131
|
-
|
|
131
|
+
showHeader: boolean;
|
|
132
132
|
isStickyHeader: boolean;
|
|
133
133
|
stickyTop: number;
|
|
134
134
|
footerDataSource: any[];
|
|
@@ -30,7 +30,7 @@ function warnEmptyContentIsDeprecated() {
|
|
|
30
30
|
}
|
|
31
31
|
class BaseTable extends _react.default.Component {
|
|
32
32
|
static defaultProps = {
|
|
33
|
-
|
|
33
|
+
showHeader: true,
|
|
34
34
|
isStickyHeader: true,
|
|
35
35
|
stickyTop: 0,
|
|
36
36
|
footerDataSource: [],
|
|
@@ -115,13 +115,13 @@ class BaseTable extends _react.default.Component {
|
|
|
115
115
|
renderTableHeader(info) {
|
|
116
116
|
const {
|
|
117
117
|
stickyTop,
|
|
118
|
-
|
|
118
|
+
showHeader
|
|
119
119
|
} = this.props;
|
|
120
120
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
121
121
|
className: (0, _classnames.default)(_styles.Classes.tableHeader, 'no-scrollbar'),
|
|
122
122
|
style: {
|
|
123
123
|
top: stickyTop === 0 ? undefined : stickyTop,
|
|
124
|
-
display:
|
|
124
|
+
display: showHeader ? undefined : 'none'
|
|
125
125
|
}
|
|
126
126
|
}, /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
127
127
|
info: info
|
|
@@ -343,7 +343,7 @@ class BaseTable extends _react.default.Component {
|
|
|
343
343
|
dataSource,
|
|
344
344
|
className,
|
|
345
345
|
style,
|
|
346
|
-
|
|
346
|
+
showHeader,
|
|
347
347
|
useOuterBorder,
|
|
348
348
|
// isStickyHead,
|
|
349
349
|
isStickyHeader,
|
|
@@ -356,7 +356,7 @@ class BaseTable extends _react.default.Component {
|
|
|
356
356
|
'use-outer-border': useOuterBorder,
|
|
357
357
|
empty: dataSource.length === 0,
|
|
358
358
|
lock: info.hasLockColumn,
|
|
359
|
-
'has-header':
|
|
359
|
+
'has-header': showHeader,
|
|
360
360
|
'sticky-header': isStickyHeader,
|
|
361
361
|
'has-footer': footerDataSource && footerDataSource.length > 0,
|
|
362
362
|
'sticky-footer': isStickyFooter
|
|
@@ -35,6 +35,7 @@ function columnCustom(opts) {
|
|
|
35
35
|
const maxSize = opts.maxSize ?? 1000;
|
|
36
36
|
const allowFiltering = opts.allowFiltering !== false;
|
|
37
37
|
const allowSortering = opts.allowSortering !== false;
|
|
38
|
+
const allowResizing = opts.allowResizing !== false;
|
|
38
39
|
const {
|
|
39
40
|
prefix,
|
|
40
41
|
id,
|
|
@@ -403,7 +404,7 @@ function columnCustom(opts) {
|
|
|
403
404
|
...col,
|
|
404
405
|
lock: !!col.fixed,
|
|
405
406
|
width: sizes[startIndex],
|
|
406
|
-
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, col.headerTemplate ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, prevTitle), /*#__PURE__*/_react.default.createElement(_ColumnResizer.default, {
|
|
407
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, col.headerTemplate ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, prevTitle), allowResizing && /*#__PURE__*/_react.default.createElement(_ColumnResizer.default, {
|
|
407
408
|
width: col.width,
|
|
408
409
|
columnKey: col.field,
|
|
409
410
|
columnIndex: startIndex
|
|
@@ -443,7 +444,7 @@ function columnCustom(opts) {
|
|
|
443
444
|
...col,
|
|
444
445
|
lock: !!col.fixed,
|
|
445
446
|
width: sizes[startIndex],
|
|
446
|
-
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, col.headerTemplate ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, prevTitle), /*#__PURE__*/_react.default.createElement(_ColumnResizer.default, {
|
|
447
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, col.headerTemplate ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof col.headerTemplate === 'function' ? col.headerTemplate(col) : col.headerTemplate) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, prevTitle), allowResizing && /*#__PURE__*/_react.default.createElement(_ColumnResizer.default, {
|
|
447
448
|
width: col.width,
|
|
448
449
|
columnKey: col.field,
|
|
449
450
|
columnIndex: startIndex
|
|
@@ -524,7 +525,7 @@ function columnCustom(opts) {
|
|
|
524
525
|
className: (0, _classnames.default)(`ui-rc-table-column-sorter-cancel toolbar-icon`, {
|
|
525
526
|
active: true
|
|
526
527
|
})
|
|
527
|
-
})), canFilter && /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Dropdown, mergedDropdownProps)))), /*#__PURE__*/_react.default.createElement(_ColumnResizer.default, {
|
|
528
|
+
})), canFilter && /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Dropdown, mergedDropdownProps)))), allowResizing && /*#__PURE__*/_react.default.createElement(_ColumnResizer.default, {
|
|
528
529
|
width: col.width,
|
|
529
530
|
columnKey: col.field,
|
|
530
531
|
columnIndex: startIndex
|
|
@@ -233,6 +233,7 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
233
233
|
color?: string;
|
|
234
234
|
};
|
|
235
235
|
useOuterBorder?: boolean;
|
|
236
|
+
showHeader?: boolean;
|
|
236
237
|
className?: string;
|
|
237
238
|
title?: ReactNode | ((data: RecordType) => ReactNode);
|
|
238
239
|
fullScreenTitle?: ReactNode | (() => ReactNode);
|
|
@@ -20,6 +20,7 @@ const TableWrapper = props => {
|
|
|
20
20
|
const {
|
|
21
21
|
id,
|
|
22
22
|
prefix,
|
|
23
|
+
showHeader = true,
|
|
23
24
|
tableContainerRef,
|
|
24
25
|
height,
|
|
25
26
|
minHeight,
|
|
@@ -218,7 +219,7 @@ const TableWrapper = props => {
|
|
|
218
219
|
display: 'grid',
|
|
219
220
|
minWidth: table.getTotalSize()
|
|
220
221
|
}
|
|
221
|
-
}, /*#__PURE__*/_react.default.createElement(_TableHead.default, {
|
|
222
|
+
}, showHeader && /*#__PURE__*/_react.default.createElement(_TableHead.default, {
|
|
222
223
|
tableContainerRef: tableContainerRef,
|
|
223
224
|
table: table,
|
|
224
225
|
columnVirtualizer: columnVirtualizer,
|
|
@@ -87,6 +87,7 @@ const EditableCell = props => {
|
|
|
87
87
|
fieldNames,
|
|
88
88
|
toolbarItems,
|
|
89
89
|
filterOption,
|
|
90
|
+
filterKey,
|
|
90
91
|
inputKey,
|
|
91
92
|
toolbarClick,
|
|
92
93
|
loadOptions,
|
|
@@ -424,7 +425,14 @@ const EditableCell = props => {
|
|
|
424
425
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, " ", menu);
|
|
425
426
|
}
|
|
426
427
|
},
|
|
427
|
-
filterOption:
|
|
428
|
+
filterOption: filterKey ? (input, option) => {
|
|
429
|
+
const searchValue = (0, _utils.removeVietnameseTones)(input.toLowerCase() ?? '');
|
|
430
|
+
const filterValues = filterKey.some(k => {
|
|
431
|
+
const val = option?.[k];
|
|
432
|
+
return (0, _utils.removeVietnameseTones)((val ?? '').toString().toLowerCase()).includes(searchValue);
|
|
433
|
+
});
|
|
434
|
+
return filterValues;
|
|
435
|
+
} : filterOption,
|
|
428
436
|
fieldNames: fieldNames ? fieldNames : {
|
|
429
437
|
value: keySelect,
|
|
430
438
|
label: inputKey ?? 'label'
|
|
@@ -525,13 +533,21 @@ const EditableCell = props => {
|
|
|
525
533
|
placeholder: t && column.placeholder ? t(column.placeholder) : tableLocal?.selectPlaceholder,
|
|
526
534
|
allowClear: column.isClearable ?? false,
|
|
527
535
|
maxTagCount: 'responsive',
|
|
528
|
-
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
529
|
-
optionFilterProp
|
|
536
|
+
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
537
|
+
// optionFilterProp="label"
|
|
538
|
+
,
|
|
530
539
|
popupClassName: 'be-popup-container',
|
|
531
540
|
status: isInvalid ? 'error' : undefined,
|
|
532
|
-
filterOption:
|
|
541
|
+
filterOption: filterKey ? (input, option) => {
|
|
542
|
+
const searchValue = (0, _utils.removeVietnameseTones)(input.toLowerCase() ?? '');
|
|
543
|
+
const filterValues = filterKey.some(k => {
|
|
544
|
+
const val = option?.[k];
|
|
545
|
+
return (0, _utils.removeVietnameseTones)((val ?? '').toString().toLowerCase()).includes(searchValue);
|
|
546
|
+
});
|
|
547
|
+
return filterValues;
|
|
548
|
+
} : filterOption,
|
|
533
549
|
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
534
|
-
fieldNames:
|
|
550
|
+
fieldNames: {
|
|
535
551
|
value: keySelect,
|
|
536
552
|
label: inputKey ?? 'label'
|
|
537
553
|
},
|
|
@@ -656,8 +672,9 @@ const EditableCell = props => {
|
|
|
656
672
|
placeholder: t && column.placeholder ? t(column.placeholder) : tableLocal?.selectPlaceholder,
|
|
657
673
|
allowClear: column.isClearable ?? false,
|
|
658
674
|
maxTagCount: 'responsive',
|
|
659
|
-
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
660
|
-
optionFilterProp
|
|
675
|
+
popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined
|
|
676
|
+
// optionFilterProp="label"
|
|
677
|
+
,
|
|
661
678
|
popupClassName: 'be-popup-container',
|
|
662
679
|
loadOptions: loadOptions,
|
|
663
680
|
status: isInvalid ? 'error' : undefined,
|
|
@@ -686,7 +703,14 @@ const EditableCell = props => {
|
|
|
686
703
|
}
|
|
687
704
|
},
|
|
688
705
|
optionRender: column.editSelectSettings?.formatOptionLabel,
|
|
689
|
-
filterOption:
|
|
706
|
+
filterOption: filterKey ? (input, option) => {
|
|
707
|
+
const searchValue = (0, _utils.removeVietnameseTones)(input.toLowerCase() ?? '');
|
|
708
|
+
const filterValues = filterKey.some(k => {
|
|
709
|
+
const val = option?.[k];
|
|
710
|
+
return (0, _utils.removeVietnameseTones)((val ?? '').toString().toLowerCase()).includes(searchValue);
|
|
711
|
+
});
|
|
712
|
+
return filterValues;
|
|
713
|
+
} : filterOption,
|
|
690
714
|
fieldNames: fieldNames ? fieldNames : {
|
|
691
715
|
value: keySelect,
|
|
692
716
|
label: inputKey ?? 'label'
|
|
@@ -22,6 +22,7 @@ const TableWrapper = props => {
|
|
|
22
22
|
id,
|
|
23
23
|
prefix,
|
|
24
24
|
tableContainerRef,
|
|
25
|
+
showHeader = true,
|
|
25
26
|
height,
|
|
26
27
|
minHeight,
|
|
27
28
|
summary,
|
|
@@ -207,7 +208,7 @@ const TableWrapper = props => {
|
|
|
207
208
|
display: 'grid',
|
|
208
209
|
minWidth: table.getTotalSize()
|
|
209
210
|
}
|
|
210
|
-
}, /*#__PURE__*/_react.default.createElement(_TableHead.default, {
|
|
211
|
+
}, showHeader && /*#__PURE__*/_react.default.createElement(_TableHead.default, {
|
|
211
212
|
tableContainerRef: tableContainerRef,
|
|
212
213
|
table: table,
|
|
213
214
|
columnVirtualizer: columnVirtualizer,
|