@titaui/pc 1.10.82-beta.15 → 1.10.82-beta.18

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.
@@ -13,7 +13,7 @@
13
13
  align-items: center;
14
14
  justify-content: center;
15
15
  min-width: 64px;
16
- font-size: 13px;
16
+ font-size: 14px;
17
17
  padding: 0 12px;
18
18
  }
19
19
 
@@ -60,21 +60,35 @@
60
60
  background: #5c8eff;
61
61
  }
62
62
 
63
+ .titaui-rect-btn--secondary {
64
+ font-size: 14px;
65
+ font-weight: normal;
66
+ color: #2879ff;
67
+ line-height: 28px;
68
+ background: rgba(40, 121, 255, 0.2);
69
+ margin-right: 16px;
70
+ }
71
+
72
+ .titaui-rect-btn--secondary:hover {
73
+ color: #fff;
74
+ background-color: #2879ff;
75
+ }
76
+
63
77
  .titaui-rect-btn--cancel {
64
- color: #6F7886;
65
- border: 1px solid #DFE3EA;
66
- background: #FFFFFF;
78
+ color: #6f7886;
79
+ border: 1px solid #dfe3ea;
80
+ background: #ffffff;
67
81
  }
68
82
 
69
83
  .titaui-rect-btn--cancel:hover {
70
- color: #2879FF;
71
- border: 1px solid #2879FF;
84
+ color: #2879ff;
85
+ border: 1px solid #2879ff;
72
86
  }
73
87
 
74
88
  .titaui-rect-btn--delete {
75
- background: #FFFFFF;
76
- color: #F05E5E;
77
- border: 1px solid #F05E5E;
89
+ background: #ffffff;
90
+ color: #f05e5e;
91
+ border: 1px solid #f05e5e;
78
92
  }
79
93
 
80
94
  .titaui-rect-btn--delete:hover {
@@ -93,10 +107,10 @@
93
107
  }
94
108
 
95
109
  .titaui-rect-btn--primary.titaui-rect-btn--disabled {
96
- background: #93BCFF;
110
+ background: #93bcff;
97
111
  opacity: 1;
98
112
  }
99
113
 
100
114
  .titaui-rect-btn--primary.titaui-rect-btn--disabled:hover {
101
- background: #93BCFF;
115
+ background: #93bcff;
102
116
  }
@@ -34,7 +34,8 @@ function RectBtn(props) {
34
34
  className = _props$className === void 0 ? "" : _props$className,
35
35
  _props$disabled = props.disabled,
36
36
  disabled = _props$disabled === void 0 ? false : _props$disabled,
37
- style = props.style;
37
+ style = props.style,
38
+ children = props.children;
38
39
 
39
40
  var renderIcon = function renderIcon() {
40
41
  if (typeof icon === "string") {
@@ -50,16 +51,19 @@ function RectBtn(props) {
50
51
  }, icon);
51
52
  };
52
53
 
53
- var onClickHandler = function onClickHandler() {
54
+ var onClickHandler = function onClickHandler(e) {
54
55
  if (disabled) return;
55
- onClick && onClick();
56
+
57
+ if (onClick) {
58
+ onClick(e);
59
+ }
56
60
  };
57
61
 
58
62
  return /*#__PURE__*/_react["default"].createElement("span", {
59
63
  className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled), className),
60
64
  style: style,
61
65
  onClick: onClickHandler
62
- }, icon && renderIcon(), props.children || text);
66
+ }, icon && renderIcon(), children || text);
63
67
  }
64
68
 
65
69
  var _default = RectBtn;
