fan-standard-comp 3.2.0 → 3.2.2

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 (293) hide show
  1. package/Readme.md +1 -33
  2. package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
  3. package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
  4. package/dist/fan-standard-comp.umd.js +166 -444
  5. package/dist/fonts/iconfont.ttf +0 -0
  6. package/dist/fonts/iconfont.woff +0 -0
  7. package/dist/fonts/lg.ttf +0 -0
  8. package/dist/fonts/lg.woff +0 -0
  9. package/dist/fonts/lg.woff2 +0 -0
  10. package/es/ButtonGroup/ButtonList.d.ts +2 -1
  11. package/es/ButtonGroup/ButtonMenu.d.ts +2 -1
  12. package/es/ButtonGroup/PopConfirmTitle.js +5 -5
  13. package/es/ButtonGroup/index.d.ts +3 -1
  14. package/es/ButtonGroup/index.js +147 -178
  15. package/es/ButtonGroup/style/index.less +4 -1
  16. package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  17. package/es/CalendarCoordPicker/CalendarMonthPicker.js +26 -0
  18. package/es/CalendarCoordPicker/index.d.ts +8 -0
  19. package/es/CalendarCoordPicker/index.js +296 -0
  20. package/es/CalendarCoordPicker/index.less +31 -0
  21. package/es/ConfigContext/index.d.ts +7 -0
  22. package/es/ConfigContext/index.js +12 -0
  23. package/es/DragContent/index.d.ts +1 -1
  24. package/es/DragContent/index.js +5 -5
  25. package/es/FormComp/ChunkUploader/api.js +14 -14
  26. package/es/FormComp/ChunkUploader/index.js +132 -139
  27. package/es/FormComp/ChunkUploader/lib.js +21 -21
  28. package/es/FormComp/ChunkUploader/upload-queue.class.js +64 -66
  29. package/es/FormComp/EditButton/index.d.ts +1 -1
  30. package/es/FormComp/EditButton/index.js +15 -17
  31. package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  32. package/es/FormComp/FieldComponent/ReUpload.js +37 -23
  33. package/es/FormComp/FieldComponent/RefactorTextarea.js +32 -0
  34. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +72 -19
  35. package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  36. package/es/FormComp/FieldComponent/index.d.ts +1 -1
  37. package/es/FormComp/FieldComponent/index.js +33 -23
  38. package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
  39. package/es/FormComp/RenderItemGroup/index.js +24 -8
  40. package/es/FormComp/Uploader/index.d.ts +3 -1
  41. package/es/FormComp/Uploader/index.js +243 -119
  42. package/es/FormComp/VarTemplate/index.js +57 -64
  43. package/es/ImageGallery/ImagePreview.d.ts +13 -0
  44. package/es/ImageGallery/ImagePreview.js +168 -0
  45. package/es/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
  46. package/es/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
  47. package/es/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
  48. package/es/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
  49. package/es/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
  50. package/es/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
  51. package/es/ImageGallery/PreviewStyles/lg-video.css +144 -0
  52. package/es/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
  53. package/es/ImageGallery/PreviewStyles/lightgallery.css +728 -0
  54. package/es/ImageGallery/SliderContent.d.ts +7 -0
  55. package/es/ImageGallery/SliderContent.js +699 -0
  56. package/es/ImageGallery/Thumbnail.d.ts +3 -0
  57. package/es/ImageGallery/Thumbnail.js +296 -0
  58. package/es/ImageGallery/hook/uniqueId.d.ts +1 -0
  59. package/es/ImageGallery/hook/uniqueId.js +10 -0
  60. package/es/ImageGallery/index.d.ts +4 -0
  61. package/es/ImageGallery/index.js +29 -0
  62. package/es/ImageGallery/style/index.less +5 -0
  63. package/es/ImageGallery/types.d.ts +5 -0
  64. package/es/ImageGallery/types.js +1 -0
  65. package/es/NavLeafScroll/index.js +94 -50
  66. package/es/RefactorTree/index.d.ts +1 -1
  67. package/es/RefactorTree/index.js +6 -6
  68. package/es/RefactorTree/indexTreeNode.d.ts +1 -1
  69. package/es/RefactorTree/indexTreeNode.js +19 -17
  70. package/es/RefactorTree/util.js +18 -18
  71. package/es/SpecIcon/fonts/demo_index.html +559 -5
  72. package/es/SpecIcon/fonts/iconfont.css +101 -3
  73. package/es/SpecIcon/fonts/iconfont.js +34 -27
  74. package/es/SpecIcon/fonts/iconfont.json +168 -0
  75. package/es/SpecIcon/fonts/iconfont.svg +163 -171
  76. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  77. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  78. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  79. package/es/SpecIcon/style/iconfont.less +106 -11
  80. package/es/SplitterLayout/Pane.d.ts +1 -1
  81. package/es/SplitterLayout/index.js +25 -26
  82. package/es/StandardContent/SplitterLayout/Pane.js +3 -3
  83. package/es/StandardContent/SplitterLayout/index.js +25 -26
  84. package/es/StandardContent/SubfieldContent.d.ts +1 -1
  85. package/es/StandardContent/WrapperContent.d.ts +1 -1
  86. package/es/StandardDragModal/index.d.ts +11 -3
  87. package/es/StandardDragModal/index.js +25 -3
  88. package/es/StandardFilter/index.d.ts +5 -16
  89. package/es/StandardFilter/index.js +212 -200
  90. package/es/StandardFilter/indexClass.d.ts +37 -0
  91. package/es/StandardFilter/indexClass.js +217 -0
  92. package/es/StandardFilter/style/index.less +82 -9
  93. package/es/StandardForm/StepForm.d.ts +1 -1
  94. package/es/StandardForm/StepForm.js +28 -22
  95. package/es/StandardForm/TabForm.d.ts +1 -1
  96. package/es/StandardForm/TabForm.js +41 -43
  97. package/es/StandardForm/index.d.ts +1 -1
  98. package/es/StandardForm/index.js +5 -5
  99. package/es/StandardModal/UpdateFormRef.js +0 -1
  100. package/es/StandardModal/index.d.ts +2 -1
  101. package/es/StandardModal/index.js +25 -39
  102. package/es/StandardPanel/index.d.ts +1 -1
  103. package/es/StandardPanel/index.js +7 -7
  104. package/es/StandardTable/index.d.ts +1 -0
  105. package/es/StandardTable/index.js +44 -26
  106. package/es/components/IconNode/index.d.ts +1 -1
  107. package/es/components/IconNode/index.js +0 -1
  108. package/es/data/general.config.js +31 -0
  109. package/es/index.d.ts +3 -1
  110. package/es/index.js +6 -2
  111. package/es/utils/filterPermission.js +7 -10
  112. package/es/utils/getParentNodes.js +101 -26
  113. package/es/utils/index.js +2 -3
  114. package/es/utils/urlUtils.js +76 -0
  115. package/lib/ButtonGroup/ButtonList.d.ts +2 -1
  116. package/lib/ButtonGroup/ButtonList.js +2 -3
  117. package/lib/ButtonGroup/ButtonMenu.d.ts +2 -1
  118. package/lib/ButtonGroup/ButtonMenu.js +2 -3
  119. package/lib/ButtonGroup/PopConfirmTitle.js +7 -8
  120. package/lib/ButtonGroup/index.d.ts +3 -1
  121. package/lib/ButtonGroup/index.js +151 -183
  122. package/lib/ButtonGroup/style/index.less +4 -1
  123. package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  124. package/lib/CalendarCoordPicker/CalendarMonthPicker.js +36 -0
  125. package/lib/CalendarCoordPicker/index.d.ts +8 -0
  126. package/lib/CalendarCoordPicker/index.js +305 -0
  127. package/lib/CalendarCoordPicker/index.less +31 -0
  128. package/lib/ConfigContext/index.d.ts +7 -0
  129. package/lib/ConfigContext/index.js +17 -0
  130. package/lib/DragContent/DragBar.js +2 -3
  131. package/lib/DragContent/index.d.ts +1 -1
  132. package/lib/DragContent/index.js +9 -10
  133. package/lib/FormComp/ChunkUploader/api.js +15 -15
  134. package/lib/FormComp/ChunkUploader/index.js +135 -142
  135. package/lib/FormComp/ChunkUploader/lib.js +22 -22
  136. package/lib/FormComp/ChunkUploader/upload-queue.class.js +66 -69
  137. package/lib/FormComp/ChunkUploader/worker.js +1 -1
  138. package/lib/FormComp/EditButton/index.d.ts +1 -1
  139. package/lib/FormComp/EditButton/index.js +19 -22
  140. package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  141. package/lib/FormComp/FieldComponent/ReUpload.js +40 -28
  142. package/lib/FormComp/FieldComponent/RefactorTextarea.js +42 -0
  143. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +75 -23
  144. package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  145. package/lib/FormComp/FieldComponent/TitleNode.js +2 -3
  146. package/lib/FormComp/FieldComponent/index.d.ts +1 -1
  147. package/lib/FormComp/FieldComponent/index.js +38 -26
  148. package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
  149. package/lib/FormComp/RenderItemGroup/index.js +26 -11
  150. package/lib/FormComp/Uploader/index.d.ts +3 -1
  151. package/lib/FormComp/Uploader/index.js +244 -123
  152. package/lib/FormComp/VarTemplate/index.js +63 -71
  153. package/lib/FormComp/index.js +1 -1
  154. package/lib/ImageGallery/ImagePreview.d.ts +13 -0
  155. package/lib/ImageGallery/ImagePreview.js +178 -0
  156. package/lib/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
  157. package/lib/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
  158. package/lib/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
  159. package/lib/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
  160. package/lib/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
  161. package/lib/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
  162. package/lib/ImageGallery/PreviewStyles/lg-video.css +144 -0
  163. package/lib/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
  164. package/lib/ImageGallery/PreviewStyles/lightgallery.css +728 -0
  165. package/lib/ImageGallery/SliderContent.d.ts +7 -0
  166. package/lib/ImageGallery/SliderContent.js +708 -0
  167. package/lib/ImageGallery/Thumbnail.d.ts +3 -0
  168. package/lib/ImageGallery/Thumbnail.js +306 -0
  169. package/lib/ImageGallery/hook/uniqueId.d.ts +1 -0
  170. package/lib/ImageGallery/hook/uniqueId.js +17 -0
  171. package/lib/ImageGallery/index.d.ts +4 -0
  172. package/lib/ImageGallery/index.js +36 -0
  173. package/lib/ImageGallery/style/index.less +5 -0
  174. package/lib/ImageGallery/types.d.ts +5 -0
  175. package/lib/ImageGallery/types.js +5 -0
  176. package/lib/NavLeafScroll/index.js +98 -55
  177. package/lib/RefactorTree/index.d.ts +1 -1
  178. package/lib/RefactorTree/index.js +10 -11
  179. package/lib/RefactorTree/indexTreeNode.d.ts +1 -1
  180. package/lib/RefactorTree/indexTreeNode.js +23 -22
  181. package/lib/RefactorTree/util.js +18 -18
  182. package/lib/SpecIcon/fonts/demo_index.html +559 -5
  183. package/lib/SpecIcon/fonts/iconfont.css +101 -3
  184. package/lib/SpecIcon/fonts/iconfont.js +34 -27
  185. package/lib/SpecIcon/fonts/iconfont.json +168 -0
  186. package/lib/SpecIcon/fonts/iconfont.svg +163 -171
  187. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  188. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  189. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  190. package/lib/SpecIcon/index.js +2 -3
  191. package/lib/SpecIcon/style/iconfont.less +106 -11
  192. package/lib/SplitterLayout/Pane.d.ts +1 -1
  193. package/lib/SplitterLayout/Pane.js +2 -3
  194. package/lib/SplitterLayout/index.js +27 -29
  195. package/lib/StandardContent/SplitterLayout/Pane.js +5 -6
  196. package/lib/StandardContent/SplitterLayout/index.js +27 -29
  197. package/lib/StandardContent/SubfieldContent.d.ts +1 -1
  198. package/lib/StandardContent/SubfieldContent.js +2 -3
  199. package/lib/StandardContent/WrapperContent.d.ts +1 -1
  200. package/lib/StandardContent/WrapperContent.js +2 -3
  201. package/lib/StandardDragModal/index.d.ts +11 -3
  202. package/lib/StandardDragModal/index.js +27 -33
  203. package/lib/StandardFilter/index.d.ts +5 -16
  204. package/lib/StandardFilter/index.js +215 -201
  205. package/lib/StandardFilter/indexClass.d.ts +37 -0
  206. package/lib/StandardFilter/indexClass.js +223 -0
  207. package/lib/StandardFilter/style/index.less +82 -9
  208. package/lib/StandardForm/ActionList.js +2 -3
  209. package/lib/StandardForm/StepForm.d.ts +1 -1
  210. package/lib/StandardForm/StepForm.js +32 -27
  211. package/lib/StandardForm/TabForm.d.ts +1 -1
  212. package/lib/StandardForm/TabForm.js +45 -48
  213. package/lib/StandardForm/index.d.ts +1 -1
  214. package/lib/StandardForm/index.js +9 -10
  215. package/lib/StandardModal/UpdateFormRef.js +3 -4
  216. package/lib/StandardModal/index.d.ts +2 -1
  217. package/lib/StandardModal/index.js +29 -43
  218. package/lib/StandardPanel/index.d.ts +1 -1
  219. package/lib/StandardPanel/index.js +11 -12
  220. package/lib/StandardTable/index.d.ts +1 -0
  221. package/lib/StandardTable/index.js +49 -29
  222. package/lib/components/IconNode/index.d.ts +1 -1
  223. package/lib/components/IconNode/index.js +2 -4
  224. package/lib/components/index.js +1 -1
  225. package/lib/data/func.code.js +2 -3
  226. package/lib/data/general.config.js +33 -3
  227. package/lib/data/index.js +1 -1
  228. package/lib/index.d.ts +3 -1
  229. package/lib/index.js +30 -10
  230. package/lib/utils/ValueFormat.js +1 -2
  231. package/lib/utils/filterPermission.js +11 -18
  232. package/lib/utils/getParentNodes.js +103 -29
  233. package/lib/utils/index.js +5 -27
  234. package/lib/utils/urlUtils.js +82 -0
  235. package/package.json +14 -9
  236. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
  237. package/dist/fonts/iconfont.eot +0 -0
  238. package/es/StandardDragModal/ChangeStandardModal.d.ts +0 -44
  239. package/es/StandardDragModal/ChangeStandardModal.js +0 -493
  240. package/es/StandardDragModal/DraggableModal.d.ts +0 -7
  241. package/es/StandardDragModal/DraggableModal.js +0 -31
  242. package/es/StandardDragModal/DraggableModalContext.d.ts +0 -9
  243. package/es/StandardDragModal/DraggableModalContext.js +0 -5
  244. package/es/StandardDragModal/DraggableModalInner.d.ts +0 -16
  245. package/es/StandardDragModal/DraggableModalInner.js +0 -114
  246. package/es/StandardDragModal/DraggableModalProvider.d.ts +0 -4
  247. package/es/StandardDragModal/DraggableModalProvider.js +0 -40
  248. package/es/StandardDragModal/Modal.d.ts +0 -11
  249. package/es/StandardDragModal/Modal.js +0 -24
  250. package/es/StandardDragModal/ResizeHandle.d.ts +0 -2
  251. package/es/StandardDragModal/ResizeHandle.js +0 -8
  252. package/es/StandardDragModal/clamp.d.ts +0 -1
  253. package/es/StandardDragModal/clamp.js +0 -3
  254. package/es/StandardDragModal/draggableModalReducer.d.ts +0 -66
  255. package/es/StandardDragModal/draggableModalReducer.js +0 -157
  256. package/es/StandardDragModal/getWindowSize.d.ts +0 -4
  257. package/es/StandardDragModal/getWindowSize.js +0 -6
  258. package/es/StandardDragModal/index.less +0 -65
  259. package/es/StandardDragModal/useDrag.d.ts +0 -5
  260. package/es/StandardDragModal/useDrag.js +0 -66
  261. package/es/StandardDragModal/usePrevious.d.ts +0 -1
  262. package/es/StandardDragModal/usePrevious.js +0 -8
  263. package/es/StandardDragModal/useResize.d.ts +0 -7
  264. package/es/StandardDragModal/useResize.js +0 -74
  265. package/es/utils/dictSelectUtil.js +0 -153
  266. package/lib/StandardDragModal/ChangeStandardModal.d.ts +0 -44
  267. package/lib/StandardDragModal/ChangeStandardModal.js +0 -502
  268. package/lib/StandardDragModal/DraggableModal.d.ts +0 -7
  269. package/lib/StandardDragModal/DraggableModal.js +0 -40
  270. package/lib/StandardDragModal/DraggableModalContext.d.ts +0 -9
  271. package/lib/StandardDragModal/DraggableModalContext.js +0 -15
  272. package/lib/StandardDragModal/DraggableModalInner.d.ts +0 -16
  273. package/lib/StandardDragModal/DraggableModalInner.js +0 -124
  274. package/lib/StandardDragModal/DraggableModalProvider.d.ts +0 -4
  275. package/lib/StandardDragModal/DraggableModalProvider.js +0 -48
  276. package/lib/StandardDragModal/Modal.d.ts +0 -11
  277. package/lib/StandardDragModal/Modal.js +0 -32
  278. package/lib/StandardDragModal/ResizeHandle.d.ts +0 -2
  279. package/lib/StandardDragModal/ResizeHandle.js +0 -18
  280. package/lib/StandardDragModal/clamp.d.ts +0 -1
  281. package/lib/StandardDragModal/clamp.js +0 -10
  282. package/lib/StandardDragModal/draggableModalReducer.d.ts +0 -66
  283. package/lib/StandardDragModal/draggableModalReducer.js +0 -167
  284. package/lib/StandardDragModal/getWindowSize.d.ts +0 -4
  285. package/lib/StandardDragModal/getWindowSize.js +0 -13
  286. package/lib/StandardDragModal/index.less +0 -65
  287. package/lib/StandardDragModal/useDrag.d.ts +0 -5
  288. package/lib/StandardDragModal/useDrag.js +0 -73
  289. package/lib/StandardDragModal/usePrevious.d.ts +0 -1
  290. package/lib/StandardDragModal/usePrevious.js +0 -15
  291. package/lib/StandardDragModal/useResize.d.ts +0 -7
  292. package/lib/StandardDragModal/useResize.js +0 -81
  293. package/lib/utils/dictSelectUtil.js +0 -161
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  interface TitleNodeProps {
2
3
  render?: any;
3
4
  data?: any;
4
5
  }
