@titaui/pc 1.7.17 → 1.7.21

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.
@@ -1,77 +1,111 @@
1
- .rc-select-single:not(.rc-select-customize-input) .rc-select-selector {
2
- border: 1px solid #DFE3EA;
3
- }
1
+ .titaui-select {
2
+ .rc-select-single:not(.rc-select-customize-input) .rc-select-selector {
3
+ border: 1px solid #DFE3EA;
4
+ }
4
5
 
5
- .rc-select-focused{
6
- .rc-select-selector{
7
- border: 1px solid #DFE3EA !important;
6
+ .rc-select-focused {
7
+ .rc-select-selector {
8
+ border: 1px solid #DFE3EA !important;
9
+ }
8
10
  }
9
- }
10
- .rc-select-selection-item-remove{
11
- display: flex;
12
- align-items: center;
13
- }
14
- .rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
15
- display: none;
16
- }
17
11
 
18
- .rc-select-single:not(.rc-select-customize-input) .rc-select-selector .rc-select-selection-search-input{
19
- display: none;
20
- }
12
+ .rc-select-selection-item-remove {
13
+ display: flex;
14
+ align-items: center;
15
+ }
21
16
 
22
- .rc-select-single .rc-select-selector .rc-select-selection-item, .rc-select-single .rc-select-selector .rc-select-selection-placeholder{
23
- top: unset;
24
- left: 12px;
25
- }
17
+ .rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
18
+ display: none;
19
+ }
26
20
 
27
- .rc-select-single .rc-select-selector{
28
- align-items: center;
29
- }
21
+ .rc-select-single:not(.rc-select-customize-input) .rc-select-selector .rc-select-selection-search-input {
22
+ display: none;
23
+ }
30
24
 
31
- .rc-select-selector{
32
- cursor: pointer;
33
- padding: 0 12px;
34
- background: #FFFFFF;
35
- border-radius: 8px;
36
- border: 1px solid #DFE3EA;
37
- height: 36px;
38
- box-sizing: border-box;
39
- }
40
- .rc-select-multiple .rc-select-selector {
41
- height: unset;
42
- padding: 7px 12px 0;
43
- border: 1px solid #DFE3EA;
44
- }
45
- .rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
46
- display: flex;
47
- align-items: center;
48
- margin-bottom: 7px;
49
- }
25
+ .rc-select-single .rc-select-selector .rc-select-selection-item,
26
+ .rc-select-single .rc-select-selector .rc-select-selection-placeholder {
27
+ top: unset;
28
+ left: 12px;
29
+ }
50
30
 
51
- .rc-select-selection-item-content{
52
- margin-right: 8px;
53
- }
31
+ .rc-select-single .rc-select-selector {
32
+ align-items: center;
33
+ }
54
34
 
55
- .rc-select-multiple .rc-select-selector .rc-select-selection-item {
56
- font-size: 12px;
57
- flex: none;
58
- height: 20px;
59
- display: flex;
60
- align-items: center;
61
- background: #F0F4FA;
62
- border-radius: 10px;
63
- margin-right: 2px;
64
- padding: 0 5px 0 10px;
65
- .tu-icon-cross{
35
+ .rc-select-selector {
66
36
  cursor: pointer;
67
- color:#a4acB9;
68
- font-size: 14px;
37
+ padding: 0 12px;
38
+ background: #FFFFFF;
39
+ border-radius: 8px;
40
+ border: 1px solid #DFE3EA;
41
+ height: 36px;
42
+ box-sizing: border-box;
43
+ }
44
+
45
+ .rc-select-multiple .rc-select-selector {
46
+ height: unset;
47
+ padding: 7px 12px 0;
48
+ border: 1px solid #DFE3EA;
49
+ }
50
+
51
+ .rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
52
+ display: flex;
53
+ align-items: center;
54
+ margin-bottom: 7px;
55
+ }
56
+
57
+ .rc-select-multiple .rc-select-selector .rc-select-selection-placeholder {
58
+ line-height: 1;
59
+ margin-bottom: 7px;
60
+ position: relative;
61
+ top: -2px;
62
+ }
63
+
64
+ .rc-select-selection-item-content {
65
+ margin-right: 8px;
66
+ }
67
+
68
+ .rc-select-multiple .rc-select-selector .rc-select-selection-item {
69
+ font-size: 12px;
70
+ flex: none;
71
+ height: 20px;
72
+ display: flex;
73
+ align-items: center;
74
+ background: #F0F4FA;
75
+ border-radius: 10px;
76
+ margin-right: 2px;
77
+ padding: 0 5px 0 10px;
78
+
79
+ .tu-icon-cross {
80
+ cursor: pointer;
81
+ color: #a4acB9;
82
+ font-size: 14px;
83
+ }
84
+ }
85
+
86
+ .titaui-select-noborder {
87
+ .rc-select-selector {
88
+ border: none !important;
89
+ height: 22px;
90
+ line-height: 1;
91
+ }
92
+ }
93
+
94
+ .rc-select-arrow {
95
+ font-size: 16px;
96
+ transform: scale(0.5);
97
+ }
98
+
99
+ .rc-select-show-arrow .rc-select-arrow {
100
+ top: 0;
101
+ bottom: 0;
102
+ margin: auto;
103
+ right: 12px;
104
+ height: 22px;
69
105
  }
70
106
  }
