@titaui/pc 1.11.57 → 1.11.59

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.
Files changed (76) hide show
  1. package/lib/components/create-okr-modal/index.js +3 -1
  2. package/lib/components/dynamic/dynamic-list/index.js +14 -7
  3. package/lib/components/dynamic/index.js +9 -12
  4. package/lib/components/dynamic/request-api.js +7 -68
  5. package/lib/components/nav-top/index.js +2 -2
  6. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  7. package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
  8. package/package.json +2 -2
  9. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  10. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  11. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  12. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  13. package/lib/components/dynamic/advertise/index.css +0 -21
  14. package/lib/components/dynamic/advertise/index.js +0 -126
  15. package/lib/components/dynamic/advertise/interface.js +0 -5
  16. package/lib/components/dynamic/advertise/util.js +0 -28
  17. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  18. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  19. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  20. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  21. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  22. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  23. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  24. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  25. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  26. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  27. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  28. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  29. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  30. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  31. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  32. package/lib/components/dynamic/dynamic-liking/index.js +0 -79
  33. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  34. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  35. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  36. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  37. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  38. package/lib/components/dynamic/dynamic-topping/index.js +0 -82
  39. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  40. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  41. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  42. package/lib/components/dynamic/dynamic.css +0 -173
  43. package/lib/components/dynamic/dynamic.js +0 -428
  44. package/lib/components/dynamic/export-module/index.js +0 -37
  45. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  46. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  47. package/lib/components/dynamic/my-team/img/line.png +0 -0
  48. package/lib/components/dynamic/my-team/img/team.png +0 -0
  49. package/lib/components/dynamic/my-team/index.css +0 -184
  50. package/lib/components/dynamic/my-team/index.js +0 -263
  51. package/lib/components/dynamic/my-team/request-api.js +0 -52
  52. package/lib/components/dynamic/my-team/util.js +0 -20
  53. package/lib/components/dynamic/new-ui.css +0 -192
  54. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  55. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  56. package/lib/components/dynamic/online-broadcast/data.js +0 -95
  57. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  58. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  59. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  60. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  61. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  62. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  63. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  64. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  65. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  66. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  67. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  68. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  69. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  70. package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -44
  71. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  72. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  73. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  74. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  75. package/lib/components/dynamic/quick-operation/index.css +0 -51
  76. package/lib/components/dynamic/quick-operation/index.js +0 -120
