tntd 2.8.45 → 2.8.47

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 (569) 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/hooks/useScrollLock.js +4 -4
  6. package/es/_util/responsiveObserve.js +1 -1
  7. package/es/_util/styleChecker.js +1 -1
  8. package/es/actions/index.js +1 -1
  9. package/es/alert/alert.js +147 -0
  10. package/es/alert/alert.js.map +1 -0
  11. package/es/alert/alert.less +128 -0
  12. package/es/anchor/anchor.js +5 -5
  13. package/es/array-input/index.js +9 -9
  14. package/es/cascader/cascader.js +84 -0
  15. package/es/cascader/cascader.js.map +1 -0
  16. package/es/cascader/cascader.less +16 -0
  17. package/es/check-card/group.js +8 -8
  18. package/es/check-card/index.js +6 -6
  19. package/es/checkbox/check.png +0 -0
  20. package/es/checkbox/checkbox-group.js +1 -1
  21. package/es/checkbox/checkbox.js +100 -0
  22. package/es/checkbox/checkbox.js.map +1 -0
  23. package/es/checkbox/checkbox.less +69 -0
  24. package/es/color-picker/ColorPicker.js +6 -6
  25. package/es/color-picker/index.js +1 -1
  26. package/es/columns/index.js +1 -1
  27. package/es/config-provider/config-provider.js +1 -1
  28. package/es/date-picker/DatePicker.js +163 -0
  29. package/es/date-picker/DatePicker.js.map +1 -0
  30. package/es/date-picker/index.less +294 -0
  31. package/es/descriptions/descriptions.js +5 -5
  32. package/es/development-login/LoginModal.js +6 -6
  33. package/es/development-login/index.js +4 -4
  34. package/es/drawer/drawer.js +2 -2
  35. package/es/ellipsis/Svg/CopySVG.js +1 -1
  36. package/es/ellipsis/Svg/TickSVG.js +1 -1
  37. package/es/ellipsis/index.js +5 -5
  38. package/es/empty/empty.js +2 -2
  39. package/es/empty/empty.stories.js +2 -2
  40. package/es/exception/exception.js +1 -1
  41. package/es/form/form.js +2 -2
  42. package/es/grid-v4/col.js +2 -2
  43. package/es/grid-v4/hooks/useBreakpoint.js +1 -1
  44. package/es/grid-v4/index.js +1 -1
  45. package/es/grid-v4/row.js +6 -6
  46. package/es/handle/index.js +1 -1
  47. package/es/handle-icon/index.js +8 -8
  48. package/es/icon/IconFont.js +1 -1
  49. package/es/icon/components/Icon.js +9 -9
  50. package/es/icon/components/index.js +1 -1
  51. package/es/icon/components/utils.js +3 -3
  52. package/es/icon/index.js +7 -7
  53. package/es/icon/twoTonePrimaryColor.js +1 -1
  54. package/es/icon/utils.js +1 -1
  55. package/es/img/Contain.js +1 -1
  56. package/es/img/Cover.js +5 -5
  57. package/es/img/index.js +5 -5
  58. package/es/index.js +1 -1
  59. package/es/input/input.js +2 -2
  60. package/es/input-number/index.js +1 -1
  61. package/es/input-number/inputNumber.js +89 -0
  62. package/es/input-number/inputNumber.js.map +1 -0
  63. package/es/input-number/inputNumber.less +12 -0
  64. package/es/label/index.js +2 -2
  65. package/es/loading-button/index.js +5 -5
  66. package/es/locale/default.js +1 -1
  67. package/es/locale/en_US.js +1 -1
  68. package/es/locale/zh_CN.js +1 -1
  69. package/es/modal/index.less +52 -0
  70. package/es/modal/modal.js +6 -4
  71. package/es/modal/modal.js.map +1 -1
  72. package/es/modal/style/modal.less +16 -0
  73. package/es/notification/assets/index.js +1 -1
  74. package/es/notification/index.js +1 -1
  75. package/es/notification/notification.js +1 -1
  76. package/es/page/Box.js +1 -1
  77. package/es/page/index.js +7 -7
  78. package/es/page-container/index.js +1 -1
  79. package/es/page-loading/index.js +1 -1
  80. package/es/popconfirm/index.less +32 -0
  81. package/es/popconfirm/popconfirm.js +96 -0
  82. package/es/popconfirm/popconfirm.js.map +1 -0
  83. package/es/popover/index.less +57 -0
  84. package/es/popover/popover.js +90 -0
  85. package/es/popover/popover.js.map +1 -0
  86. package/es/preview-text/index.js +7 -7
  87. package/es/progress/progress.js +179 -0
  88. package/es/progress/progress.js.map +1 -0
  89. package/es/progress/progress.less +82 -0
  90. package/es/query-form/Field/Checkbox.js +1 -1
  91. package/es/query-form/Field/Composition/FieldPopover.js +466 -0
  92. package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
  93. package/es/query-form/Field/Composition/FieldPopover.less +41 -0
  94. package/es/query-form/Field/Composition/Select.js +260 -0
  95. package/es/query-form/Field/Composition/Select.js.map +1 -0
  96. package/es/query-form/Field/Composition/SelectInput.js +112 -0
  97. package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
  98. package/es/query-form/Field/Composition/ValueTag.js +241 -0
  99. package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
  100. package/es/query-form/Field/Composition/index.js +448 -0
  101. package/es/query-form/Field/Composition/index.js.map +1 -0
  102. package/es/query-form/Field/Composition/index.less +167 -0
  103. package/es/query-form/Field/Composition/utils.js +173 -0
  104. package/es/query-form/Field/Composition/utils.js.map +1 -0
  105. package/es/query-form/Field/Select.js +6 -6
  106. package/es/query-form/Field/SelectInput.js +6 -6
  107. package/es/query-form/Field/fieldsMap.js +1 -1
  108. package/es/query-form/Field/index.js +10 -10
  109. package/es/query-form/createActions.js +1 -1
  110. package/es/query-form/index.js +10 -10
  111. package/es/query-form/useForm.js +1 -1
  112. package/es/query-form-backup/Field/Composition/FieldPopover.less +35 -0
  113. package/es/query-form-backup/Field/Composition/index.less +114 -0
  114. package/es/query-form-backup/index.less +90 -0
  115. package/es/query-form-v2/index.less +133 -0
  116. package/es/query-list-scene/List.js +13 -13
  117. package/es/query-list-scene/QueryForm.js +10 -10
  118. package/es/query-list-scene/QueryListScene.js +10 -10
  119. package/es/query-list-scene/Title.js +1 -1
  120. package/es/query-list-scene/Toolbar.js +2 -2
  121. package/es/query-list-scene/createActions.js +1 -1
  122. package/es/query-list-scene/index.js +1 -1
  123. package/es/query-list-scene/useActions.js +1 -1
  124. package/es/radio/index.js +1 -1
  125. package/es/radio/radio-group.js +1 -1
  126. package/es/radio/radio.js +110 -0
  127. package/es/radio/radio.js.map +1 -0
  128. package/es/radio/radio.less +43 -0
  129. package/es/render-empty/render-empty.js +1 -1
  130. package/es/scroll-bar/Bar.js +5 -5
  131. package/es/scroll-bar/Context.js +1 -1
  132. package/es/scroll-bar/ScrollBar.js +1 -1
  133. package/es/scroll-bar/Thumb.js +5 -5
  134. package/es/scroll-bar/index.js +1 -1
  135. package/es/scroll-bar/util.js +1 -1
  136. package/es/segmented/index.js +2 -2
  137. package/es/select/select.js +2 -2
  138. package/es/spin/spin.js +79 -0
  139. package/es/spin/spin.js.map +1 -0
  140. package/es/spin/spin.less +9 -0
  141. package/es/steps/assets/background_left.svg +12 -0
  142. package/es/steps/assets/background_right.svg +12 -0
  143. package/es/steps/assets/horizontal_line.svg +3 -0
  144. package/es/steps/assets/vertical_line.svg +3 -0
  145. package/es/steps/stepStyle/icon.less +51 -0
  146. package/es/steps/stepStyle/progress-dot.less +10 -0
  147. package/es/steps/stepStyle/variables.less +8 -0
  148. package/es/steps/stepStyle/vertical.less +41 -0
  149. package/es/steps/steps.js +2 -2
  150. package/es/svg-components/index.js +1 -1
  151. package/es/switch/index.less +45 -0
  152. package/es/switch/switch.js +1 -1
  153. package/es/table/hooks/use-column-setting.js +4 -4
  154. package/es/table/hooks/use-expand-fixed.js +6 -6
  155. package/es/table/resizableTable/index.js +6 -6
  156. package/es/table/table-hoc.js +1 -1
  157. package/es/table/table.js +9 -9
  158. package/es/table/table.stories.js +2 -2
  159. package/es/table/total-shower.js +1 -1
  160. package/es/table/utils.js +1 -1
  161. package/es/table-container/index.js +1 -1
  162. package/es/tabs/tabs.less +125 -0
  163. package/es/tabs-container/index.js +1 -1
  164. package/es/tag/tag.js +2 -2
  165. package/es/time-picker/TimePicker.js +90 -0
  166. package/es/time-picker/TimePicker.js.map +1 -0
  167. package/es/time-picker/index.less +38 -0
  168. package/es/title/index.js +1 -1
  169. package/es/tntd-action/Action.js +218 -0
  170. package/es/tntd-action/Action.js.map +1 -0
  171. package/es/tntd-action/index.less +61 -0
  172. package/es/tntd-cascader/AntdCascader/component/context.js +1 -1
  173. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  174. package/es/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
  175. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
  176. package/es/tntd-cascader/AntdCascader/config/utils.js +2 -2
  177. package/es/tntd-cascader/AntdCascader/index.js +7 -7
  178. package/es/tntd-cascader/index.js +1 -1
  179. package/es/tntd-cascader/rc-cascader/Cascader.js +8 -8
  180. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
  181. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
  182. package/es/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
  183. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
  184. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
  185. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
  186. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
  187. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
  188. package/es/tntd-cascader/rc-cascader/index.js +1 -1
  189. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
  190. package/es/tntd-form/ErrorList.js +7 -7
  191. package/es/tntd-form/Form.js +6 -6
  192. package/es/tntd-form/FormItem/ItemHolder.js +6 -6
  193. package/es/tntd-form/FormItem/index.js +8 -8
  194. package/es/tntd-form/FormItemInput.js +1 -1
  195. package/es/tntd-form/FormItemLabel.js +2 -2
  196. package/es/tntd-form/FormList.js +1 -1
  197. package/es/tntd-form/context.js +1 -1
  198. package/es/tntd-form/hooks/useDebounce.js +4 -4
  199. package/es/tntd-form/hooks/useForm.js +5 -5
  200. package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
  201. package/es/tntd-form/hooks/useFrameState.js +5 -5
  202. package/es/tntd-form/index.js +1 -1
  203. package/es/tntd-icon/index.js +1 -1
  204. package/es/tntd-layout/AppList.js +6 -6
  205. package/es/tntd-layout/Application.js +6 -6
  206. package/es/tntd-layout/Avatar.js +2 -2
  207. package/es/tntd-layout/CompatibleLanguage.js +6 -6
  208. package/es/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
  209. package/es/tntd-layout/EnterpriseLayout/Language.js +6 -6
  210. package/es/tntd-layout/EnterpriseLayout/Theme.js +6 -6
  211. package/es/tntd-layout/EnterpriseLayout/index.js +1 -1
  212. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
  213. package/es/tntd-layout/GlobalNavigation/index.js +9 -9
  214. package/es/tntd-layout/Header.js +2 -2
  215. package/es/tntd-layout/HeaderActions.js +2 -2
  216. package/es/tntd-layout/HeaderNavs.js +6 -6
  217. package/es/tntd-layout/HeaderTabs.js +7 -7
  218. package/es/tntd-layout/Iconfont.js +1 -1
  219. package/es/tntd-layout/Language.js +6 -6
  220. package/es/tntd-layout/Layout.js +6 -6
  221. package/es/tntd-layout/Logo.js +2 -2
  222. package/es/tntd-layout/OrgAppList.js +6 -6
  223. package/es/tntd-layout/SideMenu.js +6 -6
  224. package/es/tntd-layout/Theme.js +6 -6
  225. package/es/tntd-layout/createActions.js +1 -1
  226. package/es/tntd-layout/images/index.js +1 -1
  227. package/es/tntd-layout/index.js +1 -1
  228. package/es/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
  229. package/es/tntd-layout/paaslayout/Header.js +2 -2
  230. package/es/tntd-layout/paaslayout/Logo.js +2 -2
  231. package/es/tntd-layout/paaslayout/SideMenu.js +6 -6
  232. package/es/tntd-layout/paaslayout/index.js +6 -6
  233. package/es/tntd-layout/storage.js +1 -1
  234. package/es/tntd-modal/index.js +6 -6
  235. package/es/tntd-rc-select/_util/PurePanel.js +5 -5
  236. package/es/tntd-rc-select/_util/context.js +1 -1
  237. package/es/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
  238. package/es/tntd-rc-select/_util/getIcons.js +1 -1
  239. package/es/tntd-rc-select/_util/useCompactItemContext.js +2 -2
  240. package/es/tntd-rc-select/index.js +2 -2
  241. package/es/tntd-reference/AHref/index.js +1 -1
  242. package/es/tntd-reference/ReferenceBatchCheck/index.js +1 -1
  243. package/es/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
  244. package/es/tntd-reference/ReferenceCheck/index.js +1 -1
  245. package/es/tntd-reference/ReferenceDrawer/index.js +5 -5
  246. package/es/tntd-reference/ReferenceInfo/index.js +1 -1
  247. package/es/tntd-reference/index.js +1 -1
  248. package/es/tntd-second-page/index.js +1 -1
  249. package/es/tntd-select/DropDownWrap.js +8 -8
  250. package/es/tntd-select/index.js +10 -9
  251. package/es/tntd-select/index.less +7 -0
  252. package/es/tntd-virtual-tree/index.js +8 -8
  253. package/es/tntd-virtual-tree/utils.js +28 -28
  254. package/es/tntd-virtual-tree-select/index.js +10 -10
  255. package/es/tntd-virtual-tree-select/utils.js +9 -9
  256. package/es/tooltip/tooltip.js +1 -1
  257. package/es/upload/index.js +6 -6
  258. package/es/upload/svg/UploadSVG.js +1 -1
  259. package/es/utils/checkAuth.js +4 -4
  260. package/es/utils/index.js +9 -9
  261. package/es/utils/lang.js +1 -1
  262. package/es/water-mark/index.js +5 -5
  263. package/lib/_util/context.js +3 -3
  264. package/lib/_util/defaultRenderEmpty.js +3 -3
  265. package/lib/_util/hooks/useFlexGapSupport.js +14 -15
  266. package/lib/_util/hooks/useForceUpdate.js +14 -15
  267. package/lib/_util/hooks/useScrollLock.js +14 -15
  268. package/lib/_util/responsiveObserve.js +7 -13
  269. package/lib/_util/styleChecker.js +3 -3
  270. package/lib/actions/index.js +3 -3
  271. package/lib/alert/alert.d.ts +12 -0
  272. package/lib/alert/alert.d.ts.map +1 -0
  273. package/lib/alert/alert.js +147 -0
  274. package/lib/alert/alert.js.map +1 -0
  275. package/lib/alert/alert.less +128 -0
  276. package/lib/anchor/anchor.js +17 -18
  277. package/lib/array-input/index.js +30 -37
  278. package/lib/cascader/cascader.d.ts +10 -0
  279. package/lib/cascader/cascader.d.ts.map +1 -0
  280. package/lib/cascader/cascader.js +84 -0
  281. package/lib/cascader/cascader.js.map +1 -0
  282. package/lib/cascader/cascader.less +16 -0
  283. package/lib/check-card/group.js +23 -24
  284. package/lib/check-card/index.js +24 -31
  285. package/lib/checkbox/check.png +0 -0
  286. package/lib/checkbox/checkbox-group.js +3 -3
  287. package/lib/checkbox/checkbox.d.ts +16 -0
  288. package/lib/checkbox/checkbox.d.ts.map +1 -0
  289. package/lib/checkbox/checkbox.js +100 -0
  290. package/lib/checkbox/checkbox.js.map +1 -0
  291. package/lib/checkbox/checkbox.less +69 -0
  292. package/lib/color-picker/ColorPicker.js +24 -31
  293. package/lib/color-picker/index.js +3 -3
  294. package/lib/columns/index.js +3 -3
  295. package/lib/config-provider/config-provider.js +3 -3
  296. package/lib/date-picker/DatePicker.d.ts +21 -0
  297. package/lib/date-picker/DatePicker.d.ts.map +1 -0
  298. package/lib/date-picker/DatePicker.js +163 -0
  299. package/lib/date-picker/DatePicker.js.map +1 -0
  300. package/lib/date-picker/index.less +294 -0
  301. package/lib/descriptions/descriptions.js +13 -19
  302. package/lib/development-login/LoginModal.js +24 -31
  303. package/lib/development-login/index.js +14 -15
  304. package/lib/drawer/drawer.js +10 -16
  305. package/lib/ellipsis/Svg/CopySVG.js +3 -3
  306. package/lib/ellipsis/Svg/TickSVG.js +3 -3
  307. package/lib/ellipsis/index.js +17 -18
  308. package/lib/empty/empty.js +10 -16
  309. package/lib/empty/empty.stories.js +6 -9
  310. package/lib/exception/exception.js +3 -3
  311. package/lib/form/form.js +10 -16
  312. package/lib/grid-v4/col.js +10 -16
  313. package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
  314. package/lib/grid-v4/index.js +3 -3
  315. package/lib/grid-v4/row.js +24 -31
  316. package/lib/handle/index.js +3 -3
  317. package/lib/handle-icon/index.js +10 -10
  318. package/lib/icon/IconFont.js +3 -3
  319. package/lib/icon/components/Icon.js +44 -70
  320. package/lib/icon/components/index.js +3 -3
  321. package/lib/icon/components/utils.js +10 -18
  322. package/lib/icon/index.js +26 -33
  323. package/lib/icon/twoTonePrimaryColor.js +3 -3
  324. package/lib/icon/utils.js +3 -3
  325. package/lib/img/Contain.js +3 -3
  326. package/lib/img/Cover.js +17 -18
  327. package/lib/img/index.js +17 -18
  328. package/lib/index.js +3 -3
  329. package/lib/input/input.js +10 -16
  330. package/lib/input-number/index.js +3 -3
  331. package/lib/input-number/inputNumber.d.ts +10 -0
  332. package/lib/input-number/inputNumber.d.ts.map +1 -0
  333. package/lib/input-number/inputNumber.js +89 -0
  334. package/lib/input-number/inputNumber.js.map +1 -0
  335. package/lib/input-number/inputNumber.less +12 -0
  336. package/lib/label/index.js +10 -16
  337. package/lib/loading-button/index.js +17 -18
  338. package/lib/locale/default.js +3 -3
  339. package/lib/locale/en_US.js +3 -3
  340. package/lib/locale/zh_CN.js +3 -3
  341. package/lib/modal/index.less +52 -0
  342. package/lib/modal/modal.d.ts +1 -0
  343. package/lib/modal/modal.d.ts.map +1 -1
  344. package/lib/modal/modal.js +8 -6
  345. package/lib/modal/modal.js.map +1 -1
  346. package/lib/modal/style/modal.less +16 -0
  347. package/lib/notification/assets/index.js +3 -3
  348. package/lib/notification/index.js +3 -3
  349. package/lib/notification/notification.js +3 -3
  350. package/lib/page/Box.js +3 -3
  351. package/lib/page/index.js +26 -33
  352. package/lib/page-container/index.js +3 -3
  353. package/lib/page-loading/index.js +3 -3
  354. package/lib/popconfirm/index.less +32 -0
  355. package/lib/popconfirm/popconfirm.d.ts +8 -0
  356. package/lib/popconfirm/popconfirm.d.ts.map +1 -0
  357. package/lib/popconfirm/popconfirm.js +96 -0
  358. package/lib/popconfirm/popconfirm.js.map +1 -0
  359. package/lib/popover/index.less +57 -0
  360. package/lib/popover/popover.d.ts +14 -0
  361. package/lib/popover/popover.d.ts.map +1 -0
  362. package/lib/popover/popover.js +90 -0
  363. package/lib/popover/popover.js.map +1 -0
  364. package/lib/preview-text/index.js +9 -9
  365. package/lib/progress/progress.d.ts +12 -0
  366. package/lib/progress/progress.d.ts.map +1 -0
  367. package/lib/progress/progress.js +179 -0
  368. package/lib/progress/progress.js.map +1 -0
  369. package/lib/progress/progress.less +82 -0
  370. package/lib/query-form/Field/Checkbox.js +3 -3
  371. package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
  372. package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
  373. package/lib/query-form/Field/Composition/FieldPopover.js +466 -0
  374. package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
  375. package/lib/query-form/Field/Composition/FieldPopover.less +41 -0
  376. package/lib/query-form/Field/Composition/Select.d.ts +4 -0
  377. package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
  378. package/lib/query-form/Field/Composition/Select.js +260 -0
  379. package/lib/query-form/Field/Composition/Select.js.map +1 -0
  380. package/lib/query-form/Field/Composition/SelectInput.d.ts +3 -0
  381. package/lib/query-form/Field/Composition/SelectInput.d.ts.map +1 -0
  382. package/lib/query-form/Field/Composition/SelectInput.js +112 -0
  383. package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
  384. package/lib/query-form/Field/Composition/ValueTag.d.ts +13 -0
  385. package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -0
  386. package/lib/query-form/Field/Composition/ValueTag.js +241 -0
  387. package/lib/query-form/Field/Composition/ValueTag.js.map +1 -0
  388. package/lib/query-form/Field/Composition/index.d.ts +15 -0
  389. package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
  390. package/lib/query-form/Field/Composition/index.js +448 -0
  391. package/lib/query-form/Field/Composition/index.js.map +1 -0
  392. package/lib/query-form/Field/Composition/index.less +167 -0
  393. package/lib/query-form/Field/Composition/utils.d.ts +21 -0
  394. package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
  395. package/lib/query-form/Field/Composition/utils.js +173 -0
  396. package/lib/query-form/Field/Composition/utils.js.map +1 -0
  397. package/lib/query-form/Field/Select.js +24 -31
  398. package/lib/query-form/Field/SelectInput.js +24 -31
  399. package/lib/query-form/Field/fieldsMap.js +3 -3
  400. package/lib/query-form/Field/index.js +47 -73
  401. package/lib/query-form/createActions.js +3 -3
  402. package/lib/query-form/index.js +44 -70
  403. package/lib/query-form/useForm.js +3 -3
  404. package/lib/query-form-backup/Field/Composition/FieldPopover.less +35 -0
  405. package/lib/query-form-backup/Field/Composition/index.less +114 -0
  406. package/lib/query-form-backup/index.less +90 -0
  407. package/lib/query-form-v2/index.less +133 -0
  408. package/lib/query-list-scene/List.js +41 -61
  409. package/lib/query-list-scene/QueryForm.js +44 -70
  410. package/lib/query-list-scene/QueryListScene.js +44 -70
  411. package/lib/query-list-scene/Title.js +3 -3
  412. package/lib/query-list-scene/Toolbar.js +10 -16
  413. package/lib/query-list-scene/createActions.js +3 -3
  414. package/lib/query-list-scene/index.js +3 -3
  415. package/lib/query-list-scene/useActions.js +3 -3
  416. package/lib/radio/index.js +3 -3
  417. package/lib/radio/radio-group.js +3 -3
  418. package/lib/radio/radio.d.ts +17 -0
  419. package/lib/radio/radio.d.ts.map +1 -0
  420. package/lib/radio/radio.js +110 -0
  421. package/lib/radio/radio.js.map +1 -0
  422. package/lib/radio/radio.less +43 -0
  423. package/lib/render-empty/render-empty.js +3 -3
  424. package/lib/scroll-bar/Bar.js +17 -18
  425. package/lib/scroll-bar/Context.js +3 -3
  426. package/lib/scroll-bar/ScrollBar.js +3 -3
  427. package/lib/scroll-bar/Thumb.js +17 -18
  428. package/lib/scroll-bar/index.js +3 -3
  429. package/lib/scroll-bar/util.js +7 -13
  430. package/lib/segmented/index.js +10 -16
  431. package/lib/select/select.js +10 -16
  432. package/lib/spin/spin.d.ts +9 -0
  433. package/lib/spin/spin.d.ts.map +1 -0
  434. package/lib/spin/spin.js +79 -0
  435. package/lib/spin/spin.js.map +1 -0
  436. package/lib/spin/spin.less +9 -0
  437. package/lib/steps/assets/background_left.svg +12 -0
  438. package/lib/steps/assets/background_right.svg +12 -0
  439. package/lib/steps/assets/horizontal_line.svg +3 -0
  440. package/lib/steps/assets/vertical_line.svg +3 -0
  441. package/lib/steps/stepStyle/icon.less +51 -0
  442. package/lib/steps/stepStyle/progress-dot.less +10 -0
  443. package/lib/steps/stepStyle/variables.less +8 -0
  444. package/lib/steps/stepStyle/vertical.less +41 -0
  445. package/lib/steps/steps.js +10 -16
  446. package/lib/svg-components/index.js +3 -3
  447. package/lib/switch/index.less +45 -0
  448. package/lib/switch/switch.js +3 -3
  449. package/lib/table/hooks/use-column-setting.js +14 -15
  450. package/lib/table/hooks/use-expand-fixed.js +30 -36
  451. package/lib/table/resizableTable/index.js +24 -31
  452. package/lib/table/table-hoc.js +3 -3
  453. package/lib/table/table.js +27 -34
  454. package/lib/table/table.stories.js +10 -16
  455. package/lib/table/total-shower.js +3 -3
  456. package/lib/table/utils.js +3 -3
  457. package/lib/table-container/index.js +3 -3
  458. package/lib/tabs/tabs.less +125 -0
  459. package/lib/tabs-container/index.js +3 -3
  460. package/lib/tag/tag.js +10 -16
  461. package/lib/time-picker/TimePicker.d.ts +9 -0
  462. package/lib/time-picker/TimePicker.d.ts.map +1 -0
  463. package/lib/time-picker/TimePicker.js +90 -0
  464. package/lib/time-picker/TimePicker.js.map +1 -0
  465. package/lib/time-picker/index.less +38 -0
  466. package/lib/title/index.js +3 -3
  467. package/lib/tntd-action/Action.d.ts +6 -0
  468. package/lib/tntd-action/Action.d.ts.map +1 -0
  469. package/lib/tntd-action/Action.js +218 -0
  470. package/lib/tntd-action/Action.js.map +1 -0
  471. package/lib/tntd-action/index.less +61 -0
  472. package/lib/tntd-cascader/AntdCascader/component/context.js +3 -3
  473. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +3 -3
  474. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +3 -3
  475. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +10 -16
  476. package/lib/tntd-cascader/AntdCascader/config/utils.js +10 -16
  477. package/lib/tntd-cascader/AntdCascader/index.js +26 -33
  478. package/lib/tntd-cascader/index.js +3 -3
  479. package/lib/tntd-cascader/rc-cascader/Cascader.js +23 -24
  480. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +10 -16
  481. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +26 -33
  482. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +30 -37
  483. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +17 -18
  484. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +23 -24
  485. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +16 -17
  486. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
  487. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +23 -30
  488. package/lib/tntd-cascader/rc-cascader/index.js +3 -3
  489. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +6 -6
  490. package/lib/tntd-form/ErrorList.js +26 -33
  491. package/lib/tntd-form/Form.js +24 -31
  492. package/lib/tntd-form/FormItem/ItemHolder.js +24 -31
  493. package/lib/tntd-form/FormItem/index.js +23 -24
  494. package/lib/tntd-form/FormItemInput.js +3 -3
  495. package/lib/tntd-form/FormItemLabel.js +10 -16
  496. package/lib/tntd-form/FormList.js +3 -3
  497. package/lib/tntd-form/context.js +3 -3
  498. package/lib/tntd-form/hooks/useDebounce.js +14 -15
  499. package/lib/tntd-form/hooks/useForm.js +17 -18
  500. package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
  501. package/lib/tntd-form/hooks/useFrameState.js +17 -18
  502. package/lib/tntd-form/index.js +3 -3
  503. package/lib/tntd-icon/index.js +3 -3
  504. package/lib/tntd-layout/AppList.js +20 -24
  505. package/lib/tntd-layout/Application.js +20 -24
  506. package/lib/tntd-layout/Avatar.js +6 -9
  507. package/lib/tntd-layout/CompatibleLanguage.js +20 -24
  508. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +6 -9
  509. package/lib/tntd-layout/EnterpriseLayout/Language.js +20 -24
  510. package/lib/tntd-layout/EnterpriseLayout/Theme.js +20 -24
  511. package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
  512. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +20 -24
  513. package/lib/tntd-layout/GlobalNavigation/index.js +26 -30
  514. package/lib/tntd-layout/Header.js +6 -9
  515. package/lib/tntd-layout/HeaderActions.js +6 -9
  516. package/lib/tntd-layout/HeaderNavs.js +20 -24
  517. package/lib/tntd-layout/HeaderTabs.js +27 -37
  518. package/lib/tntd-layout/Iconfont.js +3 -3
  519. package/lib/tntd-layout/Language.js +20 -24
  520. package/lib/tntd-layout/Layout.js +20 -24
  521. package/lib/tntd-layout/Logo.js +6 -9
  522. package/lib/tntd-layout/OrgAppList.js +20 -24
  523. package/lib/tntd-layout/SideMenu.js +20 -24
  524. package/lib/tntd-layout/Theme.js +20 -24
  525. package/lib/tntd-layout/createActions.js +3 -3
  526. package/lib/tntd-layout/images/index.js +3 -3
  527. package/lib/tntd-layout/index.js +3 -3
  528. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +20 -24
  529. package/lib/tntd-layout/paaslayout/Header.js +6 -9
  530. package/lib/tntd-layout/paaslayout/Logo.js +6 -9
  531. package/lib/tntd-layout/paaslayout/SideMenu.js +20 -24
  532. package/lib/tntd-layout/paaslayout/index.js +20 -24
  533. package/lib/tntd-layout/storage.js +3 -3
  534. package/lib/tntd-modal/index.js +24 -31
  535. package/lib/tntd-rc-select/_util/PurePanel.js +17 -18
  536. package/lib/tntd-rc-select/_util/context.js +3 -3
  537. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +3 -3
  538. package/lib/tntd-rc-select/_util/getIcons.js +3 -3
  539. package/lib/tntd-rc-select/_util/useCompactItemContext.js +10 -16
  540. package/lib/tntd-rc-select/index.js +10 -16
  541. package/lib/tntd-reference/AHref/index.js +3 -3
  542. package/lib/tntd-reference/ReferenceBatchCheck/index.js +3 -3
  543. package/lib/tntd-reference/ReferenceBatchDrawer/index.js +17 -18
  544. package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
  545. package/lib/tntd-reference/ReferenceDrawer/index.js +17 -18
  546. package/lib/tntd-reference/ReferenceInfo/index.js +3 -3
  547. package/lib/tntd-reference/index.js +3 -3
  548. package/lib/tntd-second-page/index.js +3 -3
  549. package/lib/tntd-select/DropDownWrap.js +34 -54
  550. package/lib/tntd-select/index.js +40 -57
  551. package/lib/tntd-select/index.less +7 -0
  552. package/lib/tntd-virtual-tree/index.js +23 -24
  553. package/lib/tntd-virtual-tree/utils.js +62 -66
  554. package/lib/tntd-virtual-tree-select/index.js +22 -23
  555. package/lib/tntd-virtual-tree-select/utils.js +20 -21
  556. package/lib/tooltip/tooltip.js +3 -3
  557. package/lib/upload/index.js +41 -45
  558. package/lib/upload/svg/UploadSVG.js +3 -3
  559. package/lib/utils/checkAuth.js +6 -6
  560. package/lib/utils/index.js +20 -21
  561. package/lib/utils/lang.js +3 -3
  562. package/lib/water-mark/index.js +17 -18
  563. package/package.json +2 -2
  564. package/es/array-input/utils.js +0 -414
  565. package/es/array-input/utils.js.map +0 -1
  566. package/lib/array-input/utils.d.ts +0 -2
  567. package/lib/array-input/utils.d.ts.map +0 -1
  568. package/lib/array-input/utils.js +0 -414
  569. package/lib/array-input/utils.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValueTag.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/ValueTag.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuC;AACvC,mCAAwC;AACxC,+DAAsC;AACtC,uDAA8B;AAC9B,6DAAoC;AACpC,gEAAuC;AACvC,sDAAgC;AAChC,mCAA2C;AAC3C,+BAA4B;AAE5B,SAAwB,QAAQ,CAAC,EAC/B,IAAI,EACJ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,SAAS,GACV;;IAC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E,KAAK,IAEZ,IAAA,gBAAQ,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAC/B,CACE,CACX,CAAA;AACH,CAAC;AAxID,2BAwIC","sourcesContent":["import React, { useState } from 'react'\nimport { find, cloneDeep } from 'lodash'\nimport Popover from '../../../popover'\nimport Tag from '../../../tag'\nimport fieldsMap from '../fieldsMap'\nimport SelectInput from './SelectInput'\nimport SelectOpt from './Select'\nimport { getLabel, isInput } from './utils'\nimport './FieldPopover.less'\n\nexport default function ValueTag({\n item,\n fieldItems,\n locale,\n onDelete,\n value,\n onChange,\n clsPrefix,\n form,\n handleTag,\n}) {\n const [visible, setVisible] = useState()\n\n const propItem = find(fieldItems, (it) => it.props?.name === item.key)?.props || {}\n const {\n name,\n propsTitle,\n title,\n type = 'input',\n className,\n component,\n props: fieldProps,\n closable = true,\n } = propItem\n\n const handleVisibleChange = (visible) => {\n setVisible(visible)\n }\n\n const close = () => {\n setVisible(false)\n }\n\n const onFieldChange = (...args) => {\n const copyValue = cloneDeep(value)\n const index = copyValue.findIndex((v) => v.key === name)\n copyValue[index].value = args[0]\n if (['date', 'checkbox'].includes(type) || (type === 'dateRange' && args[1]?.[1])) {\n close()\n }\n onChange(copyValue, false, args[0] !== undefined, type !== 'selectInput')\n fieldProps?.onChange && fieldProps.onChange(copyValue[index].value)\n }\n\n const onSelectChange = (v, isMultiple) => {\n const copyValue = cloneDeep(value || [])\n let index = copyValue.findIndex((v) => v.key === name)\n if (isMultiple) {\n if (!copyValue[index]?.value?.length) {\n copyValue[index].value = [v?.value]\n } else {\n if (copyValue[index].value?.indexOf(v.value) > -1) {\n copyValue[index].value = copyValue[index].value.filter((val) => val !== v.value)\n } else {\n copyValue[index].value.push(v.value)\n }\n }\n } else {\n copyValue[index].value = v?.value\n close()\n }\n onChange(copyValue, false, true)\n fieldProps?.onChange && fieldProps.onChange(copyValue[index].value)\n }\n\n const renderSecondOptions = () => {\n const isSelectInput = type === 'selectInput'\n const Field = isSelectInput ? SelectInput : component || fieldsMap[type] || (() => null)\n return (\n <div onClick={(e) => e.stopPropagation()} className={className}>\n <label>{propsTitle || title || name}</label>\n {type === 'select' ? (\n <SelectOpt\n {...fieldProps}\n propItem={propItem}\n onChange={onSelectChange}\n value={item?.value}\n showEmpty\n />\n ) : (\n <div\n className={`${clsPrefix}-field-popover-content`}\n onClick={(e) => e.stopPropagation()}\n >\n <Field\n form={form}\n value={item?.value}\n {...fieldProps}\n style={{\n ...fieldProps?.style,\n width: fieldProps?.style?.width || (isSelectInput ? '361px' : '250px'),\n }}\n close={close}\n onChange={onFieldChange}\n name={name}\n />\n </div>\n )}\n </div>\n )\n }\n\n const _isInput = isInput(type) && !component\n\n if (item?.value === undefined) {\n return null\n }\n\n return (\n <Popover\n trigger=\"click\"\n visible={visible && !_isInput}\n onVisibleChange={handleVisibleChange}\n overlayClassName={`${clsPrefix}-field-popover`}\n content={renderSecondOptions()}\n placement=\"bottomLeft\"\n >\n <Tag\n closable={!(closable === false || fieldProps?.allowClear === false)}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n if (!_isInput) {\n setVisible(true)\n } else {\n handleTag(cloneDeep(item))\n }\n }}\n onClose={(e) => onDelete(item.key, e)}\n ellipsisOptions={{ widthLimit: '140px' }}\n border={false}\n >\n {getLabel(item, fieldItems, locale)}\n </Tag>\n </Popover>\n )\n}\n"]}
