tntd 3.0.42 → 3.0.43

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 (465) hide show
  1. package/CHANGELOG.json +1034 -0
  2. package/CHANGELOG.md +605 -0
  3. package/es/_util/context.js +1 -1
  4. package/es/_util/defaultRenderEmpty.js +1 -1
  5. package/es/_util/hooks/useFlexGapSupport.js +4 -4
  6. package/es/_util/hooks/useForceUpdate.js +4 -4
  7. package/es/_util/responsiveObserve.js +1 -1
  8. package/es/_util/styleChecker.js +1 -1
  9. package/es/actions/index.js +1 -1
  10. package/es/alert/alert.js +2 -2
  11. package/es/alert/index.js +1 -1
  12. package/es/array-input/index.js +9 -9
  13. package/es/button/button.js +2 -2
  14. package/es/cascader/cascader.js +1 -1
  15. package/es/check-card/group.js +8 -8
  16. package/es/check-card/index.js +6 -6
  17. package/es/checkbox/checkbox-group.js +16 -0
  18. package/es/checkbox/checkbox-group.js.map +1 -0
  19. package/es/checkbox/checkbox.js +1 -1
  20. package/es/color-picker/ColorPicker.js +6 -6
  21. package/es/color-picker/index.js +1 -1
  22. package/es/columns/index.js +1 -1
  23. package/es/config-provider/config-provider.js +1 -1
  24. package/es/date-picker/DatePicker.js +1 -1
  25. package/es/descriptions/descriptions.js +5 -5
  26. package/es/development-login/LoginModal.js +6 -6
  27. package/es/development-login/index.js +4 -4
  28. package/es/drawer/drawer.js +2 -2
  29. package/es/ellipsis/Svg/CopySVG.js +1 -1
  30. package/es/ellipsis/Svg/TickSVG.js +1 -1
  31. package/es/ellipsis/index.js +5 -5
  32. package/es/empty/empty.js +2 -2
  33. package/es/empty/empty.stories.js +2 -2
  34. package/es/exception/exception.js +1 -1
  35. package/es/form/form.js +2 -2
  36. package/es/grid-v4/col.js +2 -2
  37. package/es/grid-v4/hooks/useBreakpoint.js +1 -1
  38. package/es/grid-v4/index.js +1 -1
  39. package/es/grid-v4/row.js +6 -6
  40. package/es/handle/index.js +1 -1
  41. package/es/handle-icon/index.js +11 -11
  42. package/es/icon/IconFont.js +1 -1
  43. package/es/icon/components/Icon.js +9 -9
  44. package/es/icon/components/index.js +1 -1
  45. package/es/icon/components/utils.js +3 -3
  46. package/es/icon/index.js +7 -7
  47. package/es/icon/twoTonePrimaryColor.js +1 -1
  48. package/es/icon/utils.js +1 -1
  49. package/es/img/Contain.js +1 -1
  50. package/es/img/Cover.js +5 -5
  51. package/es/img/index.js +5 -5
  52. package/es/index.js +1 -1
  53. package/es/input/input.js +2 -2
  54. package/es/input-number/inputNumber.js +1 -1
  55. package/es/label/index.js +2 -2
  56. package/es/loading-button/index.js +5 -5
  57. package/es/locale/default.js +1 -1
  58. package/es/locale/en_US.js +1 -1
  59. package/es/locale/zh_CN.js +1 -1
  60. package/es/modal/modal.js +1 -1
  61. package/es/notification/assets/index.js +1 -1
  62. package/es/notification/index.js +1 -1
  63. package/es/notification/notification.js +1 -1
  64. package/es/page/Box.js +1 -1
  65. package/es/page/index.js +7 -7
  66. package/es/page-container/index.js +1 -1
  67. package/es/page-loading/index.js +1 -1
  68. package/es/popconfirm/popconfirm.js +1 -1
  69. package/es/popover/popover.js +1 -1
  70. package/es/preview-text/index.js +7 -7
  71. package/es/progress/progress.js +2 -2
  72. package/es/query-form/Field/Checkbox.js +1 -1
  73. package/es/query-form/Field/Select.js +6 -6
  74. package/es/query-form/Field/SelectInput.js +6 -6
  75. package/es/query-form/Field/fieldsMap.js +1 -1
  76. package/es/query-form/Field/index.js +10 -10
  77. package/es/query-form/createActions.js +1 -1
  78. package/es/query-form/index.js +10 -10
  79. package/es/query-form/useForm.js +1 -1
  80. package/es/query-list-scene/List.js +13 -13
  81. package/es/query-list-scene/QueryForm.js +9 -9
  82. package/es/query-list-scene/QueryListScene.js +10 -10
  83. package/es/query-list-scene/Title.js +1 -1
  84. package/es/query-list-scene/Toolbar.js +2 -2
  85. package/es/query-list-scene/createActions.js +1 -1
  86. package/es/query-list-scene/index.js +1 -1
  87. package/es/query-list-scene/useActions.js +1 -1
  88. package/es/radio/radio-group.js +16 -0
  89. package/es/radio/radio-group.js.map +1 -0
  90. package/es/radio/radio.js +1 -1
  91. package/es/render-empty/render-empty.js +1 -1
  92. package/es/segmented/index.js +2 -2
  93. package/es/select/select.js +2 -2
  94. package/es/spin/spin.js +1 -1
  95. package/es/steps/stepStyle/small.less +5 -0
  96. package/es/steps/steps.js +2 -2
  97. package/es/svg-components/index.js +1 -1
  98. package/es/table/hooks/use-column-setting.js +4 -4
  99. package/es/table/hooks/use-expand-fixed.js +6 -6
  100. package/es/table/resizableTable/index.js +6 -6
  101. package/es/table/table-hoc.js +1 -1
  102. package/es/table/table.js +9 -9
  103. package/es/table/table.stories.js +2 -2
  104. package/es/table/total-shower.js +20 -0
  105. package/es/table/total-shower.js.map +1 -0
  106. package/es/table/utils.js +1 -1
  107. package/es/table-container/index.js +1 -1
  108. package/es/tabs/tabs.js +2 -2
  109. package/es/tabs-container/index.js +1 -1
  110. package/es/tag/tag.js +2 -2
  111. package/es/time-picker/TimePicker.js +1 -1
  112. package/es/time-picker/index.js +1 -1
  113. package/es/title/index.js +1 -1
  114. package/es/tntd-action/Action.js +9 -9
  115. package/es/tntd-action/index.js +8 -8
  116. package/es/tntd-cascader/AntdCascader/component/context.js +1 -1
  117. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  118. package/es/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
  119. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
  120. package/es/tntd-cascader/AntdCascader/config/utils.js +2 -2
  121. package/es/tntd-cascader/AntdCascader/index.js +7 -7
  122. package/es/tntd-cascader/index.js +1 -1
  123. package/es/tntd-cascader/rc-cascader/Cascader.js +8 -8
  124. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
  125. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
  126. package/es/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
  127. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
  128. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
  129. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
  130. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
  131. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
  132. package/es/tntd-cascader/rc-cascader/index.js +1 -1
  133. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
  134. package/es/tntd-form/ErrorList.js +7 -7
  135. package/es/tntd-form/Form.js +6 -6
  136. package/es/tntd-form/FormItem/ItemHolder.js +6 -6
  137. package/es/tntd-form/FormItem/index.js +8 -8
  138. package/es/tntd-form/FormItemInput.js +1 -1
  139. package/es/tntd-form/FormItemLabel.js +2 -2
  140. package/es/tntd-form/FormList.js +1 -1
  141. package/es/tntd-form/context.js +1 -1
  142. package/es/tntd-form/hooks/useDebounce.js +4 -4
  143. package/es/tntd-form/hooks/useForm.js +5 -5
  144. package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
  145. package/es/tntd-form/hooks/useFrameState.js +5 -5
  146. package/es/tntd-form/index.js +1 -1
  147. package/es/tntd-icon/index.js +1 -1
  148. package/es/tntd-layout/AppList.js +6 -6
  149. package/es/tntd-layout/Application.js +6 -6
  150. package/es/tntd-layout/Avatar.js +2 -2
  151. package/es/tntd-layout/CompatibleLanguage.js +6 -6
  152. package/es/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
  153. package/es/tntd-layout/EnterpriseLayout/Language.js +6 -6
  154. package/es/tntd-layout/EnterpriseLayout/Theme.js +6 -6
  155. package/es/tntd-layout/EnterpriseLayout/index.js +1 -1
  156. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
  157. package/es/tntd-layout/GlobalNavigation/index.js +9 -9
  158. package/es/tntd-layout/Header.js +2 -2
  159. package/es/tntd-layout/HeaderActions.js +2 -2
  160. package/es/tntd-layout/HeaderNavs.js +6 -6
  161. package/es/tntd-layout/HeaderTabs.js +7 -7
  162. package/es/tntd-layout/Iconfont.js +1 -1
  163. package/es/tntd-layout/Language.js +6 -6
  164. package/es/tntd-layout/Layout.js +6 -6
  165. package/es/tntd-layout/Logo.js +2 -2
  166. package/es/tntd-layout/OrgAppList.js +6 -6
  167. package/es/tntd-layout/SideMenu.js +6 -6
  168. package/es/tntd-layout/Theme.js +6 -6
  169. package/es/tntd-layout/createActions.js +1 -1
  170. package/es/tntd-layout/images/index.js +1 -1
  171. package/es/tntd-layout/index.js +1 -1
  172. package/es/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
  173. package/es/tntd-layout/paaslayout/Header.js +2 -2
  174. package/es/tntd-layout/paaslayout/Logo.js +2 -2
  175. package/es/tntd-layout/paaslayout/SideMenu.js +6 -6
  176. package/es/tntd-layout/paaslayout/index.js +6 -6
  177. package/es/tntd-layout/storage.js +1 -1
  178. package/es/tntd-modal/index.js +6 -6
  179. package/es/tntd-rc-select/_util/PurePanel.js +5 -5
  180. package/es/tntd-rc-select/_util/context.js +1 -1
  181. package/es/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
  182. package/es/tntd-rc-select/_util/getIcons.js +1 -1
  183. package/es/tntd-rc-select/_util/useCompactItemContext.js +2 -2
  184. package/es/tntd-rc-select/index.js +2 -2
  185. package/es/tntd-reference/AHref/index.js +1 -1
  186. package/es/tntd-reference/ReferenceBatchCheck/index.js +1 -1
  187. package/es/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
  188. package/es/tntd-reference/ReferenceCheck/index.js +1 -1
  189. package/es/tntd-reference/ReferenceDrawer/index.js +5 -5
  190. package/es/tntd-reference/ReferenceInfo/index.js +1 -1
  191. package/es/tntd-reference/index.js +1 -1
  192. package/es/tntd-second-page/index.js +1 -1
  193. package/es/tntd-select/DropDownWrap.js +8 -8
  194. package/es/tntd-select/index.js +9 -10
  195. package/es/tntd-virtual-tree/index.js +8 -8
  196. package/es/tntd-virtual-tree/utils.js +28 -28
  197. package/es/tntd-virtual-tree-select/index.js +10 -10
  198. package/es/tntd-virtual-tree-select/utils.js +9 -9
  199. package/es/tooltip/tooltip.js +1 -1
  200. package/es/upload/index.js +6 -6
  201. package/es/upload/svg/UploadSVG.js +1 -1
  202. package/es/utils/checkAuth.js +4 -4
  203. package/es/utils/index.js +9 -9
  204. package/es/utils/lang.js +3 -3
  205. package/es/utils/simple-template.js +19 -0
  206. package/es/utils/simple-template.js.map +1 -0
  207. package/es/water-mark/index.js +5 -5
  208. package/lib/_util/context.js +3 -3
  209. package/lib/_util/defaultRenderEmpty.js +3 -3
  210. package/lib/_util/hooks/useFlexGapSupport.js +15 -14
  211. package/lib/_util/hooks/useForceUpdate.js +15 -14
  212. package/lib/_util/responsiveObserve.js +13 -7
  213. package/lib/_util/styleChecker.js +3 -3
  214. package/lib/actions/index.js +3 -3
  215. package/lib/alert/alert.js +16 -10
  216. package/lib/alert/index.js +3 -3
  217. package/lib/array-input/index.js +37 -30
  218. package/lib/button/button.js +16 -10
  219. package/lib/cascader/cascader.js +3 -3
  220. package/lib/check-card/group.js +24 -23
  221. package/lib/check-card/index.js +31 -24
  222. package/lib/checkbox/checkbox-group.d.ts +8 -0
  223. package/lib/checkbox/checkbox-group.d.ts.map +1 -0
  224. package/lib/checkbox/checkbox-group.js +16 -0
  225. package/lib/checkbox/checkbox-group.js.map +1 -0
  226. package/lib/checkbox/checkbox.js +3 -3
  227. package/lib/color-picker/ColorPicker.js +31 -24
  228. package/lib/color-picker/index.js +3 -3
  229. package/lib/columns/index.js +3 -3
  230. package/lib/config-provider/config-provider.js +3 -3
  231. package/lib/date-picker/DatePicker.js +3 -3
  232. package/lib/descriptions/descriptions.js +19 -13
  233. package/lib/development-login/LoginModal.js +31 -24
  234. package/lib/development-login/index.js +15 -14
  235. package/lib/drawer/drawer.js +16 -10
  236. package/lib/ellipsis/Svg/CopySVG.js +3 -3
  237. package/lib/ellipsis/Svg/TickSVG.js +3 -3
  238. package/lib/ellipsis/index.js +18 -17
  239. package/lib/empty/empty.js +16 -10
  240. package/lib/empty/empty.stories.js +9 -6
  241. package/lib/exception/exception.js +3 -3
  242. package/lib/form/form.js +16 -10
  243. package/lib/grid-v4/col.js +16 -10
  244. package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
  245. package/lib/grid-v4/index.js +3 -3
  246. package/lib/grid-v4/row.js +31 -24
  247. package/lib/handle/index.js +3 -3
  248. package/lib/handle-icon/index.js +13 -13
  249. package/lib/icon/IconFont.js +3 -3
  250. package/lib/icon/components/Icon.js +70 -44
  251. package/lib/icon/components/index.js +3 -3
  252. package/lib/icon/components/utils.js +18 -10
  253. package/lib/icon/index.js +33 -26
  254. package/lib/icon/twoTonePrimaryColor.js +3 -3
  255. package/lib/icon/utils.js +3 -3
  256. package/lib/img/Contain.js +3 -3
  257. package/lib/img/Cover.js +18 -17
  258. package/lib/img/index.js +18 -17
  259. package/lib/index.js +3 -3
  260. package/lib/input/input.js +16 -10
  261. package/lib/input-number/inputNumber.js +3 -3
  262. package/lib/label/index.js +16 -10
  263. package/lib/loading-button/index.js +18 -17
  264. package/lib/locale/default.js +3 -3
  265. package/lib/locale/en_US.js +3 -3
  266. package/lib/locale/zh_CN.js +3 -3
  267. package/lib/modal/modal.js +3 -3
  268. package/lib/notification/assets/index.js +3 -3
  269. package/lib/notification/index.js +3 -3
  270. package/lib/notification/notification.js +3 -3
  271. package/lib/page/Box.js +3 -3
  272. package/lib/page/index.js +33 -26
  273. package/lib/page-container/index.js +3 -3
  274. package/lib/page-loading/index.js +3 -3
  275. package/lib/popconfirm/popconfirm.js +3 -3
  276. package/lib/popover/popover.js +3 -3
  277. package/lib/preview-text/index.js +9 -9
  278. package/lib/progress/progress.js +16 -10
  279. package/lib/query-form/Field/Checkbox.js +3 -3
  280. package/lib/query-form/Field/Composition/FieldPopover.js +8 -46
  281. package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -1
  282. package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -1
  283. package/lib/query-form/Field/Composition/ValueTag.js +3 -6
  284. package/lib/query-form/Field/Composition/ValueTag.js.map +1 -1
  285. package/lib/query-form/Field/Composition/index.d.ts +0 -2
  286. package/lib/query-form/Field/Composition/index.js +16 -32
  287. package/lib/query-form/Field/Composition/index.js.map +1 -1
  288. package/lib/query-form/Field/Composition/utils.d.ts +1 -1
  289. package/lib/query-form/Field/Composition/utils.d.ts.map +1 -1
  290. package/lib/query-form/Field/Composition/utils.js +46 -47
  291. package/lib/query-form/Field/Composition/utils.js.map +1 -1
  292. package/lib/query-form/Field/Select.js +31 -24
  293. package/lib/query-form/Field/SelectInput.js +31 -24
  294. package/lib/query-form/Field/fieldsMap.js +3 -3
  295. package/lib/query-form/Field/index.js +73 -47
  296. package/lib/query-form/createActions.js +3 -3
  297. package/lib/query-form/index.js +70 -44
  298. package/lib/query-form/useForm.js +3 -3
  299. package/lib/query-list-scene/List.js +61 -41
  300. package/lib/query-list-scene/QueryForm.js +57 -37
  301. package/lib/query-list-scene/QueryListScene.js +70 -44
  302. package/lib/query-list-scene/Title.js +3 -3
  303. package/lib/query-list-scene/Toolbar.js +16 -10
  304. package/lib/query-list-scene/createActions.js +3 -3
  305. package/lib/query-list-scene/index.js +3 -3
  306. package/lib/query-list-scene/useActions.js +3 -3
  307. package/lib/radio/radio-group.d.ts +8 -0
  308. package/lib/radio/radio-group.d.ts.map +1 -0
  309. package/lib/radio/radio-group.js +16 -0
  310. package/lib/radio/radio-group.js.map +1 -0
  311. package/lib/radio/radio.js +3 -3
  312. package/lib/render-empty/render-empty.js +3 -3
  313. package/lib/segmented/index.js +16 -10
  314. package/lib/select/select.js +16 -10
  315. package/lib/spin/spin.js +3 -3
  316. package/lib/steps/stepStyle/small.less +5 -0
  317. package/lib/steps/steps.js +16 -10
  318. package/lib/svg-components/index.js +3 -3
  319. package/lib/table/hooks/use-column-setting.js +15 -14
  320. package/lib/table/hooks/use-expand-fixed.js +36 -30
  321. package/lib/table/resizableTable/index.js +31 -24
  322. package/lib/table/table-hoc.js +3 -3
  323. package/lib/table/table.js +34 -27
  324. package/lib/table/table.stories.js +16 -10
  325. package/lib/table/total-shower.d.ts +9 -0
  326. package/lib/table/total-shower.d.ts.map +1 -0
  327. package/lib/table/total-shower.js +20 -0
  328. package/lib/table/total-shower.js.map +1 -0
  329. package/lib/table/utils.js +3 -3
  330. package/lib/table-container/index.js +3 -3
  331. package/lib/tabs/tabs.js +16 -10
  332. package/lib/tabs-container/index.js +3 -3
  333. package/lib/tag/tag.js +16 -10
  334. package/lib/time-picker/TimePicker.js +3 -3
  335. package/lib/time-picker/index.js +3 -3
  336. package/lib/title/index.js +3 -3
  337. package/lib/tntd-action/Action.js +22 -21
  338. package/lib/tntd-action/index.js +21 -20
  339. package/lib/tntd-cascader/AntdCascader/component/context.js +3 -3
  340. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +3 -3
  341. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +3 -3
  342. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +16 -10
  343. package/lib/tntd-cascader/AntdCascader/config/utils.js +16 -10
  344. package/lib/tntd-cascader/AntdCascader/index.js +33 -26
  345. package/lib/tntd-cascader/index.js +3 -3
  346. package/lib/tntd-cascader/rc-cascader/Cascader.js +24 -23
  347. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +16 -10
  348. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +33 -26
  349. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +37 -30
  350. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -17
  351. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +24 -23
  352. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +17 -16
  353. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
  354. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +30 -23
  355. package/lib/tntd-cascader/rc-cascader/index.js +3 -3
  356. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +6 -6
  357. package/lib/tntd-form/ErrorList.js +33 -26
  358. package/lib/tntd-form/Form.js +31 -24
  359. package/lib/tntd-form/FormItem/ItemHolder.js +31 -24
  360. package/lib/tntd-form/FormItem/index.js +24 -23
  361. package/lib/tntd-form/FormItemInput.js +3 -3
  362. package/lib/tntd-form/FormItemLabel.js +16 -10
  363. package/lib/tntd-form/FormList.js +3 -3
  364. package/lib/tntd-form/context.js +3 -3
  365. package/lib/tntd-form/hooks/useDebounce.js +15 -14
  366. package/lib/tntd-form/hooks/useForm.js +18 -17
  367. package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
  368. package/lib/tntd-form/hooks/useFrameState.js +18 -17
  369. package/lib/tntd-form/index.js +3 -3
  370. package/lib/tntd-icon/index.js +3 -3
  371. package/lib/tntd-layout/AppList.js +24 -20
  372. package/lib/tntd-layout/Application.js +24 -20
  373. package/lib/tntd-layout/Avatar.js +9 -6
  374. package/lib/tntd-layout/CompatibleLanguage.js +24 -20
  375. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +9 -6
  376. package/lib/tntd-layout/EnterpriseLayout/Language.js +24 -20
  377. package/lib/tntd-layout/EnterpriseLayout/Theme.js +24 -20
  378. package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
  379. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +24 -20
  380. package/lib/tntd-layout/GlobalNavigation/index.js +30 -26
  381. package/lib/tntd-layout/Header.js +9 -6
  382. package/lib/tntd-layout/HeaderActions.js +9 -6
  383. package/lib/tntd-layout/HeaderNavs.js +24 -20
  384. package/lib/tntd-layout/HeaderTabs.js +37 -27
  385. package/lib/tntd-layout/Iconfont.js +3 -3
  386. package/lib/tntd-layout/Language.js +24 -20
  387. package/lib/tntd-layout/Layout.js +24 -20
  388. package/lib/tntd-layout/Logo.js +9 -6
  389. package/lib/tntd-layout/OrgAppList.js +24 -20
  390. package/lib/tntd-layout/SideMenu.js +24 -20
  391. package/lib/tntd-layout/Theme.js +24 -20
  392. package/lib/tntd-layout/createActions.js +3 -3
  393. package/lib/tntd-layout/images/index.js +3 -3
  394. package/lib/tntd-layout/index.js +3 -3
  395. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +24 -20
  396. package/lib/tntd-layout/paaslayout/Header.js +9 -6
  397. package/lib/tntd-layout/paaslayout/Logo.js +9 -6
  398. package/lib/tntd-layout/paaslayout/SideMenu.js +24 -20
  399. package/lib/tntd-layout/paaslayout/index.js +24 -20
  400. package/lib/tntd-layout/storage.js +3 -3
  401. package/lib/tntd-modal/index.js +31 -24
  402. package/lib/tntd-rc-select/_util/PurePanel.js +18 -17
  403. package/lib/tntd-rc-select/_util/context.js +3 -3
  404. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +3 -3
  405. package/lib/tntd-rc-select/_util/getIcons.js +3 -3
  406. package/lib/tntd-rc-select/_util/useCompactItemContext.js +16 -10
  407. package/lib/tntd-rc-select/index.js +16 -10
  408. package/lib/tntd-reference/AHref/index.js +3 -3
  409. package/lib/tntd-reference/ReferenceBatchCheck/index.js +3 -3
  410. package/lib/tntd-reference/ReferenceBatchDrawer/index.js +18 -17
  411. package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
  412. package/lib/tntd-reference/ReferenceDrawer/index.js +18 -17
  413. package/lib/tntd-reference/ReferenceInfo/index.js +3 -3
  414. package/lib/tntd-reference/index.js +3 -3
  415. package/lib/tntd-second-page/index.js +3 -3
  416. package/lib/tntd-select/DropDownWrap.js +54 -34
  417. package/lib/tntd-select/index.js +57 -40
  418. package/lib/tntd-virtual-tree/index.js +24 -23
  419. package/lib/tntd-virtual-tree/utils.js +66 -62
  420. package/lib/tntd-virtual-tree-select/index.js +23 -22
  421. package/lib/tntd-virtual-tree-select/utils.js +21 -20
  422. package/lib/tooltip/tooltip.js +3 -3
  423. package/lib/upload/index.js +45 -41
  424. package/lib/upload/svg/UploadSVG.js +3 -3
  425. package/lib/utils/checkAuth.js +6 -6
  426. package/lib/utils/index.js +21 -20
  427. package/lib/utils/lang.js +5 -5
  428. package/lib/utils/simple-template.d.ts +9 -0
  429. package/lib/utils/simple-template.d.ts.map +1 -0
  430. package/lib/utils/simple-template.js +19 -0
  431. package/lib/utils/simple-template.js.map +1 -0
  432. package/lib/water-mark/index.js +18 -17
  433. package/package.json +2 -2
  434. package/es/query-form/Field/Composition/FieldPopover.js +0 -457
  435. package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
  436. package/es/query-form/Field/Composition/FieldPopover.less +0 -35
  437. package/es/query-form/Field/Composition/Select.js +0 -253
  438. package/es/query-form/Field/Composition/Select.js.map +0 -1
  439. package/es/query-form/Field/Composition/SelectInput.js +0 -111
  440. package/es/query-form/Field/Composition/SelectInput.js.map +0 -1
  441. package/es/query-form/Field/Composition/ValueTag.js +0 -239
  442. package/es/query-form/Field/Composition/ValueTag.js.map +0 -1
  443. package/es/query-form/Field/Composition/index.js +0 -441
  444. package/es/query-form/Field/Composition/index.js.map +0 -1
  445. package/es/query-form/Field/Composition/index.less +0 -145
  446. package/es/query-form/Field/Composition/utils.js +0 -173
  447. package/es/query-form/Field/Composition/utils.js.map +0 -1
  448. package/es/query-form-v2/index.less +0 -133
  449. package/es/scroll-bar/Bar.js +0 -168
  450. package/es/scroll-bar/Bar.js.map +0 -1
  451. package/es/scroll-bar/Context.js +0 -17
  452. package/es/scroll-bar/Context.js.map +0 -1
  453. package/es/scroll-bar/ScrollBar.js +0 -132
  454. package/es/scroll-bar/ScrollBar.js.map +0 -1
  455. package/es/scroll-bar/Thumb.js +0 -202
  456. package/es/scroll-bar/Thumb.js.map +0 -1
  457. package/es/scroll-bar/index.js +0 -14
  458. package/es/scroll-bar/index.js.map +0 -1
  459. package/es/scroll-bar/scrollBar.less +0 -59
  460. package/es/scroll-bar/util.js +0 -66
  461. package/es/scroll-bar/util.js.map +0 -1
  462. package/lib/query-form/Field/Composition/SelectInput.d.ts +0 -3
  463. package/lib/query-form/Field/Composition/SelectInput.d.ts.map +0 -1
  464. package/lib/query-form/Field/Composition/SelectInput.js +0 -111
  465. package/lib/query-form/Field/Composition/SelectInput.js.map +0 -1
