@douyinfe/semi-ui 2.34.0-alpha.1 → 2.34.1-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 (73) hide show
  1. package/dist/css/semi.css +23 -493
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +297 -236
  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/card/index.d.ts +36 -4
  8. package/lib/cjs/card/index.js +244 -67
  9. package/lib/cjs/form/baseForm.d.ts +1 -1
  10. package/lib/cjs/form/field.d.ts +1 -1
  11. package/lib/cjs/modal/confirm.d.ts +6 -6
  12. package/lib/cjs/navigation/Item.d.ts +0 -4
  13. package/lib/cjs/navigation/Item.js +10 -29
  14. package/lib/cjs/navigation/SubNav.d.ts +0 -5
  15. package/lib/cjs/navigation/SubNav.js +26 -51
  16. package/lib/cjs/skeleton/index.d.ts +0 -1
  17. package/lib/cjs/skeleton/index.js +0 -1
  18. package/lib/cjs/skeleton/item.d.ts +0 -1
  19. package/lib/cjs/skeleton/item.js +1 -6
  20. package/lib/cjs/steps/basicStep.d.ts +0 -3
  21. package/lib/cjs/steps/basicStep.js +2 -8
  22. package/lib/cjs/steps/basicSteps.js +1 -2
  23. package/lib/cjs/steps/fillStep.d.ts +0 -2
  24. package/lib/cjs/steps/fillStep.js +1 -3
  25. package/lib/cjs/steps/fillSteps.js +8 -5
  26. package/lib/cjs/steps/index.d.ts +1 -63
  27. package/lib/cjs/steps/index.js +0 -9
  28. package/lib/cjs/steps/navStep.d.ts +0 -3
  29. package/lib/cjs/steps/navStep.js +2 -6
  30. package/lib/cjs/steps/navSteps.js +1 -2
  31. package/lib/cjs/steps/step.d.ts +1 -4
  32. package/lib/cjs/steps/step.js +0 -1
  33. package/lib/cjs/timeline/index.d.ts +1 -2
  34. package/lib/cjs/timeline/index.js +2 -8
  35. package/lib/cjs/timeline/item.d.ts +0 -10
  36. package/lib/cjs/timeline/item.js +3 -42
  37. package/lib/cjs/typography/title.d.ts +1 -1
  38. package/lib/es/card/index.d.ts +36 -4
  39. package/lib/es/card/index.js +243 -66
  40. package/lib/es/form/baseForm.d.ts +1 -1
  41. package/lib/es/form/field.d.ts +1 -1
  42. package/lib/es/modal/confirm.d.ts +6 -6
  43. package/lib/es/navigation/Item.d.ts +0 -4
  44. package/lib/es/navigation/Item.js +10 -28
  45. package/lib/es/navigation/SubNav.d.ts +0 -5
  46. package/lib/es/navigation/SubNav.js +26 -52
  47. package/lib/es/skeleton/index.d.ts +0 -1
  48. package/lib/es/skeleton/index.js +0 -1
  49. package/lib/es/skeleton/item.d.ts +0 -1
  50. package/lib/es/skeleton/item.js +1 -6
  51. package/lib/es/steps/basicStep.d.ts +0 -3
  52. package/lib/es/steps/basicStep.js +2 -8
  53. package/lib/es/steps/basicSteps.js +1 -2
  54. package/lib/es/steps/fillStep.d.ts +0 -2
  55. package/lib/es/steps/fillStep.js +1 -3
  56. package/lib/es/steps/fillSteps.js +8 -6
  57. package/lib/es/steps/index.d.ts +1 -63
  58. package/lib/es/steps/index.js +0 -6
  59. package/lib/es/steps/navStep.d.ts +0 -3
  60. package/lib/es/steps/navStep.js +2 -6
  61. package/lib/es/steps/navSteps.js +1 -2
  62. package/lib/es/steps/step.d.ts +1 -4
  63. package/lib/es/steps/step.js +0 -1
  64. package/lib/es/timeline/index.d.ts +1 -2
  65. package/lib/es/timeline/index.js +2 -7
  66. package/lib/es/timeline/item.d.ts +0 -10
  67. package/lib/es/timeline/item.js +3 -41
  68. package/lib/es/typography/title.d.ts +1 -1
  69. package/package.json +8 -8
  70. package/lib/cjs/timeline/context.d.ts +0 -8
  71. package/lib/cjs/timeline/context.js +0 -15
  72. package/lib/es/timeline/context.d.ts +0 -8
  73. package/lib/es/timeline/context.js +0 -3
