@titaui/pc 1.11.4-3 → 1.11.4-6

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 (34) hide show
  1. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +4 -4
  2. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +10 -3
  3. package/lib/components/dynamic/dynamic-item/index.js +2 -1
  4. package/lib/components/form/form-fields/user/index.css +22 -2
  5. package/lib/components/form/form-fields/user/index.js +18 -8
  6. package/lib/components/form/form-fields/user/user-input.js +15 -6
  7. package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
  8. package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
  9. package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
  10. package/lib/components/menus/components/menu-tree/index.css +4 -2
  11. package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
  12. package/lib/components/menus/export-modules/interview-menus/constant.js +3 -3
  13. package/lib/components/menus/export-modules/interview-menus/index.css +3 -0
  14. package/lib/components/menus/export-modules/interview-menus/index.js +4 -2
  15. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
  16. package/lib/components/nav-top/components/user-message/constant.js +1 -0
  17. package/lib/components/nav-top/request.apis.js +3 -1
  18. package/lib/components/picker/components/picker-trigger/index.css +15 -0
  19. package/lib/components/picker/components/picker-trigger/index.js +8 -8
  20. package/lib/components/radio/index.css +9 -9
  21. package/lib/components/scrollbar/scroll-mask/index.js +1 -1
  22. package/lib/components/task-tree/index.js +7 -12
  23. package/lib/components/task-tree/request-apis.js +1 -1
  24. package/lib/components/task-tree/task-item-node/constant.js +20 -20
  25. package/lib/components/task-tree/task-item-node/e-status-dropdown.js +10 -10
  26. package/lib/components/task-tree/task-item-node/e-task.js +1 -1
  27. package/lib/components/task-tree/task-item-node/index.css +0 -1
  28. package/lib/components/task-tree/task-tree.css +9 -1
  29. package/lib/components/time-picker/index.css +6 -0
  30. package/lib/components/time-picker/time-picker.js +27 -27
  31. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
  32. package/lib/components-v1/radio/radio.js +3 -3
  33. package/lib/components-v1/radio/style/index.css +8 -8
  34. package/package.json +1 -1
@@ -35,7 +35,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
35
35
 
36
36
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
37
 
38
- var preCls = "titaui-user-message-msg-inform";
38
+ var preCls = 'titaui-user-message-msg-inform';
39
39
 
