amis 1.5.7 → 1.5.8-beta.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 (350) hide show
  1. package/.husky/pre-commit +1 -1
  2. package/lib/Schema.d.ts +3 -2
  3. package/lib/Schema.js.map +1 -1
  4. package/lib/components/AssociatedSelection.d.ts +84 -84
  5. package/lib/components/AssociatedSelection.js +2 -2
  6. package/lib/components/AssociatedSelection.js.map +2 -2
  7. package/lib/components/Avatar.d.ts +135 -0
  8. package/lib/components/Avatar.js +120 -0
  9. package/lib/components/Avatar.js.map +13 -0
  10. package/lib/components/BaiduMapPicker.js.map +2 -2
  11. package/lib/components/CalendarMobile.d.ts +547 -0
  12. package/lib/components/CalendarMobile.js +432 -0
  13. package/lib/components/CalendarMobile.js.map +13 -0
  14. package/lib/components/Card.d.ts +20 -20
  15. package/lib/components/ChainedSelection.d.ts +84 -84
  16. package/lib/components/ChainedSelection.js +15 -3
  17. package/lib/components/ChainedSelection.js.map +2 -2
  18. package/lib/components/ColorPicker.d.ts +84 -84
  19. package/lib/components/ColorPicker.js.map +2 -2
  20. package/lib/components/DatePicker.d.ts +84 -84
  21. package/lib/components/DatePicker.js +10 -4
  22. package/lib/components/DatePicker.js.map +2 -2
  23. package/lib/components/DateRangePicker.d.ts +85 -84
  24. package/lib/components/DateRangePicker.js +21 -6
  25. package/lib/components/DateRangePicker.js.map +2 -2
  26. package/lib/components/GroupedSelection.d.ts +84 -84
  27. package/lib/components/GroupedSelection.js +14 -2
  28. package/lib/components/GroupedSelection.js.map +2 -2
  29. package/lib/components/MonthRangePicker.d.ts +85 -84
  30. package/lib/components/MonthRangePicker.js +19 -6
  31. package/lib/components/MonthRangePicker.js.map +2 -2
  32. package/lib/components/Overlay.d.ts +1 -1
  33. package/lib/components/Overlay.js.map +1 -1
  34. package/lib/components/Picker.js +9 -4
  35. package/lib/components/Picker.js.map +2 -2
  36. package/lib/components/PickerColumn.js +0 -1
  37. package/lib/components/PickerColumn.js.map +2 -2
  38. package/lib/components/PickerContainer.d.ts +3 -0
  39. package/lib/components/PickerContainer.js +12 -5
  40. package/lib/components/PickerContainer.js.map +2 -2
  41. package/lib/components/PopUp.d.ts +1 -0
  42. package/lib/components/PopUp.js +5 -5
  43. package/lib/components/PopUp.js.map +2 -2
  44. package/lib/components/ResultBox.js +2 -1
  45. package/lib/components/ResultBox.js.map +2 -2
  46. package/lib/components/ResultList.d.ts +9 -2
  47. package/lib/components/ResultList.js +22 -2
  48. package/lib/components/ResultList.js.map +2 -2
  49. package/lib/components/Select.d.ts +237 -237
  50. package/lib/components/Select.js +1 -1
  51. package/lib/components/Select.js.map +1 -1
  52. package/lib/components/Selection.d.ts +94 -86
  53. package/lib/components/Selection.js +11 -2
  54. package/lib/components/Selection.js.map +2 -2
  55. package/lib/components/Steps.js.map +2 -2
  56. package/lib/components/TableSelection.d.ts +85 -85
  57. package/lib/components/TableSelection.js +1 -9
  58. package/lib/components/TableSelection.js.map +2 -2
  59. package/lib/components/Tabs.js +31 -33
  60. package/lib/components/Tabs.js.map +2 -2
  61. package/lib/components/TabsTransfer.d.ts +87 -256
  62. package/lib/components/TabsTransfer.js +52 -9
  63. package/lib/components/TabsTransfer.js.map +2 -2
  64. package/lib/components/TabsTransferPicker.d.ts +1 -1
  65. package/lib/components/TabsTransferPicker.js +20 -18
  66. package/lib/components/TabsTransferPicker.js.map +2 -2
  67. package/lib/components/Timeline.d.ts +69 -0
  68. package/lib/components/Timeline.js +16 -0
  69. package/lib/components/Timeline.js.map +13 -0
  70. package/lib/components/TimelineItem.d.ts +516 -0
  71. package/lib/components/TimelineItem.js +41 -0
  72. package/lib/components/TimelineItem.js.map +13 -0
  73. package/lib/components/Transfer.d.ts +100 -98
  74. package/lib/components/Transfer.js +2 -3
  75. package/lib/components/Transfer.js.map +2 -2
  76. package/lib/components/TransferDropDown.d.ts +84 -84
  77. package/lib/components/TransferDropDown.js +1 -5
  78. package/lib/components/TransferDropDown.js.map +2 -2
  79. package/lib/components/TransferPicker.d.ts +1 -0
  80. package/lib/components/TransferPicker.js +19 -4
  81. package/lib/components/TransferPicker.js.map +2 -2
  82. package/lib/components/TreeSelection.d.ts +85 -85
  83. package/lib/components/TreeSelection.js +7 -1
  84. package/lib/components/TreeSelection.js.map +2 -2
  85. package/lib/components/calendar/Calendar.d.ts +5 -0
  86. package/lib/components/calendar/Calendar.js +15 -2
  87. package/lib/components/calendar/Calendar.js.map +2 -2
  88. package/lib/components/calendar/DaysView.d.ts +1 -0
  89. package/lib/components/calendar/DaysView.js +25 -13
  90. package/lib/components/calendar/DaysView.js.map +2 -2
  91. package/lib/components/calendar/MonthsView.d.ts +28 -0
  92. package/lib/components/calendar/MonthsView.js +79 -3
  93. package/lib/components/calendar/MonthsView.js.map +2 -2
  94. package/lib/components/calendar/QuartersView.d.ts +1 -0
  95. package/lib/components/calendar/QuartersView.js +2 -2
  96. package/lib/components/calendar/QuartersView.js.map +2 -2
  97. package/lib/components/calendar/TimeView.d.ts +5 -0
  98. package/lib/components/calendar/TimeView.js +8 -5
  99. package/lib/components/calendar/TimeView.js.map +2 -2
  100. package/lib/components/calendar/YearsView.js +6 -4
  101. package/lib/components/calendar/YearsView.js.map +2 -2
  102. package/lib/components/condition-builder/Field.js +1 -4
  103. package/lib/components/condition-builder/Field.js.map +2 -2
  104. package/lib/components/condition-builder/Func.js +1 -1
  105. package/lib/components/condition-builder/Func.js.map +2 -2
  106. package/lib/components/formula/Editor.d.ts +3 -0
  107. package/lib/components/formula/Editor.js +3 -2
  108. package/lib/components/formula/Editor.js.map +2 -2
  109. package/lib/components/formula/FuncList.js +2 -1
  110. package/lib/components/formula/FuncList.js.map +2 -2
  111. package/lib/components/formula/Picker.js +1 -1
  112. package/lib/components/formula/Picker.js.map +2 -2
  113. package/lib/components/icons.js +2 -0
  114. package/lib/components/icons.js.map +2 -2
  115. package/lib/components/index.d.ts +2 -1
  116. package/lib/components/index.js +4 -2
  117. package/lib/components/index.js.map +2 -2
  118. package/lib/components/virtual-list/SizeAndPositionManager.js.map +2 -2
  119. package/lib/components/virtual-list/index.js +1 -2
  120. package/lib/components/virtual-list/index.js.map +2 -2
  121. package/lib/factory.js +5 -0
  122. package/lib/factory.js.map +2 -2
  123. package/lib/icons/tree-down.js +7 -0
  124. package/lib/index.d.ts +1 -0
  125. package/lib/index.js +2 -1
  126. package/lib/index.js.map +2 -2
  127. package/lib/locale/de-DE.js +13 -2
  128. package/lib/locale/de-DE.js.map +2 -2
  129. package/lib/locale/en-US.js +13 -2
  130. package/lib/locale/en-US.js.map +2 -2
  131. package/lib/locale/zh-CN.js +12 -1
  132. package/lib/locale/zh-CN.js.map +2 -2
  133. package/lib/renderers/Avatar.d.ts +35 -26
  134. package/lib/renderers/Avatar.js +14 -19
  135. package/lib/renderers/Avatar.js.map +2 -2
  136. package/lib/renderers/Card.js +6 -5
  137. package/lib/renderers/Card.js.map +2 -2
  138. package/lib/renderers/Custom.js.map +2 -2
  139. package/lib/renderers/Each.js +5 -2
  140. package/lib/renderers/Each.js.map +2 -2
  141. package/lib/renderers/Flex.js +1 -5
  142. package/lib/renderers/Flex.js.map +2 -2
  143. package/lib/renderers/Form/ChartRadios.js.map +2 -2
  144. package/lib/renderers/Form/Checkboxes.js.map +2 -2
  145. package/lib/renderers/Form/DiffEditor.js +2 -1
  146. package/lib/renderers/Form/DiffEditor.js.map +2 -2
  147. package/lib/renderers/Form/InputCity.d.ts +84 -84
  148. package/lib/renderers/Form/InputColor.d.ts +84 -84
  149. package/lib/renderers/Form/InputColor.js +1 -1
  150. package/lib/renderers/Form/InputColor.js.map +2 -2
  151. package/lib/renderers/Form/InputDate.js +6 -4
  152. package/lib/renderers/Form/InputDate.js.map +2 -2
  153. package/lib/renderers/Form/InputDateRange.js +1 -1
  154. package/lib/renderers/Form/InputDateRange.js.map +2 -2
  155. package/lib/renderers/Form/InputFormula.d.ts +4 -1
  156. package/lib/renderers/Form/InputFormula.js +2 -2
  157. package/lib/renderers/Form/InputFormula.js.map +2 -2
  158. package/lib/renderers/Form/InputImage.d.ts +1 -0
  159. package/lib/renderers/Form/InputImage.js +8 -4
  160. package/lib/renderers/Form/InputImage.js.map +2 -2
  161. package/lib/renderers/Form/InputMonthRange.js +1 -1
  162. package/lib/renderers/Form/InputMonthRange.js.map +2 -2
  163. package/lib/renderers/Form/InputQuarterRange.js +1 -1
  164. package/lib/renderers/Form/InputQuarterRange.js.map +2 -2
  165. package/lib/renderers/Form/InputYearRange.js +1 -1
  166. package/lib/renderers/Form/InputYearRange.js.map +2 -2
  167. package/lib/renderers/Form/Item.js +11 -4
  168. package/lib/renderers/Form/Item.js.map +2 -2
  169. package/lib/renderers/Form/NestedSelect.js +1 -1
  170. package/lib/renderers/Form/NestedSelect.js.map +2 -2
  171. package/lib/renderers/Form/Select.js +1 -1
  172. package/lib/renderers/Form/Select.js.map +2 -2
  173. package/lib/renderers/Form/TabsTransfer.d.ts +5 -32
  174. package/lib/renderers/Form/TabsTransfer.js +20 -1
  175. package/lib/renderers/Form/TabsTransfer.js.map +2 -2
  176. package/lib/renderers/Form/TabsTransferPicker.d.ts +5 -35
  177. package/lib/renderers/Form/TabsTransferPicker.js +21 -2
  178. package/lib/renderers/Form/TabsTransferPicker.js.map +2 -2
  179. package/lib/renderers/Form/Transfer.d.ts +15 -4
  180. package/lib/renderers/Form/Transfer.js +55 -18
  181. package/lib/renderers/Form/Transfer.js.map +2 -2
  182. package/lib/renderers/Form/TransferPicker.d.ts +3 -32
  183. package/lib/renderers/Form/TransferPicker.js +1 -1
  184. package/lib/renderers/Form/TransferPicker.js.map +2 -2
  185. package/lib/renderers/Form/TreeSelect.js.map +2 -2
  186. package/lib/renderers/IFrame.js +0 -2
  187. package/lib/renderers/IFrame.js.map +2 -2
  188. package/lib/renderers/Remark.d.ts +4 -0
  189. package/lib/renderers/Remark.js +38 -7
  190. package/lib/renderers/Remark.js.map +2 -2
  191. package/lib/renderers/Steps.js +5 -5
  192. package/lib/renderers/Steps.js.map +2 -2
  193. package/lib/renderers/Table/index.js +4 -1
  194. package/lib/renderers/Table/index.js.map +2 -2
  195. package/lib/renderers/Tabs.js +1 -1
  196. package/lib/renderers/Tabs.js.map +2 -2
  197. package/lib/renderers/Timeline.d.ts +65 -0
  198. package/lib/renderers/Timeline.js +54 -0
  199. package/lib/renderers/Timeline.js.map +13 -0
  200. package/lib/renderers/Video.js.map +2 -2
  201. package/lib/store/combo.js.map +2 -2
  202. package/lib/themes/ang-ie11.css +659 -25
  203. package/lib/themes/ang.css +659 -25
  204. package/lib/themes/ang.css.map +1 -1
  205. package/lib/themes/antd-ie11.css +694 -25
  206. package/lib/themes/antd.css +694 -25
  207. package/lib/themes/antd.css.map +1 -1
  208. package/lib/themes/cxd-ie11.css +696 -25
  209. package/lib/themes/cxd.css +696 -25
  210. package/lib/themes/cxd.css.map +1 -1
  211. package/lib/themes/dark-ie11.css +660 -25
  212. package/lib/themes/dark.css +660 -25
  213. package/lib/themes/dark.css.map +1 -1
  214. package/lib/themes/default.css +696 -25
  215. package/lib/themes/default.css.map +1 -1
  216. package/lib/utils/RootClose.js +3 -1
  217. package/lib/utils/RootClose.js.map +2 -2
  218. package/lib/utils/helper.d.ts +1 -1
  219. package/lib/utils/helper.js +1 -1
  220. package/lib/utils/helper.js.map +2 -2
  221. package/package.json +13 -6
  222. package/schema.json +1042 -541
  223. package/scss/_properties.scss +8 -0
  224. package/scss/components/_avatar.scss +27 -9
  225. package/scss/components/_calendar.scss +280 -0
  226. package/scss/components/_card.scss +1 -1
  227. package/scss/components/_collapse-group.scss +1 -3
  228. package/scss/components/_formula.scss +30 -6
  229. package/scss/components/_modal.scss +18 -0
  230. package/scss/components/_panel.scss +45 -0
  231. package/scss/components/_popup.scss +10 -6
  232. package/scss/components/_timeline.scss +198 -0
  233. package/scss/components/form/_form.scss +168 -0
  234. package/scss/components/form/_result-list.scss +2 -0
  235. package/scss/components/form/_selection.scss +5 -4
  236. package/scss/themes/_antd-variables.scss +42 -0
  237. package/scss/themes/_common.scss +1 -0
  238. package/scss/themes/_cxd-variables.scss +47 -0
  239. package/scss/themes/_dark-variables.scss +1 -0
  240. package/sdk/ang-ie11.css +782 -23
  241. package/sdk/ang.css +791 -26
  242. package/sdk/antd-ie11.css +782 -23
  243. package/sdk/antd.css +826 -26
  244. package/sdk/charts.js +17 -17
  245. package/sdk/codemirror.js +7 -7
  246. package/sdk/color-picker.js +65 -65
  247. package/sdk/cropperjs.js +3 -3
  248. package/sdk/cxd-ie11.css +782 -23
  249. package/sdk/cxd.css +828 -26
  250. package/sdk/dark-ie11.css +783 -24
  251. package/sdk/dark.css +792 -26
  252. package/sdk/exceljs.js +1 -1
  253. package/sdk/locale/de-DE.js +13 -2
  254. package/sdk/markdown.js +69 -69
  255. package/sdk/papaparse.js +1 -1
  256. package/sdk/renderers/Form/CityDB.js +1 -1
  257. package/sdk/rest.js +18 -18
  258. package/sdk/rich-text.js +62 -62
  259. package/sdk/sdk-ie11.css +782 -23
  260. package/sdk/sdk.css +828 -26
  261. package/sdk/sdk.js +1225 -1285
  262. package/sdk/thirds/hls.js/hls.js +18 -18
  263. package/sdk/thirds/mpegts.js/mpegts.js +2 -2
  264. package/sdk/tinymce.js +57 -57
  265. package/src/Schema.ts +3 -0
  266. package/src/components/AssociatedSelection.tsx +5 -1
  267. package/src/components/Avatar.tsx +253 -0
  268. package/src/components/BaiduMapPicker.tsx +19 -14
  269. package/src/components/CalendarMobile.tsx +563 -0
  270. package/src/components/ChainedSelection.tsx +16 -3
  271. package/src/components/ColorPicker.tsx +37 -39
  272. package/src/components/DatePicker.tsx +41 -35
  273. package/src/components/DateRangePicker.tsx +61 -16
  274. package/src/components/GroupedSelection.tsx +14 -2
  275. package/src/components/MonthRangePicker.tsx +57 -17
  276. package/src/components/Overlay.tsx +1 -1
  277. package/src/components/Picker.tsx +41 -36
  278. package/src/components/PickerColumn.tsx +22 -25
  279. package/src/components/PickerContainer.tsx +13 -1
  280. package/src/components/PopUp.tsx +34 -49
  281. package/src/components/ResultBox.tsx +4 -1
  282. package/src/components/ResultList.tsx +36 -6
  283. package/src/components/Select.tsx +1 -1
  284. package/src/components/Selection.tsx +21 -3
  285. package/src/components/Steps.tsx +23 -10
  286. package/src/components/TableSelection.tsx +1 -44
  287. package/src/components/Tabs.tsx +65 -54
  288. package/src/components/TabsTransfer.tsx +78 -9
  289. package/src/components/TabsTransferPicker.tsx +25 -13
  290. package/src/components/Timeline.tsx +31 -0
  291. package/src/components/TimelineItem.tsx +107 -0
  292. package/src/components/Transfer.tsx +11 -8
  293. package/src/components/TransferDropDown.tsx +1 -7
  294. package/src/components/TransferPicker.tsx +25 -4
  295. package/src/components/TreeSelection.tsx +7 -1
  296. package/src/components/calendar/Calendar.tsx +26 -6
  297. package/src/components/calendar/DaysView.tsx +79 -31
  298. package/src/components/calendar/MonthsView.tsx +116 -2
  299. package/src/components/calendar/QuartersView.tsx +3 -2
  300. package/src/components/calendar/TimeView.tsx +26 -16
  301. package/src/components/calendar/YearsView.tsx +14 -16
  302. package/src/components/condition-builder/Field.tsx +1 -3
  303. package/src/components/condition-builder/Func.tsx +1 -1
  304. package/src/components/formula/Editor.tsx +16 -11
  305. package/src/components/formula/FuncList.tsx +3 -1
  306. package/src/components/formula/Picker.tsx +2 -1
  307. package/src/components/icons.tsx +2 -0
  308. package/src/components/index.tsx +2 -0
  309. package/src/components/virtual-list/SizeAndPositionManager.ts +6 -3
  310. package/src/components/virtual-list/index.tsx +4 -6
  311. package/src/factory.tsx +6 -0
  312. package/src/icons/tree-down.svg +5 -0
  313. package/src/index.tsx +1 -0
  314. package/src/locale/de-DE.ts +13 -2
  315. package/src/locale/en-US.ts +13 -2
  316. package/src/locale/zh-CN.ts +12 -1
  317. package/src/renderers/Avatar.tsx +83 -74
  318. package/src/renderers/Card.tsx +10 -6
  319. package/src/renderers/Custom.tsx +6 -3
  320. package/src/renderers/Each.tsx +4 -4
  321. package/src/renderers/Flex.tsx +3 -7
  322. package/src/renderers/Form/ChartRadios.tsx +2 -7
  323. package/src/renderers/Form/Checkboxes.tsx +1 -1
  324. package/src/renderers/Form/DiffEditor.tsx +2 -3
  325. package/src/renderers/Form/InputColor.tsx +1 -1
  326. package/src/renderers/Form/InputDate.tsx +38 -19
  327. package/src/renderers/Form/InputDateRange.tsx +0 -1
  328. package/src/renderers/Form/InputFormula.tsx +9 -4
  329. package/src/renderers/Form/InputImage.tsx +9 -4
  330. package/src/renderers/Form/InputMonthRange.tsx +0 -1
  331. package/src/renderers/Form/InputQuarterRange.tsx +0 -1
  332. package/src/renderers/Form/InputYearRange.tsx +0 -1
  333. package/src/renderers/Form/Item.tsx +15 -4
  334. package/src/renderers/Form/NestedSelect.tsx +1 -1
  335. package/src/renderers/Form/Select.tsx +0 -1
  336. package/src/renderers/Form/TabsTransfer.tsx +28 -38
  337. package/src/renderers/Form/TabsTransferPicker.tsx +28 -46
  338. package/src/renderers/Form/Transfer.tsx +75 -24
  339. package/src/renderers/Form/TransferPicker.tsx +6 -38
  340. package/src/renderers/Form/TreeSelect.tsx +12 -14
  341. package/src/renderers/IFrame.tsx +0 -2
  342. package/src/renderers/Remark.tsx +67 -18
  343. package/src/renderers/Steps.tsx +11 -13
  344. package/src/renderers/Table/index.tsx +7 -1
  345. package/src/renderers/Tabs.tsx +6 -2
  346. package/src/renderers/Timeline.tsx +141 -0
  347. package/src/renderers/Video.tsx +4 -20
  348. package/src/store/combo.ts +1 -3
  349. package/src/utils/RootClose.ts +5 -1
  350. package/src/utils/helper.ts +1 -1