@@ -5,7 +5,6 @@ import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
5
5
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/timeline/constants';
6
6
  import ConfigContext from '../configProvider/context';
7
7
  import Item from './item';
8
- import Context from './context';
9
8
  const prefixCls = cssClasses.PREFIX;
10
9
 
11
10
  class Timeline extends PureComponent {
@@ -77,15 +76,11 @@ class Timeline extends PureComponent {
77
76
  }
78
77
 
79
78
  const items = childrenList || this.addClassName(children);
80
- return /*#__PURE__*/React.createElement(Context.Provider, {
81
- value: {
82
- mode
83
- }
84
- }, /*#__PURE__*/React.createElement("ul", {
79
+ return /*#__PURE__*/React.createElement("ul", {
85
80
  "aria-label": this.props['aria-label'],
86
81
  style: style,
87
82
  className: classString
88
- }, items));
83
+ }, items);
89
84
  }
90
85
 
91
86
  }
@@ -1,7 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
4
- import { ModeType, TimelineContextValue } from './context';
5
4
  export interface TimelineItemProps {
6
5
  color?: string;
7
6
  children?: React.ReactNode;
@@ -13,13 +12,8 @@ export interface TimelineItemProps {
13
12
  className?: string;
14
13
  style?: React.CSSProperties;
15
14
  onClick?: React.MouseEventHandler<HTMLLIElement>;
16
- mode?: ModeType;
17
- odd?: boolean;
18
- usedInC2D?: boolean;
19
15
  }
20
16
  export default class Item extends PureComponent<TimelineItemProps> {
21
- static contextType: React.Context<TimelineContextValue>;
22
- static elementType: string;
23
17
  static propTypes: {
24
18
  color: PropTypes.Requireable<string>;
25
19
  time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -30,15 +24,11 @@ export default class Item extends PureComponent<TimelineItemProps> {
30
24
  className: PropTypes.Requireable<string>;
31
25
  style: PropTypes.Requireable<object>;
32
26
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
33
- mode: PropTypes.Requireable<string>;
34
- lastChild: PropTypes.Requireable<boolean>;
35
27
  };
36
- context: TimelineContextValue;
37
28
  static defaultProps: {
38
29
  type: string;
39
30
  time: string;
40
31
  onClick: (...args: any[]) => void;
41
32
  };
42
- getC2DCls: () => string;
43
33
  render(): JSX.Element;
44
34
  }
@@ -4,42 +4,8 @@ import cls from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/timeline/constants';
6
6
  import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
7
- import Context from './context';
8
7
  const prefixCls = cssClasses.ITEM;
9
8
  export default class Item extends PureComponent {
10
- constructor() {
11
- super(...arguments); // getC2DCls is used in C2D, it does not work in non-C2D scenes
12
-
13
- this.getC2DCls = () => {
14
- let c2dCls = '';
15
- const {
16
- mode,
17
- odd,
18
- usedInC2D
19
- } = this.props;
20
-
21
- if (usedInC2D) {
22
- switch (mode) {
23
- case 'center':
24
- c2dCls = `${prefixCls}-center ${prefixCls}-left`;
25
- break;
26
-
27
- case 'alternate':
28
- c2dCls = `${prefixCls}-alternate ${prefixCls}-${odd ? 'left' : 'right'}`;
29
- break;
30
-
31
- default:
32
- c2dCls = `${prefixCls}-${mode} ${mode === 'right' ? `${prefixCls}-mode-right` : ''}`;
33
- break;
34
- }
35
-
36
- c2dCls += ` ${prefixCls}-not-last-child`;
37
- }
38
-
39
- return c2dCls;
40
- };
41
- }
42
-
43
9
  render() {
44
10
  const {
45
11
  className,
@@ -52,7 +18,7 @@ export default class Item extends PureComponent {
52
18
  extra,
53
19
  onClick
54
20
  } = this.props;
55
- const itemCls = cls(prefixCls, className, this.getC2DCls());
21
+ const itemCls = cls(prefixCls, className);
56
22
  const dotCls = cls({
57
23
  [`${prefixCls}-head`]: true,
58
24
  [`${prefixCls}-head-custom`]: dot,
@@ -83,7 +49,6 @@ export default class Item extends PureComponent {
83
49
  }
84
50
 
85
51
  }
86
- Item.contextType = Context;
87
52
  Item.propTypes = {
88
53
  color: PropTypes.string,
89
54
  time: PropTypes.node,
@@ -93,13 +58,10 @@ Item.propTypes = {
93
58
  position: PropTypes.oneOf(strings.ITEM_POS),
94
59
  className: PropTypes.string,
95
60
  style: PropTypes.object,
96
- onClick: PropTypes.func,
97
- mode: PropTypes.string,
98
- lastChild: PropTypes.bool
61
+ onClick: PropTypes.func
99
62
  };
100
63
  Item.defaultProps = {
101
64
  type: 'default',
102
65
  time: '',
103
66
  onClick: _noop
104
- };
105
- Item.elementType = 'Timeline.Item';
67
+ };
@@ -38,7 +38,7 @@ export default class Title extends PureComponent<TitleProps> {
38
38
  underline: PropTypes.Requireable<boolean>;
39
39
  strong: PropTypes.Requireable<boolean>;
40
40
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
41
- heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
41
+ heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 6 | 5>;
42
42
  style: PropTypes.Requireable<object>;
43
43
  className: PropTypes.Requireable<string>;
44
44
  component: PropTypes.Requireable<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.34.0-alpha.1",
3
+ "version": "2.34.1-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.34.0-alpha.1",
21
- "@douyinfe/semi-animation-react": "2.34.0-alpha.1",
22
- "@douyinfe/semi-foundation": "2.34.0-alpha.1",
23
- "@douyinfe/semi-icons": "2.34.0-alpha.1",
24
- "@douyinfe/semi-illustrations": "2.34.0-alpha.1",
25
- "@douyinfe/semi-theme-default": "2.34.0-alpha.1",
20
+ "@douyinfe/semi-animation": "2.34.1-alpha.2",
21
+ "@douyinfe/semi-animation-react": "2.34.1-alpha.2",
22
+ "@douyinfe/semi-foundation": "2.34.1-alpha.2",
23
+ "@douyinfe/semi-icons": "2.34.1-alpha.2",
24
+ "@douyinfe/semi-illustrations": "2.34.1-alpha.2",
25
+ "@douyinfe/semi-theme-default": "2.34.1-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": "8990c51afec33fcfc2f89234082597e484513756",
72
+ "gitHead": "f5462b68c0ab80669582aa520ce1cd334a5809e4",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare type ModeType = 'left' | 'right' | 'center' | 'alternate';
3
- export interface TimelineContextValue {
4
- mode?: ModeType;
5
- sum?: number;
6
- }
7
- declare const Context: React.Context<TimelineContextValue>;
8
- export default Context;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- const Context = /*#__PURE__*/_react.default.createContext(null);
13
-
14
- var _default = Context;
15
- exports.default = _default;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare type ModeType = 'left' | 'right' | 'center' | 'alternate';
3
- export interface TimelineContextValue {
4
- mode?: ModeType;
5
- sum?: number;
6
- }
7
- declare const Context: React.Context<TimelineContextValue>;
8
- export default Context;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- const Context = /*#__PURE__*/React.createContext(null);
3
- export default Context;