71
- .rc-select-item {
72
- font-size: 14px;
73
- }
74
- .rc-select-dropdown{
107
+
108
+ .titaui-dropDown {
75
109
  z-index: 2000;
76
110
  box-sizing: border-box;
77
111
  padding: 16px 6px;
@@ -79,48 +113,43 @@
79
113
  box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
80
114
  border: 1px solid #F0F2F5;
81
115
  border-radius: 8px;
82
- }
83
116
 
84
- .rc-select-item-option{
85
- height: 36px;
86
- line-height: 36px;
87
- cursor: pointer;
88
- }
89
- .rc-select-item-option-selected {
117
+ .rc-select-item {
118
+ font-size: 14px;
119
+ padding: 7px 6px;
120
+ }
90
121
 
91
- color: #2879FF;
92
- }
93
- .rc-select-item-option-active {
94
- border-radius: 8px;
95
- color: #2879FF;
96
- background: #F7F8FA;
97
- }
122
+ .rc-select-item-option {
123
+ height: 36px;
124
+ box-sizing: border-box;
125
+ line-height: 36px;
126
+ cursor: pointer;
127
+ }
98
128
 
99
- .rc-select-arrow{
100
- font-size: 16px;
101
- transform: scale(0.5);
102
- }
103
- .rc-select-show-arrow .rc-select-arrow {
104
- top: 0;
105
- bottom: 0;
106
- margin: auto;
107
- right: 12px;
108
- height: 22px;
109
- }
129
+ .rc-select-item-option-selected {
110
130
 
111
- .rc-select-item-option-state{
112
- display: none;
113
- }
131
+ color: #2879FF;
132
+ }
114
133
 
115
- .titaui-select-hasSelectItem{
116
- .rc-select-item-option-state{
117
- display: block;
134
+ .rc-select-item-option-content {
135
+ line-height: 24px;
136
+ }
137
+
138
+ .rc-select-item-option-active {
139
+ border-radius: 8px;
140
+ color: #2879FF;
141
+ background: #F7F8FA;
142
+ }
143
+
144
+
145
+
146
+ .rc-select-item-option-state {
147
+ display: none;
118
148
  }
119
149
  }
120
- .titaui-select-noborder{
121
- .rc-select-selector{
122
- border: none !important;
123
- height: 22px;
124
- line-height: 1;
150
+
151
+ .titaui-select-hasSelectItem {
152
+ .rc-select-item-option-state {
153
+ display: block;
125
154
  }
126
155
  }
@@ -39,43 +39,43 @@ const SelectTags: FC<Props> = ({
39
39
 
40
40
  const [value, setValue] = useState(selected);
41
41
 
42
- // useEffect(()=>{
43
- // if(!selected) return
44
- // setValue(selected)
45
- // },[selected])
46
-
47
42
  const onhandleChange = (value, options) => {
48
43
  onChange && onChange(value, options,name);
49
44
  setValue(value);
50
45
  };
51
46
 
52
47
  return (
53
- <Select
54
- className={classNames(preCls, className,{[`${preCls}-noborder`]: noBorder},)}
55
- dropdownClassName={classNames({
56
- [`${preCls}-hasSelectItem`]: mode === "multiple",
57
- })}
58
- value={value}
59
- style={style}
60
- mode={mode}
61
- optionFilterProp="children"
62
- optionLabelProp="children"
63
- placeholder={placeholder}
64
- onChange={onhandleChange}
65
- showArrow={true}
66
- removeIcon={<span className="tu-icon-cross"></span>}
67
- inputIcon={<span className="tu-icon-caret-down" />}
68
- menuItemSelectedIcon={<span className="tu-icon-finished" />}
69
- {...restProps}
70
- >
71
- {data.map((item, key) => {
72
- return (
73
- <Option key={key} value={item.value}>
74
- {item.label}
75
- </Option>
76
- );
77
- })}
78
- </Select>
48
+ <div className={preCls}>
49
+ <Select
50
+ className={classNames(className,{[`${preCls}-noborder`]: noBorder},)}
51
+ dropdownClassName={classNames(
52
+ `titaui-dropDown`,
53
+ {
54
+ [`${preCls}-hasSelectItem`]: mode === "multiple",
55
+ })}
56
+ value={value}
57
+ style={style}
58
+ mode={mode}
59
+ optionFilterProp="children"
60
+ optionLabelProp="children"
61
+ placeholder={placeholder}
62
+ onChange={onhandleChange}
63
+ showArrow={true}
64
+ removeIcon={<span className="tu-icon-cross"></span>}
65
+ inputIcon={<span className="tu-icon-caret-down" />}
66
+ menuItemSelectedIcon={<span className="tu-icon-finished" />}
67
+ {...restProps}
68
+ >
69
+ {data.map((item, key) => {
70
+ return (
71
+ <Option key={key} value={item.value}>
72
+ {item.label}
73
+ </Option>
74
+ );
75
+ })}
76
+ </Select>
77
+ </div>
78
+
79
79
  );
80
80
  };
81
81
 
@@ -29,6 +29,16 @@ interface Props {
29
29
  handleRequest?: (type: number) => Promise<any>;
30
30
  }
31
31
 
32
+ const getBackgroundImage = (type) => {
33
+ let selected = attitudeArr.find((a) => a.type == type);
34
+ if (selected) {
35
+ return {
36
+ backgroundImage: `url(${selected.img})`,
37
+ };
38
+ }
39
+ return {};
40
+ };
41
+
32
42
  function UpvoteButton({
33
43
  type,
34
44
  count,
@@ -110,12 +120,7 @@ function UpvoteButton({
110
120
  [buttonType]: buttonType && upvoteState.type == 0,
111
121
  "feed-upvote-button": true,
112
122
  })}
113
- style={{
114
- backgroundImage: `url(${
115
- (attitudeArr.find((a) => a.type == upvoteState.type) || {})
116
- .img
117
- })`,
118
- }}
123
+ style={getBackgroundImage(upvoteState.type)}
119
124
  />
120
125
  )}
121
126
  </a>
@@ -156,9 +161,7 @@ export const UpvoteButtonForFeed = (props: Props) => {
156
161
  "feed-upvote-button": true,
157
162
  })}
158
163
  style={{
159
- backgroundImage: `url(${
160
- (attitudeArr.find((a) => a.type == type) || { img: "" }).img
161
- })`,
164
+ ...getBackgroundImage(type),
162
165
  marginRight: 4,
163
166
  }}
164
167
  />
package/src/index.js CHANGED
@@ -77,8 +77,9 @@ export { default as LikeRankingPage } from "./pages/like-ranking";
77
77
  export { default as NewOkrListPage } from "./pages/new-okr-list";
78
78
  export { default as PersonalInfoPage } from "./pages/personal-info";
79
79
  export { default as ErrorBoundary } from "./components/error-boundary";
80
- export { ERROR_LEVEL } from "./utils/error-level";
80
+ export { ERROR_LEVEL as ERROR_LEVEL } from "./utils/error-level";
81
81
  export { default as SelectTags } from "./components/select-tags";
82
82
  export { default as Cascader } from "./components/cascader";
83
83
  export { default as requestApi } from "./utils/request";
84
84
  export { default as PointDemo} from './components/point-demo'
85
+ export { default as Scrollbar } from './components/scrollbar'
@@ -1,32 +1,22 @@
1
- import { BSGlobal } from "./mock-bsglobal";
2
1
 
3
2
  export const getUserInfo = () => {
4
- if (window.location.host.indexOf("127.0.0.1") !== -1)
5
- return BSGlobal.loginUserInfo;
6
3
  return window.BSGlobal && window.BSGlobal.loginUserInfo;
7
4
  };
8
5
 
9
6
  export const getTenantInfo = () => {
10
- if (window.location.host.indexOf("127.0.0.1") !== -1)
11
- return BSGlobal.tenantInfo;
12
7
  return window.BSGlobal && window.BSGlobal.tenantInfo;
13
8
  };
14
9
 
15
10
  export const getBSGlobal = (key) => {
16
- if (window.location.host.indexOf("127.0.0.1") !== -1) return BSGlobal[key];
17
11
  return window.BSGlobal[key];
18
12
  };
19
13
 
20
14
  export const getOkrAdvancedSetting = () => {
21
- if (window.location.host.indexOf("127.0.0.1") !== -1)
22
- return BSGlobal["OkrAdvancedSetting"];
23
15
  return window.BSGlobal["OkrAdvancedSetting"];
24
16
  };
25
17
 
26
18
  export const getVersion = () => {
27
19
  // version 1 试用版
28
- if (window.location.host.indexOf("127.0.0.1") !== -1)
29
- return BSGlobal["tenantAuthentication"].Version;
30
20
  return window.BSGlobal["tenantAuthentication"].Version;
31
21
  };
32
22