@jiaozhiye/qm-design-react 1.4.0-beta.6 → 1.4.0-beta.7

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.
@@ -6,7 +6,7 @@ declare type IProps = {
6
6
  onTabClick: AnyFunction<void>;
7
7
  };
8
8
  declare class AnchorNav extends Component<IProps> {
9
- renderLabel(prefixCls: string): React.ReactNode[];
9
+ renderLabel(): React.ReactNode[];
10
10
  render(): JSX.Element;
11
11
  }
12
12
  export default AnchorNav;
@@ -9,6 +9,7 @@ declare type IProps = {
9
9
  size?: ComponentSize;
10
10
  labelWidth?: number | string;
11
11
  labelList?: Array<ILabelItem>;
12
+ tabPosition?: 'left' | 'top';
12
13
  className?: string;
13
14
  style?: CSSProperties;
14
15
  children?: React.ReactNode;
@@ -34,7 +35,7 @@ declare class QmAnchor extends Component<IProps, IState> {
34
35
  }> | null | undefined)[]>;
35
36
  };
36
37
  static defaultProps: {
37
- labelWidth: number;
38
+ tabPosition: string;
38
39
  };
39
40
  static contextType: React.Context<import("../../config-provider/context").IConfig>;
40
41
  private currentState;
@@ -11,20 +11,13 @@
11
11
  .@{prefix-anchor} {
12
12
  .reset-container;
13
13
  display: flex;
14
- flex-direction: row;
15
- &__label {
16
- width: 80px;
17
- }
18
- &-nav {
19
- height: 100%;
20
- margin-right: @--margin-md;
21
- border-right: 1px solid @--border-color-base;
22
- &__item {
14
+ .anchor-nav {
15
+ display: flex;
16
+ flex: none;
17
+ .item {
23
18
  display: flex;
24
19
  align-items: center;
25
- justify-content: flex-end;
26
20
  height: @--height-md;
27
- padding-right: @--padding-md;
28
21
  position: relative;
29
22
  cursor: pointer;
30
23
  &.actived {
@@ -32,39 +25,75 @@
32
25
  &::after {
33
26
  content: '';
34
27
  position: absolute;
35
- right: -2px;
36
- top: 0;
37
- width: 2px;
38
- height: 100%;
39
28
  background-color: @--primary-color;
40
29
  }
41
30
  }
42
31
  span {
43
32
  .text-overflow-cut();
44
33
  display: block;
45
- text-align: right;
46
34
  }
47
35
  }
48
36
  }
49
- &__container {
50
- flex: 1;
51
- width: 0;
52
- padding-right: 5px;
37
+ &-left {
38
+ flex-direction: row;
39
+ .anchor-nav {
40
+ flex-direction: column;
41
+ margin-right: @--margin-md;
42
+ border-right: 1px solid @--border-color-base;
43
+ .item {
44
+ justify-content: flex-end;
45
+ padding: 0 @--padding-md;
46
+ &.actived {
47
+ &::after {
48
+ width: 2px;
49
+ right: -2px;
50
+ top: 0;
51
+ bottom: 0;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ &-top {
58
+ flex-direction: column;
59
+ .anchor-nav {
60
+ flex-direction: row;
61
+ margin-bottom: @--margin-md;
62
+ border-bottom: 1px solid @--border-color-base;
63
+ .item {
64
+ justify-content: center;
65
+ padding: 0 @--padding-md + 2px;
66
+ &.actived {
67
+ &::after {
68
+ height: 2px;
69
+ bottom: -2px;
70
+ left: @--padding-md;
71
+ right: @--padding-md;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ .anchor-container {
78
+ flex: auto;
79
+ min-width: 0;
80
+ min-height: 0;
53
81
  overflow-y: auto;
82
+ overflow-x: hidden;
54
83
  }
55
84
  // ------ size ------
56
85
  // 40 32 24
57
86
  &--lg {
58
- .@{prefix-anchor}-nav {
59
- &__item {
87
+ .anchor-nav {
88
+ .item {
60
89
  height: @--height-lg;
61
90
  }
62
91
  }
63
92
  }
64
93
  &--sm {
65
- .@{prefix-anchor}-nav {
66
- &__item {
67
- height: @--height-sm;
94
+ .anchor-nav {
95
+ .item {
96
+ height: @--height-sm + 2px;
68
97
  font-size: 13px;
69
98
  }
70
99
  }