5
- declare const TitleNode: (props: TitleNodeProps) => JSX.Element;
6
+ declare const TitleNode: (props: TitleNodeProps) => React.JSX.Element;
6
7
  export default TitleNode;
@@ -10,7 +10,7 @@ interface OptionNameProps {
10
10
  }
11
11
  export interface FieldComponentProps {
12
12
  label?: any;
13
- type?: String;
13
+ type?: string;
14
14
  filedName?: string;
15
15
  value?: any;
16
16
  protoConfig?: any;
@@ -24,17 +24,19 @@ import "antd/es/select/style";
24
24
  import _Select from "antd/es/select";
25
25
  import "antd/es/input/style";
26
26
  import _Input from "antd/es/input";
27
- import React from "react";
27
+ import React, { useContext } from "react";
28
28
  import Uploader from '../Uploader';
29
29
  import SpecIcon from '../../SpecIcon';
30
30
  import RefactorTreeSelect from './RefactorTreeSelect.js';
31
31
  import { setSelectValue, setUploaderValue, setDatePickerValue, setTimePickerValue, setCascaderValue } from './setReadonlyValues.js';
32
32
  import TitleNode from './TitleNode';
33
33
  import ReUpload from './ReUpload';
34
+ import { FanContext } from '../../ConfigContext';
34
35
  var TextArea = _Input.TextArea,
35
36
  Password = _Input.Password;
36
37
  var Option = _Select.Option;
37
- var RangePicker = _DatePicker.RangePicker; // 表单组件类型
38
+ var RangePicker = _DatePicker.RangePicker;
39
+ // 表单组件类型
38
40
  var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
39
41
  var type = props.type,
40
42
  _onChange = props.onChange,
@@ -69,6 +71,8 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
69
71
  selectOptionRender = props.selectOptionRender,
70
72
  render = props.render;
71
73
  var selectOptions = props.selectOptions;
74
+ var InitFanContext = useContext(FanContext);
75
+ var providerConfig = InitFanContext[type] || {}; // 使用上下文(全局配置)设置扩展的配置项
72
76
  var compContent;
73
77
  if (selectOptionName && selectOptions) {
74
78
  // 将传值的数据进行转换
@@ -81,14 +85,14 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
81
85
  });
