linkmore-design 1.0.62 → 1.0.63

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 (314) hide show
  1. package/dist/AutoComplete/demos/basic.d.ts +3 -0
  2. package/dist/AutoComplete/index.d.ts +30 -0
  3. package/dist/AutoComplete/style/index.d.ts +1 -0
  4. package/dist/Avatar/demos/basic.d.ts +2 -0
  5. package/dist/Avatar/index.d.ts +3 -0
  6. package/dist/Avatar/style/index.d.ts +1 -0
  7. package/dist/Breadcrumb/demos/basic.d.ts +2 -0
  8. package/dist/Breadcrumb/demos/basic1.d.ts +2 -0
  9. package/dist/Breadcrumb/index.d.ts +4 -0
  10. package/dist/Breadcrumb/style/index.d.ts +1 -0
  11. package/dist/CardTable/utils.d.ts +1 -1
  12. package/dist/Col/demos/basic.d.ts +2 -0
  13. package/dist/Col/index.d.ts +3 -0
  14. package/dist/Col/style/index.d.ts +1 -0
  15. package/dist/Form/index.d.ts +1 -1
  16. package/dist/Grid/RowContext.d.ts +8 -0
  17. package/dist/Grid/col.d.ts +28 -0
  18. package/dist/Grid/demos/basic.d.ts +2 -0
  19. package/dist/Grid/hooks/useBreakpoint.d.ts +3 -0
  20. package/dist/Grid/index.d.ts +11 -0
  21. package/dist/Grid/row.d.ts +14 -0
  22. package/dist/Grid/style/index.d.ts +1 -0
  23. package/dist/Layout/demos/basic.d.ts +2 -0
  24. package/dist/Layout/index.d.ts +4 -0
  25. package/dist/Layout/style/index.d.ts +1 -0
  26. package/dist/LmEditTable/EditTable.d.ts +2 -0
  27. package/dist/LmEditTable/demos/colsort.d.ts +2 -0
  28. package/dist/LmEditTable/demos/size.d.ts +2 -0
  29. package/dist/LmEditTable/sortableBoxCol.d.ts +5 -0
  30. package/dist/LmEditTable/sortableItemCol.d.ts +1 -0
  31. package/dist/LmFilter/components/CustomSelectFilter.d.ts +4 -0
  32. package/dist/LmFilter/filterFns/index.d.ts +27 -17
  33. package/dist/LmFilter/utils.d.ts +2 -0
  34. package/dist/PageHeader/demos/basic.d.ts +2 -0
  35. package/dist/PageHeader/index.d.ts +24 -0
  36. package/dist/PageHeader/style/index.d.ts +1 -0
  37. package/dist/Popover/demos/basic.d.ts +2 -0
  38. package/dist/Popover/demos/basic1.d.ts +2 -0
  39. package/dist/Popover/index.d.ts +11 -0
  40. package/dist/Popover/style/index.d.ts +1 -0
  41. package/dist/Row/demos/basic.d.ts +2 -0
  42. package/dist/Row/index.d.ts +3 -0
  43. package/dist/Row/style/index.d.ts +1 -0
  44. package/dist/Tooltip/index.d.ts +43 -1
  45. package/dist/Typography/Base/Ellipsis.d.ts +14 -0
  46. package/dist/Typography/Base/EllipsisTooltip.d.ts +13 -0
  47. package/dist/Typography/Base/index.d.ts +54 -0
  48. package/dist/Typography/Editable.d.ts +20 -0
  49. package/dist/Typography/Link.d.ts +7 -0
  50. package/dist/Typography/Paragraph.d.ts +7 -0
  51. package/dist/Typography/Text.d.ts +8 -0
  52. package/dist/Typography/Title.d.ts +9 -0
  53. package/dist/Typography/Typography.d.ts +11 -0
  54. package/dist/Typography/demos/basic.d.ts +2 -0
  55. package/dist/Typography/hooks/useMergedConfig.d.ts +1 -0
  56. package/dist/Typography/hooks/useUpdatedEffect.d.ts +3 -0
  57. package/dist/Typography/index.d.ts +15 -0
  58. package/dist/Typography/style/index.d.ts +1 -0
  59. package/dist/_util/colors.d.ts +5 -0
  60. package/dist/_util/getRenderPropValue.d.ts +3 -0
  61. package/dist/_util/hooks/useFlexGapSupport.d.ts +2 -0
  62. package/dist/_util/hooks/useForceUpdate.d.ts +2 -0
  63. package/dist/_util/placements.d.ts +16 -0
  64. package/dist/_util/responsiveObserve.d.ts +21 -0
  65. package/dist/_util/styleChecker.d.ts +4 -0
  66. package/dist/_util/transButton.d.ts +9 -0
  67. package/dist/index.d.ts +14 -0
  68. package/dist/index.umd.js +17359 -8951
  69. package/dist/index.umd.min.js +6 -6
  70. package/es/AutoComplete/index.d.ts +30 -0
  71. package/es/AutoComplete/index.js +101 -0
  72. package/es/AutoComplete/style/index.css +505 -0
  73. package/es/AutoComplete/style/index.d.ts +1 -0
  74. package/es/AutoComplete/style/index.js +1 -0
  75. package/es/Avatar/index.d.ts +3 -0
  76. package/es/Avatar/index.js +3 -0
  77. package/es/Avatar/style/index.css +505 -0
  78. package/es/Avatar/style/index.d.ts +1 -0
  79. package/es/Avatar/style/index.js +1 -0
  80. package/es/Breadcrumb/index.d.ts +4 -0
  81. package/es/Breadcrumb/index.js +3 -0
  82. package/es/Breadcrumb/style/index.css +505 -0
  83. package/es/Breadcrumb/style/index.d.ts +1 -0
  84. package/es/Breadcrumb/style/index.js +1 -0
  85. package/es/Col/README.md.old +22 -0
  86. package/es/Col/index.d.ts +3 -0
  87. package/es/Col/index.js +2 -0
  88. package/es/Col/style/index.css +505 -0
  89. package/es/Col/style/index.d.ts +1 -0
  90. package/es/Col/style/index.js +1 -0
  91. package/es/Form/index.d.ts +1 -1
  92. package/es/Form/style/index.css +14 -14
  93. package/es/Grid/RowContext.d.ts +8 -0
  94. package/es/Grid/RowContext.js +3 -0
  95. package/es/Grid/col.d.ts +28 -0
  96. package/es/Grid/col.js +112 -0
  97. package/es/Grid/hooks/useBreakpoint.d.ts +3 -0
  98. package/es/Grid/hooks/useBreakpoint.js +24 -0
  99. package/es/Grid/index.d.ts +11 -0
  100. package/es/Grid/index.js +14 -0
  101. package/es/Grid/row.d.ts +14 -0
  102. package/es/Grid/row.js +142 -0
  103. package/es/Grid/style/index.css +505 -0
  104. package/es/Grid/style/index.d.ts +1 -0
  105. package/es/Grid/style/index.js +1 -0
  106. package/es/Layout/index.d.ts +4 -0
  107. package/es/Layout/index.js +3 -0
  108. package/es/Layout/style/index.css +505 -0
  109. package/es/Layout/style/index.d.ts +1 -0
  110. package/es/Layout/style/index.js +1 -0
  111. package/es/LmEditTable/EditTable.d.ts +2 -0
  112. package/es/LmEditTable/EditTable.js +170 -52
  113. package/es/LmEditTable/sortableBoxCol.d.ts +5 -0
  114. package/es/LmEditTable/sortableBoxCol.js +13 -0
  115. package/es/LmEditTable/sortableItemCol.d.ts +1 -0
  116. package/es/LmEditTable/sortableItemCol.js +48 -0
  117. package/es/LmFilter/{icon_placeholder.png → assets/empty.png} +0 -0
  118. package/es/LmFilter/clearFilter/index.js +3 -5
  119. package/es/LmFilter/complexFilter/drawer.js +24 -4
  120. package/es/LmFilter/components/CheckboxFilter.js +1 -1
  121. package/es/LmFilter/components/CustomSelectFilter.js +128 -0
  122. package/es/LmFilter/components/EmptyFilter.js +2 -2
  123. package/es/LmFilter/components/SelectFilter.js +1 -1
  124. package/es/LmFilter/customFilter/index.js +75 -2
  125. package/es/LmFilter/filterFns/index.js +181 -66
  126. package/es/LmFilter/style/style.css +49 -5
  127. package/es/LmFilter/utils.js +34 -0
  128. package/es/LmFilter/wrapper/FilterRoot.js +16 -48
  129. package/es/PageHeader/index.d.ts +24 -0
  130. package/es/PageHeader/index.js +169 -0
  131. package/es/PageHeader/style/index.css +505 -0
  132. package/es/PageHeader/style/index.d.ts +1 -0
  133. package/es/PageHeader/style/index.js +1 -0
  134. package/es/Popover/index.d.ts +11 -0
  135. package/es/Popover/index.js +63 -0
  136. package/es/Popover/style/index.css +505 -0
  137. package/es/Popover/style/index.d.ts +1 -0
  138. package/es/Popover/style/index.js +1 -0
  139. package/es/Row/README.md.old +22 -0
  140. package/es/Row/index.d.ts +3 -0
  141. package/es/Row/index.js +2 -0
  142. package/es/Row/style/index.css +505 -0
  143. package/es/Row/style/index.d.ts +1 -0
  144. package/es/Row/style/index.js +1 -0
  145. package/es/Tooltip/index.d.ts +43 -1
  146. package/es/Tooltip/index.js +236 -1
  147. package/es/Typography/Base/Ellipsis.d.ts +14 -0
  148. package/es/Typography/Base/Ellipsis.js +197 -0
  149. package/es/Typography/Base/EllipsisTooltip.d.ts +13 -0
  150. package/es/Typography/Base/EllipsisTooltip.js +23 -0
  151. package/es/Typography/Base/index.d.ts +54 -0
  152. package/es/Typography/Base/index.js +509 -0
  153. package/es/Typography/Editable.d.ts +20 -0
  154. package/es/Typography/Editable.js +117 -0
  155. package/es/Typography/Link.d.ts +7 -0
  156. package/es/Typography/Link.js +43 -0
  157. package/es/Typography/Paragraph.d.ts +7 -0
  158. package/es/Typography/Paragraph.js +12 -0
  159. package/es/Typography/Text.d.ts +8 -0
  160. package/es/Typography/Text.js +41 -0
  161. package/es/Typography/Title.d.ts +9 -0
  162. package/es/Typography/Title.js +41 -0
  163. package/es/Typography/Typography.d.ts +11 -0
  164. package/es/Typography/Typography.js +61 -0
  165. package/es/Typography/hooks/useMergedConfig.d.ts +1 -0
  166. package/es/Typography/hooks/useMergedConfig.js +8 -0
  167. package/es/Typography/hooks/useUpdatedEffect.d.ts +3 -0
  168. package/es/Typography/hooks/useUpdatedEffect.js +13 -0
  169. package/es/Typography/index.d.ts +15 -0
  170. package/es/Typography/index.js +14 -0
  171. package/es/Typography/style/index.css +505 -0
  172. package/es/Typography/style/index.d.ts +1 -0
  173. package/es/Typography/style/index.js +1 -0
  174. package/es/_util/colors.d.ts +5 -0
  175. package/es/_util/colors.js +4 -0
  176. package/es/_util/getRenderPropValue.d.ts +3 -0
  177. package/es/_util/getRenderPropValue.js +13 -0
  178. package/es/_util/hooks/useFlexGapSupport.d.ts +2 -0
  179. package/es/_util/hooks/useFlexGapSupport.js +14 -0
  180. package/es/_util/hooks/useForceUpdate.d.ts +2 -0
  181. package/es/_util/hooks/useForceUpdate.js +11 -0
  182. package/es/_util/placements.d.ts +16 -0
  183. package/es/_util/placements.js +87 -0
  184. package/es/_util/responsiveObserve.d.ts +21 -0
  185. package/es/_util/responsiveObserve.js +66 -0
  186. package/es/_util/styleChecker.d.ts +4 -0
  187. package/es/_util/styleChecker.js +31 -0
  188. package/es/_util/transButton.d.ts +9 -0
  189. package/es/_util/transButton.js +73 -0
  190. package/es/index.d.ts +14 -0
  191. package/es/index.js +8 -1
  192. package/lib/AutoComplete/index.d.ts +30 -0
  193. package/lib/AutoComplete/index.js +125 -0
  194. package/lib/AutoComplete/style/index.css +505 -0
  195. package/lib/AutoComplete/style/index.d.ts +1 -0
  196. package/lib/AutoComplete/style/index.js +3 -0
  197. package/lib/Avatar/index.d.ts +3 -0
  198. package/lib/Avatar/index.js +15 -0
  199. package/lib/Avatar/style/index.css +505 -0
  200. package/lib/Avatar/style/index.d.ts +1 -0
  201. package/lib/Avatar/style/index.js +3 -0
  202. package/lib/Breadcrumb/index.d.ts +4 -0
  203. package/lib/Breadcrumb/index.js +15 -0
  204. package/lib/Breadcrumb/style/index.css +505 -0
  205. package/lib/Breadcrumb/style/index.d.ts +1 -0
  206. package/lib/Breadcrumb/style/index.js +3 -0
  207. package/lib/Col/README.md.old +22 -0
  208. package/lib/Col/index.d.ts +3 -0
  209. package/lib/Col/index.js +11 -0
  210. package/lib/Col/style/index.css +505 -0
  211. package/lib/Col/style/index.d.ts +1 -0
  212. package/lib/Col/style/index.js +3 -0
  213. package/lib/Form/index.d.ts +1 -1
  214. package/lib/Form/style/index.css +14 -14
  215. package/lib/Grid/RowContext.d.ts +8 -0
  216. package/lib/Grid/RowContext.js +12 -0
  217. package/lib/Grid/col.d.ts +28 -0
  218. package/lib/Grid/col.js +128 -0
  219. package/lib/Grid/hooks/useBreakpoint.d.ts +3 -0
  220. package/lib/Grid/hooks/useBreakpoint.js +37 -0
  221. package/lib/Grid/index.d.ts +11 -0
  222. package/lib/Grid/index.js +45 -0
  223. package/lib/Grid/row.d.ts +14 -0
  224. package/lib/Grid/row.js +164 -0
  225. package/lib/Grid/style/index.css +505 -0
  226. package/lib/Grid/style/index.d.ts +1 -0
  227. package/lib/Grid/style/index.js +3 -0
  228. package/lib/Layout/index.d.ts +4 -0
  229. package/lib/Layout/index.js +15 -0
  230. package/lib/Layout/style/index.css +505 -0
  231. package/lib/Layout/style/index.d.ts +1 -0
  232. package/lib/Layout/style/index.js +3 -0
  233. package/lib/LmEditTable/EditTable.d.ts +2 -0
  234. package/lib/LmEditTable/EditTable.js +171 -53
  235. package/lib/LmEditTable/sortableBoxCol.d.ts +5 -0
  236. package/lib/LmEditTable/sortableBoxCol.js +24 -0
  237. package/lib/LmEditTable/sortableItemCol.d.ts +1 -0
  238. package/lib/LmEditTable/sortableItemCol.js +61 -0
  239. package/lib/LmFilter/{icon_placeholder.png → assets/empty.png} +0 -0
  240. package/lib/LmFilter/clearFilter/index.js +3 -5
  241. package/lib/LmFilter/complexFilter/drawer.js +24 -4
  242. package/lib/LmFilter/components/CheckboxFilter.js +1 -1
  243. package/lib/LmFilter/components/CustomSelectFilter.js +128 -0
  244. package/lib/LmFilter/components/EmptyFilter.js +2 -2
  245. package/lib/LmFilter/components/SelectFilter.js +1 -1
  246. package/lib/LmFilter/customFilter/index.js +75 -2
  247. package/lib/LmFilter/filterFns/index.js +181 -66
  248. package/lib/LmFilter/style/style.css +49 -5
  249. package/lib/LmFilter/utils.js +34 -0
  250. package/lib/LmFilter/wrapper/FilterRoot.js +16 -48
  251. package/lib/PageHeader/index.d.ts +24 -0
  252. package/lib/PageHeader/index.js +194 -0
  253. package/lib/PageHeader/style/index.css +505 -0
  254. package/lib/PageHeader/style/index.d.ts +1 -0
  255. package/lib/PageHeader/style/index.js +3 -0
  256. package/lib/Popover/index.d.ts +11 -0
  257. package/lib/Popover/index.js +81 -0
  258. package/lib/Popover/style/index.css +505 -0
  259. package/lib/Popover/style/index.d.ts +1 -0
  260. package/lib/Popover/style/index.js +3 -0
  261. package/lib/Row/README.md.old +22 -0
  262. package/lib/Row/index.d.ts +3 -0
  263. package/lib/Row/index.js +11 -0
  264. package/lib/Row/style/index.css +505 -0
  265. package/lib/Row/style/index.d.ts +1 -0
  266. package/lib/Row/style/index.js +3 -0
  267. package/lib/Tooltip/index.d.ts +43 -1
  268. package/lib/Tooltip/index.js +247 -1
  269. package/lib/Typography/Base/Ellipsis.d.ts +14 -0
  270. package/lib/Typography/Base/Ellipsis.js +212 -0
  271. package/lib/Typography/Base/EllipsisTooltip.d.ts +13 -0
  272. package/lib/Typography/Base/EllipsisTooltip.js +36 -0
  273. package/lib/Typography/Base/index.d.ts +54 -0
  274. package/lib/Typography/Base/index.js +545 -0
  275. package/lib/Typography/Editable.d.ts +20 -0
  276. package/lib/Typography/Editable.js +137 -0
  277. package/lib/Typography/Link.d.ts +7 -0
  278. package/lib/Typography/Link.js +58 -0
  279. package/lib/Typography/Paragraph.d.ts +7 -0
  280. package/lib/Typography/Paragraph.js +26 -0
  281. package/lib/Typography/Text.d.ts +8 -0
  282. package/lib/Typography/Text.js +57 -0
  283. package/lib/Typography/Title.d.ts +9 -0
  284. package/lib/Typography/Title.js +58 -0
  285. package/lib/Typography/Typography.d.ts +11 -0
  286. package/lib/Typography/Typography.js +77 -0
  287. package/lib/Typography/hooks/useMergedConfig.d.ts +1 -0
  288. package/lib/Typography/hooks/useMergedConfig.js +21 -0
  289. package/lib/Typography/hooks/useUpdatedEffect.d.ts +3 -0
  290. package/lib/Typography/hooks/useUpdatedEffect.js +24 -0
  291. package/lib/Typography/index.d.ts +15 -0
  292. package/lib/Typography/index.js +31 -0
  293. package/lib/Typography/style/index.css +505 -0
  294. package/lib/Typography/style/index.d.ts +1 -0
  295. package/lib/Typography/style/index.js +3 -0
  296. package/lib/_util/colors.d.ts +5 -0
  297. package/lib/_util/colors.js +14 -0
  298. package/lib/_util/getRenderPropValue.d.ts +3 -0
  299. package/lib/_util/getRenderPropValue.js +22 -0
  300. package/lib/_util/hooks/useFlexGapSupport.d.ts +2 -0
  301. package/lib/_util/hooks/useFlexGapSupport.js +30 -0
  302. package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
  303. package/lib/_util/hooks/useForceUpdate.js +24 -0
  304. package/lib/_util/placements.d.ts +16 -0
  305. package/lib/_util/placements.js +98 -0
  306. package/lib/_util/responsiveObserve.d.ts +21 -0
  307. package/lib/_util/responsiveObserve.js +79 -0
  308. package/lib/_util/styleChecker.d.ts +4 -0
  309. package/lib/_util/styleChecker.js +52 -0
  310. package/lib/_util/transButton.d.ts +9 -0
  311. package/lib/_util/transButton.js +87 -0
  312. package/lib/index.d.ts +14 -0
  313. package/lib/index.js +57 -1
  314. package/package.json +1 -1
