@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,6 @@
1
+ /// <reference types="react" />
2
+ export declare type IFormContext = {
3
+ $$form: any;
4
+ };
5
+ declare const FormContext: import("react").Context<IFormContext | undefined>;
6
+ export default FormContext;
@@ -0,0 +1,26 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ uniqueKey?: string;
5
+ items: IFormItem[];
6
+ fieldsChange?: (items: IFormItem[]) => void;
7
+ };
8
+ declare type IState = {
9
+ visible: boolean;
10
+ };
11
+ declare class FieldsFilter extends Component<IProps, IState> {
12
+ static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
13
+ private linkRef;
14
+ state: IState;
15
+ get formUniqueKey(): string;
16
+ componentDidMount(): void;
17
+ getTableFieldsConfig(key: string): Promise<unknown[] | void>;
18
+ saveTableColumnsConfig(key: string, value: Partial<IFormItem>[]): Promise<void>;
19
+ getLocalFields(): Array<IFormItem> | void;
20
+ setLocalFields(list: IFormItem[]): void;
21
+ initLocalfields(): void;
22
+ changeHandle(items: IFormItem[]): void;
23
+ popup(): JSX.Element;
24
+ render(): React.ReactElement;
25
+ }
26
+ export default FieldsFilter;
@@ -0,0 +1,21 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ import type { IDict } from '../../_utils/types';
4
+ declare type IProps = {
5
+ option: IFormItem;
6
+ multiple?: boolean;
7
+ };
8
+ declare type IState = {
9
+ results: IDict[];
10
+ loading: boolean;
11
+ };
12
+ declare class FormCascader extends Component<IProps, IState> {
13
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
14
+ state: IState;
15
+ componentDidMount(): void;
16
+ componentDidUpdate(prevProps: IProps): void;
17
+ createViewText(val: string | undefined, items: IDict[]): string;
18
+ getItemList(): Promise<void>;
19
+ render(): React.ReactElement;
20
+ }
21
+ export default FormCascader;
@@ -0,0 +1,18 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ import type { IDict } from '../../_utils/types';
4
+ declare type IProps = {
5
+ option: IFormItem;
6
+ };
7
+ declare type IState = {
8
+ results: IDict[];
9
+ };
10
+ declare class FormCheckboxGroup extends Component<IProps, IState> {
11
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
12
+ state: IState;
13
+ componentDidMount(): void;
14
+ componentDidUpdate(prevProps: IProps): void;
15
+ getItemList(): Promise<void>;
16
+ render(): React.ReactElement;
17
+ }
18
+ export default FormCheckboxGroup;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormCheckbox extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormCheckbox;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormCitySelect extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormCitySelect;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormDate extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormDate;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormDivider extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormDivider;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormImmediate extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormImmediate;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormInputNumber extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormInputNumber;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormInput extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormInput;
@@ -0,0 +1,18 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ import type { IDict } from '../../_utils/types';
4
+ declare type IProps = {
5
+ option: IFormItem;
6
+ };
7
+ declare type IState = {
8
+ results: IDict[];
9
+ };
10
+ declare class FormRadio extends Component<IProps, IState> {
11
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
12
+ state: IState;
13
+ componentDidMount(): void;
14
+ componentDidUpdate(prevProps: IProps): void;
15
+ getItemList(): Promise<void>;
16
+ render(): React.ReactElement;
17
+ }
18
+ export default FormRadio;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormRangeDate extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormRangeDate;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormRangeInputNumber extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormRangeInputNumber;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormRangeInput extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormRangeInput;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormRangeTime extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormRangeTime;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormRegionSelect extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormRegionSelect;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormSearchHelper extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormSearchHelper;
@@ -0,0 +1,21 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ import type { IDict } from '../../_utils/types';
4
+ declare type IProps = {
5
+ option: IFormItem;
6
+ multiple?: boolean;
7
+ };
8
+ declare type IState = {
9
+ results: IDict[];
10
+ loading: boolean;
11
+ };
12
+ declare class FormSelect extends Component<IProps, IState> {
13
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
14
+ state: IState;
15
+ componentDidMount(): void;
16
+ componentDidUpdate(prevProps: IProps): void;
17
+ createViewText(val: any, list: IDict[]): string | undefined;
18
+ getItemList(): Promise<void>;
19
+ render(): React.ReactElement;
20
+ }
21
+ export default FormSelect;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormSwitch extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormSwitch;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormTextArea extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormTextArea;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormTime extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormTime;
@@ -0,0 +1,10 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ declare class FormTinymce extends Component<IProps> {
7
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
8
+ render(): React.ReactElement;
9
+ }
10
+ export default FormTinymce;
@@ -0,0 +1,23 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ import type { IDict } from '../../_utils/types';
4
+ declare type IProps = {
5
+ option: IFormItem;
6
+ multiple?: boolean;
7
+ };
8
+ declare type IState = {
9
+ results: IDict[];
10
+ loading: boolean;
11
+ };
12
+ declare class FormTreeSelect extends Component<IProps, IState> {
13
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
14
+ state: IState;
15
+ componentDidMount(): void;
16
+ componentDidUpdate(prevProps: IProps): void;
17
+ getItemText(val: any, items: IDict[]): any;
18
+ createViewText(val: any, items: IDict[]): any;
19
+ getItemList(): Promise<void>;
20
+ createTreeNode(items: IDict[]): JSX.Element[];
21
+ render(): React.ReactElement;
22
+ }
23
+ export default FormTreeSelect;
@@ -0,0 +1,18 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ export interface UploadFile {
7
+ uid: string;
8
+ name: string;
9
+ fileName?: string;
10
+ url?: string;
11
+ thumbUrl?: string;
12
+ status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
13
+ }
14
+ declare class FormUploadFile extends Component<IProps> {
15
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
16
+ render(): React.ReactElement;
17
+ }
18
+ export default FormUploadFile;
@@ -0,0 +1,18 @@
1
+ import React, { Component } from 'react';
2
+ import type { IFormItem } from './types';
3
+ declare type IProps = {
4
+ option: IFormItem;
5
+ };
6
+ export interface UploadFile {
7
+ uid: string;
8
+ name: string;
9
+ fileName?: string;
10
+ url?: string;
11
+ thumbUrl?: string;
12
+ status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
13
+ }
14
+ declare class FormUploadImg extends Component<IProps> {
15
+ static contextType: React.Context<import("./context").IFormContext | undefined>;
16
+ render(): React.ReactElement;
17
+ }
18
+ export default FormUploadImg;
@@ -0,0 +1,169 @@
1
+ /// <reference types="lodash" />
2
+ import React, { Component } from 'react';
3
+ import { IFieldData } from './types';
4
+ import type { IFormProps, IFormData, IFormItem, IExtraData, IViewData, IExpandData } from './types';
5
+ import { JSXElement, ValueOf } from '../../_utils/types';
6
+ import type { FormProps } from '../../antd';
7
+ declare type IProps = FormProps & IFormProps;
8
+ declare type IState = {
9
+ formData: IFormData;
10
+ viewData: IViewData;
11
+ other: IFormData;
12
+ extra: IExtraData;
13
+ expand: IExpandData;
14
+ flexCols: number;
15
+ collapse: boolean;
16
+ };
17
+ export declare type QmFormProps = IProps;
18
+ declare class QmForm extends Component<IProps, IState> {
19
+ static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
20
+ static propTypes: {
21
+ items: import("prop-types").Requireable<(import("prop-types").InferProps<{
22
+ type: import("prop-types").Validator<string>;
23
+ fieldName: import("prop-types").Validator<string>;
24
+ }> | null | undefined)[]>;
25
+ initialValues: import("prop-types").Requireable<object>;
26
+ initialExtras: import("prop-types").Requireable<object>;
27
+ size: (props: any, propName: any, componentName: any) => void;
28
+ cols: import("prop-types").Requireable<number>;
29
+ labelWidth: import("prop-types").Requireable<string | number>;
30
+ labelAlign: import("prop-types").Requireable<string>;
31
+ formType: import("prop-types").Requireable<string>;
32
+ uniqueKey: import("prop-types").Requireable<string>;
33
+ defaultRows: import("prop-types").Requireable<number>;
34
+ authConfig: import("prop-types").Requireable<import("prop-types").InferProps<{
35
+ fetch: import("prop-types").Requireable<import("prop-types").InferProps<{
36
+ api: import("prop-types").Validator<(...args: any[]) => any>;
37
+ params: import("prop-types").Requireable<object>;
38
+ dataKey: import("prop-types").Requireable<string>;
39
+ }>>;
40
+ }>>;
41
+ isAutoFocus: import("prop-types").Requireable<boolean>;
42
+ isCollapse: import("prop-types").Requireable<boolean>;
43
+ isFieldsDefine: import("prop-types").Requireable<boolean>;
44
+ isSearchBtn: import("prop-types").Requireable<boolean>;
45
+ isSubmitBtn: import("prop-types").Requireable<boolean>;
46
+ fieldsChange: import("prop-types").Requireable<(...args: any[]) => any>;
47
+ onValuesChange: import("prop-types").Requireable<(...args: any[]) => any>;
48
+ onFieldsChange: import("prop-types").Requireable<(...args: any[]) => any>;
49
+ onFinish: import("prop-types").Requireable<(...args: any[]) => any>;
50
+ onFinishFailed: import("prop-types").Requireable<(...args: any[]) => any>;
51
+ onCollapse: import("prop-types").Requireable<(...args: any[]) => any>;
52
+ };
53
+ static defaultProps: {
54
+ labelWidth: number;
55
+ labelAlign: string;
56
+ formType: string;
57
+ initialValues: {};
58
+ initialExtras: {};
59
+ defaultRows: number;
60
+ isAutoFocus: boolean;
61
+ isCollapse: boolean;
62
+ isFieldsDefine: boolean;
63
+ isSearchBtn: boolean;
64
+ onValuesChange: () => void;
65
+ onFieldsChange: () => void;
66
+ onFinish: () => void;
67
+ onFinishFailed: () => void;
68
+ onCollapse: () => void;
69
+ onFormItemsChange: () => void;
70
+ };
71
+ private provide;
72
+ private _initialValues;
73
+ private _initialOthers;
74
+ private _initialExtras;
75
+ private wrapperRef;
76
+ private formRef;
77
+ state: IState;
78
+ constructor(props: IProps);
79
+ get $size(): any;
80
+ get formItems(): IFormItem[];
81
+ get flattenItems(): IFormItem[];
82
+ get dividers(): IFormItem[];
83
+ get isFilterType(): boolean;
84
+ get showDividerCollapse(): boolean;
85
+ get showFilterCollapse(): boolean | undefined;
86
+ componentDidMount(): void;
87
+ componentDidUpdate(prevProps: IProps, prevState: IState): void;
88
+ componentWillUnmount(): void;
89
+ resizeObserveHandler: () => void;
90
+ resizeListenerHandle: import("lodash").DebouncedFunc<() => void>;
91
+ bindResizeEvent(): void;
92
+ removeResizeEvent(): void;
93
+ initialHandle(): void;
94
+ checkFieldNames(): void;
95
+ getFormItemRequired(rules?: Record<string, any>[]): boolean;
96
+ createOtherValue(values: IFormData): IFormData;
97
+ createExtraValue(values: IExtraData): IExtraData;
98
+ createDividerExpand(): IExpandData;
99
+ getInitialValue(item: IFormItem, val?: ValueOf<IFormData>): string | number | any[] | undefined;
100
+ createFormValue(values: IFormData): IFormData;
101
+ createInitialValues(): void;
102
+ createInitialOthers(): void;
103
+ createInitialExtras(): void;
104
+ getFormItems: import("memoize-one").MemoizedFn<(items: IFormItem[]) => IFormItem[]>;
105
+ getFlattenItems: import("memoize-one").MemoizedFn<(items: IFormItem[]) => IFormItem[]>;
106
+ setViewValue(fieldName: string, val?: string): void;
107
+ createInputFocus(): void;
108
+ getFormItemLabel(label: string | IFormItem): string;
109
+ getBlockDerivedItems(): Pick<IFormItem, "fieldName" | "label">[][];
110
+ getFormItemDisplay({ type, fieldName }: {
111
+ type: any;
112
+ fieldName: any;
113
+ }): boolean;
114
+ INPUT(option: IFormItem): JSXElement;
115
+ RANGE_INPUT(option: IFormItem): JSXElement;
116
+ INPUT_NUMBER(option: IFormItem): JSXElement;
117
+ RANGE_INPUT_NUMBER(option: IFormItem): JSXElement;
118
+ SEARCH_HELPER(option: IFormItem): JSXElement;
119
+ CHECKBOX(option: IFormItem): JSXElement;
120
+ MULTIPLE_CHECKBOX(option: IFormItem): JSXElement;
121
+ RADIO(option: IFormItem): JSXElement;
122
+ SWITCH(option: IFormItem): JSXElement;
123
+ TEXT_AREA(option: IFormItem): JSXElement;
124
+ DATE(option: IFormItem): JSXElement;
125
+ RANGE_DATE(option: IFormItem): JSXElement;
126
+ TIME(option: IFormItem): JSXElement;
127
+ RANGE_TIME(option: IFormItem): JSXElement;
128
+ SELECT(option: IFormItem): JSXElement;
129
+ MULTIPLE_SELECT(option: IFormItem): JSXElement;
130
+ IMMEDIATE(option: IFormItem): JSXElement;
131
+ DIVIDER(option: IFormItem): JSXElement;
132
+ TREE_SELECT(option: IFormItem): JSXElement;
133
+ MULTIPLE_TREE_SELECT(option: IFormItem): JSXElement;
134
+ CASCADER(option: IFormItem): JSXElement;
135
+ CITY_SELECT(option: IFormItem): JSXElement;
136
+ REGION_SELECT(option: IFormItem): JSXElement;
137
+ UPLOAD_FILE(option: IFormItem): JSXElement;
138
+ UPLOAD_IMG(option: IFormItem): JSXElement;
139
+ TINYMCE(option: IFormItem): JSXElement;
140
+ renderFormLabel(label: IFormItem): JSX.Element | IFormItem;
141
+ renderFormItemExtra(option: IFormItem['extra'] & {
142
+ fieldName: string;
143
+ }): JSX.Element;
144
+ renderFormItem(option: IFormItem): JSX.Element | null;
145
+ createFormItem(item: IFormItem): JSXElement;
146
+ createFormLayout(): (JSX.Element | null)[];
147
+ createSearchButtonLayout(lastCols?: number): JSX.Element | null;
148
+ createFormButtonLayout(): JSX.Element | null;
149
+ setExpandHandle: (collapse: boolean) => void;
150
+ valuesChangeHandle: (changedValues: IFormData, allValues: IFormData) => void;
151
+ fieldsChangeHandle: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
152
+ finishHandle: (values: IFormData) => void;
153
+ finishFailedHandle: ({ values, errorFields }: {
154
+ values: any;
155
+ errorFields: any;
156
+ }) => void;
157
+ set_fields_other(values: IFormData): void;
158
+ get_fields_other(fields?: string[]): IFormData;
159
+ SET_FIELDS_VALUE(values: IFormData): void;
160
+ GET_FIELDS_VALUE(fields?: string[]): IFormData;
161
+ GET_FORM_DATA: () => Promise<any[]>;
162
+ SET_FIELDS_EXTRA(values: IExtraData): void;
163
+ GET_FIELDS_EXTRA(fields?: string[]): IExtraData;
164
+ GET_FIELDS_TOUCHED(fields?: string[]): boolean;
165
+ SUBMIT_FORM: () => void;
166
+ RESET_FORM: () => void;
167
+ render(): React.ReactElement;
168
+ }
169
+ export default QmForm;