@titaui/pc 1.10.90 → 1.11.2

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.
@@ -25,45 +25,42 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
25
25
 
26
26
  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; }
27
27
 
28
- function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
29
-
30
28
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
29
 
32
30
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
31
 
34
32
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
33
 
36
- var typeMap = {};
37
-
38
34
  var DrawerManager = /*#__PURE__*/function () {
39
35
  function DrawerManager() {
40
36
  var _this = this;
41
37
 
42
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
-
44
- _objectDestructuringEmpty(_ref);
45
-
46
38
  _classCallCheck(this, DrawerManager);
47
39
 
48
40
  this.history = [];
49
41
  this.uid = 0;
42
+ this.typeMap = {};
50
43
 
51
44
  this.open = function (type) {
52
45
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53
46
  var drawerProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
54
- if (!type) throw "need provide drawer type";
55
- var Component = typeMap[type];
56
- if (!Component) throw "the type is not regisited";
57
- window.titaTracker && window.titaTracker("action").record({
58
- actionName: type,
59
- actionGroup: "打开推屏",
60
- productName: "OKR"
61
- });
47
+ if (!type) throw new Error("need provide drawer type");
48
+ var Component = typeof type === "string" ? _this.typeMap[type] : type;
49
+ if (!Component) throw new Error("the type is not regisited");
50
+
51
+ if (window.titaTracker) {
52
+ window.titaTracker("action").record({
53
+ actionName: type,
54
+ actionGroup: "打开推屏",
55
+ productName: "OKR"
56
+ });
57
+ }
58
+
62
59
  return new Promise(function (resolve) {
63
60
  clearTimeout(_this.timer);
64
61
  _this.timer = setTimeout(function () {
65
62
  var uid = _this.uid;
66
- _this.uid++;
63
+ _this.uid += 1;
67
64
  var extendedDrawerProps = drawerProps;
68
65
 
69
66
  if (_this.history.length > 0) {
@@ -82,7 +79,7 @@ var DrawerManager = /*#__PURE__*/function () {
82
79
  key: uid
83
80
  }, props)), extendedDrawerProps);
84
81
 
85
- if (_this.history.length == 1) {
82
+ if (_this.history.length === 1) {
86
83
  document.addEventListener("mousedown", _this.autoClose);
87
84
  }
88
85
  }, 200);
@@ -109,14 +106,16 @@ var DrawerManager = /*#__PURE__*/function () {
109
106
  };
110
107
 
111
108
  this.close = function () {
112
- _this.history.reverse().forEach(function (_ref2) {
113
- var resolve = _ref2.resolve;
109
+ _this.history.reverse().forEach(function (_ref) {
110
+ var resolve = _ref.resolve;
114
111
  return resolve();
115
112
  });
116
113
 
117
114
  _this.history = [];
118
115
 
119
116
  _this.drawer.close();
117
+
118
+ document.removeEventListener("mousedown", _this.autoClose);
120
119
  };
121
120
 
122
121
  this.autoClose = function (e) {
@@ -125,20 +124,19 @@ var DrawerManager = /*#__PURE__*/function () {
125
124
  return;
126
125
  }
127
126
 
128
- if ((0, _dom.hasAncestorElement)(e.target, "document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add")) return;
127
+ if ((0, _dom.hasAncestorElement)(e.target, "document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add")) {
128
+ return;
129
+ }
129
130
 
130
131
  _this.close();
132
+ };
131
133
 
132
- document.removeEventListener("mousedown", _this.autoClose);
134
+ this.regist = function (type, component) {
135
+ _this.typeMap[type] = component;
133
136
  };
134
137
  }
135
138
 
136
139
  _createClass(DrawerManager, [{
137
- key: "regist",
138
- value: function regist(type, component) {
139
- typeMap[type] = component;
140
- }
141
- }, {
142
140
  key: "drawer",
143
141
  get: function get() {
144
142
  var _this2 = this;
@@ -18,10 +18,16 @@ exports.onlineBroadcastData = exports["default"] = void 0;
18
18
  // href = "https://wiki.tita.com/pages/viewpage.action?pageId=15697741";
19
19
  // }
20
20
  var onlineBroadcastData = [{
21
+ hasOnline: true,
22
+ preContent: "「考核」OKR 维度支持按 KR 评分啦",
23
+ preHref: "https://wiki.tita.com/x/JYOeAQ",
24
+ isNew: true,
25
+ date: "4/11"
26
+ }, {
21
27
  hasOnline: true,
22
28
  preContent: "「OKR 工作法」体验优化 ",
23
29
  preHref: "https://wiki.tita.com/x/jIOeAQ",
24
- isNew: true,
30
+ isNew: false,
25
31
  date: "3/29"
26
32
  }, {
27
33
  hasOnline: true,
@@ -13,27 +13,29 @@ var _essayComponent = _interopRequireDefault(require("../../grid-layout/essay-co
13
13
 
14
14
  var _helpers = require("../../../utils/helpers");
15
15
 
16
- var _getLocale = require("../../../utils/getLocale");
16
+ var _openData = require("../../../utils/open-data");
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
 
20
+ var pencil = require("../image/\u7B14.svg");
21
+
20
22
  function CaseLibraryMain(props) {
21
23
  var onApplyTpl = props.onApplyTpl,
22
24
  cardList = props.cardList,
23
25
  isUnlock = props.isUnlock,
24
- okrCasesNum = props.okrCasesNum,
25
26
  handleShowSubmitOkrWindow = props.handleShowSubmitOkrWindow,
26
27
  handleShowPayWindow = props.handleShowPayWindow,
27
28
  isfix = props.isfix,
28
29
  isLoading = props.isLoading,
29
30
  activeNavId = props.activeNavId,
30
- onClose = props.onClose,
31
31
  asideHeightRef = props.asideHeightRef,
32
32
  fixAsideTopScroll = props.fixAsideTopScroll; // @ts-ignore
33
33
 
34
- var DeadLine = BSGlobal.tenantAuthentication.DeadLine; // @ts-ignore
34
+ var DeadLine = window.BSGlobal.tenantAuthentication.DeadLine; // @ts-ignore
35
35
 
36
- var Name = BSGlobal.loginUserInfo.Name;
36
+ var _window$BSGlobal$logi = window.BSGlobal.loginUserInfo,
37
+ Name = _window$BSGlobal$logi.Name,
38
+ Id = _window$BSGlobal$logi.Id;
37
39
  return /*#__PURE__*/_react["default"].createElement("div", {
38
40
  className: "okr-cases-library__mainContainer"
39
41
  }, /*#__PURE__*/_react["default"].createElement(_caseLibraryCardList["default"], {
@@ -60,18 +62,22 @@ function CaseLibraryMain(props) {
60
62
  return handleShowSubmitOkrWindow(true);
61
63
  }
62
64
  }, /*#__PURE__*/_react["default"].createElement("img", {
63
- src: require("../image/\u7B14.svg")
65
+ src: pencil,
66
+ alt: "pencil"
64
67
  }), "\u63D0\u4EA4\u6211\u60F3\u8981\u7684OKR\u7C7B\u578B"), /*#__PURE__*/_react["default"].createElement("div", {
65
68
  className: "okr-cases-library__aside__submitWant__libraryNum"
66
69
  }, "\u5168\u56FD\u6700\u5927 OKR \u6848\u4F8B\u5E93", /*#__PURE__*/_react["default"].createElement("span", {
67
70
  style: {
68
71
  color: "#F05E5E"
69
72
  }
70
- }, " ", okrCasesNum), " ", (0, _getLocale.getLocale)("OKR_MyO_E_Mumber"))), isUnlock ? /*#__PURE__*/_react["default"].createElement("div", {
73
+ }, " 1000+"), " ")), isUnlock ? /*#__PURE__*/_react["default"].createElement("div", {
71
74
  className: "okr-cases-library__aside__memberInfo"
72
75
  }, /*#__PURE__*/_react["default"].createElement("div", {
73
76
  className: "okr-cases-library__aside__memberInfo__name"
74
- }, Name, "\u7684", /*#__PURE__*/_react["default"].createElement("b", null, " VIP "), "\u4F1A\u5458"), /*#__PURE__*/_react["default"].createElement("p", {
77
+ }, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
78
+ name: Name,
79
+ id: Id
80
+ }), "\u7684", /*#__PURE__*/_react["default"].createElement("b", null, " VIP "), "\u4F1A\u5458"), /*#__PURE__*/_react["default"].createElement("p", {
75
81
  className: "okr-cases-library__aside__memberInfo__deadLine"
76
82
  }, "\u6709\u6548\u65E5\u671F\u81F3\uFF1A", DeadLine)) : /*#__PURE__*/_react["default"].createElement("div", {
77
83
  className: "okr-cases-library__aside__advertise",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.90",
3
+ "version": "1.11.2",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",