@@ -1,3 +1,238 @@
1
1
  import "antd/es/tooltip/style";
2
2
  import _Tooltip from "antd/es/tooltip";
3
- export default _Tooltip;
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+
6
+ var __rest = this && this.__rest || function (s, e) {
7
+ var t = {};
8
+
9
+ for (var p in s) {
10
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
11
+ }
12
+
13
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
14
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
15
+ }
16
+ return t;
17
+ };
18
+
19
+ import classNames from 'classnames';
20
+ import RcTooltip from 'rc-tooltip';
21
+ import useMergedState from 'rc-util/lib/hooks/useMergedState';
22
+ import * as React from 'react';
23
+ import { ConfigContext } from 'antd/es/config-provider';
24
+ import { PresetColorTypes } from '../_util/colors';
25
+ import { getTransitionName } from '../_util/motion';
26
+ import getPlacements from '../_util/placements';
27
+ import { cloneElement, isValidElement } from '../_util/reactNode';
28
+
29
+ var splitObject = function splitObject(obj, keys) {
30
+ var picked = {};
31
+ var omitted = Object.assign({}, obj);
32
+ keys.forEach(function (key) {
33
+ if (obj && key in obj) {
34
+ picked[key] = obj[key];
35
+ delete omitted[key];
36
+ }
37
+ });
38
+ return {
39
+ picked: picked,
40
+ omitted: omitted
41
+ };
42
+ };
43
+
44
+ var PresetColorRegex = new RegExp("^(".concat(PresetColorTypes.join('|'), ")(-inverse)?$")); // Fix Tooltip won't hide at disabled button
45
+ // mouse events don't trigger at disabled button in Chrome
46
+ // https://github.com/react-component/tooltip/issues/18
47
+
48
+ function getDisabledCompatibleChildren(element, prefixCls) {
49
+ var elementType = element.type;
50
+
51
+ if ((elementType.__ANT_BUTTON === true || element.type === 'button') && element.props.disabled || elementType.__ANT_SWITCH === true && (element.props.disabled || element.props.loading) || elementType.__ANT_RADIO === true && element.props.disabled) {
52
+ // Pick some layout related style properties up to span
53
+ // Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254
54
+ var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),
55
+ picked = _splitObject.picked,
56
+ omitted = _splitObject.omitted;
57
+
58
+ var spanStyle = Object.assign(Object.assign({
59
+ display: 'inline-block'
60
+ }, picked), {
61
+ cursor: 'not-allowed',
62
+ width: element.props.block ? '100%' : null
63
+ });
64
+ var buttonStyle = Object.assign(Object.assign({}, omitted), {
65
+ pointerEvents: 'none'
66
+ });
67
+ var child = cloneElement(element, {
68
+ style: buttonStyle,
69
+ className: null
70
+ });
71
+ return /*#__PURE__*/React.createElement("span", {
72
+ style: spanStyle,
73
+ className: classNames(element.props.className, "".concat(prefixCls, "-disabled-compatible-wrapper"))
74
+ }, child);
75
+ }
76
+
77
+ return element;
78
+ }
79
+
80
+ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
81
+ var _classNames2;
82
+
83
+ var _React$useContext = React.useContext(ConfigContext),
84
+ getContextPopupContainer = _React$useContext.getPopupContainer,
85
+ getPrefixCls = _React$useContext.getPrefixCls,
86
+ direction = _React$useContext.direction;
87
+
88
+ var _useMergedState = useMergedState(false, {
89
+ value: props.visible,
90
+ defaultValue: props.defaultVisible
91
+ }),
92
+ _useMergedState2 = _slicedToArray(_useMergedState, 2),
93
+ visible = _useMergedState2[0],
94
+ setVisible = _useMergedState2[1];
95
+
96
+ var isNoTitle = function isNoTitle() {
97
+ var title = props.title,
98
+ overlay = props.overlay;
99
+ return !title && !overlay && title !== 0; // overlay for old version compatibility
100
+ };
101
+
102
+ var onVisibleChange = function onVisibleChange(vis) {
103
+ var _a;
104
+
105
+ setVisible(isNoTitle() ? false : vis);
106
+
107
+ if (!isNoTitle()) {
108
+ (_a = props.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(props, vis);
109
+ }
110
+ };
111
+
112
+ var getTooltipPlacements = function getTooltipPlacements() {
113
+ var builtinPlacements = props.builtinPlacements,
114
+ arrowPointAtCenter = props.arrowPointAtCenter,
115
+ autoAdjustOverflow = props.autoAdjustOverflow;
116
+ return builtinPlacements || getPlacements({
117
+ arrowPointAtCenter: arrowPointAtCenter,
118
+ autoAdjustOverflow: autoAdjustOverflow
119
+ });
120
+ }; // 动态设置动画点
121
+
122
+
123
+ var onPopupAlign = function onPopupAlign(domNode, align) {
124
+ var placements = getTooltipPlacements(); // 当前返回的位置
125
+
126
+ var placement = Object.keys(placements).find(function (key) {
127
+ return placements[key].points[0] === align.points[0] && placements[key].points[1] === align.points[1];
128
+ });
129
+
130
+ if (!placement) {
131
+ return;
132
+ } // 根据当前坐标设置动画点
133
+
134
+
135
+ var rect = domNode.getBoundingClientRect();
136
+ var transformOrigin = {
137
+ top: '50%',
138
+ left: '50%'
139
+ };
140
+
141
+ if (placement.indexOf('top') >= 0 || placement.indexOf('Bottom') >= 0) {
142
+ transformOrigin.top = "".concat(rect.height - align.offset[1], "px");
143
+ } else if (placement.indexOf('Top') >= 0 || placement.indexOf('bottom') >= 0) {
144
+ transformOrigin.top = "".concat(-align.offset[1], "px");
145
+ }
146
+
147
+ if (placement.indexOf('left') >= 0 || placement.indexOf('Right') >= 0) {
148
+ transformOrigin.left = "".concat(rect.width - align.offset[0], "px");
149
+ } else if (placement.indexOf('right') >= 0 || placement.indexOf('Left') >= 0) {
150
+ transformOrigin.left = "".concat(-align.offset[0], "px");
151
+ }
152
+
153
+ domNode.style.transformOrigin = "".concat(transformOrigin.left, " ").concat(transformOrigin.top);
154
+ };
155
+
156
+ var getOverlay = function getOverlay() {
157
+ var title = props.title,
158
+ overlay = props.overlay;
159
+
160
+ if (title === 0) {
161
+ return title;
162
+ }
163
+
164
+ return overlay || title || '';
165
+ };
166
+
167
+ var getPopupContainer = props.getPopupContainer,
168
+ otherProps = __rest(props, ["getPopupContainer"]);
169
+
170
+ var customizePrefixCls = props.prefixCls,
171
+ openClassName = props.openClassName,
172
+ getTooltipContainer = props.getTooltipContainer,
173
+ overlayClassName = props.overlayClassName,
174
+ color = props.color,
175
+ overlayInnerStyle = props.overlayInnerStyle,
176
+ children = props.children;
177
+ var prefixCls = getPrefixCls('tooltip', customizePrefixCls);
178
+ var rootPrefixCls = getPrefixCls();
179
+ var tempVisible = visible; // Hide tooltip when there is no title
180
+
181
+ if (!('visible' in props) && isNoTitle()) {
182
+ tempVisible = false;
183
+ }
184
+
185
+ var child = getDisabledCompatibleChildren(isValidElement(children) ? children : /*#__PURE__*/React.createElement("span", null, children), prefixCls);
186
+ var childProps = child.props;
187
+ var childCls = classNames(childProps.className, _defineProperty({}, openClassName || "".concat(prefixCls, "-open"), true));
188
+ var customOverlayClassName = classNames(overlayClassName, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _defineProperty(_classNames2, "".concat(prefixCls, "-").concat(color), color && PresetColorRegex.test(color)), _classNames2));
189
+ var formattedOverlayInnerStyle = overlayInnerStyle;
190
+ var arrowContentStyle;
191
+
192
+ if (color && !PresetColorRegex.test(color)) {
193
+ formattedOverlayInnerStyle = Object.assign(Object.assign({}, overlayInnerStyle), {
194
+ background: color
195
+ }); // @ts-ignore
196
+
197
+ arrowContentStyle = {
198
+ '--antd-arrow-background-color': color
199
+ };
200
+ }
201
+
202
+ return /*#__PURE__*/React.createElement(RcTooltip, Object.assign({}, otherProps, {
203
+ prefixCls: prefixCls,
204
+ overlayClassName: customOverlayClassName,
205
+ getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,
206
+ ref: ref,
207
+ builtinPlacements: getTooltipPlacements(),
208
+ overlay: getOverlay(),
209
+ visible: tempVisible,
210
+ onVisibleChange: onVisibleChange,
211
+ onPopupAlign: onPopupAlign,
212
+ overlayInnerStyle: formattedOverlayInnerStyle,
213
+ arrowContent: /*#__PURE__*/React.createElement("span", {
214
+ className: "".concat(prefixCls, "-arrow-content"),
215
+ style: arrowContentStyle
216
+ }),
217
+ motion: {
218
+ motionName: getTransitionName(rootPrefixCls, 'zoom-big-fast', props.transitionName),
219
+ motionDeadline: 1000
220
+ }
221
+ }), tempVisible ? cloneElement(child, {
222
+ className: childCls
223
+ }) : child);
224
+ });
225
+
226
+ if (process.env.NODE_ENV !== 'production') {
227
+ Tooltip.displayName = 'Tooltip';
228
+ }
229
+
230
+ Tooltip.defaultProps = {
231
+ placement: 'top',
232
+ mouseEnterDelay: 0.1,
233
+ mouseLeaveDelay: 0.1,
234
+ arrowPointAtCenter: false,
235
+ autoAdjustOverflow: true
236
+ };
237
+ Tooltip.AntdTooltip = _Tooltip;
238
+ export default Tooltip;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ export interface EllipsisProps {
3
+ enabledMeasure?: boolean;
4
+ text?: React.ReactNode;
5
+ width: number;
6
+ rows: number;
7
+ children: (cutChildren: React.ReactNode[], needEllipsis: boolean) => React.ReactNode;
8
+ onEllipsis: (isEllipsis: boolean) => void;
9
+ }
10
+ declare const Ellipsis: {
11
+ ({ enabledMeasure, children, text, width, rows, onEllipsis }: EllipsisProps): JSX.Element;
12
+ displayName: string;
13
+ };
14
+ export default Ellipsis;
@@ -0,0 +1,197 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
3
+ import toArray from 'rc-util/lib/Children/toArray';
4
+ import useIsomorphicLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
5
+ import * as React from 'react';
6
+
7
+ function cuttable(node) {
8
+ var type = _typeof(node);
9
+
10
+ return type === 'string' || type === 'number';
11
+ }
12
+
13
+ function getNodesLen(nodeList) {
14
+ var totalLen = 0;
15
+ nodeList.forEach(function (node) {
16
+ if (cuttable(node)) {
17
+ totalLen += String(node).length;
18
+ } else {
19
+ totalLen += 1;
20
+ }
21
+ });
22
+ return totalLen;
23
+ }
24
+
25
+ function sliceNodes(nodeList, len) {
26
+ var currLen = 0;
27
+ var currentNodeList = [];
28
+
29
+ for (var i = 0; i < nodeList.length; i += 1) {
30
+ // Match to return
31
+ if (currLen === len) {
32
+ return currentNodeList;
33
+ }
34
+
35
+ var node = nodeList[i];
36
+ var canCut = cuttable(node);
37
+ var nodeLen = canCut ? String(node).length : 1;
38
+ var nextLen = currLen + nodeLen; // Exceed but current not which means we need cut this
39
+ // This will not happen on validate ReactElement
40
+
41
+ if (nextLen > len) {
42
+ var restLen = len - currLen;
43
+ currentNodeList.push(String(node).slice(0, restLen));
44
+ return currentNodeList;
45
+ }
46
+
47
+ currentNodeList.push(node);
48
+ currLen = nextLen;
49
+ }
50
+
51
+ return nodeList;
52
+ }
53
+
54
+ var NONE = 0;
55
+ var PREPARE = 1;
56
+ var WALKING = 2;
57
+ var DONE_WITH_ELLIPSIS = 3;
58
+ var DONE_WITHOUT_ELLIPSIS = 4;
59
+
60
+ var Ellipsis = function Ellipsis(_ref) {
61
+ var enabledMeasure = _ref.enabledMeasure,
62
+ children = _ref.children,
63
+ text = _ref.text,
64
+ width = _ref.width,
65
+ rows = _ref.rows,
66
+ onEllipsis = _ref.onEllipsis;
67
+
68
+ var _React$useState = React.useState([0, 0, 0]),
69
+ _React$useState2 = _slicedToArray(_React$useState, 2),
70
+ cutLength = _React$useState2[0],
71
+ setCutLength = _React$useState2[1];
72
+
73
+ var _React$useState3 = React.useState(NONE),
74
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
75
+ walkingState = _React$useState4[0],
76
+ setWalkingState = _React$useState4[1];
77
+
78
+ var _cutLength = _slicedToArray(cutLength, 3),
79
+ startLen = _cutLength[0],
80
+ midLen = _cutLength[1],
81
+ endLen = _cutLength[2];
82
+
83
+ var _React$useState5 = React.useState(0),
84
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
85
+ singleRowHeight = _React$useState6[0],
86
+ setSingleRowHeight = _React$useState6[1];
87
+
88
+ var singleRowRef = React.useRef(null);
89
+ var midRowRef = React.useRef(null);
90
+ var nodeList = React.useMemo(function () {
91
+ return toArray(text);
92
+ }, [text]);
93
+ var totalLen = React.useMemo(function () {
94
+ return getNodesLen(nodeList);
95
+ }, [nodeList]);
96
+ var mergedChildren = React.useMemo(function () {
97
+ if (!enabledMeasure || walkingState !== DONE_WITH_ELLIPSIS) {
98
+ return children(nodeList, false);
99
+ }
100
+
101
+ return children(sliceNodes(nodeList, midLen), midLen < totalLen);
102
+ }, [enabledMeasure, walkingState, children, nodeList, midLen, totalLen]); // ======================== Walk ========================
103
+
104
+ useIsomorphicLayoutEffect(function () {
105
+ if (enabledMeasure && width && totalLen) {
106
+ setWalkingState(PREPARE);
107
+ setCutLength([0, Math.ceil(totalLen / 2), totalLen]);
108
+ }
109
+ }, [enabledMeasure, width, text, totalLen, rows]);
110
+ useIsomorphicLayoutEffect(function () {
111
+ var _a;
112
+
113
+ if (walkingState === PREPARE) {
114
+ setSingleRowHeight(((_a = singleRowRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0);
115
+ }
116
+ }, [walkingState]);
117
+ useIsomorphicLayoutEffect(function () {
118
+ var _a, _b;
119
+
120
+ if (singleRowHeight) {
121
+ if (walkingState === PREPARE) {
122
+ // Ignore if position is enough
123
+ var midHeight = ((_a = midRowRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0;
124
+ var maxHeight = rows * singleRowHeight;
125
+
126
+ if (midHeight <= maxHeight) {
127
+ setWalkingState(DONE_WITHOUT_ELLIPSIS);
128
+ onEllipsis(false);
129
+ } else {
130
+ setWalkingState(WALKING);
131
+ }
132
+ } else if (walkingState === WALKING) {
133
+ if (startLen !== endLen) {
134
+ var _midHeight = ((_b = midRowRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
135
+
136
+ var _maxHeight = rows * singleRowHeight;
137
+
138
+ var nextStartLen = startLen;
139
+ var nextEndLen = endLen; // We reach the last round
140
+
141
+ if (startLen === endLen - 1) {
142
+ nextEndLen = startLen;
143
+ } else if (_midHeight <= _maxHeight) {
144
+ nextStartLen = midLen;
145
+ } else {
146
+ nextEndLen = midLen;
147
+ }
148
+
149
+ var nextMidLen = Math.ceil((nextStartLen + nextEndLen) / 2);
150
+ setCutLength([nextStartLen, nextMidLen, nextEndLen]);
151
+ } else {
152
+ setWalkingState(DONE_WITH_ELLIPSIS);
153
+ onEllipsis(true);
154
+ }
155
+ }
156
+ }
157
+ }, [walkingState, startLen, endLen, rows, singleRowHeight]); // ======================= Render =======================
158
+
159
+ var measureStyle = {
160
+ width: width,
161
+ whiteSpace: 'normal',
162
+ margin: 0,
163
+ padding: 0
164
+ };
165
+
166
+ var renderMeasure = function renderMeasure(content, ref, style) {
167
+ return /*#__PURE__*/React.createElement("span", {
168
+ "aria-hidden": true,
169
+ ref: ref,
170
+ style: Object.assign({
171
+ position: 'fixed',
172
+ display: 'block',
173
+ left: 0,
174
+ top: 0,
175
+ zIndex: -9999,
176
+ visibility: 'hidden',
177
+ pointerEvents: 'none'
178
+ }, style)
179
+ }, content);
180
+ };
181
+
182
+ var renderMeasureSlice = function renderMeasureSlice(len, ref) {
183
+ var sliceNodeList = sliceNodes(nodeList, len);
184
+ return renderMeasure(children(sliceNodeList, true), ref, measureStyle);
185
+ };
186
+
187
+ return /*#__PURE__*/React.createElement(React.Fragment, null, mergedChildren, enabledMeasure && walkingState !== DONE_WITH_ELLIPSIS && walkingState !== DONE_WITHOUT_ELLIPSIS && /*#__PURE__*/React.createElement(React.Fragment, null, renderMeasure('lg', singleRowRef, {
188
+ wordBreak: 'keep-all',
189
+ whiteSpace: 'nowrap'
190
+ }), walkingState === PREPARE ? renderMeasure(children(nodeList, false), midRowRef, measureStyle) : renderMeasureSlice(midLen, midRowRef)));
191
+ };
192
+
193
+ if (process.env.NODE_ENV !== 'production') {
194
+ Ellipsis.displayName = 'Ellipsis';
195
+ }
196
+
197
+ export default Ellipsis;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import type { TooltipProps } from '../../Tooltip';
3
+ export interface EllipsisTooltipProps {
4
+ tooltipProps?: TooltipProps;
5
+ enabledEllipsis: boolean;
6
+ isEllipsis?: boolean;
7
+ children: React.ReactElement;
8
+ }
9
+ declare const EllipsisTooltip: {
10
+ ({ enabledEllipsis, isEllipsis, children, tooltipProps, }: EllipsisTooltipProps): JSX.Element;
11
+ displayName: string;
12
+ };
13
+ export default EllipsisTooltip;
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import Tooltip from '../../Tooltip';
3
+
4
+ var EllipsisTooltip = function EllipsisTooltip(_ref) {
5
+ var enabledEllipsis = _ref.enabledEllipsis,
6
+ isEllipsis = _ref.isEllipsis,
7
+ children = _ref.children,
8
+ tooltipProps = _ref.tooltipProps;
9
+
10
+ if (!(tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.title) || !enabledEllipsis) {
11
+ return children;
12
+ }
13
+
14
+ return /*#__PURE__*/React.createElement(Tooltip, Object.assign({
15
+ visible: isEllipsis ? undefined : false
16
+ }, tooltipProps), children);
17
+ };
18
+
19
+ if (process.env.NODE_ENV !== 'production') {
20
+ EllipsisTooltip.displayName = 'EllipsisTooltip';
21
+ }
22
+
23
+ export default EllipsisTooltip;
@@ -0,0 +1,54 @@
1
+ import type { AutoSizeType } from 'rc-textarea/lib/ResizableTextArea';
2
+ import * as React from 'react';
3
+ import type { TooltipProps } from '../../Tooltip';
4
+ import type { TypographyProps } from '../Typography';
5
+ export declare type BaseType = 'secondary' | 'success' | 'warning' | 'danger';
6
+ interface CopyConfig {
7
+ text?: string;
8
+ onCopy?: (event?: React.MouseEvent<HTMLDivElement>) => void;
9
+ icon?: React.ReactNode;
10
+ tooltips?: boolean | React.ReactNode;
11
+ format?: 'text/plain' | 'text/html';
12
+ }
13
+ interface EditConfig {
14
+ editing?: boolean;
15
+ icon?: React.ReactNode;
16
+ tooltip?: boolean | React.ReactNode;
17
+ onStart?: () => void;
18
+ onChange?: (value: string) => void;
19
+ onCancel?: () => void;
20
+ onEnd?: () => void;
21
+ maxLength?: number;
22
+ autoSize?: boolean | AutoSizeType;
23
+ triggerType?: ('icon' | 'text')[];
24
+ enterIcon?: React.ReactNode;
25
+ }
26
+ export interface EllipsisConfig {
27
+ rows?: number;
28
+ expandable?: boolean;
29
+ suffix?: string;
30
+ symbol?: React.ReactNode;
31
+ onExpand?: React.MouseEventHandler<HTMLElement>;
32
+ onEllipsis?: (ellipsis: boolean) => void;
33
+ tooltip?: React.ReactNode | TooltipProps;
34
+ }
35
+ export interface BlockProps extends TypographyProps {
36
+ title?: string;
37
+ editable?: boolean | EditConfig;
38
+ copyable?: boolean | CopyConfig;
39
+ type?: BaseType;
40
+ disabled?: boolean;
41
+ ellipsis?: boolean | EllipsisConfig;
42
+ code?: boolean;
43
+ mark?: boolean;
44
+ underline?: boolean;
45
+ delete?: boolean;
46
+ strong?: boolean;
47
+ keyboard?: boolean;
48
+ italic?: boolean;
49
+ }
50
+ interface InternalBlockProps extends BlockProps {
51
+ component: string;
52
+ }
53
+ declare const Base: React.ForwardRefExoticComponent<InternalBlockProps & React.RefAttributes<unknown>>;
54
+ export default Base;