@douyinfe/semi-ui 2.30.0-alpha.0 → 2.30.0-alpha.2

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 (79) hide show
  1. package/dist/css/semi.css +41 -4
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +79 -27
  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/anchor/index.d.ts +1 -1
  8. package/lib/cjs/autoComplete/index.d.ts +1 -1
  9. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  10. package/lib/cjs/carousel/index.d.ts +2 -2
  11. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  12. package/lib/cjs/datePicker/datePicker.d.ts +3 -3
  13. package/lib/cjs/datePicker/monthsGrid.d.ts +3 -3
  14. package/lib/cjs/datePicker/quickControl.d.ts +1 -1
  15. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  16. package/lib/cjs/dropdown/index.d.ts +1 -1
  17. package/lib/cjs/form/baseForm.d.ts +4 -4
  18. package/lib/cjs/form/field.d.ts +4 -4
  19. package/lib/cjs/overflowList/index.d.ts +1 -1
  20. package/lib/cjs/popover/index.d.ts +1 -1
  21. package/lib/cjs/radio/radio.d.ts +1 -1
  22. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  23. package/lib/cjs/select/index.d.ts +1 -1
  24. package/lib/cjs/steps/basicStep.d.ts +2 -1
  25. package/lib/cjs/steps/basicStep.js +5 -4
  26. package/lib/cjs/steps/basicSteps.js +6 -3
  27. package/lib/cjs/steps/fillStep.d.ts +2 -1
  28. package/lib/cjs/steps/fillStep.js +2 -1
  29. package/lib/cjs/steps/fillSteps.js +10 -11
  30. package/lib/cjs/steps/index.d.ts +59 -0
  31. package/lib/cjs/steps/index.js +9 -0
  32. package/lib/cjs/steps/navStep.d.ts +2 -1
  33. package/lib/cjs/steps/navStep.js +2 -2
  34. package/lib/cjs/steps/navSteps.js +4 -2
  35. package/lib/cjs/steps/step.d.ts +0 -1
  36. package/lib/cjs/steps/step.js +3 -2
  37. package/lib/cjs/table/Table.d.ts +2 -2
  38. package/lib/cjs/timeline/item.d.ts +7 -0
  39. package/lib/cjs/timeline/item.js +41 -3
  40. package/lib/cjs/tooltip/index.d.ts +1 -1
  41. package/lib/cjs/typography/numeral.d.ts +1 -1
  42. package/lib/cjs/typography/title.d.ts +1 -1
  43. package/lib/es/anchor/index.d.ts +1 -1
  44. package/lib/es/autoComplete/index.d.ts +1 -1
  45. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  46. package/lib/es/carousel/index.d.ts +2 -2
  47. package/lib/es/datePicker/dateInput.d.ts +1 -1
  48. package/lib/es/datePicker/datePicker.d.ts +3 -3
  49. package/lib/es/datePicker/monthsGrid.d.ts +3 -3
  50. package/lib/es/datePicker/quickControl.d.ts +1 -1
  51. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  52. package/lib/es/dropdown/index.d.ts +1 -1
  53. package/lib/es/form/baseForm.d.ts +4 -4
  54. package/lib/es/form/field.d.ts +4 -4
  55. package/lib/es/overflowList/index.d.ts +1 -1
  56. package/lib/es/popover/index.d.ts +1 -1
  57. package/lib/es/radio/radio.d.ts +1 -1
  58. package/lib/es/radio/radioGroup.d.ts +1 -1
  59. package/lib/es/select/index.d.ts +1 -1
  60. package/lib/es/steps/basicStep.d.ts +2 -1
  61. package/lib/es/steps/basicStep.js +5 -4
  62. package/lib/es/steps/basicSteps.js +6 -3
  63. package/lib/es/steps/fillStep.d.ts +2 -1
  64. package/lib/es/steps/fillStep.js +2 -1
  65. package/lib/es/steps/fillSteps.js +11 -11
  66. package/lib/es/steps/index.d.ts +59 -0
  67. package/lib/es/steps/index.js +6 -0
  68. package/lib/es/steps/navStep.d.ts +2 -1
  69. package/lib/es/steps/navStep.js +2 -2
  70. package/lib/es/steps/navSteps.js +4 -2
  71. package/lib/es/steps/step.d.ts +0 -1
  72. package/lib/es/steps/step.js +3 -2
  73. package/lib/es/table/Table.d.ts +2 -2
  74. package/lib/es/timeline/item.d.ts +7 -0
  75. package/lib/es/timeline/item.js +41 -3
  76. package/lib/es/tooltip/index.d.ts +1 -1
  77. package/lib/es/typography/numeral.d.ts +1 -1
  78. package/lib/es/typography/title.d.ts +1 -1
  79. package/package.json +8 -8