82
86
  });
83
87
  }
84
- var defaultProps = Object.assign({
88
+ var defaultProps = Object.assign(Object.assign({
85
89
  style: style,
86
90
  onChange: _onChange,
87
91
  value: value,
88
92
  render: render,
89
93
  size: size,
90
94
  ref: ref
91
- }, protoConfig);
95
+ }, providerConfig), protoConfig);
92
96
  if (fieldStatus === 'disabled') {
93
97
  defaultProps.disabled = true;
94
98
  }
@@ -104,35 +108,41 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
104
108
  var viewOnly = fieldStatus === 'viewOnly'; // 是否纯展示
105
109
  switch (type) {
106
110
  case 'input':
107
- compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(_Input, Object.assign({
111
+ compContent = viewOnly ? value || '-' : (/*#__PURE__*/React.createElement(_Input, Object.assign({
108
112
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
109
113
  autoComplete: "off",
110
114
  title: fieldStatus === 'disabled' || defaultProps.disabled ? value : null,
111
- maxLength: defaultProps.maxLength || 50
112
- }, defaultProps));
115
+ maxLength: defaultProps.maxLength || 50,
116
+ onKeyDown: function onKeyDown(evt) {
117
+ if (evt.key === 'Enter') {
118
+ // 表单只有一个输入框时,焦点定到输入框后按下Enter会触发提交事件
119
+ evt.preventDefault(); // 禁止默认行为
120
+ }
121
+ }
122
+ }, defaultProps)));
113
123
  break;
114
124
  case 'password':
115
- compContent = viewOnly ? value ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : '-' : /*#__PURE__*/React.createElement(Password, Object.assign({
125
+ compContent = viewOnly ? value ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : '-' : (/*#__PURE__*/React.createElement(Password, Object.assign({
116
126
  autoComplete: "off",
117
127
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
118
128
  maxLength: defaultProps.maxLength || 50
119
- }, defaultProps));
129
+ }, defaultProps)));
120
130
  break;
121
131
  case 'textarea':
122
- compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(TextArea, Object.assign({
132
+ compContent = viewOnly ? value || '-' : (/*#__PURE__*/React.createElement(TextArea, Object.assign({
123
133
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
124
134
  maxLength: defaultProps.maxLength || 500,
125
135
  title: fieldStatus === 'disabled' || defaultProps.disabled ? value : null
126
- }, defaultProps));
136
+ }, defaultProps)));
127
137
  break;
128
138
  case 'inputNumber':
129
- compContent = viewOnly ? value || 0 : /*#__PURE__*/React.createElement(_InputNumber, Object.assign({
139
+ compContent = viewOnly ? value || 0 : (/*#__PURE__*/React.createElement(_InputNumber, Object.assign({
130
140
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入数字'
131
141
  }, sortLimitRule, defaultProps, {
132
142
  style: Object.assign({
133
143
  width: '120px'
134
144
  }, defaultProps.style)
135
- }));
145
+ })));
136
146
  break;
137
147
  case 'select':
138
148
  // 重置返回完整字段值
@@ -153,7 +163,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
153
163
  selectOptionRender: selectOptionRender,
154
164
  defaultProps: defaultProps,
155
165
  type: type
156
- }) : /*#__PURE__*/React.createElement(_Select, Object.assign({
166
+ }) : (/*#__PURE__*/React.createElement(_Select, Object.assign({
157
167
  allowClear: true,
158
168
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || "".concat(defaultProps.showSearch ? '请输入选择' : '请选择'),
159
169
  filterOption: function filterOption(inputValue, option) {
@@ -172,7 +182,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
172
182
  title: selectOptionRender ? selectOptionRender(val) : val.title || val.label,
173
183
  disabled: val.disabled
174
184
  }, selectOptionRender ? selectOptionRender(val) : val.label);
175
- }));
185
+ })));
176
186
  break;