@@ -572,8 +572,8 @@ export default class TreeSelectControl extends React.Component<
572
572
  translate: __
573
573
  } = this.props;
574
574
 
575
- const { isOpened } = this.state;
576
- const { useMobileUI } = env;
575
+ const {isOpened} = this.state;
576
+ const {useMobileUI} = env;
577
577
  return (
578
578
  <div ref={this.container} className={cx(`TreeSelectControl`, className)}>
579
579
  <ResultBox
@@ -612,7 +612,7 @@ export default class TreeSelectControl extends React.Component<
612
612
  >
613
613
  {loading ? <Spinner size="sm" /> : undefined}
614
614
  </ResultBox>
615
- { !(useMobileUI && isMobile()) && isOpened ? (
615
+ {!(useMobileUI && isMobile()) && isOpened ? (
616
616
  <Overlay
617
617
  container={popOverContainer || (() => this.container.current)}
618
618
  target={() => this.target}
@@ -631,17 +631,15 @@ export default class TreeSelectControl extends React.Component<
631
631
  </PopOver>
632
632
  </Overlay>
633
633
  ) : null}
634
- {
635
- useMobileUI && isMobile() && (
636
- <PopUp
637
- className={cx(`${ns}TreeSelect-popup`)}
638
- isShow={isOpened}
639
- onHide={this.close}
640
- >
641
- {this.renderOuter()}
642
- </PopUp>
643
- )
644
- }
634
+ {useMobileUI && isMobile() && (
635
+ <PopUp
636
+ className={cx(`${ns}TreeSelect-popup`)}
637
+ isShow={isOpened}
638
+ onHide={this.close}
639
+ >
640
+ {this.renderOuter()}
641
+ </PopUp>
642
+ )}
645
643
  </div>
646
644
  );
647
645
  }
@@ -161,8 +161,6 @@ export default class IFrame extends React.Component<IFrameProps, object> {
161
161
  ...style
162
162
  };
163
163
 
164
- src = dataMapping(src, data);
165
-
166
164
  const finalSrc = src ? buildApi(src, data).url : undefined;
167
165
 
168
166
  if (
@@ -2,11 +2,12 @@ import React from 'react';
2
2
  import {Renderer, RendererProps} from '../factory';
3
3
  import {Api, SchemaNode, Schema, Action} from '../types';
4
4
  import cx from 'classnames';
5
- import TooltipWrapper from '../components/TooltipWrapper';
5
+ import TooltipWrapper, {TooltipObject} from '../components/TooltipWrapper';
6
6
  import {filter} from '../utils/tpl';
7
- import {themeable} from '../theme';
7
+ import {ClassNamesFn, themeable} from '../theme';
8
8
  import {hasIcon, Icon} from '../components/icons';
9
9
  import {BaseSchema, SchemaClassName, SchemaIcon, SchemaTpl} from '../Schema';
10
+ import {autobind, isMobile} from '../utils/helper';
10
11
 
11
12
  /**
12
13
  * 提示渲染器,默认会显示个小图标,鼠标放上来的时候显示配置的内容。
@@ -91,6 +92,50 @@ class Remark extends React.Component<RemarkProps> {
91
92
  trigger: ['hover', 'focus'] as Array<'hover' | 'click' | 'focus'>
92
93
  };
93
94
 
95
+ @autobind
96
+ showModalTip(tooltip?: string | TooltipObject) {
97
+ let {onAction, data} = this.props;
98
+ return (e: React.MouseEvent) => {
99
+ onAction &&
100
+ onAction(
101
+ e,
102
+ {
103
+ actionType: 'dialog',
104
+ dialog: {
105
+ title:
106
+ tooltip && typeof tooltip !== 'string' ? tooltip.title : '',
107
+ body:
108
+ tooltip && typeof tooltip !== 'string'
109
+ ? tooltip.content
110
+ : tooltip
111
+ }
112
+ },
113
+ data
114
+ );
115
+ };
116
+ }
117
+
118
+ renderLabel(finalIcon: any, finalLabel: string, cx: ClassNamesFn) {
119
+ return (
120
+ <>
121
+ {finalLabel ? <span>{finalLabel}</span> : null}
122
+ {finalIcon ? (
123
+ hasIcon(finalIcon) ? (
124
+ <span className={cx('Remark-icon')}>
125
+ <Icon icon={finalIcon} />
126
+ </span>
127
+ ) : (
128
+ <i className={cx('Remark-icon', finalIcon)} />
129
+ )
130
+ ) : finalIcon === false && finalLabel ? null : (
131
+ <span className={cx('Remark-icon icon')}>
132
+ <Icon icon="question-mark" />
133
+ </span>
134
+ )}
135
+ </>
136
+ );
137
+ }
138
+
94
139
  render() {
95
140
  const {
96
141
  className,
@@ -106,17 +151,34 @@ class Remark extends React.Component<RemarkProps> {
106
151
  content,
107
152
  data,
108
153
  env,
109
- tooltipClassName
154
+ tooltipClassName,
155
+ useMobileUI
110
156
  } = this.props;
111
157
 
112
158
  const finalIcon = tooltip?.icon ?? icon;
113
159
  const finalLabel = tooltip?.label ?? label;
160
+ const parsedTip = filterContents(tooltip || content, data);
161
+
162
+ // 移动端使用弹框提示
163
+ if (isMobile() && useMobileUI) {
164
+ return (
165
+ <div
166
+ className={cx(
167
+ `Remark`,
168
+ (tooltip && tooltip.className) || className || `Remark--warning`
169
+ )}
170
+ onClick={this.showModalTip(parsedTip)}
171
+ >
172
+ {this.renderLabel(finalIcon, finalLabel, cx)}
173
+ </div>
174
+ );
175
+ }
114
176
 
115
177
  return (
116
178
  <TooltipWrapper
117
179
  classPrefix={ns}
118
180
  classnames={cx}
119
- tooltip={filterContents(tooltip || content, data)}
181
+ tooltip={parsedTip}
120
182
  tooltipClassName={
121
183
  (tooltip && tooltip.tooltipClassName) || tooltipClassName
122
184
  }
@@ -132,20 +194,7 @@ class Remark extends React.Component<RemarkProps> {
132
194
  (tooltip && tooltip.className) || className || `Remark--warning`
133
195
  )}
134
196
  >
135
- {finalLabel ? <span>{finalLabel}</span> : null}
136
- {finalIcon ? (
137
- hasIcon(finalIcon) ? (
138
- <span className={cx('Remark-icon')}>
139
- <Icon icon={finalIcon} />
140
- </span>
141
- ) : (
142
- <i className={cx('Remark-icon', finalIcon)} />
143
- )
144
- ) : finalIcon === false && finalLabel ? null : (
145
- <span className={cx('Remark-icon icon')}>
146
- <Icon icon="question-mark" />
147
- </span>
148
- )}
197
+ {this.renderLabel(finalIcon, finalLabel, cx)}
149
198
  </div>
150
199
  </TooltipWrapper>
151
200
  );
@@ -60,9 +60,11 @@ export interface StepsSchema extends BaseSchema {
60
60
  */
61
61
  name?: string;
62
62
 
63
- status?: StepStatus | {
64
- [propName: string]: StepStatus;
65
- };
63
+ status?:
64
+ | StepStatus
65
+ | {
66
+ [propName: string]: StepStatus;
67
+ };
66
68
 
67
69
  /**
68
70
  * 展示模式
@@ -84,7 +86,7 @@ export function StepsCmpt(props: StepsProps) {
84
86
  source,
85
87
  config,
86
88
  render,
87
- env
89
+ useMobileUI
88
90
  } = props;
89
91
 
90
92
  const stepsRow =
@@ -92,9 +94,8 @@ export function StepsCmpt(props: StepsProps) {
92
94
  config ||
93
95
  steps ||
94
96
  [];
95
- const resolveRender = (val?: string | SchemaCollection) => typeof val === 'string'
96
- ? filter(val, data)
97
- : val && render('inner', val);
97
+ const resolveRender = (val?: string | SchemaCollection) =>
98
+ typeof val === 'string' ? filter(val, data) : val && render('inner', val);
98
99
  const value = getPropValue(props) ?? 0;
99
100
  const resolveValue =
100
101
  typeof value === 'string' && isNaN(+value)
@@ -112,13 +113,10 @@ export function StepsCmpt(props: StepsProps) {
112
113
  title: resolveRender(step.title),
113
114
  subTitle: resolveRender(step.subTitle),
114
115
  description: resolveRender(step.description)
115
- }
116
+ };
116
117
  });
117
118
 
118
- function getStepStatus(
119
- step: StepSchema,
120
- i: number
121
- ): StepStatus {
119
+ function getStepStatus(step: StepSchema, i: number): StepStatus {
122
120
  let stepStatus;
123
121
 
124
122
  if (typeof status === 'string') {
@@ -141,7 +139,7 @@ export function StepsCmpt(props: StepsProps) {
141
139
  className={className}
142
140
  status={status}
143
141
  mode={mode}
144
- useMobileUI={env.useMobileUI}
142
+ useMobileUI={useMobileUI}
145
143
  ></Steps>
146
144
  );
147
145
  }
@@ -1173,6 +1173,7 @@ export default class Table extends React.Component<TableProps, object> {
1173
1173
  group: 'table',
1174
1174
  animation: 150,
1175
1175
  handle: `.${ns}Table-dragCell`,
1176
+ filter: `.${ns}Table-dragCell.is-dragDisabled`,
1176
1177
  ghostClass: 'is-dragging',
1177
1178
  onEnd: (e: any) => {
1178
1179
  // 没有移动
@@ -1857,7 +1858,12 @@ export default class Table extends React.Component<TableProps, object> {
1857
1858
  );
1858
1859
  } else if (column.type === '__dragme') {
1859
1860
  return (
1860
- <td key={props.key} className={cx(column.pristine.className)}>
1861
+ <td
1862
+ key={props.key}
1863
+ className={cx(column.pristine.className, {
1864
+ 'is-dragDisabled': !item.draggable
1865
+ })}
1866
+ >
1861
1867
  {item.draggable ? <Icon icon="drag-bar" className="icon" /> : null}
1862
1868
  </td>
1863
1869
  );
@@ -21,7 +21,11 @@ import {
21
21
  } from '../Schema';
22
22
  import {ActionSchema} from './Action';
23
23
  import {filter} from '../utils/tpl';
24
- import {resolveVariable, tokenize} from '../utils/tpl-builtin';
24
+ import {
25
+ resolveVariable,
26
+ tokenize,
27
+ resolveVariableAndFilter
28
+ } from '../utils/tpl-builtin';
25
29
  import {FormSchemaHorizontal} from './Form/index';
26
30
  import {str2AsyncFunction} from '../utils/api';
27
31
 
@@ -461,7 +465,7 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
461
465
  } = this.props;
462
466
 
463
467
  const mode = tabsMode || dMode;
464
- const arr = resolveVariable(source, data);
468
+ const arr = resolveVariableAndFilter(source, data, '| raw');
465
469
  let mountOnEnter = this.props.mountOnEnter;
466
470
 
467
471
  // 如果在form下面,其他tabs默认需要渲染出来
@@ -0,0 +1,141 @@
1
+ import React from 'react';
2
+ import {Renderer, RendererProps} from '../factory';
3
+ import {BaseSchema, SchemaApi, SchemaCollection, SchemaTokenizeableString} from '../Schema';
4
+ import {resolveVariable} from '../utils/tpl-builtin';
5
+ import Timeline from '../components/Timeline';
6
+ import {filter} from '../utils/tpl';
7
+ import { RemoteOptionsProps, withRemoteConfig } from '../components/WithRemoteConfig';
8
+
9
+ export interface TimelineItemSchema extends Omit<BaseSchema, 'type'> {
10
+ /**
11
+ * 时间点
12
+ */
13
+ time: string;
14
+
15
+ /**
16
+ * 时间节点标题
17
+ */
18
+ title?: SchemaCollection;
19
+
20
+ /**
21
+ * 详细内容
22
+ */
23
+ detail?: string;
24
+
25
+ /**
26
+ * detail折叠时文案
27
+ */
28
+ detailCollapsedText?: string;
29
+
30
+ /**
31
+ * detail展开时文案
32
+ */
33
+ detailExpandedText?: string;
34
+
35
+ /**
36
+ * 时间点圆圈颜色
37
+ */
38
+ color?: string;
39
+
40
+ /**
41
+ * 图标
42
+ */
43
+ icon?: SchemaCollection;
44
+ }
45
+
46
+ export interface TimelineSchema extends BaseSchema {
47
+ /**
48
+ * 指定为 Timeline 时间轴渲染器
49
+ */
50
+ type: 'timeline';
51
+
52
+ /**
53
+ * 节点数据
54
+ */
55
+ items?: Array<TimelineItemSchema>;
56
+
57
+ /**
58
+ * API 或 数据映射
59
+ */
60
+ source?: SchemaApi  | SchemaTokenizeableString;
61
+
62
+ /**
63
+ * 文字相对于时间轴展示方向
64
+ */
65
+ mode?: 'left' | 'right' | 'alternate';
66
+
67
+ /**
68
+ * 展示方向
69
+ */
70
+ direction?: 'horizontal' | 'vertical'
71
+
72
+ /**
73
+ * 节点倒序
74
+ */
75
+ reverse?: boolean,
76
+ }
77
+
78
+ export interface TimelineProps
79
+ extends RendererProps,
80
+ Omit<TimelineSchema, 'className'> {}
81
+
82
+ export function TimelineCmpt(props: TimelineProps) {
83
+ const {
84
+ items,
85
+ mode,
86
+ direction,
87
+ reverse,
88
+ data,
89
+ config,
90
+ source,
91
+ render
92
+ } = props;
93
+
94
+ // 获取源数据
95
+ const timelineItemsRow: Array<TimelineItemSchema> = config || items || [];
96
+
97
+ // 渲染内容
98
+ const resolveRender = (region: string, val?: SchemaCollection) => typeof val === 'string'
99
+ ? filter(val, data)
100
+ : (val && render(region, val));
101
+
102
+ // 处理源数据
103
+ const resolveTimelineItems =
104
+ timelineItemsRow?.map((timelineItem: TimelineItemSchema) => {
105
+ return {
106
+ ...timelineItem,
107
+ icon: resolveRender('icon', timelineItem.icon),
108
+ title: resolveRender('title', timelineItem.title),
109
+ }
110
+ });
111
+
112
+
113
+ return (<Timeline
114
+ items = {resolveTimelineItems}
115
+ direction = {direction}
116
+ reverse = {reverse}
117
+ mode = {mode}
118
+ />)
119
+ }
120
+
121
+ const TimelineWithRemoteConfig = withRemoteConfig({
122
+ adaptor: data => data.items || data
123
+ })(
124
+ class extends React.Component<
125
+ RemoteOptionsProps & React.ComponentProps<typeof TimelineCmpt>
126
+ > {
127
+ render() {
128
+ const {config, deferLoad, loading, updateConfig, ...rest} = this.props;
129
+ return <TimelineCmpt config={config} {...rest} />;
130
+ }
131
+ }
132
+ );
133
+
134
+ @Renderer({
135
+ type: 'timeline'
136
+ })
137
+ export class TimelineRenderer extends React.Component<TimelineProps> {
138
+ render() {
139
+ return <TimelineWithRemoteConfig {...this.props} />;
140
+ }
141
+ }
@@ -149,16 +149,8 @@ export class FlvSource extends React.Component<FlvSourceProps, any> {
149
149
  unsubscribe: any;
150
150
 
151
151
  componentDidMount() {
152
- let {
153
- src,
154
- video,
155
- config,
156
- manager,
157
- isLive,
158
- autoPlay,
159
- actions,
160
- setError
161
- } = this.props;
152
+ let {src, video, config, manager, isLive, autoPlay, actions, setError} =
153
+ this.props;
162
154
 
163
155
  this.initFlv({
164
156
  video,
@@ -174,16 +166,8 @@ export class FlvSource extends React.Component<FlvSourceProps, any> {
174
166
 
175
167
  componentDidUpdate(prevProps: FlvSourceProps) {
176
168
  const props = this.props;
177
- let {
178
- autoPlay,
179
- actions,
180
- src,
181
- setError,
182
- isLive,
183
- config,
184
- video,
185
- manager
186
- } = props;
169
+ let {autoPlay, actions, src, setError, isLive, config, video, manager} =
170
+ props;
187
171
 
188
172
  if (src !== prevProps.src) {
189
173
  setError('');
@@ -11,9 +11,7 @@ export const UniqueGroup = types
11
11
  })
12
12
  .views(self => ({
13
13
  get items() {
14
- return self.itemsRef.map(
15
- id => (getStoreById(id) as any) as IFormItemStore
16
- );
14
+ return self.itemsRef.map(id => getStoreById(id) as any as IFormItemStore);
17
15
  }
18
16
  }))
19
17
  .actions(self => ({
@@ -4,9 +4,13 @@
4
4
 
5
5
  import React, {useState} from 'react';
6
6
  import useRootClose from 'react-overlays/useRootClose';
7
+ import {findDOMNode} from 'react-dom';
7
8
 
8
9
  export const RootClose = ({children, onRootClose, ...props}: any) => {
9
- const [rootElement, attachRef] = useState(null);
10
+ const [rootComponent, attachRef] = useState(null);
11
+ const rootElement = findDOMNode(rootComponent) as Element;
12
+
10
13
  useRootClose(rootElement, onRootClose, props);
14
+
11
15
  return typeof children === 'function' ? children(attachRef) : children;
12
16
  };
@@ -1607,7 +1607,7 @@ export function convertDateToObject(value: moment.Moment) {
1607
1607
  day: parseInt(value.format('DD'), 10)
1608
1608
  };
1609
1609
  }
1610
- return null;
1610
+ return value;
1611
1611
  }
1612
1612
 
1613
1613
  export function getRange(min: number, max: number, step: number = 1) {