40
40
  function Inform(props) {
41
41
  var item = props.item,
@@ -47,10 +47,11 @@ function Inform(props) {
47
47
  onItemClick && onItemClick(false);
48
48
  var objType = item.objType,
49
49
  objId = item.objId,
50
- messageType = item.messageType;
50
+ messageType = item.messageType,
51
+ user = item.user;
51
52
 
52
53
  if (objType === _constant.EObjType.Kr) {
53
- _drawerManager["default"].open("krDetail", {
54
+ _drawerManager["default"].open('krDetail', {
54
55
  krId: objId
55
56
  });
56
57
 
@@ -58,7 +59,7 @@ function Inform(props) {
58
59
  }
59
60
 
60
61
  if (objType === _constant.EObjType.O) {
61
- _drawerManager["default"].open("okrDetail", {
62
+ _drawerManager["default"].open('okrDetail', {
62
63
  okrId: objId
63
64
  });
64
65
 
@@ -72,20 +73,25 @@ function Inform(props) {
72
73
 
73
74
  if (objType === _constant.EObjType.Task) {
74
75
  // @ts-ignore
75
- window.Talent.app.vent.trigger("global-pull-screen", objId, "task");
76
+ window.Talent.app.vent.trigger('global-pull-screen', objId, 'task');
76
77
  return;
77
78
  }
78
79
 
79
80
  if (objType === _constant.EObjType.Remind) {
80
81
  // @ts-ignore
81
- window.Talent.app.vent.trigger("global-daily-detail-pull-screen", objId);
82
+ window.Talent.app.vent.trigger('global-daily-detail-pull-screen', objId);
83
+ return;
84
+ }
85
+
86
+ if (objType === _constant.EObjType.Interview) {
87
+ (0, _tools.openPage)("".concat(_constant.apiServer, "/u/").concat(_constant.userId, "/Home#/interview?reactRouterName=detail&hideNavTop=true&recordId=").concat(objId, "&toUserId=").concat(user === null || user === void 0 ? void 0 : user.userId));
82
88
  return;
83
89
  }
84
90
 
85
91
  if (messageType == 135) {
86
92
  var redisKey = item.content.match(/redisKey=(\S*?)"/)[1]; // @ts-ignore
87
93
 
88
- Talent.app.vent.trigger("open-weekly-report-modal", redisKey);
94
+ Talent.app.vent.trigger('open-weekly-report-modal', redisKey);
89
95
  return;
90
96
  } // 处理合并的消息
91
97
 
@@ -111,13 +117,13 @@ function Inform(props) {
111
117
  if (objType === 0) {
112
118
  var str = item.content.match(/\/\/.*?[\"|\']/gi);
113
119
  if (!str) return;
114
- str = str.join("");
120
+ str = str.join('');
115
121
 
116
122
  var _url = str.slice(0, str.length - 1);
117
123
 
118
124
  if (_url) {
119
- if (item.content.indexOf("点击此处下载") !== -1) {
120
- window.open(_url, "_self");
125
+ if (item.content.indexOf('点击此处下载') !== -1) {
126
+ window.open(_url, '_self');
121
127
  }
122
128
 
123
129
  (0, _tools.openPage)(_url);
@@ -147,7 +153,7 @@ function Inform(props) {
147
153
  var _str = item.content.match(/\/\/.*?[\"|\']/gi);
148
154
 
149
155
  if (!_str) return;
150
- _str = _str.join("");
156
+ _str = _str.join('');
151
157
 
152
158
  var _url3 = _str.slice(0, _str.length - 1);
153
159
 
@@ -159,7 +165,7 @@ function Inform(props) {
159
165
  var _str2 = item.content.match(/https:.*?[\"|\']/gi);
160
166
 
161
167
  if (!_str2) return;
162
- _str2 = _str2.join("");
168
+ _str2 = _str2.join('');
163
169
 
164
170
  var _url4 = _str2.slice(0, _str2.length - 1);
165
171
 
@@ -178,7 +184,7 @@ function Inform(props) {
178
184
  }
179
185
 
180
186
  var reg = /href='.*?(?=')/g;
181
- var url = "";
187
+ var url = '';
182
188
  item.content.replace(reg, function ($0) {
183
189
  url = $0.slice(6);
184
190
  });
@@ -189,22 +195,22 @@ function Inform(props) {
189
195
  }
190
196
  }
191
197
 
192
- var notificationType = "e-report"; // E-周报提醒消息合并
198
+ var notificationType = 'e-report'; // E-周报提醒消息合并
193
199
 
194
200
  var content = domRef.current.textContent;
195
201
 
196
- if (messageType == "83") {
202
+ if (messageType == '83') {
197
203
  // 项目,目标进展提醒消息合并
198
- notificationType = "project-objective";
204
+ notificationType = 'project-objective';
199
205
  } else if (Number(messageType) > 93 && Number(messageType) <= 100) {
200
206
  // OKR 仪表盘消息提醒
201
- notificationType = "okr-dashBoard";
207
+ notificationType = 'okr-dashBoard';
202
208
  } else if (messageType == 131 || messageType == 136) {
203
- notificationType = "performance";
209
+ notificationType = 'performance';
204
210
  content = item.content;
205
211
  }
206
212
 
207
- _drawerManager["default"].open("NotificationMergeDetail", {
213
+ _drawerManager["default"].open('NotificationMergeDetail', {
208
214
  config: {
209
215
  content: content,
210
216
  messageId: item.messageId,
@@ -50,4 +50,5 @@ exports.EObjType = EObjType;
50
50
  EObjType[EObjType["MileStone"] = 27] = "MileStone";
51
51
  EObjType[EObjType["KanBan"] = 66] = "KanBan";
52
52
  EObjType[EObjType["Remind"] = 8] = "Remind";
53
+ EObjType[EObjType["Interview"] = 81] = "Interview";
53
54
  })(EObjType || (exports.EObjType = EObjType = {}));
@@ -81,6 +81,8 @@ var getMessages = function getMessages() {
81
81
  _axios["default"].interceptors.response.use(function (response) {
82
82
  return response;
83
83
  }, function (error) {
84
+ var _error$response;
85
+
84
86
  if (error.response) {
85
87
  switch (error.response.status) {
86
88
  case 401:
@@ -88,7 +90,7 @@ var getMessages = function getMessages() {
88
90
  }
89
91
  }
90
92
 
91
- return Promise.reject(error.response.data);
93
+ return Promise.reject(error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data);
92
94
  });
93
95
 
94
96
  return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/RemindV2/Get?dateTime=").concat(year, "/").concat(month, "/").concat(date)).then(function (resp) {
@@ -29,6 +29,21 @@
29
29
  color: #bfc7d5;
30
30
  }
31
31
 
32
+ .tita-ui__picker-trigger__operation {
33
+ display: flex;
34
+ align-items: center;
35
+ }
36
+
37
+ .tita-ui__picker-trigger__operation .tu-icon-caret-down {
38
+ font-size: 16px;
39
+ color: #3f4755;
40
+ }
41
+
42
+ .tita-ui__picker-trigger__operation .tu-icon-caret-down::before {
43
+ transform: scale(0.5);
44
+ display: inline-block;
45
+ }
46
+
32
47
  .tita-ui__picker-trigger--disabled {
33
48
  cursor: not-allowed;
34
49
  }
@@ -43,16 +43,16 @@ var PickerTrigger = function PickerTrigger(props) {
43
43
  var currFormat = format;
44
44
 
45
45
  switch (mode) {
46
- case "date":
47
- currFormat = "YYYY/MM/DD";
46
+ case 'date':
47
+ currFormat = 'YYYY/MM/DD';
48
48
  break;
49
49
 
50
- case "month":
51
- currFormat = "YYYY/MM";
50
+ case 'month':
51
+ currFormat = 'YYYY/MM';
52
52
  break;
53
53
 
54
- case "year":
55
- currFormat = "YYYY";
54
+ case 'year':
55
+ currFormat = 'YYYY';
56
56
  break;
57
57
 
58
58
  default:
@@ -77,7 +77,7 @@ var PickerTrigger = function PickerTrigger(props) {
77
77
  }, value ? viewDate.format(currFormat) : placeholder), /*#__PURE__*/_react["default"].createElement("div", {
78
78
  className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__operation"))
79
79
  }, !disabled && /*#__PURE__*/_react["default"].createElement("span", {
80
- className: "tu-icon-sort-down"
80
+ className: "tu-icon-caret-down"
81
81
  }), allowClear && !disabled && /*#__PURE__*/_react["default"].createElement("span", {
82
82
  className: "tu-icon-circle"
83
83
  }))))
@@ -88,7 +88,7 @@ PickerTrigger.defaultProps = {
88
88
  children: null,
89
89
  disabled: false,
90
90
  allowClear: false,
91
- placeholder: "请选择"
91
+ placeholder: '请选择'
92
92
  };
93
93
  var _default = PickerTrigger;
94
94
  exports["default"] = _default;
@@ -16,7 +16,7 @@
16
16
  .titaui-radio-wrapper .titaui-radio {
17
17
  display: inline-block;
18
18
  position: relative;
19
- top: 5px;
19
+ top: 1px;
20
20
  width: 16px;
21
21
  min-width: 16px;
22
22
  height: 16px;
@@ -24,7 +24,7 @@
24
24
  margin-right: 5px;
25
25
  }
26
26
 
27
- .titaui-radio-wrapper .titaui-radio input[type="radio"] {
27
+ .titaui-radio-wrapper .titaui-radio input[type='radio'] {
28
28
  width: 16px;
29
29
  height: 16px;
30
30
  }
@@ -50,14 +50,14 @@
50
50
  }
51
51
 
52
52
  .titaui-radio-wrapper .titaui-radio .titaui-radio-inner::after {
53
- content: "";
53
+ content: '';
54
54
  position: absolute;
55
- top: 3px;
56
- left: 3px;
57
- width: 8px;
58
- min-width: 8px;
59
- height: 8px;
60
- min-height: 8px;
55
+ top: 2px;
56
+ left: 2px;
57
+ width: 10px;
58
+ min-width: 10px;
59
+ height: 10px;
60
+ min-height: 10px;
61
61
  border-radius: 50%;
62
62
  background-color: #1687d9;
63
63
  transform: scale(0);
@@ -86,7 +86,7 @@ var ScrollBarMask = function ScrollBarMask(_ref) {
86
86
  } // 判断是否滚动到底部
87
87
 
88
88
 
89
- if (scrollElement.scrollTop + scrollElement.offsetHeight === scrollElement.scrollHeight) {
89
+ if (scrollElement && scrollElement.scrollTop + scrollElement.offsetHeight === scrollElement.scrollHeight) {
90
90
  setIsScrollToBottom(true);
91
91
  } else {
92
92
  setIsScrollToBottom(false);
@@ -5,23 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _taskTree = _interopRequireDefault(require("./task-tree"));
11
9
 
12
10
  var _helper = _interopRequireDefault(require("./helper"));
13
11
 
14
- var _mock = _interopRequireDefault(require("./mock"));
15
-
16
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
13
 
18
- _taskTree["default"].formatTasksToTreeData = _helper["default"]; // export default TaskTree;
19
-
20
- var _default = function _default() {
21
- var dataSource = (0, _helper["default"])(_mock["default"]);
22
- return /*#__PURE__*/_react["default"].createElement(_taskTree["default"], {
23
- dataSource: dataSource
24
- });
25
- };
14
+ // import React from "react";
15
+ // import mockData from "./mock";
16
+ _taskTree["default"].formatTasksToTreeData = _helper["default"];
17
+ var _default = _taskTree["default"]; // export default () => {
18
+ // const dataSource = formatTasksToTreeData(mockData);
19
+ // return <TaskTree dataSource={dataSource} />;
20
+ // };
26
21
 
27
22
  exports["default"] = _default;
@@ -82,7 +82,7 @@ exports.cancelRel = cancelRel;
82
82
  var setTaskPriority = function setTaskPriority(_ref5) {
83
83
  var taskId = _ref5.taskId,
84
84
  priority = _ref5.priority;
85
- return (0, _request.rpost)("v2")("task/SetTaskPriority?taskId=".concat(taskId, "&priority=").concat(priority), {});
85
+ return (0, _request.rpost)("v2")("task/SetTaskPriority?task_id=".concat(taskId, "&priority=").concat(priority), {});
86
86
  };
87
87
 
88
88
  exports.setTaskPriority = setTaskPriority;
@@ -8,32 +8,32 @@ exports.TASK_NDOE_TYPE = exports.EStatusStatus2ClassType = exports.EStatusClass2
8
8
  var _getLocale = require("../../../utils/getLocale");
9
9
 
10
10
  var EStatusClass2StatusType = {
11
- "tu-icon-finished": 2,
12
- "tu-icon-running": 1,
13
- "tu-icon-canceled": 4,
14
- "tu-icon-deferred": 3,
15
- "tu-icon-paused": 6,
16
- "tu-icon-notstart": 0,
17
- "tu-icon-jiantou-right": 5
11
+ 'tu-icon-finished': 2,
12
+ 'tu-icon-running': 1,
13
+ 'tu-icon-canceled': 4,
14
+ 'tu-icon-deferred': 3,
15
+ 'tu-icon-paused': 6,
16
+ 'tu-icon-notstart': 0,
17
+ 'tu-icon-jiantou-right': 5
18
18
  };
19
19
  exports.EStatusClass2StatusType = EStatusClass2StatusType;
20
20
  var EStatusStatus2ClassType = {
21
- 2: "tu-icon-finished",
22
- 1: "tu-icon-running",
23
- 4: "tu-icon-canceled",
24
- 3: "tu-icon-deferred",
25
- 6: "tu-icon-paused",
26
- 0: "tu-icon-notstart",
27
- 5: "tu-icon-jiantou-right"
21
+ 2: 'tu-icon-finished',
22
+ 1: 'tu-icon-running',
23
+ 4: 'tu-icon-canceled',
24
+ 3: 'tu-icon-deferred',
25
+ 6: 'tu-icon-paused',
26
+ 0: 'tu-icon-notstart',
27
+ 5: 'tu-icon-weijieshou'
28
28
  };
29
29
  exports.EStatusStatus2ClassType = EStatusStatus2ClassType;
30
30
  var EStatusClass2StatusTypeText = {
31
- "tu-icon-finished": (0, _getLocale.getLocale)("OKR_MyO_E_From_Completed"),
32
- "tu-icon-running": (0, _getLocale.getLocale)("Per_MyRe_text_Inprogress"),
33
- "tu-icon-canceled": (0, _getLocale.getLocale)("OKR_MyO_E_From_Cancelled"),
34
- "tu-icon-deferred": (0, _getLocale.getLocale)("OKR_MyO_E_From_Delayed"),
35
- "tu-icon-paused": (0, _getLocale.getLocale)("OKR_MyO_E_From_Suspended"),
36
- "tu-icon-notstart": (0, _getLocale.getLocale)("OKR_MyO_E_From_NotStarted")
31
+ 'tu-icon-finished': (0, _getLocale.getLocale)('OKR_MyO_E_From_Completed'),
32
+ 'tu-icon-running': (0, _getLocale.getLocale)('Per_MyRe_text_Inprogress'),
33
+ 'tu-icon-canceled': (0, _getLocale.getLocale)('OKR_MyO_E_From_Cancelled'),
34
+ 'tu-icon-deferred': (0, _getLocale.getLocale)('OKR_MyO_E_From_Delayed'),
35
+ 'tu-icon-paused': (0, _getLocale.getLocale)('OKR_MyO_E_From_Suspended'),
36
+ 'tu-icon-notstart': (0, _getLocale.getLocale)('OKR_MyO_E_From_NotStarted')
37
37
  };
38
38
  exports.EStatusClass2StatusTypeText = EStatusClass2StatusTypeText;
39
39
  var TASK_NDOE_TYPE;
@@ -40,7 +40,7 @@ function _default(props) {
40
40
  checked = props.checked,
41
41
  hasAuth = props.hasAuth;
42
42
 
43
- var _useState = (0, _react.useState)("tu-icon-notstart"),
43
+ var _useState = (0, _react.useState)('tu-icon-notstart'),
44
44
  _useState2 = _slicedToArray(_useState, 2),
45
45
  status = _useState2[0],
46
46
  setStatus = _useState2[1];
@@ -59,10 +59,10 @@ function _default(props) {
59
59
  canEdit: hasAuth,
60
60
  trigger: /*#__PURE__*/_react["default"].createElement("span", {
61
61
  style: {
62
- color: "#89919F",
63
- fontSize: 14,
62
+ color: '#89919F',
63
+ fontSize: 16,
64
64
  marginRight: 4,
65
- verticalAlign: "baseline"
65
+ verticalAlign: 'baseline'
66
66
  },
67
67
  className: (0, _classnames["default"])(status)
68
68
  })
@@ -70,25 +70,25 @@ function _default(props) {
70
70
  name: "tu-icon-finished",
71
71
  icon: "tu-icon-finished",
72
72
  exIconClass: "e-node-status-icon"
73
- }, (0, _getLocale.getLocale)("OKR_MyO_E_From_Completed")), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
73
+ }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Completed')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
74
74
  name: "tu-icon-running",
75
75
  icon: "tu-icon-running",
76
76
  exIconClass: "e-node-status-icon"
77
- }, (0, _getLocale.getLocale)("Per_MyRe_text_Inprogress")), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
77
+ }, (0, _getLocale.getLocale)('Per_MyRe_text_Inprogress')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
78
78
  name: "tu-icon-canceled",
79
79
  icon: "tu-icon-canceled",
80
80
  exIconClass: "e-node-status-icon"
81
- }, (0, _getLocale.getLocale)("OKR_MyO_E_From_Cancelled")), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
81
+ }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Cancelled')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
82
82
  name: "tu-icon-deferred",
83
83
  icon: "tu-icon-deferred",
84
84
  exIconClass: "e-node-status-icon"
85
- }, (0, _getLocale.getLocale)("OKR_MyO_E_From_Delayed")), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
85
+ }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Delayed')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
86
86
  name: "tu-icon-paused",
87
87
  icon: "tu-icon-paused",
88
88
  exIconClass: "e-node-status-icon"
89
- }, (0, _getLocale.getLocale)("OKR_MyO_E_From_Suspended")), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
89
+ }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Suspended')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
90
90
  name: "tu-icon-notstart",
91
91
  icon: "tu-icon-notstart",
92
92
  exIconClass: "e-node-status-icon"
93
- }, (0, _getLocale.getLocale)("OKR_MyO_E_From_NotStarted")));
93
+ }, (0, _getLocale.getLocale)('OKR_MyO_E_From_NotStarted')));
94
94
  }
@@ -94,7 +94,7 @@ function ETaskNode(props) {
94
94
  _props$hasRelation = props.hasRelation,
95
95
  hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation,
96
96
  _props$isPushScreen = props.isPushScreen,
97
- isPushScreen = _props$isPushScreen === void 0 ? false : _props$isPushScreen,
97
+ isPushScreen = _props$isPushScreen === void 0 ? true : _props$isPushScreen,
98
98
  _props$hasPrinciple = props.hasPrinciple,
99
99
  hasPrinciple = _props$hasPrinciple === void 0 ? true : _props$hasPrinciple;
100
100
 
@@ -9,7 +9,6 @@
9
9
  position: relative;
10
10
  top: 2px;
11
11
  display: inline-block;
12
- width: 21px;
13
12
  vertical-align: top;
14
13
  }
15
14
 
@@ -3,6 +3,14 @@
3
3
  overflow: hidden;
4
4
  }
5
5
 
6
+ .titaui-task-tree .rc-tree-treenode {
7
+ padding: 0 4px;
8
+ }
9
+
10
+ .titaui-task-tree .rc-tree-treenode .rc-tree-node-content-wrapper {
11
+ width: 100% !important;
12
+ }
13
+
6
14
  .titaui-task-tree .rc-tree-treenode-switcher-close:hover {
7
- background: #F7F8FA;
15
+ background: #f7f8fa;
8
16
  }
@@ -62,9 +62,15 @@
62
62
 
63
63
  .tita-ui__time-picker-icon {
64
64
  font-size: 16px;
65
+ color: #3f4755;
65
66
  cursor: pointer;
66
67
  }
67
68
 
69
+ .tita-ui__time-picker-icon::before {
70
+ transform: scale(0.5);
71
+ display: inline-block;
72
+ }
73
+
68
74
  .tita-ui__time-picker-icon:hover {
69
75
  color: #2879ff;
70
76
  }
@@ -52,17 +52,17 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
52
52
  var TimePicker = function TimePicker(props) {
53
53
  var disabled = props.disabled,
54
54
  _props$timeFormat = props.timeFormat,
55
- timeFormat = _props$timeFormat === void 0 ? "hh:mm" : _props$timeFormat,
55
+ timeFormat = _props$timeFormat === void 0 ? 'hh:mm' : _props$timeFormat,
56
56
  _props$hourStep = props.hourStep,
57
57
  hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,
58
58
  _props$minuteStep = props.minuteStep,
59
59
  minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,
60
60
  onChange = props.onChange,
61
61
  _props$value = props.value,
62
- value = _props$value === void 0 ? "00:00" : _props$value,
62
+ value = _props$value === void 0 ? '00:00' : _props$value,
63
63
  restProps = _objectWithoutProperties(props, _excluded);
64
64
 
65
- var _useState = (0, _react.useState)(""),
65
+ var _useState = (0, _react.useState)(''),
66
66
  _useState2 = _slicedToArray(_useState, 2),
67
67
  timeSetType = _useState2[0],
68
68
  setTimeSetType = _useState2[1];
@@ -72,10 +72,10 @@ var TimePicker = function TimePicker(props) {
72
72
  visible = _useState4[0],
73
73
  setVisible = _useState4[1];
74
74
 
75
- var hourRef = (0, _react.useRef)((0, _moment["default"])(value || "00:00", timeFormat).format("HH"));
75
+ var hourRef = (0, _react.useRef)((0, _moment["default"])(value || '00:00', timeFormat).format('HH'));
76
76
  var hInputRef = (0, _react.useRef)();
77
77
  var mInputRef = (0, _react.useRef)();
78
- var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || "00:00", timeFormat).format("mm"));
78
+ var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || '00:00', timeFormat).format('mm'));
79
79
  var triggerRef = (0, _react.useRef)();
80
80
  var timerRef = (0, _react.useRef)();
81
81
  var hours = (0, _utils.getHours)(hourStep);
@@ -88,7 +88,7 @@ var TimePicker = function TimePicker(props) {
88
88
  var onInputClick = function onInputClick(type) {
89
89
  clearTimeout(timerRef.current);
90
90
  timerRef.current = setTimeout(function () {
91
- if (type === "hour") {
91
+ if (type === 'hour') {
92
92
  var _hInputRef$current;
93
93
 
94
94
  (_hInputRef$current = hInputRef.current) === null || _hInputRef$current === void 0 ? void 0 : _hInputRef$current.focus();
@@ -117,7 +117,7 @@ var TimePicker = function TimePicker(props) {
117
117
  // hInputRef.current.focus();
118
118
  // }
119
119
  // onTimeChange();
120
- setTimeSetType("");
120
+ setTimeSetType('');
121
121
  };
122
122
 
123
123
  var onHourInputChange = function onHourInputChange(e) {
@@ -158,7 +158,7 @@ var TimePicker = function TimePicker(props) {
158
158
  // mInputRef.current.focus();
159
159
  // }
160
160
  // onTimeChange();
161
- setTimeSetType("");
161
+ setTimeSetType('');
162
162
  };
163
163
 
164
164
  var onMinuteInputChange = function onMinuteInputChange(e) {
@@ -177,7 +177,7 @@ var TimePicker = function TimePicker(props) {
177
177
  };
178
178
 
179
179
  var setTimeOnKeyboardDirectionChange = function setTimeOnKeyboardDirectionChange(keyCode, type, currTime) {
180
- var datas = JSON.parse(JSON.stringify(type === "hour" ? hours : minutes));
180
+ var datas = JSON.parse(JSON.stringify(type === 'hour' ? hours : minutes));
181
181
  var currentTimeIndex;
182
182
  datas.forEach(function (item, index) {
183
183
  if (item === currTime) {
@@ -198,8 +198,8 @@ var TimePicker = function TimePicker(props) {
198
198
  var nextValue = datas[nextIndex];
199
199
 
200
200
  if (currentTimeIndex > -1 && !!nextValue) {
201
- if (type === "minute" && nextValue === datas[0]) {
202
- hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
201
+ if (type === 'minute' && nextValue === datas[0]) {
202
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
203
203
  }
204
204
 
205
205
  return nextValue;
@@ -210,8 +210,8 @@ var TimePicker = function TimePicker(props) {
210
210
  var prevValue = datas[prevIndex];
211
211
 
212
212
  if (currentTimeIndex > -1 && !!prevValue) {
213
- if (type === "minute" && prevValue === datas[datas.length - 1]) {
214
- hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
213
+ if (type === 'minute' && prevValue === datas[datas.length - 1]) {
214
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
215
215
  }
216
216
 
217
217
  return prevValue;
@@ -231,12 +231,12 @@ var TimePicker = function TimePicker(props) {
231
231
  if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].indexOf(keyCode) === -1) return;
232
232
 
233
233
  switch (timeSetType) {
234
- case "hour":
235
- hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
234
+ case 'hour':
235
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
236
236
  break;
237
237
 
238
- case "minute":
239
- minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, "minute", minuteRef.current);
238
+ case 'minute':
239
+ minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'minute', minuteRef.current);
240
240
  break;
241
241
 
242
242
  default:
@@ -247,10 +247,10 @@ var TimePicker = function TimePicker(props) {
247
247
  };
248
248
 
249
249
  (0, _react.useEffect)(function () {
250
- document.removeEventListener("keydown", handleKeyDown);
251
- document.addEventListener("keydown", handleKeyDown);
250
+ document.removeEventListener('keydown', handleKeyDown);
251
+ document.addEventListener('keydown', handleKeyDown);
252
252
  return function () {
253
- document.removeEventListener("keydown", handleKeyDown);
253
+ document.removeEventListener('keydown', handleKeyDown);
254
254
  };
255
255
  }, [timeSetType]);
256
256
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -262,27 +262,27 @@ var TimePicker = function TimePicker(props) {
262
262
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-inputs"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-inputs--placeholder"), !value))
263
263
  }, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
264
264
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
265
- active: timeSetType === "hour"
265
+ active: timeSetType === 'hour'
266
266
  }),
267
267
  disabled: disabled,
268
268
  maxLength: 2,
269
269
  onBlur: onHourInputBlur,
270
270
  onChange: onHourInputChange,
271
271
  onClick: function onClick() {
272
- return onInputClick("hour");
272
+ return onInputClick('hour');
273
273
  },
274
274
  ref: hInputRef,
275
275
  value: hourRef.current
276
276
  }), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
277
277
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
278
- active: timeSetType === "minute"
278
+ active: timeSetType === 'minute'
279
279
  }),
280
280
  disabled: disabled,
281
281
  maxLength: 2,
282
282
  onBlur: onMinuteInputBlur,
283
283
  onChange: onMinuteInputChange,
284
284
  onClick: function onClick() {
285
- return onInputClick("minute");
285
+ return onInputClick('minute');
286
286
  },
287
287
  ref: mInputRef,
288
288
  value: minuteRef.current
@@ -303,8 +303,8 @@ var TimePicker = function TimePicker(props) {
303
303
  hour: hourRef.current,
304
304
  minute: minuteRef.current,
305
305
  setTime: function setTime(time) {
306
- hourRef.current = (0, _moment["default"])(time, "HH:mm").format("HH");
307
- minuteRef.current = (0, _moment["default"])(time, "HH:mm").format("mm");
306
+ hourRef.current = (0, _moment["default"])(time, 'HH:mm').format('HH');
307
+ minuteRef.current = (0, _moment["default"])(time, 'HH:mm').format('mm');
308
308
  onChange(time);
309
309
  }
310
310
  },
@@ -313,7 +313,7 @@ var TimePicker = function TimePicker(props) {
313
313
  setVisible: setVisible
314
314
  }
315
315
  }, restProps), /*#__PURE__*/_react["default"].createElement("span", {
316
- className: "".concat(_utils.TimePickerClass, "-icon tu-icon-arrow-down"),
316
+ className: "".concat(_utils.TimePickerClass, "-icon tu-icon-caret-down"),
317
317
  onClick: function onClick() {
318
318
  setVisible(true);
319
319
  }