177
187
  case 'tree-select':
178
188
  compContent = /*#__PURE__*/React.createElement(RefactorTreeSelect, Object.assign({
@@ -280,13 +290,13 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
280
290
  compContent = viewOnly ? setTimePickerValue(value, {
281
291
  type: type,
282
292
  protoConfig: protoConfig
283
- }) : /*#__PURE__*/React.createElement(_TimePicker, Object.assign({}, defaultProps, {
293
+ }) : (/*#__PURE__*/React.createElement(_TimePicker, Object.assign({}, defaultProps, {
284
294
  style: Object.assign(Object.assign({
285
295
  'minWidth': 'auto'
286
296
  }, defaultProps.style), {
287
297
  width: 'auto'
288
298
  })
289
- }));
299
+ })));
290
300
  break;
291
301
  case 'timePickerRange':
292
302
  if (fieldStatus === 'disabled' || defaultProps.disabled) defaultProps.placeholder = ''; // 禁用时,placeHolder不显示
@@ -294,13 +304,13 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
294
304
  compContent = viewOnly ? setTimePickerValue(value, {
295
305
  type: type,
296
306
  protoConfig: protoConfig
297
- }) : /*#__PURE__*/React.createElement(_TimePicker.RangePicker, Object.assign({}, defaultProps, {
307
+ }) : (/*#__PURE__*/React.createElement(_TimePicker.RangePicker, Object.assign({}, defaultProps, {
298
308
  style: Object.assign(Object.assign({
299
309
  'minWidth': 'auto'
300
310
  }, defaultProps.style), {
301
311
  width: 'auto'
302
312
  })
303
- }));
313
+ })));
304
314
  break;
