@douyinfe/semi-ui 2.48.0 → 2.49.0-beta.0

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 (75) hide show
  1. package/dist/css/semi.css +4 -0
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +71 -44
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/banner/index.d.ts +2 -2
  8. package/lib/cjs/banner/index.js +2 -2
  9. package/lib/cjs/breadcrumb/item.d.ts +1 -1
  10. package/lib/cjs/breadcrumb/item.js +1 -1
  11. package/lib/cjs/calendar/dayCalendar.d.ts +1 -0
  12. package/lib/cjs/calendar/dayCalendar.js +4 -1
  13. package/lib/cjs/calendar/dayCol.d.ts +2 -0
  14. package/lib/cjs/calendar/dayCol.js +6 -6
  15. package/lib/cjs/calendar/index.d.ts +1 -0
  16. package/lib/cjs/calendar/index.js +1 -0
  17. package/lib/cjs/calendar/interface.d.ts +2 -1
  18. package/lib/cjs/calendar/rangeCalendar.js +4 -2
  19. package/lib/cjs/calendar/weekCalendar.js +4 -2
  20. package/lib/cjs/modal/Modal.d.ts +1 -1
  21. package/lib/cjs/modal/Modal.js +1 -1
  22. package/lib/cjs/navigation/SubNav.d.ts +1 -1
  23. package/lib/cjs/navigation/SubNav.js +1 -1
  24. package/lib/cjs/popconfirm/index.d.ts +1 -1
  25. package/lib/cjs/popconfirm/index.js +1 -1
  26. package/lib/cjs/sideSheet/SideSheetContent.d.ts +3 -1
  27. package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
  28. package/lib/cjs/table/Body/BaseRow.d.ts +3 -0
  29. package/lib/cjs/table/Body/BaseRow.js +4 -1
  30. package/lib/cjs/table/Body/ExpandedRow.d.ts +1 -0
  31. package/lib/cjs/table/Body/ExpandedRow.js +4 -2
  32. package/lib/cjs/table/Body/index.d.ts +3 -0
  33. package/lib/cjs/table/Body/index.js +18 -10
  34. package/lib/cjs/table/interface.d.ts +1 -0
  35. package/lib/cjs/timePicker/TimePicker.d.ts +3 -0
  36. package/lib/cjs/timePicker/TimePicker.js +7 -3
  37. package/lib/cjs/timePicker/index.d.ts +2 -0
  38. package/lib/cjs/toast/toast.d.ts +1 -1
  39. package/lib/cjs/toast/toast.js +1 -1
  40. package/lib/cjs/typography/util.js +5 -6
  41. package/lib/es/banner/index.d.ts +2 -2
  42. package/lib/es/banner/index.js +2 -2
  43. package/lib/es/breadcrumb/item.d.ts +1 -1
  44. package/lib/es/breadcrumb/item.js +1 -1
  45. package/lib/es/calendar/dayCalendar.d.ts +1 -0
  46. package/lib/es/calendar/dayCalendar.js +4 -1
  47. package/lib/es/calendar/dayCol.d.ts +2 -0
  48. package/lib/es/calendar/dayCol.js +6 -6
  49. package/lib/es/calendar/index.d.ts +1 -0
  50. package/lib/es/calendar/index.js +1 -0
  51. package/lib/es/calendar/interface.d.ts +2 -1
  52. package/lib/es/calendar/rangeCalendar.js +4 -2
  53. package/lib/es/calendar/weekCalendar.js +4 -2
  54. package/lib/es/modal/Modal.d.ts +1 -1
  55. package/lib/es/modal/Modal.js +1 -1
  56. package/lib/es/navigation/SubNav.d.ts +1 -1
  57. package/lib/es/navigation/SubNav.js +1 -1
  58. package/lib/es/popconfirm/index.d.ts +1 -1
  59. package/lib/es/popconfirm/index.js +1 -1
  60. package/lib/es/sideSheet/SideSheetContent.d.ts +3 -1
  61. package/lib/es/sideSheet/SideSheetContent.js +6 -3
  62. package/lib/es/table/Body/BaseRow.d.ts +3 -0
  63. package/lib/es/table/Body/BaseRow.js +4 -1
  64. package/lib/es/table/Body/ExpandedRow.d.ts +1 -0
  65. package/lib/es/table/Body/ExpandedRow.js +4 -2
  66. package/lib/es/table/Body/index.d.ts +3 -0
  67. package/lib/es/table/Body/index.js +18 -10
  68. package/lib/es/table/interface.d.ts +1 -0
  69. package/lib/es/timePicker/TimePicker.d.ts +3 -0
  70. package/lib/es/timePicker/TimePicker.js +7 -3
  71. package/lib/es/timePicker/index.d.ts +2 -0
  72. package/lib/es/toast/toast.d.ts +1 -1
  73. package/lib/es/toast/toast.js +1 -1
  74. package/lib/es/typography/util.js +5 -6
  75. package/package.json +8 -8
