es-grid-template 1.8.64 → 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.
Files changed (222) hide show
  1. package/es/grid-component/TempTable.d.ts +2 -2
  2. package/es/grid-component/TempTable.js +5 -5
  3. package/es/grid-component/hooks/index.js +0 -1
  4. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  5. package/es/grid-component/hooks/useLazyKVMap.js +0 -4
  6. package/es/grid-component/hooks/utils.d.ts +1 -8
  7. package/es/grid-component/hooks/utils.js +176 -144
  8. package/es/grid-component/index.d.ts +1 -1
  9. package/es/grid-component/index.js +0 -4
  10. package/es/grid-component/styles.scss +1394 -1394
  11. package/es/grid-component/type.d.ts +0 -407
  12. package/es/grid-component/type.js +490 -1
  13. package/es/table-component/type.d.ts +10 -0
  14. package/es/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.js +4 -3
  15. package/es/{grid-component → table-virtuoso}/InternalTable.d.ts +2 -3
  16. package/es/table-virtuoso/InternalTable.js +391 -0
  17. package/es/table-virtuoso/body/TableBodyCell.d.ts +14 -0
  18. package/es/table-virtuoso/body/TableBodyCell.js +457 -0
  19. package/es/table-virtuoso/body/TableBodyRow.d.ts +13 -0
  20. package/es/table-virtuoso/body/TableBodyRow.js +112 -0
  21. package/es/table-virtuoso/footer/TableFooterCell.d.ts +7 -0
  22. package/es/table-virtuoso/footer/TableFooterCell.js +54 -0
  23. package/es/table-virtuoso/header/TableHeadCell.d.ts +14 -0
  24. package/es/table-virtuoso/header/TableHeadCell.js +265 -0
  25. package/es/table-virtuoso/header/renderFilter.d.ts +20 -0
  26. package/es/table-virtuoso/header/renderFilter.js +289 -0
  27. package/es/table-virtuoso/hook/constant.d.ts +73 -0
  28. package/es/table-virtuoso/hook/constant.js +240 -0
  29. package/es/table-virtuoso/hook/convert.d.ts +1 -0
  30. package/es/table-virtuoso/hook/convert.js +28 -0
  31. package/es/table-virtuoso/hook/useColumns.d.ts +28 -0
  32. package/es/table-virtuoso/hook/useColumns.js +302 -0
  33. package/es/table-virtuoso/hook/useFilterOperator.d.ts +7 -0
  34. package/es/table-virtuoso/hook/useFilterOperator.js +33 -0
  35. package/es/table-virtuoso/hook/utils.d.ts +159 -0
  36. package/es/table-virtuoso/hook/utils.js +2263 -0
  37. package/es/table-virtuoso/index.d.ts +2 -0
  38. package/es/table-virtuoso/index.js +2 -0
  39. package/es/table-virtuoso/style.d.ts +22 -0
  40. package/es/table-virtuoso/style.js +12 -0
  41. package/es/table-virtuoso/style.scss +1441 -0
  42. package/es/table-virtuoso/table/Grid.d.ts +37 -0
  43. package/es/table-virtuoso/table/Grid.js +298 -0
  44. package/es/table-virtuoso/table/TableContainer.d.ts +49 -0
  45. package/es/table-virtuoso/table/TableContainer.js +292 -0
  46. package/es/table-virtuoso/table/TableWrapper.d.ts +22 -0
  47. package/es/table-virtuoso/table/TableWrapper.js +161 -0
  48. package/es/table-virtuoso/type.d.ts +0 -0
  49. package/es/table-virtuoso/type.js +785 -0
  50. package/es/table-virtuoso/useContext.d.ts +97 -0
  51. package/es/table-virtuoso/useContext.js +21 -0
  52. package/lib/grid-component/TempTable.d.ts +2 -2
  53. package/lib/grid-component/TempTable.js +5 -7
  54. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  55. package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
  56. package/lib/grid-component/hooks/utils.d.ts +1 -8
  57. package/lib/grid-component/hooks/utils.js +179 -152
  58. package/lib/grid-component/index.d.ts +1 -1
  59. package/lib/grid-component/index.js +0 -3
  60. package/lib/grid-component/styles.scss +1394 -1394
  61. package/lib/grid-component/type.d.ts +0 -407
  62. package/lib/grid-component/type.js +490 -4
  63. package/lib/table-component/type.d.ts +10 -0
  64. package/lib/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.js +4 -3
  65. package/lib/{grid-component → table-virtuoso}/InternalTable.d.ts +2 -3
  66. package/lib/table-virtuoso/InternalTable.js +400 -0
  67. package/lib/table-virtuoso/body/TableBodyCell.d.ts +14 -0
  68. package/lib/table-virtuoso/body/TableBodyCell.js +464 -0
  69. package/lib/table-virtuoso/body/TableBodyRow.d.ts +13 -0
  70. package/lib/table-virtuoso/body/TableBodyRow.js +119 -0
  71. package/lib/table-virtuoso/footer/TableFooterCell.d.ts +7 -0
  72. package/lib/table-virtuoso/footer/TableFooterCell.js +63 -0
  73. package/lib/table-virtuoso/header/TableHeadCell.d.ts +14 -0
  74. package/lib/table-virtuoso/header/TableHeadCell.js +274 -0
  75. package/lib/table-virtuoso/header/renderFilter.d.ts +20 -0
  76. package/lib/table-virtuoso/header/renderFilter.js +299 -0
  77. package/lib/table-virtuoso/hook/constant.d.ts +73 -0
  78. package/lib/table-virtuoso/hook/constant.js +247 -0
  79. package/lib/table-virtuoso/hook/convert.d.ts +1 -0
  80. package/lib/table-virtuoso/hook/convert.js +34 -0
  81. package/lib/table-virtuoso/hook/useColumns.d.ts +28 -0
  82. package/lib/table-virtuoso/hook/useColumns.js +315 -0
  83. package/lib/table-virtuoso/hook/useFilterOperator.d.ts +7 -0
  84. package/lib/table-virtuoso/hook/useFilterOperator.js +40 -0
  85. package/lib/table-virtuoso/hook/utils.d.ts +159 -0
  86. package/lib/table-virtuoso/hook/utils.js +2389 -0
  87. package/lib/table-virtuoso/index.d.ts +2 -0
  88. package/lib/table-virtuoso/index.js +9 -0
  89. package/lib/table-virtuoso/style.d.ts +22 -0
  90. package/lib/table-virtuoso/style.js +19 -0
  91. package/lib/table-virtuoso/style.scss +1441 -0
  92. package/lib/table-virtuoso/table/Grid.d.ts +37 -0
  93. package/lib/table-virtuoso/table/Grid.js +307 -0
  94. package/lib/table-virtuoso/table/TableContainer.d.ts +49 -0
  95. package/lib/table-virtuoso/table/TableContainer.js +300 -0
  96. package/lib/table-virtuoso/table/TableWrapper.d.ts +22 -0
  97. package/lib/table-virtuoso/table/TableWrapper.js +166 -0
  98. package/lib/table-virtuoso/type.d.ts +0 -0
  99. package/lib/table-virtuoso/type.js +786 -0
  100. package/lib/table-virtuoso/useContext.d.ts +97 -0
  101. package/lib/table-virtuoso/useContext.js +27 -0
  102. package/package.json +2 -1
  103. package/es/grid-component/AdvanceFilter.d.ts +0 -14
  104. package/es/grid-component/AdvanceFilter.js +0 -454
  105. package/es/grid-component/CheckboxFilter.d.ts +0 -20
  106. package/es/grid-component/CheckboxFilter.js +0 -244
  107. package/es/grid-component/CheckboxFilter2.d.ts +0 -20
  108. package/es/grid-component/CheckboxFilter2.js +0 -244
  109. package/es/grid-component/ColumnsChoose.d.ts +0 -10
  110. package/es/grid-component/ColumnsChoose.js +0 -230
  111. package/es/grid-component/Command.d.ts +0 -8
  112. package/es/grid-component/Command.js +0 -80
  113. package/es/grid-component/ContextMenu.d.ts +0 -20
  114. package/es/grid-component/ContextMenu.js +0 -130
  115. package/es/grid-component/ConvertColumnTable.d.ts +0 -7
  116. package/es/grid-component/ConvertColumnTable.js +0 -144
  117. package/es/grid-component/EditForm/EditForm.d.ts +0 -27
  118. package/es/grid-component/EditForm/EditForm.js +0 -394
  119. package/es/grid-component/EditForm/index.d.ts +0 -1
  120. package/es/grid-component/EditForm/index.js +0 -1
  121. package/es/grid-component/EditableCell.d.ts +0 -20
  122. package/es/grid-component/EditableCell.js +0 -1030
  123. package/es/grid-component/FilterSearch.d.ts +0 -12
  124. package/es/grid-component/FilterSearch.js +0 -33
  125. package/es/grid-component/GridStyle.d.ts +0 -8
  126. package/es/grid-component/GridStyle.js +0 -5
  127. package/es/grid-component/InternalTable.js +0 -1170
  128. package/es/grid-component/TableGrid.d.ts +0 -21
  129. package/es/grid-component/TableGrid.js +0 -493
  130. package/es/grid-component/async-select/index.d.ts +0 -11
  131. package/es/grid-component/async-select/index.js +0 -38
  132. package/es/grid-component/async-table-select/index.d.ts +0 -11
  133. package/es/grid-component/async-table-select/index.js +0 -40
  134. package/es/grid-component/checkbox-control/index.d.ts +0 -13
  135. package/es/grid-component/checkbox-control/index.js +0 -40
  136. package/es/grid-component/hooks/columns/index.d.ts +0 -10
  137. package/es/grid-component/hooks/columns/index.js +0 -503
  138. package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
  139. package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
  140. package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
  141. package/es/grid-component/hooks/content/HeaderContent.js +0 -44
  142. package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
  143. package/es/grid-component/hooks/content/TooltipContent.js +0 -74
  144. package/es/grid-component/hooks/useColumns.d.ts +0 -19
  145. package/es/grid-component/hooks/useColumns.js +0 -317
  146. package/es/grid-component/number/index.d.ts +0 -10
  147. package/es/grid-component/number/index.js +0 -39
  148. package/es/grid-component/number-range/index.d.ts +0 -11
  149. package/es/grid-component/number-range/index.js +0 -63
  150. package/es/grid-component/table/Grid.d.ts +0 -23
  151. package/es/grid-component/table/Grid.js +0 -49
  152. package/es/grid-component/table/GridEdit.d.ts +0 -23
  153. package/es/grid-component/table/GridEdit.js +0 -2726
  154. package/es/grid-component/table/Group.d.ts +0 -21
  155. package/es/grid-component/table/Group.js +0 -195
  156. package/es/grid-component/table/InfiniteTable.d.ts +0 -23
  157. package/es/grid-component/table/InfiniteTable.js +0 -101
  158. package/es/grid-component/useContext.d.ts +0 -34
  159. package/es/grid-component/useContext.js +0 -8
  160. package/lib/grid-component/AdvanceFilter.d.ts +0 -14
  161. package/lib/grid-component/AdvanceFilter.js +0 -463
  162. package/lib/grid-component/CheckboxFilter.d.ts +0 -20
  163. package/lib/grid-component/CheckboxFilter.js +0 -253
  164. package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
  165. package/lib/grid-component/CheckboxFilter2.js +0 -253
  166. package/lib/grid-component/ColumnsChoose.d.ts +0 -10
  167. package/lib/grid-component/ColumnsChoose.js +0 -240
  168. package/lib/grid-component/Command.d.ts +0 -8
  169. package/lib/grid-component/Command.js +0 -88
  170. package/lib/grid-component/ContextMenu.d.ts +0 -20
  171. package/lib/grid-component/ContextMenu.js +0 -140
  172. package/lib/grid-component/ConvertColumnTable.d.ts +0 -7
  173. package/lib/grid-component/ConvertColumnTable.js +0 -153
  174. package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
  175. package/lib/grid-component/EditForm/EditForm.js +0 -404
  176. package/lib/grid-component/EditForm/index.d.ts +0 -1
  177. package/lib/grid-component/EditForm/index.js +0 -16
  178. package/lib/grid-component/EditableCell.d.ts +0 -20
  179. package/lib/grid-component/EditableCell.js +0 -1032
  180. package/lib/grid-component/FilterSearch.d.ts +0 -12
  181. package/lib/grid-component/FilterSearch.js +0 -42
  182. package/lib/grid-component/GridStyle.d.ts +0 -8
  183. package/lib/grid-component/GridStyle.js +0 -12
  184. package/lib/grid-component/InternalTable.js +0 -1178
  185. package/lib/grid-component/TableGrid.d.ts +0 -21
  186. package/lib/grid-component/TableGrid.js +0 -493
  187. package/lib/grid-component/async-select/index.d.ts +0 -11
  188. package/lib/grid-component/async-select/index.js +0 -47
  189. package/lib/grid-component/async-table-select/index.d.ts +0 -11
  190. package/lib/grid-component/async-table-select/index.js +0 -49
  191. package/lib/grid-component/checkbox-control/index.d.ts +0 -13
  192. package/lib/grid-component/checkbox-control/index.js +0 -48
  193. package/lib/grid-component/hooks/columns/index.d.ts +0 -10
  194. package/lib/grid-component/hooks/columns/index.js +0 -518
  195. package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
  196. package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
  197. package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
  198. package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
  199. package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
  200. package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
  201. package/lib/grid-component/hooks/useColumns.d.ts +0 -19
  202. package/lib/grid-component/hooks/useColumns.js +0 -328
  203. package/lib/grid-component/number/index.d.ts +0 -10
  204. package/lib/grid-component/number/index.js +0 -47
  205. package/lib/grid-component/number-range/index.d.ts +0 -11
  206. package/lib/grid-component/number-range/index.js +0 -71
  207. package/lib/grid-component/table/Grid.d.ts +0 -23
  208. package/lib/grid-component/table/Grid.js +0 -58
  209. package/lib/grid-component/table/GridEdit.d.ts +0 -23
  210. package/lib/grid-component/table/GridEdit.js +0 -2723
  211. package/lib/grid-component/table/Group.d.ts +0 -21
  212. package/lib/grid-component/table/Group.js +0 -204
  213. package/lib/grid-component/table/InfiniteTable.d.ts +0 -23
  214. package/lib/grid-component/table/InfiniteTable.js +0 -109
  215. package/lib/grid-component/useContext.d.ts +0 -34
  216. package/lib/grid-component/useContext.js +0 -13
  217. /package/es/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.d.ts +0 -0
  218. /package/es/{grid-component → table-virtuoso}/ColumnsGroup/index.d.ts +0 -0
  219. /package/es/{grid-component → table-virtuoso}/ColumnsGroup/index.js +0 -0
  220. /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.d.ts +0 -0
  221. /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/index.d.ts +0 -0
  222. /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/index.js +0 -0
