tntd 3.0.10 → 3.0.11

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 (395) hide show
  1. package/es/array-input/index.js +10 -3
  2. package/es/array-input/index.js.map +1 -1
  3. package/es/index.js +1 -0
  4. package/es/index.js.map +1 -1
  5. package/es/locale/en_US.js +16 -0
  6. package/es/locale/en_US.js.map +1 -1
  7. package/es/locale/zh_CN.js +16 -0
  8. package/es/locale/zh_CN.js.map +1 -1
  9. package/es/prev-locale.js +32 -2
  10. package/es/prev-locale.js.map +1 -1
  11. package/es/query-list-scene/index.less +4 -0
  12. package/es/table/index.js +2 -2
  13. package/es/table/index.js.map +1 -1
  14. package/es/table/resizableTable/index.js +87 -0
  15. package/es/table/resizableTable/index.js.map +1 -0
  16. package/es/table/resizableTable/index.less +36 -0
  17. package/es/table/table-hoc.js +26 -0
  18. package/es/table/table-hoc.js.map +1 -0
  19. package/es/tabs/tabs.less +23 -0
  20. package/es/title/index.less +4 -1
  21. package/es/tntd-reference/AHref/index.js +39 -0
  22. package/es/tntd-reference/AHref/index.js.map +1 -0
  23. package/es/tntd-reference/ReferenceBatchCheck/index.js +153 -0
  24. package/es/tntd-reference/ReferenceBatchCheck/index.js.map +1 -0
  25. package/es/tntd-reference/ReferenceBatchCheck/index.less +21 -0
  26. package/es/tntd-reference/ReferenceBatchDrawer/index.js +102 -0
  27. package/es/tntd-reference/ReferenceBatchDrawer/index.js.map +1 -0
  28. package/es/tntd-reference/ReferenceBatchDrawer/index.less +0 -0
  29. package/es/tntd-reference/ReferenceCheck/index.js +117 -0
  30. package/es/tntd-reference/ReferenceCheck/index.js.map +1 -0
  31. package/es/tntd-reference/ReferenceCheck/index.less +10 -0
  32. package/es/tntd-reference/ReferenceDrawer/index.js +69 -0
  33. package/es/tntd-reference/ReferenceDrawer/index.js.map +1 -0
  34. package/es/tntd-reference/ReferenceDrawer/index.less +0 -0
  35. package/es/tntd-reference/ReferenceInfo/index.js +150 -0
  36. package/es/tntd-reference/ReferenceInfo/index.js.map +1 -0
  37. package/es/tntd-reference/ReferenceInfo/index.less +31 -0
  38. package/es/tntd-reference/index.js +13 -0
  39. package/es/tntd-reference/index.js.map +1 -0
  40. package/es/tntd-virtual-tree/index.js +14 -3
  41. package/es/tntd-virtual-tree/index.js.map +1 -1
  42. package/es/tntd-virtual-tree/index.less +2 -42
  43. package/es/tntd-virtual-tree-select/index.js +95 -21
  44. package/es/tntd-virtual-tree-select/index.js.map +1 -1
  45. package/es/tntd-virtual-tree-select/utils.js +20 -124
  46. package/es/tntd-virtual-tree-select/utils.js.map +1 -1
  47. package/lib/_util/context.js +1 -1
  48. package/lib/_util/defaultRenderEmpty.js +1 -1
  49. package/lib/_util/hooks/useFlexGapSupport.js +4 -4
  50. package/lib/_util/hooks/useForceUpdate.js +4 -4
  51. package/lib/_util/responsiveObserve.js +1 -1
  52. package/lib/_util/styleChecker.js +1 -1
  53. package/lib/actions/index.js +1 -1
  54. package/lib/alert/alert.js +2 -2
  55. package/lib/alert/index.js +1 -1
  56. package/lib/array-input/index.d.ts.map +1 -1
  57. package/lib/array-input/index.js +22 -13
  58. package/lib/array-input/index.js.map +1 -1
  59. package/lib/button/button.js +2 -2
  60. package/lib/cascader/cascader.js +1 -1
  61. package/lib/check-card/group.js +8 -8
  62. package/lib/check-card/index.js +6 -6
  63. package/lib/checkbox/checkbox.js +1 -1
  64. package/lib/color-picker/ColorPicker.js +6 -6
  65. package/lib/color-picker/index.js +1 -1
  66. package/lib/columns/index.js +1 -1
  67. package/lib/config-provider/config-provider.js +1 -1
  68. package/lib/date-picker/DatePicker.js +1 -1
  69. package/lib/descriptions/descriptions.js +5 -5
  70. package/lib/development-login/LoginModal.js +6 -6
  71. package/lib/development-login/index.js +4 -4
  72. package/lib/drawer/drawer.js +2 -2
  73. package/lib/ellipsis/Svg/CopySVG.js +1 -1
  74. package/lib/ellipsis/Svg/TickSVG.js +1 -1
  75. package/lib/ellipsis/index.js +5 -5
  76. package/lib/empty/empty.js +2 -2
  77. package/lib/empty/empty.stories.js +2 -2
  78. package/lib/exception/exception.js +1 -1
  79. package/lib/form/form.js +2 -2
  80. package/lib/grid-v4/col.js +2 -2
  81. package/lib/grid-v4/hooks/useBreakpoint.js +1 -1
  82. package/lib/grid-v4/index.js +1 -1
  83. package/lib/grid-v4/row.js +6 -6
  84. package/lib/handle/index.js +1 -1
  85. package/lib/handle-icon/index.js +11 -11
  86. package/lib/icon/IconFont.js +1 -1
  87. package/lib/icon/components/Icon.js +9 -9
  88. package/lib/icon/components/index.js +1 -1
  89. package/lib/icon/components/utils.js +3 -3
  90. package/lib/icon/index.js +7 -7
  91. package/lib/icon/twoTonePrimaryColor.js +1 -1
  92. package/lib/icon/utils.js +1 -1
  93. package/lib/img/Contain.js +1 -1
  94. package/lib/img/Cover.js +5 -5
  95. package/lib/img/index.js +5 -5
  96. package/lib/index.d.ts +1 -0
  97. package/lib/index.d.ts.map +1 -1
  98. package/lib/index.js +8 -1
  99. package/lib/index.js.map +1 -1
  100. package/lib/input/input.js +2 -2
  101. package/lib/input-number/inputNumber.js +1 -1
  102. package/lib/label/index.js +2 -2
  103. package/lib/loading-button/index.js +5 -5
  104. package/lib/locale/default.d.ts +16 -0
  105. package/lib/locale/default.d.ts.map +1 -1
  106. package/lib/locale/default.js +1 -1
  107. package/lib/locale/en_US.d.ts +16 -0
  108. package/lib/locale/en_US.d.ts.map +1 -1
  109. package/lib/locale/en_US.js +17 -1
  110. package/lib/locale/en_US.js.map +1 -1
  111. package/lib/locale/zh_CN.d.ts +16 -0
  112. package/lib/locale/zh_CN.d.ts.map +1 -1
  113. package/lib/locale/zh_CN.js +17 -1
  114. package/lib/locale/zh_CN.js.map +1 -1
  115. package/lib/modal/modal.js +1 -1
  116. package/lib/notification/assets/index.js +1 -1
  117. package/lib/notification/index.js +1 -1
  118. package/lib/notification/notification.js +1 -1
  119. package/lib/page/Box.js +1 -1
  120. package/lib/page/index.js +7 -7
  121. package/lib/page-container/index.js +1 -1
  122. package/lib/page-loading/index.js +1 -1
  123. package/lib/popconfirm/popconfirm.js +1 -1
  124. package/lib/popover/popover.js +1 -1
  125. package/lib/prev-locale.d.ts +42 -0
  126. package/lib/prev-locale.d.ts.map +1 -1
  127. package/lib/prev-locale.js +32 -2
  128. package/lib/prev-locale.js.map +1 -1
  129. package/lib/preview-text/index.js +7 -7
  130. package/lib/progress/progress.js +2 -2
  131. package/lib/query-form/Field/Checkbox.js +1 -1
  132. package/lib/query-form/Field/Select.js +6 -6
  133. package/lib/query-form/Field/SelectInput.js +6 -6
  134. package/lib/query-form/Field/fieldsMap.js +1 -1
  135. package/lib/query-form/Field/index.js +10 -10
  136. package/lib/query-form/createActions.js +1 -1
  137. package/lib/query-form/index.js +10 -10
  138. package/lib/query-form/useForm.js +1 -1
  139. package/lib/query-list-scene/List.js +13 -13
  140. package/lib/query-list-scene/QueryForm.js +9 -9
  141. package/lib/query-list-scene/QueryListScene.js +10 -10
  142. package/lib/query-list-scene/Title.js +1 -1
  143. package/lib/query-list-scene/Toolbar.js +2 -2
  144. package/lib/query-list-scene/createActions.js +1 -1
  145. package/lib/query-list-scene/index.js +1 -1
  146. package/lib/query-list-scene/index.less +4 -0
  147. package/lib/query-list-scene/useActions.js +1 -1
  148. package/lib/radio/radio.js +1 -1
  149. package/lib/render-empty/render-empty.js +1 -1
  150. package/lib/segmented/index.d.ts +1 -1
  151. package/lib/segmented/index.js +2 -2
  152. package/lib/select/select.js +2 -2
  153. package/lib/spin/spin.js +1 -1
  154. package/lib/steps/steps.js +2 -2
  155. package/lib/svg-components/index.js +1 -1
  156. package/lib/table/hooks/use-column-setting.js +4 -4
  157. package/lib/table/hooks/use-expand-fixed.js +6 -6
  158. package/lib/table/index.d.ts +2 -2
  159. package/lib/table/index.d.ts.map +1 -1
  160. package/lib/table/index.js +7 -7
  161. package/lib/table/index.js.map +1 -1
  162. package/lib/table/resizableTable/index.d.ts +12 -0
  163. package/lib/table/resizableTable/index.d.ts.map +1 -0
  164. package/lib/table/resizableTable/index.js +110 -0
  165. package/lib/table/resizableTable/index.js.map +1 -0
  166. package/lib/table/resizableTable/index.less +36 -0
  167. package/lib/table/table-hoc.d.ts +7 -0
  168. package/lib/table/table-hoc.d.ts.map +1 -0
  169. package/lib/table/table-hoc.js +34 -0
  170. package/lib/table/table-hoc.js.map +1 -0
  171. package/lib/table/table.js +9 -9
  172. package/lib/table/table.stories.d.ts +1 -1
  173. package/lib/table/table.stories.js +2 -2
  174. package/lib/table/total-shower.js +1 -1
  175. package/lib/table/utils.js +1 -1
  176. package/lib/table-container/index.js +1 -1
  177. package/lib/tabs/tabs.js +2 -2
  178. package/lib/tabs/tabs.less +23 -0
  179. package/lib/tabs-container/index.js +1 -1
  180. package/lib/tag/tag.js +2 -2
  181. package/lib/time-picker/TimePicker.js +1 -1
  182. package/lib/time-picker/index.js +1 -1
  183. package/lib/title/index.js +1 -1
  184. package/lib/title/index.less +4 -1
  185. package/lib/tntd-action/Action.js +9 -9
  186. package/lib/tntd-action/index.js +8 -8
  187. package/lib/tntd-cascader/AntdCascader/component/context.js +1 -1
  188. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  189. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
  190. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
  191. package/lib/tntd-cascader/AntdCascader/config/utils.js +2 -2
  192. package/lib/tntd-cascader/AntdCascader/index.js +7 -7
  193. package/lib/tntd-cascader/index.js +1 -1
  194. package/lib/tntd-cascader/rc-cascader/Cascader.js +8 -8
  195. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
  196. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
  197. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
  198. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
  199. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
  200. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
  201. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
  202. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
  203. package/lib/tntd-cascader/rc-cascader/index.js +1 -1
  204. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
  205. package/lib/tntd-form/ErrorList.js +7 -7
  206. package/lib/tntd-form/Form.js +6 -6
  207. package/lib/tntd-form/FormItem/ItemHolder.js +6 -6
  208. package/lib/tntd-form/FormItem/index.js +8 -8
  209. package/lib/tntd-form/FormItemInput.js +1 -1
  210. package/lib/tntd-form/FormItemLabel.js +2 -2
  211. package/lib/tntd-form/FormList.js +1 -1
  212. package/lib/tntd-form/context.js +1 -1
  213. package/lib/tntd-form/hooks/useDebounce.js +4 -4
  214. package/lib/tntd-form/hooks/useForm.js +5 -5
  215. package/lib/tntd-form/hooks/useFormItemStatus.js +1 -1
  216. package/lib/tntd-form/hooks/useFrameState.js +5 -5
  217. package/lib/tntd-form/index.js +1 -1
  218. package/lib/tntd-icon/index.js +1 -1
  219. package/lib/tntd-layout/AppList.js +6 -6
  220. package/lib/tntd-layout/Application.js +6 -6
  221. package/lib/tntd-layout/Avatar.js +2 -2
  222. package/lib/tntd-layout/CompatibleLanguage.js +6 -6
  223. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
  224. package/lib/tntd-layout/EnterpriseLayout/Language.js +6 -6
  225. package/lib/tntd-layout/EnterpriseLayout/Theme.js +6 -6
  226. package/lib/tntd-layout/EnterpriseLayout/index.js +1 -1
  227. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
  228. package/lib/tntd-layout/GlobalNavigation/index.js +9 -9
  229. package/lib/tntd-layout/Header.js +2 -2
  230. package/lib/tntd-layout/HeaderActions.js +2 -2
  231. package/lib/tntd-layout/HeaderNavs.js +6 -6
  232. package/lib/tntd-layout/HeaderTabs.js +7 -7
  233. package/lib/tntd-layout/Iconfont.js +1 -1
  234. package/lib/tntd-layout/Language.js +6 -6
  235. package/lib/tntd-layout/Layout.js +6 -6
  236. package/lib/tntd-layout/Logo.js +2 -2
  237. package/lib/tntd-layout/OrgAppList.js +6 -6
  238. package/lib/tntd-layout/SideMenu.js +6 -6
  239. package/lib/tntd-layout/Theme.js +6 -6
  240. package/lib/tntd-layout/createActions.js +1 -1
  241. package/lib/tntd-layout/images/index.js +1 -1
  242. package/lib/tntd-layout/index.js +1 -1
  243. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
  244. package/lib/tntd-layout/paaslayout/Header.js +2 -2
  245. package/lib/tntd-layout/paaslayout/Logo.js +2 -2
  246. package/lib/tntd-layout/paaslayout/SideMenu.js +6 -6
  247. package/lib/tntd-layout/paaslayout/index.js +6 -6
  248. package/lib/tntd-layout/storage.js +1 -1
  249. package/lib/tntd-modal/index.js +6 -6
  250. package/lib/tntd-rc-select/_util/PurePanel.js +5 -5
  251. package/lib/tntd-rc-select/_util/context.js +1 -1
  252. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
  253. package/lib/tntd-rc-select/_util/getIcons.js +1 -1
  254. package/lib/tntd-rc-select/_util/useCompactItemContext.js +2 -2
  255. package/lib/tntd-rc-select/index.js +2 -2
  256. package/lib/{query-form-v3/Field/Composition/Select.d.ts → tntd-reference/AHref/index.d.ts} +1 -1
  257. package/lib/tntd-reference/AHref/index.d.ts.map +1 -0
  258. package/lib/tntd-reference/AHref/index.js +44 -0
  259. package/lib/tntd-reference/AHref/index.js.map +1 -0
  260. package/lib/tntd-reference/ReferenceBatchCheck/index.d.ts +3 -0
  261. package/lib/tntd-reference/ReferenceBatchCheck/index.d.ts.map +1 -0
  262. package/lib/tntd-reference/ReferenceBatchCheck/index.js +165 -0
  263. package/lib/tntd-reference/ReferenceBatchCheck/index.js.map +1 -0
  264. package/lib/tntd-reference/ReferenceBatchCheck/index.less +21 -0
  265. package/lib/{query-form-v3/Field/Select.d.ts → tntd-reference/ReferenceBatchDrawer/index.d.ts} +1 -1
  266. package/lib/tntd-reference/ReferenceBatchDrawer/index.d.ts.map +1 -0
  267. package/lib/tntd-reference/ReferenceBatchDrawer/index.js +126 -0
  268. package/lib/tntd-reference/ReferenceBatchDrawer/index.js.map +1 -0
  269. package/lib/tntd-reference/ReferenceBatchDrawer/index.less +0 -0
  270. package/lib/tntd-reference/ReferenceCheck/index.d.ts +3 -0
  271. package/lib/tntd-reference/ReferenceCheck/index.d.ts.map +1 -0
  272. package/lib/tntd-reference/ReferenceCheck/index.js +126 -0
  273. package/lib/tntd-reference/ReferenceCheck/index.js.map +1 -0
  274. package/lib/tntd-reference/ReferenceCheck/index.less +10 -0
  275. package/lib/{query-form-v3/Field/SelectInput.d.ts → tntd-reference/ReferenceDrawer/index.d.ts} +1 -1
  276. package/lib/tntd-reference/ReferenceDrawer/index.d.ts.map +1 -0
  277. package/lib/tntd-reference/ReferenceDrawer/index.js +93 -0
  278. package/lib/tntd-reference/ReferenceDrawer/index.js.map +1 -0
  279. package/lib/tntd-reference/ReferenceDrawer/index.less +0 -0
  280. package/lib/tntd-reference/ReferenceInfo/index.d.ts +4 -0
  281. package/lib/tntd-reference/ReferenceInfo/index.d.ts.map +1 -0
  282. package/lib/tntd-reference/ReferenceInfo/index.js +164 -0
  283. package/lib/tntd-reference/ReferenceInfo/index.js.map +1 -0
  284. package/lib/tntd-reference/ReferenceInfo/index.less +31 -0
  285. package/lib/tntd-reference/index.d.ts +15 -0
  286. package/lib/tntd-reference/index.d.ts.map +1 -0
  287. package/lib/tntd-reference/index.js +20 -0
  288. package/lib/tntd-reference/index.js.map +1 -0
  289. package/lib/tntd-second-page/index.js +1 -1
  290. package/lib/tntd-select/DropDownWrap.js +8 -8
  291. package/lib/tntd-select/index.js +10 -9
  292. package/lib/tntd-virtual-tree/index.d.ts +3 -1
  293. package/lib/tntd-virtual-tree/index.d.ts.map +1 -1
  294. package/lib/tntd-virtual-tree/index.js +23 -12
  295. package/lib/tntd-virtual-tree/index.js.map +1 -1
  296. package/lib/tntd-virtual-tree/index.less +2 -42
  297. package/lib/tntd-virtual-tree/utils.js +28 -28
  298. package/lib/tntd-virtual-tree-select/index.d.ts +12 -4
  299. package/lib/tntd-virtual-tree-select/index.d.ts.map +1 -1
  300. package/lib/tntd-virtual-tree-select/index.js +99 -20
  301. package/lib/tntd-virtual-tree-select/index.js.map +1 -1
  302. package/lib/tntd-virtual-tree-select/utils.d.ts +2 -9
  303. package/lib/tntd-virtual-tree-select/utils.d.ts.map +1 -1
  304. package/lib/tntd-virtual-tree-select/utils.js +28 -147
  305. package/lib/tntd-virtual-tree-select/utils.js.map +1 -1
  306. package/lib/tooltip/tooltip.js +1 -1
  307. package/lib/upload/index.js +1 -1
  308. package/lib/utils/checkAuth.js +4 -4
  309. package/lib/utils/index.js +9 -9
  310. package/lib/utils/lang.js +3 -3
  311. package/lib/water-mark/index.js +5 -5
  312. package/package.json +4 -2
  313. package/es/query-form-v3/Field/Checkbox.js +0 -23
  314. package/es/query-form-v3/Field/Checkbox.js.map +0 -1
  315. package/es/query-form-v3/Field/Composition/FieldPopover.js +0 -330
  316. package/es/query-form-v3/Field/Composition/FieldPopover.js.map +0 -1
  317. package/es/query-form-v3/Field/Composition/FieldPopover.less +0 -35
  318. package/es/query-form-v3/Field/Composition/Select.js +0 -107
  319. package/es/query-form-v3/Field/Composition/Select.js.map +0 -1
  320. package/es/query-form-v3/Field/Composition/index.js +0 -208
  321. package/es/query-form-v3/Field/Composition/index.js.map +0 -1
  322. package/es/query-form-v3/Field/Composition/index.less +0 -118
  323. package/es/query-form-v3/Field/Composition/utils.js +0 -132
  324. package/es/query-form-v3/Field/Composition/utils.js.map +0 -1
  325. package/es/query-form-v3/Field/Select.js +0 -59
  326. package/es/query-form-v3/Field/Select.js.map +0 -1
  327. package/es/query-form-v3/Field/SelectInput.js +0 -87
  328. package/es/query-form-v3/Field/SelectInput.js.map +0 -1
  329. package/es/query-form-v3/Field/fieldsMap.js +0 -28
  330. package/es/query-form-v3/Field/fieldsMap.js.map +0 -1
  331. package/es/query-form-v3/Field/index.js +0 -117
  332. package/es/query-form-v3/Field/index.js.map +0 -1
  333. package/es/query-form-v3/createActions.js +0 -47
  334. package/es/query-form-v3/createActions.js.map +0 -1
  335. package/es/query-form-v3/index.js +0 -175
  336. package/es/query-form-v3/index.js.map +0 -1
  337. package/es/query-form-v3/index.less +0 -91
  338. package/es/query-form-v3/useForm.js +0 -6
  339. package/es/query-form-v3/useForm.js.map +0 -1
  340. package/es/tntd-virtual-tree-select/VirtualTree.js +0 -125
  341. package/es/tntd-virtual-tree-select/VirtualTree.js.map +0 -1
  342. package/es/tntd-virtual-tree-select/tree.less +0 -29
  343. package/lib/query-form-v3/Field/Checkbox.d.ts +0 -8
  344. package/lib/query-form-v3/Field/Checkbox.d.ts.map +0 -1
  345. package/lib/query-form-v3/Field/Checkbox.js +0 -28
  346. package/lib/query-form-v3/Field/Checkbox.js.map +0 -1
  347. package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts +0 -19
  348. package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts.map +0 -1
  349. package/lib/query-form-v3/Field/Composition/FieldPopover.js +0 -370
  350. package/lib/query-form-v3/Field/Composition/FieldPopover.js.map +0 -1
  351. package/lib/query-form-v3/Field/Composition/FieldPopover.less +0 -35
  352. package/lib/query-form-v3/Field/Composition/Select.d.ts.map +0 -1
  353. package/lib/query-form-v3/Field/Composition/Select.js +0 -131
  354. package/lib/query-form-v3/Field/Composition/Select.js.map +0 -1
  355. package/lib/query-form-v3/Field/Composition/index.d.ts +0 -10
  356. package/lib/query-form-v3/Field/Composition/index.d.ts.map +0 -1
  357. package/lib/query-form-v3/Field/Composition/index.js +0 -255
  358. package/lib/query-form-v3/Field/Composition/index.js.map +0 -1
  359. package/lib/query-form-v3/Field/Composition/index.less +0 -118
  360. package/lib/query-form-v3/Field/Composition/utils.d.ts +0 -22
  361. package/lib/query-form-v3/Field/Composition/utils.d.ts.map +0 -1
  362. package/lib/query-form-v3/Field/Composition/utils.js +0 -147
  363. package/lib/query-form-v3/Field/Composition/utils.js.map +0 -1
  364. package/lib/query-form-v3/Field/Select.d.ts.map +0 -1
  365. package/lib/query-form-v3/Field/Select.js +0 -80
  366. package/lib/query-form-v3/Field/Select.js.map +0 -1
  367. package/lib/query-form-v3/Field/SelectInput.d.ts.map +0 -1
  368. package/lib/query-form-v3/Field/SelectInput.js +0 -100
  369. package/lib/query-form-v3/Field/SelectInput.js.map +0 -1
  370. package/lib/query-form-v3/Field/fieldsMap.d.ts +0 -27
  371. package/lib/query-form-v3/Field/fieldsMap.d.ts.map +0 -1
  372. package/lib/query-form-v3/Field/fieldsMap.js +0 -35
  373. package/lib/query-form-v3/Field/fieldsMap.js.map +0 -1
  374. package/lib/query-form-v3/Field/index.d.ts +0 -14
  375. package/lib/query-form-v3/Field/index.d.ts.map +0 -1
  376. package/lib/query-form-v3/Field/index.js +0 -147
  377. package/lib/query-form-v3/Field/index.js.map +0 -1
  378. package/lib/query-form-v3/createActions.d.ts +0 -14
  379. package/lib/query-form-v3/createActions.d.ts.map +0 -1
  380. package/lib/query-form-v3/createActions.js +0 -54
  381. package/lib/query-form-v3/createActions.js.map +0 -1
  382. package/lib/query-form-v3/index.d.ts +0 -27
  383. package/lib/query-form-v3/index.d.ts.map +0 -1
  384. package/lib/query-form-v3/index.js +0 -206
  385. package/lib/query-form-v3/index.js.map +0 -1
  386. package/lib/query-form-v3/index.less +0 -91
  387. package/lib/query-form-v3/useForm.d.ts +0 -13
  388. package/lib/query-form-v3/useForm.d.ts.map +0 -1
  389. package/lib/query-form-v3/useForm.js +0 -13
  390. package/lib/query-form-v3/useForm.js.map +0 -1
  391. package/lib/tntd-virtual-tree-select/VirtualTree.d.ts +0 -13
  392. package/lib/tntd-virtual-tree-select/VirtualTree.d.ts.map +0 -1
  393. package/lib/tntd-virtual-tree-select/VirtualTree.js +0 -155
  394. package/lib/tntd-virtual-tree-select/VirtualTree.js.map +0 -1
  395. package/lib/tntd-virtual-tree-select/tree.less +0 -29