@@ -150,7 +150,7 @@ Toast.propTypes = {
150
150
  showClose: PropTypes.bool,
151
151
  stack: PropTypes.bool,
152
152
  stackExpanded: PropTypes.bool,
153
- icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
153
+ icon: PropTypes.node,
154
154
  direction: PropTypes.oneOf(strings.directions)
155
155
  };
156
156
  Toast.defaultProps = {
@@ -42,7 +42,6 @@ const getRenderText = function (originEle, rows) {
42
42
  const lineHeight = pxToNumber(originStyle.lineHeight);
43
43
  const maxHeight = Math.round(lineHeight * (rows + 1) + pxToNumber(originStyle.paddingTop) + pxToNumber(originStyle.paddingBottom));
44
44
  // Set shadow
45
- const maxWidth = parseInt(originStyle.width);
46
45
  ellipsisContainer.setAttribute('style', originCSS);
47
46
  ellipsisContainer.style.position = 'fixed';
48
47
  ellipsisContainer.style.left = '0';
@@ -54,12 +53,12 @@ const getRenderText = function (originEle, rows) {
54
53
  ellipsisContainer.style.webkitLineClamp = 'none';
55
54
  // Render fake container
56
55
  ReactDOM.render( /*#__PURE__*/React.createElement(React.Fragment, null), ellipsisContainer);
57
- // Check if ellipsis in measure div is height enough for content
56
+ // Check if ellipsis in measure div is enough for content
58
57
  function inRange() {
59
- if (originStyle.whiteSpace === 'nowrap') {
60
- return ellipsisContainer.scrollWidth <= maxWidth;
61
- }
62
- return ellipsisContainer.scrollHeight < maxHeight;
58
+ // If content does not wrap due to line break strategy, width should be judged to determine whether it's in range
59
+ const widthInRange = ellipsisContainer.scrollWidth <= ellipsisContainer.offsetWidth;
60
+ const heightInRange = ellipsisContainer.scrollHeight < maxHeight;
61
+ return rows === 1 ? widthInRange && heightInRange : heightInRange;
63
62
  }
64
63
  // ========================= Find match ellipsis content =========================
65
64
  // Create origin content holder
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.48.0",
3
+ "version": "2.49.0-beta.0",
4
4
  "description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -20,12 +20,12 @@
20
20
  "@dnd-kit/core": "^6.0.8",
21
21
  "@dnd-kit/sortable": "^7.0.2",
22
22
  "@dnd-kit/utilities": "^3.2.1",
23
- "@douyinfe/semi-animation": "2.48.0",
24
- "@douyinfe/semi-animation-react": "2.48.0",
25
- "@douyinfe/semi-foundation": "2.48.0",
26
- "@douyinfe/semi-icons": "2.48.0",
27
- "@douyinfe/semi-illustrations": "2.48.0",
28
- "@douyinfe/semi-theme-default": "2.48.0",
23
+ "@douyinfe/semi-animation": "2.49.0-beta.0",
24
+ "@douyinfe/semi-animation-react": "2.49.0-beta.0",
25
+ "@douyinfe/semi-foundation": "2.49.0-beta.0",
26
+ "@douyinfe/semi-icons": "2.49.0-beta.0",
27
+ "@douyinfe/semi-illustrations": "2.49.0-beta.0",
28
+ "@douyinfe/semi-theme-default": "2.49.0-beta.0",
29
29
  "async-validator": "^3.5.0",
30
30
  "classnames": "^2.2.6",
31
31
  "copy-text-to-clipboard": "^2.1.1",
@@ -75,7 +75,7 @@
75
75
  ],
76
76
  "author": "",
77
77
  "license": "MIT",
78
- "gitHead": "6f3b0957a0fbd5b5cf5a2187782bac2f767162b3",
78
+ "gitHead": "aa959f0cd22894b27c019eb78254ba9b991f80b3",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",