305
315
  case 'upload':
306
316
  compContent = viewOnly && (!value || value.length === 0) ? '-' : /*#__PURE__*/React.createElement(ReUpload, Object.assign({}, defaultProps, {
@@ -327,12 +337,12 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
327
337
  selectOptions: selectOptions,
328
338
  selectOptionRender: selectOptionRender,
329
339
  defaultProps: defaultProps
330
- }) : /*#__PURE__*/React.createElement(_Cascader, Object.assign({
340
+ }) : (/*#__PURE__*/React.createElement(_Cascader, Object.assign({
331
341
  options: selectOptions,
332
342
  allowClear: true,
333
343
  fieldNames: (defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.fieldNames) || selectOptionName,
334
344
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请选择'
335
- }, defaultProps));
345
+ }, defaultProps)));
336
346
  break;
337
347
  case 'switch':
338
348
  compContent = /*#__PURE__*/React.createElement(_Switch, Object.assign({}, defaultProps, {
@@ -345,9 +355,9 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
345
355
  // compContent = viewOnly ? (String(value) === 'undefined' ? '-' : String(value)) : (<Switch {...defaultProps} checked={value} style={{ ...defaultProps.style, width: 'auto' }} />)
346
356
  break;
347
357
  case 'slider':
348
- compContent = viewOnly ? value : /*#__PURE__*/React.createElement(_Slider, Object.assign({}, defaultProps, {
358
+ compContent = viewOnly ? value : (/*#__PURE__*/React.createElement(_Slider, Object.assign({}, defaultProps, {
349
359
  style: Object.assign({}, defaultProps.style)
350
- }));
360
+ })));
351
361
  break;
352
362
  case 'mentions':
353
363
  compContent = viewOnly ? value : /*#__PURE__*/React.createElement(_Mentions, Object.assign({
@@ -1,11 +1,11 @@
1
1
  import "antd/es/image/style";
2
2
  import _Image from "antd/es/image";
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
4
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
5
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
6
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
9
9
  import React, { useEffect, useMemo, useState } from "react";
10
10
  import moment from 'moment';
11
11
  import { getBase64 } from "../Uploader/util";
@@ -65,7 +65,7 @@ var setSelectValue = function setSelectValue(value, props) {
65
65
  if (matchValue.length > 0) {
66
66
  // 如果 select 配置选项展示内容,则直接使用其配置值展示当前只读信息
67
67
  if (selectOptionRender) {
68
- matchValues.push( /*#__PURE__*/React.createElement("div", {
68
+ matchValues.push(/*#__PURE__*/React.createElement("div", {
69
69
  key: index,
70
70
  className: "checkbox-viewonly-item"
71
71
  }, selectOptionRender(matchValue[0]), value.length - 1 > index ? separator ? separator : separator == null ? '' : ',' : ''));
@@ -32,6 +32,9 @@ var RenderItemGroup = function RenderItemGroup(props) {
32
32
  if (modalSize === 'lg' || modalSize === 'xlg') {
33
33
  return 8;
34
34
  }
35
+ if (modalSize === 'xxlg') {
36
+ return 6;
37
+ }
35
38
  return 12;
36
39
  };
37
40
  var updateFormFields = function updateFormFields() {
@@ -48,6 +51,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
48
51
  }
49
52
  return isHide || false;
50
53
  };
54
+ // layout='inline'条件下设置指定控件宽度自动
55
+ var setAutoWidth = function setAutoWidth(fieldType) {
56
+ var widgets = ['checkbox', 'radio', 'datePicker', 'dateTimePicker', 'rangePicker', 'rangeTimePicker', 'timePicker', 'timePickerRange'];
57
+ if (!fieldType) return false;
58
+ return widgets.includes(fieldType);
59
+ };
51
60
  // 渲染表单控件
52
61
  var renderFormField = function renderFormField(field) {
53
62
  var componentStyle = field.componentStyle,
@@ -69,7 +78,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
69
78
  },
70
79
  fieldStatus: field.fieldStatus || fieldStatus,
71
80
  size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
72
- style: componentStyle || Object.assign({}, general.formItemStyle.wide)
81
+ // style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}
82
+ // style={componentStyle || (layout === 'inline' ? { ...general.formItemStyle.xsm } : { ...general.formItemStyle.wide } )}
83
+ style: Object.assign({
84
+ width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : general.formItemStyle.xsm.width : general.formItemStyle.wide.width
85
+ }, componentStyle)
73
86
  }))), extra ? extra(field, form) : '');
74
87
  } else {
75
88
  return /*#__PURE__*/React.createElement(Field, Object.assign({}, field, {
@@ -88,7 +101,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
88
101
  },
89
102
  fieldStatus: field.fieldStatus || fieldStatus,
90
103
  size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
91
- style: componentStyle || Object.assign({}, general.formItemStyle.wide)
104
+ // style={componentStyle || { ...general.formItemStyle.wide }}
105
+ style: Object.assign({
106
+ width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : general.formItemStyle.xsm.width : general.formItemStyle.wide.width
107
+ }, componentStyle)
92
108
  }));
93
109
  }
94
110
  };
@@ -105,11 +121,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
105
121
  }, /*#__PURE__*/React.createElement(FormItem, Object.assign({
106
122
  name: type !== 'custom' && filedName,
107
123
  className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
108
- label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
124
+ label: description ? (/*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
109
125
  title: description
110
126
  }, /*#__PURE__*/React.createElement(SpecIcon, {
111
127
  name: "info"
112
- }))) : label,
128
+ })))) : label,
113
129
  rules: item.preExtra || item.extra ? [] : item.rules || (item.fieldOptions ? item.fieldOptions.rules : []),
