@titaui/pc 1.11.36 → 1.11.37

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.
@@ -347,7 +347,7 @@ function ETaskNode(props) {
347
347
  }, /*#__PURE__*/_react["default"].createElement(_eStatusDropdown["default"], {
348
348
  onChange: onEStatusChangeHandler,
349
349
  checked: _constant.EStatusStatus2ClassType[dataInfo.status],
350
- hasAuth: hasEditAuth && dataInfo.editStatusable
350
+ hasAuth: hasEditAuth
351
351
  })), isShowPriority && /*#__PURE__*/_react["default"].createElement("span", {
352
352
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-priority"))
353
353
  }, /*#__PURE__*/_react["default"].createElement(_ePriority["default"], {
@@ -356,7 +356,7 @@ function ETaskNode(props) {
356
356
  hasAuth: hasEditAuth,
357
357
  status: data.status
358
358
  })), /*#__PURE__*/_react["default"].createElement("span", {
359
- className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-title"), _defineProperty({}, "".concat(_precls["default"], "__e-project-node-gray"), isCancel || isGray)),
359
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-title ").concat(isCancel ? "".concat(_precls["default"], "__e-project-node-gray") : "")),
360
360
  onClick: handleShowTaskDetail
361
361
  }, /*#__PURE__*/_react["default"].createElement(TooltipText, {
362
362
  text: (0, _helpers.escapeHtml)(title),
@@ -72,8 +72,8 @@
72
72
 
73
73
  .titaui-task-tree__e-task-node-actions-user {
74
74
  display: inline-block;
75
- width: 92px;
76
- margin-left: 24px;
75
+ width: 64px;
76
+ margin-left: 16px;
77
77
  }
78
78
 
79
79
  .titaui-task-tree__e-task-node-actions-date {
@@ -83,13 +83,13 @@
83
83
  line-height: 18px;
84
84
  display: inline-flex;
85
85
  align-items: center;
86
+ justify-content: flex-end;
86
87
  box-sizing: border-box;
87
- width: 82px;
88
+ width: 78px;
88
89
  height: 26px;
89
90
  padding: 4px;
90
91
  text-align: left;
91
92
  line-height: 26px;
92
- margin-left: 28px;
93
93
  }
94
94
 
95
95
  .titaui-task-tree__e-task-node-actions-date > span {
@@ -101,8 +101,9 @@
101
101
  top: 3px;
102
102
  color: #89919f;
103
103
  cursor: auto;
104
- width: 68px;
105
- margin-left: 20px;
104
+ width: 64px;
105
+ margin-left: 16px;
106
+ margin-right: 4px;
106
107
  }
107
108
 
108
109
  .titaui-task-tree__e-task-node-actions-progress .tooltip-text-wrapper {
@@ -222,8 +223,8 @@
222
223
 
223
224
  .titaui-task-tree__e-project-node-actions-user {
224
225
  display: inline-block;
225
- width: 92px;
226
- margin-left: 24px;
226
+ width: 64px;
227
+ margin-left: 16px;
227
228
  }
228
229
 
229
230
  .titaui-task-tree__e-project-node-actions-date {
@@ -233,13 +234,13 @@
233
234
  line-height: 18px;
234
235
  display: inline-flex;
235
236
  align-items: center;
237
+ justify-content: flex-end;
236
238
  box-sizing: border-box;
237
- width: 82px;
239
+ width: 78px;
238
240
  height: 26px;
239
241
  padding: 4px;
240
242
  text-align: left;
241
243
  line-height: 26px;
242
- margin-left: 28px;
243
244
  }
244
245
 
245
246
  .titaui-task-tree__e-project-node-actions-date > span {
@@ -251,8 +252,9 @@
251
252
  top: 3px;
252
253
  color: #89919f;
253
254
  cursor: auto;
254
- width: 68px;
255
- margin-left: 20px;
255
+ width: 64px;
256
+ margin-left: 16px;
257
+ margin-right: 4px;
256
258
  }
257
259
 
258
260
  .titaui-task-tree__e-project-node-actions-progress .tooltip-text-wrapper {
@@ -12,5 +12,5 @@
12
12
  }
13
13
 
14
14
  .titaui-task-tree .rc-tree-treenode-switcher-close:hover {
15
- background: #f0f4fa;
15
+ background: #f7f8fa;
16
16
  }
@@ -79,49 +79,42 @@ var TimePicker = function TimePicker(props) {
79
79
  var mInputRef = (0, _react.useRef)();
80
80
  var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || '00:00', timeFormat).format('mm'));
81
81
  var triggerRef = (0, _react.useRef)();
82
- var timerRef = (0, _react.useRef)();
83
82
  var hours = (0, _utils.getHours)(hourStep);
84
83
  var minutes = (0, _utils.getMinutes)(minuteStep);
85
84
 
86
85
  var onTimeChange = function onTimeChange() {
87
- onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hourRef.current, ":").concat(minuteRef.current));
88
- }; // const onInputClick = (type) => {
89
- // clearTimeout(timerRef.current)
90
- // timerRef.current = setTimeout(() => {
91
- // if (type === 'hour') {
92
- // hInputRef.current?.focus()
93
- // } else {
94
- // mInputRef.current?.focus()
95
- // }
96
- // setTimeSettingType(() => type)
97
- // }, 0)
98
- // }
99
-
100
-
101
- var showSelectorPop = function showSelectorPop() {
102
- return setVisible(true);
86
+ return onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hourRef.current, ":").concat(minuteRef.current));
103
87
  };
