@jiaozhiye/qm-design-react 1.0.0-beta.1

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/LICENSE +21 -0
  2. package/README.md +4 -0
  3. package/lib/_utils/cloneElement.d.ts +2 -0
  4. package/lib/_utils/dom.d.ts +68 -0
  5. package/lib/_utils/download.d.ts +7 -0
  6. package/lib/_utils/error.d.ts +2 -0
  7. package/lib/_utils/isServer.d.ts +2 -0
  8. package/lib/_utils/prefix.d.ts +1 -0
  9. package/lib/_utils/resize-event.d.ts +10 -0
  10. package/lib/_utils/scrollbar-width.d.ts +1 -0
  11. package/lib/_utils/types.d.ts +33 -0
  12. package/lib/_utils/util.d.ts +23 -0
  13. package/lib/_utils/validators.d.ts +2 -0
  14. package/lib/anchor/index.d.ts +4 -0
  15. package/lib/anchor/src/anchor-item.d.ts +13 -0
  16. package/lib/anchor/src/anchor-nav.d.ts +12 -0
  17. package/lib/anchor/src/anchor.d.ts +52 -0
  18. package/lib/anchor/style/index.less +60 -0
  19. package/lib/antd/Calendar.d.ts +4 -0
  20. package/lib/antd/DatePicker.d.ts +11 -0
  21. package/lib/antd/TimePicker.d.ts +14 -0
  22. package/lib/antd/index.d.ts +123 -0
  23. package/lib/antd/index.less +7 -0
  24. package/lib/button/index.d.ts +3 -0
  25. package/lib/button/src/button.d.ts +30 -0
  26. package/lib/button/style/index.less +12 -0
  27. package/lib/config-provider/context.d.ts +9 -0
  28. package/lib/config-provider/index.d.ts +3 -0
  29. package/lib/config-provider/src/config-provider.d.ts +34 -0
  30. package/lib/countup/index.d.ts +3 -0
  31. package/lib/countup/src/countup.d.ts +17 -0
  32. package/lib/countup/style/index.less +22 -0
  33. package/lib/cropper/index.d.ts +3 -0
  34. package/lib/cropper/src/cropper.d.ts +213 -0
  35. package/lib/cropper/style/index.less +13 -0
  36. package/lib/divider/index.d.ts +3 -0
  37. package/lib/divider/src/divider.d.ts +25 -0
  38. package/lib/divider/style/index.less +54 -0
  39. package/lib/download/index.d.ts +3 -0
  40. package/lib/download/src/download.d.ts +51 -0
  41. package/lib/download/style/index.less +12 -0
  42. package/lib/drawer/index.d.ts +3 -0
  43. package/lib/drawer/src/drawer.d.ts +33 -0
  44. package/lib/drawer/style/index.less +77 -0
  45. package/lib/empty/index.d.ts +3 -0
  46. package/lib/empty/src/empty.d.ts +15 -0
  47. package/lib/empty/style/index.less +35 -0
  48. package/lib/form/index.d.ts +4 -0
  49. package/lib/form/src/china-data.d.ts +4577 -0
  50. package/lib/form/src/context.d.ts +6 -0
  51. package/lib/form/src/fields-filter.d.ts +26 -0
  52. package/lib/form/src/form-cascader.d.ts +21 -0
  53. package/lib/form/src/form-checkbox-group.d.ts +18 -0
  54. package/lib/form/src/form-checkbox.d.ts +10 -0
  55. package/lib/form/src/form-city-select.d.ts +10 -0
  56. package/lib/form/src/form-date.d.ts +10 -0
  57. package/lib/form/src/form-divider.d.ts +10 -0
  58. package/lib/form/src/form-immediate.d.ts +10 -0
  59. package/lib/form/src/form-input-number.d.ts +10 -0
  60. package/lib/form/src/form-input.d.ts +10 -0
  61. package/lib/form/src/form-radio.d.ts +18 -0
  62. package/lib/form/src/form-range-date.d.ts +10 -0
  63. package/lib/form/src/form-range-input-number.d.ts +10 -0
  64. package/lib/form/src/form-range-input.d.ts +10 -0
  65. package/lib/form/src/form-range-time.d.ts +10 -0
  66. package/lib/form/src/form-region-select.d.ts +10 -0
  67. package/lib/form/src/form-search-helper.d.ts +10 -0
  68. package/lib/form/src/form-select.d.ts +21 -0
  69. package/lib/form/src/form-switch.d.ts +10 -0
  70. package/lib/form/src/form-text-area.d.ts +10 -0
  71. package/lib/form/src/form-time.d.ts +10 -0
  72. package/lib/form/src/form-tinymce.d.ts +10 -0
  73. package/lib/form/src/form-tree-select.d.ts +23 -0
  74. package/lib/form/src/form-upload-file.d.ts +18 -0
  75. package/lib/form/src/form-upload-img.d.ts +18 -0
  76. package/lib/form/src/form.d.ts +169 -0
  77. package/lib/form/src/types.d.ts +251 -0
  78. package/lib/form/src/utils.d.ts +7 -0
  79. package/lib/form/style/index.less +243 -0
  80. package/lib/hooks/useForceUpdate.d.ts +1 -0
  81. package/lib/hooks/useOutsideClick.d.ts +2 -0
  82. package/lib/hooks/useResizeObserve.d.ts +5 -0
  83. package/lib/hooks/useUpdateEffect.d.ts +2 -0
  84. package/lib/index.d.ts +42 -0
  85. package/lib/index.esm.js +16 -0
  86. package/lib/index.full.js +1 -0
  87. package/lib/index.js +16 -0
  88. package/lib/locale/index.d.ts +11 -0
  89. package/lib/locale/index.js +51 -0
  90. package/lib/locale/lang/en.d.ts +243 -0
  91. package/lib/locale/lang/en.js +248 -0
  92. package/lib/locale/lang/zh-cn.d.ts +243 -0
  93. package/lib/locale/lang/zh-cn.js +248 -0
  94. package/lib/modal/index.d.ts +3 -0
  95. package/lib/modal/src/modal.d.ts +38 -0
  96. package/lib/modal/style/index.less +89 -0
  97. package/lib/pinyin/core.d.ts +12 -0
  98. package/lib/pinyin/dict.d.ts +31 -0
  99. package/lib/pinyin/index.d.ts +2 -0
  100. package/lib/pinyin/patchers/56l.d.ts +7 -0
  101. package/lib/qm-design.d.ts +28 -0
  102. package/lib/search-helper/index.d.ts +3 -0
  103. package/lib/search-helper/src/search-helper.d.ts +20 -0
  104. package/lib/search-helper/style/index.less +13 -0
  105. package/lib/space/index.d.ts +3 -0
  106. package/lib/space/src/space.d.ts +12 -0
  107. package/lib/space/style/index.less +12 -0
  108. package/lib/spin/index.d.ts +3 -0
  109. package/lib/spin/src/spin.d.ts +11 -0
  110. package/lib/spin/style/index.less +12 -0
  111. package/lib/split/index.d.ts +4 -0
  112. package/lib/split/src/context.d.ts +8 -0
  113. package/lib/split/src/resize-bar.d.ts +8 -0
  114. package/lib/split/src/split-pane.d.ts +9 -0
  115. package/lib/split/src/split.d.ts +14 -0
  116. package/lib/split/style/index.less +86 -0
  117. package/lib/style/common.less +8 -0
  118. package/lib/style/index.css +1 -0
  119. package/lib/style/index.less +32 -0
  120. package/lib/style/mixins/box.less +13 -0
  121. package/lib/style/mixins/clearfix.less +21 -0
  122. package/lib/style/mixins/index.less +11 -0
  123. package/lib/style/mixins/operation-unit.less +24 -0
  124. package/lib/style/mixins/reset.less +35 -0
  125. package/lib/style/mixins/size.less +15 -0
  126. package/lib/style/reset.less +134 -0
  127. package/lib/style/themes/default.less +113 -0
  128. package/lib/style/themes/index.less +7 -0
  129. package/lib/table/index.d.ts +4 -0
  130. package/lib/table/src/alert/index.d.ts +6 -0
  131. package/lib/table/src/body/index.d.ts +8 -0
  132. package/lib/table/src/body/useValueFormat.d.ts +12 -0
  133. package/lib/table/src/column-filter/index.d.ts +7 -0
  134. package/lib/table/src/config/index.d.ts +47 -0
  135. package/lib/table/src/context/index.d.ts +74 -0
  136. package/lib/table/src/edit/InputNumber.d.ts +17 -0
  137. package/lib/table/src/edit/index.d.ts +12 -0
  138. package/lib/table/src/empty/index.d.ts +3 -0
  139. package/lib/table/src/expandable/index.d.ts +8 -0
  140. package/lib/table/src/export/define.d.ts +8 -0
  141. package/lib/table/src/export/index.d.ts +18 -0
  142. package/lib/table/src/export/setting.d.ts +8 -0
  143. package/lib/table/src/export/useExport.d.ts +9 -0
  144. package/lib/table/src/filter/index.d.ts +8 -0
  145. package/lib/table/src/filter-sql/index.d.ts +5 -0
  146. package/lib/table/src/filter-sql/lib/filter_string.d.ts +11 -0
  147. package/lib/table/src/filter-sql/lib/operations.d.ts +8 -0
  148. package/lib/table/src/filter-sql/lib/variables_replacement.d.ts +5 -0
  149. package/lib/table/src/footer/index.d.ts +8 -0
  150. package/lib/table/src/full-screen/index.d.ts +6 -0
  151. package/lib/table/src/group-summary/index.d.ts +3 -0
  152. package/lib/table/src/group-summary/result.d.ts +9 -0
  153. package/lib/table/src/group-summary/setting.d.ts +6 -0
  154. package/lib/table/src/header/index.d.ts +10 -0
  155. package/lib/table/src/hooks/useImperativeMethod.d.ts +36 -0
  156. package/lib/table/src/hooks/useTableCore.d.ts +86 -0
  157. package/lib/table/src/hooks/useTableEffect.d.ts +35 -0
  158. package/lib/table/src/hooks/useTableLayout.d.ts +39 -0
  159. package/lib/table/src/hooks/useTableMemo.d.ts +43 -0
  160. package/lib/table/src/hooks/useTableRef.d.ts +89 -0
  161. package/lib/table/src/hooks/useTableState.d.ts +94 -0
  162. package/lib/table/src/icon/caretdown.d.ts +3 -0
  163. package/lib/table/src/icon/caretup.d.ts +3 -0
  164. package/lib/table/src/icon/filter.d.ts +3 -0
  165. package/lib/table/src/manager/index.d.ts +15 -0
  166. package/lib/table/src/pager/index.d.ts +11 -0
  167. package/lib/table/src/print/index.d.ts +7 -0
  168. package/lib/table/src/reload/index.d.ts +3 -0
  169. package/lib/table/src/resizable/index.d.ts +7 -0
  170. package/lib/table/src/select-collection/index.d.ts +7 -0
  171. package/lib/table/src/select-collection/result.d.ts +8 -0
  172. package/lib/table/src/selection/all.d.ts +7 -0
  173. package/lib/table/src/selection/index.d.ts +12 -0
  174. package/lib/table/src/store/index.d.ts +29 -0
  175. package/lib/table/src/super-search/index.d.ts +3 -0
  176. package/lib/table/src/super-search/result.d.ts +6 -0
  177. package/lib/table/src/table/index.d.ts +5 -0
  178. package/lib/table/src/table/props.d.ts +243 -0
  179. package/lib/table/src/table/types.d.ts +335 -0
  180. package/lib/table/src/utils/index.d.ts +37 -0
  181. package/lib/table/style/alert.less +34 -0
  182. package/lib/table/style/body.less +42 -0
  183. package/lib/table/style/column-filter.less +88 -0
  184. package/lib/table/style/empty.less +16 -0
  185. package/lib/table/style/expandable.less +55 -0
  186. package/lib/table/style/export.less +30 -0
  187. package/lib/table/style/footer.less +28 -0
  188. package/lib/table/style/full-screen.less +21 -0
  189. package/lib/table/style/group-summary.less +93 -0
  190. package/lib/table/style/header.less +178 -0
  191. package/lib/table/style/index.less +25 -0
  192. package/lib/table/style/pager.less +12 -0
  193. package/lib/table/style/print.less +21 -0
  194. package/lib/table/style/reload.less +21 -0
  195. package/lib/table/style/select-collection.less +21 -0
  196. package/lib/table/style/size.less +69 -0
  197. package/lib/table/style/super-search.less +102 -0
  198. package/lib/table/style/table.less +328 -0
  199. package/lib/table/style/toper.less +28 -0
  200. package/lib/table/style/variable.less +48 -0
  201. package/lib/tabs/index.d.ts +4 -0
  202. package/lib/tabs/src/tab-pane.d.ts +8 -0
  203. package/lib/tabs/src/tabs.d.ts +16 -0
  204. package/lib/tabs/style/index.less +22 -0
  205. package/lib/tinymce/index.d.ts +3 -0
  206. package/lib/tinymce/src/Events.d.ts +78 -0
  207. package/lib/tinymce/src/ScriptLoader.d.ts +13 -0
  208. package/lib/tinymce/src/TinyMCE.d.ts +2 -0
  209. package/lib/tinymce/src/Utils.d.ts +19 -0
  210. package/lib/tinymce/src/components/Editor.d.ts +66 -0
  211. package/lib/tinymce/src/components/EditorPropTypes.d.ts +18 -0
  212. package/lib/tinymce/src/index.d.ts +29 -0
  213. package/lib/tinymce/style/index.less +18 -0
  214. package/lib/upload-file/index.d.ts +3 -0
  215. package/lib/upload-file/src/upload-file.d.ts +16 -0
  216. package/lib/upload-file/style/index.less +12 -0
  217. package/lib/upload-img/index.d.ts +3 -0
  218. package/lib/upload-img/src/cropper-preview.d.ts +30 -0
  219. package/lib/upload-img/src/upload-img.d.ts +27 -0
  220. package/lib/upload-img/style/index.less +36 -0
  221. package/lib/version/index.d.ts +2 -0
  222. package/package.json +136 -0
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { IColumn, IFilter } from '../table/types';
3
+ declare type IHeadFilterProps = {
4
+ column: IColumn;
5
+ filters: IFilter;
6
+ };
7
+ declare const HeadFilter: React.FC<IHeadFilterProps>;
8
+ export default HeadFilter;
@@ -0,0 +1,5 @@
1
+ import type { IRecord } from '../table/types';
2
+ export declare const stringify: (string: any, separator?: string) => any;
3
+ export declare const array_format: (array: any) => string;
4
+ export declare const isBracketBalance: (str: any) => boolean;
5
+ export declare const where: <T extends IRecord<any>>(array: T[], query: string) => T[];
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ operations: (string: any) => any[];
3
+ number_operations: (string: any) => any;
4
+ string_format: (string: any) => any;
5
+ stringify: (string: any, separator?: string) => any;
6
+ array_format: (array: any) => string;
7
+ operation_format: (string: any) => any;
8
+ find_replace: (string: any, find: any, replace: any) => any;
9
+ replace_symbols: (string: any) => any;
10
+ };
11
+ export default _default;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 解析 where 条件的各种情况
3
+ * @param {any} value 数据值
4
+ * @param {string} expression 标记符
5
+ * @param {any} condition 条件值
6
+ * @returns {boolean}
7
+ */
8
+ export declare const matchWhere: (value: any, expression: string, condition: any) => boolean;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ isBracketBalance: (str: any) => boolean;
3
+ replace_variables: (string: any, variable: any) => any;
4
+ };
5
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { IColumn } from '../table/types';
3
+ declare type IFootProps = {
4
+ summationRows: Record<string, string | number>[];
5
+ flattenColumns: IColumn[];
6
+ };
7
+ declare const TableFooter: React.FC<IFootProps>;
8
+ export default TableFooter;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare type IFullScreenProps = {
3
+ isFullScreen: boolean;
4
+ };
5
+ declare const FullScreen: React.FC<IFullScreenProps>;
6
+ export default FullScreen;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const GroupSummary: React.FC;
3
+ export default GroupSummary;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { IColumn, IRecord } from '../table/types';
3
+ declare type IResultProps = {
4
+ columns: IColumn[];
5
+ group: IRecord[];
6
+ summary: IRecord[];
7
+ };
8
+ declare const Result: React.FC<IResultProps>;
9
+ export default Result;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare type ISettingProps = {
3
+ onClose: () => void;
4
+ };
5
+ declare const Setting: React.FC<ISettingProps>;
6
+ export default Setting;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { IColumn, IFilter, ISorter } from '../table/types';
3
+ declare type IHeaderProps = {
4
+ tableColumns: IColumn[];
5
+ flattenColumns: IColumn[];
6
+ sorter: ISorter;
7
+ filters: IFilter;
8
+ };
9
+ declare const TableHeader: React.FC<IHeaderProps>;
10
+ export default TableHeader;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import type { ITableRef } from './useTableRef';
3
+ import type { getRowKeyType, IColumn, IFetchParams, IPagination, IRecord, IRowKey, IRule, IValidItem, TableBodyRef, TableRef } from '../table/types';
4
+ declare type IExtra = {
5
+ getRowKey: getRowKeyType;
6
+ tableRef: React.MutableRefObject<ITableRef>;
7
+ tableBodyRef: React.RefObject<TableBodyRef>;
8
+ flattenColumns: IColumn[];
9
+ editableColumns: IColumn[];
10
+ pagination: IPagination;
11
+ fetchParams: IFetchParams;
12
+ isFetch: boolean;
13
+ dataChange: () => void;
14
+ getTableData: () => Promise<void>;
15
+ createTableData: (records: IRecord[]) => void;
16
+ calcTableHeight: () => void;
17
+ scrollXToColumn: (dataIndex: string, index?: number) => void;
18
+ scrollYToRecord: (rowKey: IRowKey, index?: number) => void;
19
+ doFieldValidate: (rules: IRule[], val: unknown, rowKey: IRowKey, columnKey: string) => void;
20
+ setHandleState: (option: ITableRef['handleState']) => void;
21
+ getTableLog: () => {
22
+ required: IValidItem[];
23
+ validate: IValidItem[];
24
+ inserted: IValidItem[];
25
+ updated: IValidItem[];
26
+ removed: IValidItem[];
27
+ };
28
+ clearRowSelection: () => void;
29
+ clearRowHighlight: () => void;
30
+ clearTableSorter: () => void;
31
+ clearTableFilter: () => void;
32
+ clearSuperFilters: () => void;
33
+ clearTableLog: () => void;
34
+ };
35
+ declare const useImperativeMethod: <T extends React.ForwardedRef<TableRef>>(ref: T, extra: IExtra) => void;
36
+ export default useImperativeMethod;
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import type { ITableRef } from './useTableRef';
3
+ import type { ITableState } from './useTableState';
4
+ import type { getRowKeyType, IColumn, IDerivedRowKey, IFetchParams, IFilter, IPagination, IRecord, IRowKey, IRule, ISorter, ISuperFilter, ITableProps, IValidItem, TableBodyRef } from '../table/types';
5
+ import type { ComponentSize } from '../../../_utils/types';
6
+ declare type IExtra = {
7
+ getRowKey: getRowKeyType;
8
+ tableRef: React.MutableRefObject<ITableRef>;
9
+ tableElementRef: React.RefObject<HTMLElement>;
10
+ tableBodyRef: React.RefObject<TableBodyRef>;
11
+ $size: ComponentSize;
12
+ tableColumns: IColumn[];
13
+ tableFullData: IRecord[];
14
+ pagination: IPagination;
15
+ filters: IFilter;
16
+ sorter: ISorter;
17
+ superFilters: ISuperFilter[];
18
+ fetchParams: IFetchParams;
19
+ selectionKeys: IRowKey[];
20
+ highlightKey: IRowKey;
21
+ summationColumns: IColumn[];
22
+ shouldUpdateHeight: boolean;
23
+ isFetch: boolean;
24
+ isTreeTable: boolean;
25
+ isWebPagination: boolean;
26
+ isScrollPagination: boolean;
27
+ isServiceSummation: boolean;
28
+ isGroupSubtotal: boolean;
29
+ doLayout: () => void;
30
+ calcTableHeight: () => void;
31
+ setTableData: (records: IRecord[]) => void;
32
+ setTableFullData: (records: IRecord[]) => void;
33
+ setTableOriginData: (records: IRecord[]) => void;
34
+ setAllTableData: (records: IRecord[]) => void;
35
+ setDeriveRowKeys: (records: IRecord[]) => void;
36
+ setPagination: <T extends IPagination>(pagination: T | ((prev: T) => T)) => void;
37
+ setSpinning: (value: boolean) => void;
38
+ setSorter: (sorter: ITableState['sorter']) => void;
39
+ setFilters: (sorter: ITableState['filters']) => void;
40
+ setSuperFilters: (options: ITableState['superFilters']) => void;
41
+ setSelectionKeys: (rowKeys: IRowKey[]) => void;
42
+ setHighlightKey: (rowKey: IRowKey) => void;
43
+ setScrollYLoad: (scrollYLoad: boolean) => void;
44
+ setScrollYStore: (option: ITableRef['scrollYStore']) => void;
45
+ setResizeState: (option: ITableRef['resizeState']) => void;
46
+ setSummaries: (option: ITableRef['summaries']) => void;
47
+ setPermission: <T extends ITableState['permission']>(option: T | ((prev: T) => T)) => void;
48
+ setRowKeysMap: (key: IRowKey, value: number) => void;
49
+ resetTableScroll: () => void;
50
+ clearElementStore: () => void;
51
+ clearAllRowKeysMap: () => void;
52
+ };
53
+ declare const useTableCore: <T extends ITableProps>(props: T, extra: IExtra) => {
54
+ initialTable: () => void;
55
+ createTableFullData: (list: IRecord[]) => void;
56
+ getTableData: () => Promise<void>;
57
+ createTableData: (list: IRecord[]) => void;
58
+ createGroupData: (list: IRecord[]) => IRecord<any>[];
59
+ createSelectionKeys: () => (string | number)[];
60
+ createSelectionRows: (selectedKeys: IRowKey[]) => IRecord<any>[];
61
+ createRowExpandedKeys: () => (string | number)[];
62
+ findParentRowKeys: (deriveRowKeys: IDerivedRowKey[], key: IRowKey) => (string | number)[];
63
+ getAllChildRowKeys: (deriveRowKeys: IDerivedRowKey[]) => (string | number)[];
64
+ doFieldValidate: (rules: IRule[], val: unknown, rowKey: IRowKey, columnKey: string) => void;
65
+ getTableLog: () => {
66
+ required: IValidItem[];
67
+ validate: IValidItem[];
68
+ inserted: IValidItem[];
69
+ updated: IValidItem[];
70
+ removed: IValidItem[];
71
+ };
72
+ dataChange: () => void;
73
+ tableChange: import("lodash").DebouncedFunc<(backTop?: boolean) => void>;
74
+ toLastPage: () => void;
75
+ pagerChangeHandle: ({ current, pageSize }: Omit<IPagination, 'total'>) => void;
76
+ triggerScrollYEvent: (st: number) => void;
77
+ scrollBottomDebouncer: import("lodash").DebouncedFunc<(ev: React.SyntheticEvent<HTMLDivElement>) => void>;
78
+ clearTableSorter: () => void;
79
+ clearTableFilter: () => void;
80
+ clearSuperFilters: () => void;
81
+ clearRowSelection: () => void;
82
+ clearRowHighlight: () => void;
83
+ clearTableLog: () => void;
84
+ destroy: () => void;
85
+ };
86
+ export default useTableCore;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import type { ITableRef } from './useTableRef';
3
+ import type { TableBodyRef, IColumn, IPagination, IRecord, IRowKey, ITableProps } from '../table/types';
4
+ declare type IExtra = {
5
+ tableRef: React.MutableRefObject<ITableRef>;
6
+ topElementRef: React.RefObject<HTMLDivElement>;
7
+ tableElementRef: React.RefObject<HTMLDivElement>;
8
+ tableBodyRef: React.RefObject<TableBodyRef>;
9
+ resizableBarRef: React.RefObject<HTMLDivElement>;
10
+ pagination: IPagination;
11
+ selectionKeys: IRowKey[];
12
+ rowExpandedKeys: IRowKey[];
13
+ highlightKey: IRowKey;
14
+ summationRows: Record<string, number | string>[];
15
+ isWebPagination: boolean;
16
+ isScrollPagination: boolean;
17
+ isTreeTable: boolean;
18
+ toLastPage: () => void;
19
+ setHandleState: (option: ITableRef['handleState']) => void;
20
+ scrollYToRecord: (rowKey: IRowKey, index?: number) => void;
21
+ setOriginColumns: (columns: IColumn[]) => void;
22
+ setSelectionKeys: (rowKeys: IRowKey[]) => void;
23
+ setSelectionRows: (records: IRecord[]) => void;
24
+ setRowExpandedKeys: (rowKeys: IRowKey[]) => void;
25
+ setHighlightKey: (rowKey: IRowKey) => void;
26
+ createSelectionKeys: () => IRowKey[];
27
+ createSelectionRows: (rowKeys: IRowKey[]) => IRecord[];
28
+ createRowExpandedKeys: () => IRowKey[];
29
+ createElementStore: (option: Record<string, HTMLElement>) => void;
30
+ triggerScrollYEvent: (st: number) => void;
31
+ initialTable: () => void;
32
+ destroy: () => void;
33
+ };
34
+ declare const useTableEffect: <T extends ITableProps>(props: T, extra: IExtra) => void;
35
+ export default useTableEffect;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import type { IColumn, IRecord, IRowKey, ITableProps } from '../table/types';
3
+ import type { ITableState } from './useTableState';
4
+ import type { ITableRef } from './useTableRef';
5
+ import type { ComponentSize } from '../../../_utils/types';
6
+ declare type IExtra = {
7
+ tableRef: React.MutableRefObject<ITableRef>;
8
+ $size: ComponentSize;
9
+ tableColumns: IColumn[];
10
+ flattenColumns: IColumn[];
11
+ leftFixedColumns: IColumn[];
12
+ layout: ITableState['layout'];
13
+ scrollY: boolean;
14
+ showFooter: boolean;
15
+ showPagination: boolean;
16
+ isFullScreen: boolean;
17
+ setLayout: <T extends ITableState['layout']>(layout: T | ((prev: T) => T)) => void;
18
+ setScrollX: (scrollX: boolean) => void;
19
+ setScrollY: (scrollY: boolean) => void;
20
+ setElementStore: (key: string, value: HTMLElement) => void;
21
+ setScrollYStore: (option: ITableRef['scrollYStore']) => void;
22
+ };
23
+ declare const useTableLayout: <T extends ITableProps>(props: T, extra: IExtra) => {
24
+ createElementStore: (option: Record<string, HTMLElement>) => void;
25
+ tableStyles: React.CSSProperties;
26
+ updateColumnsWidth: () => void;
27
+ getSpan: (row: IRecord, column: IColumn, rowIndex: number, columnIndex: number, tableData: IRecord[]) => {
28
+ rowSpan: number;
29
+ colSpan: number;
30
+ };
31
+ getStickyLeft: (rowKey: IRowKey) => number;
32
+ getStickyRight: (rowKey: IRowKey) => number;
33
+ scrollXToColumn: (dataIndex: string, index?: number | undefined) => void;
34
+ scrollYToRecord: (rowKey: IRowKey, index?: number | undefined) => void;
35
+ calcTableHeight: () => void;
36
+ resetTableScroll: () => void;
37
+ doLayout: () => void;
38
+ };
39
+ export default useTableLayout;
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import type { ITableProps, IColumn, IRecord, IRowKey, getRowKeyType, IFetchParams, ISorter, IFilter, IPagination, ISuperFilter } from '../table/types';
3
+ import type { ITableRef } from './useTableRef';
4
+ declare type IExtra = {
5
+ getRowKey: getRowKeyType;
6
+ tableRef: React.MutableRefObject<ITableRef>;
7
+ tableFullData: IRecord[];
8
+ tableData: IRecord[];
9
+ sorter: ISorter;
10
+ filters: IFilter;
11
+ superFilters: ISuperFilter[];
12
+ pagination: IPagination;
13
+ selectionKeys: IRowKey[];
14
+ };
15
+ declare const useTableMemo: <T extends ITableProps>(props: T, extra: IExtra) => {
16
+ isFetch: boolean;
17
+ isWebPagination: boolean;
18
+ isScrollPagination: boolean;
19
+ showPagination: boolean;
20
+ shouldUpdateHeight: boolean;
21
+ tableColumns: IColumn[];
22
+ flattenColumns: IColumn[];
23
+ editableColumns: IColumn[];
24
+ summationColumns: IColumn[];
25
+ leftFixedColumns: IColumn[];
26
+ rightFixedColumns: IColumn[];
27
+ showSummary: boolean;
28
+ showFooter: boolean;
29
+ isHeadGroup: boolean;
30
+ bordered: boolean;
31
+ isHeadSorter: boolean;
32
+ isHeadFilter: boolean;
33
+ isServiceSummation: boolean;
34
+ isSelectCollection: boolean;
35
+ isSuperSearch: boolean;
36
+ isGroupSummary: boolean;
37
+ isGroupSubtotal: boolean;
38
+ isTreeTable: boolean;
39
+ isTableEmpty: boolean;
40
+ summationRows: Record<string, string | number>[];
41
+ fetchParams: IFetchParams;
42
+ };
43
+ export default useTableMemo;
@@ -0,0 +1,89 @@
1
+ import React from 'react';
2
+ import Store from '../store';
3
+ import type { getRowKeyType, IColumn, IDerivedRowKey, IRecord, IRowKey, ITableProps } from '../table/types';
4
+ import type { ComponentSize, Nullable } from '../../../_utils/types';
5
+ export declare type ITableRef = {
6
+ uid: string;
7
+ elementStore: Record<string, Nullable<HTMLElement>>;
8
+ originColumns: IColumn[];
9
+ tableFullData: IRecord[];
10
+ tableOriginData: IRecord[];
11
+ allTableData: IRecord[];
12
+ allRowKeys: IRowKey[];
13
+ deriveRowKeys: IDerivedRowKey[];
14
+ scrollYStore: {
15
+ startIndex: number;
16
+ endIndex: number;
17
+ offsetSize: number;
18
+ visibleSize: number;
19
+ rowHeight: number;
20
+ };
21
+ store: Store;
22
+ resizeState: {
23
+ width: number;
24
+ height: number;
25
+ winHeight: number;
26
+ };
27
+ handleState: {
28
+ insert: boolean;
29
+ remove: boolean;
30
+ };
31
+ summaries: Record<string, number>;
32
+ scrollYLoad: boolean;
33
+ selectionRows: IRecord[];
34
+ rowKeysMap: Map<IRowKey, number>;
35
+ isIE: boolean;
36
+ };
37
+ declare type IExtra = {
38
+ getRowKey: getRowKeyType;
39
+ $size: ComponentSize;
40
+ };
41
+ declare const useTableRef: <T extends ITableProps>(props: T, { getRowKey, $size }: IExtra) => {
42
+ setElementStore: (key: string, value: HTMLElement) => void;
43
+ setOriginColumns: (columns: IColumn[]) => void;
44
+ setTableFullData: (records: IRecord[]) => void;
45
+ setTableOriginData: (records: IRecord[]) => void;
46
+ setAllTableData: (records: IRecord[]) => void;
47
+ setDeriveRowKeys: (records: IRecord[]) => void;
48
+ setScrollYStore: (option: ITableRef['scrollYStore']) => void;
49
+ setResizeState: (option: ITableRef['resizeState']) => void;
50
+ setHandleState: (option: ITableRef['handleState']) => void;
51
+ setSummaries: (option: ITableRef['summaries']) => void;
52
+ setScrollYLoad: (value: boolean) => void;
53
+ setSelectionRows: (selectKeys: IRecord[]) => void;
54
+ setRowKeysMap: (key: IRowKey, value: number) => void;
55
+ clearElementStore: () => void;
56
+ clearAllRowKeysMap: () => void;
57
+ uid: string;
58
+ elementStore: Record<string, Nullable<HTMLElement>>;
59
+ originColumns: IColumn[];
60
+ tableFullData: IRecord[];
61
+ tableOriginData: IRecord[];
62
+ allTableData: IRecord[];
63
+ allRowKeys: IRowKey[];
64
+ deriveRowKeys: IDerivedRowKey[];
65
+ scrollYStore: {
66
+ startIndex: number;
67
+ endIndex: number;
68
+ offsetSize: number;
69
+ visibleSize: number;
70
+ rowHeight: number;
71
+ };
72
+ store: Store;
73
+ resizeState: {
74
+ width: number;
75
+ height: number;
76
+ winHeight: number;
77
+ };
78
+ handleState: {
79
+ insert: boolean;
80
+ remove: boolean;
81
+ };
82
+ summaries: Record<string, number>;
83
+ scrollYLoad: boolean;
84
+ selectionRows: IRecord[];
85
+ rowKeysMap: Map<IRowKey, number>;
86
+ isIE: boolean;
87
+ tableRef: React.MutableRefObject<ITableRef>;
88
+ };
89
+ export default useTableRef;
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import type { IFilter, IPagination, IRecord, IRowKey, ISorter, ISuperFilter, ITableProps } from '../table/types';
3
+ export declare type ITableState = {
4
+ tableData: IRecord[];
5
+ filters: IFilter;
6
+ sorter: ISorter;
7
+ superFilters: ISuperFilter[];
8
+ pagination: IPagination;
9
+ selectionKeys: IRowKey[];
10
+ rowExpandedKeys: IRowKey[];
11
+ highlightKey: IRowKey;
12
+ layout: {
13
+ gutterWidth: number;
14
+ tableWidth: number;
15
+ tableBodyWidth: number;
16
+ tableBodyHeight: number;
17
+ viewportHeight: number;
18
+ headerHeight: number;
19
+ footerHeight: number;
20
+ tableAutoHeight: number;
21
+ tableFullHeight: number;
22
+ };
23
+ permission: {
24
+ export: boolean;
25
+ print: boolean;
26
+ };
27
+ spinning: boolean;
28
+ scrollX: boolean;
29
+ scrollY: boolean;
30
+ isPingLeft: boolean;
31
+ isPingRight: boolean;
32
+ isFullScreen: boolean;
33
+ };
34
+ declare const useTableState: <T extends ITableProps>(props: T) => {
35
+ tableData: IRecord<any>[];
36
+ setTableData: React.Dispatch<React.SetStateAction<IRecord<any>[]>>;
37
+ filters: IFilter;
38
+ setFilters: React.Dispatch<IFilter>;
39
+ sorter: ISorter;
40
+ setSorter: React.Dispatch<ISorter>;
41
+ superFilters: ISuperFilter[];
42
+ setSuperFilters: React.Dispatch<ISuperFilter[]>;
43
+ pagination: Required<Pick<import("../table/types").IPaginationConfig, "current" | "total" | "pageSize">>;
44
+ setPagination: React.Dispatch<React.SetStateAction<Required<Pick<import("../table/types").IPaginationConfig, "current" | "total" | "pageSize">>>>;
45
+ selectionKeys: (string | number)[];
46
+ setSelectionKeys: React.Dispatch<(string | number)[]>;
47
+ rowExpandedKeys: (string | number)[];
48
+ setRowExpandedKeys: React.Dispatch<(string | number)[]>;
49
+ highlightKey: string | number;
50
+ setHighlightKey: React.Dispatch<React.SetStateAction<string | number>>;
51
+ layout: {
52
+ gutterWidth: number;
53
+ tableWidth: number;
54
+ tableBodyWidth: number;
55
+ tableBodyHeight: number;
56
+ viewportHeight: number;
57
+ headerHeight: number;
58
+ footerHeight: number;
59
+ tableAutoHeight: number;
60
+ tableFullHeight: number;
61
+ };
62
+ permission: {
63
+ export: boolean;
64
+ print: boolean;
65
+ };
66
+ setPermission: React.Dispatch<React.SetStateAction<{
67
+ export: boolean;
68
+ print: boolean;
69
+ }>>;
70
+ setLayout: React.Dispatch<React.SetStateAction<{
71
+ gutterWidth: number;
72
+ tableWidth: number;
73
+ tableBodyWidth: number;
74
+ tableBodyHeight: number;
75
+ viewportHeight: number;
76
+ headerHeight: number;
77
+ footerHeight: number;
78
+ tableAutoHeight: number;
79
+ tableFullHeight: number;
80
+ }>>;
81
+ spinning: boolean;
82
+ setSpinning: React.Dispatch<React.SetStateAction<boolean>>;
83
+ scrollX: boolean;
84
+ setScrollX: React.Dispatch<React.SetStateAction<boolean>>;
85
+ scrollY: boolean;
86
+ setScrollY: React.Dispatch<React.SetStateAction<boolean>>;
87
+ isPingLeft: boolean;
88
+ setPingLeft: React.Dispatch<React.SetStateAction<boolean>>;
89
+ isPingRight: boolean;
90
+ setPingRight: React.Dispatch<React.SetStateAction<boolean>>;
91
+ isFullScreen: boolean;
92
+ setFullScreen: React.Dispatch<React.SetStateAction<boolean>>;
93
+ };
94
+ export default useTableState;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CaretDownIcon: React.FC;
3
+ export default CaretDownIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CaretUpIcon: React.FC;
3
+ export default CaretUpIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const FilterIcon: React.FC;
3
+ export default FilterIcon;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { TableRef } from '../table/types';
3
+ import type { Nullable } from '../../../_utils/types';
4
+ declare type Instance = {
5
+ id: string;
6
+ vm: React.ForwardedRef<TableRef>;
7
+ };
8
+ declare const TableManager: {
9
+ getFocusInstance: () => Nullable<Instance>;
10
+ getInstance: (id: string) => Nullable<Instance>;
11
+ focus: (id: string) => void;
12
+ register: (id: string, instance: React.ForwardedRef<TableRef>) => void;
13
+ deregister: (id: string) => void;
14
+ };
15
+ export default TableManager;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { IPaginationConfig } from '../table/types';
3
+ declare type IPagerProps = {
4
+ current: number;
5
+ pageSize: number;
6
+ total: number;
7
+ config?: Pick<IPaginationConfig, 'pageSizeOptions' | 'showSizeChanger' | 'showQuickJumper'>;
8
+ onChange: (current: number, pageSize: number) => void;
9
+ };
10
+ declare const TablePager: React.FC<IPagerProps>;
11
+ export default TablePager;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { IColumn } from '../table/types';
3
+ declare type ITablePrintProps = {
4
+ tableColumns: IColumn[];
5
+ };
6
+ declare const TablePrint: React.FC<ITablePrintProps>;
7
+ export default TablePrint;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Reload: React.FC;
3
+ export default Reload;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { IColumn } from '../table/types';
3
+ declare type IResizableProps = {
4
+ column: IColumn;
5
+ };
6
+ declare const Resizable: React.FC<IResizableProps>;
7
+ export default Resizable;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { IColumn } from '../table/types';
3
+ declare type ISelectCollectionProps = {
4
+ columns: IColumn[];
5
+ };
6
+ declare const SelectCollection: React.FC<ISelectCollectionProps>;
7
+ export default SelectCollection;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { IColumn } from '../table/types';
3
+ declare type IResultProps = {
4
+ columns: IColumn[];
5
+ onClose: () => void;
6
+ };
7
+ declare const Result: React.FC<IResultProps>;
8
+ export default Result;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { IRowKey } from '../table/types';
3
+ declare type IAllSelectionProps = {
4
+ selectionKeys: IRowKey[];
5
+ };
6
+ declare const AllSelection: React.FC<IAllSelectionProps>;
7
+ export default AllSelection;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { IColumn, IRecord, IRowKey, ISelectionType } from '../table/types';
3
+ declare type ISelectionProps = {
4
+ selectionKeys: IRowKey[];
5
+ column: IColumn & {
6
+ type?: ISelectionType;
7
+ };
8
+ record: IRecord;
9
+ rowKey: IRowKey;
10
+ };
11
+ declare const Selection: React.FC<ISelectionProps>;
12
+ export default Selection;
@@ -0,0 +1,29 @@
1
+ declare type IStoreItem = {
2
+ x: string;
3
+ y: string;
4
+ text: string;
5
+ };
6
+ declare type IStoreState = {
7
+ required: IStoreItem[];
8
+ validate: IStoreItem[];
9
+ inserted: IStoreItem[];
10
+ updated: IStoreItem[];
11
+ removed: IStoreItem[];
12
+ };
13
+ declare class Store {
14
+ state: IStoreState;
15
+ addToRequired: (data: any) => void;
16
+ removeFromRequired: (data: any) => void;
17
+ addToValidate: (data: any) => void;
18
+ removeFromValidate: (data: any) => void;
19
+ addToInserted: (data: any) => void;
20
+ removeFromInserted: (data: any) => void;
21
+ addToUpdated: (data: any) => void;
22
+ removeFromUpdated: (data: any) => void;
23
+ addToRemoved: (data: any) => void;
24
+ removeFromRemoved: (data: any) => void;
25
+ clearAllLog: () => void;
26
+ destroy: () => void;
27
+ }
28
+ export default Store;
29
+ export type { Store };