@titaui/pc 1.10.45-meta.2 → 1.10.47
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.
- package/lib/components/dialog/index.css +1 -1
- package/lib/components/mblog/index.js +14 -5
- package/lib/components/okr-share/common-painter/openDataPainter.js +34 -27
- package/lib/components/open-data-painter/index.js +5 -1
- package/lib/components/rich-editor/plugins/inline/color/index.js +10 -4
- package/lib/components/rich-editor/plugins/inline/color/util.js +25 -0
- package/lib/components/rich-editor/ui/normal-toolbar/index.css +1 -0
- package/lib/components/toast/index.js +2 -10
- package/lib/components/weekly-report/common-painter/openDataPainter.js +5 -1
- package/lib/pages/new-okr-list/index.js +3 -3
- package/package.json +2 -1
|
@@ -169,17 +169,23 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
_this.handlerDealAttachemntData = function (uploadSuccessFilesPath) {
|
|
172
|
+
var _this$refs$textEditor2;
|
|
173
|
+
|
|
172
174
|
var successFilesPath = uploadSuccessFilesPath.filter(function (item) {
|
|
173
175
|
return item !== "";
|
|
174
176
|
});
|
|
175
177
|
var successFilesPathLen = successFilesPath.length; // @ts-ignore
|
|
176
178
|
|
|
177
|
-
var
|
|
179
|
+
var _this$refs$textEditor = (_this$refs$textEditor2 = _this.refs.textEditor) === null || _this$refs$textEditor2 === void 0 ? void 0 : _this$refs$textEditor2.refs,
|
|
180
|
+
textareaInput = _this$refs$textEditor.textareaInput;
|
|
181
|
+
|
|
178
182
|
var textareaValue = _this.state.textareaValue; // textareaValue = dealWithLoadedFileTips(textareaValue, successFilesPathLen); // 更新输入框内容
|
|
179
183
|
|
|
180
184
|
localStorage.setItem(_this.state.localStroageKey, textareaValue); // 将输入框内容进行本地缓存
|
|
181
185
|
|
|
182
|
-
textareaInput
|
|
186
|
+
if (textareaInput) {
|
|
187
|
+
textareaInput.focus();
|
|
188
|
+
}
|
|
183
189
|
|
|
184
190
|
_this.setState({
|
|
185
191
|
textareaValue: textareaValue,
|
|
@@ -192,9 +198,12 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
|
|
|
192
198
|
_this.focus = function () {
|
|
193
199
|
// @ts-ignore
|
|
194
200
|
var textareaInput = _this.refs.textEditor.refs.textareaInput;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
201
|
+
|
|
202
|
+
if (textareaInput) {
|
|
203
|
+
setTimeout(function () {
|
|
204
|
+
textareaInput.focus();
|
|
205
|
+
}, 300);
|
|
206
|
+
}
|
|
198
207
|
};
|
|
199
208
|
|
|
200
209
|
_this.allowSubmit = function (content) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _openData = require("../../../utils/open-data");
|
|
9
9
|
|
|
@@ -13,12 +13,38 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
13
13
|
|
|
14
14
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
15
15
|
|
|
16
|
-
function
|
|
17
|
-
|
|
16
|
+
var getOpenData = function getOpenData(_ref) {
|
|
17
|
+
var id = _ref.id,
|
|
18
|
+
name = _ref.name,
|
|
19
|
+
type = _ref.type;
|
|
20
|
+
var openId = (0, _openData.getOpenId)(id, type);
|
|
21
|
+
if (!window.WWOpenData || !openId) return Promise.resolve(name);
|
|
22
|
+
return new Promise(function (resolve, reject) {
|
|
23
|
+
window.WWOpenData.prefetch({
|
|
24
|
+
items: [{
|
|
25
|
+
id: openId,
|
|
26
|
+
type: type
|
|
27
|
+
}]
|
|
28
|
+
}, function (err, data) {
|
|
29
|
+
if (err) {
|
|
30
|
+
return reject(err);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (data && data.items[0]) {
|
|
34
|
+
resolve(data.items[0].data);
|
|
35
|
+
} else {
|
|
36
|
+
resolve(name);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function openDataPainter(_x, _x2, _x3) {
|
|
43
|
+
return _openDataPainter.apply(this, arguments);
|
|
18
44
|
}
|
|
19
45
|
|
|
20
|
-
function
|
|
21
|
-
|
|
46
|
+
function _openDataPainter() {
|
|
47
|
+
_openDataPainter = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, openDataParams, lineHeight) {
|
|
22
48
|
var maxWidth,
|
|
23
49
|
name,
|
|
24
50
|
_ctx$measureText,
|
|
@@ -69,27 +95,8 @@ function _ref() {
|
|
|
69
95
|
}
|
|
70
96
|
}, _callee);
|
|
71
97
|
}));
|
|
72
|
-
return
|
|
98
|
+
return _openDataPainter.apply(this, arguments);
|
|
73
99
|
}
|
|
74
100
|
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
name = _ref2.name,
|
|
78
|
-
type = _ref2.type;
|
|
79
|
-
var openId = (0, _openData.getOpenId)(id, type);
|
|
80
|
-
if (!window.WWOpenData || !openId) return Promise.resolve(name);
|
|
81
|
-
return new Promise(function (resolve, reject) {
|
|
82
|
-
window.WWOpenData.prefetch({
|
|
83
|
-
items: [{
|
|
84
|
-
id: openId,
|
|
85
|
-
type: type
|
|
86
|
-
}]
|
|
87
|
-
}, function (err, data) {
|
|
88
|
-
if (err) {
|
|
89
|
-
return reject(err);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
resolve(data.items[0].data);
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
101
|
+
var _default = openDataPainter;
|
|
102
|
+
exports["default"] = _default;
|
|
@@ -19,6 +19,10 @@ var _selector = _interopRequireDefault(require("./selector"));
|
|
|
19
19
|
|
|
20
20
|
var _getLocale = require("../../../../../utils/getLocale");
|
|
21
21
|
|
|
22
|
+
var _util = require("./util");
|
|
23
|
+
|
|
24
|
+
var _consts = require("./consts");
|
|
25
|
+
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
27
|
|
|
24
28
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -50,10 +54,11 @@ var colorReg = /^\s*(rgba\([^)]+\)|rgb\([^)]+\)|#[\d|a-f]{3,6})|\w*/i;
|
|
|
50
54
|
|
|
51
55
|
var getColorAttrs = function getColorAttrs(style) {
|
|
52
56
|
var color = style;
|
|
57
|
+
var key = (0, _util.findColor)(color, _consts.FontColor);
|
|
53
58
|
|
|
54
|
-
if (
|
|
59
|
+
if (key) {
|
|
55
60
|
return {
|
|
56
|
-
color:
|
|
61
|
+
color: _consts.FontColor[key]
|
|
57
62
|
};
|
|
58
63
|
}
|
|
59
64
|
|
|
@@ -107,10 +112,11 @@ var getBgAttrs = function getBgAttrs(style) {
|
|
|
107
112
|
var colorMatch = style.match(colorReg);
|
|
108
113
|
if (!colorMatch) return false;
|
|
109
114
|
var background = colorMatch[0];
|
|
115
|
+
var key = (0, _util.findColor)(background, _consts.BackgroundColor);
|
|
110
116
|
|
|
111
|
-
if (
|
|
117
|
+
if (key) {
|
|
112
118
|
return {
|
|
113
|
-
color:
|
|
119
|
+
color: _consts.BackgroundColor[key]
|
|
114
120
|
};
|
|
115
121
|
}
|
|
116
122
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findColor = findColor;
|
|
7
|
+
exports.isColorEqual = isColorEqual;
|
|
8
|
+
|
|
9
|
+
var _color = _interopRequireDefault(require("color"));
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
+
|
|
13
|
+
function findColor(color, colorEnum) {
|
|
14
|
+
for (var key in colorEnum) {
|
|
15
|
+
if (isColorEqual(colorEnum[key], color)) {
|
|
16
|
+
return key;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isColorEqual(a, b) {
|
|
24
|
+
return new _color["default"](a).contrast(new _color["default"](b)) === 1;
|
|
25
|
+
}
|
|
@@ -132,11 +132,7 @@ var Toast = /*#__PURE__*/function () {
|
|
|
132
132
|
while (1) {
|
|
133
133
|
switch (_context2.prev = _context2.next) {
|
|
134
134
|
case 0:
|
|
135
|
-
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {
|
|
136
|
-
style: {
|
|
137
|
-
position: "fixed"
|
|
138
|
-
}
|
|
139
|
-
};
|
|
135
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
140
136
|
key = (0, _uuid["default"])();
|
|
141
137
|
_context2.next = 4;
|
|
142
138
|
return getInstance();
|
|
@@ -177,11 +173,7 @@ var Toast = /*#__PURE__*/function () {
|
|
|
177
173
|
while (1) {
|
|
178
174
|
switch (_context3.prev = _context3.next) {
|
|
179
175
|
case 0:
|
|
180
|
-
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {
|
|
181
|
-
style: {
|
|
182
|
-
position: "fixed"
|
|
183
|
-
}
|
|
184
|
-
};
|
|
176
|
+
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
|
185
177
|
key = (0, _uuid["default"])();
|
|
186
178
|
_context3.next = 4;
|
|
187
179
|
return getInstance();
|
|
@@ -205,8 +205,8 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
205
205
|
params.Searchpage = 2;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
if (departmentId
|
|
209
|
-
params.keyWords =
|
|
208
|
+
if (departmentId !== 0) {
|
|
209
|
+
params.keyWords = "";
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
var request;
|
|
@@ -363,7 +363,7 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
363
363
|
className: "okr-list__check-filter-btn",
|
|
364
364
|
onClick: triggerAnimation
|
|
365
365
|
}, (0, _getLocale.getLocale)("OKR_MyO_Text_Check")), (0, _getLocale.getLocale)("OKR_MyO_Text_Topfiltercriteria")), /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
366
|
-
zIndex:
|
|
366
|
+
zIndex: 1200,
|
|
367
367
|
noHeadLine: true,
|
|
368
368
|
visible: casesVisible,
|
|
369
369
|
onClose: onCasesCloseHandler,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.47",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"@babel/core": "^7.11.1",
|
|
23
23
|
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
|
24
24
|
"@babel/plugin-proposal-decorators": "^7.10.5",
|
|
25
|
+
"@babel/plugin-proposal-numeric-separator": "^7.16.7",
|
|
25
26
|
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
|
|
26
27
|
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
|
|
27
28
|
"@babel/plugin-transform-runtime": "^7.11.0",
|