es-grid-template 1.8.65 → 1.8.66
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/TempTable.d.ts +2 -2
- package/es/grid-component/TempTable.js +3 -3
- package/es/grid-component/hooks/index.js +0 -1
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/useLazyKVMap.js +0 -4
- package/es/grid-component/hooks/utils.d.ts +3 -4
- package/es/grid-component/hooks/utils.js +2 -1
- package/es/grid-component/styles.scss +1394 -1394
- package/es/grid-component/type.d.ts +0 -414
- package/es/grid-component/type.js +490 -1
- package/es/table-component/type.d.ts +2 -0
- package/es/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/es/table-virtuoso/InternalTable.js +6 -28
- package/es/table-virtuoso/body/TableBodyCell.js +0 -9
- package/es/table-virtuoso/body/TableBodyRow.js +0 -4
- package/es/table-virtuoso/style.js +2 -1
- package/es/table-virtuoso/style.scss +2 -1
- package/es/table-virtuoso/table/Grid.js +0 -4
- package/es/table-virtuoso/table/TableContainer.js +31 -44
- package/es/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/es/table-virtuoso/table/TableWrapper.js +5 -2
- package/lib/grid-component/TempTable.d.ts +2 -2
- package/lib/grid-component/TempTable.js +3 -5
- package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
- package/lib/grid-component/hooks/utils.d.ts +3 -4
- package/lib/grid-component/hooks/utils.js +3 -0
- package/lib/grid-component/styles.scss +1394 -1394
- package/lib/grid-component/type.d.ts +0 -414
- package/lib/grid-component/type.js +490 -4
- package/lib/table-component/type.d.ts +2 -0
- package/lib/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/lib/table-virtuoso/InternalTable.js +6 -28
- package/lib/table-virtuoso/body/TableBodyCell.js +0 -9
- package/lib/table-virtuoso/body/TableBodyRow.js +0 -5
- package/lib/table-virtuoso/style.js +2 -1
- package/lib/table-virtuoso/style.scss +2 -1
- package/lib/table-virtuoso/table/Grid.js +0 -4
- package/lib/table-virtuoso/table/TableContainer.js +29 -42
- package/lib/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/lib/table-virtuoso/table/TableWrapper.js +4 -2
- package/package.json +1 -1
- package/es/grid-component/AdvanceFilter.d.ts +0 -14
- package/es/grid-component/AdvanceFilter.js +0 -454
- package/es/grid-component/CheckboxFilter.d.ts +0 -20
- package/es/grid-component/CheckboxFilter.js +0 -244
- package/es/grid-component/CheckboxFilter2.d.ts +0 -20
- package/es/grid-component/CheckboxFilter2.js +0 -244
- package/es/grid-component/ColumnsChoose.d.ts +0 -10
- package/es/grid-component/ColumnsChoose.js +0 -230
- package/es/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/es/grid-component/ColumnsGroup/ColumnsGroup.js +0 -232
- package/es/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/es/grid-component/ColumnsGroup/index.js +0 -1
- package/es/grid-component/Command.d.ts +0 -8
- package/es/grid-component/Command.js +0 -80
- package/es/grid-component/ContextMenu.d.ts +0 -20
- package/es/grid-component/ContextMenu.js +0 -130
- package/es/grid-component/EditForm/EditForm.d.ts +0 -27
- package/es/grid-component/EditForm/EditForm.js +0 -394
- package/es/grid-component/EditForm/index.d.ts +0 -1
- package/es/grid-component/EditForm/index.js +0 -1
- package/es/grid-component/EditableCell.d.ts +0 -20
- package/es/grid-component/EditableCell.js +0 -1030
- package/es/grid-component/FilterSearch.d.ts +0 -12
- package/es/grid-component/FilterSearch.js +0 -33
- package/es/grid-component/GridStyle.d.ts +0 -8
- package/es/grid-component/GridStyle.js +0 -5
- package/es/grid-component/TableGrid.d.ts +0 -21
- package/es/grid-component/TableGrid.js +0 -493
- package/es/grid-component/async-select/index.d.ts +0 -11
- package/es/grid-component/async-select/index.js +0 -38
- package/es/grid-component/async-table-select/index.d.ts +0 -11
- package/es/grid-component/async-table-select/index.js +0 -40
- package/es/grid-component/checkbox-control/index.d.ts +0 -13
- package/es/grid-component/checkbox-control/index.js +0 -40
- package/es/grid-component/hooks/columns/index.d.ts +0 -10
- package/es/grid-component/hooks/columns/index.js +0 -503
- package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
- package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/es/grid-component/hooks/content/HeaderContent.js +0 -44
- package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/es/grid-component/hooks/content/TooltipContent.js +0 -74
- package/es/grid-component/hooks/useColumns.d.ts +0 -19
- package/es/grid-component/hooks/useColumns.js +0 -317
- package/es/grid-component/number/index.d.ts +0 -10
- package/es/grid-component/number/index.js +0 -39
- package/es/grid-component/number-range/index.d.ts +0 -11
- package/es/grid-component/number-range/index.js +0 -63
- package/es/grid-component/useContext.d.ts +0 -34
- package/es/grid-component/useContext.js +0 -8
- package/es/table-virtuoso/body/TableBody.d.ts +0 -14
- package/es/table-virtuoso/body/TableBody.js +0 -84
- package/lib/grid-component/AdvanceFilter.d.ts +0 -14
- package/lib/grid-component/AdvanceFilter.js +0 -463
- package/lib/grid-component/CheckboxFilter.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter.js +0 -253
- package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter2.js +0 -253
- package/lib/grid-component/ColumnsChoose.d.ts +0 -10
- package/lib/grid-component/ColumnsChoose.js +0 -240
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +0 -243
- package/lib/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/lib/grid-component/ColumnsGroup/index.js +0 -16
- package/lib/grid-component/Command.d.ts +0 -8
- package/lib/grid-component/Command.js +0 -88
- package/lib/grid-component/ContextMenu.d.ts +0 -20
- package/lib/grid-component/ContextMenu.js +0 -140
- package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
- package/lib/grid-component/EditForm/EditForm.js +0 -404
- package/lib/grid-component/EditForm/index.d.ts +0 -1
- package/lib/grid-component/EditForm/index.js +0 -16
- package/lib/grid-component/EditableCell.d.ts +0 -20
- package/lib/grid-component/EditableCell.js +0 -1032
- package/lib/grid-component/FilterSearch.d.ts +0 -12
- package/lib/grid-component/FilterSearch.js +0 -42
- package/lib/grid-component/GridStyle.d.ts +0 -8
- package/lib/grid-component/GridStyle.js +0 -12
- package/lib/grid-component/TableGrid.d.ts +0 -21
- package/lib/grid-component/TableGrid.js +0 -493
- package/lib/grid-component/async-select/index.d.ts +0 -11
- package/lib/grid-component/async-select/index.js +0 -47
- package/lib/grid-component/async-table-select/index.d.ts +0 -11
- package/lib/grid-component/async-table-select/index.js +0 -49
- package/lib/grid-component/checkbox-control/index.d.ts +0 -13
- package/lib/grid-component/checkbox-control/index.js +0 -48
- package/lib/grid-component/hooks/columns/index.d.ts +0 -10
- package/lib/grid-component/hooks/columns/index.js +0 -518
- package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
- package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
- package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
- package/lib/grid-component/hooks/useColumns.d.ts +0 -19
- package/lib/grid-component/hooks/useColumns.js +0 -328
- package/lib/grid-component/number/index.d.ts +0 -10
- package/lib/grid-component/number/index.js +0 -47
- package/lib/grid-component/number-range/index.d.ts +0 -11
- package/lib/grid-component/number-range/index.js +0 -71
- package/lib/grid-component/useContext.d.ts +0 -34
- package/lib/grid-component/useContext.js +0 -13
- package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
- package/lib/table-virtuoso/body/TableBody.js +0 -95
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React, { Fragment } from "react";
|
|
3
|
-
import classnames from "classnames";
|
|
4
|
-
import { getTemplate } from "../utils";
|
|
5
|
-
import styled from "styled-components";
|
|
6
|
-
const HeaderStyle = styled.div.withConfig({
|
|
7
|
-
displayName: "HeaderStyle",
|
|
8
|
-
componentId: "es-grid-template__sc-ibhq66-0"
|
|
9
|
-
})([""]);
|
|
10
|
-
const HeaderContent = props => {
|
|
11
|
-
const {
|
|
12
|
-
t,
|
|
13
|
-
id,
|
|
14
|
-
wrapSettings,
|
|
15
|
-
column,
|
|
16
|
-
onCopy,
|
|
17
|
-
...rest
|
|
18
|
-
} = props;
|
|
19
|
-
const {
|
|
20
|
-
headerTooltip,
|
|
21
|
-
headerText,
|
|
22
|
-
columnGroupText,
|
|
23
|
-
headerTemplate,
|
|
24
|
-
headerTextWrap,
|
|
25
|
-
ellipsis
|
|
26
|
-
} = props.column ?? {};
|
|
27
|
-
const text = React.useMemo(() => {
|
|
28
|
-
return columnGroupText ?? headerText;
|
|
29
|
-
}, [columnGroupText, headerText]);
|
|
30
|
-
const tooltip = React.useMemo(() => {
|
|
31
|
-
return t ? t?.(headerTooltip ?? columnGroupText ?? headerText) : headerTooltip ?? columnGroupText ?? headerText;
|
|
32
|
-
}, [columnGroupText, headerText, headerTooltip, t]);
|
|
33
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(HeaderStyle, _extends({}, rest, {
|
|
34
|
-
className: classnames('', {
|
|
35
|
-
'ui-rc-table-cell-ellipsis': ellipsis !== false && headerTextWrap !== true,
|
|
36
|
-
'header-text-wrap': headerTextWrap ?? (wrapSettings?.wrapMode === 'Header' || wrapSettings?.wrapMode === 'Both')
|
|
37
|
-
}),
|
|
38
|
-
"data-tooltip-id": `${id}-tooltip-header`,
|
|
39
|
-
"data-tooltip-content": tooltip,
|
|
40
|
-
"data-tooltip-offset": 16,
|
|
41
|
-
onCopy: onCopy
|
|
42
|
-
}), headerTemplate ? getTemplate(headerTemplate, column) : t ? t(text) : text));
|
|
43
|
-
};
|
|
44
|
-
export default HeaderContent;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
-
type Props = {
|
|
3
|
-
t?: any;
|
|
4
|
-
content?: any;
|
|
5
|
-
value?: any;
|
|
6
|
-
record?: any;
|
|
7
|
-
rowIndex?: any;
|
|
8
|
-
template?: React.ReactElement | React.ReactNode | (() => React.ReactElement | React.ReactNode);
|
|
9
|
-
tooltip?: ReactNode | ReactElement | ((value: any, record: any, index: number) => ReactNode | ReactElement);
|
|
10
|
-
showTooltip?: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare const TooltipContent: (props: Props) => React.JSX.Element;
|
|
13
|
-
export default TooltipContent;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React, { Fragment, useState } from "react";
|
|
3
|
-
import classnames from "classnames";
|
|
4
|
-
import { useFloating, autoUpdate, offset, flip, shift, useHover, useFocus, useDismiss, useRole, useInteractions, FloatingPortal
|
|
5
|
-
// useClick
|
|
6
|
-
} from "@floating-ui/react";
|
|
7
|
-
import styled from "styled-components";
|
|
8
|
-
import { useIsOverflow } from "../useIsOverflow";
|
|
9
|
-
// import {getTemplate} from "../utils";
|
|
10
|
-
|
|
11
|
-
const TooltipStyle = styled.div.withConfig({
|
|
12
|
-
displayName: "TooltipStyle",
|
|
13
|
-
componentId: "es-grid-template__sc-7yfbzv-0"
|
|
14
|
-
})(["width:max-content;background-color:#444;color:white;font-size:90%;padding:4px 8px;border-radius:4px;opacity:0.9;z-index:9999;max-width:450px;"]);
|
|
15
|
-
const TooltipContent = props => {
|
|
16
|
-
const {
|
|
17
|
-
content,
|
|
18
|
-
tooltip,
|
|
19
|
-
value,
|
|
20
|
-
record,
|
|
21
|
-
rowIndex,
|
|
22
|
-
showTooltip
|
|
23
|
-
} = props;
|
|
24
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
25
|
-
const {
|
|
26
|
-
refs,
|
|
27
|
-
floatingStyles,
|
|
28
|
-
context
|
|
29
|
-
} = useFloating({
|
|
30
|
-
open: isOpen,
|
|
31
|
-
onOpenChange: setIsOpen,
|
|
32
|
-
placement: "top",
|
|
33
|
-
whileElementsMounted: autoUpdate,
|
|
34
|
-
middleware: [offset(5), flip({
|
|
35
|
-
fallbackAxisSideDirection: "start"
|
|
36
|
-
}), shift()]
|
|
37
|
-
});
|
|
38
|
-
const isOverflow = useIsOverflow(refs.reference);
|
|
39
|
-
const hover = useHover(context, {
|
|
40
|
-
move: false
|
|
41
|
-
});
|
|
42
|
-
const focus = useFocus(context);
|
|
43
|
-
const dismiss = useDismiss(context);
|
|
44
|
-
const role = useRole(context, {
|
|
45
|
-
role: "tooltip"
|
|
46
|
-
});
|
|
47
|
-
const {
|
|
48
|
-
getReferenceProps,
|
|
49
|
-
getFloatingProps
|
|
50
|
-
} = useInteractions([hover, focus, dismiss, role]);
|
|
51
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
52
|
-
ref: refs.setReference
|
|
53
|
-
}, getReferenceProps(), {
|
|
54
|
-
style: {
|
|
55
|
-
flex: 1,
|
|
56
|
-
overflow: 'hidden',
|
|
57
|
-
textOverflow: 'ellipsis',
|
|
58
|
-
wordBreak: 'keep-all'
|
|
59
|
-
},
|
|
60
|
-
className: classnames('', {})
|
|
61
|
-
}), content()), isOpen && showTooltip !== false && isOverflow &&
|
|
62
|
-
/*#__PURE__*/
|
|
63
|
-
// {true && (
|
|
64
|
-
React.createElement(FloatingPortal, {
|
|
65
|
-
root: document.body
|
|
66
|
-
}, /*#__PURE__*/React.createElement(TooltipStyle, _extends({
|
|
67
|
-
className: "Tooltip",
|
|
68
|
-
ref: refs.setFloating,
|
|
69
|
-
style: {
|
|
70
|
-
...floatingStyles
|
|
71
|
-
}
|
|
72
|
-
}, getFloatingProps()), tooltip && typeof tooltip === 'function' ? tooltip(value, record, rowIndex) : tooltip ?? content())));
|
|
73
|
-
};
|
|
74
|
-
export default TooltipContent;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AnyObject, IGroupSetting } from "../type";
|
|
2
|
-
export declare const SELECTION_COLUMN: {};
|
|
3
|
-
interface UseColumnsConfig<RecordType> {
|
|
4
|
-
t?: any;
|
|
5
|
-
dataSource: RecordType[];
|
|
6
|
-
buddhistLocale?: any;
|
|
7
|
-
dataSourceFilter?: any;
|
|
8
|
-
locale?: any;
|
|
9
|
-
format?: any;
|
|
10
|
-
handleResize?: any;
|
|
11
|
-
sortMultiple?: boolean;
|
|
12
|
-
groupAble?: boolean;
|
|
13
|
-
groupSetting?: IGroupSetting;
|
|
14
|
-
groupColumns?: string[];
|
|
15
|
-
rowKey?: any;
|
|
16
|
-
onMouseHover?: any;
|
|
17
|
-
}
|
|
18
|
-
declare const useColumns: <RecordType extends AnyObject = AnyObject>(config: UseColumnsConfig<RecordType>) => readonly [any];
|
|
19
|
-
export default useColumns;
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
// import type {Key} from 'react';
|
|
3
|
-
import { Fragment, useCallback } from 'react';
|
|
4
|
-
// import Command from "../Command";
|
|
5
|
-
import { Button, Space } from "antd";
|
|
6
|
-
import { Select } from "rc-master-ui";
|
|
7
|
-
import { findItemPath, getFormat, getTypeFilter } from "./utils";
|
|
8
|
-
import { booleanOperator, numberOperator, stringOperator, translateOption } from "./constant";
|
|
9
|
-
import { flatColumns2, renderContent, renderFilter } from "./columns";
|
|
10
|
-
import { SearchOutlined } from "@ant-design/icons";
|
|
11
|
-
import { ArrowDown, ArrowUp, FilterFill } from "becoxy-icons";
|
|
12
|
-
import classNames from "classnames";
|
|
13
|
-
import HeaderContent from "./content/HeaderContent";
|
|
14
|
-
const ASCEND = 'ascend';
|
|
15
|
-
const DESCEND = 'descend';
|
|
16
|
-
export const SELECTION_COLUMN = {};
|
|
17
|
-
|
|
18
|
-
// const EMPTY_LIST: React.Key[] = [];
|
|
19
|
-
|
|
20
|
-
const useColumns = config => {
|
|
21
|
-
// const {
|
|
22
|
-
// preserveSelectedRowKeys,
|
|
23
|
-
// selectedRowKeys,
|
|
24
|
-
// defaultSelectedRowKeys,
|
|
25
|
-
// onSelectMultiple,
|
|
26
|
-
// columnWidth: selectionColWidth,
|
|
27
|
-
// type: selectionType,
|
|
28
|
-
// selections,
|
|
29
|
-
// fixed,
|
|
30
|
-
// } = rowSelection || {};
|
|
31
|
-
|
|
32
|
-
const {
|
|
33
|
-
t,
|
|
34
|
-
dataSourceFilter,
|
|
35
|
-
buddhistLocale,
|
|
36
|
-
locale,
|
|
37
|
-
sortMultiple,
|
|
38
|
-
format,
|
|
39
|
-
handleResize,
|
|
40
|
-
// onMouseHover,
|
|
41
|
-
groupAble,
|
|
42
|
-
groupColumns,
|
|
43
|
-
groupSetting,
|
|
44
|
-
dataSource,
|
|
45
|
-
rowKey
|
|
46
|
-
} = config;
|
|
47
|
-
|
|
48
|
-
// const mergedColumns = React.useMemo(
|
|
49
|
-
// () => getMergedColumns<RecordType>(rawMergedColumns || []),
|
|
50
|
-
// [rawMergedColumns],
|
|
51
|
-
// );
|
|
52
|
-
//
|
|
53
|
-
// const [filterStates, setFilterStates] = React.useState<FilterState<RecordType>[]>(() =>
|
|
54
|
-
// collectFilterStates(mergedColumns, true),
|
|
55
|
-
// );
|
|
56
|
-
|
|
57
|
-
// ====================== Selections ======================
|
|
58
|
-
|
|
59
|
-
// const handleSearch = (
|
|
60
|
-
// selectedKeys: string[],
|
|
61
|
-
// confirm: any,
|
|
62
|
-
// ) => {
|
|
63
|
-
//
|
|
64
|
-
// confirm()
|
|
65
|
-
//
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
const getColumnSearchProps = useCallback(column => ({
|
|
69
|
-
filterDropdown: ({
|
|
70
|
-
setSelectedKeys,
|
|
71
|
-
selectedKeys,
|
|
72
|
-
confirm,
|
|
73
|
-
// close,
|
|
74
|
-
setOperatorKey,
|
|
75
|
-
operatorKey,
|
|
76
|
-
visible,
|
|
77
|
-
searchValue,
|
|
78
|
-
setSearchValue
|
|
79
|
-
}) => {
|
|
80
|
-
const type = getTypeFilter(column);
|
|
81
|
-
// const operatorOptions = !type || type === 'Text' ? stringOperator : numberOperator
|
|
82
|
-
// const operatorOptions = type === 'Checkbox' || type === 'Dropdown' || type === 'DropTree' || ty
|
|
83
|
-
// const operatorOptions = type === ('Checkbox' || 'Dropdown' || 'DropTree' || 'CheckboxDropdown') ? booleanOperator : (!type || type === 'Text' ? stringOperator : numberOperator)
|
|
84
|
-
const operatorOptions = ['Checkbox', 'Dropdown', 'DropTree', 'CheckboxDropdown'].includes(type) ? booleanOperator : !type || type === 'Text' ? stringOperator : numberOperator;
|
|
85
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
style: {
|
|
87
|
-
padding: 8,
|
|
88
|
-
minWidth: 275
|
|
89
|
-
},
|
|
90
|
-
onKeyDown: e => e.stopPropagation()
|
|
91
|
-
}, column?.showOperator !== false && column?.typeFilter !== 'DateRange' && column?.typeFilter !== 'NumberRange' && /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
className: 'mb-1'
|
|
93
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
94
|
-
options: translateOption(operatorOptions, t),
|
|
95
|
-
style: {
|
|
96
|
-
width: '100%',
|
|
97
|
-
marginBottom: 8
|
|
98
|
-
},
|
|
99
|
-
value: operatorKey,
|
|
100
|
-
onChange: val => {
|
|
101
|
-
setOperatorKey(val);
|
|
102
|
-
}
|
|
103
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
style: {
|
|
105
|
-
marginBottom: 8
|
|
106
|
-
}
|
|
107
|
-
}, renderFilter(column, selectedKeys, setSelectedKeys, confirm, visible, searchValue, setSearchValue, dataSourceFilter, buddhistLocale, locale, t)), /*#__PURE__*/React.createElement(Space, {
|
|
108
|
-
style: {
|
|
109
|
-
justifyContent: 'end',
|
|
110
|
-
width: '100%'
|
|
111
|
-
}
|
|
112
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
113
|
-
type: "primary",
|
|
114
|
-
onClick: () => {
|
|
115
|
-
// confirm({closeDropdown: false})
|
|
116
|
-
confirm();
|
|
117
|
-
// handleSearch(selectedKeys as string[], confirm)
|
|
118
|
-
},
|
|
119
|
-
icon: /*#__PURE__*/React.createElement(SearchOutlined, null),
|
|
120
|
-
size: "small",
|
|
121
|
-
style: {
|
|
122
|
-
width: 90
|
|
123
|
-
}
|
|
124
|
-
}, t ? t('Filter') : 'Filter'), /*#__PURE__*/React.createElement(Button, {
|
|
125
|
-
type: "link",
|
|
126
|
-
size: "small",
|
|
127
|
-
onClick: () => {
|
|
128
|
-
// setSearchValue('')
|
|
129
|
-
setSelectedKeys([]);
|
|
130
|
-
confirm();
|
|
131
|
-
// handleSearch()
|
|
132
|
-
// close()
|
|
133
|
-
}
|
|
134
|
-
}, t ? t("Clear") : 'Clear')));
|
|
135
|
-
},
|
|
136
|
-
filterIcon: filtered => /*#__PURE__*/React.createElement(FilterFill, {
|
|
137
|
-
fontSize: 12
|
|
138
|
-
// onClick={() => {
|
|
139
|
-
// onFilterClick?.(column, onFilterCallback)
|
|
140
|
-
// }}
|
|
141
|
-
,
|
|
142
|
-
style: {
|
|
143
|
-
color: filtered ? '#E3165B' : '#283046'
|
|
144
|
-
}
|
|
145
|
-
}),
|
|
146
|
-
filterDropdownProps: {
|
|
147
|
-
onOpenChange(open) {
|
|
148
|
-
if (open) {
|
|
149
|
-
// setTimeout(() => searchInput.current?.select(), 100)
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}), [buddhistLocale, dataSourceFilter, locale, t]);
|
|
154
|
-
|
|
155
|
-
// ======================= Columns ========================
|
|
156
|
-
const transformColumns = useCallback(columns => {
|
|
157
|
-
// >>>>>>>>>>> Support selection
|
|
158
|
-
const cloneColumns = [...columns];
|
|
159
|
-
const firstNonGroupColumn = flatColumns2(cloneColumns).find(col => col.field && col.field !== '#' && !groupColumns?.includes(col.field) && col.hidden !== true);
|
|
160
|
-
const nonGroupColumns = flatColumns2(cloneColumns).filter(col => col.field && col.field !== '#' && !groupColumns?.includes(col.field) && col.hidden !== true);
|
|
161
|
-
|
|
162
|
-
// ===================== Render =====================
|
|
163
|
-
|
|
164
|
-
const convertColumns = cols => {
|
|
165
|
-
return cols.map(col => {
|
|
166
|
-
const colIndex = flatColumns2(cols).findIndex(it => it.field === col.field);
|
|
167
|
-
if (col === SELECTION_COLUMN) {
|
|
168
|
-
return SELECTION_COLUMN;
|
|
169
|
-
}
|
|
170
|
-
const transformedColumn = {
|
|
171
|
-
...col,
|
|
172
|
-
dataIndex: col.field ?? col.dataIndex,
|
|
173
|
-
key: col.field ?? col.dataIndex ?? col.key,
|
|
174
|
-
// title: t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title,
|
|
175
|
-
// title: () => (<span>aaa</span>),
|
|
176
|
-
title: () => /*#__PURE__*/React.createElement(HeaderContent, {
|
|
177
|
-
column: {
|
|
178
|
-
...col
|
|
179
|
-
},
|
|
180
|
-
t: t
|
|
181
|
-
}),
|
|
182
|
-
// title: () => (<span>{t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title}</span>),
|
|
183
|
-
ellipsis: col.ellipsis !== false,
|
|
184
|
-
align: col.textAlign ?? col.align,
|
|
185
|
-
fixed: col.fixedType ?? col.fixed,
|
|
186
|
-
isSummary: col.isSummary ?? col.haveSum,
|
|
187
|
-
hidden: col.hidden ?? col.visible === false
|
|
188
|
-
// hidden: true
|
|
189
|
-
};
|
|
190
|
-
if (transformedColumn.children && transformedColumn.children?.length) {
|
|
191
|
-
return {
|
|
192
|
-
...transformedColumn,
|
|
193
|
-
children: convertColumns(transformedColumn.children)
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
if (transformedColumn.field === '#') {
|
|
197
|
-
return {
|
|
198
|
-
...transformedColumn,
|
|
199
|
-
onCell: () => ({
|
|
200
|
-
className: 'cell-number'
|
|
201
|
-
}),
|
|
202
|
-
render: (val, record) => {
|
|
203
|
-
return findItemPath(dataSource, record, rowKey);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
if (transformedColumn.field === 'command') {
|
|
208
|
-
return {
|
|
209
|
-
...transformedColumn,
|
|
210
|
-
onCell: () => ({
|
|
211
|
-
className: 'cell-number',
|
|
212
|
-
style: {
|
|
213
|
-
padding: '2px 8px'
|
|
214
|
-
}
|
|
215
|
-
})
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
return {
|
|
219
|
-
...transformedColumn,
|
|
220
|
-
...(transformedColumn.allowFiltering === false ? {} : {
|
|
221
|
-
...getColumnSearchProps(col)
|
|
222
|
-
}),
|
|
223
|
-
sorter: col.sorter === false ? undefined : {
|
|
224
|
-
compare: a => a,
|
|
225
|
-
multiple: sortMultiple ? colIndex : undefined
|
|
226
|
-
},
|
|
227
|
-
sortIcon: args => {
|
|
228
|
-
const {
|
|
229
|
-
sortOrder
|
|
230
|
-
} = args;
|
|
231
|
-
return /*#__PURE__*/React.createElement(Fragment, null, !sortOrder && /*#__PURE__*/React.createElement(ArrowUp, {
|
|
232
|
-
fontSize: 15,
|
|
233
|
-
style: {
|
|
234
|
-
display: 'flex',
|
|
235
|
-
opacity: 0,
|
|
236
|
-
marginLeft: 4
|
|
237
|
-
},
|
|
238
|
-
className: classNames(`ui-rc-table-column-sorter-up`, {
|
|
239
|
-
active: true
|
|
240
|
-
})
|
|
241
|
-
}), sortOrder === ASCEND && /*#__PURE__*/React.createElement("span", {
|
|
242
|
-
className: classNames(`ui-rc-table-column-sorter-up`, {
|
|
243
|
-
active: sortOrder === ASCEND
|
|
244
|
-
}),
|
|
245
|
-
style: {
|
|
246
|
-
display: 'flex',
|
|
247
|
-
marginLeft: 4
|
|
248
|
-
}
|
|
249
|
-
}, /*#__PURE__*/React.createElement(ArrowUp, {
|
|
250
|
-
fontSize: 15,
|
|
251
|
-
color: '#000'
|
|
252
|
-
})), sortOrder === DESCEND && /*#__PURE__*/React.createElement("span", {
|
|
253
|
-
className: classNames(`ui-rc-table-column-sorter-up`, {
|
|
254
|
-
active: sortOrder === DESCEND
|
|
255
|
-
}),
|
|
256
|
-
style: {
|
|
257
|
-
display: 'flex',
|
|
258
|
-
marginLeft: 4
|
|
259
|
-
}
|
|
260
|
-
}, /*#__PURE__*/React.createElement(ArrowDown, {
|
|
261
|
-
fontSize: 15,
|
|
262
|
-
color: '#000'
|
|
263
|
-
})));
|
|
264
|
-
},
|
|
265
|
-
onHeaderCell: () => ({
|
|
266
|
-
id: `${col.field}`,
|
|
267
|
-
width: col.width,
|
|
268
|
-
onResize: handleResize?.(col),
|
|
269
|
-
className: col.headerTextAlign === 'center' ? 'head-align-center' : col.headerTextAlign === 'right' ? 'head-align-right' : ''
|
|
270
|
-
}),
|
|
271
|
-
onCell: (data, index) => {
|
|
272
|
-
return {
|
|
273
|
-
id: `${col.field}`,
|
|
274
|
-
colSpan: groupColumns && data.children && col.field === firstNonGroupColumn?.field ? 2 : groupColumns && data.children && nonGroupColumns[1].field === col.field ? 0 : 1,
|
|
275
|
-
zIndex: data.children && col.field === firstNonGroupColumn?.field ? 11 : undefined,
|
|
276
|
-
...transformedColumn?.onCell?.(data, index),
|
|
277
|
-
className: classNames(transformedColumn?.onCell?.(data, index).className ?? '', {
|
|
278
|
-
'cell-group': groupColumns && data.children,
|
|
279
|
-
'cell-group-fixed': groupColumns && data.children && col.field === firstNonGroupColumn?.field
|
|
280
|
-
})
|
|
281
|
-
// onMouseEnter: () => {
|
|
282
|
-
// onMouseHover(data, col as any)
|
|
283
|
-
// },
|
|
284
|
-
};
|
|
285
|
-
},
|
|
286
|
-
render: (value, record, rowIndex) => {
|
|
287
|
-
const colFormat = typeof col.format === 'function' ? col.format(record) : col.format;
|
|
288
|
-
const cellFormat = getFormat(colFormat, format);
|
|
289
|
-
if (groupSetting && groupSetting.hiddenColumnGroup === false) {
|
|
290
|
-
if (record.children) {
|
|
291
|
-
return renderContent(col, value, record, rowIndex, colIndex, false, cellFormat);
|
|
292
|
-
}
|
|
293
|
-
if (groupColumns?.includes(col.field)) {
|
|
294
|
-
return '';
|
|
295
|
-
}
|
|
296
|
-
return renderContent(col, value, record, rowIndex, colIndex, false, cellFormat);
|
|
297
|
-
}
|
|
298
|
-
if (col.field === firstNonGroupColumn?.field && record.children) {
|
|
299
|
-
const currentGroupColumn = flatColumns2(cols).find(it => it.field === record.field);
|
|
300
|
-
if (currentGroupColumn?.template) {
|
|
301
|
-
return renderContent(currentGroupColumn, record[record.field], record, rowIndex, colIndex, false, cellFormat);
|
|
302
|
-
}
|
|
303
|
-
return /*#__PURE__*/React.createElement("span", null, currentGroupColumn?.headerText, ": ", renderContent(currentGroupColumn, record[record.field], record, rowIndex, colIndex, false, cellFormat));
|
|
304
|
-
}
|
|
305
|
-
return renderContent(col, value, record, rowIndex, colIndex, false, cellFormat);
|
|
306
|
-
},
|
|
307
|
-
hidden: groupSetting && groupSetting.hiddenColumnGroup === false ? transformedColumn.hidden : groupAble && groupColumns && groupColumns.includes(col.field) ? true : transformedColumn.hidden
|
|
308
|
-
};
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
return convertColumns(cloneColumns);
|
|
312
|
-
}, [groupColumns, getColumnSearchProps, sortMultiple, groupSetting, groupAble, t, dataSource, rowKey, handleResize, format]
|
|
313
|
-
// format, getColumnSearchProps, sortMultiple, groupSetting, groupAble, t, groupColumns, , handleResize, , t, cellHover
|
|
314
|
-
);
|
|
315
|
-
return [transformColumns];
|
|
316
|
-
};
|
|
317
|
-
export default useColumns;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IFormat } from "../type";
|
|
3
|
-
type Props = {
|
|
4
|
-
t?: any;
|
|
5
|
-
format?: IFormat;
|
|
6
|
-
value: number | string | undefined;
|
|
7
|
-
onChange?: (values: any[]) => void;
|
|
8
|
-
};
|
|
9
|
-
declare const NumberInput: (props: Props) => React.JSX.Element;
|
|
10
|
-
export default NumberInput;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import { NumericFormat } from "react-numeric-component";
|
|
3
|
-
import { Input } from "rc-master-ui";
|
|
4
|
-
import { checkDecimalSeparator, checkThousandSeparator } from "../hooks";
|
|
5
|
-
const NumberInput = props => {
|
|
6
|
-
const {
|
|
7
|
-
t,
|
|
8
|
-
value,
|
|
9
|
-
format,
|
|
10
|
-
onChange
|
|
11
|
-
} = props;
|
|
12
|
-
const values = React.useMemo(() => [value], [value]);
|
|
13
|
-
|
|
14
|
-
// const [values, setValues] = React.useState<any[]>(() =>
|
|
15
|
-
// mergedValues,
|
|
16
|
-
// );
|
|
17
|
-
|
|
18
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(NumericFormat, {
|
|
19
|
-
value: values[0] ?? ''
|
|
20
|
-
// value={min}
|
|
21
|
-
,
|
|
22
|
-
thousandSeparator: checkThousandSeparator(format?.thousandSeparator, format?.decimalSeparator),
|
|
23
|
-
decimalSeparator: checkDecimalSeparator(format?.thousandSeparator, format?.decimalSeparator),
|
|
24
|
-
allowNegative: true,
|
|
25
|
-
customInput: Input,
|
|
26
|
-
className: 'rounded-0 input-element',
|
|
27
|
-
onValueChange: vals => {
|
|
28
|
-
// onChangeValueFilter(type, values.floatValue, 'min')
|
|
29
|
-
|
|
30
|
-
// setValues([vals.floatValue, values[1]])
|
|
31
|
-
onChange?.([vals.floatValue]);
|
|
32
|
-
}
|
|
33
|
-
// placeholder={t ? t('Min') : 'Min'}
|
|
34
|
-
,
|
|
35
|
-
placeholder: t ? t('Enter') : 'Enter',
|
|
36
|
-
autoFocus: true
|
|
37
|
-
}));
|
|
38
|
-
};
|
|
39
|
-
export default NumberInput;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IFormat } from "../type";
|
|
3
|
-
type Props = {
|
|
4
|
-
t?: any;
|
|
5
|
-
format?: IFormat;
|
|
6
|
-
min: number | string | undefined;
|
|
7
|
-
max: number | string | undefined;
|
|
8
|
-
onChange?: (values: any[]) => void;
|
|
9
|
-
};
|
|
10
|
-
declare const NumberRange: (props: Props) => React.JSX.Element;
|
|
11
|
-
export default NumberRange;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import { NumericFormat } from "react-numeric-component";
|
|
3
|
-
import { Input } from "rc-master-ui";
|
|
4
|
-
import { checkDecimalSeparator, checkThousandSeparator } from "../hooks";
|
|
5
|
-
const NumberRange = props => {
|
|
6
|
-
const {
|
|
7
|
-
t,
|
|
8
|
-
max,
|
|
9
|
-
min,
|
|
10
|
-
format,
|
|
11
|
-
onChange
|
|
12
|
-
} = props;
|
|
13
|
-
const values = React.useMemo(() => [min, max], [min, max]);
|
|
14
|
-
|
|
15
|
-
// const [values, setValues] = React.useState<any[]>(() =>
|
|
16
|
-
// mergedValues,
|
|
17
|
-
// );
|
|
18
|
-
|
|
19
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: '',
|
|
21
|
-
style: {
|
|
22
|
-
display: 'flex',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
columnGap: 5
|
|
25
|
-
}
|
|
26
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NumericFormat, {
|
|
27
|
-
value: values[0] ?? ''
|
|
28
|
-
// value={min}
|
|
29
|
-
,
|
|
30
|
-
thousandSeparator: checkThousandSeparator(format?.thousandSeparator, format?.decimalSeparator),
|
|
31
|
-
decimalSeparator: checkDecimalSeparator(format?.thousandSeparator, format?.decimalSeparator),
|
|
32
|
-
allowNegative: true,
|
|
33
|
-
customInput: Input,
|
|
34
|
-
className: ' rounded-0 input-element',
|
|
35
|
-
onValueChange: vals => {
|
|
36
|
-
// onChangeValueFilter(type, values.floatValue, 'min')
|
|
37
|
-
|
|
38
|
-
// setValues([vals.floatValue, values[1]])
|
|
39
|
-
onChange?.([vals.floatValue, max]);
|
|
40
|
-
}
|
|
41
|
-
// placeholder={t ? t('Min') : 'Min'}
|
|
42
|
-
,
|
|
43
|
-
placeholder: t ? t('From') : 'From',
|
|
44
|
-
autoFocus: true
|
|
45
|
-
})), /*#__PURE__*/React.createElement("span", null, " - "), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NumericFormat, {
|
|
46
|
-
value: values[1] ?? ''
|
|
47
|
-
// value={max}
|
|
48
|
-
,
|
|
49
|
-
thousandSeparator: checkThousandSeparator(format?.thousandSeparator, format?.decimalSeparator),
|
|
50
|
-
decimalSeparator: checkDecimalSeparator(format?.thousandSeparator, format?.decimalSeparator),
|
|
51
|
-
allowNegative: true,
|
|
52
|
-
customInput: Input,
|
|
53
|
-
className: ' rounded-0 input-element',
|
|
54
|
-
onValueChange: vals => {
|
|
55
|
-
// setValues([values[0], vals.floatValue])
|
|
56
|
-
onChange?.([min, vals.floatValue]);
|
|
57
|
-
}
|
|
58
|
-
// placeholder={t ? t('Max') : 'Max'}
|
|
59
|
-
,
|
|
60
|
-
placeholder: t ? t('To') : 'To'
|
|
61
|
-
}))));
|
|
62
|
-
};
|
|
63
|
-
export default NumberRange;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { AnyObject, IFormat } from "./type";
|
|
3
|
-
import type { SubmitHandler } from "react-hook-form";
|
|
4
|
-
import type { GetRowKey } from "./type";
|
|
5
|
-
export interface IContext<RecordType> {
|
|
6
|
-
searchValue?: any;
|
|
7
|
-
setSearchValue?: any;
|
|
8
|
-
open?: boolean;
|
|
9
|
-
setOpen?: any;
|
|
10
|
-
rowKey: string | keyof RecordType | GetRowKey<RecordType>;
|
|
11
|
-
onSave?: any;
|
|
12
|
-
format?: IFormat;
|
|
13
|
-
control?: any;
|
|
14
|
-
errors?: any;
|
|
15
|
-
trigger?: any;
|
|
16
|
-
handleSubmit?: any;
|
|
17
|
-
onSubmit?: SubmitHandler<any>;
|
|
18
|
-
getValues?: any;
|
|
19
|
-
handleCellChange?: (args: ContextCellChange<RecordType>) => void;
|
|
20
|
-
getRowKey?: GetRowKey<RecordType>;
|
|
21
|
-
id: string;
|
|
22
|
-
}
|
|
23
|
-
export type ContextCellChange<RecordType = AnyObject> = {
|
|
24
|
-
key: string | keyof RecordType | GetRowKey<RecordType>;
|
|
25
|
-
record: any;
|
|
26
|
-
field: string | undefined;
|
|
27
|
-
option: any;
|
|
28
|
-
indexRow: number;
|
|
29
|
-
indexCol: number;
|
|
30
|
-
newState?: any;
|
|
31
|
-
prevState?: any;
|
|
32
|
-
type: 'enter' | 'blur' | 'outClick';
|
|
33
|
-
};
|
|
34
|
-
export declare const TableContext: import("react").Context<IContext<any>>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Table } from "@tanstack/react-table";
|
|
2
|
-
import type { CommandClick } from "../../table-component/type";
|
|
3
|
-
import React from "react";
|
|
4
|
-
interface TableBodyProps<T> {
|
|
5
|
-
table: Table<T>;
|
|
6
|
-
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
7
|
-
commandClick?: (args: CommandClick<T>) => void;
|
|
8
|
-
editAble?: boolean;
|
|
9
|
-
tableId: string;
|
|
10
|
-
showEmptyText?: boolean;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
declare const TableBody: <RecordType extends object>({ columnVirtualizer, table, tableContainerRef, virtualPaddingLeft, virtualPaddingRight, fixedLeftColumns, fixedRightColumns, tableId, showEmptyText, ...rest }: TableBodyProps<RecordType>) => React.JSX.Element;
|
|
14
|
-
export default TableBody;
|