fat-design 0.0.1-beta.20250505154859

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 (231) hide show
  1. package/README.md +1 -0
  2. package/index.browser.js +78 -0
  3. package/index.js +44076 -0
  4. package/index.umd.cjs +67 -0
  5. package/index.umd.js +67 -0
  6. package/libs/config-16.js +7 -0
  7. package/libs/config-17.js +7 -0
  8. package/libs/config-18.js +9 -0
  9. package/libs/config-19.js +9 -0
  10. package/manifest.json +11 -0
  11. package/package.json +20 -0
  12. package/style.css +1 -0
  13. package/types/0buildTypes/config-provider/constants.d.ts +3 -0
  14. package/types/0buildTypes/config-provider/index.d.ts +4 -0
  15. package/types/0buildTypes/config-provider/v2/consumer.d.ts +3 -0
  16. package/types/0buildTypes/config-provider/v2/context.d.ts +6 -0
  17. package/types/0buildTypes/config-provider/v2/error-boundary.d.ts +27 -0
  18. package/types/0buildTypes/config-provider/v2/functions.d.ts +66 -0
  19. package/types/0buildTypes/config-provider/v2/index.d.ts +37 -0
  20. package/types/0buildTypes/config-provider/v2/provider.d.ts +4 -0
  21. package/types/0buildTypes/config-provider/v2/types.d.ts +22 -0
  22. package/types/0buildTypes/dependencies.d.ts +2 -0
  23. package/types/0buildTypes/empty/empty.d.ts +22 -0
  24. package/types/0buildTypes/empty/index.d.ts +2 -0
  25. package/types/0buildTypes/filter/filter-types.d.ts +21 -0
  26. package/types/0buildTypes/filter/filter.d.ts +10 -0
  27. package/types/0buildTypes/filter/index.d.ts +9 -0
  28. package/types/0buildTypes/form2/deps.d.ts +10 -0
  29. package/types/0buildTypes/form2/form-actions.d.ts +36 -0
  30. package/types/0buildTypes/form2/form-buttons.d.ts +28 -0
  31. package/types/0buildTypes/form2/form-context.d.ts +4 -0
  32. package/types/0buildTypes/form2/form-error.d.ts +3 -0
  33. package/types/0buildTypes/form2/form-item-card.d.ts +9 -0
  34. package/types/0buildTypes/form2/form-item-comp.d.ts +4 -0
  35. package/types/0buildTypes/form2/form-item-label.d.ts +4 -0
  36. package/types/0buildTypes/form2/form-item-preview.d.ts +4 -0
  37. package/types/0buildTypes/form2/form-item.d.ts +7 -0
  38. package/types/0buildTypes/form2/form-layout.d.ts +3 -0
  39. package/types/0buildTypes/form2/form-rules.d.ts +3 -0
  40. package/types/0buildTypes/form2/form-section.d.ts +25 -0
  41. package/types/0buildTypes/form2/form-types.d.ts +386 -0
  42. package/types/0buildTypes/form2/form.d.ts +36 -0
  43. package/types/0buildTypes/form2/helper/buildParams.d.ts +5 -0
  44. package/types/0buildTypes/form2/helper/constants.d.ts +24 -0
  45. package/types/0buildTypes/form2/helper/fixItemProps.d.ts +16 -0
  46. package/types/0buildTypes/form2/helper/fnInheritProps.d.ts +2 -0
  47. package/types/0buildTypes/form2/helper/linkageFormState.d.ts +16 -0
  48. package/types/0buildTypes/form2/helper/useDataSource.d.ts +14 -0
  49. package/types/0buildTypes/form2/helper/useFormChildren.d.ts +5 -0
  50. package/types/0buildTypes/form2/helper/useFormItemState.d.ts +3 -0
  51. package/types/0buildTypes/form2/helper/useGetXProps.d.ts +3 -0
  52. package/types/0buildTypes/form2/index.d.ts +20 -0
  53. package/types/0buildTypes/form2/layout/from-float-layout.d.ts +3 -0
  54. package/types/0buildTypes/hooks/index.d.ts +16 -0
  55. package/types/0buildTypes/hooks/useCurrentState.d.ts +11 -0
  56. package/types/0buildTypes/hooks/useOnKeyPressSave.d.ts +12 -0
  57. package/types/0buildTypes/hooks/usePersistFn.d.ts +3 -0
  58. package/types/0buildTypes/hooks/usePreciseStore.d.ts +53 -0
  59. package/types/0buildTypes/hooks/useSize.d.ts +6 -0
  60. package/types/0buildTypes/hooks/useUniqueId.d.ts +2 -0
  61. package/types/0buildTypes/hooks/useValueOnChange.d.ts +2 -0
  62. package/types/0buildTypes/image/Image.d.ts +42 -0
  63. package/types/0buildTypes/image/Operations.d.ts +25 -0
  64. package/types/0buildTypes/image/Preview.d.ts +64 -0
  65. package/types/0buildTypes/image/PreviewGroup.d.ts +32 -0
  66. package/types/0buildTypes/image/common.d.ts +2 -0
  67. package/types/0buildTypes/image/context.d.ts +7 -0
  68. package/types/0buildTypes/image/getFixScaleEleTransPosition.d.ts +17 -0
  69. package/types/0buildTypes/image/hooks/useImageTransform.d.ts +28 -0
  70. package/types/0buildTypes/image/hooks/useMouseEvent.d.ts +9 -0
  71. package/types/0buildTypes/image/hooks/usePreviewItems.d.ts +7 -0
  72. package/types/0buildTypes/image/hooks/useRegisterImage.d.ts +2 -0
  73. package/types/0buildTypes/image/hooks/useStatus.d.ts +14 -0
  74. package/types/0buildTypes/image/hooks/useTouchEvent.d.ts +8 -0
  75. package/types/0buildTypes/image/index.d.ts +6 -0
  76. package/types/0buildTypes/image/interface.d.ts +14 -0
  77. package/types/0buildTypes/image/previewConfig.d.ts +4 -0
  78. package/types/0buildTypes/image/util.d.ts +1 -0
  79. package/types/0buildTypes/image/utils/KeyCode.d.ts +23 -0
  80. package/types/0buildTypes/image/utils/addEventListener.d.ts +4 -0
  81. package/types/0buildTypes/image/utils/buildIcons.d.ts +2 -0
  82. package/types/0buildTypes/image/utils/css.d.ts +8 -0
  83. package/types/0buildTypes/image/utils/isEqual.d.ts +8 -0
  84. package/types/0buildTypes/image/utils/raf.d.ts +6 -0
  85. package/types/0buildTypes/image/utils/useEvent.d.ts +1 -0
  86. package/types/0buildTypes/image/utils/useLayoutEffect.d.ts +4 -0
  87. package/types/0buildTypes/image/utils/useMergedState.d.ts +12 -0
  88. package/types/0buildTypes/image/utils/useSafeState.d.ts +14 -0
  89. package/types/0buildTypes/index.d.ts +4 -0
  90. package/types/0buildTypes/libs.d.ts +66 -0
  91. package/types/0buildTypes/nav/group.d.ts +30 -0
  92. package/types/0buildTypes/nav/index.d.ts +4 -0
  93. package/types/0buildTypes/nav/item.d.ts +30 -0
  94. package/types/0buildTypes/nav/nav.d.ts +2 -0
  95. package/types/0buildTypes/nav/popup-item.d.ts +24 -0
  96. package/types/0buildTypes/nav/sub-nav.d.ts +30 -0
  97. package/types/0buildTypes/nav/types.d.ts +375 -0
  98. package/types/0buildTypes/others.d.ts +10 -0
  99. package/types/0buildTypes/pages/deps.d.ts +5 -0
  100. package/types/0buildTypes/pages/detail-page/detail-page-card-form.d.ts +12 -0
  101. package/types/0buildTypes/pages/detail-page/detail-page-form-item.d.ts +9 -0
  102. package/types/0buildTypes/pages/detail-page/detail-page-section.d.ts +19 -0
  103. package/types/0buildTypes/pages/detail-page/detail-page-summary.d.ts +9 -0
  104. package/types/0buildTypes/pages/detail-page/detail-page.d.ts +14 -0
  105. package/types/0buildTypes/pages/detail-page/index.d.ts +2 -0
  106. package/types/0buildTypes/pages/detail-page/types.d.ts +29 -0
  107. package/types/0buildTypes/pages/page-card/types.d.ts +6 -0
  108. package/types/0buildTypes/query-form/index.d.ts +2 -0
  109. package/types/0buildTypes/query-form/query-form-items.d.ts +3 -0
  110. package/types/0buildTypes/query-form/query-form-layout.d.ts +2 -0
  111. package/types/0buildTypes/query-form/query-form.d.ts +17 -0
  112. package/types/0buildTypes/query-form/types.d.ts +5 -0
  113. package/types/0buildTypes/sortable-list/helpers.d.ts +8 -0
  114. package/types/0buildTypes/sortable-list/hooks.d.ts +24 -0
  115. package/types/0buildTypes/sortable-list/index.d.ts +14 -0
  116. package/types/0buildTypes/sortable-list/sortable-editable-table.d.ts +2 -0
  117. package/types/0buildTypes/sortable-list/sortable-list.d.ts +564 -0
  118. package/types/0buildTypes/sortable-list/sortable-table.d.ts +2 -0
  119. package/types/0buildTypes/sortable-list/types.d.ts +15 -0
  120. package/types/0buildTypes/table-pro/index.d.ts +24 -0
  121. package/types/0buildTypes/table-pro/table-pro.d.ts +17 -0
  122. package/types/0buildTypes/table-pro/types.d.ts +93 -0
  123. package/types/0buildTypes/table-pro/useTablePro.d.ts +10 -0
  124. package/types/0buildTypes/table-pro/utils/formatQueryRes.d.ts +1 -0
  125. package/types/0buildTypes/table-pro/widget/column-setting.d.ts +4 -0
  126. package/types/0buildTypes/table-pro/widget/deps.d.ts +2 -0
  127. package/types/0buildTypes/table-pro/widget/index.d.ts +23 -0
  128. package/types/0buildTypes/table-pro/widget/operations.d.ts +5 -0
  129. package/types/0buildTypes/table-pro/widget/operationsActions.d.ts +2 -0
  130. package/types/0buildTypes/table-pro/widget/renderFormats.d.ts +15 -0
  131. package/types/0buildTypes/table-pro/widget/renderMultiFieldCell.d.ts +4 -0
  132. package/types/0buildTypes/table-pro/widget/renderOperationCell.d.ts +4 -0
  133. package/types/0buildTypes/table-pro/widget/renderToolbar.d.ts +6 -0
  134. package/types/0buildTypes/table-pro/widget/table-utils-types.d.ts +40 -0
  135. package/types/0buildTypes/util/comp.d.ts +16 -0
  136. package/types/0buildTypes/util/component.d.ts +1 -0
  137. package/types/0buildTypes/util/constants.d.ts +4 -0
  138. package/types/0buildTypes/util/dom.d.ts +116 -0
  139. package/types/0buildTypes/util/env.d.ts +7 -0
  140. package/types/0buildTypes/util/func-wrapper.d.ts +1 -0
  141. package/types/0buildTypes/util/func.d.ts +73 -0
  142. package/types/0buildTypes/util/guid.d.ts +11 -0
  143. package/types/0buildTypes/util/isStateEquals.d.ts +4 -0
  144. package/types/0buildTypes/util/localforage.d.ts +11 -0
  145. package/types/0buildTypes/util/log.d.ts +18 -0
  146. package/types/0buildTypes/util/pick-res-data.d.ts +28 -0
  147. package/types/0buildTypes/util/react-dom.d.ts +27 -0
  148. package/types/0buildTypes/util/shallowEqual.d.ts +3 -0
  149. package/types/0buildTypes/util/string.d.ts +26 -0
  150. package/types/0buildTypes/util/toMap.d.ts +7 -0
  151. package/types/affix/index.d.ts +33 -0
  152. package/types/animate/index.d.ts +80 -0
  153. package/types/avatar/index.d.ts +41 -0
  154. package/types/badge/index.d.ts +38 -0
  155. package/types/balloon/index.d.ts +254 -0
  156. package/types/balloon-confirm/index.d.ts +78 -0
  157. package/types/batch-input/index.d.ts +152 -0
  158. package/types/box/index.d.ts +18 -0
  159. package/types/breadcrumb/index.d.ts +60 -0
  160. package/types/button/index.d.ts +179 -0
  161. package/types/calendar/index.d.ts +76 -0
  162. package/types/card/index.d.ts +147 -0
  163. package/types/cascader/index.d.ts +135 -0
  164. package/types/cascader-select/index.d.ts +230 -0
  165. package/types/checkbox/index.d.ts +175 -0
  166. package/types/collapse/index.d.ts +96 -0
  167. package/types/config-provider/index.d.ts +3 -0
  168. package/types/date-picker/index.d.ts +123 -0
  169. package/types/dialog/index.d.ts +328 -0
  170. package/types/divider/index.d.ts +21 -0
  171. package/types/drawer/index.d.ts +121 -0
  172. package/types/dropdown/index.d.ts +198 -0
  173. package/types/field/index.d.ts +33 -0
  174. package/types/filter/index.d.ts +2 -0
  175. package/types/form/index.d.ts +5 -0
  176. package/types/grid/index.d.ts +142 -0
  177. package/types/hooks/index.d.ts +2 -0
  178. package/types/icon/index.d.ts +29 -0
  179. package/types/image/index.d.ts +3 -0
  180. package/types/index.d.ts +67 -0
  181. package/types/input/index.d.ts +367 -0
  182. package/types/list/index.d.ts +69 -0
  183. package/types/loading/index.d.ts +92 -0
  184. package/types/locale/default.d.ts +143 -0
  185. package/types/locale/en-us.d.ts +1 -0
  186. package/types/locale/id-id.d.ts +1 -0
  187. package/types/locale/it-it.d.ts +1 -0
  188. package/types/locale/ja-jp.d.ts +1 -0
  189. package/types/locale/ko-kr.d.ts +1 -0
  190. package/types/locale/ms-my.d.ts +1 -0
  191. package/types/locale/pt-pt.d.ts +1 -0
  192. package/types/locale/th-th.d.ts +1 -0
  193. package/types/locale/vi-vn.d.ts +1 -0
  194. package/types/locale/zh-cn.d.ts +1 -0
  195. package/types/locale/zh-hk.d.ts +1 -0
  196. package/types/locale/zh-tw.d.ts +1 -0
  197. package/types/menu/index.d.ts +336 -0
  198. package/types/menu-button/index.d.ts +100 -0
  199. package/types/message/index.d.ts +164 -0
  200. package/types/nav/index.d.ts +313 -0
  201. package/types/notification/index.d.ts +35 -0
  202. package/types/number-picker/index.d.ts +161 -0
  203. package/types/overlay/index.d.ts +363 -0
  204. package/types/pagination/index.d.ts +115 -0
  205. package/types/paragraph/index.d.ts +23 -0
  206. package/types/progress/index.d.ts +53 -0
  207. package/types/query-form/index.d.ts +3 -0
  208. package/types/radio/index.d.ts +180 -0
  209. package/types/range/index.d.ts +120 -0
  210. package/types/rating/index.d.ts +84 -0
  211. package/types/responsive-grid/index.d.ts +30 -0
  212. package/types/search/index.d.ts +219 -0
  213. package/types/select/index.d.ts +476 -0
  214. package/types/shell/index.d.ts +53 -0
  215. package/types/slider/index.d.ts +172 -0
  216. package/types/split-button/index.d.ts +134 -0
  217. package/types/step/index.d.ts +108 -0
  218. package/types/switch/index.d.ts +85 -0
  219. package/types/tab/index.d.ts +170 -0
  220. package/types/table/index.d.ts +407 -0
  221. package/types/table-pro/index.d.ts +3 -0
  222. package/types/tag/index.d.ts +124 -0
  223. package/types/time-picker/index.d.ts +193 -0
  224. package/types/timeline/index.d.ts +95 -0
  225. package/types/transfer/index.d.ts +199 -0
  226. package/types/tree/index.d.ts +421 -0
  227. package/types/tree-select/index.d.ts +251 -0
  228. package/types/typography/index.d.ts +28 -0
  229. package/types/upload/index.d.ts +707 -0
  230. package/types/util.d.ts +50 -0
  231. package/types/virtual-list/index.d.ts +44 -0
