amis-ui 6.13.0-beta.6 → 6.13.0-beta.8

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 (1043) hide show
  1. package/package.json +3 -3
  2. package/scss/components/_popoverable.scss +1 -0
  3. package/scss/components/form/_excel.scss +110 -4
  4. package/esm/components/404.d.ts +0 -53
  5. package/esm/components/404.js +0 -35
  6. package/esm/components/Alert.d.ts +0 -615
  7. package/esm/components/Alert.js +0 -266
  8. package/esm/components/Alert2.d.ts +0 -117
  9. package/esm/components/Alert2.js +0 -58
  10. package/esm/components/AlphabetIndexer.d.ts +0 -11
  11. package/esm/components/AlphabetIndexer.js +0 -48
  12. package/esm/components/AnchorNav.d.ts +0 -162
  13. package/esm/components/AnchorNav.js +0 -153
  14. package/esm/components/AnchorNavSection.d.ts +0 -2
  15. package/esm/components/AnchorNavSection.js +0 -7
  16. package/esm/components/ArrayInput.d.ts +0 -617
  17. package/esm/components/ArrayInput.js +0 -147
  18. package/esm/components/AsideNav.d.ts +0 -142
  19. package/esm/components/AsideNav.js +0 -133
  20. package/esm/components/AssociatedSelection.d.ts +0 -564
  21. package/esm/components/AssociatedSelection.js +0 -103
  22. package/esm/components/AutoSizer.d.ts +0 -2
  23. package/esm/components/AutoSizer.js +0 -8
  24. package/esm/components/Avatar.d.ts +0 -374
  25. package/esm/components/Avatar.js +0 -126
  26. package/esm/components/Badge.d.ts +0 -118
  27. package/esm/components/Badge.js +0 -154
  28. package/esm/components/BaiduMapPicker.d.ts +0 -100
  29. package/esm/components/BaiduMapPicker.js +0 -366
  30. package/esm/components/BarCode.d.ts +0 -56
  31. package/esm/components/BarCode.js +0 -42
  32. package/esm/components/Breadcrumb.d.ts +0 -115
  33. package/esm/components/Breadcrumb.js +0 -160
  34. package/esm/components/Button.d.ts +0 -147
  35. package/esm/components/Button.js +0 -63
  36. package/esm/components/CalendarMobile.d.ts +0 -431
  37. package/esm/components/CalendarMobile.js +0 -538
  38. package/esm/components/Card.d.ts +0 -444
  39. package/esm/components/Card.js +0 -88
  40. package/esm/components/Cascader.d.ts +0 -108
  41. package/esm/components/Cascader.js +0 -515
  42. package/esm/components/ChainedDropdownSelection.d.ts +0 -561
  43. package/esm/components/ChainedDropdownSelection.js +0 -104
  44. package/esm/components/ChainedSelection.d.ts +0 -554
  45. package/esm/components/ChainedSelection.js +0 -184
  46. package/esm/components/Checkbox.d.ts +0 -110
  47. package/esm/components/Checkbox.js +0 -87
  48. package/esm/components/CityArea.d.ts +0 -299
  49. package/esm/components/CityArea.js +0 -190
  50. package/esm/components/CityDB.d.ts +0 -13
  51. package/esm/components/CityDB.js +0 -3942
  52. package/esm/components/CodeMirror.d.ts +0 -29
  53. package/esm/components/CodeMirror.js +0 -140
  54. package/esm/components/Collapse.d.ts +0 -447
  55. package/esm/components/Collapse.js +0 -184
  56. package/esm/components/CollapseGroup.d.ts +0 -219
  57. package/esm/components/CollapseGroup.js +0 -117
  58. package/esm/components/ColorPicker.d.ts +0 -530
  59. package/esm/components/ColorPicker.js +0 -260
  60. package/esm/components/Combo.d.ts +0 -354
  61. package/esm/components/Combo.js +0 -212
  62. package/esm/components/ConditionBuilder.d.ts +0 -2
  63. package/esm/components/ConditionBuilder.js +0 -7
  64. package/esm/components/ConfirmBox.d.ts +0 -322
  65. package/esm/components/ConfirmBox.js +0 -129
  66. package/esm/components/ContextMenu.d.ts +0 -115
  67. package/esm/components/ContextMenu.js +0 -305
  68. package/esm/components/DatePicker.d.ts +0 -638
  69. package/esm/components/DatePicker.js +0 -717
  70. package/esm/components/DateRangePicker.d.ts +0 -1046
  71. package/esm/components/DateRangePicker.js +0 -1389
  72. package/esm/components/DiffEditor.d.ts +0 -21
  73. package/esm/components/DiffEditor.js +0 -119
  74. package/esm/components/DndContainer.d.ts +0 -205
  75. package/esm/components/DndContainer.js +0 -25
  76. package/esm/components/Drawer.d.ts +0 -158
  77. package/esm/components/Drawer.js +0 -269
  78. package/esm/components/DropDownSelection.d.ts +0 -557
  79. package/esm/components/DropDownSelection.js +0 -78
  80. package/esm/components/DropdownContextMenus.d.ts +0 -84
  81. package/esm/components/DropdownContextMenus.js +0 -93
  82. package/esm/components/Editor.d.ts +0 -681
  83. package/esm/components/Editor.js +0 -238
  84. package/esm/components/Form.d.ts +0 -31
  85. package/esm/components/Form.js +0 -84
  86. package/esm/components/FormField.d.ts +0 -287
  87. package/esm/components/FormField.js +0 -78
  88. package/esm/components/FormulaPicker.d.ts +0 -2
  89. package/esm/components/FormulaPicker.js +0 -7
  90. package/esm/components/GaodeMapPicker.d.ts +0 -89
  91. package/esm/components/GaodeMapPicker.js +0 -204
  92. package/esm/components/GridNav.d.ts +0 -53
  93. package/esm/components/GridNav.js +0 -125
  94. package/esm/components/GridNavItem.d.ts +0 -2
  95. package/esm/components/GridNavItem.js +0 -7
  96. package/esm/components/GroupedSelection.d.ts +0 -543
  97. package/esm/components/GroupedSelection.js +0 -138
  98. package/esm/components/HeadCellDropDown.d.ts +0 -2
  99. package/esm/components/HeadCellDropDown.js +0 -7
  100. package/esm/components/HorizontalScroll.d.ts +0 -75
  101. package/esm/components/HorizontalScroll.js +0 -271
  102. package/esm/components/Html.d.ts +0 -82
  103. package/esm/components/Html.js +0 -52
  104. package/esm/components/Icon.d.ts +0 -2
  105. package/esm/components/Icon.js +0 -7
  106. package/esm/components/ImageGallery.d.ts +0 -465
  107. package/esm/components/ImageGallery.js +0 -396
  108. package/esm/components/Input.d.ts +0 -18
  109. package/esm/components/Input.js +0 -75
  110. package/esm/components/InputBox.d.ts +0 -100
  111. package/esm/components/InputBox.js +0 -98
  112. package/esm/components/InputBoxWithSuggestion.d.ts +0 -272
  113. package/esm/components/InputBoxWithSuggestion.js +0 -69
  114. package/esm/components/InputJSONSchema.d.ts +0 -2
  115. package/esm/components/InputJSONSchema.js +0 -7
  116. package/esm/components/InputTable.d.ts +0 -317
  117. package/esm/components/InputTable.js +0 -176
  118. package/esm/components/JSONSchemaEditor.d.ts +0 -2
  119. package/esm/components/JSONSchemaEditor.js +0 -7
  120. package/esm/components/Layout.d.ts +0 -74
  121. package/esm/components/Layout.js +0 -60
  122. package/esm/components/Link.d.ts +0 -60
  123. package/esm/components/Link.js +0 -44
  124. package/esm/components/ListGroup.d.ts +0 -77
  125. package/esm/components/ListGroup.js +0 -31
  126. package/esm/components/ListMenu.d.ts +0 -568
  127. package/esm/components/ListMenu.js +0 -62
  128. package/esm/components/LocationPicker.d.ts +0 -467
  129. package/esm/components/LocationPicker.js +0 -208
  130. package/esm/components/Markdown.d.ts +0 -25
  131. package/esm/components/Markdown.js +0 -70
  132. package/esm/components/Menu.d.ts +0 -2
  133. package/esm/components/Menu.js +0 -7
  134. package/esm/components/MobileDevTool.d.ts +0 -12
  135. package/esm/components/MobileDevTool.js +0 -312
  136. package/esm/components/Modal.d.ts +0 -1316
  137. package/esm/components/Modal.js +0 -261
  138. package/esm/components/ModalManager.d.ts +0 -17
  139. package/esm/components/ModalManager.js +0 -42
  140. package/esm/components/MonthRangePicker.d.ts +0 -744
  141. package/esm/components/MultilineText.d.ts +0 -454
  142. package/esm/components/MultilineText.js +0 -90
  143. package/esm/components/NumberInput.d.ts +0 -201
  144. package/esm/components/NumberInput.js +0 -274
  145. package/esm/components/OverflowTpl.d.ts +0 -61
  146. package/esm/components/OverflowTpl.js +0 -101
  147. package/esm/components/Pagination.d.ts +0 -812
  148. package/esm/components/Pagination.js +0 -375
  149. package/esm/components/PdfViewer.d.ts +0 -49
  150. package/esm/components/PdfViewer.js +0 -83
  151. package/esm/components/Picker.d.ts +0 -277
  152. package/esm/components/Picker.js +0 -73
  153. package/esm/components/PickerColumn.d.ts +0 -62
  154. package/esm/components/PickerColumn.js +0 -276
  155. package/esm/components/PickerContainer.d.ts +0 -291
  156. package/esm/components/PickerContainer.js +0 -157
  157. package/esm/components/PopOverContainer.d.ts +0 -59
  158. package/esm/components/PopOverContainer.js +0 -149
  159. package/esm/components/PopUp.d.ts +0 -573
  160. package/esm/components/PopUp.js +0 -85
  161. package/esm/components/Progress.d.ts +0 -311
  162. package/esm/components/Progress.js +0 -136
  163. package/esm/components/PullRefresh.d.ts +0 -79
  164. package/esm/components/PullRefresh.js +0 -172
  165. package/esm/components/Radios.d.ts +0 -170
  166. package/esm/components/Radios.js +0 -122
  167. package/esm/components/Range.d.ts +0 -131
  168. package/esm/components/Range.js +0 -517
  169. package/esm/components/Rating.d.ts +0 -227
  170. package/esm/components/Rating.js +0 -341
  171. package/esm/components/ResultBox.d.ts +0 -532
  172. package/esm/components/ResultBox.js +0 -215
  173. package/esm/components/ResultList.d.ts +0 -554
  174. package/esm/components/ResultList.js +0 -254
  175. package/esm/components/ResultTableList.d.ts +0 -786
  176. package/esm/components/ResultTableList.js +0 -152
  177. package/esm/components/ResultTreeList.d.ts +0 -425
  178. package/esm/components/ResultTreeList.js +0 -239
  179. package/esm/components/RichText.d.ts +0 -48
  180. package/esm/components/RichText.js +0 -271
  181. package/esm/components/SearchBox.d.ts +0 -625
  182. package/esm/components/SearchBox.js +0 -299
  183. package/esm/components/Select.d.ts +0 -6498
  184. package/esm/components/Select.js +0 -843
  185. package/esm/components/SelectMobile.d.ts +0 -38
  186. package/esm/components/SelectMobile.js +0 -370
  187. package/esm/components/Selection.d.ts +0 -598
  188. package/esm/components/Selection.js +0 -166
  189. package/esm/components/Shape.d.ts +0 -58
  190. package/esm/components/Shape.js +0 -429
  191. package/esm/components/Signature.d.ts +0 -279
  192. package/esm/components/Signature.js +0 -291
  193. package/esm/components/Slider.d.ts +0 -56
  194. package/esm/components/Slider.js +0 -140
  195. package/esm/components/SparkLine.d.ts +0 -397
  196. package/esm/components/SparkLine.js +0 -62
  197. package/esm/components/Spinner.d.ts +0 -266
  198. package/esm/components/Spinner.js +0 -202
  199. package/esm/components/Steps.d.ts +0 -117
  200. package/esm/components/Steps.js +0 -76
  201. package/esm/components/Switch.d.ts +0 -105
  202. package/esm/components/Switch.js +0 -73
  203. package/esm/components/Tab.d.ts +0 -2
  204. package/esm/components/Tab.js +0 -7
  205. package/esm/components/Table.d.ts +0 -2
  206. package/esm/components/Table.js +0 -7
  207. package/esm/components/TableSelection.d.ts +0 -791
  208. package/esm/components/TableSelection.js +0 -169
  209. package/esm/components/Tabs.d.ts +0 -670
  210. package/esm/components/Tabs.js +0 -607
  211. package/esm/components/TabsTransfer.d.ts +0 -423
  212. package/esm/components/TabsTransfer.js +0 -219
  213. package/esm/components/TabsTransferPicker.d.ts +0 -267
  214. package/esm/components/TabsTransferPicker.js +0 -81
  215. package/esm/components/Tag.d.ts +0 -307
  216. package/esm/components/Tag.js +0 -137
  217. package/esm/components/Textarea.d.ts +0 -564
  218. package/esm/components/Textarea.js +0 -147
  219. package/esm/components/Timeline.d.ts +0 -56
  220. package/esm/components/Timeline.js +0 -60
  221. package/esm/components/TimelineItem.d.ts +0 -1292
  222. package/esm/components/TimelineItem.js +0 -101
  223. package/esm/components/Tinymce.d.ts +0 -66
  224. package/esm/components/Tinymce.js +0 -632
  225. package/esm/components/TitleBar.d.ts +0 -123
  226. package/esm/components/TitleBar.js +0 -48
  227. package/esm/components/Toast.d.ts +0 -591
  228. package/esm/components/Toast.js +0 -247
  229. package/esm/components/Tooltip.d.ts +0 -65
  230. package/esm/components/Tooltip.js +0 -36
  231. package/esm/components/TooltipWrapper.d.ts +0 -217
  232. package/esm/components/TooltipWrapper.js +0 -181
  233. package/esm/components/Transfer.d.ts +0 -1844
  234. package/esm/components/Transfer.js +0 -481
  235. package/esm/components/TransferDropDown.d.ts +0 -634
  236. package/esm/components/TransferDropDown.js +0 -98
  237. package/esm/components/TransferPicker.d.ts +0 -275
  238. package/esm/components/TransferPicker.js +0 -98
  239. package/esm/components/TransferSearch.d.ts +0 -283
  240. package/esm/components/TransferSearch.js +0 -100
  241. package/esm/components/Tree.d.ts +0 -1991
  242. package/esm/components/Tree.js +0 -1179
  243. package/esm/components/TreeSelection.d.ts +0 -601
  244. package/esm/components/TreeSelection.js +0 -201
  245. package/esm/components/UserSelect.d.ts +0 -541
  246. package/esm/components/UserSelect.js +0 -674
  247. package/esm/components/UserTabSelect.d.ts +0 -315
  248. package/esm/components/UserTabSelect.js +0 -227
  249. package/esm/components/VerificationCode.d.ts +0 -116
  250. package/esm/components/VerificationCode.js +0 -172
  251. package/esm/components/VirtualList.d.ts +0 -2
  252. package/esm/components/VirtualList.js +0 -7
  253. package/esm/components/WithRemoteConfig.d.ts +0 -383
  254. package/esm/components/WithRemoteConfig.js +0 -302
  255. package/esm/components/WithStore.d.ts +0 -72
  256. package/esm/components/WithStore.js +0 -48
  257. package/esm/components/calendar/Calendar.d.ts +0 -83
  258. package/esm/components/calendar/Calendar.js +0 -529
  259. package/esm/components/calendar/CalendarContainer.d.ts +0 -10
  260. package/esm/components/calendar/CalendarContainer.js +0 -27
  261. package/esm/components/calendar/DaysView.d.ts +0 -184
  262. package/esm/components/calendar/DaysView.js +0 -527
  263. package/esm/components/calendar/MonthsView.d.ts +0 -133
  264. package/esm/components/calendar/MonthsView.js +0 -175
  265. package/esm/components/calendar/QuartersView.d.ts +0 -102
  266. package/esm/components/calendar/QuartersView.js +0 -125
  267. package/esm/components/calendar/TimeView.d.ts +0 -183
  268. package/esm/components/calendar/TimeView.js +0 -559
  269. package/esm/components/calendar/YearsView.d.ts +0 -102
  270. package/esm/components/calendar/YearsView.js +0 -122
  271. package/esm/components/condition-builder/Expression.d.ts +0 -292
  272. package/esm/components/condition-builder/Expression.js +0 -121
  273. package/esm/components/condition-builder/Field.d.ts +0 -272
  274. package/esm/components/condition-builder/Field.js +0 -32
  275. package/esm/components/condition-builder/Formula.d.ts +0 -261
  276. package/esm/components/condition-builder/Func.d.ts +0 -273
  277. package/esm/components/condition-builder/Func.js +0 -75
  278. package/esm/components/condition-builder/Group.d.ts +0 -310
  279. package/esm/components/condition-builder/Group.js +0 -191
  280. package/esm/components/condition-builder/GroupOrItem.d.ts +0 -87
  281. package/esm/components/condition-builder/GroupOrItem.js +0 -105
  282. package/esm/components/condition-builder/InputSwitch.d.ts +0 -47
  283. package/esm/components/condition-builder/InputSwitch.js +0 -28
  284. package/esm/components/condition-builder/Item.d.ts +0 -287
  285. package/esm/components/condition-builder/Item.js +0 -232
  286. package/esm/components/condition-builder/Value.d.ts +0 -272
  287. package/esm/components/condition-builder/Value.js +0 -108
  288. package/esm/components/condition-builder/config.d.ts +0 -36
  289. package/esm/components/condition-builder/config.js +0 -120
  290. package/esm/components/condition-builder/index.d.ts +0 -319
  291. package/esm/components/condition-builder/index.js +0 -228
  292. package/esm/components/condition-builder/types.d.ts +0 -115
  293. package/esm/components/formula/CodeEditor.d.ts +0 -92
  294. package/esm/components/formula/CodeEditor.js +0 -99
  295. package/esm/components/formula/Editor.d.ts +0 -516
  296. package/esm/components/formula/Editor.js +0 -430
  297. package/esm/components/formula/FuncList.d.ts +0 -46
  298. package/esm/components/formula/FuncList.js +0 -63
  299. package/esm/components/formula/Input.d.ts +0 -292
  300. package/esm/components/formula/Input.js +0 -122
  301. package/esm/components/formula/Picker.d.ts +0 -492
  302. package/esm/components/formula/Picker.js +0 -454
  303. package/esm/components/formula/VariableList.d.ts +0 -58
  304. package/esm/components/formula/VariableList.js +0 -182
  305. package/esm/components/formula/plugin.d.ts +0 -51
  306. package/esm/components/formula/plugin.js +0 -372
  307. package/esm/components/icons.d.ts +0 -61
  308. package/esm/components/icons.js +0 -456
  309. package/esm/components/index.d.ts +0 -136
  310. package/esm/components/json-schema/Array.d.ts +0 -3
  311. package/esm/components/json-schema/Array.js +0 -129
  312. package/esm/components/json-schema/Item.d.ts +0 -5
  313. package/esm/components/json-schema/Item.js +0 -63
  314. package/esm/components/json-schema/Object.d.ts +0 -5
  315. package/esm/components/json-schema/Object.js +0 -265
  316. package/esm/components/json-schema/index.d.ts +0 -272
  317. package/esm/components/json-schema/index.js +0 -29
  318. package/esm/components/menu/MenuContext.d.ts +0 -83
  319. package/esm/components/menu/MenuContext.js +0 -25
  320. package/esm/components/menu/MenuItem.d.ts +0 -81
  321. package/esm/components/menu/MenuItem.js +0 -112
  322. package/esm/components/menu/PanelMenu.d.ts +0 -46
  323. package/esm/components/menu/PanelMenu.js +0 -68
  324. package/esm/components/menu/SubMenu.d.ts +0 -84
  325. package/esm/components/menu/SubMenu.js +0 -137
  326. package/esm/components/menu/index.d.ts +0 -381
  327. package/esm/components/menu/index.js +0 -369
  328. package/esm/components/schema-editor/Array.d.ts +0 -11
  329. package/esm/components/schema-editor/Array.js +0 -84
  330. package/esm/components/schema-editor/Common.d.ts +0 -61
  331. package/esm/components/schema-editor/Common.js +0 -161
  332. package/esm/components/schema-editor/Item.d.ts +0 -8
  333. package/esm/components/schema-editor/Item.js +0 -24
  334. package/esm/components/schema-editor/Object.d.ts +0 -51
  335. package/esm/components/schema-editor/Object.js +0 -294
  336. package/esm/components/schema-editor/SchemaVariableList.d.ts +0 -186
  337. package/esm/components/schema-editor/SchemaVariableList.js +0 -74
  338. package/esm/components/schema-editor/SchemaVariableListPicker.d.ts +0 -179
  339. package/esm/components/schema-editor/SchemaVariableListPicker.js +0 -34
  340. package/esm/components/schema-editor/index.d.ts +0 -797
  341. package/esm/components/schema-editor/index.js +0 -122
  342. package/esm/components/table/Cell.d.ts +0 -36
  343. package/esm/components/table/Cell.js +0 -43
  344. package/esm/components/table/ColGroup.d.ts +0 -24
  345. package/esm/components/table/ColGroup.js +0 -58
  346. package/esm/components/table/Head.d.ts +0 -45
  347. package/esm/components/table/Head.js +0 -150
  348. package/esm/components/table/HeadCellDropDown.d.ts +0 -289
  349. package/esm/components/table/HeadCellDropDown.js +0 -55
  350. package/esm/components/table/HeadCellFilter.d.ts +0 -414
  351. package/esm/components/table/HeadCellFilter.js +0 -131
  352. package/esm/components/table/HeadCellSelect.d.ts +0 -357
  353. package/esm/components/table/HeadCellSelect.js +0 -52
  354. package/esm/components/table/HeadCellSort.d.ts +0 -278
  355. package/esm/components/table/HeadCellSort.js +0 -88
  356. package/esm/components/table/ItemActionsWrapper.d.ts +0 -10
  357. package/esm/components/table/ItemActionsWrapper.js +0 -29
  358. package/esm/components/table/Row.d.ts +0 -56
  359. package/esm/components/table/Row.js +0 -224
  360. package/esm/components/table/SummaryRow.d.ts +0 -28
  361. package/esm/components/table/SummaryRow.js +0 -73
  362. package/esm/components/table/index.d.ts +0 -852
  363. package/esm/components/table/index.js +0 -1067
  364. package/esm/components/table/util.d.ts +0 -56
  365. package/esm/components/table/util.js +0 -263
  366. package/esm/components/virtual-list/AutoSizer.d.ts +0 -19
  367. package/esm/components/virtual-list/AutoSizer.js +0 -49
  368. package/esm/components/virtual-list/SizeAndPositionManager.d.ts +0 -70
  369. package/esm/components/virtual-list/SizeAndPositionManager.js +0 -216
  370. package/esm/components/virtual-list/constants.d.ts +0 -34
  371. package/esm/components/virtual-list/constants.js +0 -45
  372. package/esm/components/virtual-list/index.d.ts +0 -99
  373. package/esm/components/virtual-list/index.js +0 -288
  374. package/esm/components/withBadge.d.ts +0 -2
  375. package/esm/components/withBadge.js +0 -7
  376. package/esm/hooks/index.d.ts +0 -8
  377. package/esm/hooks/use-click-away.d.ts +0 -12
  378. package/esm/hooks/use-click-away.js +0 -55
  379. package/esm/hooks/use-on-screen.d.ts +0 -2
  380. package/esm/hooks/use-on-screen.js +0 -28
  381. package/esm/hooks/use-set-state.d.ts +0 -2
  382. package/esm/hooks/use-set-state.js +0 -19
  383. package/esm/hooks/use-sub-form.d.ts +0 -4
  384. package/esm/hooks/use-sub-form.js +0 -39
  385. package/esm/hooks/use-touch.d.ts +0 -16
  386. package/esm/hooks/use-touch.js +0 -77
  387. package/esm/hooks/use-update-effect.d.ts +0 -3
  388. package/esm/hooks/use-update-effect.js +0 -21
  389. package/esm/hooks/use-validation-resolver.d.ts +0 -7
  390. package/esm/hooks/use-validation-resolver.js +0 -115
  391. package/esm/icons/alert-danger.svg.js +0 -22
  392. package/esm/icons/alert-info.svg.js +0 -22
  393. package/esm/icons/alert-success.svg.js +0 -22
  394. package/esm/icons/alert-warning.svg.js +0 -22
  395. package/esm/icons/arrow-double-left.svg.js +0 -24
  396. package/esm/icons/arrow-double-right.svg.js +0 -24
  397. package/esm/icons/back.svg.js +0 -21
  398. package/esm/icons/calendar.svg.js +0 -31
  399. package/esm/icons/caret.svg.js +0 -21
  400. package/esm/icons/check.svg.js +0 -21
  401. package/esm/icons/clock.svg.js +0 -29
  402. package/esm/icons/close-small.svg.js +0 -24
  403. package/esm/icons/close.svg.js +0 -21
  404. package/esm/icons/cloud-upload.svg.js +0 -22
  405. package/esm/icons/column-filter.svg.js +0 -22
  406. package/esm/icons/columns.svg.js +0 -21
  407. package/esm/icons/compress-alt.svg.js +0 -21
  408. package/esm/icons/copy.svg.js +0 -26
  409. package/esm/icons/date.svg.js +0 -26
  410. package/esm/icons/department.svg.js +0 -52
  411. package/esm/icons/desk-empty.svg.js +0 -73
  412. package/esm/icons/dot.svg.js +0 -36
  413. package/esm/icons/down-arrow-bold.svg.js +0 -22
  414. package/esm/icons/down.svg.js +0 -23
  415. package/esm/icons/download.svg.js +0 -24
  416. package/esm/icons/drag-bar.svg.js +0 -53
  417. package/esm/icons/drag.svg.js +0 -22
  418. package/esm/icons/edit.svg.js +0 -21
  419. package/esm/icons/ellipsis-v.svg.js +0 -21
  420. package/esm/icons/enter.svg.js +0 -20
  421. package/esm/icons/exchange.svg.js +0 -21
  422. package/esm/icons/expand-alt.svg.js +0 -21
  423. package/esm/icons/fail.svg.js +0 -31
  424. package/esm/icons/file.svg.js +0 -22
  425. package/esm/icons/filter.svg.js +0 -21
  426. package/esm/icons/folder.svg.js +0 -24
  427. package/esm/icons/fullscreen.svg.js +0 -21
  428. package/esm/icons/function.svg.js +0 -21
  429. package/esm/icons/home.svg.js +0 -21
  430. package/esm/icons/if.svg.js +0 -21
  431. package/esm/icons/image.svg.js +0 -20
  432. package/esm/icons/info-circle.svg.js +0 -21
  433. package/esm/icons/info.svg.js +0 -27
  434. package/esm/icons/input-clear.svg.js +0 -20
  435. package/esm/icons/invisible.svg.js +0 -22
  436. package/esm/icons/left-arrow.svg.js +0 -23
  437. package/esm/icons/loading-outline.svg.js +0 -21
  438. package/esm/icons/location.svg.js +0 -20
  439. package/esm/icons/menu.svg.js +0 -20
  440. package/esm/icons/minus.svg.js +0 -21
  441. package/esm/icons/move.svg.js +0 -22
  442. package/esm/icons/mute.svg.js +0 -21
  443. package/esm/icons/new-edit.svg.js +0 -22
  444. package/esm/icons/pause.svg.js +0 -21
  445. package/esm/icons/pencil.svg.js +0 -21
  446. package/esm/icons/play.svg.js +0 -20
  447. package/esm/icons/plus-cicle.svg.js +0 -20
  448. package/esm/icons/plus-fine.svg.js +0 -21
  449. package/esm/icons/plus.svg.js +0 -21
  450. package/esm/icons/post.svg.js +0 -48
  451. package/esm/icons/question-mark.svg.js +0 -26
  452. package/esm/icons/question.svg.js +0 -21
  453. package/esm/icons/redo.svg.js +0 -21
  454. package/esm/icons/refresh.svg.js +0 -21
  455. package/esm/icons/reload.svg.js +0 -21
  456. package/esm/icons/remove.svg.js +0 -21
  457. package/esm/icons/retry.svg.js +0 -24
  458. package/esm/icons/right-arrow-bold.svg.js +0 -21
  459. package/esm/icons/right-arrow.svg.js +0 -23
  460. package/esm/icons/right-double-arrow.svg.js +0 -22
  461. package/esm/icons/role.svg.js +0 -43
  462. package/esm/icons/rotate-left.svg.js +0 -22
  463. package/esm/icons/rotate-right.svg.js +0 -22
  464. package/esm/icons/rotate-screen.svg.js +0 -21
  465. package/esm/icons/scale-origin.svg.js +0 -24
  466. package/esm/icons/schedule.svg.js +0 -24
  467. package/esm/icons/search.svg.js +0 -21
  468. package/esm/icons/setting.svg.js +0 -21
  469. package/esm/icons/slider-handle-icon.svg.js +0 -22
  470. package/esm/icons/sort-asc.svg.js +0 -21
  471. package/esm/icons/sort-default.svg.js +0 -21
  472. package/esm/icons/sort-desc.svg.js +0 -21
  473. package/esm/icons/star.svg.js +0 -21
  474. package/esm/icons/status-close.svg.js +0 -23
  475. package/esm/icons/steps-finsh.svg.js +0 -22
  476. package/esm/icons/sub-plus.svg.js +0 -20
  477. package/esm/icons/success.svg.js +0 -29
  478. package/esm/icons/transparent.svg.js +0 -38
  479. package/esm/icons/trash.svg.js +0 -22
  480. package/esm/icons/tree-down.svg.js +0 -21
  481. package/esm/icons/undo-normal.svg.js +0 -25
  482. package/esm/icons/undo.svg.js +0 -21
  483. package/esm/icons/unfullscreen.svg.js +0 -21
  484. package/esm/icons/upload.svg.js +0 -21
  485. package/esm/icons/user-remove.svg.js +0 -33
  486. package/esm/icons/view.svg.js +0 -22
  487. package/esm/icons/volume.svg.js +0 -24
  488. package/esm/icons/warning-mark.svg.js +0 -22
  489. package/esm/icons/warning.svg.js +0 -21
  490. package/esm/icons/window-restore.svg.js +0 -21
  491. package/esm/icons/zoom-in.svg.js +0 -21
  492. package/esm/icons/zoom-out.svg.js +0 -21
  493. package/esm/index.d.ts +0 -15
  494. package/esm/index.js +0 -154
  495. package/esm/locale/de-DE.d.ts +0 -1
  496. package/esm/locale/de-DE.js +0 -419
  497. package/esm/locale/en-US.d.ts +0 -1
  498. package/esm/locale/en-US.js +0 -425
  499. package/esm/locale/zh-CN.d.ts +0 -1
  500. package/esm/locale/zh-CN.js +0 -434
  501. package/esm/themes/ang.d.ts +0 -3
  502. package/esm/themes/ang.js +0 -15
  503. package/esm/themes/antd.d.ts +0 -1
  504. package/esm/themes/antd.js +0 -42
  505. package/esm/themes/cxd.d.ts +0 -3
  506. package/esm/themes/cxd.js +0 -455
  507. package/esm/themes/dark.d.ts +0 -3
  508. package/esm/themes/dark.js +0 -23
  509. package/esm/themes/default.d.ts +0 -4
  510. package/esm/utils/index.d.ts +0 -2
  511. package/esm/utils/smoothSignature.d.ts +0 -86
  512. package/esm/utils/vectorComputed.d.ts +0 -20
  513. package/esm/utils/vectorComputed.js +0 -75
  514. package/esm/withRemoteConfig.d.ts +0 -2
  515. package/esm/withRemoteConfig.js +0 -7
  516. package/esm/withStore.d.ts +0 -2
  517. package/esm/withStore.js +0 -7
  518. package/lib/components/404.d.ts +0 -53
  519. package/lib/components/404.js +0 -43
  520. package/lib/components/Alert.d.ts +0 -615
  521. package/lib/components/Alert.js +0 -279
  522. package/lib/components/Alert2.d.ts +0 -117
  523. package/lib/components/Alert2.js +0 -66
  524. package/lib/components/AlphabetIndexer.d.ts +0 -11
  525. package/lib/components/AlphabetIndexer.js +0 -59
  526. package/lib/components/AnchorNav.d.ts +0 -162
  527. package/lib/components/AnchorNav.js +0 -162
  528. package/lib/components/AnchorNavSection.d.ts +0 -2
  529. package/lib/components/AnchorNavSection.js +0 -14
  530. package/lib/components/ArrayInput.d.ts +0 -617
  531. package/lib/components/ArrayInput.js +0 -160
  532. package/lib/components/AsideNav.d.ts +0 -142
  533. package/lib/components/AsideNav.js +0 -140
  534. package/lib/components/AssociatedSelection.d.ts +0 -564
  535. package/lib/components/AssociatedSelection.js +0 -106
  536. package/lib/components/AutoSizer.d.ts +0 -2
  537. package/lib/components/AutoSizer.js +0 -15
  538. package/lib/components/Avatar.d.ts +0 -374
  539. package/lib/components/Avatar.js +0 -154
  540. package/lib/components/Badge.d.ts +0 -118
  541. package/lib/components/Badge.js +0 -165
  542. package/lib/components/BaiduMapPicker.d.ts +0 -100
  543. package/lib/components/BaiduMapPicker.js +0 -379
  544. package/lib/components/BarCode.d.ts +0 -56
  545. package/lib/components/BarCode.js +0 -52
  546. package/lib/components/Breadcrumb.d.ts +0 -115
  547. package/lib/components/Breadcrumb.js +0 -170
  548. package/lib/components/Button.d.ts +0 -147
  549. package/lib/components/Button.js +0 -71
  550. package/lib/components/CalendarMobile.d.ts +0 -431
  551. package/lib/components/CalendarMobile.js +0 -546
  552. package/lib/components/Card.d.ts +0 -444
  553. package/lib/components/Card.js +0 -100
  554. package/lib/components/Cascader.d.ts +0 -108
  555. package/lib/components/Cascader.js +0 -527
  556. package/lib/components/ChainedDropdownSelection.d.ts +0 -561
  557. package/lib/components/ChainedDropdownSelection.js +0 -116
  558. package/lib/components/ChainedSelection.d.ts +0 -554
  559. package/lib/components/ChainedSelection.js +0 -197
  560. package/lib/components/Checkbox.d.ts +0 -110
  561. package/lib/components/Checkbox.js +0 -95
  562. package/lib/components/CityArea.d.ts +0 -299
  563. package/lib/components/CityArea.js +0 -197
  564. package/lib/components/CityDB.d.ts +0 -13
  565. package/lib/components/CityDB.js +0 -3949
  566. package/lib/components/CodeMirror.d.ts +0 -29
  567. package/lib/components/CodeMirror.js +0 -152
  568. package/lib/components/Collapse.d.ts +0 -447
  569. package/lib/components/Collapse.js +0 -192
  570. package/lib/components/CollapseGroup.d.ts +0 -219
  571. package/lib/components/CollapseGroup.js +0 -124
  572. package/lib/components/ColorPicker.d.ts +0 -530
  573. package/lib/components/ColorPicker.js +0 -267
  574. package/lib/components/Combo.d.ts +0 -354
  575. package/lib/components/Combo.js +0 -165
  576. package/lib/components/ConditionBuilder.d.ts +0 -2
  577. package/lib/components/ConditionBuilder.js +0 -14
  578. package/lib/components/ConfirmBox.d.ts +0 -322
  579. package/lib/components/ConfirmBox.js +0 -141
  580. package/lib/components/ContextMenu.d.ts +0 -115
  581. package/lib/components/ContextMenu.js +0 -322
  582. package/lib/components/DatePicker.d.ts +0 -638
  583. package/lib/components/DatePicker.js +0 -725
  584. package/lib/components/DateRangePicker.d.ts +0 -1046
  585. package/lib/components/DateRangePicker.js +0 -1401
  586. package/lib/components/DiffEditor.d.ts +0 -21
  587. package/lib/components/DiffEditor.js +0 -130
  588. package/lib/components/DndContainer.d.ts +0 -205
  589. package/lib/components/DndContainer.js +0 -32
  590. package/lib/components/Drawer.d.ts +0 -158
  591. package/lib/components/Drawer.js +0 -279
  592. package/lib/components/DropDownSelection.d.ts +0 -557
  593. package/lib/components/DropDownSelection.js +0 -85
  594. package/lib/components/DropdownContextMenus.d.ts +0 -84
  595. package/lib/components/DropdownContextMenus.js +0 -101
  596. package/lib/components/Editor.d.ts +0 -681
  597. package/lib/components/Editor.js +0 -246
  598. package/lib/components/Form.d.ts +0 -31
  599. package/lib/components/Form.js +0 -97
  600. package/lib/components/FormField.d.ts +0 -287
  601. package/lib/components/FormField.js +0 -90
  602. package/lib/components/FormulaPicker.d.ts +0 -2
  603. package/lib/components/FormulaPicker.js +0 -14
  604. package/lib/components/GaodeMapPicker.d.ts +0 -89
  605. package/lib/components/GaodeMapPicker.js +0 -217
  606. package/lib/components/GridNav.d.ts +0 -53
  607. package/lib/components/GridNav.js +0 -133
  608. package/lib/components/GridNavItem.d.ts +0 -2
  609. package/lib/components/GridNavItem.js +0 -14
  610. package/lib/components/GroupedSelection.d.ts +0 -543
  611. package/lib/components/GroupedSelection.js +0 -150
  612. package/lib/components/HeadCellDropDown.d.ts +0 -2
  613. package/lib/components/HeadCellDropDown.js +0 -14
  614. package/lib/components/HorizontalScroll.d.ts +0 -75
  615. package/lib/components/HorizontalScroll.js +0 -283
  616. package/lib/components/Html.d.ts +0 -82
  617. package/lib/components/Html.js +0 -59
  618. package/lib/components/Icon.d.ts +0 -2
  619. package/lib/components/Icon.js +0 -14
  620. package/lib/components/ImageGallery.d.ts +0 -465
  621. package/lib/components/ImageGallery.js +0 -409
  622. package/lib/components/Input.d.ts +0 -18
  623. package/lib/components/Input.js +0 -86
  624. package/lib/components/InputBox.d.ts +0 -100
  625. package/lib/components/InputBox.js +0 -110
  626. package/lib/components/InputBoxWithSuggestion.d.ts +0 -272
  627. package/lib/components/InputBoxWithSuggestion.js +0 -81
  628. package/lib/components/InputJSONSchema.d.ts +0 -2
  629. package/lib/components/InputJSONSchema.js +0 -14
  630. package/lib/components/InputTable.d.ts +0 -317
  631. package/lib/components/InputTable.js +0 -189
  632. package/lib/components/JSONSchemaEditor.d.ts +0 -2
  633. package/lib/components/JSONSchemaEditor.js +0 -14
  634. package/lib/components/Layout.d.ts +0 -74
  635. package/lib/components/Layout.js +0 -56
  636. package/lib/components/Link.d.ts +0 -60
  637. package/lib/components/Link.js +0 -56
  638. package/lib/components/ListGroup.d.ts +0 -77
  639. package/lib/components/ListGroup.js +0 -43
  640. package/lib/components/ListMenu.d.ts +0 -568
  641. package/lib/components/ListMenu.js +0 -74
  642. package/lib/components/LocationPicker.d.ts +0 -467
  643. package/lib/components/LocationPicker.js +0 -220
  644. package/lib/components/Markdown.d.ts +0 -25
  645. package/lib/components/Markdown.js +0 -83
  646. package/lib/components/Menu.d.ts +0 -2
  647. package/lib/components/Menu.js +0 -14
  648. package/lib/components/MobileDevTool.d.ts +0 -12
  649. package/lib/components/MobileDevTool.js +0 -325
  650. package/lib/components/Modal.d.ts +0 -1316
  651. package/lib/components/Modal.js +0 -272
  652. package/lib/components/ModalManager.d.ts +0 -17
  653. package/lib/components/ModalManager.js +0 -53
  654. package/lib/components/MonthRangePicker.d.ts +0 -744
  655. package/lib/components/MultilineText.d.ts +0 -454
  656. package/lib/components/MultilineText.js +0 -102
  657. package/lib/components/NumberInput.d.ts +0 -201
  658. package/lib/components/NumberInput.js +0 -289
  659. package/lib/components/OverflowTpl.d.ts +0 -61
  660. package/lib/components/OverflowTpl.js +0 -109
  661. package/lib/components/Pagination.d.ts +0 -812
  662. package/lib/components/Pagination.js +0 -388
  663. package/lib/components/PdfViewer.d.ts +0 -49
  664. package/lib/components/PdfViewer.js +0 -89
  665. package/lib/components/Picker.d.ts +0 -277
  666. package/lib/components/Picker.js +0 -80
  667. package/lib/components/PickerColumn.d.ts +0 -62
  668. package/lib/components/PickerColumn.js +0 -288
  669. package/lib/components/PickerContainer.d.ts +0 -291
  670. package/lib/components/PickerContainer.js +0 -169
  671. package/lib/components/PopOverContainer.d.ts +0 -59
  672. package/lib/components/PopOverContainer.js +0 -162
  673. package/lib/components/PopUp.d.ts +0 -573
  674. package/lib/components/PopUp.js +0 -94
  675. package/lib/components/Progress.d.ts +0 -311
  676. package/lib/components/Progress.js +0 -148
  677. package/lib/components/PullRefresh.d.ts +0 -79
  678. package/lib/components/PullRefresh.js +0 -178
  679. package/lib/components/Radios.d.ts +0 -170
  680. package/lib/components/Radios.js +0 -119
  681. package/lib/components/Range.d.ts +0 -131
  682. package/lib/components/Range.js +0 -528
  683. package/lib/components/Rating.d.ts +0 -227
  684. package/lib/components/Rating.js +0 -349
  685. package/lib/components/ResultBox.d.ts +0 -532
  686. package/lib/components/ResultBox.js +0 -230
  687. package/lib/components/ResultList.d.ts +0 -554
  688. package/lib/components/ResultList.js +0 -268
  689. package/lib/components/ResultTableList.d.ts +0 -786
  690. package/lib/components/ResultTableList.js +0 -161
  691. package/lib/components/ResultTreeList.d.ts +0 -425
  692. package/lib/components/ResultTreeList.js +0 -254
  693. package/lib/components/RichText.d.ts +0 -48
  694. package/lib/components/RichText.js +0 -283
  695. package/lib/components/SearchBox.d.ts +0 -625
  696. package/lib/components/SearchBox.js +0 -315
  697. package/lib/components/Select.d.ts +0 -6498
  698. package/lib/components/Select.js +0 -861
  699. package/lib/components/SelectMobile.d.ts +0 -38
  700. package/lib/components/SelectMobile.js +0 -382
  701. package/lib/components/Selection.d.ts +0 -598
  702. package/lib/components/Selection.js +0 -176
  703. package/lib/components/Shape.d.ts +0 -58
  704. package/lib/components/Shape.js +0 -434
  705. package/lib/components/Signature.d.ts +0 -279
  706. package/lib/components/Signature.js +0 -295
  707. package/lib/components/Slider.d.ts +0 -56
  708. package/lib/components/Slider.js +0 -146
  709. package/lib/components/SparkLine.d.ts +0 -397
  710. package/lib/components/SparkLine.js +0 -74
  711. package/lib/components/Spinner.d.ts +0 -266
  712. package/lib/components/Spinner.js +0 -210
  713. package/lib/components/Steps.d.ts +0 -117
  714. package/lib/components/Steps.js +0 -84
  715. package/lib/components/Switch.d.ts +0 -105
  716. package/lib/components/Switch.js +0 -80
  717. package/lib/components/Tab.d.ts +0 -2
  718. package/lib/components/Tab.js +0 -14
  719. package/lib/components/Table.d.ts +0 -2
  720. package/lib/components/Table.js +0 -14
  721. package/lib/components/TableSelection.d.ts +0 -791
  722. package/lib/components/TableSelection.js +0 -183
  723. package/lib/components/Tabs.d.ts +0 -670
  724. package/lib/components/Tabs.js +0 -618
  725. package/lib/components/TabsTransfer.d.ts +0 -423
  726. package/lib/components/TabsTransfer.js +0 -232
  727. package/lib/components/TabsTransferPicker.d.ts +0 -267
  728. package/lib/components/TabsTransferPicker.js +0 -93
  729. package/lib/components/Tag.d.ts +0 -307
  730. package/lib/components/Tag.js +0 -146
  731. package/lib/components/Textarea.d.ts +0 -564
  732. package/lib/components/Textarea.js +0 -160
  733. package/lib/components/Timeline.d.ts +0 -56
  734. package/lib/components/Timeline.js +0 -68
  735. package/lib/components/TimelineItem.d.ts +0 -1292
  736. package/lib/components/TimelineItem.js +0 -118
  737. package/lib/components/Tinymce.d.ts +0 -66
  738. package/lib/components/Tinymce.js +0 -648
  739. package/lib/components/TitleBar.d.ts +0 -123
  740. package/lib/components/TitleBar.js +0 -51
  741. package/lib/components/Toast.d.ts +0 -591
  742. package/lib/components/Toast.js +0 -258
  743. package/lib/components/Tooltip.d.ts +0 -65
  744. package/lib/components/Tooltip.js +0 -43
  745. package/lib/components/TooltipWrapper.d.ts +0 -217
  746. package/lib/components/TooltipWrapper.js +0 -188
  747. package/lib/components/Transfer.d.ts +0 -1844
  748. package/lib/components/Transfer.js +0 -498
  749. package/lib/components/TransferDropDown.d.ts +0 -634
  750. package/lib/components/TransferDropDown.js +0 -106
  751. package/lib/components/TransferPicker.d.ts +0 -275
  752. package/lib/components/TransferPicker.js +0 -110
  753. package/lib/components/TransferSearch.d.ts +0 -283
  754. package/lib/components/TransferSearch.js +0 -113
  755. package/lib/components/Tree.d.ts +0 -1991
  756. package/lib/components/Tree.js +0 -1173
  757. package/lib/components/TreeSelection.d.ts +0 -601
  758. package/lib/components/TreeSelection.js +0 -209
  759. package/lib/components/UserSelect.d.ts +0 -541
  760. package/lib/components/UserSelect.js +0 -685
  761. package/lib/components/UserTabSelect.d.ts +0 -315
  762. package/lib/components/UserTabSelect.js +0 -235
  763. package/lib/components/VerificationCode.d.ts +0 -116
  764. package/lib/components/VerificationCode.js +0 -191
  765. package/lib/components/VirtualList.d.ts +0 -2
  766. package/lib/components/VirtualList.js +0 -14
  767. package/lib/components/WithRemoteConfig.d.ts +0 -383
  768. package/lib/components/WithRemoteConfig.js +0 -316
  769. package/lib/components/WithStore.d.ts +0 -72
  770. package/lib/components/WithStore.js +0 -61
  771. package/lib/components/calendar/Calendar.d.ts +0 -83
  772. package/lib/components/calendar/Calendar.js +0 -542
  773. package/lib/components/calendar/CalendarContainer.d.ts +0 -10
  774. package/lib/components/calendar/CalendarContainer.js +0 -38
  775. package/lib/components/calendar/DaysView.d.ts +0 -184
  776. package/lib/components/calendar/DaysView.js +0 -546
  777. package/lib/components/calendar/MonthsView.d.ts +0 -133
  778. package/lib/components/calendar/MonthsView.js +0 -188
  779. package/lib/components/calendar/QuartersView.d.ts +0 -102
  780. package/lib/components/calendar/QuartersView.js +0 -138
  781. package/lib/components/calendar/TimeView.d.ts +0 -183
  782. package/lib/components/calendar/TimeView.js +0 -574
  783. package/lib/components/calendar/YearsView.d.ts +0 -102
  784. package/lib/components/calendar/YearsView.js +0 -135
  785. package/lib/components/condition-builder/Expression.d.ts +0 -292
  786. package/lib/components/condition-builder/Expression.js +0 -133
  787. package/lib/components/condition-builder/Field.d.ts +0 -272
  788. package/lib/components/condition-builder/Field.js +0 -44
  789. package/lib/components/condition-builder/Formula.d.ts +0 -261
  790. package/lib/components/condition-builder/Func.d.ts +0 -273
  791. package/lib/components/condition-builder/Func.js +0 -87
  792. package/lib/components/condition-builder/Group.d.ts +0 -310
  793. package/lib/components/condition-builder/Group.js +0 -203
  794. package/lib/components/condition-builder/GroupOrItem.d.ts +0 -87
  795. package/lib/components/condition-builder/GroupOrItem.js +0 -117
  796. package/lib/components/condition-builder/InputSwitch.d.ts +0 -47
  797. package/lib/components/condition-builder/InputSwitch.js +0 -36
  798. package/lib/components/condition-builder/Item.d.ts +0 -287
  799. package/lib/components/condition-builder/Item.js +0 -244
  800. package/lib/components/condition-builder/Value.d.ts +0 -272
  801. package/lib/components/condition-builder/Value.js +0 -121
  802. package/lib/components/condition-builder/config.d.ts +0 -36
  803. package/lib/components/condition-builder/config.js +0 -125
  804. package/lib/components/condition-builder/index.d.ts +0 -319
  805. package/lib/components/condition-builder/index.js +0 -240
  806. package/lib/components/condition-builder/types.d.ts +0 -115
  807. package/lib/components/formula/CodeEditor.d.ts +0 -92
  808. package/lib/components/formula/CodeEditor.js +0 -110
  809. package/lib/components/formula/Editor.d.ts +0 -516
  810. package/lib/components/formula/Editor.js +0 -444
  811. package/lib/components/formula/FuncList.d.ts +0 -46
  812. package/lib/components/formula/FuncList.js +0 -75
  813. package/lib/components/formula/Input.d.ts +0 -292
  814. package/lib/components/formula/Input.js +0 -134
  815. package/lib/components/formula/Picker.d.ts +0 -492
  816. package/lib/components/formula/Picker.js +0 -467
  817. package/lib/components/formula/VariableList.d.ts +0 -58
  818. package/lib/components/formula/VariableList.js +0 -193
  819. package/lib/components/formula/plugin.d.ts +0 -51
  820. package/lib/components/formula/plugin.js +0 -381
  821. package/lib/components/icons.d.ts +0 -61
  822. package/lib/components/icons.js +0 -484
  823. package/lib/components/index.d.ts +0 -136
  824. package/lib/components/json-schema/Array.d.ts +0 -3
  825. package/lib/components/json-schema/Array.js +0 -140
  826. package/lib/components/json-schema/Item.d.ts +0 -5
  827. package/lib/components/json-schema/Item.js +0 -75
  828. package/lib/components/json-schema/Object.d.ts +0 -5
  829. package/lib/components/json-schema/Object.js +0 -278
  830. package/lib/components/json-schema/index.d.ts +0 -272
  831. package/lib/components/json-schema/index.js +0 -40
  832. package/lib/components/menu/MenuContext.d.ts +0 -83
  833. package/lib/components/menu/MenuContext.js +0 -29
  834. package/lib/components/menu/MenuItem.d.ts +0 -81
  835. package/lib/components/menu/MenuItem.js +0 -120
  836. package/lib/components/menu/PanelMenu.d.ts +0 -46
  837. package/lib/components/menu/PanelMenu.js +0 -74
  838. package/lib/components/menu/SubMenu.d.ts +0 -84
  839. package/lib/components/menu/SubMenu.js +0 -145
  840. package/lib/components/menu/index.d.ts +0 -381
  841. package/lib/components/menu/index.js +0 -379
  842. package/lib/components/schema-editor/Array.d.ts +0 -11
  843. package/lib/components/schema-editor/Array.js +0 -95
  844. package/lib/components/schema-editor/Common.d.ts +0 -61
  845. package/lib/components/schema-editor/Common.js +0 -174
  846. package/lib/components/schema-editor/Item.d.ts +0 -8
  847. package/lib/components/schema-editor/Item.js +0 -35
  848. package/lib/components/schema-editor/Object.d.ts +0 -51
  849. package/lib/components/schema-editor/Object.js +0 -305
  850. package/lib/components/schema-editor/SchemaVariableList.d.ts +0 -186
  851. package/lib/components/schema-editor/SchemaVariableList.js +0 -86
  852. package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +0 -179
  853. package/lib/components/schema-editor/SchemaVariableListPicker.js +0 -46
  854. package/lib/components/schema-editor/index.d.ts +0 -797
  855. package/lib/components/schema-editor/index.js +0 -131
  856. package/lib/components/table/Cell.d.ts +0 -36
  857. package/lib/components/table/Cell.js +0 -50
  858. package/lib/components/table/ColGroup.d.ts +0 -24
  859. package/lib/components/table/ColGroup.js +0 -69
  860. package/lib/components/table/Head.d.ts +0 -45
  861. package/lib/components/table/Head.js +0 -157
  862. package/lib/components/table/HeadCellDropDown.d.ts +0 -289
  863. package/lib/components/table/HeadCellDropDown.js +0 -63
  864. package/lib/components/table/HeadCellFilter.d.ts +0 -414
  865. package/lib/components/table/HeadCellFilter.js +0 -140
  866. package/lib/components/table/HeadCellSelect.d.ts +0 -357
  867. package/lib/components/table/HeadCellSelect.js +0 -60
  868. package/lib/components/table/HeadCellSort.d.ts +0 -278
  869. package/lib/components/table/HeadCellSort.js +0 -96
  870. package/lib/components/table/ItemActionsWrapper.d.ts +0 -10
  871. package/lib/components/table/ItemActionsWrapper.js +0 -40
  872. package/lib/components/table/Row.d.ts +0 -56
  873. package/lib/components/table/Row.js +0 -231
  874. package/lib/components/table/SummaryRow.d.ts +0 -28
  875. package/lib/components/table/SummaryRow.js +0 -81
  876. package/lib/components/table/index.d.ts +0 -852
  877. package/lib/components/table/index.js +0 -1081
  878. package/lib/components/table/util.d.ts +0 -56
  879. package/lib/components/table/util.js +0 -285
  880. package/lib/components/virtual-list/AutoSizer.d.ts +0 -19
  881. package/lib/components/virtual-list/AutoSizer.js +0 -76
  882. package/lib/components/virtual-list/SizeAndPositionManager.d.ts +0 -70
  883. package/lib/components/virtual-list/SizeAndPositionManager.js +0 -220
  884. package/lib/components/virtual-list/constants.d.ts +0 -34
  885. package/lib/components/virtual-list/constants.js +0 -53
  886. package/lib/components/virtual-list/index.d.ts +0 -99
  887. package/lib/components/virtual-list/index.js +0 -317
  888. package/lib/components/withBadge.d.ts +0 -2
  889. package/lib/components/withBadge.js +0 -14
  890. package/lib/helper.css +0 -47744
  891. package/lib/hooks/index.d.ts +0 -8
  892. package/lib/hooks/use-click-away.d.ts +0 -12
  893. package/lib/hooks/use-click-away.js +0 -59
  894. package/lib/hooks/use-on-screen.d.ts +0 -2
  895. package/lib/hooks/use-on-screen.js +0 -32
  896. package/lib/hooks/use-set-state.d.ts +0 -2
  897. package/lib/hooks/use-set-state.js +0 -27
  898. package/lib/hooks/use-sub-form.d.ts +0 -4
  899. package/lib/hooks/use-sub-form.js +0 -48
  900. package/lib/hooks/use-touch.d.ts +0 -16
  901. package/lib/hooks/use-touch.js +0 -81
  902. package/lib/hooks/use-update-effect.d.ts +0 -3
  903. package/lib/hooks/use-update-effect.js +0 -25
  904. package/lib/hooks/use-validation-resolver.d.ts +0 -7
  905. package/lib/hooks/use-validation-resolver.js +0 -125
  906. package/lib/icons/alert-danger.svg.js +0 -29
  907. package/lib/icons/alert-info.svg.js +0 -29
  908. package/lib/icons/alert-success.svg.js +0 -29
  909. package/lib/icons/alert-warning.svg.js +0 -29
  910. package/lib/icons/arrow-double-left.svg.js +0 -31
  911. package/lib/icons/arrow-double-right.svg.js +0 -31
  912. package/lib/icons/back.svg.js +0 -28
  913. package/lib/icons/calendar.svg.js +0 -38
  914. package/lib/icons/caret.svg.js +0 -28
  915. package/lib/icons/check.svg.js +0 -28
  916. package/lib/icons/clock.svg.js +0 -36
  917. package/lib/icons/close-small.svg.js +0 -31
  918. package/lib/icons/close.svg.js +0 -28
  919. package/lib/icons/cloud-upload.svg.js +0 -29
  920. package/lib/icons/column-filter.svg.js +0 -29
  921. package/lib/icons/columns.svg.js +0 -28
  922. package/lib/icons/compress-alt.svg.js +0 -28
  923. package/lib/icons/copy.svg.js +0 -33
  924. package/lib/icons/date.svg.js +0 -33
  925. package/lib/icons/department.svg.js +0 -59
  926. package/lib/icons/desk-empty.svg.js +0 -80
  927. package/lib/icons/dot.svg.js +0 -43
  928. package/lib/icons/down-arrow-bold.svg.js +0 -29
  929. package/lib/icons/down.svg.js +0 -30
  930. package/lib/icons/download.svg.js +0 -31
  931. package/lib/icons/drag-bar.svg.js +0 -60
  932. package/lib/icons/drag.svg.js +0 -29
  933. package/lib/icons/edit.svg.js +0 -28
  934. package/lib/icons/ellipsis-v.svg.js +0 -28
  935. package/lib/icons/enter.svg.js +0 -27
  936. package/lib/icons/exchange.svg.js +0 -28
  937. package/lib/icons/expand-alt.svg.js +0 -28
  938. package/lib/icons/fail.svg.js +0 -38
  939. package/lib/icons/file.svg.js +0 -29
  940. package/lib/icons/filter.svg.js +0 -28
  941. package/lib/icons/folder.svg.js +0 -31
  942. package/lib/icons/fullscreen.svg.js +0 -28
  943. package/lib/icons/function.svg.js +0 -28
  944. package/lib/icons/home.svg.js +0 -28
  945. package/lib/icons/if.svg.js +0 -28
  946. package/lib/icons/image.svg.js +0 -27
  947. package/lib/icons/info-circle.svg.js +0 -28
  948. package/lib/icons/info.svg.js +0 -34
  949. package/lib/icons/input-clear.svg.js +0 -27
  950. package/lib/icons/invisible.svg.js +0 -29
  951. package/lib/icons/left-arrow.svg.js +0 -30
  952. package/lib/icons/loading-outline.svg.js +0 -28
  953. package/lib/icons/location.svg.js +0 -27
  954. package/lib/icons/menu.svg.js +0 -27
  955. package/lib/icons/minus.svg.js +0 -28
  956. package/lib/icons/move.svg.js +0 -29
  957. package/lib/icons/mute.svg.js +0 -28
  958. package/lib/icons/new-edit.svg.js +0 -29
  959. package/lib/icons/pause.svg.js +0 -28
  960. package/lib/icons/pencil.svg.js +0 -28
  961. package/lib/icons/play.svg.js +0 -27
  962. package/lib/icons/plus-cicle.svg.js +0 -27
  963. package/lib/icons/plus-fine.svg.js +0 -28
  964. package/lib/icons/plus.svg.js +0 -28
  965. package/lib/icons/post.svg.js +0 -55
  966. package/lib/icons/question-mark.svg.js +0 -33
  967. package/lib/icons/question.svg.js +0 -28
  968. package/lib/icons/redo.svg.js +0 -28
  969. package/lib/icons/refresh.svg.js +0 -28
  970. package/lib/icons/reload.svg.js +0 -28
  971. package/lib/icons/remove.svg.js +0 -28
  972. package/lib/icons/retry.svg.js +0 -31
  973. package/lib/icons/right-arrow-bold.svg.js +0 -28
  974. package/lib/icons/right-arrow.svg.js +0 -30
  975. package/lib/icons/right-double-arrow.svg.js +0 -29
  976. package/lib/icons/role.svg.js +0 -50
  977. package/lib/icons/rotate-left.svg.js +0 -29
  978. package/lib/icons/rotate-right.svg.js +0 -29
  979. package/lib/icons/rotate-screen.svg.js +0 -28
  980. package/lib/icons/scale-origin.svg.js +0 -31
  981. package/lib/icons/schedule.svg.js +0 -31
  982. package/lib/icons/search.svg.js +0 -28
  983. package/lib/icons/setting.svg.js +0 -28
  984. package/lib/icons/slider-handle-icon.svg.js +0 -29
  985. package/lib/icons/sort-asc.svg.js +0 -28
  986. package/lib/icons/sort-default.svg.js +0 -28
  987. package/lib/icons/sort-desc.svg.js +0 -28
  988. package/lib/icons/star.svg.js +0 -28
  989. package/lib/icons/status-close.svg.js +0 -30
  990. package/lib/icons/steps-finsh.svg.js +0 -29
  991. package/lib/icons/sub-plus.svg.js +0 -27
  992. package/lib/icons/success.svg.js +0 -36
  993. package/lib/icons/transparent.svg.js +0 -45
  994. package/lib/icons/trash.svg.js +0 -29
  995. package/lib/icons/tree-down.svg.js +0 -28
  996. package/lib/icons/undo-normal.svg.js +0 -32
  997. package/lib/icons/undo.svg.js +0 -28
  998. package/lib/icons/unfullscreen.svg.js +0 -28
  999. package/lib/icons/upload.svg.js +0 -28
  1000. package/lib/icons/user-remove.svg.js +0 -40
  1001. package/lib/icons/view.svg.js +0 -29
  1002. package/lib/icons/volume.svg.js +0 -31
  1003. package/lib/icons/warning-mark.svg.js +0 -29
  1004. package/lib/icons/warning.svg.js +0 -28
  1005. package/lib/icons/window-restore.svg.js +0 -28
  1006. package/lib/icons/zoom-in.svg.js +0 -28
  1007. package/lib/icons/zoom-out.svg.js +0 -28
  1008. package/lib/index.d.ts +0 -15
  1009. package/lib/index.js +0 -344
  1010. package/lib/locale/de-DE.d.ts +0 -1
  1011. package/lib/locale/de-DE.js +0 -421
  1012. package/lib/locale/en-US.d.ts +0 -1
  1013. package/lib/locale/en-US.js +0 -427
  1014. package/lib/locale/zh-CN.d.ts +0 -1
  1015. package/lib/locale/zh-CN.js +0 -436
  1016. package/lib/scss/helper.scss.js +0 -12
  1017. package/lib/scss/themes/ang.scss.js +0 -12
  1018. package/lib/scss/themes/antd.scss.js +0 -12
  1019. package/lib/scss/themes/cxd.scss.js +0 -12
  1020. package/lib/scss/themes/dark.scss.js +0 -12
  1021. package/lib/scss/themes/default.scss.js +0 -12
  1022. package/lib/themes/ang.css +0 -46139
  1023. package/lib/themes/ang.d.ts +0 -3
  1024. package/lib/themes/ang.js +0 -20
  1025. package/lib/themes/antd.css +0 -46126
  1026. package/lib/themes/antd.d.ts +0 -1
  1027. package/lib/themes/antd.js +0 -44
  1028. package/lib/themes/cxd.css +0 -46115
  1029. package/lib/themes/cxd.d.ts +0 -3
  1030. package/lib/themes/cxd.js +0 -459
  1031. package/lib/themes/dark.css +0 -46146
  1032. package/lib/themes/dark.d.ts +0 -3
  1033. package/lib/themes/dark.js +0 -28
  1034. package/lib/themes/default.css +0 -46115
  1035. package/lib/themes/default.d.ts +0 -4
  1036. package/lib/utils/index.d.ts +0 -2
  1037. package/lib/utils/smoothSignature.d.ts +0 -86
  1038. package/lib/utils/vectorComputed.d.ts +0 -20
  1039. package/lib/utils/vectorComputed.js +0 -84
  1040. package/lib/withRemoteConfig.d.ts +0 -2
  1041. package/lib/withRemoteConfig.js +0 -14
  1042. package/lib/withStore.d.ts +0 -2
  1043. package/lib/withStore.js +0 -14
