@douyinfe/semi-ui 2.20.2 → 2.20.3

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 (55) hide show
  1. package/dist/umd/semi-ui.js +255 -233
  2. package/dist/umd/semi-ui.js.map +1 -1
  3. package/dist/umd/semi-ui.min.js +1 -1
  4. package/dist/umd/semi-ui.min.js.map +1 -1
  5. package/lib/cjs/anchor/index.d.ts +1 -1
  6. package/lib/cjs/autoComplete/index.d.ts +1 -1
  7. package/lib/cjs/breadcrumb/item.js +1 -0
  8. package/lib/cjs/button/buttonGroup.js +14 -9
  9. package/lib/cjs/datePicker/datePicker.d.ts +2 -2
  10. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  11. package/lib/cjs/datePicker/quickControl.d.ts +1 -1
  12. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  13. package/lib/cjs/dropdown/index.d.ts +1 -1
  14. package/lib/cjs/dropdown/index.js +1 -0
  15. package/lib/cjs/form/baseForm.d.ts +1 -1
  16. package/lib/cjs/form/field.d.ts +1 -1
  17. package/lib/cjs/form/hoc/withField.js +7 -4
  18. package/lib/cjs/inputNumber/index.js +1 -1
  19. package/lib/cjs/modal/ModalContent.js +9 -2
  20. package/lib/cjs/navigation/Footer.js +2 -2
  21. package/lib/cjs/navigation/OpenIconTransition.js +1 -0
  22. package/lib/cjs/navigation/SubNav.js +6 -2
  23. package/lib/cjs/popover/index.d.ts +1 -1
  24. package/lib/cjs/select/index.d.ts +1 -1
  25. package/lib/cjs/table/Body/index.js +1 -1
  26. package/lib/cjs/table/Table.d.ts +1 -1
  27. package/lib/cjs/timeline/index.js +1 -0
  28. package/lib/cjs/tooltip/index.d.ts +1 -1
  29. package/lib/cjs/typography/title.d.ts +1 -1
  30. package/lib/es/anchor/index.d.ts +1 -1
  31. package/lib/es/autoComplete/index.d.ts +1 -1
  32. package/lib/es/breadcrumb/item.js +1 -0
  33. package/lib/es/button/buttonGroup.js +14 -9
  34. package/lib/es/datePicker/datePicker.d.ts +2 -2
  35. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  36. package/lib/es/datePicker/quickControl.d.ts +1 -1
  37. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  38. package/lib/es/dropdown/index.d.ts +1 -1
  39. package/lib/es/dropdown/index.js +1 -0
  40. package/lib/es/form/baseForm.d.ts +1 -1
  41. package/lib/es/form/field.d.ts +1 -1
  42. package/lib/es/form/hoc/withField.js +8 -5
  43. package/lib/es/inputNumber/index.js +1 -1
  44. package/lib/es/modal/ModalContent.js +8 -2
  45. package/lib/es/navigation/Footer.js +2 -2
  46. package/lib/es/navigation/OpenIconTransition.js +1 -0
  47. package/lib/es/navigation/SubNav.js +6 -2
  48. package/lib/es/popover/index.d.ts +1 -1
  49. package/lib/es/select/index.d.ts +1 -1
  50. package/lib/es/table/Body/index.js +1 -1
  51. package/lib/es/table/Table.d.ts +1 -1
  52. package/lib/es/timeline/index.js +1 -0
  53. package/lib/es/tooltip/index.d.ts +1 -1
  54. package/lib/es/typography/title.d.ts +1 -1
  55. package/package.json +7 -7
