tntd 3.0.43 → 3.0.45-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (519) hide show
  1. package/es/_util/context.js +1 -1
  2. package/es/_util/defaultRenderEmpty.js +1 -1
  3. package/es/_util/hooks/useFlexGapSupport.js +4 -4
  4. package/es/_util/hooks/useForceUpdate.js +4 -4
  5. package/es/_util/responsiveObserve.js +1 -1
  6. package/es/_util/styleChecker.js +1 -1
  7. package/es/actions/index.js +1 -1
  8. package/es/alert/alert.js +2 -2
  9. package/es/alert/index.js +1 -1
  10. package/es/array-input/index.js +9 -9
  11. package/es/button/button.js +2 -2
  12. package/es/cascader/cascader.js +1 -1
  13. package/es/check-card/group.js +8 -8
  14. package/es/check-card/index.js +6 -6
  15. package/es/checkbox/checkbox.js +1 -1
  16. package/es/color-picker/ColorPicker.js +6 -6
  17. package/es/color-picker/index.js +1 -1
  18. package/es/columns/index.js +1 -1
  19. package/es/config-provider/config-provider.js +1 -1
  20. package/es/date-picker/DatePicker.js +1 -1
  21. package/es/descriptions/descriptions.js +5 -5
  22. package/es/development-login/LoginModal.js +6 -6
  23. package/es/development-login/index.js +4 -4
  24. package/es/drawer/drawer.js +2 -2
  25. package/es/ellipsis/Svg/CopySVG.js +1 -1
  26. package/es/ellipsis/Svg/TickSVG.js +1 -1
  27. package/es/ellipsis/index.js +5 -5
  28. package/es/empty/empty.js +2 -2
  29. package/es/empty/empty.stories.js +2 -2
  30. package/es/exception/exception.js +1 -1
  31. package/es/form/form.js +2 -2
  32. package/es/form/style/index.less +5 -5
  33. package/es/grid-v4/col.js +2 -2
  34. package/es/grid-v4/hooks/useBreakpoint.js +1 -1
  35. package/es/grid-v4/index.js +1 -1
  36. package/es/grid-v4/row.js +6 -6
  37. package/es/handle/index.js +1 -1
  38. package/es/handle-icon/index.js +11 -11
  39. package/es/icon/IconFont.js +1 -1
  40. package/es/icon/components/Icon.js +9 -9
  41. package/es/icon/components/index.js +1 -1
  42. package/es/icon/components/utils.js +3 -3
  43. package/es/icon/index.js +7 -7
  44. package/es/icon/twoTonePrimaryColor.js +1 -1
  45. package/es/icon/utils.js +1 -1
  46. package/es/img/Contain.js +1 -1
  47. package/es/img/Cover.js +5 -5
  48. package/es/img/index.js +5 -5
  49. package/es/index.js +8 -1
  50. package/es/index.js.map +1 -1
  51. package/es/input/input.js +2 -2
  52. package/es/input-number/inputNumber.js +1 -1
  53. package/es/label/index.js +2 -2
  54. package/es/loading-button/index.js +5 -5
  55. package/es/locale/default.js +1 -1
  56. package/es/locale/en_US.js +1 -1
  57. package/es/locale/zh_CN.js +1 -1
  58. package/es/modal/modal.js +1 -1
  59. package/es/notification/assets/index.js +1 -1
  60. package/es/notification/index.js +1 -1
  61. package/es/notification/notification.js +1 -1
  62. package/es/page/Box.js +1 -1
  63. package/es/page/index.js +7 -7
  64. package/es/page-container/index.js +1 -1
  65. package/es/page-loading/index.js +1 -1
  66. package/es/popconfirm/popconfirm.js +1 -1
  67. package/es/popover/popover.js +1 -1
  68. package/es/preview-text/index.js +7 -7
  69. package/es/progress/progress.js +2 -2
  70. package/es/query-form/Field/Checkbox.js +2 -2
  71. package/es/query-form/Field/Checkbox.js.map +1 -1
  72. package/es/query-form/Field/Composition/FieldPopover.js +361 -0
  73. package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
  74. package/es/query-form/Field/Composition/FieldPopover.less +35 -0
  75. package/es/query-form/Field/Composition/Select.js +157 -0
  76. package/es/query-form/Field/Composition/Select.js.map +1 -0
  77. package/es/query-form/Field/Composition/SelectInput.js +34 -0
  78. package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
  79. package/es/query-form/Field/Composition/ValueTag.js +162 -0
  80. package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
  81. package/es/query-form/Field/Composition/index.js +337 -0
  82. package/es/query-form/Field/Composition/index.js.map +1 -0
  83. package/es/query-form/Field/Composition/index.less +145 -0
  84. package/es/query-form/Field/Composition/utils.js +169 -0
  85. package/es/query-form/Field/Composition/utils.js.map +1 -0
  86. package/es/query-form/Field/Select.js +6 -6
  87. package/es/query-form/Field/SelectInput.js +26 -15
  88. package/es/query-form/Field/SelectInput.js.map +1 -1
  89. package/es/query-form/Field/fieldsMap.js +3 -3
  90. package/es/query-form/Field/fieldsMap.js.map +1 -1
  91. package/es/query-form/Field/index.js +13 -11
  92. package/es/query-form/Field/index.js.map +1 -1
  93. package/es/query-form/createActions.js +1 -1
  94. package/es/query-form/index.js +228 -359
  95. package/es/query-form/index.js.map +1 -1
  96. package/es/query-form/index.less +26 -60
  97. package/es/query-form/useForm.js +1 -1
  98. package/es/query-form-v2/index.less +133 -0
  99. package/es/query-list-scene/List.js +29 -16
  100. package/es/query-list-scene/List.js.map +1 -1
  101. package/es/query-list-scene/QueryForm.js +44 -22
  102. package/es/query-list-scene/QueryForm.js.map +1 -1
  103. package/es/query-list-scene/QueryListScene.js +10 -10
  104. package/es/query-list-scene/Title.js +1 -1
  105. package/es/query-list-scene/Toolbar.js +2 -2
  106. package/es/query-list-scene/createActions.js +1 -1
  107. package/es/query-list-scene/index.js +3 -2
  108. package/es/query-list-scene/index.js.map +1 -1
  109. package/es/query-list-scene/useActions.js +1 -1
  110. package/es/radio/radio.js +1 -1
  111. package/es/render-empty/render-empty.js +1 -1
  112. package/es/scroll-bar/Bar.js +91 -0
  113. package/es/scroll-bar/Bar.js.map +1 -0
  114. package/es/scroll-bar/Context.js +13 -0
  115. package/es/scroll-bar/Context.js.map +1 -0
  116. package/es/scroll-bar/ScrollBar.js +97 -0
  117. package/es/scroll-bar/ScrollBar.js.map +1 -0
  118. package/es/scroll-bar/Thumb.js +125 -0
  119. package/es/scroll-bar/Thumb.js.map +1 -0
  120. package/es/scroll-bar/index.js +10 -0
  121. package/es/scroll-bar/index.js.map +1 -0
  122. package/es/scroll-bar/scrollBar.less +59 -0
  123. package/es/scroll-bar/util.js +39 -0
  124. package/es/scroll-bar/util.js.map +1 -0
  125. package/es/segmented/index.js +2 -2
  126. package/es/select/select.js +2 -2
  127. package/es/spin/spin.js +1 -1
  128. package/es/steps/steps.js +2 -2
  129. package/es/svg-components/index.js +1 -1
  130. package/es/table/hooks/use-column-setting.js +4 -4
  131. package/es/table/hooks/use-column-setting.js.map +1 -1
  132. package/es/table/hooks/use-expand-fixed.js +6 -6
  133. package/es/table/resizableTable/index.js +40 -11
  134. package/es/table/resizableTable/index.js.map +1 -1
  135. package/es/table/resizableTable/index.less +9 -1
  136. package/es/table/table-hoc.js +1 -1
  137. package/es/table/table.js +17 -11
  138. package/es/table/table.js.map +1 -1
  139. package/es/table/table.stories.js +2 -2
  140. package/es/table/utils.js +1 -1
  141. package/es/table-container/index.js +1 -1
  142. package/es/tabs/tabs.js +2 -2
  143. package/es/tabs-container/index.js +1 -1
  144. package/es/tag/tag.js +2 -2
  145. package/es/time-picker/TimePicker.js +1 -1
  146. package/es/time-picker/index.js +1 -1
  147. package/es/title/index.js +1 -1
  148. package/es/tntd-action/Action.js +9 -9
  149. package/es/tntd-action/index.js +8 -8
  150. package/es/tntd-cascader/AntdCascader/component/context.js +1 -1
  151. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  152. package/es/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
  153. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
  154. package/es/tntd-cascader/AntdCascader/config/utils.js +2 -2
  155. package/es/tntd-cascader/AntdCascader/index.js +7 -7
  156. package/es/tntd-cascader/index.js +1 -1
  157. package/es/tntd-cascader/rc-cascader/Cascader.js +8 -8
  158. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
  159. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
  160. package/es/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
  161. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
  162. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
  163. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
  164. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
  165. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
  166. package/es/tntd-cascader/rc-cascader/index.js +1 -1
  167. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
  168. package/es/tntd-form/ErrorList.js +7 -7
  169. package/es/tntd-form/Form.js +6 -6
  170. package/es/tntd-form/FormItem/ItemHolder.js +6 -6
  171. package/es/tntd-form/FormItem/index.js +8 -8
  172. package/es/tntd-form/FormItemInput.js +1 -1
  173. package/es/tntd-form/FormItemLabel.js +2 -2
  174. package/es/tntd-form/FormList.js +1 -1
  175. package/es/tntd-form/context.js +1 -1
  176. package/es/tntd-form/hooks/useDebounce.js +4 -4
  177. package/es/tntd-form/hooks/useForm.js +5 -5
  178. package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
  179. package/es/tntd-form/hooks/useFrameState.js +5 -5
  180. package/es/tntd-form/index.js +1 -1
  181. package/es/tntd-icon/index.js +1 -1
  182. package/es/tntd-layout/AppList.js +6 -6
  183. package/es/tntd-layout/Application.js +6 -6
  184. package/es/tntd-layout/Avatar.js +2 -2
  185. package/es/tntd-layout/CompatibleLanguage.js +6 -6
  186. package/es/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
  187. package/es/tntd-layout/EnterpriseLayout/Language.js +6 -6
  188. package/es/tntd-layout/EnterpriseLayout/Theme.js +6 -6
  189. package/es/tntd-layout/EnterpriseLayout/index.js +1 -1
  190. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
  191. package/es/tntd-layout/GlobalNavigation/index.js +9 -9
  192. package/es/tntd-layout/Header.js +2 -2
  193. package/es/tntd-layout/HeaderActions.js +2 -2
  194. package/es/tntd-layout/HeaderNavs.js +6 -6
  195. package/es/tntd-layout/HeaderTabs.js +7 -7
  196. package/es/tntd-layout/Iconfont.js +1 -1
  197. package/es/tntd-layout/Language.js +6 -6
  198. package/es/tntd-layout/Layout.js +6 -6
  199. package/es/tntd-layout/Logo.js +2 -2
  200. package/es/tntd-layout/OrgAppList.js +6 -6
  201. package/es/tntd-layout/SideMenu.js +6 -6
  202. package/es/tntd-layout/Theme.js +6 -6
  203. package/es/tntd-layout/createActions.js +1 -1
  204. package/es/tntd-layout/images/index.js +1 -1
  205. package/es/tntd-layout/index.js +1 -1
  206. package/es/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
  207. package/es/tntd-layout/paaslayout/Header.js +2 -2
  208. package/es/tntd-layout/paaslayout/Logo.js +2 -2
  209. package/es/tntd-layout/paaslayout/SideMenu.js +6 -6
  210. package/es/tntd-layout/paaslayout/index.js +6 -6
  211. package/es/tntd-layout/storage.js +1 -1
  212. package/es/tntd-modal/index.js +6 -6
  213. package/es/tntd-rc-select/_util/PurePanel.js +5 -5
  214. package/es/tntd-rc-select/_util/context.js +1 -1
  215. package/es/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
  216. package/es/tntd-rc-select/_util/getIcons.js +1 -1
  217. package/es/tntd-rc-select/_util/useCompactItemContext.js +2 -2
  218. package/es/tntd-rc-select/index.js +2 -2
  219. package/es/tntd-reference/AHref/index.js +1 -1
  220. package/es/tntd-reference/ReferenceBatchCheck/index.js +1 -1
  221. package/es/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
  222. package/es/tntd-reference/ReferenceCheck/index.js +1 -1
  223. package/es/tntd-reference/ReferenceDrawer/index.js +5 -5
  224. package/es/tntd-reference/ReferenceInfo/index.js +1 -1
  225. package/es/tntd-reference/index.js +1 -1
  226. package/es/tntd-second-page/index.js +1 -1
  227. package/es/tntd-select/DropDownWrap.js +8 -8
  228. package/es/tntd-select/index.js +10 -9
  229. package/es/tntd-select/index.js.map +1 -1
  230. package/es/tntd-virtual-tree/index.js +8 -11
  231. package/es/tntd-virtual-tree/index.js.map +1 -1
  232. package/es/tntd-virtual-tree/utils.js +28 -28
  233. package/es/tntd-virtual-tree-select/index.js +10 -10
  234. package/es/tntd-virtual-tree-select/utils.js +9 -9
  235. package/es/tooltip/tooltip.js +1 -1
  236. package/es/upload/index.js +6 -6
  237. package/es/upload/svg/UploadSVG.js +1 -1
  238. package/es/utils/checkAuth.js +4 -4
  239. package/es/utils/index.js +9 -9
  240. package/es/utils/lang.js +3 -3
  241. package/es/water-mark/index.js +5 -5
  242. package/lib/_util/context.js +3 -3
  243. package/lib/_util/defaultRenderEmpty.js +3 -3
  244. package/lib/_util/hooks/useFlexGapSupport.js +14 -15
  245. package/lib/_util/hooks/useForceUpdate.js +14 -15
  246. package/lib/_util/responsiveObserve.js +7 -13
  247. package/lib/_util/styleChecker.js +3 -3
  248. package/lib/actions/index.js +3 -3
  249. package/lib/alert/alert.js +10 -16
  250. package/lib/alert/index.js +3 -3
  251. package/lib/array-input/index.js +30 -37
  252. package/lib/button/button.js +10 -16
  253. package/lib/cascader/cascader.js +3 -3
  254. package/lib/check-card/group.js +23 -24
  255. package/lib/check-card/index.js +24 -31
  256. package/lib/checkbox/checkbox.js +3 -3
  257. package/lib/color-picker/ColorPicker.js +24 -31
  258. package/lib/color-picker/index.js +3 -3
  259. package/lib/columns/index.js +3 -3
  260. package/lib/config-provider/config-provider.js +3 -3
  261. package/lib/date-picker/DatePicker.js +3 -3
  262. package/lib/descriptions/descriptions.js +13 -19
  263. package/lib/development-login/LoginModal.js +24 -31
  264. package/lib/development-login/index.js +14 -15
  265. package/lib/drawer/drawer.js +10 -16
  266. package/lib/ellipsis/Svg/CopySVG.js +3 -3
  267. package/lib/ellipsis/Svg/TickSVG.js +3 -3
  268. package/lib/ellipsis/index.js +17 -18
  269. package/lib/empty/empty.js +10 -16
  270. package/lib/empty/empty.stories.js +6 -9
  271. package/lib/exception/exception.js +3 -3
  272. package/lib/form/form.js +10 -16
  273. package/lib/form/style/index.less +5 -5
  274. package/lib/grid-v4/col.js +10 -16
  275. package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
  276. package/lib/grid-v4/index.js +3 -3
  277. package/lib/grid-v4/row.js +24 -31
  278. package/lib/handle/index.js +3 -3
  279. package/lib/handle-icon/index.js +13 -13
  280. package/lib/icon/IconFont.js +3 -3
  281. package/lib/icon/components/Icon.js +44 -70
  282. package/lib/icon/components/index.js +3 -3
  283. package/lib/icon/components/utils.js +10 -18
  284. package/lib/icon/index.js +26 -33
  285. package/lib/icon/twoTonePrimaryColor.js +3 -3
  286. package/lib/icon/utils.js +3 -3
  287. package/lib/img/Contain.js +3 -3
  288. package/lib/img/Cover.js +17 -18
  289. package/lib/img/index.js +17 -18
  290. package/lib/index.d.ts +1 -0
  291. package/lib/index.d.ts.map +1 -1
  292. package/lib/index.js +10 -3
  293. package/lib/index.js.map +1 -1
  294. package/lib/input/input.js +10 -16
  295. package/lib/input-number/inputNumber.js +3 -3
  296. package/lib/label/index.js +10 -16
  297. package/lib/loading-button/index.js +17 -18
  298. package/lib/locale/default.js +3 -3
  299. package/lib/locale/en_US.js +3 -3
  300. package/lib/locale/zh_CN.js +3 -3
  301. package/lib/modal/modal.js +3 -3
  302. package/lib/notification/assets/index.js +3 -3
  303. package/lib/notification/index.js +3 -3
  304. package/lib/notification/notification.js +3 -3
  305. package/lib/page/Box.js +3 -3
  306. package/lib/page/index.js +26 -33
  307. package/lib/page-container/index.js +3 -3
  308. package/lib/page-loading/index.js +3 -3
  309. package/lib/popconfirm/popconfirm.js +3 -3
  310. package/lib/popover/popover.js +3 -3
  311. package/lib/preview-text/index.js +9 -9
  312. package/lib/progress/progress.js +10 -16
  313. package/lib/query-form/Field/Checkbox.js +4 -4
  314. package/lib/query-form/Field/Checkbox.js.map +1 -1
  315. package/lib/query-form/Field/Composition/FieldPopover.js +46 -8
  316. package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -1
  317. package/lib/query-form/Field/Composition/SelectInput.d.ts +3 -0
  318. package/lib/query-form/Field/Composition/SelectInput.d.ts.map +1 -0
  319. package/lib/query-form/Field/Composition/SelectInput.js +111 -0
  320. package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
  321. package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -1
  322. package/lib/query-form/Field/Composition/ValueTag.js +6 -3
  323. package/lib/query-form/Field/Composition/ValueTag.js.map +1 -1
  324. package/lib/query-form/Field/Composition/index.d.ts +2 -0
  325. package/lib/query-form/Field/Composition/index.js +32 -16
  326. package/lib/query-form/Field/Composition/index.js.map +1 -1
  327. package/lib/query-form/Field/Composition/index.less +4 -4
  328. package/lib/query-form/Field/Composition/utils.d.ts +1 -1
  329. package/lib/query-form/Field/Composition/utils.d.ts.map +1 -1
  330. package/lib/query-form/Field/Composition/utils.js +47 -46
  331. package/lib/query-form/Field/Composition/utils.js.map +1 -1
  332. package/lib/query-form/Field/Select.js +24 -31
  333. package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
  334. package/lib/query-form/Field/SelectInput.js +44 -40
  335. package/lib/query-form/Field/SelectInput.js.map +1 -1
  336. package/lib/query-form/Field/fieldsMap.d.ts +6 -3
  337. package/lib/query-form/Field/fieldsMap.d.ts.map +1 -1
  338. package/lib/query-form/Field/fieldsMap.js +5 -5
  339. package/lib/query-form/Field/fieldsMap.js.map +1 -1
  340. package/lib/query-form/Field/index.d.ts.map +1 -1
  341. package/lib/query-form/Field/index.js +49 -73
  342. package/lib/query-form/Field/index.js.map +1 -1
  343. package/lib/query-form/createActions.js +3 -3
  344. package/lib/query-form/index.d.ts +1 -36
  345. package/lib/query-form/index.d.ts.map +1 -1
  346. package/lib/query-form/index.js +271 -432
  347. package/lib/query-form/index.js.map +1 -1
  348. package/lib/query-form/index.less +26 -60
  349. package/lib/query-form/useForm.js +3 -3
  350. package/lib/query-list-scene/List.d.ts.map +1 -1
  351. package/lib/query-list-scene/List.js +57 -64
  352. package/lib/query-list-scene/List.js.map +1 -1
  353. package/lib/query-list-scene/QueryForm.d.ts +5 -4
  354. package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
  355. package/lib/query-list-scene/QueryForm.js +72 -70
  356. package/lib/query-list-scene/QueryForm.js.map +1 -1
  357. package/lib/query-list-scene/QueryListScene.js +44 -70
  358. package/lib/query-list-scene/Title.js +3 -3
  359. package/lib/query-list-scene/Toolbar.js +10 -16
  360. package/lib/query-list-scene/createActions.js +3 -3
  361. package/lib/query-list-scene/index.d.ts.map +1 -1
  362. package/lib/query-list-scene/index.js +5 -4
  363. package/lib/query-list-scene/index.js.map +1 -1
  364. package/lib/query-list-scene/useActions.js +3 -3
  365. package/lib/radio/radio.js +3 -3
  366. package/lib/render-empty/render-empty.js +3 -3
  367. package/lib/segmented/index.d.ts +1 -1
  368. package/lib/segmented/index.js +10 -16
  369. package/lib/select/select.js +10 -16
  370. package/lib/spin/spin.js +3 -3
  371. package/lib/steps/steps.js +10 -16
  372. package/lib/svg-components/index.js +3 -3
  373. package/lib/table/hooks/use-column-setting.d.ts +1 -0
  374. package/lib/table/hooks/use-column-setting.d.ts.map +1 -1
  375. package/lib/table/hooks/use-column-setting.js +14 -15
  376. package/lib/table/hooks/use-column-setting.js.map +1 -1
  377. package/lib/table/hooks/use-expand-fixed.js +30 -36
  378. package/lib/table/resizableTable/index.d.ts +3 -0
  379. package/lib/table/resizableTable/index.d.ts.map +1 -1
  380. package/lib/table/resizableTable/index.js +58 -36
  381. package/lib/table/resizableTable/index.js.map +1 -1
  382. package/lib/table/resizableTable/index.less +9 -1
  383. package/lib/table/table-hoc.js +3 -3
  384. package/lib/table/table.d.ts.map +1 -1
  385. package/lib/table/table.js +35 -36
  386. package/lib/table/table.js.map +1 -1
  387. package/lib/table/table.stories.js +10 -16
  388. package/lib/table/utils.js +3 -3
  389. package/lib/table-container/index.js +3 -3
  390. package/lib/tabs/tabs.js +10 -16
  391. package/lib/tabs-container/index.js +3 -3
  392. package/lib/tag/tag.js +10 -16
  393. package/lib/time-picker/TimePicker.js +3 -3
  394. package/lib/time-picker/index.js +3 -3
  395. package/lib/title/index.js +3 -3
  396. package/lib/tntd-action/Action.js +21 -22
  397. package/lib/tntd-action/index.js +20 -21
  398. package/lib/tntd-cascader/AntdCascader/component/context.js +3 -3
  399. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +3 -3
  400. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +3 -3
  401. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +10 -16
  402. package/lib/tntd-cascader/AntdCascader/config/utils.js +10 -16
  403. package/lib/tntd-cascader/AntdCascader/index.js +26 -33
  404. package/lib/tntd-cascader/index.js +3 -3
  405. package/lib/tntd-cascader/rc-cascader/Cascader.js +23 -24
  406. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +10 -16
  407. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +26 -33
  408. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +30 -37
  409. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +17 -18
  410. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +23 -24
  411. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +16 -17
  412. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
  413. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +23 -30
  414. package/lib/tntd-cascader/rc-cascader/index.js +3 -3
  415. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +6 -6
  416. package/lib/tntd-form/ErrorList.js +26 -33
  417. package/lib/tntd-form/Form.js +24 -31
  418. package/lib/tntd-form/FormItem/ItemHolder.js +24 -31
  419. package/lib/tntd-form/FormItem/index.js +23 -24
  420. package/lib/tntd-form/FormItemInput.js +3 -3
  421. package/lib/tntd-form/FormItemLabel.js +10 -16
  422. package/lib/tntd-form/FormList.js +3 -3
  423. package/lib/tntd-form/context.js +3 -3
  424. package/lib/tntd-form/hooks/useDebounce.js +14 -15
  425. package/lib/tntd-form/hooks/useForm.js +17 -18
  426. package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
  427. package/lib/tntd-form/hooks/useFrameState.js +17 -18
  428. package/lib/tntd-form/index.js +3 -3
  429. package/lib/tntd-icon/index.js +3 -3
  430. package/lib/tntd-layout/AppList.js +20 -24
  431. package/lib/tntd-layout/Application.js +20 -24
  432. package/lib/tntd-layout/Avatar.js +6 -9
  433. package/lib/tntd-layout/CompatibleLanguage.js +20 -24
  434. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +6 -9
  435. package/lib/tntd-layout/EnterpriseLayout/Language.js +20 -24
  436. package/lib/tntd-layout/EnterpriseLayout/Theme.js +20 -24
  437. package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
  438. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +20 -24
  439. package/lib/tntd-layout/GlobalNavigation/index.js +26 -30
  440. package/lib/tntd-layout/Header.js +6 -9
  441. package/lib/tntd-layout/HeaderActions.js +6 -9
  442. package/lib/tntd-layout/HeaderNavs.js +20 -24
  443. package/lib/tntd-layout/HeaderTabs.js +27 -37
  444. package/lib/tntd-layout/Iconfont.js +3 -3
  445. package/lib/tntd-layout/Language.js +20 -24
  446. package/lib/tntd-layout/Layout.js +20 -24
  447. package/lib/tntd-layout/Logo.js +6 -9
  448. package/lib/tntd-layout/OrgAppList.js +20 -24
  449. package/lib/tntd-layout/SideMenu.js +20 -24
  450. package/lib/tntd-layout/Theme.js +20 -24
  451. package/lib/tntd-layout/createActions.js +3 -3
  452. package/lib/tntd-layout/images/index.js +3 -3
  453. package/lib/tntd-layout/index.js +3 -3
  454. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +20 -24
  455. package/lib/tntd-layout/paaslayout/Header.js +6 -9
  456. package/lib/tntd-layout/paaslayout/Logo.js +6 -9
  457. package/lib/tntd-layout/paaslayout/SideMenu.js +20 -24
  458. package/lib/tntd-layout/paaslayout/index.js +20 -24
  459. package/lib/tntd-layout/storage.js +3 -3
  460. package/lib/tntd-modal/index.js +24 -31
  461. package/lib/tntd-rc-select/_util/PurePanel.js +17 -18
  462. package/lib/tntd-rc-select/_util/context.js +3 -3
  463. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +3 -3
  464. package/lib/tntd-rc-select/_util/getIcons.js +3 -3
  465. package/lib/tntd-rc-select/_util/useCompactItemContext.js +10 -16
  466. package/lib/tntd-rc-select/index.js +10 -16
  467. package/lib/tntd-reference/AHref/index.js +3 -3
  468. package/lib/tntd-reference/ReferenceBatchCheck/index.js +3 -3
  469. package/lib/tntd-reference/ReferenceBatchDrawer/index.js +17 -18
  470. package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
  471. package/lib/tntd-reference/ReferenceDrawer/index.js +17 -18
  472. package/lib/tntd-reference/ReferenceInfo/index.js +3 -3
  473. package/lib/tntd-reference/index.js +3 -3
  474. package/lib/tntd-second-page/index.js +3 -3
  475. package/lib/tntd-select/DropDownWrap.js +34 -54
  476. package/lib/tntd-select/index.d.ts.map +1 -1
  477. package/lib/tntd-select/index.js +40 -57
  478. package/lib/tntd-select/index.js.map +1 -1
  479. package/lib/tntd-virtual-tree/index.js +23 -27
  480. package/lib/tntd-virtual-tree/index.js.map +1 -1
  481. package/lib/tntd-virtual-tree/utils.js +62 -66
  482. package/lib/tntd-virtual-tree-select/index.js +22 -23
  483. package/lib/tntd-virtual-tree-select/utils.js +20 -21
  484. package/lib/tooltip/tooltip.js +3 -3
  485. package/lib/upload/index.js +41 -45
  486. package/lib/upload/svg/UploadSVG.js +3 -3
  487. package/lib/utils/checkAuth.js +6 -6
  488. package/lib/utils/index.js +20 -21
  489. package/lib/utils/lang.js +5 -5
  490. package/lib/water-mark/index.js +17 -18
  491. package/package.json +3 -2
  492. package/CHANGELOG.json +0 -1034
  493. package/CHANGELOG.md +0 -605
  494. package/es/checkbox/checkbox-group.js +0 -16
  495. package/es/checkbox/checkbox-group.js.map +0 -1
  496. package/es/radio/radio-group.js +0 -16
  497. package/es/radio/radio-group.js.map +0 -1
  498. package/es/steps/stepStyle/small.less +0 -5
  499. package/es/table/total-shower.js +0 -20
  500. package/es/table/total-shower.js.map +0 -1
  501. package/es/utils/simple-template.js +0 -19
  502. package/es/utils/simple-template.js.map +0 -1
  503. package/lib/checkbox/checkbox-group.d.ts +0 -8
  504. package/lib/checkbox/checkbox-group.d.ts.map +0 -1
  505. package/lib/checkbox/checkbox-group.js +0 -16
  506. package/lib/checkbox/checkbox-group.js.map +0 -1
  507. package/lib/radio/radio-group.d.ts +0 -8
  508. package/lib/radio/radio-group.d.ts.map +0 -1
  509. package/lib/radio/radio-group.js +0 -16
  510. package/lib/radio/radio-group.js.map +0 -1
  511. package/lib/steps/stepStyle/small.less +0 -5
  512. package/lib/table/total-shower.d.ts +0 -9
  513. package/lib/table/total-shower.d.ts.map +0 -1
  514. package/lib/table/total-shower.js +0 -20
  515. package/lib/table/total-shower.js.map +0 -1
  516. package/lib/utils/simple-template.d.ts +0 -9
  517. package/lib/utils/simple-template.d.ts.map +0 -1
  518. package/lib/utils/simple-template.js +0 -19
  519. package/lib/utils/simple-template.js.map +0 -1