104
88
 
105
- var onFocusHandler = function onFocusHandler(type) {
106
- setTimeSettingType(function () {
89
+ var onInputClickHandler = function onInputClickHandler(type) {
90
+ return setTimeSettingType(function () {
107
91
  return type;
108
92
  });
109
93
  };
110
94
 
111
- var onHourInputBlur = function onHourInputBlur() {
112
- // setHour((prevHour) => {
113
- // const prevHour = hourRef.current;
114
- // let nextHour = (Array(2).join("0") + prevHour).slice(-2);
115
- // if (Number(prevHour) > Number(hours[hours.length - 1])) {
116
- // nextHour = `0${prevHour.slice(0, 1)}`;
117
- // }
118
- // hourRef.current = nextHour;
119
- // });
120
- // if (timeSetType === "hour" && hInputRef.current) {
121
- // hInputRef.current.focus();
122
- // }
123
- // onTimeChange();
124
- setTimeSettingType('');
95
+ var onKeyDownHandler = function onKeyDownHandler(e) {
96
+ var keyCode = e.keyCode;
97
+
98
+ if ([_utils.KEYCODE.directionLeft, _utils.KEYCODE.directionRight].includes(keyCode)) {
99
+ setTimeSettingType(_utils.TargetMapByKeyCode[keyCode]);
100
+ }
101
+
102
+ if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].includes(keyCode)) {
103
+ switch (timeSetingtType) {
104
+ case 'hour':
105
+ hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
106
+ break;
107
+
108
+ case 'minute':
109
+ minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'minute', minuteRef.current);
110
+ break;
111
+
112
+ default:
113
+ break;
114
+ }
115
+
116
+ onTimeChange();
117
+ }
125
118
  };
126
119
 
127
120
  var onHourInputChange = function onHourInputChange(e) {
@@ -139,32 +132,6 @@ var TimePicker = function TimePicker(props) {
139
132
  }
140
133
  };
141
134
 
142
- var onMinuteInputBlur = function onMinuteInputBlur() {
143
- // setMinute((prevMinute) => {
144
- // let nextMinute = minuteRef.current;
145
- // minutes.forEach((m, i) => {
146
- // const mNum = Number(m);
147
- // const nextMinuteNum = Number(nextMinute);
148
- // if (mNum === nextMinuteNum) {
149
- // nextMinute = m;
150
- // } else if (
151
- // mNum < nextMinuteNum
152
- // && Number(minutes[i + 1]) > nextMinuteNum
153
- // ) {
154
- // nextMinute = m;
155
- // } else if (nextMinuteNum > Number(minutes[minutes.length - 1])) {
156
- // nextMinute = "00";
157
- // }
158
- // });
159
- // minuteRef.current = nextMinute;
160
- // });
161
- // if (timeSetType === "minute" && mInputRef.current) {
162
- // mInputRef.current.focus();
163
- // }
164
- // onTimeChange();
165
- setTimeSettingType('');
166
- };
167
-
168
135
  var onMinuteInputChange = function onMinuteInputChange(e) {
169
136
  var v = e.target.value;
170
137
 
@@ -225,39 +192,10 @@ var TimePicker = function TimePicker(props) {
225
192
  return currTime;
226
193
  };
227
194
 
228
- var handleKeyDown = function handleKeyDown(e) {
229
- var keyCode = e.keyCode;
230
-
231
- if ([_utils.KEYCODE.directionLeft, _utils.KEYCODE.directionRight].includes(keyCode)) {
232
- setTimeSettingType(_utils.TargetMapByKeyCode[keyCode]);
233
- }
234
-
235
- if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].includes(keyCode)) {
236
- switch (timeSetingtType) {
237
- case 'hour':
238
- hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'hour', hourRef.current);
239
- break;
240
-
241
- case 'minute':
242
- minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, 'minute', minuteRef.current);
243
- break;
244
-
245
- default:
246
- break;
247
- }
248
-
249
- onTimeChange();
250
- }
195
+ var showSelectorPop = function showSelectorPop() {
196
+ return setVisible(true);
251
197
  };