@@ -19,12 +19,11 @@ const NavStep = props => {
19
19
  onKeyDown,
20
20
  onChange,
21
21
  lastOne,
22
- type,
23
22
  size
24
23
  } = props;
25
24
  const classString = classnames(prefixCls, {
26
25
  ["".concat(prefixCls, "-active")]: active,
27
- ["".concat(prefixCls, "-nav")]: type,
26
+ ["".concat(prefixCls, "-nav")]: props.usedInC2D,
28
27
  ["".concat(prefixCls, "-small")]: size === 'small'
29
28
  }, className);
30
29
 
@@ -88,4 +87,5 @@ NavStep.defaultProps = {
88
87
  active: false,
89
88
  className: ''
90
89
  };
90
+ NavStep.elementType = 'Steps.NavStep';
91
91
  export default NavStep;
@@ -22,10 +22,12 @@ const Steps = props => {
22
22
  return null;
23
23
  }
24
24
 
25
- const childProps = Object.assign({
25
+ const childProps = Object.assign(Object.assign({
26
26
  index,
27
27
  total
28
- }, child.props);
28
+ }, child.props), {
29
+ size
30
+ });
29
31
  childProps.active = index === current;
30
32
 
31
33
  childProps.onChange = () => {
@@ -8,7 +8,6 @@ export interface StepProps {
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
10
  onClick?: React.MouseEventHandler<HTMLDivElement>;
11
- type?: string;
12
11
  }
13
12
  declare const Step: {
14
13
  (props: StepProps): JSX.Element;
@@ -5,8 +5,9 @@ import NavStep from './navStep';
5
5
  import Context from './context';
6
6
 
7
7
  const Step = props => {
8
- const stepContext = useContext(Context);
9
- const type = stepContext ? stepContext.type : props.type;
8
+ const {
9
+ type
10
+ } = useContext(Context);
10
11
 
11
12
  const renderStep = () => {
12
13
  switch (type) {
@@ -280,7 +280,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
280
280
  * Combine pagination and table paging processing functions
281
281
  */
282
282
  mergePagination: (pagination: TablePaginationProps) => {
283
- position?: "top" | "bottom" | "both";
283
+ position?: "both" | "top" | "bottom";
284
284
  formatPageText?: import("./interface").FormatPageText;
285
285
  style?: React.CSSProperties;
286
286
  className?: 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?: "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
  };
@@ -12,8 +12,12 @@ export interface TimelineItemProps {
12
12
  className?: string;
13
13
  style?: React.CSSProperties;
14
14
  onClick?: React.MouseEventHandler<HTMLLIElement>;
15
+ mode?: 'left' | 'right' | 'center' | 'alternate';
16
+ oddIndex?: boolean;
17
+ lastOne?: boolean;
15
18
  }
16
19
  export default class Item extends PureComponent<TimelineItemProps> {
20
+ static elementType: string;
17
21
  static propTypes: {
18
22
  color: PropTypes.Requireable<string>;
19
23
  time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -24,11 +28,14 @@ export default class Item extends PureComponent<TimelineItemProps> {
24
28
  className: PropTypes.Requireable<string>;
25
29
  style: PropTypes.Requireable<object>;
26
30
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
31
+ mode: PropTypes.Requireable<string>;
32
+ lastOne: PropTypes.Requireable<boolean>;
27
33
  };
28
34
  static defaultProps: {
29
35
  type: string;
30
36
  time: string;
31
37
  onClick: (...args: any[]) => void;
32
38
  };
39
+ getC2DCls: () => string;
33
40
  render(): JSX.Element;
34
41
  }
@@ -6,6 +6,41 @@ import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/timeline/c
6
6
  import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
7
7
  const prefixCls = cssClasses.ITEM;
8
8
  export default class Item extends PureComponent {
9
+ constructor() {
10
+ super(...arguments); // getC2DCls is used in C2D, it does not work in non-C2D scenes
11
+
12
+ this.getC2DCls = () => {
13
+ let c2dCls = '';
14
+ const {
15
+ mode,
16
+ oddIndex,
17
+ lastOne
18
+ } = this.props;
19
+
20
+ if (mode) {
21
+ switch (mode) {
22
+ case 'center':
23
+ c2dCls = "".concat(prefixCls, "-center ").concat(prefixCls, "-left");
24
+ break;
25
+
26
+ case 'alternate':
27
+ c2dCls = "".concat(prefixCls, "-alternate ").concat(prefixCls, "-").concat(oddIndex ? 'left' : 'right');
28
+ break;
29
+
30
+ default:
31
+ c2dCls = "".concat(prefixCls, "-").concat(mode, " ").concat(mode === 'right' ? "".concat(prefixCls, "-mode-right") : '');
32
+ break;
33
+ }
34
+ }
35
+
36
+ if (!lastOne) {
37
+ c2dCls += " ".concat(prefixCls, "-not-last-child");
38
+ }
39
+
40
+ return c2dCls;
41
+ };
42
+ }
43
+
9
44
  render() {
10
45
  const {
11
46
  className,
@@ -18,7 +53,7 @@ export default class Item extends PureComponent {
18
53
  extra,
19
54
  onClick
20
55
  } = this.props;
21
- const itemCls = cls(prefixCls, className);
56
+ const itemCls = cls(prefixCls, className, this.getC2DCls());
22
57
  const dotCls = cls({
23
58
  ["".concat(prefixCls, "-head")]: true,
24
59
  ["".concat(prefixCls, "-head-custom")]: dot,
@@ -58,10 +93,13 @@ Item.propTypes = {
58
93
  position: PropTypes.oneOf(strings.ITEM_POS),
59
94
  className: PropTypes.string,
60
95
  style: PropTypes.object,
61
- onClick: PropTypes.func
96
+ onClick: PropTypes.func,
97
+ mode: PropTypes.string,
98
+ lastOne: PropTypes.bool
62
99
  };
63
100
  Item.defaultProps = {
64
101
  type: 'default',
65
102
  time: '',
66
103
  onClick: _noop
67
- };
104
+ };
105
+ Item.elementType = 'Timeline.Item';
@@ -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<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
89
+ position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "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>;
@@ -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<"ceil" | "floor" | "round">;
31
+ truncate: PropTypes.Requireable<"round" | "ceil" | "floor">;
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 | 5 | 6>;
40
+ heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 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.30.0-alpha.0",
3
+ "version": "2.30.0-alpha.2",
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.30.0-alpha.0",
21
- "@douyinfe/semi-animation-react": "2.30.0-alpha.0",
22
- "@douyinfe/semi-foundation": "2.30.0-alpha.0",
23
- "@douyinfe/semi-icons": "2.30.0-alpha.0",
24
- "@douyinfe/semi-illustrations": "2.30.0-alpha.0",
25
- "@douyinfe/semi-theme-default": "2.30.0-alpha.0",
20
+ "@douyinfe/semi-animation": "2.30.0-alpha.2",
21
+ "@douyinfe/semi-animation-react": "2.30.0-alpha.2",
22
+ "@douyinfe/semi-foundation": "2.30.0-alpha.2",
23
+ "@douyinfe/semi-icons": "2.30.0-alpha.2",
24
+ "@douyinfe/semi-illustrations": "2.30.0-alpha.2",
25
+ "@douyinfe/semi-theme-default": "2.30.0-alpha.2",
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": "5f4c9d8a0aadec8453ba22b1206ba1182878dceb",
72
+ "gitHead": "22568ce0c431646136c6823016342214cac447ca",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",