es-grid-template 1.8.65 → 1.8.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/es/grid-component/TempTable.d.ts +2 -2
  2. package/es/grid-component/TempTable.js +3 -3
  3. package/es/grid-component/hooks/constant.d.ts +1 -0
  4. package/es/grid-component/hooks/constant.js +2 -1
  5. package/es/grid-component/hooks/index.js +0 -1
  6. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  7. package/es/grid-component/hooks/useLazyKVMap.js +0 -4
  8. package/es/grid-component/hooks/utils.d.ts +3 -4
  9. package/es/grid-component/hooks/utils.js +2 -1
  10. package/es/grid-component/styles.scss +1394 -1394
  11. package/es/grid-component/type.d.ts +0 -414
  12. package/es/grid-component/type.js +490 -1
  13. package/es/table-component/TableContainerEdit.js +2 -127
  14. package/es/table-component/body/TableBodyCellEdit.js +2 -9
  15. package/es/table-component/header/TableHeadCell.js +1 -10
  16. package/es/table-component/header/TableHeadCell2.js +1 -1
  17. package/es/table-component/type.d.ts +3 -1
  18. package/es/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
  19. package/es/table-virtuoso/InternalTable.js +6 -28
  20. package/es/table-virtuoso/body/TableBodyCell.js +0 -9
  21. package/es/table-virtuoso/body/TableBodyRow.js +0 -4
  22. package/es/table-virtuoso/style.js +2 -1
  23. package/es/table-virtuoso/style.scss +2 -1
  24. package/es/table-virtuoso/table/Grid.js +0 -4
  25. package/es/table-virtuoso/table/TableContainer.js +31 -44
  26. package/es/table-virtuoso/table/TableWrapper.d.ts +2 -0
  27. package/es/table-virtuoso/table/TableWrapper.js +5 -2
  28. package/lib/grid-component/TempTable.d.ts +2 -2
  29. package/lib/grid-component/TempTable.js +3 -5
  30. package/lib/grid-component/hooks/constant.d.ts +1 -0
  31. package/lib/grid-component/hooks/constant.js +3 -2
  32. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  33. package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
  34. package/lib/grid-component/hooks/utils.d.ts +3 -4
  35. package/lib/grid-component/hooks/utils.js +3 -0
  36. package/lib/grid-component/styles.scss +1394 -1394
  37. package/lib/grid-component/type.d.ts +0 -414
  38. package/lib/grid-component/type.js +490 -4
  39. package/lib/table-component/TableContainerEdit.js +1 -126
  40. package/lib/table-component/body/TableBodyCellEdit.js +5 -11
  41. package/lib/table-component/header/TableHeadCell.js +4 -13
  42. package/lib/table-component/header/TableHeadCell2.js +4 -4
  43. package/lib/table-component/type.d.ts +3 -1
  44. package/lib/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
  45. package/lib/table-virtuoso/InternalTable.js +6 -28
  46. package/lib/table-virtuoso/body/TableBodyCell.js +0 -9
  47. package/lib/table-virtuoso/body/TableBodyRow.js +0 -5
  48. package/lib/table-virtuoso/style.js +2 -1
  49. package/lib/table-virtuoso/style.scss +2 -1
  50. package/lib/table-virtuoso/table/Grid.js +0 -4
  51. package/lib/table-virtuoso/table/TableContainer.js +29 -42
  52. package/lib/table-virtuoso/table/TableWrapper.d.ts +2 -0
  53. package/lib/table-virtuoso/table/TableWrapper.js +4 -2
  54. package/package.json +1 -1
  55. package/es/grid-component/AdvanceFilter.d.ts +0 -14
  56. package/es/grid-component/AdvanceFilter.js +0 -454
  57. package/es/grid-component/CheckboxFilter.d.ts +0 -20
  58. package/es/grid-component/CheckboxFilter.js +0 -244
  59. package/es/grid-component/CheckboxFilter2.d.ts +0 -20
  60. package/es/grid-component/CheckboxFilter2.js +0 -244
  61. package/es/grid-component/ColumnsChoose.d.ts +0 -10
  62. package/es/grid-component/ColumnsChoose.js +0 -230
  63. package/es/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
  64. package/es/grid-component/ColumnsGroup/ColumnsGroup.js +0 -232
  65. package/es/grid-component/ColumnsGroup/index.d.ts +0 -1
  66. package/es/grid-component/ColumnsGroup/index.js +0 -1
  67. package/es/grid-component/Command.d.ts +0 -8
  68. package/es/grid-component/Command.js +0 -80
  69. package/es/grid-component/ContextMenu.d.ts +0 -20
  70. package/es/grid-component/ContextMenu.js +0 -130
  71. package/es/grid-component/EditForm/EditForm.d.ts +0 -27
  72. package/es/grid-component/EditForm/EditForm.js +0 -394
  73. package/es/grid-component/EditForm/index.d.ts +0 -1
  74. package/es/grid-component/EditForm/index.js +0 -1
  75. package/es/grid-component/EditableCell.d.ts +0 -20
  76. package/es/grid-component/EditableCell.js +0 -1030
  77. package/es/grid-component/FilterSearch.d.ts +0 -12
  78. package/es/grid-component/FilterSearch.js +0 -33
  79. package/es/grid-component/GridStyle.d.ts +0 -8
  80. package/es/grid-component/GridStyle.js +0 -5
  81. package/es/grid-component/TableGrid.d.ts +0 -21
  82. package/es/grid-component/TableGrid.js +0 -493
  83. package/es/grid-component/async-select/index.d.ts +0 -11
  84. package/es/grid-component/async-select/index.js +0 -38
  85. package/es/grid-component/async-table-select/index.d.ts +0 -11
  86. package/es/grid-component/async-table-select/index.js +0 -40
  87. package/es/grid-component/checkbox-control/index.d.ts +0 -13
  88. package/es/grid-component/checkbox-control/index.js +0 -40
  89. package/es/grid-component/hooks/columns/index.d.ts +0 -10
  90. package/es/grid-component/hooks/columns/index.js +0 -503
  91. package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
  92. package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
  93. package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
  94. package/es/grid-component/hooks/content/HeaderContent.js +0 -44
  95. package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
  96. package/es/grid-component/hooks/content/TooltipContent.js +0 -74
  97. package/es/grid-component/hooks/useColumns.d.ts +0 -19
  98. package/es/grid-component/hooks/useColumns.js +0 -317
  99. package/es/grid-component/number/index.d.ts +0 -10
  100. package/es/grid-component/number/index.js +0 -39
  101. package/es/grid-component/number-range/index.d.ts +0 -11
  102. package/es/grid-component/number-range/index.js +0 -63
  103. package/es/grid-component/useContext.d.ts +0 -34
  104. package/es/grid-component/useContext.js +0 -8
  105. package/es/table-component/hook/constant.d.ts +0 -73
  106. package/es/table-component/hook/constant.js +0 -240
  107. package/es/table-virtuoso/body/TableBody.d.ts +0 -14
  108. package/es/table-virtuoso/body/TableBody.js +0 -84
  109. package/lib/grid-component/AdvanceFilter.d.ts +0 -14
  110. package/lib/grid-component/AdvanceFilter.js +0 -463
  111. package/lib/grid-component/CheckboxFilter.d.ts +0 -20
  112. package/lib/grid-component/CheckboxFilter.js +0 -253
  113. package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
  114. package/lib/grid-component/CheckboxFilter2.js +0 -253
  115. package/lib/grid-component/ColumnsChoose.d.ts +0 -10
  116. package/lib/grid-component/ColumnsChoose.js +0 -240
  117. package/lib/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
  118. package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +0 -243
  119. package/lib/grid-component/ColumnsGroup/index.d.ts +0 -1
  120. package/lib/grid-component/ColumnsGroup/index.js +0 -16
  121. package/lib/grid-component/Command.d.ts +0 -8
  122. package/lib/grid-component/Command.js +0 -88
  123. package/lib/grid-component/ContextMenu.d.ts +0 -20
  124. package/lib/grid-component/ContextMenu.js +0 -140
  125. package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
  126. package/lib/grid-component/EditForm/EditForm.js +0 -404
  127. package/lib/grid-component/EditForm/index.d.ts +0 -1
  128. package/lib/grid-component/EditForm/index.js +0 -16
  129. package/lib/grid-component/EditableCell.d.ts +0 -20
  130. package/lib/grid-component/EditableCell.js +0 -1032
  131. package/lib/grid-component/FilterSearch.d.ts +0 -12
  132. package/lib/grid-component/FilterSearch.js +0 -42
  133. package/lib/grid-component/GridStyle.d.ts +0 -8
  134. package/lib/grid-component/GridStyle.js +0 -12
  135. package/lib/grid-component/TableGrid.d.ts +0 -21
  136. package/lib/grid-component/TableGrid.js +0 -493
  137. package/lib/grid-component/async-select/index.d.ts +0 -11
  138. package/lib/grid-component/async-select/index.js +0 -47
  139. package/lib/grid-component/async-table-select/index.d.ts +0 -11
  140. package/lib/grid-component/async-table-select/index.js +0 -49
  141. package/lib/grid-component/checkbox-control/index.d.ts +0 -13
  142. package/lib/grid-component/checkbox-control/index.js +0 -48
  143. package/lib/grid-component/hooks/columns/index.d.ts +0 -10
  144. package/lib/grid-component/hooks/columns/index.js +0 -518
  145. package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
  146. package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
  147. package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
  148. package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
  149. package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
  150. package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
  151. package/lib/grid-component/hooks/useColumns.d.ts +0 -19
  152. package/lib/grid-component/hooks/useColumns.js +0 -328
  153. package/lib/grid-component/number/index.d.ts +0 -10
  154. package/lib/grid-component/number/index.js +0 -47
  155. package/lib/grid-component/number-range/index.d.ts +0 -11
  156. package/lib/grid-component/number-range/index.js +0 -71
  157. package/lib/grid-component/useContext.d.ts +0 -34
  158. package/lib/grid-component/useContext.js +0 -13
  159. package/lib/table-component/hook/constant.d.ts +0 -73
  160. package/lib/table-component/hook/constant.js +0 -247
  161. package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
  162. package/lib/table-virtuoso/body/TableBody.js +0 -95