@@ -1,1389 +0,0 @@
1
- /**
2
- * amis-ui v6.13.0-beta.6
3
- * Copyright 2018-2025 fex
4
- */
5
-
6
- import { __extends, __spreadArray, __read, __assign, __rest } from 'tslib';
7
- import React__default from 'react';
8
- import { findDOMNode } from 'react-dom';
9
- import moment from 'moment';
10
- import omit from 'lodash/omit';
11
- import kebabCase from 'lodash/kebabCase';
12
- import { filterDate, str2function, noop, isExpression, FormulaExec, getComputedStyle, ucFirst, Overlay, PopOver, themeable, localeable } from 'amis-core';
13
- import { Icon } from './icons.js';
14
- import Calendar from './calendar/Calendar.js';
15
- import PopUp from './PopUp.js';
16
- import CalendarMobile from './CalendarMobile.js';
17
- import Input from './Input.js';
18
- import Button from './Button.js';
19
-
20
- /**
21
- * @file DateRangePicker
22
- * @description 自定义日期范围时间选择器组件
23
- * @author fex
24
- */
25
- var availableShortcuts = {
26
- 'today': {
27
- label: 'Date.today',
28
- startDate: function (now) {
29
- return now.startOf('day');
30
- },
31
- endDate: function (now) {
32
- return now;
33
- }
34
- },
35
- 'yesterday': {
36
- label: 'Date.yesterday',
37
- startDate: function (now) {
38
- return now.add(-1, 'days').startOf('day');
39
- },
40
- endDate: function (now) {
41
- return now.add(-1, 'days').endOf('day');
42
- }
43
- },
44
- 'tomorrow': {
45
- label: 'Date.tomorrow',
46
- startDate: function (now) {
47
- return now.add(1, 'days').startOf('day');
48
- },
49
- endDate: function (now) {
50
- return now.add(1, 'days').endOf('day');
51
- }
52
- },
53
- // 兼容一下错误的用法
54
- '1daysago': {
55
- label: 'DateRange.1daysago',
56
- startDate: function (now) {
57
- return now.add(-1, 'days');
58
- },
59
- endDate: function (now) {
60
- return now;
61
- }
62
- },
63
- '1dayago': {
64
- label: 'DateRange.1daysago',
65
- startDate: function (now) {
66
- return now.add(-1, 'days');
67
- },
68
- endDate: function (now) {
69
- return now;
70
- }
71
- },
72
- '7daysago': {
73
- label: 'DateRange.7daysago',
74
- startDate: function (now) {
75
- return now.add(-7, 'days').startOf('day');
76
- },
77
- endDate: function (now) {
78
- return now.add(-1, 'days').endOf('day');
79
- }
80
- },
81
- '30daysago': {
82
- label: 'DateRange.30daysago',
83
- startDate: function (now) {
84
- return now.add(-30, 'days').startOf('day');
85
- },
86
- endDate: function (now) {
87
- return now.add(-1, 'days').endOf('day');
88
- }
89
- },
90
- '90daysago': {
91
- label: 'DateRange.90daysago',
92
- startDate: function (now) {
93
- return now.add(-90, 'days').startOf('day');
94
- },
95
- endDate: function (now) {
96
- return now.add(-1, 'days').endOf('day');
97
- }
98
- },
99
- 'prevweek': {
100
- label: 'DateRange.lastWeek',
101
- startDate: function (now) {
102
- return now.startOf('week').add(-1, 'weeks');
103
- },
104
- endDate: function (now) {
105
- return now.startOf('week').add(-1, 'days').endOf('day');
106
- }
107
- },
108
- 'thisweek': {
109
- label: 'DateRange.thisWeek',
110
- startDate: function (now) {
111
- return now.startOf('week');
112
- },
113
- endDate: function (now) {
114
- return now.endOf('week');
115
- }
116
- },
117
- 'thismonth': {
118
- label: 'DateRange.thisMonth',
119
- startDate: function (now) {
120
- return now.startOf('month');
121
- },
122
- endDate: function (now) {
123
- return now.endOf('month');
124
- }
125
- },
126
- 'thisquarter': {
127
- label: 'DateRange.thisQuarter',
128
- startDate: function (now) {
129
- return now.startOf('quarter');
130
- },
131
- endDate: function (now) {
132
- return now.endOf('quarter');
133
- }
134
- },
135
- 'prevmonth': {
136
- label: 'DateRange.lastMonth',
137
- startDate: function (now) {
138
- return now.startOf('month').add(-1, 'month');
139
- },
140
- endDate: function (now) {
141
- return now.startOf('month').add(-1, 'day').endOf('day');
142
- }
143
- },
144
- 'prevquarter': {
145
- label: 'DateRange.lastQuarter',
146
- startDate: function (now) {
147
- return now.startOf('quarter').add(-1, 'quarter');
148
- },
149
- endDate: function (now) {
150
- return now.startOf('quarter').add(-1, 'day').endOf('day');
151
- }
152
- },
153
- 'thisyear': {
154
- label: 'DateRange.thisYear',
155
- startDate: function (now) {
156
- return now.startOf('year');
157
- },
158
- endDate: function (now) {
159
- return now.endOf('year');
160
- }
161
- },
162
- // 兼容一下之前的用法 'lastYear'
163
- 'prevyear': {
164
- label: 'DateRange.lastYear',
165
- startDate: function (now) {
166
- return now.startOf('year').add(-1, 'year');
167
- },
168
- endDate: function (now) {
169
- return now.endOf('year').add(-1, 'year').endOf('day');
170
- }
171
- },
172
- 'lastYear': {
173
- label: 'DateRange.lastYear',
174
- startDate: function (now) {
175
- return now.startOf('year').add(-1, 'year');
176
- },
177
- endDate: function (now) {
178
- return now.endOf('year').add(-1, 'year').endOf('day');
179
- }
180
- }
181
- };
182
- var advancedRanges = [
183
- {
184
- regexp: /^(\d+)hoursago$/,
185
- resolve: function (__, _, hours) {
186
- return {
187
- label: __('DateRange.hoursago', { hours: hours }),
188
- startDate: function (now) {
189
- return now.add(-hours, 'hours').startOf('hour');
190
- },
191
- endDate: function (now) {
192
- return now.add(-1, 'hours').endOf('hours');
193
- }
194
- };
195
- }
196
- },
197
- {
198
- regexp: /^(\d+)hourslater$/,
199
- resolve: function (__, _, hours) {
200
- return {
201
- label: __('DateRange.hourslater', { hours: hours }),
202
- startDate: function (now) {
203
- return now.startOf('hour');
204
- },
205
- endDate: function (now) {
206
- return now.add(hours, 'hours').endOf('hour');
207
- }
208
- };
209
- }
210
- },
211
- {
212
- regexp: /^(\d+)daysago$/,
213
- resolve: function (__, _, days) {
214
- return {
215
- label: __('DateRange.daysago', { days: days }),
216
- startDate: function (now) {
217
- return now.add(-days, 'days').startOf('day');
218
- },
219
- endDate: function (now) {
220
- return now.add(-1, 'days').endOf('day');
221
- }
222
- };
223
- }
224
- },
225
- {
226
- regexp: /^(\d+)dayslater$/,
227
- resolve: function (__, _, days) {
228
- return {
229
- label: __('DateRange.dayslater', { days: days }),
230
- startDate: function (now) {
231
- return now.startOf('day');
232
- },
233
- endDate: function (now) {
234
- return now.add(days, 'days').endOf('day');
235
- }
236
- };
237
- }
238
- },
239
- {
240
- regexp: /^(\d+)weeksago$/,
241
- resolve: function (__, _, weeks) {
242
- return {
243
- label: __('DateRange.weeksago', { weeks: weeks }),
244
- startDate: function (now) {
245
- return now.startOf('week').add(-weeks, 'weeks');
246
- },
247
- endDate: function (now) {
248
- return now.startOf('week').add(-1, 'days').endOf('day');
249
- }
250
- };
251
- }
252
- },
253
- {
254
- regexp: /^(\d+)weekslater$/,
255
- resolve: function (__, _, weeks) {
256
- return {
257
- label: __('DateRange.weekslater', { weeks: weeks }),
258
- startDate: function (now) {
259
- return now.startOf('week');
260
- },
261
- endDate: function (now) {
262
- return now.startOf('week').add(weeks, 'weeks').endOf('day');
263
- }
264
- };
265
- }
266
- },
267
- {
268
- regexp: /^(\d+)monthsago$/,
269
- resolve: function (__, _, months) {
270
- return {
271
- label: __('DateRange.monthsago', { months: months }),
272
- startDate: function (now) {
273
- return now.startOf('months').add(-months, 'months');
274
- },
275
- endDate: function (now) {
276
- return now.startOf('month').add(-1, 'days').endOf('day');
277
- }
278
- };
279
- }
280
- },
281
- {
282
- regexp: /^(\d+)monthslater$/,
283
- resolve: function (__, _, months) {
284
- return {
285
- label: __('DateRange.monthslater', { months: months }),
286
- startDate: function (now) {
287
- return now.startOf('month');
288
- },
289
- endDate: function (now) {
290
- return now.startOf('month').add(months, 'months').endOf('day');
291
- }
292
- };
293
- }
294
- },
295
- {
296
- regexp: /^(\d+)quartersago$/,
297
- resolve: function (__, _, quarters) {
298
- return {
299
- label: __('DateRange.quartersago', { quarters: quarters }),
300
- startDate: function (now) {
301
- return now.startOf('quarters').add(-quarters, 'quarters');
302
- },
303
- endDate: function (now) {
304
- return now.startOf('quarter').add(-1, 'days').endOf('day');
305
- }
306
- };
307
- }
308
- },
309
- {
310
- regexp: /^(\d+)quarterslater$/,
311
- resolve: function (__, _, quarters) {
312
- return {
313
- label: __('DateRange.quarterslater', { quarters: quarters }),
314
- startDate: function (now) {
315
- return now.startOf('quarter');
316
- },
317
- endDate: function (now) {
318
- return now.startOf('quarter').add(quarters, 'quarters').endOf('day');
319
- }
320
- };
321
- }
322
- },
323
- {
324
- regexp: /^(\d+)yearsago$/,
325
- resolve: function (__, _, years) {
326
- return {
327
- label: __('DateRange.yearsago', { years: years }),
328
- startDate: function (now) {
329
- return now.startOf('years').add(-years, 'years');
330
- },
331
- endDate: function (now) {
332
- return now.startOf('year').add(-1, 'days').endOf('day');
333
- }
334
- };
335
- }
336
- },
337
- {
338
- regexp: /^(\d+)yearslater$/,
339
- resolve: function (__, _, years) {
340
- return {
341
- label: __('DateRange.yearslater', { years: years }),
342
- startDate: function (now) {
343
- return now.startOf('year');
344
- },
345
- endDate: function (now) {
346
- return now.startOf('year').add(years, 'years').endOf('day');
347
- }
348
- };
349
- }
350
- }
351
- ];
352
- var dateFormats = {
353
- Y: { format: 'YYYY' },
354
- Q: { format: 'YYYY [Q]Q' },
355
- M: { format: 'YYYY-MM' },
356
- D: { format: 'YYYY-MM-DD' }
357
- };
358
- var timeFormats = {
359
- h: { format: 'HH' },
360
- H: { format: 'HH' },
361
- m: { format: 'mm' },
362
- s: { format: 'ss' },
363
- S: { format: 'ss' }
364
- };
365
- var DateRangePicker = /** @class */ (function (_super) {
366
- __extends(DateRangePicker, _super);
367
- function DateRangePicker(props) {
368
- var _this = _super.call(this, props) || this;
369
- // 是否是第一次点击,如果是第一次点击就可以点任意地址
370
- _this.isFirstClick = true;
371
- _this.nextMonth = moment().add(1, 'months').startOf('day');
372
- _this.currentMonth = moment().startOf('day');
373
- _this.startInputRef = React__default.createRef();
374
- _this.endInputRef = React__default.createRef();
375
- _this.separatorRef = React__default.createRef();
376
- _this.calendarRef = React__default.createRef();
377
- _this.open = _this.open.bind(_this);
378
- _this.openStart = _this.openStart.bind(_this);
379
- _this.openEnd = _this.openEnd.bind(_this);
380
- _this.close = _this.close.bind(_this);
381
- _this.startInputChange = _this.startInputChange.bind(_this);
382
- _this.endInputChange = _this.endInputChange.bind(_this);
383
- _this.handleDateChange = _this.handleDateChange.bind(_this);
384
- _this.handleStartDateChange = _this.handleStartDateChange.bind(_this);
385
- _this.handelEndDateChange = _this.handelEndDateChange.bind(_this);
386
- _this.handleTimeStartChange = _this.handleTimeStartChange.bind(_this);
387
- _this.handleTimeEndChange = _this.handleTimeEndChange.bind(_this);
388
- _this.handleFocus = _this.handleFocus.bind(_this);
389
- _this.handleBlur = _this.handleBlur.bind(_this);
390
- _this.checkStartIsValidDate = _this.checkStartIsValidDate.bind(_this);
391
- _this.checkEndIsValidDate = _this.checkEndIsValidDate.bind(_this);
392
- _this.confirm = _this.confirm.bind(_this);
393
- _this.clearValue = _this.clearValue.bind(_this);
394
- _this.dom = React__default.createRef();
395
- _this.handleClick = _this.handleClick.bind(_this);
396
- _this.handleKeyPress = _this.handleKeyPress.bind(_this);
397
- _this.handlePopOverClick = _this.handlePopOverClick.bind(_this);
398
- _this.renderDay = _this.renderDay.bind(_this);
399
- _this.renderMonth = _this.renderMonth.bind(_this);
400
- _this.renderQuarter = _this.renderQuarter.bind(_this);
401
- _this.renderYear = _this.renderYear.bind(_this);
402
- _this.handleMobileChange = _this.handleMobileChange.bind(_this);
403
- _this.handleOutClick = _this.handleOutClick.bind(_this);
404
- var _a = _this.props, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, value = _a.value, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, dateFormat = _a.dateFormat, timeFormat = _a.timeFormat, data = _a.data, utc = _a.utc;
405
- var _b = DateRangePicker.unFormatValue(value, valueFormat || format, joinValues, delimiter, data, utc), startDate = _b.startDate, endDate = _b.endDate;
406
- var curDateFormat = dateFormat !== null && dateFormat !== void 0 ? dateFormat : '';
407
- var curTimeFormat = timeFormat !== null && timeFormat !== void 0 ? timeFormat : '';
408
- var curTimeFormatArr = [];
409
- !dateFormat &&
410
- Object.keys(dateFormats).forEach(function (item) {
411
- var _a;
412
- if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
413
- curDateFormat = dateFormats[item].format;
414
- }
415
- });
416
- !timeFormat &&
417
- Object.keys(timeFormats).forEach(function (item) {
418
- var _a;
419
- if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
420
- curTimeFormatArr.push(timeFormats[item].format);
421
- }
422
- });
423
- curTimeFormat = curTimeFormatArr.length
424
- ? curTimeFormatArr.join(':')
425
- : curTimeFormat;
426
- _this.state = {
427
- isOpened: false,
428
- isFocused: false,
429
- editState: 'start',
430
- startDate: startDate,
431
- endDate: endDate,
432
- oldStartDate: startDate,
433
- oldEndDate: endDate,
434
- startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(displayFormat || inputFormat),
435
- endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(displayFormat || inputFormat),
436
- endDateOpenedFirst: false,
437
- curDateFormat: curDateFormat,
438
- curTimeFormat: curTimeFormat
439
- };
440
- return _this;
441
- }
442
- DateRangePicker.formatValue = function (newValue, valueFormat, joinValues, delimiter, utc) {
443
- var _a, _b;
444
- if (utc === void 0) { utc = false; }
445
- newValue = [
446
- (_a = (utc ? moment.utc(newValue.startDate) : newValue.startDate)) === null || _a === void 0 ? void 0 : _a.format(valueFormat),
447
- (_b = (utc ? moment.utc(newValue.endDate) : newValue.endDate)) === null || _b === void 0 ? void 0 : _b.format(valueFormat)
448
- ];
449
- if (joinValues) {
450
- newValue = newValue.join(delimiter);
451
- }
452
- return newValue;
453
- };
454
- /* 将日期时间转化为momemnt格式,如果输入的内容不合法则返回undefined */
455
- DateRangePicker.unFormatValue = function (value, format, joinValues, delimiter, data, utc) {
456
- if (!value) {
457
- return {
458
- startDate: undefined,
459
- endDate: undefined
460
- };
461
- }
462
- if (joinValues && typeof value === 'string') {
463
- value = value.split(delimiter);
464
- }
465
- var startDate = filterDate(value === null || value === void 0 ? void 0 : value[0], data, format, utc);
466
- var endDate = filterDate(value === null || value === void 0 ? void 0 : value[1], data, format, utc);
467
- /**
468
- * 不合法的value输入都丢弃
469
- * 注意undefined被moment认为是合法的输入,moment会转化为now,所以需要结合在一起判断
470
- * @reference https://github.com/moment/moment/issues/1639
471
- */
472
- return {
473
- startDate: value[0] && startDate.isValid() ? startDate : undefined,
474
- endDate: value[1] && endDate.isValid() ? endDate : undefined
475
- };
476
- };
477
- DateRangePicker.prototype.componentDidMount = function () {
478
- var _a, _b;
479
- document.body.addEventListener('click', this.handleOutClick, true);
480
- (_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.onRef) === null || _b === void 0 ? void 0 : _b.call(_a, this);
481
- };
482
- DateRangePicker.prototype.componentWillUnmount = function () {
483
- document.body.removeEventListener('click', this.handleOutClick, true);
484
- };
485
- DateRangePicker.prototype.handleOutClick = function (e) {
486
- if (!e.target ||
487
- !this.dom.current ||
488
- this.dom.current.contains(e.target) ||
489
- !this.calendarRef.current ||
490
- this.calendarRef.current.contains(e.target)) {
491
- return;
492
- }
493
- if (this.state.isOpened) {
494
- e.preventDefault();
495
- this.close();
496
- }
497
- };
498
- DateRangePicker.prototype.componentDidUpdate = function (prevProps) {
499
- var props = this.props;
500
- var value = props.value, format = props.format, valueFormat = props.valueFormat, joinValues = props.joinValues, inputFormat = props.inputFormat, displayFormat = props.displayFormat, dateFormat = props.dateFormat, timeFormat = props.timeFormat, delimiter = props.delimiter, data = props.data, utc = props.utc;
501
- if (prevProps.displayFormat != displayFormat ||
502
- prevProps.inputFormat != inputFormat) {
503
- var curDateFormat_1 = dateFormat !== null && dateFormat !== void 0 ? dateFormat : '';
504
- var curTimeFormat = timeFormat !== null && timeFormat !== void 0 ? timeFormat : '';
505
- var curTimeFormatArr_1 = [];
506
- !dateFormat &&
507
- Object.keys(dateFormats).forEach(function (item) {
508
- var _a;
509
- if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
510
- curDateFormat_1 = dateFormats[item].format;
511
- }
512
- });
513
- !timeFormat &&
514
- Object.keys(timeFormats).forEach(function (item) {
515
- var _a;
516
- if ((_a = (displayFormat || inputFormat)) === null || _a === void 0 ? void 0 : _a.includes(item)) {
517
- curTimeFormatArr_1.push(timeFormats[item].format);
518
- }
519
- });
520
- this.setState({
521
- curDateFormat: curDateFormat_1,
522
- curTimeFormat: curTimeFormatArr_1.length
523
- ? curTimeFormatArr_1.join(':')
524
- : curTimeFormat
525
- });
526
- }
527
- if (prevProps.value !== value) {
528
- var _a = DateRangePicker.unFormatValue(value, valueFormat || format, joinValues, delimiter, data, utc), startDate = _a.startDate, endDate = _a.endDate;
529
- this.setState({
530
- startDate: startDate,
531
- endDate: endDate,
532
- startInputValue: startDate && (startDate === null || startDate === void 0 ? void 0 : startDate.isValid())
533
- ? startDate === null || startDate === void 0 ? void 0 : startDate.format(displayFormat || inputFormat)
534
- : '',
535
- endInputValue: endDate && (endDate === null || endDate === void 0 ? void 0 : endDate.isValid())
536
- ? endDate === null || endDate === void 0 ? void 0 : endDate.format(displayFormat || inputFormat)
537
- : ''
538
- });
539
- }
540
- };
541
- DateRangePicker.prototype.focus = function () {
542
- if (!this.dom.current || this.props.disabled) {
543
- return;
544
- }
545
- this.dom.current.focus();
546
- };
547
- DateRangePicker.prototype.blur = function () {
548
- if (!this.dom.current || this.props.disabled) {
549
- return;
550
- }
551
- this.dom.current.blur();
552
- };
553
- DateRangePicker.prototype.handleFocus = function (e) {
554
- this.setState({
555
- isFocused: true
556
- });
557
- var onFocus = this.props.onFocus;
558
- onFocus && onFocus(e);
559
- };
560
- DateRangePicker.prototype.handleBlur = function (e) {
561
- this.setState({
562
- isFocused: false
563
- });
564
- var onBlur = this.props.onBlur;
565
- onBlur && onBlur(e);
566
- };
567
- DateRangePicker.prototype.open = function () {
568
- if (this.props.disabled) {
569
- return;
570
- }
571
- this.setState({
572
- isOpened: true
573
- });
574
- };
575
- DateRangePicker.prototype.openStart = function () {
576
- if (this.props.disabled) {
577
- return;
578
- }
579
- this.setState({
580
- isOpened: true,
581
- editState: 'start'
582
- });
583
- };
584
- DateRangePicker.prototype.openEnd = function () {
585
- if (this.props.disabled) {
586
- return;
587
- }
588
- this.setState({
589
- isOpened: true,
590
- editState: 'end',
591
- endDateOpenedFirst: true
592
- });
593
- };
594
- DateRangePicker.prototype.close = function (isConfirm) {
595
- if (isConfirm === void 0) { isConfirm = false; }
596
- if (!isConfirm) {
597
- /** 未点击确认关闭时,将日期恢复至未做任何选择的状态 */
598
- var _a = this.props, value = _a.value, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, data = _a.data, utc = _a.utc;
599
- var _b = DateRangePicker.unFormatValue(value, valueFormat || format, joinValues, delimiter, data, utc), startDate = _b.startDate, endDate = _b.endDate;
600
- this.setState({
601
- startDate: startDate,
602
- endDate: endDate,
603
- oldStartDate: startDate,
604
- oldEndDate: endDate,
605
- startInputValue: startDate && moment(startDate).isValid()
606
- ? startDate.format(displayFormat || inputFormat)
607
- : '',
608
- endInputValue: endDate && moment(endDate).isValid()
609
- ? endDate.format(displayFormat || inputFormat)
610
- : ''
611
- });
612
- }
613
- else {
614
- this.setState({
615
- oldStartDate: this.state.startDate,
616
- oldEndDate: this.state.endDate
617
- });
618
- }
619
- this.setState({
620
- isOpened: false,
621
- editState: undefined,
622
- endDateOpenedFirst: false
623
- }, this.blur);
624
- };
625
- DateRangePicker.prototype.handleClick = function () {
626
- this.state.isOpened ? this.close() : this.open();
627
- };
628
- DateRangePicker.prototype.handlePopOverClick = function (e) {
629
- e.stopPropagation();
630
- e.preventDefault();
631
- };
632
- DateRangePicker.prototype.handleKeyPress = function (e) {
633
- if (e.key === ' ') {
634
- this.handleClick();
635
- e.preventDefault();
636
- }
637
- };
638
- DateRangePicker.prototype.confirm = function () {
639
- var _a = this.props, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, utc = _a.utc;
640
- var _b = this.state, startDate = _b.startDate, endDate = _b.endDate;
641
- if (!startDate && !endDate) {
642
- return;
643
- }
644
- else if (endDate && (startDate === null || startDate === void 0 ? void 0 : startDate.isAfter(this.state.endDate))) {
645
- return;
646
- }
647
- this.props.onChange(DateRangePicker.formatValue({ startDate: startDate, endDate: endDate }, valueFormat || format, joinValues, delimiter, utc));
648
- if (startDate && !endDate) {
649
- this.setState({ editState: 'end', endDateOpenedFirst: false });
650
- }
651
- else {
652
- this.close(true);
653
- }
654
- };
655
- DateRangePicker.prototype.filterDate = function (date, options) {
656
- if (options === void 0) { options = { type: 'start' }; }
657
- var _a = options || {
658
- type: 'start'
659
- }, type = _a.type, originValue = _a.originValue, timeFormat = _a.timeFormat, subControlViewMode = _a.subControlViewMode, autoInitDefaultValue = _a.autoInitDefaultValue;
660
- var value = date.clone();
661
- var _b = this.props, transform = _b.transform, data = _b.data;
662
- var _c = this.state, startDate = _c.startDate, endDate = _c.endDate;
663
- /** 此时为点选后的值初始化设置,不应该被内部转化逻辑和transformFn限制 */
664
- if (autoInitDefaultValue === true) {
665
- var now_1 = moment();
666
- /** 如果已经设置了结束时间且当前时间已经超出了结束时间,则开始时间不能超过结束时间 */
667
- if (!startDate && endDate && type === 'start' && now_1.isAfter(endDate)) {
668
- value = endDate.clone();
669
- return value;
670
- }
671
- var timePart_1 = {
672
- date: value.get('date'),
673
- hour: value.get('hour'),
674
- minute: value.get('minute'),
675
- second: value.get('second'),
676
- millisecond: value.get('millisecond')
677
- };
678
- Object.keys(timePart_1).forEach(function (unit) {
679
- /** 首次选择时间,日期使用当前时间; 将未设置过的时间字段设置为当前值 */
680
- if ((unit === 'date' && subControlViewMode === 'time') ||
681
- (unit !== 'date' && timePart_1[unit] === 0)) {
682
- timePart_1[unit] = now_1.get(unit);
683
- }
684
- });
685
- value.set(timePart_1);
686
- return value;
687
- }
688
- /** 日期时间选择器组件支持用户选择时间,如果用户手动选择了时间,则不需要走默认处理 */
689
- if (subControlViewMode && subControlViewMode === 'time') {
690
- return value;
691
- }
692
- var transformFn = transform && typeof transform === 'string'
693
- ? str2function(transform, 'value', 'config', 'props', 'data', 'moment')
694
- : transform;
695
- // 没有初始值
696
- if (!originValue) {
697
- value = value[type === 'start' ? 'startOf' : 'endOf']('day');
698
- }
699
- else if (typeof timeFormat === 'string' && /ss/.test(timeFormat)) {
700
- value = value[type === 'start' ? 'startOf' : 'endOf']('second');
701
- }
702
- else if (typeof timeFormat === 'string' && /mm/.test(timeFormat)) {
703
- value = value[type === 'start' ? 'startOf' : 'endOf']('minute');
704
- }
705
- else if (typeof timeFormat === 'string' && /HH/i.test(timeFormat)) {
706
- value = value[type === 'start' ? 'startOf' : 'endOf']('hour');
707
- }
708
- else if (typeof timeFormat === 'string' && /Q/i.test(timeFormat)) {
709
- value = value[type === 'start' ? 'startOf' : 'endOf']('quarter');
710
- }
711
- else {
712
- value = value[type === 'start' ? 'startOf' : 'endOf']('day');
713
- }
714
- if (typeof transformFn === 'function') {
715
- value = transformFn(value, { type: type, originValue: originValue, timeFormat: timeFormat }, this.props, data, moment);
716
- }
717
- return value;
718
- };
719
- DateRangePicker.prototype.handleDateChange = function (newValue, viewMode, status) {
720
- var embed = this.props.embed;
721
- var editState = embed
722
- ? this.state.editState || status
723
- : this.state.editState;
724
- if (editState === 'start') {
725
- this.handleStartDateChange(newValue);
726
- }
727
- else if (editState === 'end') {
728
- this.handelEndDateChange(newValue);
729
- }
730
- };
731
- /**
732
- * @param {Moment} newValue 当前选择的日期时间值
733
- * @param {ViewMode=} subControlViewMode 子选择控件的类型,可选参数('time'),用于区分datetime选择器的触发控件
734
- */
735
- DateRangePicker.prototype.handleStartDateChange = function (newValue, subControlViewMode) {
736
- var _a = this.props, minDate = _a.minDate, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, type = _a.type; _a.value;
737
- var _b = this.state, startDate = _b.startDate; _b.oldStartDate; var endDateOpenedFirst = _b.endDateOpenedFirst, timeFormat = _b.curTimeFormat;
738
- if (minDate && newValue.isBefore(minDate)) {
739
- newValue = minDate;
740
- }
741
- var date = this.filterDate(newValue, {
742
- type: 'start',
743
- originValue: startDate || minDate,
744
- timeFormat: timeFormat,
745
- subControlViewMode: subControlViewMode,
746
- autoInitDefaultValue: !!timeFormat && newValue && !startDate
747
- });
748
- var newState = {
749
- startDate: date,
750
- startInputValue: date.format(displayFormat || inputFormat)
751
- };
752
- // 这些没有时间的选择点第一次后第二次就是选结束时间
753
- if (!endDateOpenedFirst &&
754
- (type === 'input-date-range' ||
755
- type === 'input-year-range' ||
756
- type === 'input-quarter-range' ||
757
- type === 'input-month-range')) {
758
- newState.editState = 'end';
759
- }
760
- this.setState(newState);
761
- };
762
- /**
763
- * @param {Moment} newValue 当前选择的日期时间值
764
- * @param {string=} subControlViewMode 子选择控件的类型的类型,可选参数('time'),用于区分datetime选择器的触发控件
765
- */
766
- DateRangePicker.prototype.handelEndDateChange = function (newValue, subControlViewMode) {
767
- var _this = this;
768
- var _a = this.props, embed = _a.embed, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, type = _a.type; _a.value;
769
- var _b = this.state; _b.startDate; var endDate = _b.endDate; _b.oldEndDate; var endDateOpenedFirst = _b.endDateOpenedFirst, timeFormat = _b.curTimeFormat;
770
- newValue = this.getEndDateByDuration(newValue);
771
- var editState = endDateOpenedFirst ? 'start' : 'end';
772
- var date = this.filterDate(newValue, {
773
- type: 'end',
774
- originValue: endDate,
775
- timeFormat: timeFormat,
776
- subControlViewMode: subControlViewMode,
777
- autoInitDefaultValue: !!timeFormat && newValue && !endDate
778
- });
779
- this.setState({
780
- endDate: date,
781
- endInputValue: date.format(displayFormat || inputFormat)
782
- }, function () {
783
- embed && _this.confirm();
784
- });
785
- if (type !== 'input-datetime-range') {
786
- this.setState({ editState: editState });
787
- }
788
- };
789
- // 手动控制输入时间
790
- DateRangePicker.prototype.startInputChange = function (e) {
791
- var _a = this.props, onChange = _a.onChange, displayFormat = _a.displayFormat, inputFormat = _a.inputFormat; _a.utc;
792
- var value = e.currentTarget.value;
793
- this.setState({ startInputValue: value });
794
- if (value === '') {
795
- onChange('');
796
- }
797
- else {
798
- var newDate = this.getStartDateByDuration(moment(value, displayFormat || inputFormat));
799
- this.setState({ startDate: newDate });
800
- }
801
- };
802
- DateRangePicker.prototype.endInputChange = function (e) {
803
- var _a = this.props, onChange = _a.onChange, displayFormat = _a.displayFormat, inputFormat = _a.inputFormat; _a.utc;
804
- var value = e.currentTarget.value;
805
- this.setState({ endInputValue: value });
806
- if (value === '') {
807
- onChange('');
808
- }
809
- else {
810
- var newDate = this.getEndDateByDuration(moment(value, displayFormat || inputFormat));
811
- this.setState({ endDate: newDate });
812
- }
813
- };
814
- // 根据 duration 修复结束时间
815
- DateRangePicker.prototype.getEndDateByDuration = function (newValue) {
816
- var _a = this.props, minDuration = _a.minDuration, maxDuration = _a.maxDuration, type = _a.type, maxDate = _a.maxDate;
817
- var _b = this.state, startDate = _b.startDate; _b.endDate; _b.editState;
818
- if (!startDate) {
819
- return newValue;
820
- }
821
- // 时间范围必须统一成同一天,不然会不一致
822
- if (type === 'input-time-range' && startDate) {
823
- newValue.set({
824
- year: startDate.year(),
825
- month: startDate.month(),
826
- date: startDate.date()
827
- });
828
- }
829
- if (minDuration && newValue.isBefore(startDate.clone().add(minDuration))) {
830
- newValue = startDate.clone().add(minDuration);
831
- }
832
- if (maxDuration && newValue.isAfter(startDate.clone().add(maxDuration))) {
833
- newValue = startDate.clone().add(maxDuration);
834
- }
835
- if (maxDate && newValue && newValue.isAfter(maxDate, 'second')) {
836
- newValue = maxDate;
837
- }
838
- return newValue;
839
- };
840
- // 根据 duration 修复起始时间
841
- DateRangePicker.prototype.getStartDateByDuration = function (newValue) {
842
- var _a = this.props, minDuration = _a.minDuration, maxDuration = _a.maxDuration, type = _a.type;
843
- var _b = this.state, endDate = _b.endDate; _b.editState;
844
- if (!endDate) {
845
- return newValue;
846
- }
847
- // 时间范围必须统一成同一天,不然会不一致
848
- if (type === 'input-time-range' && endDate) {
849
- newValue.set({
850
- year: endDate.year(),
851
- month: endDate.month(),
852
- date: endDate.date()
853
- });
854
- }
855
- if (minDuration &&
856
- newValue.isBefore(endDate.clone().subtract(minDuration))) {
857
- newValue = endDate.clone().subtract(minDuration);
858
- }
859
- if (maxDuration &&
860
- newValue.isAfter(endDate.clone().subtract(maxDuration))) {
861
- newValue = endDate.clone().subtract(maxDuration);
862
- }
863
- return newValue;
864
- };
865
- // 主要用于处理时间的情况
866
- DateRangePicker.prototype.handleTimeStartChange = function (newValue) {
867
- var _this = this;
868
- var _a = this.props, embed = _a.embed, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat; _a.minDuration; _a.maxDuration; var minDate = _a.minDate;
869
- var _b = this.state; _b.startDate; var endDate = _b.endDate;
870
- // 时间范围必须统一成同一天,不然会不一致
871
- if (endDate) {
872
- newValue.set({
873
- year: endDate.year(),
874
- month: endDate.month(),
875
- date: endDate.date()
876
- });
877
- }
878
- if (minDate && newValue && newValue.isBefore(minDate, 'second')) {
879
- newValue = minDate;
880
- }
881
- this.setState({
882
- startDate: newValue,
883
- startInputValue: newValue.format(displayFormat || inputFormat)
884
- }, function () {
885
- embed && _this.confirm();
886
- });
887
- };
888
- DateRangePicker.prototype.handleTimeEndChange = function (newValue) {
889
- var _this = this;
890
- var _a = this.props, embed = _a.embed, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, minDuration = _a.minDuration, maxDuration = _a.maxDuration, maxDate = _a.maxDate;
891
- var _b = this.state, startDate = _b.startDate; _b.endDate;
892
- if (startDate) {
893
- newValue.set({
894
- year: startDate.year(),
895
- month: startDate.month(),
896
- date: startDate.date()
897
- });
898
- }
899
- if (maxDate && newValue && newValue.isAfter(maxDate, 'second')) {
900
- newValue = maxDate;
901
- }
902
- if (startDate &&
903
- minDuration &&
904
- newValue.isBefore(startDate.clone().add(minDuration))) {
905
- newValue = startDate.clone().add(minDuration);
906
- }
907
- if (startDate &&
908
- maxDuration &&
909
- newValue.isAfter(startDate.clone().add(maxDuration))) {
910
- newValue = startDate.clone().add(maxDuration);
911
- }
912
- this.setState({
913
- endDate: newValue,
914
- endInputValue: newValue.format(displayFormat || inputFormat)
915
- }, function () {
916
- embed && _this.confirm();
917
- });
918
- };
919
- DateRangePicker.prototype.handleMobileChange = function (data, callback) {
920
- this.setState({
921
- startDate: data.startDate,
922
- endDate: data.endDate
923
- }, callback);
924
- };
925
- DateRangePicker.prototype.selectShortcut = function (shortcut) {
926
- var _a = this.props, closeOnSelect = _a.closeOnSelect, minDateRaw = _a.minDateRaw, maxDateRaw = _a.maxDateRaw, format = _a.format, valueFormat = _a.valueFormat, data = _a.data, mobileUI = _a.mobileUI;
927
- var now = moment();
928
- /** minDate和maxDate要实时计算,因为用户可能设置为${NOW()},暂时不考虑毫秒级的时间差 */
929
- var minDate = minDateRaw
930
- ? filterDate(minDateRaw, data, valueFormat || format)
931
- : undefined;
932
- var maxDate = maxDateRaw
933
- ? filterDate(maxDateRaw, data, valueFormat || format)
934
- : undefined;
935
- var startDate = shortcut.startDate(now.clone());
936
- var endDate = shortcut.endDate(now.clone());
937
- this.setState({
938
- startDate: minDate && (minDate === null || minDate === void 0 ? void 0 : minDate.isValid())
939
- ? moment.max(startDate, minDate)
940
- : startDate,
941
- endDate: maxDate && (maxDate === null || maxDate === void 0 ? void 0 : maxDate.isValid()) ? moment.min(maxDate, endDate) : endDate
942
- }, closeOnSelect && !mobileUI ? this.confirm : noop);
943
- };
944
- DateRangePicker.prototype.renderShortcuts = function (shortcuts) {
945
- var _this = this;
946
- if (!shortcuts) {
947
- return null;
948
- }
949
- var _a = this.props, ns = _a.classPrefix, format = _a.format, valueFormat = _a.valueFormat, data = _a.data, __ = _a.translate, testIdBuilder = _a.testIdBuilder;
950
- var shortcutArr;
951
- if (typeof shortcuts === 'string') {
952
- shortcutArr = shortcuts.split(',');
953
- }
954
- else {
955
- shortcutArr = shortcuts;
956
- }
957
- var TIDBuilder = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('shortcut');
958
- return (React__default.createElement("ul", { className: "".concat(ns, "DateRangePicker-rangers") }, shortcutArr.map(function (item, index) {
959
- if (!item) {
960
- return null;
961
- }
962
- var shortcut = {};
963
- if (typeof item === 'string') {
964
- if (availableShortcuts[item]) {
965
- shortcut = availableShortcuts[item];
966
- shortcut.key = item;
967
- }
968
- else {
969
- // 通过正则尝试匹配
970
- for (var i = 0, len = advancedRanges.length; i < len; i++) {
971
- var value = advancedRanges[i];
972
- var m = value.regexp.exec(item);
973
- if (m) {
974
- shortcut = value.resolve.apply(item, __spreadArray([__], __read(m), false));
975
- shortcut.key = item;
976
- }
977
- }
978
- }
979
- }
980
- else if (item.startDate &&
981
- item.endDate) {
982
- var shortcutRaw_1 = __assign({}, item);
983
- shortcut = __assign(__assign({}, item), { startDate: function () {
984
- var startDate = isExpression(shortcutRaw_1.startDate)
985
- ? moment(FormulaExec['formula'](shortcutRaw_1.startDate, data), valueFormat || format)
986
- : typeof shortcutRaw_1.startDate === 'string'
987
- ? moment(shortcutRaw_1.startDate, valueFormat || format)
988
- : shortcutRaw_1.startDate;
989
- return startDate &&
990
- moment.isMoment(startDate) &&
991
- startDate.isValid()
992
- ? startDate
993
- : item.startDate;
994
- }, endDate: function () {
995
- var endDate = isExpression(shortcutRaw_1.endDate)
996
- ? moment(FormulaExec['formula'](shortcutRaw_1.endDate, data), valueFormat || format)
997
- : typeof shortcutRaw_1.endDate === 'string'
998
- ? moment(shortcutRaw_1.endDate, valueFormat || format)
999
- : shortcutRaw_1.endDate;
1000
- return endDate && moment.isMoment(endDate) && endDate.isValid()
1001
- ? endDate
1002
- : item.endDate;
1003
- } });
1004
- }
1005
- if (Object.keys(shortcut).length) {
1006
- return (React__default.createElement("li", { className: "".concat(ns, "DateRangePicker-ranger"), onClick: function () { return _this.selectShortcut(shortcut); }, key: index },
1007
- React__default.createElement("a", __assign({}, TIDBuilder === null || TIDBuilder === void 0 ? void 0 : TIDBuilder.getChild(shortcut.key).getTestId()), __(shortcut.label))));
1008
- }
1009
- else {
1010
- return null;
1011
- }
1012
- })));
1013
- };
1014
- DateRangePicker.prototype.clearValue = function (e) {
1015
- e.preventDefault();
1016
- e.stopPropagation();
1017
- var onChange = this.props.onChange;
1018
- this.setState({ startInputValue: '', endInputValue: '' });
1019
- onChange('');
1020
- };
1021
- // 清空
1022
- DateRangePicker.prototype.clear = function () {
1023
- var onChange = this.props.onChange;
1024
- this.setState({ startInputValue: '', endInputValue: '' });
1025
- onChange('');
1026
- };
1027
- // 重置
1028
- DateRangePicker.prototype.reset = function (resetValue) {
1029
- var _a = this.props, onChange = _a.onChange, format = _a.format, valueFormat = _a.valueFormat, joinValues = _a.joinValues, delimiter = _a.delimiter, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, data = _a.data, utc = _a.utc;
1030
- var tmpResetValue = resetValue !== null && resetValue !== void 0 ? resetValue : this.props.resetValue;
1031
- var _b = DateRangePicker.unFormatValue(tmpResetValue, valueFormat || format, joinValues, delimiter, data, utc), startDate = _b.startDate, endDate = _b.endDate;
1032
- onChange === null || onChange === void 0 ? void 0 : onChange(tmpResetValue);
1033
- this.setState({
1034
- startInputValue: startDate === null || startDate === void 0 ? void 0 : startDate.format(displayFormat || inputFormat),
1035
- endInputValue: endDate === null || endDate === void 0 ? void 0 : endDate.format(displayFormat || inputFormat)
1036
- });
1037
- };
1038
- DateRangePicker.prototype.checkStartIsValidDate = function (currentDate) {
1039
- var _a = this.state, endDate = _a.endDate; _a.startDate;
1040
- var _b = this.props, minDate = _b.minDate, maxDate = _b.maxDate, minDuration = _b.minDuration, maxDuration = _b.maxDuration, viewMode = _b.viewMode;
1041
- var precision = viewMode === 'time' ? 'hours' : viewMode || 'day';
1042
- maxDate =
1043
- maxDate && endDate
1044
- ? maxDate.isBefore(endDate)
1045
- ? maxDate
1046
- : endDate
1047
- : maxDate || endDate;
1048
- if (minDate && currentDate.isBefore(minDate, precision)) {
1049
- return false;
1050
- }
1051
- else if (maxDate && currentDate.isAfter(maxDate, precision)) {
1052
- return false;
1053
- }
1054
- else if (
1055
- // 如果配置了 minDuration 那么 EndDate - minDuration 之后的天数也不能选
1056
- endDate &&
1057
- minDuration &&
1058
- currentDate.isAfter(endDate.clone().subtract(minDuration))) {
1059
- return false;
1060
- }
1061
- else if (endDate &&
1062
- maxDuration &&
1063
- currentDate.isBefore(endDate.clone().subtract(maxDuration))) {
1064
- return false;
1065
- }
1066
- return true;
1067
- };
1068
- DateRangePicker.prototype.checkEndIsValidDate = function (currentDate) {
1069
- var startDate = this.state.startDate;
1070
- var _a = this.props, minDate = _a.minDate, maxDate = _a.maxDate, minDuration = _a.minDuration, maxDuration = _a.maxDuration, viewMode = _a.viewMode;
1071
- var precision = viewMode === 'time' ? 'hours' : viewMode || 'day';
1072
- minDate =
1073
- minDate && startDate
1074
- ? minDate.isAfter(startDate)
1075
- ? minDate
1076
- : startDate
1077
- : minDate || startDate;
1078
- // 在 dateTimeRange 的场景下,如果选择了开始时间的时间点不为 0,比如 2020-10-1 10:10,这时 currentDate 传入的当天值是 2020-10-1 00:00,这个值在起始时间后面,导致没法再选这一天了,所以在这时需要先通过将时间都转成 00 再比较
1079
- if (minDate &&
1080
- currentDate
1081
- .startOf('day')
1082
- .isBefore(minDate.clone().startOf('day'), precision)) {
1083
- return false;
1084
- }
1085
- else if (maxDate && currentDate.isAfter(maxDate, precision)) {
1086
- return false;
1087
- }
1088
- else if (startDate &&
1089
- minDuration &&
1090
- currentDate.isBefore(startDate.clone().add(minDuration))) {
1091
- return false;
1092
- }
1093
- else if (startDate &&
1094
- maxDuration &&
1095
- currentDate.isAfter(startDate.clone().add(maxDuration))) {
1096
- return false;
1097
- }
1098
- return true;
1099
- };
1100
- DateRangePicker.prototype.renderDay = function (props, currentDate) {
1101
- var _a;
1102
- var _b = this.state, startDate = _b.startDate, endDate = _b.endDate;
1103
- var testIdBuilder = this.props.testIdBuilder;
1104
- if (startDate &&
1105
- endDate &&
1106
- currentDate.isBetween(startDate, endDate, 'day', '[]')) {
1107
- props.className += ' rdtBetween';
1108
- }
1109
- // 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
1110
- if (startDate && endDate && props.className.includes('rdtActive')) {
1111
- props.className = props.className.replace('rdtActive', '');
1112
- }
1113
- if (startDate && currentDate.isSame(startDate, 'day')) {
1114
- props.className += ' rdtActive rdtStart';
1115
- }
1116
- if (endDate && currentDate.isSame(endDate, 'day')) {
1117
- props.className += ' rdtActive rdtEnd';
1118
- }
1119
- var _c = this.getDisabledElementProps(currentDate, 'day'), className = _c.className, others = __rest(_c, ["className"]);
1120
- props.className += className;
1121
- return (React__default.createElement("td", __assign({}, omit(props, ['todayActiveStyle']), others),
1122
- React__default.createElement("span", __assign({}, (_a = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key)) === null || _a === void 0 ? void 0 : _a.getTestId()), currentDate.date())));
1123
- };
1124
- DateRangePicker.prototype.renderMonth = function (props, month, year, date) {
1125
- var currentDate = props.viewDate.year(year).month(month);
1126
- var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
1127
- var _b = this.props, __ = _b.translate, testIdBuilder = _b.testIdBuilder;
1128
- var monthStr = currentDate.format(__('MMM'));
1129
- var strLength = 3;
1130
- // Because some months are up to 5 characters long, we want to
1131
- // use a fixed string length for consistency
1132
- var monthStrFixedLength = monthStr.substring(0, strLength);
1133
- if (startDate &&
1134
- endDate &&
1135
- currentDate.isBetween(startDate, endDate, 'month', '[]')) {
1136
- props.className += ' rdtBetween';
1137
- }
1138
- // 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
1139
- if (startDate && endDate && props.className.includes('rdtActive')) {
1140
- props.className = props.className.replace('rdtActive', '');
1141
- }
1142
- if (startDate && currentDate.isSame(startDate, 'month')) {
1143
- props.className += ' rdtActive rdtStart';
1144
- }
1145
- if (endDate && currentDate.isSame(endDate, 'month')) {
1146
- props.className += ' rdtActive rdtEnd';
1147
- }
1148
- var _c = this.getDisabledElementProps(currentDate, 'month'), className = _c.className, others = __rest(_c, ["className"]);
1149
- props.className += className;
1150
- return (React__default.createElement("td", __assign({}, omit(props, 'viewDate'), others),
1151
- React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key).getTestId()), monthStrFixedLength)));
1152
- };
1153
- DateRangePicker.prototype.renderQuarter = function (props, quarter, year) {
1154
- var currentDate = moment().year(year).quarter(quarter);
1155
- var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
1156
- var testIdBuilder = this.props.testIdBuilder;
1157
- if (startDate &&
1158
- endDate &&
1159
- currentDate.isBetween(startDate, endDate, 'quarter', '[]')) {
1160
- props.className += ' rdtBetween';
1161
- }
1162
- // 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
1163
- if (startDate && endDate && props.className.includes('rdtActive')) {
1164
- props.className = props.className.replace('rdtActive', '');
1165
- }
1166
- if (startDate && currentDate.isSame(startDate, 'quarter')) {
1167
- props.className += ' rdtActive rdtStart';
1168
- }
1169
- if (endDate && currentDate.isSame(endDate, 'quarter')) {
1170
- props.className += ' rdtActive rdtEnd';
1171
- }
1172
- var _b = this.getDisabledElementProps(currentDate, 'quarter'), className = _b.className, others = __rest(_b, ["className"]);
1173
- props.className += className;
1174
- return (React__default.createElement("td", __assign({}, props, others),
1175
- React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key).getTestId()),
1176
- "Q",
1177
- quarter)));
1178
- };
1179
- DateRangePicker.prototype.renderYear = function (props, year) {
1180
- var currentDate = moment().year(year);
1181
- var _a = this.state, startDate = _a.startDate, endDate = _a.endDate;
1182
- var testIdBuilder = this.props.testIdBuilder;
1183
- if (startDate &&
1184
- endDate &&
1185
- currentDate.isBetween(startDate, endDate, 'year', '[]')) {
1186
- props.className += ' rdtBetween';
1187
- }
1188
- // 如果已经选择了开始时间和结束时间,那么中间的时间都不应该高亮
1189
- if (startDate && endDate && props.className.includes('rdtActive')) {
1190
- props.className = props.className.replace('rdtActive', '');
1191
- }
1192
- if (startDate && currentDate.isSame(startDate, 'year')) {
1193
- props.className += ' rdtActive rdtStart';
1194
- }
1195
- if (endDate && currentDate.isSame(endDate, 'year')) {
1196
- props.className += ' rdtActive rdtEnd';
1197
- }
1198
- var _b = this.getDisabledElementProps(currentDate, 'year'), className = _b.className, others = __rest(_b, ["className"]);
1199
- props.className += className;
1200
- return (React__default.createElement("td", __assign({}, props, others),
1201
- React__default.createElement("span", __assign({}, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild(props.key).getTestId()), year)));
1202
- };
1203
- DateRangePicker.prototype.renderCalendar = function () {
1204
- var _this = this;
1205
- var _a = this.props, ns = _a.classPrefix, cx = _a.classnames, inputFormat = _a.inputFormat, displayFormat = _a.displayFormat, ranges = _a.ranges, shortcuts = _a.shortcuts, locale = _a.locale, embed = _a.embed, type = _a.type, _b = _a.viewMode, viewMode = _b === void 0 ? 'days' : _b, label = _a.label, mobileUI = _a.mobileUI, testIdBuilder = _a.testIdBuilder;
1206
- var __ = this.props.translate;
1207
- var _c = this.state, startDate = _c.startDate, endDate = _c.endDate, editState = _c.editState, curDateFormat = _c.curDateFormat, curTimeFormat = _c.curTimeFormat;
1208
- var isDateTimeRange = type === 'input-datetime-range';
1209
- var isDateRange = type === 'input-date-range';
1210
- // timeRange需要单独选择范围
1211
- var isTimeRange = isDateTimeRange || viewMode === 'time';
1212
- var isConfirmBtnDisbaled = (isTimeRange && editState === 'start' && !startDate) ||
1213
- (isTimeRange && editState === 'end' && !endDate) ||
1214
- (startDate && (endDate === null || endDate === void 0 ? void 0 : endDate.isBefore(this.state.startDate))) ||
1215
- /** 日期范围选择之后会立即切换面板,所以开始/结束日期任意一个不合法就不允许更新数据 */
1216
- (isDateRange &&
1217
- (!startDate ||
1218
- !endDate ||
1219
- !(startDate === null || startDate === void 0 ? void 0 : startDate.isValid()) ||
1220
- !(endDate === null || endDate === void 0 ? void 0 : endDate.isValid())));
1221
- return (React__default.createElement("div", { className: cx("".concat(ns, "DateRangePicker-wrap"), { 'is-mobile': mobileUI }), ref: this.calendarRef },
1222
- mobileUI && !embed ? (React__default.createElement("div", { className: cx('PickerColumns-header') },
1223
- React__default.createElement(Button, { className: "PickerColumns-cancel", level: "link", onClick: function () { return _this.close(false); } }, __('cancel')),
1224
- label && typeof label === 'string'
1225
- ? label
1226
- : __('Calendar.datepicker'),
1227
- React__default.createElement(Button, { className: "PickerColumns-confirm", level: "link", disabled: isConfirmBtnDisbaled || !startDate || !endDate, onClick: this.confirm }, __('confirm')))) : null,
1228
- this.renderShortcuts(ranges || shortcuts),
1229
- React__default.createElement("div", { className: cx("".concat(ns, "DateRangePicker-picker-wrap"), {
1230
- 'is-vertical': embed
1231
- }) },
1232
- (!isTimeRange ||
1233
- (editState === 'start' && !embed) ||
1234
- (mobileUI && isTimeRange)) && (React__default.createElement(Calendar, { className: "".concat(ns, "DateRangePicker-start"), value: startDate,
1235
- // 区分的原因是 time-range 左侧就只能选起始时间,而其它都能在左侧同时同时选择起始和结束
1236
- // TODO: 后续得把 time-range 代码拆分出来
1237
- onChange: isDateTimeRange
1238
- ? this.handleStartDateChange
1239
- : viewMode === 'time'
1240
- ? this.handleTimeStartChange
1241
- : this.handleDateChange, requiredConfirm: false, dateFormat: curDateFormat, displayForamt: displayFormat || inputFormat, timeFormat: curTimeFormat, isValidDate: this.checkStartIsValidDate, viewMode: viewMode, input: false, onClose: this.close, renderDay: this.renderDay, renderMonth: this.renderMonth, renderQuarter: this.renderQuarter, renderYear: this.renderYear, locale: locale, timeRangeHeader: "\u5F00\u59CB\u65F6\u95F4", embed: embed, status: "start", testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('calendar-start') })),
1242
- (!isTimeRange ||
1243
- (editState === 'end' && !embed) ||
1244
- (mobileUI && isTimeRange)) && (React__default.createElement(Calendar, { className: "".concat(ns, "DateRangePicker-end"), value: endDate, onChange: isDateTimeRange
1245
- ? this.handelEndDateChange
1246
- : viewMode === 'time'
1247
- ? this.handleTimeEndChange
1248
- : this.handleDateChange, requiredConfirm: false, dateFormat: curDateFormat, displayForamt: displayFormat || inputFormat, timeFormat: curTimeFormat, viewDate: isDateTimeRange ? this.currentMonth : this.nextMonth,
1249
- // isEndDate
1250
- isValidDate: this.checkEndIsValidDate, viewMode: viewMode, input: false, onClose: this.close, renderDay: this.renderDay, renderMonth: this.renderMonth, renderQuarter: this.renderQuarter, renderYear: this.renderYear, locale: locale, timeRangeHeader: "\u7ED3\u675F\u65F6\u95F4", embed: embed, status: "end", testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('calendar-end') }))),
1251
- embed || mobileUI ? null : (React__default.createElement("div", { key: "button", className: "".concat(ns, "DateRangePicker-actions") },
1252
- React__default.createElement(Button, { size: "sm", onClick: function () { return _this.close(); } }, __('cancel')),
1253
- React__default.createElement(Button, { level: "primary", size: "sm", className: cx('m-l-sm'), disabled: isConfirmBtnDisbaled, onClick: this.confirm }, __('confirm'))))));
1254
- };
1255
- DateRangePicker.prototype.getDisabledElementProps = function (currentDate, granularity) {
1256
- var _a = this.state; _a.endDateOpenedFirst; var endDate = _a.endDate, startDate = _a.startDate, editState = _a.editState;
1257
- var afterEndDate = editState === 'start' &&
1258
- endDate &&
1259
- currentDate.isAfter(endDate, granularity);
1260
- var beforeStartDate = editState === 'end' &&
1261
- startDate &&
1262
- !currentDate.isSameOrAfter(startDate, granularity);
1263
- if (afterEndDate || beforeStartDate) {
1264
- return {
1265
- className: ' is-disabled',
1266
- onClick: undefined
1267
- };
1268
- }
1269
- return {
1270
- className: ''
1271
- };
1272
- };
1273
- /** 获取宽度类型变量的值 */
1274
- DateRangePicker.prototype.getValidWidthValue = function (element, propsName) {
1275
- if (!element || !propsName) {
1276
- return 0;
1277
- }
1278
- var propsValue = parseInt(getComputedStyle(element, kebabCase(propsName)), 10);
1279
- return isNaN(propsValue) ? 0 : propsValue;
1280
- };
1281
- DateRangePicker.prototype.renderActiveCursor = function () {
1282
- var _a, _b, _c, _d;
1283
- var cx = this.props.classnames;
1284
- var _e = this.state, editState = _e.editState, isFocused = _e.isFocused;
1285
- var cursorWidth = 0;
1286
- var cursorLeft = 0;
1287
- var parentNode = (_a = this === null || this === void 0 ? void 0 : this.dom) === null || _a === void 0 ? void 0 : _a.current;
1288
- var startInputNode = (_b = this === null || this === void 0 ? void 0 : this.startInputRef) === null || _b === void 0 ? void 0 : _b.current;
1289
- var endInputNode = (_c = this === null || this === void 0 ? void 0 : this.endInputRef) === null || _c === void 0 ? void 0 : _c.current;
1290
- var separatorNode = (_d = this === null || this === void 0 ? void 0 : this.separatorRef) === null || _d === void 0 ? void 0 : _d.current;
1291
- if (parentNode && startInputNode && endInputNode && separatorNode) {
1292
- if (editState === 'start') {
1293
- var paddingWidth = this.getValidWidthValue(parentNode, 'paddingLeft');
1294
- cursorLeft = paddingWidth;
1295
- cursorWidth = startInputNode.offsetWidth;
1296
- }
1297
- else if (editState === 'end') {
1298
- var separatorWidth = separatorNode.offsetWidth +
1299
- this.getValidWidthValue(parentNode, 'paddingLeft') +
1300
- this.getValidWidthValue(parentNode, 'marginLeft') +
1301
- this.getValidWidthValue(parentNode, 'paddingRight') +
1302
- this.getValidWidthValue(parentNode, 'marginRight');
1303
- cursorLeft = startInputNode.offsetWidth + separatorWidth;
1304
- cursorWidth = endInputNode.offsetWidth;
1305
- }
1306
- else {
1307
- cursorWidth = 0;
1308
- }
1309
- }
1310
- return (React__default.createElement("div", { className: cx('DateRangePicker-activeCursor', { isFocused: isFocused }), style: {
1311
- position: 'absolute',
1312
- left: cursorLeft,
1313
- width: cursorWidth
1314
- } }));
1315
- };
1316
- DateRangePicker.prototype.getDefaultDate = function () {
1317
- var _a;
1318
- var _b = this.props, value = _b.value, data = _b.data, valueFormat = _b.valueFormat, format = _b.format, delimiter = _b.delimiter;
1319
- if (value) {
1320
- var startDate = filterDate(Array.isArray(value)
1321
- ? value[0] || value[1]
1322
- : (_a = String(value).split(delimiter)) === null || _a === void 0 ? void 0 : _a[0], data, valueFormat || format);
1323
- return startDate;
1324
- }
1325
- return undefined;
1326
- };
1327
- DateRangePicker.prototype.render = function () {
1328
- var _a;
1329
- var _this = this;
1330
- var _b = this.props, className = _b.className, popoverClassName = _b.popoverClassName, ns = _b.classPrefix, cx = _b.classnames, value = _b.value, startPlaceholder = _b.startPlaceholder, endPlaceholder = _b.endPlaceholder, popOverContainer = _b.popOverContainer, popOverContainerSelector = _b.popOverContainerSelector, inputFormat = _b.inputFormat, displayFormat = _b.displayFormat; _b.joinValues; _b.delimiter; var clearable = _b.clearable, inputForbid = _b.inputForbid, disabled = _b.disabled, embed = _b.embed, overlayPlacement = _b.overlayPlacement, borderMode = _b.borderMode, mobileUI = _b.mobileUI; _b.timeFormat; var minDate = _b.minDate, maxDate = _b.maxDate, minDuration = _b.minDuration, maxDuration = _b.maxDuration; _b.dateFormat; var _c = _b.viewMode, viewMode = _c === void 0 ? 'days' : _c, ranges = _b.ranges, shortcuts = _b.shortcuts, label = _b.label, animation = _b.animation, testIdBuilder = _b.testIdBuilder, locale = _b.locale;
1331
- var useCalendarMobile = mobileUI && ['days', 'months', 'quarters'].indexOf(viewMode) > -1;
1332
- var _d = this.state, isOpened = _d.isOpened, isFocused = _d.isFocused, startDate = _d.startDate, endDate = _d.endDate, curDateFormat = _d.curDateFormat, curTimeFormat = _d.curTimeFormat;
1333
- var __ = this.props.translate;
1334
- var calendarMobile = (React__default.createElement(CalendarMobile, { popOverContainer: popOverContainer, timeFormat: curTimeFormat, displayForamt: displayFormat || inputFormat, defaultDate: this.getDefaultDate(), startDate: startDate, endDate: endDate, minDate: minDate, maxDate: maxDate, minDuration: minDuration, maxDuration: maxDuration, dateFormat: curDateFormat, embed: embed, viewMode: viewMode, close: this.close, confirm: this.confirm, onChange: this.handleMobileChange, footerExtra: this.renderShortcuts(ranges || shortcuts), locale: locale, showViewMode: viewMode === 'quarters' || viewMode === 'months' ? 'years' : 'months' }));
1335
- if (embed) {
1336
- return (React__default.createElement("div", { className: cx("".concat(ns, "DateRangeCalendar"), {
1337
- 'is-mobile': mobileUI
1338
- }, {
1339
- 'is-disabled': disabled
1340
- }, className) }, useCalendarMobile ? calendarMobile : this.renderCalendar()));
1341
- }
1342
- var CalendarMobileTitle = (React__default.createElement("div", { className: "".concat(ns, "CalendarMobile-title") }, label && typeof label === 'string' ? label : __('Calendar.datepicker')));
1343
- /** 是否启用游标动画 */
1344
- var useAnimation = animation !== false;
1345
- return (React__default.createElement("div", { tabIndex: 0, onKeyPress: this.handleKeyPress, onFocus: this.handleFocus, onBlur: this.handleBlur, className: cx("".concat(ns, "DateRangePicker"), (_a = {
1346
- 'is-disabled': disabled,
1347
- 'is-focused': isFocused
1348
- },
1349
- _a["".concat(ns, "DateRangePicker--border").concat(ucFirst(borderMode))] = borderMode,
1350
- _a['is-mobile'] = mobileUI,
1351
- _a), className), ref: this.dom },
1352
- React__default.createElement(Input, { className: cx('DateRangePicker-input', {
1353
- isActive: !useAnimation && this.state.editState === 'start' && isOpened
1354
- }), onChange: this.startInputChange, onClick: this.openStart, ref: this.startInputRef, placeholder: __(startPlaceholder), autoComplete: "off", value: this.state.startInputValue || '', disabled: disabled, readOnly: mobileUI || inputForbid, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('start') }),
1355
- React__default.createElement("span", { className: cx('DateRangePicker-input-separator'), ref: this.separatorRef },
1356
- React__default.createElement("span", { className: cx('DateRangePicker-input-separator-line') })),
1357
- React__default.createElement(Input, { className: cx('DateRangePicker-input', {
1358
- isActive: !useAnimation && this.state.editState === 'end' && isOpened
1359
- }), onChange: this.endInputChange, onClick: this.openEnd, ref: this.endInputRef, placeholder: __(endPlaceholder), autoComplete: "off", value: this.state.endInputValue || '', disabled: disabled, readOnly: mobileUI || inputForbid, testIdBuilder: testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('end') }),
1360
- useAnimation ? this.renderActiveCursor() : null,
1361
- clearable && !disabled && value ? (React__default.createElement("a", { className: "".concat(ns, "DateRangePicker-clear"), onClick: this.clearValue },
1362
- React__default.createElement(Icon, { icon: "input-clear", className: "icon" }))) : null,
1363
- React__default.createElement("a", { className: cx("DateRangePicker-toggler") },
1364
- React__default.createElement(Icon, { icon: viewMode === 'time' ? 'clock' : 'date', className: "icon", iconContent: viewMode === 'time'
1365
- ? 'DatePicker-toggler-clock'
1366
- : 'DatePicker-toggler-date' })),
1367
- isOpened ? (mobileUI ? (React__default.createElement(PopUp, { isShow: isOpened, container: popOverContainer, className: cx("".concat(ns, "CalendarMobile-pop"), "".concat(ns, "CalendarMobile-pop--").concat(viewMode)), onHide: this.close, header: CalendarMobileTitle, showClose: false }, useCalendarMobile ? calendarMobile : this.renderCalendar())) : (React__default.createElement(Overlay, { target: function () { return _this.dom.current; }, onHide: this.close, container: popOverContainer || (function () { return findDOMNode(_this); }), containerSelector: popOverContainerSelector, rootClose: false, placement: overlayPlacement, show: true },
1368
- React__default.createElement(PopOver, { classPrefix: ns, className: cx("".concat(ns, "DateRangePicker-popover"), popoverClassName), onHide: this.close, onClick: this.handlePopOverClick }, this.renderCalendar())))) : null));
1369
- };
1370
- DateRangePicker.defaultProps = {
1371
- startPlaceholder: 'Calendar.startPick',
1372
- endPlaceholder: 'Calendar.endPick',
1373
- format: 'X',
1374
- inputFormat: 'YYYY-MM-DD',
1375
- joinValues: true,
1376
- clearable: true,
1377
- delimiter: ',',
1378
- ranges: '',
1379
- shortcuts: 'yesterday,7daysago,prevweek,thismonth,prevmonth,prevquarter',
1380
- resetValue: '',
1381
- closeOnSelect: true,
1382
- overlayPlacement: 'auto',
1383
- endDateOpenedFirst: false
1384
- };
1385
- return DateRangePicker;
1386
- }(React__default.Component));
1387
- var DateRangePicker$1 = themeable(localeable(DateRangePicker));
1388
-
1389
- export { DateRangePicker, advancedRanges, availableShortcuts, DateRangePicker$1 as default };