@douyinfe/semi-ui 2.24.2 → 2.24.4-alpha.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 (55) hide show
  1. package/dist/umd/semi-ui.js +227 -211
  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/carousel/CarouselIndicator.d.ts +1 -1
  8. package/lib/cjs/carousel/index.d.ts +2 -2
  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/form/baseForm.d.ts +4 -4
  15. package/lib/cjs/form/field.d.ts +4 -4
  16. package/lib/cjs/form/hoc/withFormApi.d.ts +1 -1
  17. package/lib/cjs/form/hoc/withFormApi.js +15 -6
  18. package/lib/cjs/form/hoc/withFormState.d.ts +1 -1
  19. package/lib/cjs/form/hoc/withFormState.js +15 -6
  20. package/lib/cjs/navigation/index.d.ts +7 -7
  21. package/lib/cjs/popover/index.d.ts +1 -1
  22. package/lib/cjs/radio/radio.d.ts +1 -1
  23. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  24. package/lib/cjs/select/index.d.ts +1 -1
  25. package/lib/cjs/table/Table.d.ts +1 -1
  26. package/lib/cjs/tooltip/index.d.ts +1 -1
  27. package/lib/cjs/tooltip/index.js +6 -4
  28. package/lib/cjs/typography/numeral.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/carousel/CarouselIndicator.d.ts +1 -1
  33. package/lib/es/carousel/index.d.ts +2 -2
  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/form/baseForm.d.ts +4 -4
  40. package/lib/es/form/field.d.ts +4 -4
  41. package/lib/es/form/hoc/withFormApi.d.ts +1 -1
  42. package/lib/es/form/hoc/withFormApi.js +12 -5
  43. package/lib/es/form/hoc/withFormState.d.ts +1 -1
  44. package/lib/es/form/hoc/withFormState.js +12 -5
  45. package/lib/es/navigation/index.d.ts +7 -7
  46. package/lib/es/popover/index.d.ts +1 -1
  47. package/lib/es/radio/radio.d.ts +1 -1
  48. package/lib/es/radio/radioGroup.d.ts +1 -1
  49. package/lib/es/select/index.d.ts +1 -1
  50. package/lib/es/table/Table.d.ts +1 -1
  51. package/lib/es/tooltip/index.d.ts +1 -1
  52. package/lib/es/tooltip/index.js +7 -4
  53. package/lib/es/typography/numeral.d.ts +1 -1
  54. package/lib/es/typography/title.d.ts +1 -1
  55. package/package.json +8 -8
@@ -1,9 +1,16 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { FormApiContext } from '../context';
3
3
 
4
- const withFormApi = Component => /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(FormApiContext.Consumer, null, formApi => /*#__PURE__*/React.createElement(Component, Object.assign({
5
- formApi: formApi,
6
- ref: ref
7
- }, props))));
4
+ function withFormApi(Component) {
5
+ let WithApiCom = (props, ref) => {
6
+ return /*#__PURE__*/React.createElement(FormApiContext.Consumer, null, formApi => /*#__PURE__*/React.createElement(Component, Object.assign({
7
+ formApi: formApi,
8
+ ref: ref
9
+ }, props)));
10
+ };
11
+
12
+ WithApiCom = /*#__PURE__*/forwardRef(WithApiCom);
13
+ return WithApiCom;
14
+ }
8
15
 
9
16
  export default withFormApi;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const withFormState: (Component: React.ElementType) => React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
2
+ declare function withFormState<C extends React.ElementType, T extends React.ComponentProps<C> & React.RefAttributes<any>, R extends React.ComponentType<T>>(Component: C): R;
3
3
  export default withFormState;
@@ -1,9 +1,16 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { FormStateContext } from '../context';
3
3
 
4
- const withFormState = Component => /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(FormStateContext.Consumer, null, formState => /*#__PURE__*/React.createElement(Component, Object.assign({
5
- formState: formState,
6
- ref: ref
7
- }, props))));
4
+ function withFormState(Component) {
5
+ let WithStateCom = (props, ref) => {
6
+ return /*#__PURE__*/React.createElement(FormStateContext.Consumer, null, formState => /*#__PURE__*/React.createElement(Component, Object.assign({
7
+ formState: formState,
8
+ ref: ref
9
+ }, props)));
10
+ };
11
+
12
+ WithStateCom = /*#__PURE__*/forwardRef(WithStateCom);
13
+ return WithStateCom;
14
+ }
8
15
 
9
16
  export default withFormState;