@@ -1,131 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
- var _icon = _interopRequireDefault(require("../../../icon"));
12
- var _utils = require("./utils");
13
- 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); }
14
- 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; }
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
- 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; }
17
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
- 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); }
19
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
20
- 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."); }
21
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
23
- 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; } }
24
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25
- var __rest = void 0 && (void 0).__rest || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
28
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
29
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
30
- }
31
- return t;
32
- };
33
- var _default = exports["default"] = function _default(props) {
34
- var options = props.options,
35
- params = props.params,
36
- _props$queryKey = props.queryKey,
37
- queryKey = _props$queryKey === void 0 ? 'name' : _props$queryKey,
38
- _props$fieldNames = props.fieldNames,
39
- fieldNames = _props$fieldNames === void 0 ? {
40
- label: 'label',
41
- value: 'value'
42
- } : _props$fieldNames,
43
- loadData = props.loadData,
44
- onChange = props.onChange,
45
- _value = props.value,
46
- mode = props.mode,
47
- propItem = props.propItem,
48
- searchText = props.searchText,
49
- rest = __rest(props, ["options", "params", "queryKey", "fieldNames", "loadData", "onChange", "value", "mode", "propItem", "searchText"]);
50
- var _useState = (0, _react.useState)(options || []),
51
- _useState2 = _slicedToArray(_useState, 2),
52
- items = _useState2[0],
53
- setItems = _useState2[1];
54
- (0, _react.useEffect)(function () {
55
- if (loadData) {
56
- loadData(Object.assign(_defineProperty({}, queryKey, searchText), params || {})).then(function (items) {
57
- setItems(items);
58
- });
59
- }
60
- }, [params, searchText]);
61
- (0, _react.useEffect)(function () {
62
- setItems(options || []);
63
- }, [options]);
64
- var onValueChange = function onValueChange(item) {
65
- onChange(item, mode === 'multiple' || mode === 'tags');
66
- };
67
- return _react["default"].createElement("ul", {
68
- className: "ant-select-dropdown-menu"
69
- }, items.map(function (item) {
70
- var labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label';
71
- var valueKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value';
72
- var value = item instanceof Object ? item[valueKey] : item;
73
- var label = item instanceof Object ? item[labelKey] : item + '';
74
- var disabled = item instanceof Object ? item['disabled'] : false;
75
- var isSelected = (0, _isArray2["default"])(_value) ? (_value === null || _value === void 0 ? void 0 : _value.indexOf(value)) > -1 : value === _value;
76
- if (searchText) {
77
- var isReactDom = _react["default"].isValidElement(label);
78
- var _label = isReactDom ? (0, _utils.formatLabel)(label) : label;
79
- if ((_label === null || _label === void 0 ? void 0 : _label.indexOf(searchText)) > -1) {
80
- return _react["default"].createElement("li", {
81
- className: (0, _classnames["default"])({
82
- 'ant-select-dropdown-menu-item': true,
83
- 'ant-select-dropdown-menu-item-selected': isSelected,
84
- 'ant-select-dropdown-menu-item-disabled': disabled
85
- }),
86
- key: value,
87
- value: value,
88
- onMouseDown: function onMouseDown(e) {
89
- return e.preventDefault();
90
- },
91
- onClick: function onClick() {
92
- !disabled && onValueChange({
93
- value: value,
94
- propItem: propItem,
95
- options: items
96
- });
97
- }
98
- }, _react["default"].createElement("span", null, (propItem === null || propItem === void 0 ? void 0 : propItem.propsTitle) || (propItem === null || propItem === void 0 ? void 0 : propItem.name), ": "), isReactDom ? _react["default"].createElement("span", null, label) : _react["default"].createElement("span", {
99
- dangerouslySetInnerHTML: {
100
- __html: (0, _utils.highlightSubstring)(label, searchText)
101
- }
102
- }), isSelected && _react["default"].createElement(_icon["default"], {
103
- type: "check",
104
- className: "ant-select-selected-icon"
105
- }));
106
- }
107
- return null;
108
- }
109
- return _react["default"].createElement("li", {
110
- className: (0, _classnames["default"])({
111
- 'ant-select-dropdown-menu-item': true,
112
- 'ant-select-dropdown-menu-item-selected': isSelected,
113
- 'ant-select-dropdown-menu-item-disabled': disabled
114
- }),
115
- key: value,
116
- value: value,
117
- onMouseDown: function onMouseDown(e) {
118
- return e.preventDefault();
119
- },
120
- onClick: function onClick() {
121
- !disabled && onValueChange({
122
- value: value,
123
- options: items
124
- });
125
- }
126
- }, label, isSelected && _react["default"].createElement(_icon["default"], {
127
- type: "check",
128
- className: "ant-select-selected-icon"
129
- }));
130
- }));
131
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/query-form-v3/Field/Composition/Select.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAClD,mCAAgC;AAChC,4DAAmC;AACnC,yDAAgC;AAChC,mC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G,EAAE;wBACZ,CAAC,QAAQ;4BACP,aAAa,CAAC;gCACZ,KAAK;gCACL,QAAQ;gCACR,OAAO,EAAE,KAAK;6BACf,CAAC,CAAA;oBACN,CAAC;oBAED;wBAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,MAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAA;6BAAU;oBACtD,UAAU,CAAC,CAAC,CAAC,CACZ,4CAAO,KAAK,CAAQ,CACrB,CAAC,CAAC,CAAC,CACF,wCACE,uBAAuB,EAAE;4BACvB,MAAM,EAAE,IAAA,0BAAkB,EAAC,KAAK,EAAE,UAAU,CAAC;yBAC9C,GACK,CACT;oBACA,UAAU,IAAI,8BAAC,cAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,GAAG,CACtE,CACN,CAAA;aACF;YACD,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,CACL,sCACE,SAAS,EAAE,IAAA,oBAAU,EAAC;gBACpB,+BAA+B,EAAE,IAAI;gBACrC,wCAAwC,EAAE,UAAU;gBACpD,wCAAwC,EAAE,QAAQ;aACnD,CAAC,EACF,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACtC,OAAO,EAAE,GAAG,EAAE;gBACZ,CAAC,QAAQ,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;YACvD,CAAC;YAEA,KAAK;YACL,UAAU,IAAI,8BAAC,cAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,GAAG,CACtE,CACN,CAAA;IACH,CAAC,CAAC,CACC,CACN,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useState, useEffect } from 'react'\nimport { isArray } from 'lodash'\nimport classNames from 'classnames'\nimport Icon from '../../../icon'\nimport { highlightSubstring, formatLabel } from './utils'\n\nexport default (props) => {\n const {\n options,\n params,\n queryKey = 'name',\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n loadData,\n onChange,\n value: _value,\n mode,\n propItem,\n searchText,\n ...rest\n } = props\n const [items, setItems] = useState(options || [])\n\n useEffect(() => {\n if (loadData) {\n loadData({\n [queryKey]: searchText,\n ...(params || {}),\n }).then((items) => {\n setItems(items)\n })\n }\n }, [params, searchText])\n\n useEffect(() => {\n setItems(options || [])\n }, [options])\n\n const onValueChange = (item) => {\n onChange(item, mode === 'multiple' || mode === 'tags')\n }\n\n return (\n <ul className=\"ant-select-dropdown-menu\">\n {items.map((item) => {\n const labelKey = fieldNames?.label || 'label'\n const valueKey = fieldNames?.value || 'value'\n const value = item instanceof Object ? item[valueKey] : item\n const label = item instanceof Object ? item[labelKey] : item + ''\n const disabled = item instanceof Object ? item['disabled'] : false\n\n const isSelected = isArray(_value) ? _value?.indexOf(value) > -1 : value === _value\n if (searchText) {\n const isReactDom = React.isValidElement(label)\n const _label = isReactDom ? formatLabel(label) : label\n if (_label?.indexOf(searchText) > -1) {\n return (\n <li\n className={classNames({\n 'ant-select-dropdown-menu-item': true,\n 'ant-select-dropdown-menu-item-selected': isSelected,\n 'ant-select-dropdown-menu-item-disabled': disabled,\n })}\n key={value}\n value={value}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n !disabled &&\n onValueChange({\n value,\n propItem,\n options: items,\n })\n }}\n >\n <span>{propItem?.propsTitle || propItem?.name}: </span>\n {isReactDom ? (\n <span>{label}</span>\n ) : (\n <span\n dangerouslySetInnerHTML={{\n __html: highlightSubstring(label, searchText),\n }}\n ></span>\n )}\n {isSelected && <Icon type=\"check\" className=\"ant-select-selected-icon\" />}\n </li>\n )\n }\n return null\n }\n return (\n <li\n className={classNames({\n 'ant-select-dropdown-menu-item': true,\n 'ant-select-dropdown-menu-item-selected': isSelected,\n 'ant-select-dropdown-menu-item-disabled': disabled,\n })}\n key={value}\n value={value}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n !disabled && onValueChange({ value, options: items })\n }}\n >\n {label}\n {isSelected && <Icon type=\"check\" className=\"ant-select-selected-icon\" />}\n </li>\n )\n })}\n </ul>\n )\n}\n"]}
@@ -1,10 +0,0 @@
1
- declare var _default: React.ForwardRefExoticComponent<{
2
- fieldItems: any;
3
- initialValues: any;
4
- onChange: any;
5
- form: any;
6
- clsPrefix: any;
7
- } & React.RefAttributes<any>>;
8
- export default _default;
9
- import React from "react";
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/query-form-v3/Field/Composition/index.js"],"names":[],"mappings":""}
@@ -1,255 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
10
- var _icon = _interopRequireDefault(require("../../../icon"));
11
- var _tag = _interopRequireDefault(require("../../../tag"));
12
- var _input = _interopRequireDefault(require("../../../input"));
13
- var _FieldPopover = _interopRequireDefault(require("./FieldPopover"));
14
- var _utils = require("./utils");
15
- require("./index.less");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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); }
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; }
19
- 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; }
20
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
21
- 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); }
22
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
26
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
- 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."); }
28
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
30
- 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; } }
31
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
- /**
33
- * @param value: [{
34
- key: 'key1',
35
- value: 'value1',
36
- label: 'key1:value1'
37
- }, {
38
- key: 'key2',
39
- value: ['value2', 'value3'],
40
- label: 'key1:value2|value3'
41
- }]
42
- * @param {*} ref
43
- * @returns
44
- */
45
- var regex = /^.+:.*$/;
46
- var CompositionInput = function CompositionInput(_ref, ref) {
47
- var fieldItems = _ref.fieldItems,
48
- initialValues = _ref.initialValues,
49
- onChange = _ref.onChange,
50
- form = _ref.form,
51
- clsPrefix = _ref.clsPrefix;
52
- var prefix = "".concat(clsPrefix, "-composition-input");
53
- var _useState = (0, _react.useState)([]),
54
- _useState2 = _slicedToArray(_useState, 2),
55
- value = _useState2[0],
56
- setValue = _useState2[1];
57
- var _useState3 = (0, _react.useState)(),
58
- _useState4 = _slicedToArray(_useState3, 2),
59
- tempItem = _useState4[0],
60
- setTempItem = _useState4[1];
61
- var _useState5 = (0, _react.useState)(''),
62
- _useState6 = _slicedToArray(_useState5, 2),
63
- searchText = _useState6[0],
64
- setSearchText = _useState6[1];
65
- var _useState7 = (0, _react.useState)(false),
66
- _useState8 = _slicedToArray(_useState7, 2),
67
- visible = _useState8[0],
68
- setVisible = _useState8[1];
69
- var _useState9 = (0, _react.useState)(undefined),
70
- _useState10 = _slicedToArray(_useState9, 2),
71
- fieldItem = _useState10[0],
72
- setFieldItem = _useState10[1];
73
- var _ref2 = fieldItem || {},
74
- props = _ref2.props;
75
- var inputRef = (0, _react.useRef)(null);
76
- var widthRef = (0, _react.useRef)(null);
77
- var fieldRef = (0, _react.useRef)(null);
78
- var handleFocus = function handleFocus(e) {
79
- var _a;
80
- e.preventDefault();
81
- (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
82
- if (!visible && !regex.test(searchText)) {
83
- setVisible(true);
84
- }
85
- };
86
- (0, _react.useImperativeHandle)(ref, function () {
87
- return {
88
- changeVal: function changeVal() {
89
- return value;
90
- }
91
- };
92
- });
93
- (0, _react.useEffect)(function () {
94
- if (initialValues) {
95
- setValue((0, _utils.parseObjectToArray)(initialValues, fieldItems));
96
- }
97
- }, [fieldItems, form, initialValues]);
98
- var onClear = function onClear(e) {
99
- e.stopPropagation();
100
- var initKeys = Object.keys(initialValues || {});
101
- var deleteKeys = value === null || value === void 0 ? void 0 : value.filter(function (_ref3) {
102
- var key = _ref3.key;
103
- return !initKeys.includes(key);
104
- }).map(function (_ref4) {
105
- var key = _ref4.key;
106
- return key;
107
- });
108
- setValue((0, _utils.parseObjectToArray)(initialValues || {}, fieldItems));
109
- onChange(Object.assign({}, initialValues || {}), deleteKeys, true);
110
- };
111
- var onDelete = function onDelete(key, e) {
112
- e.preventDefault();
113
- if (value.length > 0) {
114
- var newValue = value.filter(function (v) {
115
- return v.key !== key;
116
- });
117
- setValue(newValue);
118
- var deleteKeys = [key];
119
- onChange((0, _utils.parseArrayToObject)(newValue), deleteKeys, true);
120
- }
121
- };
122
- var handleFieldChange = function handleFieldChange(value, isInput, hasValue) {
123
- if (isInput) {
124
- setSearchText(value === null || value === void 0 ? void 0 : value.label);
125
- setTempItem(value);
126
- return;
127
- }
128
- setValue(value);
129
- setSearchText('');
130
- setTempItem();
131
- if (hasValue) onChange((0, _utils.parseArrayToObject)(value), undefined, true);
132
- };
133
- // 输入框事件方法
134
- var onInputChange = function onInputChange(e) {
135
- var value = e.target.value;
136
- if (tempItem) {
137
- if (regex.test(value)) {
138
- // 有输入值
139
- setSearchText(value);
140
- } else {
141
- // 没有输入值, 清空选择的属性类型重新显示属性列表
142
- setSearchText('');
143
- setTempItem();
144
- }
145
- } else {
146
- setSearchText(value);
147
- }
148
- };
149
- var onPressEnter = function onPressEnter(e) {
150
- var _a;
151
- var inputValue = ((_a = searchText === null || searchText === void 0 ? void 0 : searchText.match(/[^:]+:(.*)/)) === null || _a === void 0 ? void 0 : _a[1]) || null;
152
- if (tempItem && inputValue) {
153
- setVisible(false);
154
- tempItem.label = searchText;
155
- tempItem.closable = true;
156
- tempItem.value = inputValue; // 得到输入值
157
- if (!(value === null || value === void 0 ? void 0 : value.find(function (v) {
158
- return v.key === tempItem.key;
159
- }))) {
160
- var newValue = [].concat(_toConsumableArray(value), [tempItem]);
161
- setValue(newValue);
162
- onChange((0, _utils.parseArrayToObject)(newValue));
163
- } else {
164
- var _newValue = value.map(function (v) {
165
- return v.key === tempItem.key ? tempItem : v;
166
- });
167
- setValue(_newValue);
168
- onChange((0, _utils.parseArrayToObject)(_newValue));
169
- }
170
- e.target.value = inputValue;
171
- form.emit('search', _defineProperty(_defineProperty({}, tempItem.key, inputValue), "current", 1));
172
- (props === null || props === void 0 ? void 0 : props.onPressEnter) && props.onPressEnter(e);
173
- }
174
- setTempItem();
175
- setSearchText('');
176
- };
177
- var handleTag = function handleTag(obj) {
178
- var curItem = undefined;
179
- for (var index = 0; index < fieldItems.length; index++) {
180
- var item = fieldItems[index];
181
- if (item.props.name === obj.key) {
182
- curItem = item;
183
- break;
184
- }
185
- }
186
- fieldRef.current.onPropsClick(curItem.props);
187
- };
188
- return _react["default"].createElement(_LocaleReceiver["default"], {
189
- componentName: "QueryForm"
190
- }, function (locale) {
191
- return _react["default"].createElement("div", {
192
- className: prefix,
193
- onClick: handleFocus
194
- }, _react["default"].createElement("span", {
195
- className: "".concat(prefix, "-width"),
196
- ref: widthRef
197
- }, searchText), _react["default"].createElement("ul", {
198
- className: "".concat(prefix, "-items")
199
- }, value && value.map(function (item, index) {
200
- return _react["default"].createElement("li", {
201
- key: index,
202
- className: "".concat(prefix, "-items-item")
203
- }, _react["default"].createElement(_tag["default"], {
204
- closable: item.closable,
205
- onClick: function onClick(e) {
206
- e.preventDefault();
207
- e.stopPropagation();
208
- handleTag(item);
209
- },
210
- onClose: function onClose(e) {
211
- return onDelete(item.key, e);
212
- },
213
- ellipsisOptions: {
214
- widthLimit: '140px'
215
- }
216
- }, item === null || item === void 0 ? void 0 : item.label));
217
- }), _react["default"].createElement("li", {
218
- className: "".concat(prefix, "-items-input")
219
- }, _react["default"].createElement(_FieldPopover["default"], {
220
- ref: fieldRef,
221
- onChange: handleFieldChange,
222
- clsPrefix: clsPrefix,
223
- fieldItems: fieldItems,
224
- propItem: fieldItem,
225
- setFieldItem: setFieldItem,
226
- form: form,
227
- regex: regex,
228
- visible: visible,
229
- value: value,
230
- setVisible: setVisible,
231
- searchText: searchText,
232
- locale: locale,
233
- placement: "bottomLeft"
234
- }, _react["default"].createElement(_input["default"], Object.assign({
235
- ref: inputRef,
236
- value: searchText,
237
- className: "inputClass",
238
- placeholder: !(value === null || value === void 0 ? void 0 : value.length) ? locale.placeholder : undefined
239
- }, props, {
240
- onPressEnter: onPressEnter,
241
- onChange: onInputChange
242
- }))))), _react["default"].createElement("div", {
243
- className: "".concat(prefix, "-prefix")
244
- }, _react["default"].createElement(_icon["default"], {
245
- type: "filter"
246
- })), _react["default"].createElement("div", {
247
- className: "".concat(prefix, "-clear")
248
- }, _react["default"].createElement(_icon["default"], {
249
- onClick: onClear,
250
- type: "close-circle",
251
- theme: "filled"
252
- })));
253
- });
254
- };
255
- var _default = exports["default"] = (0, _react.forwardRef)(CompositionInput);
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/query-form-v3/Field/Composition/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2F;AAC3F,4FAAmE;AACnE,yDAAgC;AAChC,uDAA8B;AAC9B,2DAAkC;AAClC,kEAAyC;AACzC,mCAAgE;AAChE,wBAAqB;AAErB;;;;;;;;;;;;GAYG;AACH,MAAM,KAAK,GAAG,SAAS,CAAA;AAEvB,MAAM,gBAAgB,GAAG,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE;IACzF,MAAM,MAAM,GAAG,GAAG,SAAS,oBAAoB,CAAA;IAC/C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAA;IACtC,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,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAA;IACrD,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,IAAI,EAAE,CAAA;IAEjC,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IA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IAAI,EAAC,QAAQ,GAAG,CAClB;YACN,uCAAK,SAAS,EAAE,GAAG,MAAM,QAAQ;gBAC/B,8BAAC,cAAI,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CACzD,CACF,CACP,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AACD,kBAAe,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAA","sourcesContent":["import React, { useEffect, useState, useRef, useImperativeHandle, forwardRef } from 'react'\nimport LocaleReceiver from 'antd/lib/locale-provider/LocaleReceiver'\nimport Icon from '../../../icon'\nimport Tag from '../../../tag'\nimport Input from '../../../input'\nimport FieldPopover from './FieldPopover'\nimport { parseArrayToObject, parseObjectToArray } from './utils'\nimport './index.less'\n\n/**\n * @param value: [{\n key: 'key1',\n value: 'value1',\n label: 'key1:value1'\n }, {\n key: 'key2',\n value: ['value2', 'value3'],\n label: 'key1:value2|value3'\n }]\n * @param {*} ref \n * @returns \n */\nconst regex = /^.+:.*$/\n\nconst CompositionInput = ({ fieldItems, initialValues, onChange, form, clsPrefix }, ref) => {\n const prefix = `${clsPrefix}-composition-input`\n const [value, setValue] = useState([])\n const [tempItem, setTempItem] = useState()\n const [searchText, setSearchText] = useState('')\n const [visible, setVisible] = useState(false)\n const [fieldItem, setFieldItem] = useState(undefined)\n const { props } = fieldItem || {}\n\n const inputRef = useRef(null)\n const widthRef = useRef(null)\n const fieldRef = useRef(null)\n\n const handleFocus = (e) => {\n e.preventDefault()\n inputRef?.current?.focus()\n if (!visible && !regex.test(searchText)) {\n setVisible(true)\n }\n }\n useImperativeHandle(ref, () => ({\n changeVal: () => {\n return value\n },\n }))\n\n useEffect(() => {\n if (initialValues) {\n setValue(parseObjectToArray(initialValues, fieldItems))\n }\n }, [fieldItems, form, initialValues])\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, true)\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 }\n }\n const handleFieldChange = (value, isInput, hasValue) => {\n if (isInput) {\n setSearchText(value?.label)\n setTempItem(value)\n return\n }\n setValue(value)\n setSearchText('')\n setTempItem()\n if (hasValue) onChange(parseArrayToObject(value), undefined, true)\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 if (tempItem && inputValue) {\n setVisible(false)\n tempItem.label = searchText\n tempItem.closable = true\n tempItem.value = inputValue // 得到输入值\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 = inputValue\n form.emit('search', { [tempItem.key]: inputValue, current: 1 })\n props?.onPressEnter && props.onPressEnter(e)\n }\n setTempItem()\n setSearchText('')\n }\n\n const handleTag = (obj) => {\n let curItem = undefined\n for (let index = 0; index < fieldItems.length; index++) {\n const item = fieldItems[index]\n if (item.props.name === obj.key) {\n curItem = item\n break\n }\n }\n fieldRef.current.onPropsClick(curItem.props)\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={index} className={`${prefix}-items-item`}>\n <Tag\n closable={item.closable}\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n handleTag(item)\n }}\n onClose={(e) => onDelete(item.key, e)}\n ellipsisOptions={{ widthLimit: '140px' }}\n >\n {item?.label}\n </Tag>\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={!value?.length ? locale.placeholder : undefined}\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 <div className={`${prefix}-clear`}>\n <Icon onClick={onClear} type=\"close-circle\" theme=\"filled\" />\n </div>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n}\nexport default forwardRef(CompositionInput)\n"]}
@@ -1,118 +0,0 @@
1
- @import '../../../style/themes/index';
2
- @import '../../../style/mixins/index';
3
- @import '../../../input/style/mixin';
4
-
5
- .tnt-queryform-composition-input {
6
- // width: 100%;
7
- max-height: 162px;
8
- overflow-x: hidden;
9
- cursor: text;
10
- padding: 2px @padding-xl;
11
- position: relative;
12
- box-sizing: border-box;
13
- background-color: @select-background;
14
- border: @border-width-base @border-style-base @select-border-color;
15
- border-top-width: calc(@border-width-base + 0.02px);
16
- border-radius: @border-radius-base;
17
- outline: none;
18
- transition: all 0.3s @ease-in-out;
19
- user-select: none;
20
- margin-bottom: @margin-sm;
21
-
22
- &-prefix {
23
- position: absolute;
24
- left: @padding-sm;
25
- top: 50%;
26
- transform: translateY(-50%);
27
- i.anticon {
28
- color: tint(@bg-color-spotilight, 50%);
29
- }
30
- }
31
-
32
- &-width {
33
- height: 0;
34
- opacity: 0;
35
- width: auto;
36
- position: absolute;
37
- max-width: 100%;
38
- }
39
-
40
- &-items {
41
- float: left;
42
- padding: 0;
43
- list-style: none;
44
- margin: 0;
45
- width: 100%;
46
- &-item {
47
- padding: 3px 0;
48
- }
49
- li {
50
- float: left;
51
- line-height: 1;
52
- }
53
- &-input {
54
- .inputClass {
55
- background: none;
56
- border: none !important;
57
- outline: none;
58
- box-shadow: none !important;
59
- width: 150px !important;
60
- height: 26px;
61
- line-height: 26px;
62
- padding: 0;
63
- input {
64
- border: none !important;
65
- outline: none !important;
66
- box-shadow: none !important;
67
- height: 26px;
68
- line-height: 26px;
69
- padding: 0;
70
- }
71
- textarea {
72
- padding: 0;
73
- }
74
- }
75
- .inputClass-with-placeholder {
76
- min-width: 398px !important;
77
- }
78
- }
79
- }
80
- &-clear {
81
- position: absolute;
82
- right: @margin-sm;
83
- top: 50%;
84
- transform: translateY(-50%);
85
- display: none;
86
- i.anticon {
87
- color: tint(@bg-color-spotilight, 50%);
88
- }
89
- &:hover {
90
- .anticon {
91
- color: @text-color-secondary !important;
92
- }
93
- }
94
- }
95
- &:hover {
96
- border-color: @blue-6;
97
- outline: 0;
98
- .tnt-queryform-composition-input-clear {
99
- display: block;
100
- }
101
- // box-shadow: 0 0 0 2px rgb(18 107 251 / 20%);
102
- }
103
- &:focus,
104
- &:active {
105
- border-color: @blue-5;
106
- outline: 0;
107
- // box-shadow: 0 0 0 2px rgb(18 107 251 / 20%);
108
- }
109
- .ant-tag {
110
- padding: 0 @padding-xs;
111
- border: none;
112
- background: @fill-color-tertiary;
113
- height: 20px;
114
- .ant-tag-addon-wrap {
115
- margin-top: -2px;
116
- }
117
- }
118
- }
@@ -1,22 +0,0 @@
1
- export function highlightSubstring(str: any, substring: any): any;
2
- export function getLabelFromOptions(key: any, options: any, fieldNames?: {
3
- label: string;
4
- value: string;
5
- }): any;
6
- export function getLabelByValue({ value, options, fieldNames, }: {
7
- value: any;
8
- options: any;
9
- fieldNames?: {
10
- label: string;
11
- value: string;
12
- } | undefined;
13
- }): any;
14
- export function formatLabel(reactDom: any): any;
15
- export function parseObjectToArray(value: any, data: any): (false | {
16
- key: string;
17
- value: any;
18
- closable: boolean;
19
- label: string;
20
- } | null)[];
21
- export function parseArrayToObject(value: any): any;
22
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/query-form-v3/Field/Composition/utils.js"],"names":[],"mappings":"AAIA,kEAGC;AAED;;;QAkBC;AAED;;;;;;;QAqBC;AAED,gDAWC;AAED;;;;;YA8DC;AAED,oDAKC"}