@@ -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,23 +0,0 @@
1
- import React from 'react';
2
- import type { ColumnsTable, GridTableProps } from "../type";
3
- import type { GetRowKey } from "../type";
4
- type Props<T> = GridTableProps<T> & {
5
- scrollHeight?: number;
6
- tableRef: any;
7
- triggerFilter?: (queries: any) => void;
8
- triggerChangeColumns?: (columns: ColumnsTable<T>, type: string) => void;
9
- triggerChangeData?: (newData: T[], type: string) => void;
10
- getRowKey: GetRowKey<T>;
11
- triggerGroupColumns?: (groupedColumns: string[]) => void;
12
- setTooltipContent?: any;
13
- triggerPaste?: (pastedRows: T[], pastedColumnsArray: string[], newData: T[], copyRows: T[]) => void;
14
- isFilter?: boolean;
15
- setIsFilter?: React.Dispatch<React.SetStateAction<boolean>>;
16
- originData: T[];
17
- mergedFilterKeys?: any;
18
- setMergedFilterKeys?: any;
19
- handleFullScreen?: any;
20
- isFullScreen?: boolean;
21
- };
22
- declare const Grid: <RecordType extends object>(props: Props<RecordType>) => React.JSX.Element;
23
- export default Grid;
@@ -1,49 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import React, { Fragment } from 'react';
3
- import { GridStyle } from "../GridStyle";
4
- import TableGrid from "../TableGrid";
5
- // import type {ColumnsTable} from "../type";
6
-
7
- import { ConfigProvider } from "rc-master-ui";
8
- // import {ConfigProvider} from "antd";
9
-
10
- const Grid = props => {
11
- const {
12
- id,
13
- height,
14
- scrollHeight,
15
- rowHoverable,
16
- isFullScreen,
17
- ...rest
18
- } = props;
19
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(GridStyle, {
20
- $heightTable: height,
21
- $heightScroll: scrollHeight,
22
- $isFullScreen: isFullScreen,
23
- style: {
24
- position: 'relative'
25
- },
26
- id: id
27
- }, /*#__PURE__*/React.createElement(ConfigProvider, {
28
- theme: {
29
- components: {
30
- Table: {
31
- rowHoverBg: '#eb461912',
32
- rowSelectedBg: '#eb4619',
33
- rowSelectedHoverBg: '#eb4619',
34
- cellFontSize: 12,
35
- cellFontSizeSM: 13,
36
- headerBg: '#ffffff',
37
- cellPaddingBlockSM: 7
38
- }
39
- }
40
- }
41
- }, /*#__PURE__*/React.createElement(TableGrid, _extends({}, rest, {
42
- isFullScreen: isFullScreen,
43
- id: id
44
- // style={{...style, minHeight: height}}
45
- ,
46
- rowHoverable: rowHoverable ?? true
47
- })))));
48
- };
49
- export default Grid;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import 'dayjs/locale/es';
3
- import 'dayjs/locale/vi';
4
- import type { AnyObject, TableProps } from "../type";
5
- import type { ColumnsTable } from "../type";
6
- import type { GetRowKey } from "../type";
7
- type Props<RecordType> = TableProps<RecordType> & {
8
- tableRef: any;
9
- triggerChangeColumns?: (columns: ColumnsTable<RecordType>, type: string) => void;
10
- triggerChangeData?: (newData: RecordType[], type: string) => void;
11
- triggerPaste?: (pastedRows: RecordType[], pastedColumnsArray: string[], newData: RecordType[], copyRows: RecordType[]) => void;
12
- getRowKey: GetRowKey<RecordType>;
13
- triggerGroupColumns?: (groupedColumns: string[]) => void;
14
- setTooltipContent?: any;
15
- scrollHeight?: number;
16
- originData: RecordType[];
17
- mergedFilterKeys?: any;
18
- setMergedFilterKeys?: any;
19
- handleFullScreen?: any;
20
- isFullScreen?: boolean;
21
- };
22
- declare const GridEdit: <RecordType extends AnyObject = AnyObject>(props: Props<RecordType>) => React.JSX.Element;
23
- export default GridEdit;