@@ -51,17 +51,17 @@ export interface NavProps extends BaseProps {
51
51
  tooltipShowDelay?: number;
52
52
  getPopupContainer?: () => HTMLElement;
53
53
  onClick?: (data: {
54
- itemKey: React.ReactText;
55
- domEvent: MouseEvent;
56
- isOpen: boolean;
54
+ itemKey?: React.ReactText;
55
+ domEvent?: MouseEvent;
56
+ isOpen?: boolean;
57
57
  }) => void;
58
58
  onCollapseChange?: (isCollapse: boolean) => void;
59
59
  onDeselect?: (data?: any) => void;
60
60
  onOpenChange?: (data: {
61
- itemKey: (string | number);
62
- openKeys: (string | number)[];
63
- domEvent: MouseEvent;
64
- isOpen: boolean;
61
+ itemKey?: (string | number);
62
+ openKeys?: (string | number)[];
63
+ domEvent?: MouseEvent;
64
+ isOpen?: boolean;
65
65
  }) => void;
66
66
  onSelect?: (data: OnSelectedData) => void;
67
67
  renderWrapper?: ({ itemElement, isSubNav, isInSubNav, props }: {
@@ -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>;
56
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
56
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
57
57
  mouseEnterDelay: PropTypes.Requireable<number>;
58
58
  mouseLeaveDelay: PropTypes.Requireable<number>;
59
59
  trigger: PropTypes.Validator<NonNullable<"hover" | "focus" | "click" | "custom">>;
@@ -82,7 +82,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
82
82
  prefixCls?: string;
83
83
  name?: string;
84
84
  onChange?: (e: RadioChangeEvent) => void;
85
- buttonSize?: "small" | "large" | "middle";
85
+ buttonSize?: "small" | "middle" | "large";
86
86
  isCardRadio?: boolean;
87
87
  isPureCardRadio?: boolean;
88
88
  };
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
48
48
  disabled: PropTypes.Requireable<boolean>;
49
49
  name: PropTypes.Requireable<string>;
50
50
  options: PropTypes.Requireable<any[]>;
51
- buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
51
+ buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
52
52
  type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
53
53
  value: PropTypes.Requireable<any>;
54
54
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -173,7 +173,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
173
173
  emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
174
174
  onDropdownVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
175
175
  zIndex: PropTypes.Requireable<number>;
176
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
176
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
177
177
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
178
178
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
179
179
  dropdownClassName: PropTypes.Requireable<string>;
@@ -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?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
303
+ popoverPosition?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
304
304
  hideOnSinglePage?: boolean;
305
305
  hoverShowPageSelect?: boolean;
306
306
  };
@@ -86,7 +86,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
86
86
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
87
87
  motion: PropTypes.Requireable<boolean>;
88
88
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
89
- position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
89
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
90
90
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
91
91
  mouseEnterDelay: PropTypes.Requireable<number>;
92
92
  mouseLeaveDelay: PropTypes.Requireable<number>;
@@ -185,6 +185,9 @@ export default class Tooltip extends BaseComponent {
185
185
 
186
186
  const transformOrigin = _get(containerStyle, 'transformOrigin');
187
187
 
188
+ const userOpacity = _get(style, 'opacity');
189
+
190
+ const opacity = userOpacity ? userOpacity : 1;
188
191
  const inner = /*#__PURE__*/React.createElement(CSSAnimation, {
189
192
  fillMode: "forwards",
190
193
  animationState: transitionState,
@@ -206,11 +209,11 @@ export default class Tooltip extends BaseComponent {
206
209
  } = _ref;
207
210
  return /*#__PURE__*/React.createElement("div", Object.assign({
208
211
  className: classNames(className, animationClassName),
209
- style: Object.assign(Object.assign(Object.assign({
210
- opacity: isPositionUpdated ? '1' : "0"
211
- }, animationStyle), {
212
+ style: Object.assign(Object.assign(Object.assign(Object.assign({}, animationStyle), {
212
213
  transformOrigin
213
- }), style)
214
+ }), style), {
215
+ opacity: isPositionUpdated ? opacity : "0"
216
+ })
214
217
  }, portalEventSet, animationEventsNeedBind, {
215
218
  role: role,
216
219
  "x-placement": placement,
@@ -28,7 +28,7 @@ export default class Numeral extends PureComponent<NumeralProps> {
28
28
  static propTypes: {
29
29
  rule: PropTypes.Requireable<"text" | "numbers" | "bytes-decimal" | "bytes-binary" | "percentages" | "exponential">;
30
30
  precision: PropTypes.Requireable<number>;
31
- truncate: PropTypes.Requireable<"round" | "ceil" | "floor">;
31
+ truncate: PropTypes.Requireable<"ceil" | "floor" | "round">;
32
32
  parser: PropTypes.Requireable<(...args: any[]) => any>;
33
33
  copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
34
34
  delete: PropTypes.Requireable<boolean>;
@@ -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 | 6 | 5>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
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.24.2",
3
+ "version": "2.24.4-alpha.0",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.24.2",
21
- "@douyinfe/semi-animation-react": "2.24.2",
22
- "@douyinfe/semi-foundation": "2.24.2",
23
- "@douyinfe/semi-icons": "2.24.2",
24
- "@douyinfe/semi-illustrations": "2.24.2",
25
- "@douyinfe/semi-theme-default": "2.24.2",
20
+ "@douyinfe/semi-animation": "2.24.3",
21
+ "@douyinfe/semi-animation-react": "2.24.3",
22
+ "@douyinfe/semi-foundation": "2.24.3",
23
+ "@douyinfe/semi-icons": "2.24.3",
24
+ "@douyinfe/semi-illustrations": "2.24.3",
25
+ "@douyinfe/semi-theme-default": "2.24.3",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "41831fb74dbc194221e9be7034dbcf93e4a35aa5",
72
+ "gitHead": "0b408b581caff46443a1eec44535cac0ada7aebd",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",