@@ -0,0 +1,386 @@
1
+ export interface ResponsiveGridProps {
2
+ prefix?: string;
3
+ className?: any;
4
+ device?: string;
5
+ rows?: number | string;
6
+ columns?: number | string;
7
+ gap?: number | number[];
8
+ component?: any;
9
+ dense?: boolean;
10
+ style?: any;
11
+ }
12
+ export interface FloatLayoutProps {
13
+ className?: any;
14
+ itemWidth: number;
15
+ }
16
+ type IFunc = (e: any, e2?: any) => any;
17
+ type IReactElement = any;
18
+ type IReactComponent = any;
19
+ type IObject = any;
20
+ export declare enum SizeEnum {
21
+ large = "large",
22
+ small = "small",
23
+ medium = "medium"
24
+ }
25
+ export declare enum LayoutEnum {
26
+ responsive = "responsive",
27
+ float = "float",
28
+ custom = "custom",
29
+ null = "null"
30
+ }
31
+ export declare enum LabelAlignEnum {
32
+ top = "top",
33
+ left = "left",
34
+ inset = "inset"
35
+ }
36
+ export declare enum LabelTextAlignEnum {
37
+ left = "left",
38
+ right = "right"
39
+ }
40
+ export declare enum FormItemStateEnum {
41
+ error = "error",
42
+ warning = "warning",
43
+ ok = "ok"
44
+ }
45
+ export interface ILabelValue {
46
+ label: string;
47
+ value: string;
48
+ }
49
+ export interface IItemState {
50
+ errors: IValidateStateError[];
51
+ display: boolean;
52
+ disabled: boolean;
53
+ isPreview: boolean;
54
+ }
55
+ /**
56
+ * 存储在Store中的
57
+ */
58
+ export interface FormItemStateSaved {
59
+ errors?: any[];
60
+ required: boolean;
61
+ display: boolean;
62
+ disabled: boolean;
63
+ isPreview: boolean;
64
+ label: string;
65
+ xProps?: any;
66
+ forceUpdateTick?: number;
67
+ }
68
+ /**
69
+ * 数据计算使用的
70
+ */
71
+ export interface FormItemState extends FormItemStateSaved {
72
+ value: any;
73
+ state?: string;
74
+ stateMessage?: string;
75
+ }
76
+ export interface FormItemValidateRule {
77
+ message?: string;
78
+ trigger?: string;
79
+ validator?: FnValidator;
80
+ minLength?: number;
81
+ maxLength?: number;
82
+ min?: number;
83
+ max?: number;
84
+ }
85
+ export interface CustomLayoutProps {
86
+ layoutComponent: any;
87
+ }
88
+ export interface TableLayoutCellProps {
89
+ rowSpan: number;
90
+ colSpan: number;
91
+ children: any;
92
+ }
93
+ export interface FnFormOnChangeParams {
94
+ values: any;
95
+ stateMap: any;
96
+ storeData: any;
97
+ formStore: any;
98
+ formActions: any;
99
+ defaultValues: any;
100
+ runtimeParams: any;
101
+ valuesOfOnSearch: any;
102
+ eventArgs?: any[];
103
+ }
104
+ export interface FnValidatorObjRes {
105
+ message: string;
106
+ }
107
+ export type FnGetStateBool = (values: any, storeData: any) => boolean;
108
+ export type FnGetXProps = (values: any, storeData: any) => any;
109
+ export type FnGetEnums = (childProps: any, params: FnFormOnChangeParams) => ILabelValue[] | Promise<ILabelValue[]>;
110
+ export type FnValidator = (rule: FormItemValidateRule, value: any) => Promise<string | FnValidatorObjRes> | string | FnValidatorObjRes | null;
111
+ export type FnFormOnCreated = (values: any, params: FnFormOnChangeParams) => any;
112
+ export type FnFormOnChange = (values: any, params: FnFormOnChangeParams) => any;
113
+ export type FnFormItemOnChange = (value: any, params: FnFormOnChangeParams) => any;
114
+ export type FnFormOnSubmit = (values: any, params: FnFormOnChangeParams) => any;
115
+ export type TypeHelpPos = "tip" | 'always' | 'bottom';
116
+ export interface FormItemSchema {
117
+ id?: string;
118
+ label?: string | IReactElement;
119
+ size?: SizeEnum | string;
120
+ labelCol?: any;
121
+ wrapperCol?: any;
122
+ hasFeedback?: boolean;
123
+ help?: IFunc;
124
+ component?: string | IReactComponent;
125
+ labelAlign?: LabelAlignEnum;
126
+ labelTextAlign?: LabelTextAlignEnum;
127
+ labelWidth?: number;
128
+ device?: string;
129
+ colon?: boolean;
130
+ children?: any;
131
+ xProps?: any | FnGetXProps;
132
+ /**
133
+ * 布局方式
134
+ */
135
+ layout?: LayoutEnum | string;
136
+ cellProps?: any | TableLayoutCellProps;
137
+ className?: string;
138
+ style?: any;
139
+ prefix?: string;
140
+ fullWidth?: boolean;
141
+ render?: (value: any, childProps: any) => any;
142
+ renderPreview?: (value: any, childProps: any) => any;
143
+ renderExtra?: (value: any, wrapFormItemProps: any) => any;
144
+ previewPlaceholder?: string;
145
+ isPreview?: boolean | FnGetStateBool;
146
+ display?: boolean | FnGetStateBool;
147
+ disabled?: boolean | FnGetStateBool;
148
+ deps?: string[];
149
+ enums?: ILabelValue[] | FnGetEnums;
150
+ autoValidate?: boolean;
151
+ max?: number;
152
+ min?: number;
153
+ format?: string;
154
+ pattern?: string;
155
+ required?: boolean | FnGetStateBool;
156
+ requiredMessage?: string;
157
+ length?: number;
158
+ maxLength?: number;
159
+ minLength?: number;
160
+ validator?: FnValidator;
161
+ errorMessageName?: string;
162
+ useLabelForErrorMessage?: boolean;
163
+ rules?: FormItemValidateRule[];
164
+ helpPos?: TypeHelpPos;
165
+ onChange?: FnFormItemOnChange;
166
+ description?: string;
167
+ }
168
+ export interface FormItemProps extends FormItemSchema {
169
+ name: string;
170
+ }
171
+ export interface FormSchema {
172
+ type: string;
173
+ properties: Record<string, FormItemSchema>;
174
+ }
175
+ /**
176
+ * 表单Props
177
+ */
178
+ export interface FormProps {
179
+ /**
180
+ * 是否显示默认的提交按钮。默认 false
181
+ */
182
+ submitter?: boolean;
183
+ /**
184
+ * 样式前缀
185
+ */
186
+ prefix?: string;
187
+ /**
188
+ * 内联表单
189
+ */
190
+ inline?: boolean;
191
+ /**
192
+ * 单个 Item 的 size 自定义,优先级高于 Form 的 size, 并且当组件与 Item 一起使用时,组件自身设置 size 属性无效。
193
+ * @enumdesc 大, 中, 小
194
+ */
195
+ size?: string | SizeEnum;
196
+ /**
197
+ * 单个 Item 中表单类组件宽度是否是100%
198
+ */
199
+ fullWidth?: boolean;
200
+ /**
201
+ * 标签的位置, 如果不设置 labelCol 和 wrapperCol 那么默认是标签在上
202
+ * @enumdesc 上, 左, 内
203
+ */
204
+ labelAlign?: string | LabelAlignEnum;
205
+ /**
206
+ * 标签的左右对齐方式
207
+ * @enumdesc 左, 右
208
+ */
209
+ labelTextAlign?: string | LabelTextAlignEnum;
210
+ /**
211
+ * 控制第一级 Item 的 labelCol
212
+ */
213
+ labelCol?: IObject;
214
+ /**
215
+ * 控制第一级 Item 的 wrapperCol
216
+ */
217
+ wrapperCol?: IObject;
218
+ /**
219
+ * FormSubmit按钮会触发
220
+ */
221
+ onSubmit?: FnFormOnSubmit;
222
+ /**
223
+ * FormSubmit按钮会触发
224
+ */
225
+ onReset?: FnFormOnSubmit;
226
+ /**
227
+ * 组件创建完毕
228
+ */
229
+ onCreated?: FnFormOnCreated;
230
+ /**
231
+ * 表单变化回调
232
+ */
233
+ onChange?: FnFormOnChange;
234
+ /**
235
+ * 异步枚举值加载完成
236
+ */
237
+ onAsyncEnums?: FnGetEnums;
238
+ /**
239
+ * 子元素
240
+ */
241
+ children?: any;
242
+ /**
243
+ * 子元素schema模式
244
+ */
245
+ schema?: FormSchema | null;
246
+ /**
247
+ * 扩展class
248
+ */
249
+ className?: string;
250
+ /**
251
+ * 自定义内联样式
252
+ */
253
+ style?: IObject;
254
+ /**
255
+ * 是否是从从右往左的布局样式
256
+ */
257
+ rtl?: boolean;
258
+ /**
259
+ * 布局方式
260
+ */
261
+ layout?: LayoutEnum | null;
262
+ /**
263
+ * 布局组件使用的参数
264
+ */
265
+ layoutProps?: ResponsiveGridProps | CustomLayoutProps | FloatLayoutProps | null;
266
+ /**
267
+ * 是否使用 label 替换校验信息的 name 字段
268
+ */
269
+ useLabelForErrorMessage?: boolean;
270
+ /**
271
+ * 表示是否显示 label 后面的冒号
272
+ */
273
+ colon?: boolean;
274
+ /**
275
+ * 渲染设备。可选值:phone、desktop
276
+ */
277
+ device?: string;
278
+ /**
279
+ * 表单默认值
280
+ */
281
+ defaultValues?: any;
282
+ /**
283
+ * Form内可以使用的组件定义components
284
+ */
285
+ components?: Record<string, IReactComponent>;
286
+ /**
287
+ * 是否处于预览状态, 默认: false
288
+ */
289
+ isPreview?: boolean | FnGetStateBool;
290
+ /**
291
+ * 是否处于禁用状态,默认:false
292
+ */
293
+ disabled?: boolean | FnGetStateBool;
294
+ /**
295
+ * 是否处于显示状态,默认 true
296
+ */
297
+ display?: boolean | FnGetStateBool;
298
+ /**
299
+ * 自定义预览状态渲染
300
+ */
301
+ renderPreview?: IFunc;
302
+ /**
303
+ * 在预览状态下,对于空值的占位符,默认: --
304
+ */
305
+ previewPlaceholder?: string;
306
+ /**
307
+ * 错误提示显示位置: tip,bottom(default)
308
+ */
309
+ helpPos?: string;
310
+ /**
311
+ * 是否表单创建完成后,自动触发校验。
312
+ */
313
+ autoValidateOnCreated?: boolean;
314
+ /**
315
+ * 自动校验
316
+ */
317
+ autoValidate?: boolean;
318
+ /**
319
+ * 表单内部的多语言配置对象
320
+ */
321
+ locale?: any;
322
+ }
323
+ export interface IValidateStateError {
324
+ message: string;
325
+ }
326
+ export interface IFormStoreValues {
327
+ stateMap: Record<string, IItemState>;
328
+ defaultValues: Record<string, any>;
329
+ values: Record<string, any>;
330
+ runtimeParams: any;
331
+ valuesOfOnSearch: any;
332
+ }
333
+ export interface IFormContext {
334
+ formProps: FormProps;
335
+ formStore: any;
336
+ formActions: any;
337
+ formComponents: any;
338
+ formOnChange: any;
339
+ }
340
+ export interface WrapFormItemProps {
341
+ formItemProps: FormItemProps;
342
+ formItemState: FormItemState;
343
+ formContext: IFormContext;
344
+ }
345
+ export interface FormStoreExtData1 {
346
+ propsMap: Record<string, any>;
347
+ }
348
+ export interface IFormSectionProps extends FormProps {
349
+ useCard?: boolean;
350
+ title?: string;
351
+ }
352
+ export interface IFormSectionContext {
353
+ sectionProps: IFormSectionProps;
354
+ }
355
+ export interface BaseBtnProps {
356
+ type?: any;
357
+ onClick?: any;
358
+ children?: any;
359
+ text?: string;
360
+ bizCallback?: any;
361
+ localKey: string;
362
+ xProps?: any;
363
+ }
364
+ export interface ResetProps extends BaseBtnProps {
365
+ toDefault?: boolean;
366
+ names?: string[] | string;
367
+ exclude?: string[];
368
+ }
369
+ export interface SubmitProps extends BaseBtnProps {
370
+ validate?: boolean;
371
+ showToast?: boolean;
372
+ }
373
+ export interface FormButtonGroupBtn extends Record<string, any> {
374
+ component: string | any;
375
+ }
376
+ export interface FormButtonGroupProps {
377
+ id: string;
378
+ buttons: FormButtonGroupBtn[];
379
+ className?: string;
380
+ }
381
+ export interface IFormItemCardProps {
382
+ title?: string;
383
+ children?: any;
384
+ prefix?: string;
385
+ }
386
+ export {};
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import FormItem from './form-item';
3
+ import { FormProps } from "./form-types";
4
+ declare function Form(formProps: FormProps): React.JSX.Element;
5
+ declare namespace Form {
6
+ var defaultProps: {
7
+ prefix: string;
8
+ onSubmit: typeof import("../util/func").preventDefault;
9
+ size: string;
10
+ labelAlign: string;
11
+ onChange: () => void;
12
+ component: string;
13
+ device: string;
14
+ locale: any;
15
+ colon: boolean;
16
+ autoValidate: boolean;
17
+ useLabelForErrorMessage: boolean;
18
+ helpPos: string;
19
+ disabled: boolean;
20
+ isPreview: boolean;
21
+ display: boolean;
22
+ autoValidateOnCreated: boolean;
23
+ previewPlaceholder: string;
24
+ };
25
+ var displayName: string;
26
+ var Item: typeof FormItem;
27
+ var Section: any;
28
+ var Reset: any;
29
+ var Submit: any;
30
+ var Button: any;
31
+ var ButtonGroup: any;
32
+ var ItemCard: any;
33
+ var schemaToFormItems: (schema: any) => React.JSX.Element[];
34
+ var useFormChildren: (props: FormProps) => any[];
35
+ }
36
+ export default Form;
@@ -0,0 +1,5 @@
1
+ import { PreciseStore } from "../../hooks/usePreciseStore";
2
+ import { FormActions } from "../form-actions";
3
+ import { FnFormOnChangeParams } from "../form-types";
4
+ declare const buildFnFormOnChangeParams: (formStore: PreciseStore, formActions: FormActions) => FnFormOnChangeParams;
5
+ export { buildFnFormOnChangeParams };
@@ -0,0 +1,24 @@
1
+ declare const formDefaultProps: {
2
+ prefix: string;
3
+ onSubmit: typeof import("../../util/func").preventDefault;
4
+ size: string;
5
+ labelAlign: string;
6
+ onChange: () => void;
7
+ component: string;
8
+ device: string;
9
+ locale: any;
10
+ colon: boolean;
11
+ autoValidate: boolean;
12
+ useLabelForErrorMessage: boolean;
13
+ helpPos: string;
14
+ disabled: boolean;
15
+ isPreview: boolean;
16
+ display: boolean;
17
+ autoValidateOnCreated: boolean;
18
+ previewPlaceholder: string;
19
+ };
20
+ export declare const FORM_ITEM_TYPE_MARK: string;
21
+ export declare const FORM_SUBMIT_TYPE_MARK: string;
22
+ export declare const FORM_RESET_TYPE_MARK: string;
23
+ export declare const FORM_BUTTON_TYPE_MARK: string;
24
+ export { formDefaultProps };
@@ -0,0 +1,16 @@
1
+ import { FormItemProps, FormItemStateSaved, IFormContext, IFormSectionContext } from "../form-types";
2
+ /**
3
+ * 使用继承关系,设置FormItemProps
4
+ * @param props0
5
+ * @param formContext
6
+ * @param formSectionContext
7
+ * @param runtimeId
8
+ */
9
+ declare function fixItemPropsByInherit(props0: FormItemProps, formContext: IFormContext, formSectionContext: IFormSectionContext, runtimeId: string): FormItemProps;
10
+ /**
11
+ * 使用状态,设置FormItemProps
12
+ * @param props
13
+ * @param itemState
14
+ */
15
+ declare function fixItemPropsByState(props: FormItemProps, itemState: FormItemStateSaved): FormItemStateSaved;
16
+ export { fixItemPropsByInherit, fixItemPropsByState };
@@ -0,0 +1,2 @@
1
+ declare function inheritFormProps(props: any, formProps: any): any;
2
+ export { inheritFormProps };
@@ -0,0 +1,16 @@
1
+ import { PreciseStore } from "../../hooks/usePreciseStore";
2
+ import { FormItemProps } from "../form-types";
3
+ import { FormActions } from "../form-actions";
4
+ /**
5
+ * 对单个formItem的状态进行联动计算
6
+ * @param formStore
7
+ * @param itemProps
8
+ */
9
+ declare function linkageFormItemState(formStore: PreciseStore, itemProps: FormItemProps): void;
10
+ /**
11
+ * 对所有formItem的状态进行联动计算
12
+ * @param formStore
13
+ * @param formActions
14
+ */
15
+ declare function linkageFormState(formStore: PreciseStore, formActions: FormActions): void;
16
+ export { linkageFormState, linkageFormItemState };
@@ -0,0 +1,14 @@
1
+ import { IFormContext } from "../form-types";
2
+ /**
3
+ * dataSource 字段数据来源:
4
+ * 1. enums 是一个异步函数,可以异步返回
5
+ * 2. enums 是一个同步函数,可以直接返回
6
+ * 3. enums 是一个数组
7
+ * @param enums
8
+ * @param childProps
9
+ * @param xProps
10
+ * @param formContext
11
+ * @param forceUpdateTick
12
+ */
13
+ declare function useDataSource(enums: any, childProps: any, xProps: any, formContext: IFormContext, forceUpdateTick?: number): any;
14
+ export { useDataSource };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { FormProps } from "../form-types";
3
+ declare function schemaToFormItems(schema: any, FormItem: any): React.JSX.Element[];
4
+ declare function useFormChildren(props: FormProps, FormItem: any): any[];
5
+ export { useFormChildren, schemaToFormItems };
@@ -0,0 +1,3 @@
1
+ import { FormItemProps, FormItemState, IFormContext } from "../form-types";
2
+ declare function useFormItemState(props: FormItemProps, formContext: IFormContext): FormItemState;
3
+ export { useFormItemState };
@@ -0,0 +1,3 @@
1
+ import { FormItemProps, FormItemState, IFormContext } from "../form-types";
2
+ declare function useGetXProps(formItemProps: FormItemProps, formItemState: FormItemState, formContext: IFormContext): any;
3
+ export { useGetXProps };
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import FormItem from './form-item';
3
+ import { FormButton, FormButtonGroup, Reset, Submit } from './form-buttons';
4
+ import { FormProps } from "./form-types";
5
+ import { FormSection } from "./form-section";
6
+ import { FormItemCard } from "./form-item-card";
7
+ declare class Form extends React.Component<FormProps, any> {
8
+ static Item: typeof FormItem;
9
+ static ItemCard: typeof FormItemCard;
10
+ static Section: typeof FormSection;
11
+ static Submit: typeof Submit;
12
+ static Reset: typeof Reset;
13
+ static Button: typeof FormButton;
14
+ static ButtonGroup: typeof FormButtonGroup;
15
+ static schemaToFormItems: (schema: any) => React.JSX.Element[];
16
+ static useFormChildren: (props: FormProps) => any[];
17
+ render(): React.JSX.Element;
18
+ }
19
+ declare const _default: typeof Form;
20
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare function FromFloatLayout(props: any): React.JSX.Element;
3
+ export { FromFloatLayout };
@@ -0,0 +1,16 @@
1
+ import { useCreatePreciseStore, useGetPreciseStore, usePreciseValue, usePreciseTick, PreciseStore } from './usePreciseStore';
2
+ import { useCurrentState, useCurrentState2 } from './useCurrentState';
3
+ import { useOnKeyPressCtrl, useOnKeyPressSave } from "./useOnKeyPressSave";
4
+ declare const _default: {
5
+ PreciseStore: typeof PreciseStore;
6
+ useCreatePreciseStore: typeof useCreatePreciseStore;
7
+ useGetPreciseStore: typeof useGetPreciseStore;
8
+ usePreciseValue: typeof usePreciseValue;
9
+ usePreciseTick: typeof usePreciseTick;
10
+ useUniqueId: () => string;
11
+ useCurrentState: typeof useCurrentState;
12
+ useCurrentState2: typeof useCurrentState2;
13
+ useOnKeyPressCtrl: typeof useOnKeyPressCtrl;
14
+ useOnKeyPressSave: typeof useOnKeyPressSave;
15
+ };
16
+ export default _default;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * state 可以是任何值
3
+ * @param initialState
4
+ */
5
+ declare function useCurrentState(initialState: any): any[];
6
+ /**
7
+ * state 必须是个对象
8
+ * @param initialState
9
+ */
10
+ declare function useCurrentState2(initialState?: any): any[];
11
+ export { useCurrentState, useCurrentState2, };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 响应键盘 Ctrl + XXXX 事件
3
+ * @param fn
4
+ * @param keyCode
5
+ */
6
+ declare function useOnKeyPressCtrl(fn: any, keyCode: number): void;
7
+ /**
8
+ * 响应键盘 Ctrl + S 事件
9
+ * @param fn
10
+ */
11
+ declare function useOnKeyPressSave(fn: any): void;
12
+ export { useOnKeyPressCtrl, useOnKeyPressSave };
@@ -0,0 +1,3 @@
1
+ declare function usePersistFn(fn: any): any;
2
+ declare const useMemoizedFn: typeof usePersistFn;
3
+ export { usePersistFn, useMemoizedFn };
@@ -0,0 +1,53 @@
1
+ import { CompareFn } from "../util/isStateEquals";
2
+ export type AnyType = any;
3
+ export declare const KEY_SAVED_TICK_COUNT = "KEY_SAVED_TICK_COUNT";
4
+ export type WatcherFn = (nextValue: any, preValue: any, storage: PreciseStore) => void;
5
+ export interface Watcher {
6
+ watchPath: string;
7
+ watcher: WatcherFn;
8
+ preValue: any;
9
+ }
10
+ type UpdateFn<A> = (nextValue: A) => void;
11
+ type GetFn<A> = () => A;
12
+ declare class PreciseStore {
13
+ readonly storeData: Record<string, any>;
14
+ private watcherManager;
15
+ private updatedBuffer;
16
+ private tickCount;
17
+ compareFn: CompareFn;
18
+ linkageFn: any;
19
+ extData1: any;
20
+ extData2: any;
21
+ constructor(initialValues: Record<any, any>, compareFn?: CompareFn, linkageFn?: any);
22
+ getValue(path: string): any;
23
+ setValue(path: string, value: any): void;
24
+ commit(): void;
25
+ setValueAndCommit(path: string, value: any): void;
26
+ watch(path: string, watcher: WatcherFn): void;
27
+ unwatch(path: string, watcher: WatcherFn): void;
28
+ notifyWatcher(): void;
29
+ }
30
+ /**
31
+ * 创建一个PreciseStore
32
+ * @param initialValues
33
+ * @param compareFn
34
+ * @param linkageFn
35
+ */
36
+ declare function useCreatePreciseStore(initialValues: any, compareFn?: CompareFn, linkageFn?: any): PreciseStore;
37
+ /**
38
+ * 从Context中获取PreciseStore
39
+ * @param context
40
+ */
41
+ declare function useGetPreciseStore(context: any): PreciseStore;
42
+ /**
43
+ * 订阅并获取value的变化
44
+ * @param store
45
+ * @param path
46
+ */
47
+ declare function usePreciseValue(store: PreciseStore, path: string): [any, UpdateFn<AnyType>, GetFn<AnyType>, PreciseStore];
48
+ /**
49
+ * 监听任何一次变更
50
+ * @param store
51
+ */
52
+ declare function usePreciseTick(store: PreciseStore): [AnyType, UpdateFn<AnyType>, GetFn<AnyType>, PreciseStore];
53
+ export { PreciseStore, useCreatePreciseStore, useGetPreciseStore, usePreciseValue, usePreciseTick, };
@@ -0,0 +1,6 @@
1
+ export interface UseSizeRes {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ declare function useSize(target: any): UseSizeRes;
6
+ export { useSize };
@@ -0,0 +1,2 @@
1
+ declare const useUniqueId: () => string;
2
+ export { useUniqueId, };
@@ -0,0 +1,2 @@
1
+ declare function useValueOnChange(props: any): any[];
2
+ export { useValueOnChange };