@titaui/pc 1.13.1 → 1.13.2-beta.1
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/checkbox-list/index.css +18 -0
- package/lib/components/checkbox-list/index.js +66 -0
- package/lib/components/dialog-qq-docs/index.css +90 -0
- package/lib/components/dialog-qq-docs/index.js +488 -0
- package/lib/components/dialog-qq-docs/request-apis.js +16 -0
- package/lib/components/dialog-qq-docs/utils.js +76 -0
- package/lib/components/dialog-select/index.css +9 -0
- package/lib/components/dialog-select/index.js +48 -0
- package/lib/components/dialog-upload-type/assets/folder.svg +20 -0
- package/lib/components/dialog-upload-type/assets/qq-docs.svg +20 -0
- package/lib/components/dialog-upload-type/components/upload-type-item/index.css +14 -0
- package/lib/components/dialog-upload-type/components/upload-type-item/index.js +36 -0
- package/lib/components/dialog-upload-type/index.css +7 -0
- package/lib/components/dialog-upload-type/index.js +75 -0
- package/lib/components/file-list/components/single-file/index.js +3 -1
- package/lib/components/file-list/index.js +2 -1
- package/lib/components/file-preview/index.css +37 -0
- package/lib/components/file-preview/index.js +68 -0
- package/lib/components/loading/assets/loading.gif +0 -0
- package/lib/components/loading/index.css +23 -0
- package/lib/components/loading/index.js +30 -0
- package/lib/components/nav/index.css +23 -0
- package/lib/components/nav/index.js +31 -0
- package/lib/components/nav-top/components/app-center/index.css +1 -1
- package/lib/components/nav-top/components/menu/index.js +15 -15
- package/lib/components/nav-top/index.js +19 -4
- package/lib/components/scroll-container/index.js +27 -6
- package/lib/components/search-input/index.js +3 -0
- package/lib/components/upload/index.js +260 -456
- package/lib/components/upload/upload.js +555 -0
- package/lib/utils/tools.js +11 -1
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
45
45
|
|
|
46
46
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
47
|
|
|
48
|
-
var prefix =
|
|
48
|
+
var prefix = "titaui-nav-top-menu";
|
|
49
49
|
var popupAlign = {
|
|
50
50
|
offset: [0, 5],
|
|
51
51
|
overflow: {
|
|
@@ -54,7 +54,7 @@ var popupAlign = {
|
|
|
54
54
|
},
|
|
55
55
|
targetOffset: [0, 0]
|
|
56
56
|
};
|
|
57
|
-
var NEWMENUS =
|
|
57
|
+
var NEWMENUS = "#summary/my";
|
|
58
58
|
|
|
59
59
|
var Menu = function Menu(_ref) {
|
|
60
60
|
var menus = _ref.menus,
|
|
@@ -75,7 +75,7 @@ var Menu = function Menu(_ref) {
|
|
|
75
75
|
feedNum = _useGlobalValue2[0];
|
|
76
76
|
|
|
77
77
|
var containerRef = (0, _react.useRef)();
|
|
78
|
-
var apiPath = (0, _bsGlobal.getBSGlobal)(
|
|
78
|
+
var apiPath = (0, _bsGlobal.getBSGlobal)("apiPath");
|
|
79
79
|
var userId = (0, _bsGlobal.getUserInfo)().Id;
|
|
80
80
|
|
|
81
81
|
var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
|
|
@@ -84,14 +84,14 @@ var Menu = function Menu(_ref) {
|
|
|
84
84
|
|
|
85
85
|
var handleTracker = function handleTracker(menu) {
|
|
86
86
|
if (window.titaTracker) {
|
|
87
|
-
window.titaTracker(
|
|
87
|
+
window.titaTracker("action").record({
|
|
88
88
|
actionName: "\u5BFC\u822A\u83DC\u5355__".concat(menu.title),
|
|
89
|
-
actionGroup:
|
|
90
|
-
productName:
|
|
89
|
+
actionGroup: "导航菜单",
|
|
90
|
+
productName: "导航菜单"
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
if (menu.code ===
|
|
94
|
+
if (menu.code === "dynamic" && feedNum > 0) {
|
|
95
95
|
window.location.reload();
|
|
96
96
|
}
|
|
97
97
|
};
|
|
@@ -114,7 +114,7 @@ var Menu = function Menu(_ref) {
|
|
|
114
114
|
var renderRawItem = function renderRawItem(menu) {
|
|
115
115
|
var href = menu.href;
|
|
116
116
|
|
|
117
|
-
if (menu.title ===
|
|
117
|
+
if (menu.title === "Learning" || menu.code === "learning") {
|
|
118
118
|
href = "".concat(apiPath, "/").concat(href);
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -138,7 +138,7 @@ var Menu = function Menu(_ref) {
|
|
|
138
138
|
// }}
|
|
139
139
|
// onClickClose={handleClickClose}
|
|
140
140
|
// >
|
|
141
|
-
_react["default"].createElement(
|
|
141
|
+
_react["default"].createElement("a", {
|
|
142
142
|
className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId === menu.id)),
|
|
143
143
|
href: href,
|
|
144
144
|
target: "_self",
|
|
@@ -149,7 +149,7 @@ var Menu = function Menu(_ref) {
|
|
|
149
149
|
src: _new["default"],
|
|
150
150
|
alt: "",
|
|
151
151
|
className: "".concat(prefix, "__tips-new")
|
|
152
|
-
}))
|
|
152
|
+
})) // </GuideTip>
|
|
153
153
|
, menu.href !== NEWMENUS && /*#__PURE__*/_react["default"].createElement("a", {
|
|
154
154
|
className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId === menu.id)),
|
|
155
155
|
href: href,
|
|
@@ -157,9 +157,9 @@ var Menu = function Menu(_ref) {
|
|
|
157
157
|
onClick: function onClick() {
|
|
158
158
|
return handleTracker(menu);
|
|
159
159
|
}
|
|
160
|
-
}, menu.title, menu.href ===
|
|
161
|
-
className: (0, _classnames["default"])("".concat(prefix, "__menu--hasNum"), _defineProperty({}, "".concat(prefix, "__menu--hasNum-active"), activeMenuId === menu.id && menu.href ===
|
|
162
|
-
}, feedNum > 100 ?
|
|
160
|
+
}, menu.title, menu.href === "#dynamic" && feedNum > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
161
|
+
className: (0, _classnames["default"])("".concat(prefix, "__menu--hasNum"), _defineProperty({}, "".concat(prefix, "__menu--hasNum-active"), activeMenuId === menu.id && menu.href === "#dynamic"))
|
|
162
|
+
}, feedNum > 100 ? "99+" : feedNum))));
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
var renderRest = function renderRest(items) {
|
|
@@ -173,7 +173,7 @@ var Menu = function Menu(_ref) {
|
|
|
173
173
|
}, items.map(function (menu) {
|
|
174
174
|
var href = menu.href;
|
|
175
175
|
|
|
176
|
-
if (menu.title ===
|
|
176
|
+
if (menu.title === "Learning" || menu.code === "learning") {
|
|
177
177
|
href = "".concat(apiPath, "/").concat(href);
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -194,7 +194,7 @@ var Menu = function Menu(_ref) {
|
|
|
194
194
|
popupPlacement: "bottomLeft",
|
|
195
195
|
popupAlign: popupAlign
|
|
196
196
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
197
|
-
className: (0, _classnames["default"])(
|
|
197
|
+
className: (0, _classnames["default"])("tu-icon-diot", "".concat(prefix, "__more-icon"), _defineProperty({}, "".concat(prefix, "__more-icon--active"), isActiveHideMeun))
|
|
198
198
|
}));
|
|
199
199
|
};
|
|
200
200
|
|
|
@@ -91,8 +91,13 @@ var NavTop = function NavTop() {
|
|
|
91
91
|
|
|
92
92
|
var _useState7 = (0, _react.useState)(false),
|
|
93
93
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
appCenterPosition = _useState8[0],
|
|
95
|
+
setAppCenterPosition = _useState8[1];
|
|
96
|
+
|
|
97
|
+
var _useState9 = (0, _react.useState)(false),
|
|
98
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
99
|
+
summaryGuideVisible = _useState10[0],
|
|
100
|
+
setSummaryGuideVisible = _useState10[1];
|
|
96
101
|
|
|
97
102
|
var ua = navigator.userAgent.toLowerCase();
|
|
98
103
|
var showWxInvite = (0, _bsGlobal.getTenantInfo)().mainCorpId && ua.indexOf("micromessenger") !== -1;
|
|
@@ -159,7 +164,17 @@ var NavTop = function NavTop() {
|
|
|
159
164
|
} else {
|
|
160
165
|
setSummaryGuideVisible(true);
|
|
161
166
|
}
|
|
162
|
-
}, []);
|
|
167
|
+
}, []); // 为了处理应用中心收起时 还没收起时 层级就消失了
|
|
168
|
+
|
|
169
|
+
(0, _react.useEffect)(function () {
|
|
170
|
+
if (appCenterVisible) {
|
|
171
|
+
setAppCenterPosition(true);
|
|
172
|
+
} else {
|
|
173
|
+
setTimeout(function () {
|
|
174
|
+
setAppCenterPosition(false);
|
|
175
|
+
}, 500);
|
|
176
|
+
}
|
|
177
|
+
}, [appCenterVisible]);
|
|
163
178
|
|
|
164
179
|
var handleCloseSummaryGuide = function handleCloseSummaryGuide() {
|
|
165
180
|
setSummaryGuideVisible(false);
|
|
@@ -172,7 +187,7 @@ var NavTop = function NavTop() {
|
|
|
172
187
|
};
|
|
173
188
|
|
|
174
189
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
175
|
-
className: (0, _classnames["default"])(preCls, _defineProperty({}, "".concat(preCls, "--position"),
|
|
190
|
+
className: (0, _classnames["default"])(preCls, _defineProperty({}, "".concat(preCls, "--position"), appCenterPosition), _defineProperty({}, "".concat(preCls, "-no-shadow"), appCenterVisible))
|
|
176
191
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
177
192
|
className: "".concat(preCls, "__left"),
|
|
178
193
|
href: "#dynamic"
|
|
@@ -23,6 +23,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
23
|
|
|
24
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
25
|
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
26
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
33
|
|
|
28
34
|
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); } }
|
|
@@ -59,15 +65,24 @@ var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
59
65
|
|
|
60
66
|
_this = _super.call(this, props);
|
|
61
67
|
|
|
62
|
-
_this.onEndScroll = function () {
|
|
68
|
+
_this.onEndScroll = function (e) {
|
|
69
|
+
var _e$target = e.target,
|
|
70
|
+
clientHeight = _e$target.clientHeight,
|
|
71
|
+
scrollHeight = _e$target.scrollHeight,
|
|
72
|
+
scrollTop = _e$target.scrollTop;
|
|
73
|
+
if (clientHeight + scrollTop === scrollHeight) _this.props.onScrollBottom(e);
|
|
63
74
|
_this.scrolling = false;
|
|
64
75
|
|
|
65
76
|
if (!_this.pressed && _this.started) {
|
|
66
|
-
_this.processEnd();
|
|
77
|
+
_this.processEnd(e);
|
|
67
78
|
}
|
|
68
79
|
};
|
|
69
80
|
|
|
70
81
|
_this.onScroll = function (e) {
|
|
82
|
+
var _e$target2 = e.target,
|
|
83
|
+
clientHeight = _e$target2.clientHeight,
|
|
84
|
+
scrollHeight = _e$target2.scrollHeight,
|
|
85
|
+
scrollTop = _e$target2.scrollTop;
|
|
71
86
|
var container = _this.container.current; // Ignore the internal scrolls
|
|
72
87
|
|
|
73
88
|
if (container.scrollLeft !== _this.scrollLeft || container.scrollTop !== _this.scrollTop) {
|
|
@@ -75,7 +90,13 @@ var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
75
90
|
|
|
76
91
|
_this.processScroll(e);
|
|
77
92
|
|
|
78
|
-
_this.onEndScroll(
|
|
93
|
+
_this.onEndScroll({
|
|
94
|
+
target: {
|
|
95
|
+
clientHeight: clientHeight,
|
|
96
|
+
scrollHeight: scrollHeight,
|
|
97
|
+
scrollTop: scrollTop
|
|
98
|
+
}
|
|
99
|
+
});
|
|
79
100
|
}
|
|
80
101
|
};
|
|
81
102
|
|
|
@@ -351,14 +372,14 @@ var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
351
372
|
}
|
|
352
373
|
}, {
|
|
353
374
|
key: "processEnd",
|
|
354
|
-
value: function processEnd() {
|
|
375
|
+
value: function processEnd(e) {
|
|
355
376
|
var onEndScroll = this.props.onEndScroll;
|
|
356
377
|
var container = this.container.current;
|
|
357
378
|
|
|
358
379
|
if (container && onEndScroll) {
|
|
359
|
-
onEndScroll({
|
|
380
|
+
onEndScroll(_objectSpread(_objectSpread({}, e), {}, {
|
|
360
381
|
external: !this.internal
|
|
361
|
-
});
|
|
382
|
+
}));
|
|
362
383
|
}
|
|
363
384
|
|
|
364
385
|
this.pressed = false;
|
|
@@ -58,6 +58,9 @@ function _default(props) {
|
|
|
58
58
|
height: 30
|
|
59
59
|
}, props.style);
|
|
60
60
|
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
62
|
+
setValue(props.value);
|
|
63
|
+
}, [props.value]);
|
|
61
64
|
var inputClassName = focus ? "search-input-focus" : "";
|
|
62
65
|
var iconClassName = focus ? "search-input-icon-focus" : "";
|
|
63
66
|
var clearIconStyle = {
|