252
198
 
253
- (0, _react.useEffect)(function () {
254
- document.removeEventListener('keydown', handleKeyDown);
255
- enableKeyBoard && timeSetingtType && document.addEventListener('keydown', handleKeyDown);
256
- return function () {
257
- clearTimeout(timerRef.current);
258
- document.removeEventListener('keydown', handleKeyDown);
259
- };
260
- }, [timeSetingtType]);
261
199
  return /*#__PURE__*/_react["default"].createElement("div", {
262
200
  className: _utils.TimePickerClass
263
201
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -268,36 +206,30 @@ var TimePicker = function TimePicker(props) {
268
206
  onClick: function onClick() {
269
207
  return !enableKeyBoard && showSelectorPop();
270
208
  }
271
- }, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
209
+ }, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], _extends({
272
210
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
273
211
  active: enableKeyBoard && timeSetingtType === 'hour'
274
212
  }),
275
213
  disabled: disabled,
276
214
  maxLength: 2,
277
- onBlur: onHourInputBlur,
278
215
  onChange: onHourInputChange,
279
216
  onClick: function onClick() {
280
- return !enableKeyBoard && showSelectorPop();
281
- },
282
- onFocus: function onFocus() {
283
- return onFocusHandler('hour');
217
+ return onInputClickHandler('hour');
284
218
  },
219
+ onKeyDown: onKeyDownHandler,
285
220
  ref: hInputRef,
286
221
  value: hourRef.current
287
- }), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
222
+ }, restProps)), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
288
223
  className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
289
224
  active: enableKeyBoard && timeSetingtType === 'minute'
290
225
  }),
291
226
  disabled: disabled,
292
227
  maxLength: 2,
293
- onBlur: onMinuteInputBlur,
294
228
  onChange: onMinuteInputChange,
295
229
  onClick: function onClick() {
296
- return !enableKeyBoard && showSelectorPop();
297
- },
298
- onFocus: function onFocus() {
299
- return onFocusHandler('minute');
230
+ return onInputClickHandler('minute');
300
231
  },
232
+ onKeyDown: onKeyDownHandler,
301
233
  ref: mInputRef,
302
234
  value: minuteRef.current
303
235
  })), !disabled && /*#__PURE__*/_react["default"].createElement(_timePickerSelector["default"], _extends({
@@ -57,11 +57,6 @@ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
57
57
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
58
58
  };
59
59
 
60
- var onFocusHandler = function onFocusHandler(e) {
61
- setSelectionRange(0);
62
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
63
- };
64
-
65
60
  var onChangeHandler = function onChangeHandler(e) {
66
61
  return onChange === null || onChange === void 0 ? void 0 : onChange(e);
67
62
  };
@@ -86,7 +81,6 @@ var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
86
81
  maxLength: maxLength,
87
82
  onClick: onClickHandler,
88
83
  onChange: onChangeHandler,
89
- onFocus: onFocusHandler,
90
84
  ref: inputRef,
91
85
  type: type,
92
86
  value: value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.11.36",
3
+ "version": "1.11.37",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",