114
130
  required: item.rules && item.rules.filter(function (rItem) {
115
131
  return rItem.required;
@@ -120,11 +136,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
120
136
  key: index,
121
137
  name: type !== 'custom' && filedName,
122
138
  className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
123
- label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
139
+ label: description ? (/*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
124
140
  title: description
125
141
  }, /*#__PURE__*/React.createElement(SpecIcon, {
126
142
  name: "info"
127
- }))) : label,
143
+ })))) : label,
128
144
  rules: item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])
129
145
  }, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form, Object.assign({}, item), fieldStatus) : renderFormField(Object.assign({}, item)));
130
146
  }
@@ -170,11 +186,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
170
186
  }, function (FormInstance) {
171
187
  var _a;
172
188
  // isHide 返回为true则隐藏当前控件
173
- return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/React.createElement(_Col, {
189
+ return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? (/*#__PURE__*/React.createElement(_Col, {
174
190
  span: item.colSpan || 24
175
191
  }, type === 'title' ? /*#__PURE__*/React.createElement("h3", Object.assign({}, item.protoConfig, {
176
192
  className: "modalPanelTitle ".concat(((_a = item === null || item === void 0 ? void 0 : item.protoConfig) === null || _a === void 0 ? void 0 : _a.className) || '')
177
- }), label) : label) : /*#__PURE__*/React.createElement(React.Fragment, null, null);
193
+ }), label) : label)) : /*#__PURE__*/React.createElement(React.Fragment, null, null);
178
194
  });
179
195
  }
180
196
  // 判断是否强制重新渲染表单
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import './style/index.less';
2
3
  interface UploaderProps {
3
4
  extraExt?: string;
4
5
  accept?: string;
@@ -16,6 +17,7 @@ interface UploaderProps {
16
17
  limit?: number;
17
18
  modalConfig?: any;
18
19
  modalZIndex?: number;
20
+ [k: string]: any;
19
21
  }
20
- declare const Uploader: React.ForwardRefExoticComponent<UploaderProps & React.RefAttributes<unknown>>;
22
+ declare const Uploader: React.ForwardRefExoticComponent<Omit<UploaderProps, "ref"> & React.RefAttributes<unknown>>;
21
23
  export default Uploader;