@@ -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,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNumericComponent = require("react-numeric-component");
9
- var _rcMasterUi = require("rc-master-ui");
10
- var _hooks = require("../hooks");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- const NumberRange = props => {
14
- const {
15
- t,
16
- max,
17
- min,
18
- format,
19
- onChange
20
- } = props;
21
- const values = _react.default.useMemo(() => [min, max], [min, max]);
22
-
23
- // const [values, setValues] = React.useState<any[]>(() =>
24
- // mergedValues,
25
- // );
26
-
27
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
28
- className: '',
29
- style: {
30
- display: 'flex',
31
- alignItems: 'center',
32
- columnGap: 5
33
- }
34
- }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactNumericComponent.NumericFormat, {
35
- value: values[0] ?? ''
36
- // value={min}
37
- ,
38
- thousandSeparator: (0, _hooks.checkThousandSeparator)(format?.thousandSeparator, format?.decimalSeparator),
39
- decimalSeparator: (0, _hooks.checkDecimalSeparator)(format?.thousandSeparator, format?.decimalSeparator),
40
- allowNegative: true,
41
- customInput: _rcMasterUi.Input,
42
- className: ' rounded-0 input-element',
43
- onValueChange: vals => {
44
- // onChangeValueFilter(type, values.floatValue, 'min')
45
-
46
- // setValues([vals.floatValue, values[1]])
47
- onChange?.([vals.floatValue, max]);
48
- }
49
- // placeholder={t ? t('Min') : 'Min'}
50
- ,
51
- placeholder: t ? t('From') : 'From',
52
- autoFocus: true
53
- })), /*#__PURE__*/_react.default.createElement("span", null, " - "), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactNumericComponent.NumericFormat, {
54
- value: values[1] ?? ''
55
- // value={max}
56
- ,
57
- thousandSeparator: (0, _hooks.checkThousandSeparator)(format?.thousandSeparator, format?.decimalSeparator),
58
- decimalSeparator: (0, _hooks.checkDecimalSeparator)(format?.thousandSeparator, format?.decimalSeparator),
59
- allowNegative: true,
60
- customInput: _rcMasterUi.Input,
61
- className: ' rounded-0 input-element',
62
- onValueChange: vals => {
63
- // setValues([values[0], vals.floatValue])
64
- onChange?.([min, vals.floatValue]);
65
- }
66
- // placeholder={t ? t('Max') : 'Max'}
67
- ,
68
- placeholder: t ? t('To') : 'To'
69
- }))));
70
- };
71
- var _default = exports.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,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TableContext = void 0;
7
- var _react = require("react");
8
- // import {AnyObject} from "antd/es/_util/type";
9
-
10
- const TableContext = exports.TableContext = /*#__PURE__*/(0, _react.createContext)({
11
- rowKey: 'rowId',
12
- id: ''
13
- });
@@ -1,73 +0,0 @@
1
- export declare const defaultWidth: number;
2
- export declare const defaultRowHeight: number;
3
- export type IOperator = {
4
- value: string;
5
- label: string;
6
- key: string;
7
- };
8
- export declare const numberOperator: IOperator[];
9
- export declare const stringOperator: IOperator[];
10
- export declare const dateOperator: IOperator[];
11
- export declare const dateTimeOperator: IOperator[];
12
- export declare const booleanOperator: IOperator[];
13
- export declare const translateOption: (options: IOperator[], t: any) => any[];
14
- export declare const transferFontSize: any;
15
- export declare const defaultDateFormat = "d/m/Y";
16
- export declare const defaultDateTimeFormat = "d/m/Y H:i";
17
- export declare const defaultTimeFormat = "H:i";
18
- export declare const defaultPageSizes: number[];
19
- export declare const alignToFlex: any;
20
- export declare const optionsSize: {
21
- label: string;
22
- value: string;
23
- width: number;
24
- height: number;
25
- }[];
26
- export declare const paperSize: {
27
- a4: {
28
- width: number;
29
- height: number;
30
- };
31
- a3: {
32
- width: number;
33
- height: number;
34
- };
35
- letter: {
36
- width: number;
37
- height: number;
38
- };
39
- };
40
- export declare const optionFont: {
41
- value: string;
42
- label: string;
43
- }[];
44
- export declare const optionsPaperOrientation: any[];
45
- export declare const optionFontSize: {
46
- value: number;
47
- label: string;
48
- }[];
49
- /**
50
- * Sort order for BaseTable
51
- */
52
- declare const SortOrder: {
53
- /**
54
- * Sort data in ascending order
55
- */
56
- ascend: string;
57
- /**
58
- * Sort data in descending order
59
- */
60
- descend: string;
61
- };
62
- export default SortOrder;
63
- export declare const valueToBoolean: {
64
- true: boolean;
65
- false: boolean;
66
- 1: boolean;
67
- 0: boolean;
68
- };
69
- export declare const booleanToValue: {
70
- true: number;
71
- false: number;
72
- };
73
- export declare const nonActionColumn: string[];
@@ -1,247 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.nonActionColumn = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
7
- const defaultWidth = exports.defaultWidth = 100;
8
- const defaultRowHeight = exports.defaultRowHeight = 35;
9
- const numberOperator = exports.numberOperator = [{
10
- value: 'equal',
11
- label: 'Equal',
12
- key: '=='
13
- }, {
14
- value: 'greaterthan',
15
- label: 'Greater than',
16
- key: '>'
17
- }, {
18
- value: 'greaterthanorequal',
19
- label: 'Greater than or equal',
20
- key: '>='
21
- }, {
22
- value: 'lessthan',
23
- label: 'Less than',
24
- key: '<'
25
- }, {
26
- value: 'lessthanorequal',
27
- label: 'Less than or equal',
28
- key: '<='
29
- }, {
30
- value: 'notequal',
31
- label: 'Not equal',
32
- key: '!='
33
- }];
34
- const stringOperator = exports.stringOperator = [{
35
- value: 'startswith',
36
- key: '_=',
37
- label: 'Starts with'
38
- }, {
39
- value: 'endswith',
40
- key: '|=',
41
- label: 'Ends with'
42
- }, {
43
- value: 'contains',
44
- key: '~=',
45
- label: 'Contains'
46
- }, {
47
- value: 'equal',
48
- key: '==',
49
- label: 'Equal'
50
- }, {
51
- value: 'notequal',
52
- key: '!=',
53
- label: 'Not equal'
54
- }];
55
- const dateOperator = exports.dateOperator = [{
56
- value: 'equal',
57
- key: '==',
58
- label: 'Equal'
59
- }, {
60
- value: 'notequal',
61
- key: '!=',
62
- label: 'Not equal'
63
- }, {
64
- value: 'greaterthan',
65
- key: '>',
66
- label: 'Greater than'
67
- }, {
68
- value: 'lessthan',
69
- key: '<',
70
- label: 'Less than'
71
- }];
72
- const dateTimeOperator = exports.dateTimeOperator = [{
73
- value: 'equal',
74
- key: '==',
75
- label: 'Equal'
76
- }, {
77
- value: 'notequal',
78
- key: '!=',
79
- label: 'Not equal'
80
- }, {
81
- value: 'greaterthan',
82
- key: '>',
83
- label: 'Greater than'
84
- }, {
85
- value: 'lessthan',
86
- key: '<',
87
- label: 'Less than'
88
- }];
89
- const booleanOperator = exports.booleanOperator = [{
90
- value: 'equal',
91
- key: '==',
92
- label: 'Equal'
93
- }, {
94
- value: 'notequal',
95
- key: '!=',
96
- label: 'Not equal'
97
- }];
98
- const translateOption = (options, t) => {
99
- if (!t) {
100
- return options;
101
- }
102
- return options.map(it => ({
103
- ...it,
104
- label: t(it.label)
105
- }));
106
- };
107
- exports.translateOption = translateOption;
108
- const transferFontSize = exports.transferFontSize = {
109
- 6: 8,
110
- 7: 9,
111
- 8: 11,
112
- 9: 12,
113
- 10: 13,
114
- 11: 15,
115
- 12: 16,
116
- 13: 17,
117
- 14: 19,
118
- 15: 20,
119
- 16: 21,
120
- 17: 23,
121
- 18: 24,
122
- 19: 25,
123
- 20: 27,
124
- 21: 28,
125
- 22: 29,
126
- 24: 32,
127
- 26: 35,
128
- 27: 36,
129
- 28: 37
130
- };
131
- const defaultDateFormat = exports.defaultDateFormat = 'd/m/Y';
132
- const defaultDateTimeFormat = exports.defaultDateTimeFormat = 'd/m/Y H:i';
133
- const defaultTimeFormat = exports.defaultTimeFormat = 'H:i';
134
- const defaultPageSizes = exports.defaultPageSizes = [20, 30, 50, 100];
135
- const alignToFlex = exports.alignToFlex = {
136
- center: 'center',
137
- left: 'start',
138
- right: 'end'
139
- };
140
- const optionsSize = exports.optionsSize = [{
141
- label: 'letter',
142
- value: 'letter',
143
- width: 21.59,
144
- height: 27.94
145
- }, {
146
- label: 'A3',
147
- value: 'a3',
148
- width: 27.94,
149
- height: 42
150
- }, {
151
- label: 'A4',
152
- value: 'a4',
153
- width: 21,
154
- height: 29.7
155
- }];
156
- const paperSize = exports.paperSize = {
157
- a4: {
158
- width: 21,
159
- height: 29.7
160
- },
161
- a3: {
162
- width: 27.94,
163
- height: 42
164
- },
165
- letter: {
166
- width: 21.59,
167
- height: 27.94
168
- }
169
- };
170
- const optionFont = exports.optionFont = [{
171
- value: 'Times New Roman',
172
- label: 'Times New Roman'
173
- }, {
174
- value: 'Calibri',
175
- label: 'Calibri (Body)'
176
- }];
177
- // portrait' | 'landscape'
178
- const optionsPaperOrientation = exports.optionsPaperOrientation = [{
179
- value: 'portrait',
180
- label: 'portrait'
181
- }, {
182
- value: 'landscape',
183
- label: 'landscape'
184
- }];
185
- const optionFontSize = exports.optionFontSize = [{
186
- value: 8,
187
- label: '8'
188
- }, {
189
- value: 9,
190
- label: '9'
191
- }, {
192
- value: 10,
193
- label: '10'
194
- }, {
195
- value: 11,
196
- label: '11'
197
- }, {
198
- value: 12,
199
- label: '12'
200
- }, {
201
- value: 13,
202
- label: '13'
203
- }, {
204
- value: 14,
205
- label: '14'
206
- }, {
207
- value: 16,
208
- label: '16'
209
- }, {
210
- value: 18,
211
- label: '18'
212
- }, {
213
- value: 24,
214
- label: '24'
215
- }, {
216
- value: 36,
217
- label: '36'
218
- }, {
219
- value: 48,
220
- label: '48'
221
- }];
222
-
223
- /**
224
- * Sort order for BaseTable
225
- */
226
- const SortOrder = {
227
- /**
228
- * Sort data in ascending order
229
- */
230
- ascend: 'Ascending',
231
- /**
232
- * Sort data in descending order
233
- */
234
- descend: 'Descending'
235
- };
236
- var _default = exports.default = SortOrder;
237
- const valueToBoolean = exports.valueToBoolean = {
238
- true: true,
239
- false: false,
240
- 1: true,
241
- 0: false
242
- };
243
- const booleanToValue = exports.booleanToValue = {
244
- true: 1,
245
- false: 0
246
- };
247
- const nonActionColumn = exports.nonActionColumn = ['#', 'command', 'selection_column'];
@@ -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;
@@ -1,95 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _TableBodyRow = _interopRequireDefault(require("./TableBodyRow"));
10
- var _reactVirtual = require("@tanstack/react-virtual");
11
- var _react = _interopRequireWildcard(require("react"));
12
- var _useContext = require("../useContext");
13
- var _rcMasterUi = require("rc-master-ui");
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- // import type { Virtualizer } from "@tanstack/react-virtual";
17
-
18
- // import type { Dispatch, SetStateAction } from "react";
19
-
20
- const TableBody = ({
21
- columnVirtualizer,
22
- table,
23
- tableContainerRef,
24
- virtualPaddingLeft,
25
- virtualPaddingRight,
26
- fixedLeftColumns,
27
- fixedRightColumns,
28
- tableId,
29
- showEmptyText,
30
- ...rest
31
- }) => {
32
- const {
33
- rows
34
- } = table.getRowModel();
35
- const {
36
- editingKey,
37
- prefix,
38
- locale
39
- } = _react.default.useContext(_useContext.TableContext);
40
-
41
- //dynamic row height virtualization - alternatively you could use a simpler fixed row height strategy without the need for `measureElement`
42
- const rowVirtualizer = (0, _reactVirtual.useVirtualizer)({
43
- count: rows.length,
44
- estimateSize: () => 36,
45
- //estimate row height for accurate scrollbar dragging
46
- getScrollElement: () => tableContainerRef.current,
47
- //measure dynamic row height, except in firefox because it measures table border height incorrectly
48
- measureElement: typeof window !== 'undefined' && navigator.userAgent.indexOf('Firefox') === -1 ? element => element?.getBoundingClientRect().height : undefined,
49
- overscan: 1
50
- });
51
- const virtualRows = rowVirtualizer.getVirtualItems();
52
- return /*#__PURE__*/_react.default.createElement("div", {
53
- className: `${prefix}-grid-tbody`,
54
- style: {
55
- display: 'grid',
56
- // height: `${rowVirtualizer.getTotalSize()}px`, //tells scrollbar how big the table is
57
- height: showEmptyText && rows.length === 0 ? `140px` : `${rowVirtualizer.getTotalSize()}px`,
58
- //tells scrollbar how big the table is
59
- position: 'relative' //needed for absolute positioning of rows
60
- }
61
- }, showEmptyText && rows.length === 0 ? /*#__PURE__*/_react.default.createElement("tr", {
62
- style: {
63
- // transform: `translateY(${virtualRow.start}px)`, //this should always be a `style` as it changes on scroll
64
- }
65
- }, /*#__PURE__*/_react.default.createElement("td", {
66
- // colSpan={30}
67
- style: {
68
- position: "sticky",
69
- left: 0,
70
- width: tableContainerRef.current?.clientWidth,
71
- overflow: 'hidden'
72
- }
73
- }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Empty, {
74
- image: _rcMasterUi.Empty.PRESENTED_IMAGE_SIMPLE,
75
- description: locale?.emptyText
76
- })))) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, virtualRows.map(virtualRow => {
77
- const row = rows[virtualRow.index];
78
- const isEditing = row.id === editingKey;
79
- return /*#__PURE__*/_react.default.createElement(_TableBodyRow.default, (0, _extends2.default)({}, rest, {
80
- table: table,
81
- tableId: tableId,
82
- key: row.id,
83
- row: row,
84
- columnVirtualizer: columnVirtualizer,
85
- rowVirtualizer: rowVirtualizer,
86
- virtualPaddingLeft: virtualPaddingLeft,
87
- virtualPaddingRight: virtualPaddingRight,
88
- virtualRow: virtualRow,
89
- fixedLeftColumns: fixedLeftColumns,
90
- fixedRightColumns: fixedRightColumns,
91
- isEditing: isEditing
92
- }));
93
- })));
94
- };
95
- var _default = exports.default = TableBody;