@@ -199,7 +199,6 @@ export default class ModalContent extends BaseComponent {
199
199
  }, /*#__PURE__*/React.createElement("div", {
200
200
  role: "dialog",
201
201
  ref: this.modalDialogRef,
202
- tabIndex: -1,
203
202
  "aria-modal": "true",
204
203
  "aria-labelledby": "".concat(cssClasses.DIALOG, "-title"),
205
204
  "aria-describedby": "".concat(cssClasses.DIALOG, "-body"),
@@ -299,8 +298,16 @@ export default class ModalContent extends BaseComponent {
299
298
  }
300
299
 
301
300
  componentDidMount() {
301
+ var _a;
302
+
302
303
  this.foundation.handleKeyDownEventListenerMount();
303
304
  this.foundation.modalDialogFocus();
305
+ const nodes = FocusTrapHandle.getFocusableElements(this.modalDialogRef.current);
306
+
307
+ if (!this.modalDialogRef.current.contains(document.activeElement)) {
308
+ // focus on first focusable element
309
+ (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.focus();
310
+ }
304
311
  }
305
312
 
306
313
  componentWillUnmount() {
@@ -329,7 +336,6 @@ export default class ModalContent extends BaseComponent {
329
336
  className: classList
330
337
  }, this.getMaskElement(), /*#__PURE__*/React.createElement("div", {
331
338
  role: "none",
332
- tabIndex: -1,
333
339
  className: cls({
334
340
  ["".concat(cssClasses.DIALOG, "-wrap")]: true,
335
341
  ["".concat(cssClasses.DIALOG, "-wrap-center")]: this.props.centered
@@ -25,13 +25,13 @@ export default class NavFooter extends PureComponent {
25
25
  locale,
26
26
  isCollapsed
27
27
  } = this.context;
28
- return /*#__PURE__*/React.createElement(CollapseButton, Object.assign({
28
+ return /*#__PURE__*/React.createElement(CollapseButton, {
29
29
  prefixCls: prefixCls,
30
30
  isCollapsed: isCollapsed,
31
31
  locale: locale,
32
32
  onClick: onCollapseChange,
33
33
  collapseText: collapseText
34
- }, collapseButton));
34
+ });
35
35
  };
36
36
  }
37
37
 
@@ -50,6 +50,7 @@ function OpenIconTransition() {
50
50
 
51
51
  if ( /*#__PURE__*/React.isValidElement(children)) {
52
52
  return /*#__PURE__*/React.cloneElement(children, {
53
+ // @ts-ignore
53
54
  style: Object.assign(Object.assign({}, children.props && children.props.style), formatedStyle)
54
55
  });
55
56
  }
@@ -127,11 +127,15 @@ export default class SubNav extends BaseComponent {
127
127
  ["".concat(prefixCls, "-item-icon-info")]: !isToggleIcon
128
128
  });
129
129
  const isOpen = this.adapter.getIsOpen();
130
- const iconElem = /*#__PURE__*/React.isValidElement(icon) ? withTransition ? /*#__PURE__*/React.createElement(OpenIconTransition, {
130
+ const iconElem = /*#__PURE__*/React.isValidElement(icon) ? withTransition ?
131
+ /*#__PURE__*/
132
+ // @ts-ignore
133
+ React.createElement(OpenIconTransition, {
131
134
  isOpen: isOpen
132
135
  }, /*#__PURE__*/React.cloneElement(icon, {
133
136
  size: iconSize
134
- })) : /*#__PURE__*/React.cloneElement(icon, {
137
+ })) //@ts-ignore
138
+ : /*#__PURE__*/React.cloneElement(icon, {
135
139
  size: iconSize
136
140
  }) : null;
137
141
  return /*#__PURE__*/React.createElement("i", {
@@ -53,7 +53,7 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
53
53
  visible: PropTypes.Requireable<boolean>;
54
54
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
55
55
  motion: PropTypes.Requireable<boolean | object>;
56
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
56
+ position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
57
57
  mouseEnterDelay: PropTypes.Requireable<number>;
58
58
  mouseLeaveDelay: PropTypes.Requireable<number>;
59
59
  trigger: PropTypes.Validator<"hover" | "focus" | "click" | "custom">;
@@ -168,7 +168,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
168
168
  emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
169
169
  onDropdownVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
170
170
  zIndex: PropTypes.Requireable<number>;
171
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
171
+ position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
172
172
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
173
173
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
174
174
  dropdownClassName: PropTypes.Requireable<string>;
@@ -292,7 +292,7 @@ class Body extends BaseComponent {
292
292
  overflowY: 'auto'
293
293
  };
294
294
  const wrapCls = classnames("".concat(prefixCls, "-body"));
295
- return /*#__PURE__*/React.createElement(List, Object.assign({}, virtualized, {
295
+ return /*#__PURE__*/React.createElement(List, Object.assign({}, typeof virtualized === 'object' ? virtualized : {}, {
296
296
  initialScrollOffset: this.state.cache.virtualizedScrollTop,
297
297
  onScroll: this.handleVirtualizedScroll,
298
298
  onItemsRendered: this.onItemsRendered,
@@ -300,7 +300,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
300
300
  showSizeChanger?: boolean;
301
301
  showQuickJumper?: boolean;
302
302
  popoverZIndex?: number;
303
- popoverPosition?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
303
+ popoverPosition?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
304
304
  hideOnSinglePage?: boolean;
305
305
  hoverShowPageSelect?: boolean;
306
306
  };
@@ -46,6 +46,7 @@ class Timeline extends PureComponent {
46
46
  this.addClassName = items => React.Children.map(items, (ele, idx) => {
47
47
  if ( /*#__PURE__*/React.isValidElement(ele)) {
48
48
  return /*#__PURE__*/React.cloneElement(ele, {
49
+ // @ts-ignore
49
50
  className: cls(ele.props.className, this.getPosCls(ele, idx))
50
51
  });
51
52
  }
@@ -81,7 +81,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
81
81
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
82
82
  motion: PropTypes.Requireable<boolean | object>;
83
83
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
84
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
84
+ position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
85
85
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
86
86
  mouseEnterDelay: PropTypes.Requireable<number>;
87
87
  mouseLeaveDelay: PropTypes.Requireable<number>;
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
39
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.20.2",
3
+ "version": "2.20.3",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -18,11 +18,11 @@
18
18
  ],
19
19
  "dependencies": {
20
20
  "@douyinfe/semi-animation": "2.12.0",
21
- "@douyinfe/semi-animation-react": "2.20.2",
22
- "@douyinfe/semi-foundation": "2.20.2",
23
- "@douyinfe/semi-icons": "2.20.2",
21
+ "@douyinfe/semi-animation-react": "2.20.3",
22
+ "@douyinfe/semi-foundation": "2.20.3",
23
+ "@douyinfe/semi-icons": "2.20.3",
24
24
  "@douyinfe/semi-illustrations": "2.15.0",
25
- "@douyinfe/semi-theme-default": "2.20.2",
25
+ "@douyinfe/semi-theme-default": "2.20.3",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,13 +69,13 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "bd882a1aea13fc07aa43d61a51dd9a346b428059",
72
+ "gitHead": "f3c92641b8e004623a6e644af93eb0718290956d",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",
76
76
  "@babel/preset-env": "^7.15.8",
77
77
  "@babel/preset-react": "^7.14.5",
78
- "@douyinfe/semi-scss-compile": "2.20.2",
78
+ "@douyinfe/semi-scss-compile": "2.20.3",
79
79
  "@storybook/addon-knobs": "^6.3.1",
80
80
  "@types/lodash": "^4.14.176",
81
81
  "@types/react": ">=16.0.0",