@@ -0,0 +1,15 @@
1
+ declare var _default: React.ForwardRefExoticComponent<{
2
+ fieldItems: any;
3
+ initialValues: any;
4
+ onChange: any;
5
+ form: any;
6
+ compositionShowReset: any;
7
+ defaultSearchField: any;
8
+ defaultSearchPlaceholder: any;
9
+ clsPrefix: any;
10
+ _onReset: any;
11
+ _onSearch: any;
12
+ } & React.RefAttributes<any>>;
13
+ export default _default;
14
+ import React from "react";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) {
4
+ "@babel/helpers - typeof";
5
+
6
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7
+ return typeof o;
8
+ } : function (o) {
9
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
+ }, _typeof(o);
11
+ }
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+ exports["default"] = void 0;
16
+ var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
17
+ var _find2 = _interopRequireDefault(require("lodash/find"));
18
+ var _react = _interopRequireWildcard(require("react"));
19
+ var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
20
+ var _icon = _interopRequireDefault(require("../../../icon"));
21
+ var _input = _interopRequireDefault(require("../../../input"));
22
+ var _FieldPopover = _interopRequireDefault(require("./FieldPopover"));
23
+ var _ValueTag = _interopRequireDefault(require("./ValueTag"));
24
+ var _utils = require("./utils");
25
+ require("./index.less");
26
+ function _getRequireWildcardCache(e) {
27
+ if ("function" != typeof WeakMap) return null;
28
+ var r = new WeakMap(),
29
+ t = new WeakMap();
30
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
31
+ return e ? t : r;
32
+ })(e);
33
+ }
34
+ function _interopRequireWildcard(e, r) {
35
+ if (!r && e && e.__esModule) return e;
36
+ if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
37
+ "default": e
38
+ };
39
+ var t = _getRequireWildcardCache(r);
40
+ if (t && t.has(e)) return t.get(e);
41
+ var n = {
42
+ __proto__: null
43
+ },
44
+ a = Object.defineProperty && Object.getOwnPropertyDescriptor;
45
+ for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
46
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
47
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
48
+ }
49
+ return n["default"] = e, t && t.set(e, n), n;
50
+ }
51
+ function _interopRequireDefault(obj) {
52
+ return obj && obj.__esModule ? obj : {
53
+ "default": obj
54
+ };
55
+ }
56
+ function _toConsumableArray(arr) {
57
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
58
+ }
59
+ function _nonIterableSpread() {
60
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
61
+ }
62
+ function _iterableToArray(iter) {
63
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
64
+ }
65
+ function _arrayWithoutHoles(arr) {
66
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
67
+ }
68
+ function _defineProperty(obj, key, value) {
69
+ key = _toPropertyKey(key);
70
+ if (key in obj) {
71
+ Object.defineProperty(obj, key, {
72
+ value: value,
73
+ enumerable: true,
74
+ configurable: true,
75
+ writable: true
76
+ });
77
+ } else {
78
+ obj[key] = value;
79
+ }
80
+ return obj;
81
+ }
82
+ function _toPropertyKey(t) {
83
+ var i = _toPrimitive(t, "string");
84
+ return "symbol" == _typeof(i) ? i : i + "";
85
+ }
86
+ function _toPrimitive(t, r) {
87
+ if ("object" != _typeof(t) || !t) return t;
88
+ var e = t[Symbol.toPrimitive];
89
+ if (void 0 !== e) {
90
+ var i = e.call(t, r || "default");
91
+ if ("object" != _typeof(i)) return i;
92
+ throw new TypeError("@@toPrimitive must return a primitive value.");
93
+ }
94
+ return ("string" === r ? String : Number)(t);
95
+ }
96
+ function _slicedToArray(arr, i) {
97
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
98
+ }
99
+ function _nonIterableRest() {
100
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
101
+ }
102
+ function _unsupportedIterableToArray(o, minLen) {
103
+ if (!o) return;
104
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
105
+ var n = Object.prototype.toString.call(o).slice(8, -1);
106
+ if (n === "Object" && o.constructor) n = o.constructor.name;
107
+ if (n === "Map" || n === "Set") return Array.from(o);
108
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
109
+ }
110
+ function _arrayLikeToArray(arr, len) {
111
+ if (len == null || len > arr.length) len = arr.length;
112
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
113
+ return arr2;
114
+ }
115
+ function _iterableToArrayLimit(r, l) {
116
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
117
+ if (null != t) {
118
+ var e,
119
+ n,
120
+ i,
121
+ u,
122
+ a = [],
123
+ f = !0,
124
+ o = !1;
125
+ try {
126
+ if (i = (t = t.call(r)).next, 0 === l) {
127
+ if (Object(t) !== t) return;
128
+ f = !1;
129
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
130
+ } catch (r) {
131
+ o = !0, n = r;
132
+ } finally {
133
+ try {
134
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
135
+ } finally {
136
+ if (o) throw n;
137
+ }
138
+ }
139
+ return a;
140
+ }
141
+ }
142
+ function _arrayWithHoles(arr) {
143
+ if (Array.isArray(arr)) return arr;
144
+ }
145
+ /**
146
+ * @param value: [{
147
+ key: 'key1',
148
+ value: 'value1',
149
+ }, {
150
+ key: 'key2',
151
+ value: ['value2', 'value3']
152
+ }]
153
+ * @param {*} ref
154
+ * @returns
155
+ */
156
+ var regex = /^.+:.*$/;
157
+ var CompositionInput = function CompositionInput(_ref, ref) {
158
+ var fieldItems = _ref.fieldItems,
159
+ initialValues = _ref.initialValues,
160
+ onChange = _ref.onChange,
161
+ form = _ref.form,
162
+ compositionShowReset = _ref.compositionShowReset,
163
+ defaultSearchField = _ref.defaultSearchField,
164
+ defaultSearchPlaceholder = _ref.defaultSearchPlaceholder,
165
+ clsPrefix = _ref.clsPrefix,
166
+ _onReset = _ref._onReset,
167
+ _onSearch = _ref._onSearch;
168
+ var _a;
169
+ var prefix = "".concat(clsPrefix, "-composition-input");
170
+ var _useState = (0, _react.useState)((0, _utils.parseObjectToArray)(initialValues, fieldItems)),
171
+ _useState2 = _slicedToArray(_useState, 2),
172
+ value = _useState2[0],
173
+ setValue = _useState2[1];
174
+ var _useState3 = (0, _react.useState)(),
175
+ _useState4 = _slicedToArray(_useState3, 2),
176
+ tempItem = _useState4[0],
177
+ setTempItem = _useState4[1];
178
+ var _useState5 = (0, _react.useState)(''),
179
+ _useState6 = _slicedToArray(_useState5, 2),
180
+ searchText = _useState6[0],
181
+ setSearchText = _useState6[1];
182
+ var _useState7 = (0, _react.useState)(false),
183
+ _useState8 = _slicedToArray(_useState7, 2),
184
+ visible = _useState8[0],
185
+ setVisible = _useState8[1];
186
+ var _useState9 = (0, _react.useState)(undefined),
187
+ _useState10 = _slicedToArray(_useState9, 2),
188
+ fieldItem = _useState10[0],
189
+ setFieldItem = _useState10[1];
190
+ var fieldItemsRef = (0, _react.useRef)(fieldItems);
191
+ var _fieldItem = fieldItem ? ((_a = (0, _find2["default"])(fieldItems, function (f) {
192
+ var _a;
193
+ return ((_a = f.props) === null || _a === void 0 ? void 0 : _a.name) === fieldItem.name;
194
+ })) === null || _a === void 0 ? void 0 : _a.props) || fieldItem : {};
195
+ var _ref2 = fieldItem || {},
196
+ props = _ref2.props;
197
+ var inputRef = (0, _react.useRef)(null);
198
+ var widthRef = (0, _react.useRef)(null);
199
+ var fieldRef = (0, _react.useRef)(null);
200
+ var eventRef = (0, _react.useRef)(false);
201
+ fieldItemsRef.current = fieldItems;
202
+ var updateValues = (0, _react.useCallback)(function (obj) {
203
+ var newValueArr = (0, _utils.parseObjectToArray)(obj, fieldItemsRef.current);
204
+ setValue(newValueArr);
205
+ }, []);
206
+ var updateValue = (0, _react.useCallback)(function (name, value) {
207
+ updateValues(_defineProperty({}, name, value));
208
+ }, []);
209
+ if (!eventRef.current) {
210
+ eventRef.current = true;
211
+ form.on('setValue', updateValue);
212
+ form.on('setValues', updateValues);
213
+ }
214
+ (0, _react.useEffect)(function () {
215
+ return function () {
216
+ form.off('setValue', updateValue);
217
+ form.off('setValues', updateValues);
218
+ };
219
+ }, []);
220
+ var handleFocus = function handleFocus(e) {
221
+ e.preventDefault();
222
+ setTimeout(function () {
223
+ var _a;
224
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
225
+ }, 10);
226
+ if (!visible && !regex.test(searchText)) {
227
+ setVisible(true);
228
+ }
229
+ };
230
+ (0, _react.useImperativeHandle)(ref, function () {
231
+ return {
232
+ changeVal: function changeVal() {
233
+ return value;
234
+ }
235
+ };
236
+ });
237
+ var onClear = function onClear(e) {
238
+ e.stopPropagation();
239
+ var initKeys = Object.keys(initialValues || {});
240
+ var deleteKeys = value === null || value === void 0 ? void 0 : value.filter(function (_ref3) {
241
+ var key = _ref3.key;
242
+ return !initKeys.includes(key);
243
+ }).map(function (_ref4) {
244
+ var key = _ref4.key;
245
+ return key;
246
+ });
247
+ setValue((0, _utils.parseObjectToArray)(initialValues || {}, fieldItems));
248
+ onChange(Object.assign({}, initialValues || {}), deleteKeys, false, true);
249
+ // 清除其他数据
250
+ setSearchText('');
251
+ setTempItem();
252
+ _onReset();
253
+ };
254
+ var doSearch = function doSearch(e) {
255
+ var _a;
256
+ e.stopPropagation();
257
+ var inputValue = ((_a = searchText === null || searchText === void 0 ? void 0 : searchText.match(/[^:]+:(.*)/)) === null || _a === void 0 ? void 0 : _a[1]) || null;
258
+ if (tempItem && inputValue) {
259
+ if ((0, _isObject2["default"])(tempItem.value)) {
260
+ tempItem.value = _defineProperty({}, Object.keys(tempItem.value)[0], inputValue);
261
+ } else {
262
+ tempItem.value = inputValue; // 得到输入值
263
+ }
264
+ if (!(value === null || value === void 0 ? void 0 : value.find(function (v) {
265
+ return v.key === tempItem.key;
266
+ }))) {
267
+ var newValue = [].concat(_toConsumableArray(value), [tempItem]);
268
+ setValue(newValue);
269
+ onChange((0, _utils.parseArrayToObject)(newValue));
270
+ } else {
271
+ var _newValue = value.map(function (v) {
272
+ return v.key === tempItem.key ? tempItem : v;
273
+ });
274
+ setValue(_newValue);
275
+ onChange((0, _utils.parseArrayToObject)(_newValue));
276
+ }
277
+ e.target.value = tempItem.value;
278
+ form.emit('search', _defineProperty(_defineProperty({}, tempItem.key, tempItem.value), "current", 1));
279
+ setTempItem();
280
+ setSearchText('');
281
+ } else {
282
+ _onSearch();
283
+ }
284
+ };
285
+ var onDelete = function onDelete(key, e) {
286
+ var _a, _b;
287
+ e.preventDefault();
288
+ if (value.length > 0) {
289
+ var newValue = value.filter(function (v) {
290
+ return v.key !== key;
291
+ });
292
+ setValue(newValue);
293
+ var deleteKeys = [key];
294
+ onChange((0, _utils.parseArrayToObject)(newValue), deleteKeys, true);
295
+ // 删除的时候也触发Field的onChange -- 泳建提的需求
296
+ var fieldProps = (_a = (0, _find2["default"])(fieldItems, function (it) {
297
+ var _a;
298
+ return ((_a = it.props) === null || _a === void 0 ? void 0 : _a.name) === key;
299
+ })) === null || _a === void 0 ? void 0 : _a.props;
300
+ ((_b = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.props) === null || _b === void 0 ? void 0 : _b.onChange) && fieldProps.props.onChange(undefined);
301
+ }
302
+ };
303
+ var focusInput = function focusInput(value) {
304
+ var _a;
305
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
306
+ setSearchText((0, _utils.getLabel)(value, fieldItems));
307
+ setTempItem(value);
308
+ setTimeout(function () {
309
+ var _a;
310
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
311
+ }, 10);
312
+ };
313
+ var handleFieldChange = function handleFieldChange(value, isInput, hasValue) {
314
+ var needSearch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
315
+ if (isInput) {
316
+ focusInput(value);
317
+ return;
318
+ }
319
+ setValue(value);
320
+ setSearchText('');
321
+ setTempItem();
322
+ if (hasValue) onChange((0, _utils.parseArrayToObject)(value), undefined, needSearch);
323
+ };
324
+ // 输入框事件方法
325
+ var onInputChange = function onInputChange(e) {
326
+ var value = e.target.value;
327
+ if (tempItem) {
328
+ if (regex.test(value)) {
329
+ // 有输入值
330
+ setSearchText(value);
331
+ } else {
332
+ // 没有输入值, 清空选择的属性类型重新显示属性列表
333
+ setSearchText('');
334
+ setTempItem();
335
+ }
336
+ } else {
337
+ setSearchText(value);
338
+ }
339
+ };
340
+ var onPressEnter = function onPressEnter(e) {
341
+ var _a;
342
+ var inputValue = ((_a = searchText === null || searchText === void 0 ? void 0 : searchText.match(/[^:]+:(.*)/)) === null || _a === void 0 ? void 0 : _a[1]) || null;
343
+ var fieldValue;
344
+ if (tempItem && inputValue) {
345
+ setVisible(false);
346
+ if ((0, _isObject2["default"])(tempItem.value)) {
347
+ tempItem.value = _defineProperty({}, Object.keys(tempItem.value)[0], inputValue);
348
+ } else {
349
+ tempItem.value = inputValue; // 得到输入值
350
+ }
351
+ fieldValue = tempItem;
352
+ } else if (defaultSearchField) {
353
+ fieldValue = {
354
+ key: defaultSearchField,
355
+ value: searchText
356
+ };
357
+ }
358
+ if (fieldValue) {
359
+ if (!(value === null || value === void 0 ? void 0 : value.find(function (v) {
360
+ return v.key === fieldValue.key;
361
+ }))) {
362
+ var newValue = [].concat(_toConsumableArray(value), [fieldValue]);
363
+ setValue(newValue);
364
+ onChange((0, _utils.parseArrayToObject)(newValue));
365
+ } else {
366
+ var _newValue2 = value.map(function (v) {
367
+ return v.key === fieldValue.key ? fieldValue : v;
368
+ });
369
+ setValue(_newValue2);
370
+ onChange((0, _utils.parseArrayToObject)(_newValue2));
371
+ }
372
+ e.target.value = fieldValue.value;
373
+ form.emit('search', _defineProperty(_defineProperty({}, fieldValue.key, fieldValue.value), "current", 1));
374
+ (props === null || props === void 0 ? void 0 : props.onPressEnter) && props.onPressEnter(e);
375
+ }
376
+ setTempItem();
377
+ setSearchText('');
378
+ };
379
+ return _react["default"].createElement(_LocaleReceiver["default"], {
380
+ componentName: "QueryForm"
381
+ }, function (locale) {
382
+ return _react["default"].createElement("div", {
383
+ className: prefix,
384
+ onClick: handleFocus
385
+ }, _react["default"].createElement("span", {
386
+ className: "".concat(prefix, "-width"),
387
+ ref: widthRef
388
+ }, searchText), _react["default"].createElement("ul", {
389
+ className: "".concat(prefix, "-items")
390
+ }, value && value.map(function (item, index) {
391
+ return _react["default"].createElement("li", {
392
+ key: item.key,
393
+ className: "".concat(prefix, "-items-item")
394
+ }, _react["default"].createElement(_ValueTag["default"], {
395
+ onChange: handleFieldChange,
396
+ value: value,
397
+ item: item,
398
+ fieldItems: fieldItems,
399
+ locale: locale,
400
+ onDelete: onDelete,
401
+ handleTag: focusInput,
402
+ clsPrefix: clsPrefix,
403
+ form: form
404
+ }));
405
+ }), _react["default"].createElement("li", {
406
+ className: "".concat(prefix, "-items-input")
407
+ }, _react["default"].createElement(_FieldPopover["default"], {
408
+ ref: fieldRef,
409
+ onChange: handleFieldChange,
410
+ clsPrefix: clsPrefix,
411
+ fieldItems: fieldItems,
412
+ propItem: _fieldItem,
413
+ setFieldItem: setFieldItem,
414
+ form: form,
415
+ regex: regex,
416
+ visible: visible,
417
+ value: value,
418
+ setVisible: setVisible,
419
+ searchText: searchText,
420
+ locale: locale,
421
+ placement: "bottomLeft"
422
+ }, _react["default"].createElement(_input["default"], Object.assign({
423
+ ref: inputRef,
424
+ value: searchText,
425
+ className: "inputClass",
426
+ placeholder: defaultSearchPlaceholder || (!(value === null || value === void 0 ? void 0 : value.length) ? locale.placeholder : undefined)
427
+ }, props, {
428
+ onPressEnter: onPressEnter,
429
+ onChange: onInputChange
430
+ }))))), _react["default"].createElement("div", {
431
+ className: "".concat(prefix, "-prefix")
432
+ }, _react["default"].createElement(_icon["default"], {
433
+ type: "filter"
434
+ })), compositionShowReset && _react["default"].createElement("div", {
435
+ className: "".concat(prefix, "-clear")
436
+ }, _react["default"].createElement(_icon["default"], {
437
+ onClick: onClear,
438
+ type: "close-circle",
439
+ theme: "filled"
440
+ })), _react["default"].createElement("div", {
441
+ className: "".concat(prefix, "-search"),
442
+ onClick: doSearch
443
+ }, _react["default"].createElement(_icon["default"], {
444
+ type: "search"
445
+ })));
446
+ });
447
+ };
448
+ var _default = exports["default"] = (0, _react.forwardRef)(CompositionInput);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAOc;AACd,4FAAmE;AACnE,mCAAuC;AACvC,yDAAgC;AAChC,2DAAkC;AAClC,kEAAyC;AACzC,0DAAiC;AACjC,mCAA0E;AAC1E,wBAAqB;AAErB;;;;;;;;;;GAUG;AACH,MAAM,KAAK,GAAG,SAAS,CAAA;AACvB,MAAM,gBAAgB,GAAG,CACvB,EACE,UAAU,EACV,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EACD,GAAG,EACH,EAAE;;IACF,MAAM,MAAM,GAAG,GAAG,SAAS,oBAAoB,CAAA;IAC/C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAA,0BAAkB,EAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAA;IACjF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,GAAE,CAAA;IAC1C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAA;IAChD,MAAM,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B;YACL,oBAAoB,IAAI,CACvB,uCAAK,SAAS,EAAE,GAAG,MAAM,QAAQ;gBAC/B,8BAAC,cAAI,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CACzD,CACP;YACD,uCAAK,SAAS,EAAE,GAAG,MAAM,SAAS,EAAE,OAAO,EAAE,QAAQ;gBACnD,8BAAC,cAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,CAClB,CACF,CACP,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AACD,kBAAe,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAA","sourcesContent":["import React, {\n useEffect,\n useState,\n useRef,\n useImperativeHandle,\n forwardRef,\n useCallback,\n} from 'react'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport { find, isObject } from 'lodash'\nimport Icon from '../../../icon'\nimport Input from '../../../input'\nimport FieldPopover from './FieldPopover'\nimport ValueTag from './ValueTag'\nimport { parseArrayToObject, parseObjectToArray, getLabel } from './utils'\nimport './index.less'\n\n/**\n * @param value: [{\n key: 'key1',\n value: 'value1',\n }, {\n key: 'key2',\n value: ['value2', 'value3']\n }]\n * @param {*} ref \n * @returns \n */\nconst regex = /^.+:.*$/\nconst CompositionInput = (\n {\n fieldItems,\n initialValues,\n onChange,\n form,\n compositionShowReset,\n defaultSearchField,\n defaultSearchPlaceholder,\n clsPrefix,\n _onReset,\n _onSearch,\n },\n ref\n) => {\n const prefix = `${clsPrefix}-composition-input`\n const [value, setValue] = useState(parseObjectToArray(initialValues, fieldItems))\n const [tempItem, setTempItem] = useState()\n const [searchText, setSearchText] = useState('')\n const [visible, setVisible] = useState(false)\n const [fieldItem, setFieldItem] = useState(undefined)\n const fieldItemsRef = useRef(fieldItems)\n const _fieldItem = fieldItem\n ? find(fieldItems, (f) => f.props?.name === fieldItem.name)?.props || fieldItem\n : {}\n const { props } = fieldItem || {}\n\n const inputRef = useRef(null)\n const widthRef = useRef(null)\n const fieldRef = useRef(null)\n const eventRef = useRef(false)\n\n fieldItemsRef.current = fieldItems\n\n const updateValues = useCallback((obj) => {\n const newValueArr = parseObjectToArray(obj, fieldItemsRef.current)\n setValue(newValueArr)\n }, [])\n\n const updateValue = useCallback((name, value) => {\n updateValues({ [name]: value })\n }, [])\n\n if (!eventRef.current) {\n eventRef.current = true\n form.on('setValue', updateValue)\n form.on('setValues', updateValues)\n }\n\n useEffect(() => {\n return () => {\n form.off('setValue', updateValue)\n form.off('setValues', updateValues)\n }\n }, [])\n\n const handleFocus = (e) => {\n e.preventDefault()\n setTimeout(() => {\n inputRef?.current?.focus()\n }, 10)\n if (!visible && !regex.test(searchText)) {\n setVisible(true)\n }\n }\n\n useImperativeHandle(ref, () => ({\n changeVal: () => {\n return value\n },\n }))\n\n const onClear = (e) => {\n e.stopPropagation()\n const initKeys = Object.keys(initialValues || {})\n const deleteKeys = value?.filter(({ key }) => !initKeys.includes(key)).map(({ key }) => key)\n setValue(parseObjectToArray(initialValues || {}, fieldItems))\n onChange({ ...(initialValues || {}) }, deleteKeys, false, true)\n // 清除其他数据\n setSearchText('')\n setTempItem()\n _onReset()\n }\n\n const doSearch = (e) => {\n e.stopPropagation()\n const inputValue = searchText?.match(/[^:]+:(.*)/)?.[1] || null\n if (tempItem && inputValue) {\n if (isObject(tempItem.value)) {\n tempItem.value = {\n [Object.keys(tempItem.value)[0]]: inputValue,\n }\n } else {\n tempItem.value = inputValue // 得到输入值\n }\n if (!value?.find((v) => v.key === tempItem.key)) {\n const newValue = [...value, tempItem]\n setValue(newValue)\n onChange(parseArrayToObject(newValue))\n } else {\n const newValue = value.map((v) => (v.key === tempItem.key ? tempItem : v))\n setValue(newValue)\n onChange(parseArrayToObject(newValue))\n }\n e.target.value = tempItem.value\n form.emit('search', { [tempItem.key]: tempItem.value, current: 1 })\n setTempItem()\n setSearchText('')\n } else {\n _onSearch()\n }\n }\n\n const onDelete = (key, e) => {\n e.preventDefault()\n if (value.length > 0) {\n const newValue = value.filter((v) => v.key !== key)\n setValue(newValue)\n const deleteKeys = [key]\n onChange(parseArrayToObject(newValue), deleteKeys, true)\n // 删除的时候也触发Field的onChange -- 泳建提的需求\n const fieldProps = find(fieldItems, (it) => it.props?.name === key)?.props\n fieldProps?.props?.onChange && fieldProps.props.onChange(undefined)\n }\n }\n\n const focusInput = (value) => {\n inputRef?.current?.focus()\n setSearchText(getLabel(value, fieldItems))\n setTempItem(value)\n setTimeout(() => {\n inputRef?.current?.focus()\n }, 10)\n }\n\n const handleFieldChange = (value, isInput, hasValue, needSearch = true) => {\n if (isInput) {\n focusInput(value)\n return\n }\n setValue(value)\n setSearchText('')\n setTempItem()\n if (hasValue) onChange(parseArrayToObject(value), undefined, needSearch)\n }\n\n // 输入框事件方法\n const onInputChange = (e) => {\n const value = e.target.value\n if (tempItem) {\n if (regex.test(value)) {\n // 有输入值\n setSearchText(value)\n } else {\n // 没有输入值, 清空选择的属性类型重新显示属性列表\n setSearchText('')\n setTempItem()\n }\n } else {\n setSearchText(value)\n }\n }\n\n const onPressEnter = (e) => {\n const inputValue = searchText?.match(/[^:]+:(.*)/)?.[1] || null\n let fieldValue\n if (tempItem && inputValue) {\n setVisible(false)\n if (isObject(tempItem.value)) {\n tempItem.value = {\n [Object.keys(tempItem.value)[0]]: inputValue,\n }\n } else {\n tempItem.value = inputValue // 得到输入值\n }\n fieldValue = tempItem\n } else if (defaultSearchField) {\n fieldValue = { key: defaultSearchField, value: searchText }\n }\n if (fieldValue) {\n if (!value?.find((v) => v.key === fieldValue.key)) {\n const newValue = [...value, fieldValue]\n setValue(newValue)\n onChange(parseArrayToObject(newValue))\n } else {\n const newValue = value.map((v) => (v.key === fieldValue.key ? fieldValue : v))\n setValue(newValue)\n onChange(parseArrayToObject(newValue))\n }\n e.target.value = fieldValue.value\n form.emit('search', { [fieldValue.key]: fieldValue.value, current: 1 })\n props?.onPressEnter && props.onPressEnter(e)\n }\n setTempItem()\n setSearchText('')\n }\n return (\n <LocaleReceiver componentName=\"QueryForm\">\n {(locale) => {\n return (\n <div className={prefix} onClick={handleFocus}>\n <span className={`${prefix}-width`} ref={widthRef}>\n {searchText}\n </span>\n <ul className={`${prefix}-items`}>\n {value &&\n value.map((item, index) => (\n <li key={item.key} className={`${prefix}-items-item`}>\n <ValueTag\n onChange={handleFieldChange}\n value={value}\n item={item}\n fieldItems={fieldItems}\n locale={locale}\n onDelete={onDelete}\n handleTag={focusInput}\n clsPrefix={clsPrefix}\n form={form}\n />\n </li>\n ))}\n <li className={`${prefix}-items-input`}>\n <FieldPopover\n ref={fieldRef}\n onChange={handleFieldChange}\n clsPrefix={clsPrefix}\n fieldItems={fieldItems}\n propItem={_fieldItem}\n setFieldItem={setFieldItem}\n form={form}\n regex={regex}\n visible={visible}\n value={value}\n setVisible={setVisible}\n searchText={searchText}\n locale={locale}\n placement=\"bottomLeft\"\n >\n <Input\n ref={inputRef}\n value={searchText}\n className=\"inputClass\"\n placeholder={\n defaultSearchPlaceholder || (!value?.length ? locale.placeholder : undefined)\n }\n {...props}\n onPressEnter={onPressEnter}\n onChange={onInputChange}\n />\n </FieldPopover>\n </li>\n </ul>\n <div className={`${prefix}-prefix`}>\n <Icon type=\"filter\" />\n </div>\n {compositionShowReset && (\n <div className={`${prefix}-clear`}>\n <Icon onClick={onClear} type=\"close-circle\" theme=\"filled\" />\n </div>\n )}\n <div className={`${prefix}-search`} onClick={doSearch}>\n <Icon type=\"search\" />\n </div>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n}\nexport default forwardRef(CompositionInput)\n"]}