@@ -1,173 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatLabel = formatLabel;
7
- exports.getLabel = getLabel;
8
- exports.getLabelByValue = getLabelByValue;
9
- exports.highlightSubstring = highlightSubstring;
10
- exports.isInput = void 0;
11
- exports.parseArrayToObject = parseArrayToObject;
12
- exports.parseObjectToArray = parseObjectToArray;
13
- var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
14
- var _isString2 = _interopRequireDefault(require("lodash/isString"));
15
- var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
16
- var _react = _interopRequireDefault(require("react"));
17
- var _moment = _interopRequireDefault(require("moment"));
18
- function _interopRequireDefault(e) {
19
- return e && e.__esModule ? e : {
20
- "default": e
21
- };
22
- }
23
- function highlightSubstring(str, substring) {
24
- var highlighted = "<span class=\"tnt-highlight\">".concat(substring, "</span>");
25
- return str.replace(new RegExp(substring, 'g'), highlighted);
26
- }
27
- function getLabelByValue(_ref) {
28
- var value = _ref.value,
29
- options = _ref.options,
30
- _ref$fieldNames = _ref.fieldNames,
31
- fieldNames = _ref$fieldNames === void 0 ? {
32
- label: 'label',
33
- value: 'value'
34
- } : _ref$fieldNames;
35
- var getLabel = function getLabel(value) {
36
- var target = options === null || options === void 0 ? void 0 : options.find(function (item) {
37
- var valueKey = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
38
- var itemValue = item instanceof Object ? item[valueKey] : item;
39
- return itemValue === value;
40
- });
41
- if (target) {
42
- return target instanceof Object ? target === null || target === void 0 ? void 0 : target[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label] : target;
43
- } else {
44
- return value;
45
- }
46
- };
47
- if ((0, _isArray2["default"])(value)) {
48
- return value.map(getLabel).join(' | ');
49
- } else {
50
- return getLabel(value);
51
- }
52
- }
53
- function formatLabel(reactDom) {
54
- return (0, _flatten2["default"])(_react["default"].Children.map(reactDom.props.children, function (child) {
55
- if (_react["default"].isValidElement(child)) {
56
- return formatLabel(child);
57
- } else if ((0, _isString2["default"])(child)) {
58
- return child;
59
- }
60
- return '';
61
- })).join('');
62
- }
63
- function parseObjectToArray(value, data) {
64
- var _a, _b;
65
- return (_b = (_a = Object.keys(value || {})) === null || _a === void 0 ? void 0 : _a.map(function (key) {
66
- var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
67
- var _a, _b;
68
- return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key || ((_b = item.props) === null || _b === void 0 ? void 0 : _b.pName) === key;
69
- });
70
- if (!target) return null;
71
- var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
72
- var _ref2 = dataItem || {},
73
- _ref2$type = _ref2.type,
74
- type = _ref2$type === void 0 ? 'input' : _ref2$type,
75
- component = _ref2.component,
76
- setLabel = _ref2.setLabel;
77
- if (!type && component && !setLabel) {
78
- console.error('自定义组件需要传入setLabel()方法');
79
- }
80
- return {
81
- key: key,
82
- value: value[key]
83
- };
84
- })) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
85
- return !!item;
86
- });
87
- }
88
- function parseArrayToObject(value) {
89
- return value === null || value === void 0 ? void 0 : value.reduce(function (acc, v) {
90
- acc[v.key] = v.value;
91
- return acc;
92
- }, {});
93
- }
94
- function getLabel(_ref3, data, locale) {
95
- var key = _ref3.key,
96
- value = _ref3.value;
97
- var _a, _b, _c, _d;
98
- var otherTarget = data === null || data === void 0 ? void 0 : data.find(function (item) {
99
- var _a;
100
- return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.pName) === key;
101
- });
102
- if (otherTarget) {
103
- // otherInput
104
- var selectKey = (_a = Object.keys(value || {})) === null || _a === void 0 ? void 0 : _a[0];
105
- if (!selectKey) {
106
- // 17. inputSelect组件,初始值{},展示undefined:undefined
107
- return false;
108
- }
109
- var otherTargetObj = data.find(function (item) {
110
- return item.props.pName === key && item.props.cName === selectKey;
111
- });
112
- if (!otherTargetObj) {
113
- return false;
114
- }
115
- return otherTargetObj.props.title + ':' + (value[selectKey] || '');
116
- }
117
- var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
118
- var _a;
119
- return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key;
120
- });
121
- if (!target) return null;
122
- var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
123
- var _ref4 = dataItem || {},
124
- _ref4$type = _ref4.type,
125
- type = _ref4$type === void 0 ? 'input' : _ref4$type,
126
- setLabel = _ref4.setLabel,
127
- fieldProps = _ref4.props,
128
- propsTitle = _ref4.propsTitle,
129
- title = _ref4.title,
130
- name = _ref4.name;
131
- var _propsTitle = propsTitle || title || name;
132
- var _ref5 = fieldProps || {},
133
- options = _ref5.options,
134
- format = _ref5.format;
135
- var labelValue = value;
136
- if (setLabel) {
137
- // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制
138
- labelValue = setLabel(value);
139
- } else if (options) {
140
- if (type === 'selectInput') {
141
- var _selectKey = (_b = Object.keys(value || {})) === null || _b === void 0 ? void 0 : _b[0];
142
- if (!_selectKey) {
143
- // 17. inputSelect组件,初始值{},展示undefined:undefined
144
- return false;
145
- }
146
- var inputValue = value[_selectKey];
147
- var selectLabel = (_c = options === null || options === void 0 ? void 0 : options.find(function (v) {
148
- return v.value === _selectKey;
149
- })) === null || _c === void 0 ? void 0 : _c.label;
150
- return selectLabel + ':' + inputValue;
151
- }
152
- labelValue = getLabelByValue({
153
- value: value,
154
- options: options,
155
- fieldNames: ((_d = dataItem === null || dataItem === void 0 ? void 0 : dataItem.props) === null || _d === void 0 ? void 0 : _d.fieldNames) || {
156
- label: 'label',
157
- value: 'value'
158
- }
159
- });
160
- } else if (type === 'checkbox') {
161
- labelValue = value ? locale.yes : locale.no;
162
- } else if (type === 'dateRange' && format) {
163
- if (value === null || value === void 0 ? void 0 : value.length) {
164
- labelValue = [(0, _moment["default"])(value === null || value === void 0 ? void 0 : value[0]).format(format), (0, _moment["default"])(value === null || value === void 0 ? void 0 : value[1]).format(format)].join('~');
165
- }
166
- } else if (type === 'date' && format) {
167
- labelValue = value ? (0, _moment["default"])(value).format(format) : undefined;
168
- }
169
- return _propsTitle + ':' + (labelValue === undefined ? '' : labelValue);
170
- }
171
- var isInput = exports.isInput = function isInput(type) {
172
- return ['input', 'string', 'search', 'aloneSearch', 'number', 'inputNumber', 'otherInput'].includes(type);
173
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/utils.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,UAAU,kBAAkB,CAAC,GAAG,EAAE,SAAS;IAC/C,MAAM,WAAW,GAAG,+BAA+B,SAAS,SAAS,CAAA;IACrE,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,WAAW,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,OAAO,EACP,UAAU,GAAG;IACX,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACf,GACF;IACC,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,EAAE;QACzB,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAA;YAClC,MAAM,SAAS,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YAChE,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G,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SAC9F;KACF;SAAM,IAAI,IAAI,KAAK,MAAM,IAAI,MAAM,EAAE;QACpC,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;KAC9D;IACD,OAAO,WAAW,GAAG,GAAG,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;AACzE,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,CAC9B,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { isArray, isString, flatten } from 'lodash'\nimport moment from 'moment'\n\nexport function highlightSubstring(str, substring) {\n const highlighted = `<span class=\"tnt-highlight\">${substring}</span>`\n return str.replace(new RegExp(substring, 'g'), highlighted)\n}\n\nexport function getLabelByValue({\n value,\n options,\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n}) {\n const getLabel = (value) => {\n const target = options?.find((item) => {\n const valueKey = fieldNames?.value\n const itemValue = item instanceof Object ? item[valueKey] : item\n return itemValue === value\n })\n if (target) {\n return target instanceof Object ? target?.[fieldNames?.label] : target\n } else {\n return value\n }\n }\n if (isArray(value)) {\n return value.map(getLabel).join(' | ')\n } else {\n return getLabel(value)\n }\n}\n\nexport function formatLabel(reactDom) {\n return flatten(\n React.Children.map(reactDom.props.children, (child) => {\n if (React.isValidElement(child)) {\n return formatLabel(child)\n } else if (isString(child)) {\n return child\n }\n return ''\n })\n ).join('')\n}\n\nexport function parseObjectToArray(value, data) {\n return Object.keys(value || {})\n ?.map((key) => {\n const target = data?.find((item) => item.props?.name === key || item.props?.pName === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const { type = 'input', component, setLabel } = dataItem || {}\n if (!type && component && !setLabel) {\n console.error('自定义组件需要传入setLabel()方法')\n }\n return {\n key,\n value: value[key],\n }\n })\n ?.filter((item) => !!item)\n}\n\nexport function parseArrayToObject(value) {\n return value?.reduce((acc, v) => {\n acc[v.key] = v.value\n return acc\n }, {})\n}\n\nexport function getLabel({ key, value }, data, locale) {\n const otherTarget = data?.find((item) => item.props?.pName === key)\n if (otherTarget) {\n // otherInput\n const selectKey = Object.keys(value || {})?.[0]\n if (!selectKey) {\n // 17. inputSelect组件,初始值{},展示undefined:undefined\n return false\n }\n const otherTargetObj = data.find(\n (item) => item.props.pName === key && item.props.cName === selectKey\n )\n if (!otherTargetObj) {\n return false\n }\n return otherTargetObj.props.title + ':' + (value[selectKey] || '')\n }\n\n const target = data?.find((item) => item.props?.name === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const { type = 'input', setLabel, props: fieldProps, propsTitle, title, name } = dataItem || {}\n const _propsTitle = propsTitle || title || name\n const { options, format } = fieldProps || {}\n let labelValue = value\n if (setLabel) {\n // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制\n labelValue = setLabel(value)\n } else if (options) {\n if (type === 'selectInput') {\n const selectKey = Object.keys(value || {})?.[0]\n if (!selectKey) {\n // 17. inputSelect组件,初始值{},展示undefined:undefined\n return false\n }\n const inputValue = value[selectKey]\n const selectLabel = options?.find((v) => v.value === selectKey)?.label\n return selectLabel + ':' + inputValue\n }\n labelValue = getLabelByValue({\n value,\n options,\n fieldNames: dataItem?.props?.fieldNames || {\n label: 'label',\n value: 'value',\n },\n })\n } else if (type === 'checkbox') {\n labelValue = value ? locale.yes : locale.no\n } else if (type === 'dateRange' && format) {\n if (value?.length) {\n labelValue = [moment(value?.[0]).format(format), moment(value?.[1]).format(format)].join('~')\n }\n } else if (type === 'date' && format) {\n labelValue = value ? moment(value).format(format) : undefined\n }\n return _propsTitle + ':' + (labelValue === undefined ? '' : labelValue)\n}\n\nexport const isInput = (type) =>\n ['input', 'string', 'search', 'aloneSearch', 'number', 'inputNumber', 'otherInput'].includes(type)\n"]}
@@ -1,133 +0,0 @@
1
- .tnt-queryform {
2
- display: flex;
3
-
4
- &-extra {
5
- line-height: 32px;
6
- margin-left: 12px;
7
- & > * {
8
- margin-left: 8px;
9
- }
10
- }
11
-
12
- &-actions {
13
- align-items: center;
14
- display: inline-block;
15
- height: 32px;
16
- line-height: 32px;
17
-
18
- & > *:not(.expand-link) {
19
- margin-right: 10px;
20
- }
21
- & > .expand-link {
22
- padding: 0;
23
- margin-right: 0;
24
- }
25
- & > .ant-badge {
26
- .tnt-icon {
27
- margin-right: 8px;
28
- }
29
- }
30
- }
31
-
32
- .ant-form {
33
- display: inline-block;
34
- margin-bottom: 12px;
35
- display: flex;
36
- flex: 1;
37
- &.ant-form-inline {
38
- flex-wrap: unset;
39
- }
40
-
41
- & > div:nth-child(1) {
42
- height: 32px;
43
- overflow: hidden;
44
- .ant-form-item-label {
45
- label {
46
- // bottom: 4px;
47
- }
48
- }
49
- }
50
-
51
- &.expanded {
52
- & > div:nth-child(1) {
53
- height: auto !important;
54
- }
55
- }
56
-
57
- &.showMore {
58
- & > div:nth-child(1) {
59
- .ant-form-item {
60
- margin-bottom: 12px;
61
- }
62
- }
63
- }
64
-
65
- & > div:nth-child(2) {
66
- display: flex;
67
- }
68
-
69
- &.ant-form-inline .ant-form-item {
70
- margin-right: 10px;
71
- display: inline-block;
72
- }
73
-
74
- .ant-form-item-control {
75
- // min-width: 160px;
76
- line-height: unset;
77
- .ant-calendar-picker-input {
78
- padding: 0 11px;
79
- }
80
- .ant-form-item-children {
81
- & > .ant-input,
82
- & > .ant-input-affix-wrapper {
83
- width: 160px;
84
- // width: 200px;
85
- }
86
- }
87
- }
88
- }
89
-
90
- &-drawer {
91
- margin-top: 50px;
92
- &.large-size {
93
- margin-top: 60px;
94
- }
95
-
96
- &.ant-drawer.ant-drawer-open {
97
- .ant-drawer-mask {
98
- opacity: 0;
99
- background: unset;
100
- }
101
- }
102
- .ant-drawer-body {
103
- .ant-form-item {
104
- display: block;
105
- margin-right: 0;
106
- margin-bottom: 20px;
107
- width: 100%;
108
- }
109
- .ant-form-item-label {
110
- display: block;
111
- text-align: left;
112
- line-height: 22px;
113
- margin-bottom: 10px;
114
- }
115
- .ant-form-item-control-wrapper,
116
- .ant-form-item-control,
117
- .ant-calendar-picker,
118
- .ant-input {
119
- min-width: 100%;
120
- width: 100%;
121
- }
122
-
123
- & > .ant-btn {
124
- display: block;
125
- width: 100%;
126
- margin-bottom: 10px;
127
- &.ant-btn-primary {
128
- margin-top: 20px;
129
- }
130
- }
131
- }
132
- }
133
- }
@@ -1,168 +0,0 @@
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 _react = _interopRequireWildcard(require("react"));
17
- var _Context = _interopRequireDefault(require("./Context"));
18
- var _Thumb = _interopRequireDefault(require("./Thumb"));
19
- var _util = require("./util");
20
- function _interopRequireDefault(e) {
21
- return e && e.__esModule ? e : {
22
- "default": e
23
- };
24
- }
25
- function _getRequireWildcardCache(e) {
26
- if ("function" != typeof WeakMap) return null;
27
- var r = new WeakMap(),
28
- t = new WeakMap();
29
- return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
30
- return e ? t : r;
31
- })(e);
32
- }
33
- function _interopRequireWildcard(e, r) {
34
- if (!r && e && e.__esModule) return e;
35
- if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
36
- "default": e
37
- };
38
- var t = _getRequireWildcardCache(r);
39
- if (t && t.has(e)) return t.get(e);
40
- var n = {
41
- __proto__: null
42
- },
43
- a = Object.defineProperty && Object.getOwnPropertyDescriptor;
44
- for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
45
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
46
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
47
- }
48
- return n["default"] = e, t && t.set(e, n), n;
49
- }
50
- function _slicedToArray(r, e) {
51
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
52
- }
53
- function _nonIterableRest() {
54
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
55
- }
56
- function _unsupportedIterableToArray(r, a) {
57
- if (r) {
58
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
59
- var t = {}.toString.call(r).slice(8, -1);
60
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
61
- }
62
- }
63
- function _arrayLikeToArray(r, a) {
64
- (null == a || a > r.length) && (a = r.length);
65
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
66
- return n;
67
- }
68
- function _iterableToArrayLimit(r, l) {
69
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
70
- if (null != t) {
71
- var e,
72
- n,
73
- i,
74
- u,
75
- a = [],
76
- f = !0,
77
- o = !1;
78
- try {
79
- if (i = (t = t.call(r)).next, 0 === l) {
80
- if (Object(t) !== t) return;
81
- f = !1;
82
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
83
- } catch (r) {
84
- o = !0, n = r;
85
- } finally {
86
- try {
87
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
88
- } finally {
89
- if (o) throw n;
90
- }
91
- }
92
- return a;
93
- }
94
- }
95
- function _arrayWithHoles(r) {
96
- if (Array.isArray(r)) return r;
97
- }
98
- var _default = exports["default"] = (0, _react.forwardRef)(function (props, ref) {
99
- var _useContext = (0, _react.useContext)(_Context["default"]),
100
- wrapElement = _useContext.wrapElement;
101
- var _useState = (0, _react.useState)(0),
102
- _useState2 = _slicedToArray(_useState, 2),
103
- moveX = _useState2[0],
104
- setMoveX = _useState2[1];
105
- var _useState3 = (0, _react.useState)(0),
106
- _useState4 = _slicedToArray(_useState3, 2),
107
- moveY = _useState4[0],
108
- setMoveY = _useState4[1];
109
- var _useState5 = (0, _react.useState)(0),
110
- _useState6 = _slicedToArray(_useState5, 2),
111
- sizeWidth = _useState6[0],
112
- setSizeWidth = _useState6[1];
113
- var _useState7 = (0, _react.useState)(0),
114
- _useState8 = _slicedToArray(_useState7, 2),
115
- sizeHeight = _useState8[0],
116
- setSizeHeight = _useState8[1];
117
- var _useState9 = (0, _react.useState)(1),
118
- _useState10 = _slicedToArray(_useState9, 2),
119
- ratioX = _useState10[0],
120
- setRatioX = _useState10[1];
121
- var _useState11 = (0, _react.useState)(1),
122
- _useState12 = _slicedToArray(_useState11, 2),
123
- ratioY = _useState12[0],
124
- setRatioY = _useState12[1];
125
- (0, _react.useImperativeHandle)(ref, function () {
126
- return {
127
- update: update,
128
- handleScroll: handleScroll
129
- };
130
- });
131
- function handleScroll() {
132
- var wrap = wrapElement.current;
133
- if (!wrap) return;
134
- var offsetHeight = wrap.offsetHeight - _util.GAP;
135
- var offsetWidth = wrap.offsetWidth - _util.GAP;
136
- setMoveY(wrap.scrollTop * 100 / offsetHeight * ratioY);
137
- setMoveX(wrap.scrollLeft * 100 / offsetWidth * ratioX);
138
- }
139
- function update() {
140
- var wrap = wrapElement.current;
141
- if (!wrap) return;
142
- // 滚动窗口的高度
143
- var offsetHeight = wrap.offsetHeight - _util.GAP;
144
- var offsetWidth = wrap.offsetWidth - _util.GAP;
145
- // 滚动条的逻辑高度
146
- var originalHeight = Math.pow(offsetHeight, 2) / wrap.scrollHeight;
147
- var originalWidth = Math.pow(offsetWidth, 2) / wrap.scrollWidth;
148
- // 滚动条的实际高度,因为如果内容太长会导致滚动条非常短,可能难以点击拖拽,所以设置了最小高度
149
- var height = Math.max(originalHeight, props.minSize);
150
- var width = Math.max(originalWidth, props.minSize);
151
- setRatioY(originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)));
152
- setRatioX(originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)));
153
- setSizeHeight(height + _util.GAP < offsetHeight ? height : 0);
154
- setSizeWidth(width + _util.GAP < offsetWidth ? width : 0);
155
- }
156
- return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_Thumb["default"], {
157
- always: props.always,
158
- move: moveX,
159
- size: sizeWidth,
160
- ratio: ratioX
161
- }), _react["default"].createElement(_Thumb["default"], {
162
- always: props.always,
163
- move: moveY,
164
- size: sizeHeight,
165
- ratio: ratioY,
166
- vertical: true
167
- }));
168
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"Bar.js","sourceRoot":"","sources":["../../src/scroll-bar/Bar.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpF,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,eAAe,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACvC,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAE3C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IACrC,MAAM,CAA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C,GAAG,IAAI,CAAC,YAAY,CAAA;QAC5D,MAAM,aAAa,GAAG,WAAW,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAA;QACzD,gDAAgD;QAChD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;QAEpD,SAAS,CAAC,cAAc,GAAG,CAAC,YAAY,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QAChG,SAAS,CAAC,aAAa,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC1F,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACvD,YAAY,CAAC,KAAK,GAAG,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACrD,CAAC;IAED,OAAO,CACL;QACE,oBAAC,KAAK,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAI;QAC5E,oBAAC,KAAK,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAG,CACrF,CACJ,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import React, { forwardRef, useContext, useImperativeHandle, useState } from 'react'\nimport Context from './Context'\nimport Thumb from './Thumb'\nimport { GAP } from './util'\n\nexport default forwardRef((props, ref) => {\n const { wrapElement } = useContext(Context)\n\n const [moveX, setMoveX] = useState(0)\n const [moveY, setMoveY] = useState(0)\n const [sizeWidth, setSizeWidth] = useState(0)\n const [sizeHeight, setSizeHeight] = useState(0)\n const [ratioX, setRatioX] = useState(1)\n const [ratioY, setRatioY] = useState(1)\n\n useImperativeHandle(ref, () => ({\n update,\n handleScroll,\n }))\n\n function handleScroll() {\n const wrap = wrapElement.current\n if (!wrap) return\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n setMoveY(((wrap.scrollTop * 100) / offsetHeight) * ratioY)\n setMoveX(((wrap.scrollLeft * 100) / offsetWidth) * ratioX)\n }\n\n function update() {\n const wrap = wrapElement.current\n if (!wrap) return\n // 滚动窗口的高度\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n // 滚动条的逻辑高度\n const originalHeight = offsetHeight ** 2 / wrap.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap.scrollWidth\n // 滚动条的实际高度,因为如果内容太长会导致滚动条非常短,可能难以点击拖拽,所以设置了最小高度\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n setRatioY(originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)))\n setRatioX(originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)))\n setSizeHeight(height + GAP < offsetHeight ? height : 0)\n setSizeWidth(width + GAP < offsetWidth ? width : 0)\n }\n\n return (\n <>\n <Thumb always={props.always} move={moveX} size={sizeWidth} ratio={ratioX} />\n <Thumb always={props.always} move={moveY} size={sizeHeight} ratio={ratioY} vertical />\n </>\n )\n})\n"]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- function _interopRequireDefault(e) {
9
- return e && e.__esModule ? e : {
10
- "default": e
11
- };
12
- }
13
- var Context = _react["default"].createContext({
14
- scrollbarElement: null,
15
- wrapElement: null
16
- });
17
- var _default = exports["default"] = Context;
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../src/scroll-bar/Context.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC;IAClC,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;CAClB,CAAC,CAAA;AAEF,eAAe,OAAO,CAAA","sourcesContent":["import React from 'react'\n\nconst Context = React.createContext({\n scrollbarElement: null,\n wrapElement: null,\n})\n\nexport default Context\n"]}
@@ -1,132 +0,0 @@
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 _classnames = _interopRequireDefault(require("classnames"));
17
- var _react = _interopRequireWildcard(require("react"));
18
- var _Bar = _interopRequireDefault(require("./Bar"));
19
- var _Context = _interopRequireDefault(require("./Context"));
20
- function _getRequireWildcardCache(e) {
21
- if ("function" != typeof WeakMap) return null;
22
- var r = new WeakMap(),
23
- t = new WeakMap();
24
- return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
25
- return e ? t : r;
26
- })(e);
27
- }
28
- function _interopRequireWildcard(e, r) {
29
- if (!r && e && e.__esModule) return e;
30
- if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
31
- "default": e
32
- };
33
- var t = _getRequireWildcardCache(r);
34
- if (t && t.has(e)) return t.get(e);
35
- var n = {
36
- __proto__: null
37
- },
38
- a = Object.defineProperty && Object.getOwnPropertyDescriptor;
39
- for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
40
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
41
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
42
- }
43
- return n["default"] = e, t && t.set(e, n), n;
44
- }
45
- function _interopRequireDefault(e) {
46
- return e && e.__esModule ? e : {
47
- "default": e
48
- };
49
- }
50
- var __rest = void 0 && (void 0).__rest || function (s, e) {
51
- var t = {};
52
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- };
58
- var _default = exports["default"] = (0, _react.forwardRef)(function (_a, ref) {
59
- var children = _a.children,
60
- _a$minSize = _a.minSize,
61
- minSize = _a$minSize === void 0 ? 20 : _a$minSize,
62
- props = __rest(_a, ["children", "minSize"]);
63
- var scrollbarElement = (0, _react.useRef)();
64
- var wrapElement = (0, _react.useRef)();
65
- wrapElement = ref || wrapElement;
66
- var resizeRef = (0, _react.useRef)();
67
- var barRef = (0, _react.useRef)();
68
- (0, _react.useEffect)(function () {
69
- var wrapDom = wrapElement.current;
70
- var resizeDom = resizeRef.current;
71
- // 监听容器尺寸变化,因为尺寸可以设置类似height:100vh之类样式,高度并不是固定的
72
- var observerCallback = function observerCallback() {
73
- return requestAnimationFrame(function () {
74
- var _a;
75
- update();
76
- (_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
77
- });
78
- };
79
- var observer = new ResizeObserver(observerCallback);
80
- observer.observe(wrapDom);
81
- observer.observe(resizeDom);
82
- return function () {
83
- observer.unobserve(wrapDom);
84
- observer.unobserve(resizeDom);
85
- };
86
- }, []);
87
- (0, _react.useEffect)(function () {
88
- var _a;
89
- if (!props["native"]) {
90
- update();
91
- (_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
92
- }
93
- }, [props["native"]]);
94
- function update() {
95
- var _a;
96
- (_a = barRef.current) === null || _a === void 0 ? void 0 : _a.update();
97
- }
98
- function handleScroll(e) {
99
- var _a, _b;
100
- (_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
101
- (_b = props.onScroll) === null || _b === void 0 ? void 0 : _b.call(props, e);
102
- }
103
- var wrapStyle = {
104
- height: props.height,
105
- maxHeight: props.maxHeight
106
- };
107
- var wrapClassName = (0, _classnames["default"])('tntd-scroll-bar-wrap', {
108
- 'tntd-scroll-bar-wrap-hidden-default': !props["native"]
109
- });
110
- return _react["default"].createElement(_Context["default"].Provider, {
111
- value: {
112
- scrollbarElement: scrollbarElement,
113
- wrapElement: wrapElement
114
- }
115
- }, _react["default"].createElement("div", {
116
- style: props.style,
117
- className: (0, _classnames["default"])('tntd-scroll-bar', props.className),
118
- ref: scrollbarElement
119
- }, _react["default"].createElement("div", {
120
- style: wrapStyle,
121
- className: wrapClassName,
122
- ref: wrapElement,
123
- onScroll: handleScroll
124
- }, _react["default"].createElement("div", {
125
- className: "tntd-scroll-bar-view",
126
- ref: resizeRef
127
- }, children)), !props["native"] && _react["default"].createElement(_Bar["default"], {
128
- ref: barRef,
129
- always: props.always,
130
- minSize: minSize
131
- })));
132
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScrollBar.js","sourceRoot":"","sources":["../../src/scroll-bar/ScrollBar.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,eAAe,UAAU,CAAC,CAAC,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AA,MAAM,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAA;IAC1B,CAAC;IAED,SAAS,YAAY,CAAC,CAAC;;QACrB,MAAA,MAAM,CAAC,OAAO,0CAAE,YAAY,EAAE,CAAA;QAC9B,MAAA,KAAK,CAAC,QAAQ,sDAAG,CAAC,CAAC,CAAA;IACrB,CAAC;IAED,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IACtE,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE;QACjD,qCAAqC,EAAE,CAAC,KAAK,CAAC,MAAM;KACrD,CAAC,CAAA;IAEF,OAAO,CACL,oBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE;QACxD,6BACE,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,EACnD,GAAG,EAAE,gBAAgB;YAErB,6BAAK,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY;gBACvF,6BAAK,SAAS,EAAC,sBAAsB,EAAC,GAAG,EAAE,SAAS,IACjD,QAAQ,CACL,CACF;YACL,CAAC,KAAK,CAAC,MAAM,IAAI,oBAAC,GAAG,IAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,GAAI,CAC1E,CACW,CACpB,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import clsx from 'classnames'\nimport React, { forwardRef, useEffect, useRef } from 'react'\nimport Bar from './Bar'\nimport Context from './Context'\n\nexport default forwardRef(({ children, minSize = 20, ...props }, ref) => {\n const scrollbarElement = useRef()\n let wrapElement = useRef()\n wrapElement = ref || wrapElement\n const resizeRef = useRef()\n const barRef = useRef()\n\n useEffect(() => {\n const wrapDom = wrapElement.current\n const resizeDom = resizeRef.current\n // 监听容器尺寸变化,因为尺寸可以设置类似height:100vh之类样式,高度并不是固定的\n const observerCallback = () =>\n requestAnimationFrame(() => {\n update()\n barRef.current?.handleScroll()\n })\n const observer = new ResizeObserver(observerCallback)\n observer.observe(wrapDom)\n observer.observe(resizeDom)\n return () => {\n observer.unobserve(wrapDom)\n observer.unobserve(resizeDom)\n }\n }, [])\n useEffect(() => {\n if (!props.native) {\n update()\n barRef.current?.handleScroll()\n }\n }, [props.native])\n\n function update() {\n barRef.current?.update()\n }\n\n function handleScroll(e) {\n barRef.current?.handleScroll()\n props.onScroll?.(e)\n }\n\n const wrapStyle = { height: props.height, maxHeight: props.maxHeight }\n const wrapClassName = clsx('tntd-scroll-bar-wrap', {\n 'tntd-scroll-bar-wrap-hidden-default': !props.native,\n })\n\n return (\n <Context.Provider value={{ scrollbarElement, wrapElement }}>\n <div\n style={props.style}\n className={clsx('tntd-scroll-bar', props.className)}\n ref={scrollbarElement}\n >\n <div style={wrapStyle} className={wrapClassName} ref={wrapElement} onScroll={handleScroll}>\n <div className=\"tntd-scroll-bar-view\" ref={resizeRef}>\n {children}\n </div>\n </div>\n {!props.native && <Bar ref={barRef} always={props.always} minSize={minSize} />}\n </div>\n </Context.Provider>\n )\n})\n"]}