@@ -46,7 +46,7 @@ var createWidthKr = /*#__PURE__*/function () {
46
46
  while (1) {
47
47
  switch (_context.prev = _context.next) {
48
48
  case 0:
49
- url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/work/createWithKr");
49
+ url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/createWithKr");
50
50
  _context.next = 3;
51
51
  return _axios["default"].post(url, _objectSpread({
52
52
  workType: 6
@@ -25,7 +25,9 @@ require("./index.css");
25
25
 
26
26
  var _context = _interopRequireDefault(require("../drawer-manager/context"));
27
27
 
28
- var _excluded = ["visible", "placement", "children", "mask", "width", "className", "contentWrapperStyle", "onClose", "style", "afterVisibleChange", "destroyOnClose", "bodyStyle", "zIndex"];
28
+ var _dom = require("./utils/dom");
29
+
30
+ var _excluded = ["visible", "placement", "children", "mask", "width", "className", "contentWrapperStyle", "onClose", "style", "afterVisibleChange", "destroyOnClose", "bodyStyle", "zIndex", "autoClosable"];
29
31
 
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
31
33
 
@@ -54,7 +56,7 @@ var Drawer = function Drawer(props) {
54
56
 
55
57
  var visible = props.visible,
56
58
  _props$placement = props.placement,
57
- placement = _props$placement === void 0 ? "right" : _props$placement,
59
+ placement = _props$placement === void 0 ? 'right' : _props$placement,
58
60
  children = props.children,
59
61
  _props$mask = props.mask,
60
62
  mask = _props$mask === void 0 ? false : _props$mask,
@@ -70,6 +72,8 @@ var Drawer = function Drawer(props) {
70
72
  bodyStyle = props.bodyStyle,
71
73
  _props$zIndex = props.zIndex,
72
74
  zIndex = _props$zIndex === void 0 ? 1200 : _props$zIndex,
75
+ _props$autoClosable = props.autoClosable,
76
+ autoClosable = _props$autoClosable === void 0 ? false : _props$autoClosable,
73
77
  rest = _objectWithoutProperties(props, _excluded);
74
78
 
75
79
  var handleAfterVisibleChange = (0, _react.useCallback)(function (opened) {
@@ -89,6 +93,20 @@ var Drawer = function Drawer(props) {
89
93
  return children;
90
94
  }
91
95
 
96
+ var autoClose = function autoClose(e) {
97
+ 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;
98
+ onClose();
99
+ };
100
+
101
+ (0, _react.useEffect)(function () {
102
+ if (autoClosable) {
103
+ document.addEventListener('mousedown', autoClose);
104
+ }
105
+
106
+ return function () {
107
+ document.removeEventListener('mousedown', autoClose);
108
+ };
109
+ }, []);
92
110
  return /*#__PURE__*/_react["default"].createElement(DrawerContext.Provider, {
93
111
  value: {
94
112
  close: function close() {
@@ -96,7 +114,7 @@ var Drawer = function Drawer(props) {
96
114
  }
97
115
  }
98
116
  }, /*#__PURE__*/_react["default"].createElement(_rcDrawer["default"], _extends({
99
- className: (0, _classnames["default"])("titaui-drawer", "document-mouse-event-ignore", className),
117
+ className: (0, _classnames["default"])('titaui-drawer', 'document-mouse-event-ignore', className),
100
118
  style: _objectSpread(_objectSpread({}, style), {}, {
101
119
  zIndex: zIndex
102
120
  })
@@ -146,7 +164,7 @@ function DrawerHeader(_ref) {
146
164
  onClick: manager && manager.goBack
147
165
  }, /*#__PURE__*/_react["default"].createElement("i", {
148
166
  className: "tu-icon-fanhui"
149
- }), (0, _getLocale.getLocale)("Mod_Back")), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
167
+ }), (0, _getLocale.getLocale)('Mod_Back')), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
150
168
  className: "titaui-drawer-header-divider"
151
169
  }), hasContent && content, /*#__PURE__*/_react["default"].createElement("div", {
152
170
  style: {
@@ -155,7 +173,7 @@ function DrawerHeader(_ref) {
155
173
  }), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
156
174
  return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
157
175
  }), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
158
- title: (0, _getLocale.getLocale)("Mod_MoreOperate"),
176
+ title: (0, _getLocale.getLocale)('Mod_MoreOperate'),
159
177
  icon: "tu-icon-10",
160
178
  children: collapsedActions
161
179
  }), showClose && /*#__PURE__*/_react["default"].createElement("div", {
@@ -15,6 +15,8 @@ var _bsGlobal = require("../../utils/bs-global");
15
15
 
16
16
  var _userOwnMenu = _interopRequireDefault(require("./components/user-own-menu"));
17
17
 
18
+ var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
19
+
18
20
  var _menu = _interopRequireDefault(require("./components/menu"));
19
21
 
20
22
  var _userMessage = _interopRequireDefault(require("./components/user-message"));
@@ -170,5 +172,7 @@ var NavTop = function NavTop() {
170
172
  }, /*#__PURE__*/_react["default"].createElement(_userOwnMenu["default"], null)));
171
173
  };
172
174
 
173
- var _default = NavTop;
174
- exports["default"] = _default;
175
+ var _default = NavTop; // @ts-ignore
176
+
177
+ exports["default"] = _default;
178
+ NavTop.useGlobalValue = _useGlobalValue["default"];
@@ -157,8 +157,8 @@ function OkrSearchPanel(props, ref) {
157
157
  return (0, _requestApis.expandNodesByLevel)({
158
158
  okrIds: okrIds,
159
159
  level: openLevel - 1,
160
- showKr: showkr ? 0 : 1,
161
- showCardKr: showCardKr ? 0 : 1
160
+ showKr: showkr ? 1 : 0,
161
+ showCardKr: showCardKr ? 1 : 0
162
162
  });
163
163
 
164
164
  case 13:
@@ -220,7 +220,7 @@ function OkrSearchPanel(props, ref) {
220
220
  okrId: modelType == "kr" ? data.workId : id,
221
221
  okrIdParent: modelType == "work" ? data.parentId : data.workId,
222
222
  childRoot: false,
223
- showCardKr: showCardKr ? 0 : 1
223
+ showCardKr: showCardKr ? 1 : 0
224
224
  });
225
225
 
226
226
  case 3:
@@ -272,7 +272,7 @@ function OkrSearchPanel(props, ref) {
272
272
  okrId: modelType == "work" ? id : data.workId,
273
273
  okrIdParent: 0,
274
274
  childRoot: true,
275
- showCardKr: showCardKr ? 0 : 1,
275
+ showCardKr: showCardKr ? 1 : 0,
276
276
  currentOkrRole: modelType == "kr" ? data.mapkrVisible : data.MapOkrVisible
277
277
  });
278
278
 
@@ -109,7 +109,7 @@ var expandNodesByLevel = function expandNodesByLevel(_ref2) {
109
109
  _ref2$showKr = _ref2.showKr,
110
110
  showKr = _ref2$showKr === void 0 ? 0 : _ref2$showKr,
111
111
  _ref2$showCardKr = _ref2.showCardKr,
112
- showCardKr = _ref2$showCardKr === void 0 ? 1 : _ref2$showCardKr;
112
+ showCardKr = _ref2$showCardKr === void 0 ? 0 : _ref2$showCardKr;
113
113
  return (// const queryStr = qs.stringify({ okrIds, level }, { arrayFormat: 'repeat' });
114
114
  _axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/map/generalview"), {
115
115
  okrIds: okrIds,
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _button = _interopRequireDefault(require("../button"));
15
+
16
+ var _form = _interopRequireDefault(require("../form"));
17
+
18
+ require("./index.css");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ 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); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
+
28
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
+
30
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
31
+
32
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
33
+
34
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
35
+
36
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
+
38
+ var preCls = 'tita-survey-model';
39
+ var Rect = _button["default"].Rect;
40
+ var Input = _form["default"].Fields.Input;
41
+
42
+ var ContactModel = function ContactModel(_ref) {
43
+ var visilble = _ref.visilble,
44
+ setVisible = _ref.setVisible,
45
+ sendData = _ref.sendData;
46
+
47
+ var _useState = (0, _react.useState)(''),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ contact = _useState2[0],
50
+ setContact = _useState2[1];
51
+
52
+ var onContactChange = function onContactChange(value) {
53
+ setContact(value);
54
+ };
55
+
56
+ var handleClose = function handleClose() {
57
+ sendData(contact);
58
+
59
+ if (setVisible) {
60
+ setVisible(false);
61
+ }
62
+ };
63
+
64
+ var handleSubmit = function handleSubmit() {
65
+ sendData(contact);
66
+ setVisible(false);
67
+ };
68
+
69
+ if (!visilble) return /*#__PURE__*/_react["default"].createElement("div", null);
70
+ return /*#__PURE__*/_react["default"].createElement("div", {
71
+ className: (0, _classnames["default"])('tita-survey-model')
72
+ }, /*#__PURE__*/_react["default"].createElement("div", {
73
+ className: "".concat(preCls, "__head")
74
+ }, /*#__PURE__*/_react["default"].createElement("div", {
75
+ className: "".concat(preCls, "__head-title")
76
+ }, "\u5982\u613F\u610F\u63A5\u53D7\u56DE\u8BBF\uFF0C\u8BF7\u7559\u4E0B\u59D3\u540D\u4E0E\u7535\u8BDD"), /*#__PURE__*/_react["default"].createElement("span", {
77
+ className: "tu-icon-canceled ".concat(preCls, "__head-close "),
78
+ onClick: handleClose
79
+ })), /*#__PURE__*/_react["default"].createElement(Input, {
80
+ placeholder: '请输入',
81
+ value: contact,
82
+ onChange: onContactChange,
83
+ className: "".concat(preCls, "__input")
84
+ }), /*#__PURE__*/_react["default"].createElement(Rect, {
85
+ type: "primary",
86
+ className: "".concat(preCls, "__btn"),
87
+ onClick: handleSubmit
88
+ }, "\u63D0\u4EA4"));
89
+ };
90
+
91
+ ContactModel.defaultProps = {};
92
+ var _default = ContactModel;
93
+ exports["default"] = _default;
@@ -0,0 +1,141 @@
1
+ .tita-survey-model {
2
+ width: 436px;
3
+ background: #FFFFFF;
4
+ box-shadow: 0px 8px 24px 0px rgba(127, 145, 180, 0.2);
5
+ border-radius: 24px;
6
+ border: 1px solid #F0F2F5;
7
+ padding: 24px;
8
+ box-sizing: border-box;
9
+ position: fixed;
10
+ right: 20px;
11
+ bottom: 0;
12
+ z-index: 4000;
13
+ animation: showModel 0.5s;
14
+ transition: height linear 0.5s;
15
+ }
16
+
17
+ .tita-survey-model__head {
18
+ display: flex;
19
+ justify-content: space-between;
20
+ align-items: center;
21
+ font-size: 16px;
22
+ }
23
+
24
+ .tita-survey-model__head-title {
25
+ font-size: 18px;
26
+ font-weight: 600;
27
+ color: #141C28;
28
+ line-height: 22px;
29
+ }
30
+
31
+ .tita-survey-model__head-close {
32
+ cursor: pointer;
33
+ color: #141C28;
34
+ display: inline-flex;
35
+ font-size: 20px;
36
+ align-items: center;
37
+ justify-content: center;
38
+ width: 24px;
39
+ height: 24px;
40
+ border-radius: 8px;
41
+ }
42
+
43
+ .tita-survey-model__head-close:hover {
44
+ background: #F0F4FA;
45
+ }
46
+
47
+ .tita-survey-model__text {
48
+ border-radius: 8px;
49
+ }
50
+
51
+ .tita-survey-model__score {
52
+ display: flex;
53
+ justify-content: space-between;
54
+ align-items: center;
55
+ margin-top: 20px;
56
+ }
57
+
58
+ .tita-survey-model__score-item {
59
+ width: 28px;
60
+ height: 28px;
61
+ background: #FFFFFF;
62
+ border-radius: 8px;
63
+ border: 1px solid #DFE3EA;
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: center;
67
+ cursor: pointer;
68
+ }
69
+
70
+ .tita-survey-model__score-item:hover {
71
+ border: 1px solid #2879FF;
72
+ color: #2879FF;
73
+ }
74
+
75
+ .tita-survey-model__score-item--active {
76
+ border: 1px solid #2879FF;
77
+ background: rgba(40, 121, 255, 0.1);
78
+ color: #2879FF;
79
+ }
80
+
81
+ .tita-survey-model__keywords {
82
+ display: flex;
83
+ justify-content: space-between;
84
+ align-items: center;
85
+ margin-top: 12px;
86
+ font-size: 12px;
87
+ font-weight: normal;
88
+ color: #6F7886;
89
+ line-height: 18px;
90
+ }
91
+
92
+ .tita-survey-model__tags {
93
+ margin: 14px -10px 8px 0;
94
+ display: flex;
95
+ align-items: center;
96
+ flex-wrap: wrap;
97
+ }
98
+
99
+ .tita-survey-model__tags-item {
100
+ height: 26px;
101
+ font-size: 12px;
102
+ display: flex;
103
+ align-items: center;
104
+ justify-content: center;
105
+ background: #FFFFFF;
106
+ margin: 0 8px 8px 0;
107
+ padding: 0 12px;
108
+ border-radius: 8px;
109
+ border: 1px solid #DFE3EA;
110
+ cursor: pointer;
111
+ }
112
+
113
+ .tita-survey-model__tags-item:hover {
114
+ color: #2879FF;
115
+ border: 1px solid #2879FF;
116
+ }
117
+
118
+ .tita-survey-model__tags-item--active {
119
+ background: rgba(40, 121, 255, 0.1);
120
+ color: #2879FF;
121
+ border: 1px solid #2879FF;
122
+ }
123
+
124
+ .tita-survey-model__btn {
125
+ width: 36px;
126
+ margin: 16px auto 0;
127
+ }
128
+
129
+ .tita-survey-model__input {
130
+ margin-top: 20px;
131
+ }
132
+
133
+ @keyframes showModel {
134
+ 0% {
135
+ transform: translateY(100%);
136
+ }
137
+
138
+ 100% {
139
+ transform: translateY(0);
140
+ }
141
+ }