@@ -1,81 +0,0 @@
1
- .titaui-dynamic-search-input {
2
- display: flex;
3
- align-items: center;
4
- width: 240px;
5
- height: 32px;
6
- background: #ffffff;
7
- border-radius: 16px;
8
- border: 1px solid #e9ecf0;
9
- padding: 5px 12px 5px 14px;
10
- box-sizing: border-box;
11
- }
12
-
13
- .titaui-dynamic-search-input__popup {
14
- width: 96px;
15
- height: 96px;
16
- background: #ffffff;
17
- box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
18
- border: 1px solid #f0f2f5;
19
- padding: 16px 0px 16px 0px;
20
- box-sizing: border-box;
21
- border-radius: 6px;
22
- user-select: none;
23
- }
24
-
25
- .titaui-dynamic-search-input__popup-item {
26
- display: flex;
27
- align-items: center;
28
- justify-content: center;
29
- height: 32px;
30
- font-size: 14px;
31
- color: #3f4755;
32
- line-height: 22px;
33
- cursor: pointer;
34
- }
35
-
36
- .titaui-dynamic-search-input__popup-item--active {
37
- color: #2879ff;
38
- }
39
-
40
- .titaui-dynamic-search-input__popup-item:hover {
41
- color: #2879ff;
42
- background: #f7f8fa;
43
- }
44
-
45
- .titaui-dynamic-search-input__icon {
46
- margin: 0 8px;
47
- }
48
-
49
- .titaui-dynamic-search-input__select-type {
50
- display: flex;
51
- align-items: center;
52
- cursor: pointer;
53
- word-break: keep-all;
54
- white-space: nowrap;
55
- }
56
-
57
- .titaui-dynamic-search-input__input {
58
- border: none;
59
- outline: none;
60
- width: 130px;
61
- margin-right: 4px;
62
- overflow: hidden;
63
- text-overflow: ellipsis;
64
- line-height: 22px;
65
- }
66
-
67
- .titaui-dynamic-search-input__input::placeholder {
68
- font-size: 14px;
69
- color: #bfc7d5;
70
- line-height: 22px;
71
- }
72
-
73
- .titaui-dynamic-search-input__input-clear {
74
- color: #bfc7d5;
75
- font-size: 14px;
76
- }
77
-
78
- .titaui-dynamic-search-input__input-clear:hover {
79
- cursor: pointer;
80
- color: #f05e5e;
81
- }
@@ -1,203 +0,0 @@
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 _popup = _interopRequireDefault(require("../../../popup"));
15
-
16
- var _userSelector = _interopRequireDefault(require("../../../user-selector"));
17
-
18
- var _getLocale = require("../../../../utils/getLocale");
19
-
20
- require("./index.css");
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
-
24
- 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); }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
30
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
-
32
- 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."); }
33
-
34
- 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); }
35
-
36
- 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; }
37
-
38
- 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; }
39
-
40
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
-
42
- var prefix = "titaui-dynamic-search-input";
43
-
44
- var SearchType = function SearchType() {
45
- return {
46
- dynamic: (0, _getLocale.getLocale)("Menu_Title_Feed"),
47
- person: (0, _getLocale.getLocale)("Mod_UserName")
48
- };
49
- };
50
-
51
- var DynamicSearchInput = function DynamicSearchInput(_ref) {
52
- var _SearchType;
53
-
54
- var setSearchKey = _ref.setSearchKey,
55
- setSearchKeyType = _ref.setSearchKeyType,
56
- setSearchUser = _ref.setSearchUser;
57
-
58
- var _useState = (0, _react.useState)("dynamic"),
59
- _useState2 = _slicedToArray(_useState, 2),
60
- searchDynamicType = _useState2[0],
61
- setSearchDynamicType = _useState2[1];
62
-
63
- var _useState3 = (0, _react.useState)(""),
64
- _useState4 = _slicedToArray(_useState3, 2),
65
- searchInputValue = _useState4[0],
66
- setSearchInputValue = _useState4[1];
67
-
68
- var _useState5 = (0, _react.useState)(false),
69
- _useState6 = _slicedToArray(_useState5, 2),
70
- isMouseEnter = _useState6[0],
71
- setIsMouseEnter = _useState6[1];
72
-
73
- var popupRef = (0, _react.useRef)();
74
- var selectorRef = (0, _react.useRef)();
75
- var inputRef = (0, _react.useRef)();
76
-
77
- var handleInputChange = function handleInputChange(e) {
78
- setSearchInputValue(e.target.value);
79
-
80
- if (searchDynamicType === "person") {
81
- // @ts-ignore
82
- selectorRef.current && selectorRef.current.open();
83
- }
84
- };
85
-
86
- var handleKeyUp = function handleKeyUp(e) {
87
- // 按回车
88
- if (e.keyCode === 13 && searchDynamicType !== "person") {
89
- setSearchKey(searchInputValue);
90
- setSearchKeyType(searchDynamicType);
91
- }
92
- };
93
-
94
- var handleChangeSearchDynamicType = function handleChangeSearchDynamicType(type) {
95
- setSearchDynamicType(type);
96
- setSearchKeyType; // @ts-ignore
97
-
98
- popupRef.current && popupRef.current.close();
99
- };
100
-
101
- var handleSelected = function handleSelected(_ref2) {
102
- var _ref3 = _slicedToArray(_ref2, 1),
103
- user = _ref3[0];
104
-
105
- setSearchInputValue(user.data.name);
106
- setSearchUser(user.data);
107
- setSearchKeyType(searchDynamicType);
108
- };
109
-
110
- var handleMouseEnter = function handleMouseEnter() {
111
- setIsMouseEnter(true);
112
- };
113
-
114
- var handleMouseLeave = function handleMouseLeave() {
115
- setIsMouseEnter(false);
116
- };
117
-
118
- var handleClearSearchValue = function handleClearSearchValue() {
119
- setSearchInputValue("");
120
- setSearchKey("");
121
- setSearchUser(null);
122
- setSearchKeyType(searchDynamicType);
123
- };
124
-
125
- function PopupContent() {
126
- return /*#__PURE__*/_react["default"].createElement("div", {
127
- className: "".concat(prefix, "__popup")
128
- }, /*#__PURE__*/_react["default"].createElement("div", {
129
- className: (0, _classnames["default"])("".concat(prefix, "__popup-item"), _defineProperty({}, "".concat(prefix, "__popup-item--active"), searchDynamicType === "dynamic")),
130
- onClick: function onClick() {
131
- handleChangeSearchDynamicType("dynamic");
132
- }
133
- }, (0, _getLocale.getLocale)("Menu_Title_Feed")), /*#__PURE__*/_react["default"].createElement("div", {
134
- className: (0, _classnames["default"])("".concat(prefix, "__popup-item"), _defineProperty({}, "".concat(prefix, "__popup-item--active"), searchDynamicType === "person")),
135
- onClick: function onClick() {
136
- handleChangeSearchDynamicType("person");
137
- }
138
- }, (0, _getLocale.getLocale)("Mod_UserName")));
139
- }
140
-
141
- return /*#__PURE__*/_react["default"].createElement("div", {
142
- className: prefix,
143
- ref: inputRef,
144
- onMouseEnter: handleMouseEnter,
145
- onMouseLeave: handleMouseLeave
146
- }, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
147
- popup: PopupContent,
148
- popupPlacement: "bottom",
149
- ref: popupRef,
150
- popupAlign: {
151
- offset: [-10, 2],
152
- overflow: {
153
- adjustX: true,
154
- adjustY: true
155
- },
156
- targetOffset: [0, 0]
157
- }
158
- }, /*#__PURE__*/_react["default"].createElement("span", {
159
- className: "".concat(prefix, "__select-type")
160
- }, /*#__PURE__*/_react["default"].createElement("span", null, (_SearchType = SearchType()) === null || _SearchType === void 0 ? void 0 : _SearchType[searchDynamicType]), /*#__PURE__*/_react["default"].createElement("i", {
161
- className: (0, _classnames["default"])("tu-icon-sort-down", "".concat(prefix, "__icon"))
162
- }))), /*#__PURE__*/_react["default"].createElement("input", {
163
- className: "".concat(prefix, "__input"),
164
- value: searchInputValue,
165
- onChange: handleInputChange,
166
- onKeyUp: handleKeyUp,
167
- placeholder: searchDynamicType === "dynamic" ? (0, _getLocale.getLocale)("Feed_Search_Searchbykeyword") : (0, _getLocale.getLocale)("Mod_SearchbyName")
168
- }), isMouseEnter && searchInputValue && /*#__PURE__*/_react["default"].createElement("i", {
169
- onClick: handleClearSearchValue,
170
- className: (0, _classnames["default"])("tu-icon-circle", "".concat(prefix, "__input-clear"))
171
- }), /*#__PURE__*/_react["default"].createElement(_userSelector["default"], {
172
- ref: selectorRef,
173
- multiple: false,
174
- position: "bottomRight",
175
- onSelect: handleSelected,
176
- disabledDepartSelect: true,
177
- showSearchInput: false,
178
- searchedPanes: {
179
- user: true,
180
- depart: false,
181
- group: false
182
- },
183
- searchWord: searchInputValue,
184
- trigger: /*#__PURE__*/_react["default"].createElement("span", null),
185
- getPopupContainer: function getPopupContainer() {
186
- return inputRef.current;
187
- },
188
- panes: {
189
- depart: true
190
- },
191
- popupAlign: {
192
- offset: [17, 15],
193
- overflow: {
194
- adjustX: true,
195
- adjustY: true
196
- },
197
- targetOffset: [0, 0]
198
- }
199
- }));
200
- };
201
-
202
- var _default = DynamicSearchInput;
203
- exports["default"] = _default;
@@ -1,101 +0,0 @@
1
- .titaui-dynamic-first-level-tabs {
2
- display: flex;
3
- align-items: center;
4
- }
5
-
6
- .titaui-dynamic-first-level-tabs__tab {
7
- display: inline-flex;
8
- align-items: center;
9
- height: 100%;
10
- position: relative;
11
- font-size: 16px;
12
- color: #141c28;
13
- line-height: 24px;
14
- cursor: pointer;
15
- margin-right: 36px;
16
- white-space: nowrap;
17
- word-break: keep-all;
18
- text-overflow: ellipsis;
19
- font-weight: 400;
20
- }
21
-
22
- .titaui-dynamic-first-level-tabs__tab--active {
23
- color: #2879ff;
24
- font-weight: 600;
25
- }
26
-
27
- .titaui-dynamic-first-level-tabs__tab--active::before {
28
- content: '';
29
- display: inline-block;
30
- position: absolute;
31
- bottom: 0;
32
- left: 50%;
33
- transform: translateX(-50%);
34
- width: 24px;
35
- height: 4px;
36
- background: linear-gradient(90deg, #4e90ff 0%, #2879ff 100%);
37
- border-radius: 2px;
38
- }
39
-
40
- .titaui-dynamic-first-level-tabs__tab--point {
41
- position: absolute;
42
- width: 6px;
43
- height: 6px;
44
- background: #f05e5e;
45
- border-radius: 50%;
46
- right: -6px;
47
- top: 22px;
48
- border: 2px solid #ffffff;
49
- }
50
-
51
- .titaui-dynamic-first-level-tabs__hide-first-level-tabs {
52
- display: flex;
53
- flex-direction: column;
54
- background: #ffffff;
55
- box-shadow: 0px 4px 24px 0px rgba(127, 145, 180, 0.2);
56
- border-radius: 12px;
57
- padding: 16px 0;
58
- color: #ffffff;
59
- }
60
-
61
- .titaui-dynamic-first-level-tabs__hide-first-level-tabs:hover {
62
- color: #ffffff;
63
- }
64
-
65
- .titaui-dynamic-first-level-tabs__hide-first-level-tab {
66
- padding: 5px 20px;
67
- font-size: 14px;
68
- font-weight: 400;
69
- color: #3f4755;
70
- line-height: 22px;
71
- min-width: 104px;
72
- box-sizing: border-box;
73
- }
74
-
75
- .titaui-dynamic-first-level-tabs__hide-first-level-tab--active {
76
- color: #2879ff;
77
- }
78
-
79
- .titaui-dynamic-first-level-tabs__hide-first-level-tab:hover {
80
- cursor: pointer;
81
- background: #f7f8fa;
82
- color: #2879ff;
83
- }
84
-
85
- .titaui-dynamic-first-level-tabs__more-icon {
86
- display: inline-flex;
87
- align-items: center;
88
- margin: 8px 12px;
89
- font-weight: 600;
90
- padding: 6px;
91
- cursor: pointer;
92
- border-radius: 4px;
93
- }
94
-
95
- .titaui-dynamic-first-level-tabs__more-icon--active {
96
- color: #2879ff;
97
- }
98
-
99
- .titaui-dynamic-first-level-tabs__more-icon:hover {
100
- background: #f0f4fa;
101
- }
@@ -1,131 +0,0 @@
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 _conditionRender = _interopRequireDefault(require("../../../condition-render"));
15
-
16
- var _popup = _interopRequireDefault(require("../../../popup"));
17
-
18
- var _useGlobalValue3 = _interopRequireDefault(require("../../../nav-top/useGlobalValue"));
19
-
20
- require("./index.css");
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
-
24
- 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); }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
30
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
-
32
- 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."); }
33
-
34
- 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); }
35
-
36
- 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; }
37
-
38
- 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; }
39
-
40
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
-
42
- var prefix = "titaui-dynamic-first-level-tabs";
43
- var popupAlign = {
44
- offset: [0, 5],
45
- overflow: {
46
- adjustX: true,
47
- adjustY: true
48
- },
49
- targetOffset: [0, 0]
50
- };
51
-
52
- var FirstLevelTabs = function FirstLevelTabs(_ref) {
53
- var tabsInfo = _ref.tabsInfo,
54
- onTabsChange = _ref.onTabsChange,
55
- activeTab = _ref.activeTab;
56
-
57
- var _useState = (0, _react.useState)(false),
58
- _useState2 = _slicedToArray(_useState, 2),
59
- popupVisible = _useState2[0],
60
- setPopupVisible = _useState2[1];
61
-
62
- var _useGlobalValue = (0, _useGlobalValue3["default"])(),
63
- _useGlobalValue2 = _slicedToArray(_useGlobalValue, 1),
64
- feedNum = _useGlobalValue2[0];
65
-
66
- var handleTabsChange = function handleTabsChange(id) {
67
- setPopupVisible(false);
68
-
69
- if (onTabsChange) {
70
- onTabsChange(id);
71
- }
72
- };
73
-
74
- var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
75
- setPopupVisible(visible);
76
- };
77
-
78
- var renderFoldFirstLevelTab = (0, _react.useMemo)(function () {
79
- var foldTabs = tabsInfo.slice(3);
80
- var isActiveHideMeun = foldTabs.filter(function (item) {
81
- return item.CodeId === activeTab;
82
- }).length > 0;
83
-
84
- var popContent = /*#__PURE__*/_react["default"].createElement("div", {
85
- className: "".concat(prefix, "__hide-first-level-tabs")
86
- }, foldTabs.map(function (item) {
87
- return /*#__PURE__*/_react["default"].createElement("div", {
88
- key: item.CodeId + item.MenuName,
89
- className: (0, _classnames["default"])("".concat(prefix, "__hide-first-level-tab"), _defineProperty({}, "".concat(prefix, "__hide-first-level-tab--active"), item.CodeId === activeTab)),
90
- onClick: function onClick() {
91
- handleTabsChange(item.CodeId);
92
- }
93
- }, item.MenuName);
94
- }));
95
-
96
- return /*#__PURE__*/_react["default"].createElement(_popup["default"], {
97
- popup: popContent,
98
- onPopupVisibleChange: handlePopupVisibleChange,
99
- popupVisible: popupVisible,
100
- popupPlacement: "bottomLeft",
101
- popupAlign: popupAlign // action="hover"
102
- ,
103
- destroyPopupOnHide: false
104
- }, /*#__PURE__*/_react["default"].createElement("span", {
105
- className: (0, _classnames["default"])("tu-icon-diot", "".concat(prefix, "__more-icon"), _defineProperty({}, "".concat(prefix, "__more-icon--active"), isActiveHideMeun))
106
- }));
107
- }, [tabsInfo, activeTab, popupVisible, onTabsChange]);
108
- return /*#__PURE__*/_react["default"].createElement("div", {
109
- className: prefix
110
- }, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
111
- condition: !!tabsInfo
112
- }, tabsInfo.map(function (item, index) {
113
- if (index >= 3) return null;
114
- return /*#__PURE__*/_react["default"].createElement("span", {
115
- key: item.CodeId + item.MenuName,
116
- className: (0, _classnames["default"])("".concat(prefix, "__tab"), _defineProperty({}, "".concat(prefix, "__tab--active"), item.CodeId === activeTab)),
117
- onClick: function onClick() {
118
- if (onTabsChange) {
119
- onTabsChange(item.CodeId);
120
- }
121
- }
122
- }, item.MenuName, item.CodeId === 1001 && feedNum > 0 && /*#__PURE__*/_react["default"].createElement("span", {
123
- className: "".concat(prefix, "__tab--point")
124
- }));
125
- })), /*#__PURE__*/_react["default"].createElement("span", {
126
- className: "".concat(prefix, "__fold-tab")
127
- }, renderFoldFirstLevelTab));
128
- };
129
-
130
- var _default = FirstLevelTabs;
131
- exports["default"] = _default;
@@ -1,23 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <title>点赞排行榜</title>
4
- <defs>
5
- <linearGradient x1="25.6749834%" y1="84.5410483%" x2="73.6493792%" y2="24.52131%" id="linearGradient-1">
6
- <stop stop-color="#FFFFFF" offset="0%"></stop>
7
- <stop stop-color="#FFA5A5" offset="100%"></stop>
8
- </linearGradient>
9
- </defs>
10
- <g id="页面-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
11
- <g id="公告/分享" transform="translate(-1082.000000, -727.000000)">
12
- <g id="置顶分享" transform="translate(1066.000000, 713.000000)">
13
- <g id="点赞排行榜" transform="translate(16.000000, 14.000000)">
14
- <circle id="椭圆形" fill="#F05E5E" cx="10" cy="10" r="10"></circle>
15
- <path d="M4.58285466,13.3531698 L6.82522274,10 L6.82522274,10 L10,11.9877624 L7.90149916,15.2903228 C7.78302165,15.4767793 7.53582378,15.5318872 7.34936727,15.4134097 C7.29756512,15.3804938 7.25403227,15.3360987 7.22213851,15.283661 L6.42650106,13.9755248 L6.42650106,13.9755248 L4.91535766,13.9755248 C4.69444376,13.9755248 4.51535766,13.7964387 4.51535766,13.5755248 C4.51535766,13.4963603 4.53884808,13.4189759 4.58285466,13.3531698 Z" id="路径-3" fill="url(#linearGradient-1)"></path>
16
- <path d="M10.416188,13.3531698 L12.6585561,10 L12.6585561,10 L15.8333333,11.9877624 L13.7348325,15.2903228 C13.616355,15.4767793 13.3691571,15.5318872 13.1827006,15.4134097 C13.1308985,15.3804938 13.0873656,15.3360987 13.0554718,15.283661 L12.2598344,13.9755248 L12.2598344,13.9755248 L10.748691,13.9755248 C10.5277771,13.9755248 10.348691,13.7964387 10.348691,13.5755248 C10.348691,13.4963603 10.3721814,13.4189759 10.416188,13.3531698 Z" id="路径-3" fill="url(#linearGradient-1)" transform="translate(12.916667, 12.916667) scale(-1, 1) translate(-12.916667, -12.916667) "></path>
17
- <circle id="椭圆形" fill="#FFFFFF" cx="10" cy="9.16666667" r="4.16666667"></circle>
18
- <path d="M10,10.4166667 L9.24792573,10.8120555 C9.0523879,10.9148558 8.81053703,10.8396772 8.70773671,10.6441394 C8.66680108,10.5662752 8.65267521,10.477088 8.66754595,10.3903849 L8.81117935,9.55293791 L8.81117935,9.55293791 L8.20273849,8.95985465 C8.04454506,8.80565416 8.04130814,8.55240886 8.19550862,8.39421542 C8.25691206,8.33122197 8.33736903,8.2902271 8.42442384,8.2775773 L9.26526843,8.15539542 L9.26526843,8.15539542 L9.64130557,7.39346097 C9.73907449,7.1953595 9.97892482,7.1140239 10.1770263,7.21179282 C10.2559113,7.25072492 10.3197623,7.31457592 10.3586944,7.39346097 L10.7347316,8.15539542 L10.7347316,8.15539542 L11.5755762,8.2775773 C11.7941941,8.30934434 11.9456667,8.51232148 11.9138996,8.73093943 C11.9012498,8.81799424 11.860255,8.8984512 11.7972615,8.95985465 L11.1888206,9.55293791 L11.1888206,9.55293791 L11.332454,10.3903849 C11.3697985,10.6081195 11.2235633,10.8149019 11.0058287,10.8522463 C10.9191257,10.867117 10.8299385,10.8529911 10.7520743,10.8120555 L10,10.4166667 L10,10.4166667 Z" id="星形" fill="#F05E5E"></path>
19
- </g>
20
- </g>
21
- </g>
22
- </g>
23
- </svg>