@titaui/pc 1.11.52-beta.15 → 1.11.52-beta.16

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.
@@ -171,7 +171,11 @@ function ONewName(_ref) {
171
171
  onOInputFocusStateChange(false);
172
172
  }
173
173
  }, []);
174
- var handleOnKeyDown = (0, _react.useCallback)(function () {
174
+ var handleOnKeyDown = (0, _react.useCallback)(function (e) {
175
+ if (e.key.toLocaleLowerCase() == 'enter') {
176
+ e.preventDefault();
177
+ }
178
+
175
179
  setIsInputContent(true);
176
180
  }, [setIsInputContent]);
177
181
  var handleOnKeyUp = (0, _react.useCallback)(function (e) {
@@ -198,6 +202,8 @@ function ONewName(_ref) {
198
202
  position: "top"
199
203
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
200
204
  initialState: richText,
205
+ manualWrap: true,
206
+ contentEditable: true,
201
207
  key: richEditorStatus,
202
208
  onDocChange: onChangeHandler,
203
209
  onFocus: handleInputFocus,
@@ -102,7 +102,11 @@ function KrItem(props) {
102
102
  // }
103
103
  // }, [onAddKr])
104
104
 
105
- var handleOnKeyDown = (0, _react.useCallback)(function () {
105
+ var handleOnKeyDown = (0, _react.useCallback)(function (e) {
106
+ if (e.key.toLocaleLowerCase() == 'enter') {
107
+ e.preventDefault();
108
+ }
109
+
106
110
  setIsInputContent(true);
107
111
  }, [setIsInputContent]);
108
112
  var handleOnKeyUp = (0, _react.useCallback)(function (e) {
@@ -140,6 +144,8 @@ function KrItem(props) {
140
144
  position: "top"
141
145
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
142
146
  initialState: mileStoneNameRichText,
147
+ manualWrap: true,
148
+ contentEditable: true,
143
149
  key: krData === null || krData === void 0 ? void 0 : krData.uuid,
144
150
  onDocChange: onKrNameInputChangeHandler,
145
151
  onFocus: handleInputFocus,
@@ -29,6 +29,8 @@ var _getLocale = require("../../../../utils/getLocale");
29
29
 
30
30
  var _mblog = require("../../../../utils/mblog");
31
31
 
32
+ var _openData = require("../../../../utils/open-data");
33
+
32
34
  require("./index.css");
33
35
 
34
36
  var _excluded = ["data"];
@@ -118,7 +120,7 @@ var DynamicTask = function DynamicTask(_ref) {
118
120
  className: "".concat(prefix, "__object-name"),
119
121
  onClick: handleClickTitle
120
122
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
121
- text: (0, _mblog.htmlDecodeByRegExp)(obj.objName),
123
+ text: (0, _openData.parseString)((0, _mblog.htmlDecodeByRegExp)(obj.objName)),
122
124
  isPercent: true
123
125
  })), (0, _getLocale.getLocale)('Mod_stask'));
124
126
  }
@@ -27,6 +27,8 @@ var _utils = require("./utils");
27
27
 
28
28
  var _getLocale = require("../../utils/getLocale");
29
29
 
30
+ var _openData = require("../../utils/open-data");
31
+
30
32
  require("./style/style.css");
31
33
 
32
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -110,7 +112,7 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
110
112
 
111
113
  _this.handleOk = function () {
112
114
  if (!_this.state.isValid) {
113
- _toast["default"].Warning("关键成果总权重须等于100%");
115
+ _toast["default"].Warning('关键成果总权重须等于100%');
114
116
 
115
117
  return;
116
118
  }
@@ -126,10 +128,10 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
126
128
  };
127
129
  });
128
130
 
129
- (0, _requestV.taker)((0, _requestV.getApiUrl)(url), "post", data).then(function (res) {
131
+ (0, _requestV.taker)((0, _requestV.getApiUrl)(url), 'post', data).then(function (res) {
130
132
  _this.props.onOk && _this.props.onOk(); // @ts-ignore
131
133
 
132
- window.Talent.app.vent.trigger("updateProgress:Project-Progress-View", {});
134
+ window.Talent.app.vent.trigger('updateProgress:Project-Progress-View', {});
133
135
  });
134
136
  };
135
137
 
@@ -295,7 +297,7 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
295
297
  isValid = _this$state.isValid,
296
298
  isDone = _this$state.isDone;
297
299
  return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
298
- title: (0, _getLocale.getLocale)("OKR_MyO_Text_krweightsetting"),
300
+ title: (0, _getLocale.getLocale)('OKR_MyO_Text_krweightsetting'),
299
301
  noFooterLine: true,
300
302
  visible: !isDone && isShowModal,
301
303
  width: "570px",
@@ -324,19 +326,19 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
324
326
  }, /*#__PURE__*/_react["default"].createElement(_style.KrCounter, null, /*#__PURE__*/_react["default"].createElement("div", {
325
327
  className: "kr-counter"
326
328
  }, "KR".concat(index + 1))), /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
327
- title: mileStoneName,
329
+ title: (0, _openData.parseString)(mileStoneName),
328
330
  overlayStyle: mileStoneName.length > 18 ? {
329
331
  zIndex: 99999
330
332
  } : {}
331
- }, /*#__PURE__*/_react["default"].createElement(_style.KrTitle, null, mileStoneName)), /*#__PURE__*/_react["default"].createElement(_style.FormItemWrapper, {
333
+ }, /*#__PURE__*/_react["default"].createElement(_style.KrTitle, null, (0, _openData.parseString)(mileStoneName))), /*#__PURE__*/_react["default"].createElement(_style.FormItemWrapper, {
332
334
  style: {
333
335
  width: 140
334
336
  }
335
- }, /*#__PURE__*/_react["default"].createElement(_style.FormItemLabel, null, (0, _getLocale.getLocale)("OKR_MyO_Text_Weights")), /*#__PURE__*/_react["default"].createElement(_FormItemV["default"], {
337
+ }, /*#__PURE__*/_react["default"].createElement(_style.FormItemLabel, null, (0, _getLocale.getLocale)('OKR_MyO_Text_Weights')), /*#__PURE__*/_react["default"].createElement(_FormItemV["default"], {
336
338
  isDirty: data.isDirty,
337
- errorText: (0, _getLocale.getLocale)("OKR_MyO_KRP_Please0and100")
339
+ errorText: (0, _getLocale.getLocale)('OKR_MyO_KRP_Please0and100')
338
340
  }, /*#__PURE__*/_react["default"].createElement(_Input["default"], {
339
- suffixIcon: (0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_Percentage"),
341
+ suffixIcon: (0, _getLocale.getLocale)('OKR_MyO_Pop_Upd_Percentage'),
340
342
  value: krWeight,
341
343
  onChange: function onChange(value) {
342
344
  return _this4.handleWeightChange(value, feedId);
@@ -260,7 +260,7 @@ function Inform(props) {
260
260
  className: (0, _classnames["default"])("".concat(preCls, "__item-right-content"))
261
261
  }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
262
262
  overlayClassName: "".concat(preCls, "__item-right-content-tooltip"),
263
- text: (0, _openData.parseString)((0, _utils.deleteText)((0, _utils.htmlToText)(item.content))),
263
+ text: (0, _utils.htmlToText)((0, _openData.parseString)((0, _utils.deleteText)(item.content))),
264
264
  isPercent: true,
265
265
  mouseEnterDelay: 0.8
266
266
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -299,6 +299,11 @@ function _default(props) {
299
299
 
300
300
  var onInputKeyDownHandler = function onInputKeyDownHandler(e) {
301
301
  if (e.keyCode !== 13) return;
302
+
303
+ if (e.key.toLocaleLowerCase() == 'enter') {
304
+ e.preventDefault();
305
+ }
306
+
302
307
  onKrNameChangeHandler();
303
308
  };
304
309
 
@@ -407,6 +412,8 @@ function _default(props) {
407
412
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
408
413
  editable: editing,
409
414
  initialState: krNameData.richText,
415
+ manualWrap: true,
416
+ contentEditable: true,
410
417
  onDocChange: onEditorChange,
411
418
  onBlur: onKrNameChangeHandler,
412
419
  onKeyDown: onInputKeyDownHandler,
@@ -67,6 +67,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
67
67
 
68
68
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
69
69
 
70
+ var StrRreg = /@\$(userName|departmentName)\=(.+?)\$(\s|$)/g;
71
+
70
72
  function OkrDetailHeader(_ref) {
71
73
  var detailInfo = _ref.detailInfo;
72
74
 
@@ -396,7 +398,7 @@ function OkrDetailHeader(_ref) {
396
398
  actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
397
399
  id: detailInfo.workId,
398
400
  objType: 62,
399
- name: detailInfo.workName,
401
+ name: detailInfo.workName.replace(StrRreg, ''),
400
402
  principalUser: detailInfo.principalUser
401
403
  }),
402
404
  content: parent && /*#__PURE__*/_react["default"].createElement("span", {
@@ -172,6 +172,7 @@ function CreateKr(_ref) {
172
172
 
173
173
  var onInputKeyDown = function onInputKeyDown(e) {
174
174
  if (e.key.toLocaleLowerCase() == 'enter' && !pendingRef.current) {
175
+ e.preventDefault();
175
176
  pendingRef.current = true;
176
177
  var mentionUsers = krNameData.mentionUsers,
177
178
  pureText = krNameData.pureText,
@@ -242,6 +243,8 @@ function CreateKr(_ref) {
242
243
  className: (0, _classnames["default"])("".concat(preCls, "__input"))
243
244
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
244
245
  initialState: undefined,
246
+ manualWrap: true,
247
+ contentEditable: true,
245
248
  onDocChange: setKrNameData,
246
249
  onBlur: createKr,
247
250
  onFocus: onFocus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.11.52-beta.15",
3
+ "version": "1.11.52-beta.16",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",