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

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 (77) hide show
  1. package/dist/css/semi.css +38 -4
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +69 -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/datePicker.d.ts +2 -2
  12. package/lib/cjs/datePicker/monthsGrid.d.ts +2 -2
  13. package/lib/cjs/datePicker/quickControl.d.ts +1 -1
  14. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  15. package/lib/cjs/dropdown/index.d.ts +1 -1
  16. package/lib/cjs/form/baseForm.d.ts +4 -4
  17. package/lib/cjs/form/field.d.ts +4 -4
  18. package/lib/cjs/overflowList/index.d.ts +1 -1
  19. package/lib/cjs/popover/index.d.ts +1 -1
  20. package/lib/cjs/radio/radio.d.ts +1 -1
  21. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  22. package/lib/cjs/select/index.d.ts +1 -1
  23. package/lib/cjs/steps/basicStep.d.ts +2 -1
  24. package/lib/cjs/steps/basicStep.js +5 -4
  25. package/lib/cjs/steps/basicSteps.js +6 -3
  26. package/lib/cjs/steps/fillStep.d.ts +2 -1
  27. package/lib/cjs/steps/fillStep.js +2 -1
  28. package/lib/cjs/steps/fillSteps.js +10 -11
  29. package/lib/cjs/steps/index.d.ts +59 -0
  30. package/lib/cjs/steps/index.js +9 -0
  31. package/lib/cjs/steps/navStep.d.ts +2 -1
  32. package/lib/cjs/steps/navStep.js +2 -2
  33. package/lib/cjs/steps/navSteps.js +4 -2
  34. package/lib/cjs/steps/step.d.ts +0 -1
  35. package/lib/cjs/steps/step.js +3 -2
  36. package/lib/cjs/table/Table.d.ts +2 -2
  37. package/lib/cjs/timeline/item.d.ts +5 -0
  38. package/lib/cjs/timeline/item.js +31 -3
  39. package/lib/cjs/tooltip/index.d.ts +1 -1
  40. package/lib/cjs/typography/numeral.d.ts +1 -1
  41. package/lib/cjs/typography/title.d.ts +1 -1
  42. package/lib/es/anchor/index.d.ts +1 -1
  43. package/lib/es/autoComplete/index.d.ts +1 -1
  44. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  45. package/lib/es/carousel/index.d.ts +2 -2
  46. package/lib/es/datePicker/datePicker.d.ts +2 -2
  47. package/lib/es/datePicker/monthsGrid.d.ts +2 -2
  48. package/lib/es/datePicker/quickControl.d.ts +1 -1
  49. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  50. package/lib/es/dropdown/index.d.ts +1 -1
  51. package/lib/es/form/baseForm.d.ts +4 -4
  52. package/lib/es/form/field.d.ts +4 -4
  53. package/lib/es/overflowList/index.d.ts +1 -1
  54. package/lib/es/popover/index.d.ts +1 -1
  55. package/lib/es/radio/radio.d.ts +1 -1
  56. package/lib/es/radio/radioGroup.d.ts +1 -1
  57. package/lib/es/select/index.d.ts +1 -1
  58. package/lib/es/steps/basicStep.d.ts +2 -1
  59. package/lib/es/steps/basicStep.js +5 -4
  60. package/lib/es/steps/basicSteps.js +6 -3
  61. package/lib/es/steps/fillStep.d.ts +2 -1
  62. package/lib/es/steps/fillStep.js +2 -1
  63. package/lib/es/steps/fillSteps.js +11 -11
  64. package/lib/es/steps/index.d.ts +59 -0
  65. package/lib/es/steps/index.js +6 -0
  66. package/lib/es/steps/navStep.d.ts +2 -1
  67. package/lib/es/steps/navStep.js +2 -2
  68. package/lib/es/steps/navSteps.js +4 -2
  69. package/lib/es/steps/step.d.ts +0 -1
  70. package/lib/es/steps/step.js +3 -2
  71. package/lib/es/table/Table.d.ts +2 -2
  72. package/lib/es/timeline/item.d.ts +5 -0
  73. package/lib/es/timeline/item.js +31 -3
  74. package/lib/es/tooltip/index.d.ts +1 -1
  75. package/lib/es/typography/numeral.d.ts +1 -1
  76. package/lib/es/typography/title.d.ts +1 -1
  77. package/package.json +8 -8
@@ -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,11 @@ 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;
15
17
  }
16
18
  export default class Item extends PureComponent<TimelineItemProps> {
19
+ static elementType: string;
17
20
  static propTypes: {
18
21
  color: PropTypes.Requireable<string>;
19
22
  time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -24,11 +27,13 @@ export default class Item extends PureComponent<TimelineItemProps> {
24
27
  className: PropTypes.Requireable<string>;
25
28
  style: PropTypes.Requireable<object>;
26
29
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
30
+ mode: PropTypes.Requireable<string>;
27
31
  };
28
32
  static defaultProps: {
29
33
  type: string;
30
34
  time: string;
31
35
  onClick: (...args: any[]) => void;
32
36
  };
37
+ getC2DCls: () => string;
33
38
  render(): JSX.Element;
34
39
  }
@@ -6,6 +6,32 @@ 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
+ const {
14
+ mode,
15
+ oddIndex
16
+ } = this.props;
17
+
18
+ if (mode) {
19
+ switch (mode) {
20
+ case 'center':
21
+ return "".concat(prefixCls, "-center ").concat(prefixCls, "-left");
22
+
23
+ case 'alternate':
24
+ return "".concat(prefixCls, "-alternate ").concat(prefixCls, "-").concat(oddIndex ? 'left' : 'right');
25
+
26
+ default:
27
+ return "".concat(prefixCls, "-").concat(mode, " ").concat(mode === 'right' ? "".concat(prefixCls, "-mode-right") : '');
28
+ }
29
+ }
30
+
31
+ return '';
32
+ };
33
+ }
34
+
9
35
  render() {
10
36
  const {
11
37
  className,
@@ -18,7 +44,7 @@ export default class Item extends PureComponent {
18
44
  extra,
19
45
  onClick
20
46
  } = this.props;
21
- const itemCls = cls(prefixCls, className);
47
+ const itemCls = cls(prefixCls, className, this.getC2DCls());
22
48
  const dotCls = cls({
23
49
  ["".concat(prefixCls, "-head")]: true,
24
50
  ["".concat(prefixCls, "-head-custom")]: dot,
@@ -58,10 +84,12 @@ Item.propTypes = {
58
84
  position: PropTypes.oneOf(strings.ITEM_POS),
59
85
  className: PropTypes.string,
60
86
  style: PropTypes.object,
61
- onClick: PropTypes.func
87
+ onClick: PropTypes.func,
88
+ mode: PropTypes.string
62
89
  };
63
90
  Item.defaultProps = {
64
91
  type: 'default',
65
92
  time: '',
66
93
  onClick: _noop
67
- };
94
+ };
95
+ 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<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.30.0-alpha.0",
3
+ "version": "2.30.0-alpha.1",
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.1",
21
+ "@douyinfe/semi-animation-react": "2.30.0-alpha.1",
22
+ "@douyinfe/semi-foundation": "2.30.0-alpha.1",
23
+ "@douyinfe/semi-icons": "2.30.0-alpha.1",
24
+ "@douyinfe/semi-illustrations": "2.30.0-alpha.1",
25
+ "@douyinfe/semi-theme-default": "2.30.0-alpha.1",
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": "8bb24709d0cd0a406d93f3c61e73774a02ea1af3",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",