@@ -5,386 +5,255 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports["default"] = void 0;
8
- var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
9
- var _classnames3 = _interopRequireDefault(require("classnames"));
8
+ var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
10
9
  var _react = _interopRequireWildcard(require("react"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _Composition = _interopRequireDefault(require("./Field/Composition"));
12
+ var _form = _interopRequireDefault(require("../form"));
11
13
  var _createActions = _interopRequireDefault(require("./createActions"));
12
14
  var _Field = _interopRequireDefault(require("./Field"));
13
15
  var _useForm = _interopRequireDefault(require("./useForm"));
14
- var _badge = _interopRequireDefault(require("../badge"));
15
- var _button = _interopRequireDefault(require("../button"));
16
- var _drawer = _interopRequireDefault(require("../drawer"));
17
- var _form = _interopRequireDefault(require("../form"));
18
- var _prevLocale = require("../prev-locale");
19
- var _tntdIcon = _interopRequireDefault(require("../tntd-icon"));
20
16
  require("./index.less");
21
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
24
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
27
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
20
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
28
21
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
29
22
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
30
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
31
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
32
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
24
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
26
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
27
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
28
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // import Button from '../button'
29
+ // import { getLanguage, getText } from '../prev-locale'
37
30
  var clsPrefix = 'tnt-queryform';
38
- var QueryForm = /*#__PURE__*/function (_React$PureComponent) {
39
- function QueryForm(props) {
40
- var _this;
41
- _classCallCheck(this, QueryForm);
42
- _this = _callSuper(this, QueryForm, [props]);
43
- Object.defineProperty(_this, "onWindowResize", {
44
- enumerable: true,
45
- configurable: true,
46
- writable: true,
47
- value: (0, _debounce2["default"])(function () {
48
- var current = _this.fieldsRef.current;
49
- if (current) {
50
- setTimeout(function () {
51
- _this.setState({
52
- showMore: _this.isFieldsWidthOverflow()
53
- });
54
- }, 25);
31
+ var QueryForm = (0, _react.forwardRef)(function (_ref, ref) {
32
+ var form = _ref.form,
33
+ _ref$className = _ref.className,
34
+ className = _ref$className === void 0 ? '' : _ref$className,
35
+ _initialValues = _ref.initialValues,
36
+ language = _ref.language,
37
+ onSearch = _ref.onSearch,
38
+ onReset = _ref.onReset,
39
+ hasOnChange = _ref.hasOnChange,
40
+ onChange = _ref.onChange,
41
+ renderActions = _ref.renderActions,
42
+ extraActions = _ref.extraActions,
43
+ children = _ref.children,
44
+ _ref$showSearch = _ref.showSearch,
45
+ showSearch = _ref$showSearch === void 0 ? false : _ref$showSearch,
46
+ _ref$showReset = _ref.showReset,
47
+ showReset = _ref$showReset === void 0 ? false : _ref$showReset,
48
+ _ref$showFieldCount = _ref.showFieldCount,
49
+ showFieldCount = _ref$showFieldCount === void 0 ? 3 : _ref$showFieldCount,
50
+ _ref$minGroupCount = _ref.minGroupCount,
51
+ minGroupCount = _ref$minGroupCount === void 0 ? 3 : _ref$minGroupCount,
52
+ _ref$compositionShowR = _ref.compositionShowReset,
53
+ compositionShowReset = _ref$compositionShowR === void 0 ? true : _ref$compositionShowR,
54
+ inline = _ref.inline,
55
+ defaultSearchField = _ref.defaultSearchField,
56
+ defaultSearchPlaceholder = _ref.defaultSearchPlaceholder;
57
+ var _useState = (0, _react.useState)(_initialValues || {}),
58
+ _useState2 = _slicedToArray(_useState, 2),
59
+ initialValues = _useState2[0],
60
+ setInitialValues = _useState2[1];
61
+ var formRef = (0, _react.useRef)(form || (0, _createActions["default"])());
62
+ (0, _react.useImperativeHandle)(ref, function () {
63
+ return {
64
+ form: formRef.current
65
+ };
66
+ }, []);
67
+ (0, _react.useEffect)(function () {
68
+ var _search = function _search() {
69
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
70
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(Object.assign(Object.assign({}, formRef.current.getValues()), params));
71
+ };
72
+ formRef.current.setData('initialValues', initialValues);
73
+ formRef.current.setData('values', initialValues);
74
+ formRef.current.on('search', _search);
75
+ return function () {
76
+ formRef.current.off('search', _search);
77
+ };
78
+ }, []);
79
+ // const _getText = (key) => {
80
+ // return getText(key, language || getLanguage())
81
+ // }
82
+ var _onSearch = function _onSearch() {
83
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(formRef.current.getValues());
84
+ };
85
+ var _onReset = function _onReset() {
86
+ formRef.current.setValues(Object.assign({}, initialValues));
87
+ onReset === null || onReset === void 0 ? void 0 : onReset(initialValues);
88
+ setInitialValues(Object.assign({}, initialValues));
89
+ };
90
+ var _onFieldChange = function _onFieldChange(name, value) {
91
+ var values = formRef.current.getValues();
92
+ var newValues = Object.assign(Object.assign({}, values), _defineProperty({}, name, value));
93
+ var changedInfo = {
94
+ name: name,
95
+ value: value,
96
+ preValue: values === null || values === void 0 ? void 0 : values[name]
97
+ };
98
+ formRef.current.setData('values', newValues);
99
+ for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
100
+ rest[_key - 2] = arguments[_key];
101
+ }
102
+ onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
103
+ };
104
+ var _onCompositionFieldChange = function _onCompositionFieldChange(value, deleteKeys, needSearch, isReset) {
105
+ var values = formRef.current.getValues();
106
+ var newValues = Object.assign(Object.assign({}, values), value);
107
+ var changeKeys = Object.keys(newValues);
108
+ if (deleteKeys === null || deleteKeys === void 0 ? void 0 : deleteKeys.length) {
109
+ deleteKeys === null || deleteKeys === void 0 ? void 0 : deleteKeys.forEach(function (key) {
110
+ if ((values === null || values === void 0 ? void 0 : values[key]) || (values === null || values === void 0 ? void 0 : values[key]) === 0 || (values === null || values === void 0 ? void 0 : values[key]) === false) {
111
+ delete newValues[key];
55
112
  }
56
- }, 50)
57
- });
58
- Object.defineProperty(_this, "search", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: function value(params) {
63
- _this.props.onSearch(Object.assign(Object.assign({}, _this.form.getValues()), params));
64
- }
65
- });
66
- Object.defineProperty(_this, "onSearch", {
67
- enumerable: true,
68
- configurable: true,
69
- writable: true,
70
- value: function value() {
71
- var _a, _b;
72
- (_b = (_a = _this.props).onSearch) === null || _b === void 0 ? void 0 : _b.call(_a, _this.form.getValues());
73
- }
74
- });
75
- Object.defineProperty(_this, "onReset", {
76
- enumerable: true,
77
- configurable: true,
78
- writable: true,
79
- value: function value() {
80
- var _this$props = _this.props,
81
- initialValues = _this$props.initialValues,
82
- onReset = _this$props.onReset;
83
- _this.form.setValues(Object.assign({}, initialValues));
84
- _this.updateDrawerFieldsValueCount();
85
- onReset === null || onReset === void 0 ? void 0 : onReset(initialValues);
86
- }
87
- });
88
- Object.defineProperty(_this, "onToggleExpand", {
89
- enumerable: true,
90
- configurable: true,
91
- writable: true,
92
- value: function value() {
93
- var _a, _b;
94
- _this.setState({
95
- expanded: !_this.state.expanded
96
- });
97
- (_b = (_a = _this.props).onToggleExpand) === null || _b === void 0 ? void 0 : _b.call(_a, !_this.state.expanded);
98
- }
99
- });
100
- Object.defineProperty(_this, "onShowDrawer", {
101
- enumerable: true,
102
- configurable: true,
103
- writable: true,
104
- value: function value() {
105
- _this.setState({
106
- drawerVisible: true
113
+ });
114
+ }
115
+ formRef.current.setData('values', newValues);
116
+ if (isReset) {
117
+ return;
118
+ } else if ((deleteKeys === null || deleteKeys === void 0 ? void 0 : deleteKeys.length) === 1) {
119
+ // 删除一定要搜索
120
+ if (onSearch) {
121
+ onSearch(newValues, true);
122
+ } else {
123
+ onChange(newValues, {
124
+ name: deleteKeys[0]
107
125
  });
108
126
  }
109
- });
110
- Object.defineProperty(_this, "onFieldChange", {
111
- enumerable: true,
112
- configurable: true,
113
- writable: true,
114
- value: function value(name, _value) {
115
- var values = _this.form.getValues();
116
- var newValues = Object.assign(Object.assign({}, values), _defineProperty({}, name, _value));
117
- var changedInfo = {
118
- name: name,
119
- value: _value,
120
- preValue: values === null || values === void 0 ? void 0 : values[name]
121
- };
122
- var onChange = _this.props.onChange;
123
- _this.form.setData('values', newValues);
124
- for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
125
- rest[_key - 2] = arguments[_key];
126
- }
127
- onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
128
- _this.updateDrawerFieldsValueCount(newValues);
129
- }
130
- });
131
- Object.defineProperty(_this, "updateDrawerFieldsValueCount", {
132
- enumerable: true,
133
- configurable: true,
134
- writable: true,
135
- value: function value() {
136
- var values = _this.form.getValues();
137
- var _this$props2 = _this.props,
138
- showFieldCount = _this$props2.showFieldCount,
139
- children = _this$props2.children;
140
- if (showFieldCount) {
141
- var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {
142
- var _a;
143
- if (index >= showFieldCount && (values === null || values === void 0 ? void 0 : values[(_a = cur === null || cur === void 0 ? void 0 : cur.props) === null || _a === void 0 ? void 0 : _a.name])) {
144
- acc++;
145
- }
146
- return acc;
147
- }, 0);
148
- if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {
149
- _this.setState({
150
- drawerFieldsValueCount: drawerFieldsValueCount
151
- });
152
- }
153
- }
154
- }
155
- });
156
- Object.defineProperty(_this, "addResizeListener", {
157
- enumerable: true,
158
- configurable: true,
159
- writable: true,
160
- value: function value() {
161
- if ('ResizeObserver' in window) {
162
- var current = _this.fieldsRef.current;
163
- if (current) {
164
- var observer = new ResizeObserver(_this.onWindowResize);
165
- observer.observe(current);
166
- return function () {
167
- return observer.disconnect();
168
- };
169
- }
170
- } else {
171
- window.addEventListener('resize', _this.onWindowResize);
172
- return function () {
173
- return window.removeEventListener('resize', _this.onWindowResize);
127
+ } else if (needSearch && !hasOnChange) {
128
+ formRef.current.emit('search', Object.assign(Object.assign({}, newValues), {
129
+ current: 1
130
+ }));
131
+ } else if (onChange) {
132
+ changeKeys.forEach(function (key) {
133
+ if (JSON.stringify(value[key]) !== JSON.stringify(values[key])) {
134
+ var changedInfo = {
135
+ name: key,
136
+ value: value[key],
137
+ preValue: values === null || values === void 0 ? void 0 : values[key]
174
138
  };
139
+ onChange(newValues, changedInfo);
175
140
  }
176
- }
177
- });
178
- var form = props.form,
179
- initialValues = props.initialValues,
180
- _props$showExpand = props.showExpand,
181
- showExpand = _props$showExpand === void 0 ? true : _props$showExpand,
182
- renderActions = props.renderActions,
183
- defaultExpanded = props.defaultExpanded;
184
- _this.state = {
185
- showMore: false,
186
- expanded: defaultExpanded || !showExpand || renderActions ? true : false,
187
- drawerVisible: false,
188
- drawerFieldsValueCount: 0
189
- };
190
- _this.fieldsRef = (0, _react.createRef)();
191
- _this.formBoxRef = (0, _react.createRef)();
192
- _this.form = form || (0, _createActions["default"])();
193
- _this.form.setData('initialValues', initialValues);
194
- _this.form.setData('values', Object.assign({}, initialValues));
195
- return _this;
196
- }
197
- _inherits(QueryForm, _React$PureComponent);
198
- return _createClass(QueryForm, [{
199
- key: "render",
200
- value: function render() {
201
- var _this2 = this;
202
- var _this$props3 = this.props,
203
- children = _this$props3.children,
204
- _this$props3$classNam = _this$props3.className,
205
- className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
206
- _this$props3$initialV = _this$props3.initialValues,
207
- initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,
208
- renderActions = _this$props3.renderActions,
209
- _this$props3$showSear = _this$props3.showSearch,
210
- showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,
211
- _this$props3$showRese = _this$props3.showReset,
212
- showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,
213
- showFieldCount = _this$props3.showFieldCount,
214
- _this$props3$drawerPr = _this$props3.drawerProps,
215
- drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,
216
- size = _this$props3.size;
217
- var extraActions = this.props.extraActions;
218
- var _this$state = this.state,
219
- expanded = _this$state.expanded,
220
- showMore = _this$state.showMore,
221
- drawerVisible = _this$state.drawerVisible,
222
- drawerFieldsValueCount = _this$state.drawerFieldsValueCount;
223
- var renderFormActions = renderActions || function () {
224
- return _react["default"].createElement(_react["default"].Fragment, null, showFieldCount && _react["default"].createElement(_badge["default"], {
225
- count: drawerFieldsValueCount
226
- }, _react["default"].createElement(_button["default"], {
227
- onClick: _this2.onShowDrawer
228
- }, _react["default"].createElement(_tntdIcon["default"], {
229
- type: "filter"
230
- }), _this2.getText('moreFiltering'))), showSearch && _react["default"].createElement(_button["default"], {
231
- type: "primary",
232
- onClick: _this2.onSearch
233
- }, _this2.getText('search')), showReset && _react["default"].createElement(_button["default"], {
234
- onClick: _this2.onReset
235
- }, _this2.getText('reset')), showMore && !showFieldCount && _react["default"].createElement(_button["default"], {
236
- className: "expand-link",
237
- type: "link",
238
- onClick: _this2.onToggleExpand
239
- }, _this2.getText(expanded ? 'collapse' : 'expand')), _react["default"].Children.map(children, function (child) {
240
- var _a;
241
- return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) === 'right' && _react["default"].cloneElement(child);
242
- }));
243
- };
244
- return _react["default"].createElement("div", {
245
- ref: this.formBoxRef,
246
- className: (0, _classnames3["default"])(clsPrefix, _defineProperty({}, className, className))
247
- }, _react["default"].createElement(_form["default"], {
248
- layout: "inline",
249
- className: (0, _classnames3["default"])({
250
- expanded: !showMore || expanded,
251
- showMore: showMore
252
- })
253
- }, _react["default"].createElement("div", {
254
- ref: this.fieldsRef
255
- }, _react["default"].Children.map(children, function (child, index) {
256
- var _a, _b;
257
- return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) !== 'right' && (!showFieldCount || showFieldCount > index) && _react["default"].cloneElement(child, {
258
- form: _this2.form,
259
- initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[(_b = child.props) === null || _b === void 0 ? void 0 : _b.name],
260
- onChange: _this2.onFieldChange
261
- });
262
- })), _react["default"].createElement("div", {
263
- className: "".concat(clsPrefix, "-actions")
264
- }, renderFormActions()), showFieldCount && _react["default"].createElement(_drawer["default"], Object.assign({
265
- title: this.getText('moreFiltering'),
266
- visible: drawerVisible,
267
- onClose: function onClose() {
268
- return _this2.setState({
269
- drawerVisible: false
270
- });
271
- },
272
- width: 300,
273
- size: size,
274
- getContainer: false
275
- }, drawerProps, {
276
- className: (0, _classnames3["default"])("".concat(clsPrefix, "-drawer"), _defineProperty({
277
- 'large-size': size === 'large'
278
- }, className, className))
279
- }), _react["default"].Children.map(children, function (child, index) {
280
- return child && index >= showFieldCount && _react["default"].cloneElement(child, {
281
- form: _this2.form,
282
- isFieldInDrawer: true,
283
- initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[child.props.name],
284
- onChange: _this2.onFieldChange,
285
- onSearch: _this2.onSearch
286
- });
287
- }), _react["default"].createElement(_button["default"], {
288
- type: "primary",
289
- onClick: this.onSearch
290
- }, this.getText('search')), _react["default"].createElement(_button["default"], {
291
- onClick: this.onReset
292
- }, this.getText('reset')))), extraActions && _react["default"].createElement("div", {
293
- className: "".concat(clsPrefix, "-extra")
294
- }, extraActions));
295
- }
296
- }, {
297
- key: "getText",
298
- value: function getText(key) {
299
- return (0, _prevLocale.getText)(key, this.props.language || (0, _prevLocale.getLanguage)());
300
- }
301
- }, {
302
- key: "isFieldsWidthOverflow",
303
- value: function isFieldsWidthOverflow() {
304
- var current = this.fieldsRef.current;
305
- if (current) {
306
- return parseFloat(window.getComputedStyle(current).width, 10) < [].reduce.call(current.children, function (acc, cur) {
307
- var _window$getComputedSt = window.getComputedStyle(cur),
308
- margin = _window$getComputedSt.margin,
309
- width = _window$getComputedSt.width;
310
- var marginArray = margin.split(' ').map(function (str) {
311
- return parseFloat(str, 10);
312
- });
313
- acc += parseFloat(width, 10) + marginArray[1];
314
- return acc;
315
- }, 0);
316
- }
317
- return false;
141
+ });
318
142
  }
319
- }, {
320
- key: "updateFieldHeight",
321
- value: function updateFieldHeight() {
322
- var _a, _b, _c;
323
- var formBoxRef = this.formBoxRef,
324
- fieldsRef = this.fieldsRef;
325
- var getFieldHeight = function getFieldHeight() {
326
- var _a;
327
- var current = fieldsRef.current;
328
- var height = '32px';
329
- if (current && ((_a = current.children) === null || _a === void 0 ? void 0 : _a[0])) {
330
- height = window.getComputedStyle(current.children[0]).height;
143
+ };
144
+ var _useMemo = (0, _react.useMemo)(function () {
145
+ var _a;
146
+ var groupFields = [];
147
+ var outFields = [];
148
+ var otherFields = [];
149
+ var rightChildren = [];
150
+ var compositionInitValues = {};
151
+ _react["default"].Children.map(children, function (child) {
152
+ var _a, _b;
153
+ if (child) {
154
+ if (((_a = child.props) === null || _a === void 0 ? void 0 : _a.align) === 'right') {
155
+ rightChildren.push(child);
156
+ return;
157
+ } else if (((_b = child.props) === null || _b === void 0 ? void 0 : _b.isGroup) === false) {
158
+ outFields.push(child);
159
+ } else {
160
+ groupFields.push(child);
161
+ }
162
+ otherFields.push(child);
331
163
  }
332
- return height;
333
- };
334
- var queryFormActionsDom = (_a = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(".".concat(clsPrefix, "-actions"));
335
- var queryFormExtraDom = (_b = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _b === void 0 ? void 0 : _b.querySelector(".".concat(clsPrefix, "-extra"));
336
- var formItemsDomList = (_c = fieldsRef === null || fieldsRef === void 0 ? void 0 : fieldsRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('.ant-form-item-control');
337
- var fieldHeight = getFieldHeight();
338
- fieldsRef.current.style.height = fieldHeight;
339
- [queryFormActionsDom, queryFormExtraDom].forEach(function (item) {
340
- item && Object.assign(item.style, {
341
- height: fieldHeight,
342
- lineHeight: fieldHeight
343
- });
344
- });
345
- [].forEach.call(formItemsDomList, function (item) {
346
- item.style.lineHeight = fieldHeight;
347
164
  });
348
- }
349
- }, {
350
- key: "componentDidMount",
351
- value: function componentDidMount() {
352
- var current = this.fieldsRef.current;
353
- var _this$props4 = this.props,
354
- showFieldCount = _this$props4.showFieldCount,
355
- _this$props4$showExpa = _this$props4.showExpand,
356
- showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa;
357
- this.updateFieldHeight();
358
- this.form.on('search', this.search);
359
- // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
360
- // || renderActions
361
- if (!showFieldCount && !showExpand) {
362
- return;
165
+ if (groupFields.length <= minGroupCount) {
166
+ groupFields = [];
167
+ outFields = otherFields;
168
+ } else {
169
+ // 初始值
170
+ for (var i = 0; i < groupFields.length; i++) {
171
+ var name = (_a = groupFields[i].props) === null || _a === void 0 ? void 0 : _a.name;
172
+ if (initialValues[name] !== undefined) {
173
+ compositionInitValues[name] = initialValues[name];
174
+ }
175
+ }
363
176
  }
364
- if (!showFieldCount) {
365
- if (current && this.isFieldsWidthOverflow()) {
366
- this.setState({
367
- showMore: true
177
+ return [(0, _flatten2["default"])(groupFields.map(function (it) {
178
+ if (it.props.type === 'selectInput') {
179
+ var _ref2 = it.props || {},
180
+ _name = _ref2.name,
181
+ props = _ref2.props;
182
+ var _ref3 = props || {},
183
+ _ref3$options = _ref3.options,
184
+ options = _ref3$options === void 0 ? [] : _ref3$options;
185
+ return options.map(function (_ref4) {
186
+ var label = _ref4.label,
187
+ value = _ref4.value;
188
+ return {
189
+ props: {
190
+ pName: _name,
191
+ cName: value,
192
+ name: "".concat(_name, ".").concat(value),
193
+ title: label,
194
+ type: 'otherInput',
195
+ props: {}
196
+ }
197
+ };
368
198
  });
199
+ } else {
200
+ return it;
369
201
  }
370
- this.removeResizeListener = this.addResizeListener();
371
- } else {
372
- this.updateDrawerFieldsValueCount();
373
- this.form.on('setValues', this.updateDrawerFieldsValueCount);
374
- this.form.on('setValue', this.updateDrawerFieldsValueCount);
375
- }
376
- }
377
- }, {
378
- key: "componentWillUnmount",
379
- value: function componentWillUnmount() {
380
- var _a;
381
- (_a = this.removeResizeListener) === null || _a === void 0 ? void 0 : _a.call(this);
382
- this.form.off('setValues', this.updateDrawerFieldsValueCount);
383
- this.form.off('setValue', this.updateDrawerFieldsValueCount);
384
- this.form.off('search', this.search);
385
- }
386
- }]);
387
- }(_react["default"].PureComponent);
202
+ })), outFields, rightChildren, Object.keys(compositionInitValues).length > 0 ? compositionInitValues : undefined];
203
+ }, [children, minGroupCount, initialValues]),
204
+ _useMemo2 = _slicedToArray(_useMemo, 4),
205
+ groupFields = _useMemo2[0],
206
+ outFields = _useMemo2[1],
207
+ rightChildren = _useMemo2[2],
208
+ compositionInitValues = _useMemo2[3];
209
+ var isGroupMode = groupFields.length > 0;
210
+ var hasOutField = outFields.length > 0;
211
+ var showExtra = rightChildren.length > 0 || extraActions;
212
+ console.log(groupFields);
213
+ return _react["default"].createElement("div", {
214
+ className: (0, _classnames["default"])(clsPrefix, className, _defineProperty({}, "".concat(clsPrefix, "-inline"), inline))
215
+ }, _react["default"].createElement(_form["default"], {
216
+ layout: "inline"
217
+ }, _react["default"].createElement("div", {
218
+ className: "".concat(clsPrefix, "-top")
219
+ }, _react["default"].createElement("div", {
220
+ className: "".concat(clsPrefix, "-top-body")
221
+ }, outFields.map(function (child, i) {
222
+ var _a;
223
+ return _react["default"].cloneElement(child, {
224
+ form: formRef.current,
225
+ initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[(_a = child.props) === null || _a === void 0 ? void 0 : _a.name],
226
+ onChange: _onFieldChange,
227
+ key: i
228
+ });
229
+ }), isGroupMode && (!hasOutField || inline) && _react["default"].createElement(_Composition["default"], {
230
+ clsPrefix: clsPrefix,
231
+ fieldItems: groupFields,
232
+ initialValues: compositionInitValues,
233
+ _onReset: _onReset,
234
+ _onSearch: _onSearch,
235
+ onChange: _onCompositionFieldChange,
236
+ form: formRef.current,
237
+ compositionShowReset: compositionShowReset,
238
+ defaultSearchField: defaultSearchField,
239
+ defaultSearchPlaceholder: defaultSearchPlaceholder
240
+ }), renderActions ? renderActions() : _react["default"].createElement(_react["default"].Fragment, null)), showExtra && _react["default"].createElement("div", {
241
+ className: "".concat(clsPrefix, "-extra")
242
+ }, rightChildren, extraActions)), isGroupMode && hasOutField && !inline && _react["default"].createElement("div", {
243
+ className: "".concat(clsPrefix, "-bottom")
244
+ }, _react["default"].createElement(_Composition["default"], {
245
+ clsPrefix: clsPrefix,
246
+ fieldItems: groupFields,
247
+ initialValues: compositionInitValues,
248
+ _onReset: _onReset,
249
+ _onSearch: _onSearch,
250
+ onChange: _onCompositionFieldChange,
251
+ form: formRef.current,
252
+ compositionShowReset: compositionShowReset,
253
+ defaultSearchField: defaultSearchField,
254
+ defaultSearchPlaceholder: defaultSearchPlaceholder
255
+ }))));
256
+ });
388
257
  QueryForm.Field = _Field["default"];
389
258
  QueryForm.useForm = _useForm["default"];
390
259
  QueryForm.createForm = _createActions["default"];