@titaui/pc 1.10.21 → 1.10.24
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/communication/index.css +7 -7
- package/lib/components/communication/style.js +1 -1
- package/lib/components/dynamic/constant.js +10 -1
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +24 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +1 -2
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/dynamic-share-course.png +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/jiantou-right@3x.png +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/user-photo.png +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.css +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.js +5 -4
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +9 -2
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +32 -2
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.css +11 -16
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +5 -1
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +55 -2
- package/lib/components/dynamic/dynamic-item/index.css +56 -1
- package/lib/components/dynamic/dynamic-item/index.js +12 -9
- package/lib/components/dynamic/img/dynamic-redenvelopes-hover.svg +1 -0
- package/lib/components/dynamic/img/dynamic-redenvelopes-normal.svg +1 -0
- package/lib/components/file-list/components/single-file/index.css +6 -5
- package/lib/components/file-list/index.css +1 -0
- package/lib/components/superset-charts/components/index.js +15 -15
- package/lib/components/superset-charts/init/index.js +30 -11
- package/lib/components/superset-charts/init/use-get-assets.js +17 -85
- package/lib/components/video-modal/components/video-box/index.css +240 -0
- package/lib/components/video-modal/components/video-box/index.js +334 -0
- package/lib/components/video-modal/img/bigFaqi.png +0 -0
- package/lib/components/video-modal/img/close.png +0 -0
- package/lib/components/video-modal/img/full.svg +21 -0
- package/lib/components/video-modal/img/muted.svg +14 -0
- package/lib/components/video-modal/img/not-muted.svg +22 -0
- package/lib/components/video-modal/img/pause.svg +13 -0
- package/lib/components/video-modal/img/play.svg +18 -0
- package/lib/components/video-modal/img/small.svg +22 -0
- package/lib/components/video-modal/index.css +83 -0
- package/lib/components/video-modal/index.js +182 -0
- package/lib/components/video-modal/utils.js +25 -0
- package/lib/index.js +9 -1
- package/package.json +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-share-content/index.js +0 -42
|
@@ -0,0 +1,182 @@
|
|
|
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 _dialog = _interopRequireDefault(require("../dialog"));
|
|
13
|
+
|
|
14
|
+
var _videoBox = _interopRequireDefault(require("./components/video-box"));
|
|
15
|
+
|
|
16
|
+
var _conditionRender = _interopRequireDefault(require("../condition-render"));
|
|
17
|
+
|
|
18
|
+
var _bsGlobal = require("../../utils/bs-global");
|
|
19
|
+
|
|
20
|
+
var _full = _interopRequireDefault(require("./img/full.svg"));
|
|
21
|
+
|
|
22
|
+
var _small = _interopRequireDefault(require("./img/small.svg"));
|
|
23
|
+
|
|
24
|
+
var _close = _interopRequireDefault(require("./img/close.png"));
|
|
25
|
+
|
|
26
|
+
require("./index.css");
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
+
|
|
36
|
+
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."); }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
+
|
|
46
|
+
var preCls = "titaui-pc-video-modal";
|
|
47
|
+
var userId = (0, _bsGlobal.getBSGlobal)("loginUserInfo").Id;
|
|
48
|
+
var VideoModal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
49
|
+
var videoSrc = props.videoSrc,
|
|
50
|
+
title = props.title,
|
|
51
|
+
videoPoster = props.videoPoster,
|
|
52
|
+
visible = props.visible,
|
|
53
|
+
onClose = props.onClose,
|
|
54
|
+
onOpen = props.onOpen,
|
|
55
|
+
_props$hasextraButton = props.hasextraButton,
|
|
56
|
+
hasextraButton = _props$hasextraButton === void 0 ? true : _props$hasextraButton;
|
|
57
|
+
|
|
58
|
+
var _useState = (0, _react.useState)(true),
|
|
59
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
+
smallVideoVisible = _useState2[0],
|
|
61
|
+
setSmallVideoVisible = _useState2[1];
|
|
62
|
+
|
|
63
|
+
var _useState3 = (0, _react.useState)("0"),
|
|
64
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
65
|
+
time = _useState4[0],
|
|
66
|
+
setTime = _useState4[1];
|
|
67
|
+
|
|
68
|
+
var modalVideoRef = (0, _react.useRef)(document.createElement("div"));
|
|
69
|
+
var smallVideoRef = (0, _react.useRef)(document.createElement("div")); // 关闭小窗口视频
|
|
70
|
+
|
|
71
|
+
var handleClickCloseSmallVideo = function handleClickCloseSmallVideo() {
|
|
72
|
+
setSmallVideoVisible(false); // @ts-ignore
|
|
73
|
+
|
|
74
|
+
smallVideoRef.current.closeVideo();
|
|
75
|
+
localStorage.setItem("hide_performance_small_video_".concat(userId), "true");
|
|
76
|
+
}; // 打开dialog弹层 关闭小窗口
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
var handleClickToFull = function handleClickToFull() {
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
setTime(smallVideoRef.current.getCurrentTime());
|
|
82
|
+
onOpen(); // @ts-ignore
|
|
83
|
+
|
|
84
|
+
smallVideoRef.current.closeVideo();
|
|
85
|
+
setSmallVideoVisible(false);
|
|
86
|
+
}; // 关闭dialog弹层 打开小窗口
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
var handleClickToSmall = function handleClickToSmall() {
|
|
90
|
+
onClose(); // @ts-ignore
|
|
91
|
+
|
|
92
|
+
setTime(modalVideoRef.current.getCurrentTime());
|
|
93
|
+
setSmallVideoVisible(true);
|
|
94
|
+
}; // 关闭过一次自动播放小窗口 之后不再出现
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
(0, _react.useEffect)(function () {
|
|
98
|
+
if (localStorage.getItem("hide_performance_small_video_".concat(userId)) === "true") {
|
|
99
|
+
setSmallVideoVisible(false); // @ts-ignore
|
|
100
|
+
|
|
101
|
+
smallVideoRef.current.closeVideo();
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
104
|
+
(0, _react.useEffect)(function () {
|
|
105
|
+
if (visible) {
|
|
106
|
+
setSmallVideoVisible(false);
|
|
107
|
+
}
|
|
108
|
+
}, [visible]); // *---提供给父组件调用(因为有时间的联动,视频默认从0开始需要手动调用此方法)---*
|
|
109
|
+
|
|
110
|
+
var handleSetDefaultTime = function handleSetDefaultTime() {
|
|
111
|
+
setTime("0");
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
115
|
+
return {
|
|
116
|
+
setDefaultTime: handleSetDefaultTime
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
(0, _react.useEffect)(function () {
|
|
120
|
+
if (!hasextraButton) {
|
|
121
|
+
setSmallVideoVisible(false);
|
|
122
|
+
}
|
|
123
|
+
}, []);
|
|
124
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
125
|
+
condition: !smallVideoVisible
|
|
126
|
+
}, /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
127
|
+
visible: visible,
|
|
128
|
+
title: title,
|
|
129
|
+
onClose: onClose,
|
|
130
|
+
style: {
|
|
131
|
+
width: "840px",
|
|
132
|
+
borderRadius: "24px"
|
|
133
|
+
},
|
|
134
|
+
noHeadLine: true,
|
|
135
|
+
noFooterLine: true,
|
|
136
|
+
noFooter: true,
|
|
137
|
+
destroyOnClose: true
|
|
138
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
|
+
className: "".concat(preCls, "__full")
|
|
140
|
+
}, /*#__PURE__*/_react["default"].createElement(_videoBox["default"], {
|
|
141
|
+
videoSrc: videoSrc,
|
|
142
|
+
containerWidth: 840,
|
|
143
|
+
ref: modalVideoRef,
|
|
144
|
+
extraButton: hasextraButton ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
+
className: "".concat(preCls, "__full-control"),
|
|
146
|
+
onClick: handleClickToSmall
|
|
147
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
148
|
+
src: _small["default"],
|
|
149
|
+
alt: "\u7F29\u5C0F"
|
|
150
|
+
})) : "",
|
|
151
|
+
videoPoster: videoPoster,
|
|
152
|
+
time: time
|
|
153
|
+
})))), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
154
|
+
condition: smallVideoVisible
|
|
155
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
|
+
className: "".concat(preCls, "__small")
|
|
157
|
+
}, /*#__PURE__*/_react["default"].createElement(_videoBox["default"], {
|
|
158
|
+
videoSrc: videoSrc,
|
|
159
|
+
containerWidth: 360,
|
|
160
|
+
hasHead: true,
|
|
161
|
+
title: title,
|
|
162
|
+
extraButton: /*#__PURE__*/_react["default"].createElement("div", {
|
|
163
|
+
className: "".concat(preCls, "__small-enlarge"),
|
|
164
|
+
onClick: handleClickToFull
|
|
165
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
166
|
+
src: _full["default"],
|
|
167
|
+
alt: "\u5168\u5C4F"
|
|
168
|
+
})),
|
|
169
|
+
videoPoster: videoPoster,
|
|
170
|
+
headButton: /*#__PURE__*/_react["default"].createElement("div", {
|
|
171
|
+
className: "".concat(preCls, "__small-close"),
|
|
172
|
+
onClick: handleClickCloseSmallVideo
|
|
173
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
174
|
+
src: _close["default"],
|
|
175
|
+
alt: "\u5173\u95ED"
|
|
176
|
+
})),
|
|
177
|
+
ref: smallVideoRef,
|
|
178
|
+
time: time
|
|
179
|
+
}))));
|
|
180
|
+
});
|
|
181
|
+
var _default = VideoModal;
|
|
182
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var formatSecToTime = function formatSecToTime(value) {
|
|
9
|
+
var result = parseInt(value, 10);
|
|
10
|
+
var m = Math.floor(result / 60 % 60) < 10 ? "0".concat(Math.floor(result / 60 % 60)) : Math.floor(result / 60 % 60);
|
|
11
|
+
var s = Math.floor(result % 60) < 10 ? "0".concat(Math.floor(result % 60)) : Math.floor(result % 60);
|
|
12
|
+
var res = "";
|
|
13
|
+
|
|
14
|
+
if (m !== "00") {
|
|
15
|
+
res += "".concat(m, ":");
|
|
16
|
+
} else {
|
|
17
|
+
res += "00:";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
res += "".concat(s);
|
|
21
|
+
return res;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var _default = formatSecToTime;
|
|
25
|
+
exports["default"] = _default;
|
package/lib/index.js
CHANGED
|
@@ -417,7 +417,7 @@ Object.defineProperty(exports, "StatusTime", {
|
|
|
417
417
|
return _statusTime["default"];
|
|
418
418
|
}
|
|
419
419
|
});
|
|
420
|
-
Object.defineProperty(exports, "
|
|
420
|
+
Object.defineProperty(exports, "SupersetCharts", {
|
|
421
421
|
enumerable: true,
|
|
422
422
|
get: function get() {
|
|
423
423
|
return _supersetCharts["default"];
|
|
@@ -507,6 +507,12 @@ Object.defineProperty(exports, "VersionChangeModal", {
|
|
|
507
507
|
return _versionChangeModal["default"];
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
|
+
Object.defineProperty(exports, "VideoModal", {
|
|
511
|
+
enumerable: true,
|
|
512
|
+
get: function get() {
|
|
513
|
+
return _videoModal["default"];
|
|
514
|
+
}
|
|
515
|
+
});
|
|
510
516
|
Object.defineProperty(exports, "WeeklyReport", {
|
|
511
517
|
enumerable: true,
|
|
512
518
|
get: function get() {
|
|
@@ -732,6 +738,8 @@ var _uploadPhotoModal = _interopRequireDefault(require("./components/upload-phot
|
|
|
732
738
|
|
|
733
739
|
var _bookDemo = _interopRequireDefault(require("./components/book-demo"));
|
|
734
740
|
|
|
741
|
+
var _videoModal = _interopRequireDefault(require("./components/video-modal"));
|
|
742
|
+
|
|
735
743
|
var _supersetCharts = _interopRequireDefault(require("./components/superset-charts"));
|
|
736
744
|
|
|
737
745
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
package/package.json
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
|
-
var _dynamicLeftQuoto = _interopRequireDefault(require("../../img/dynamic-left-quoto.svg"));
|
|
13
|
-
|
|
14
|
-
var _dynamicRightQuoto = _interopRequireDefault(require("../../img/dynamic-right-quoto.svg"));
|
|
15
|
-
|
|
16
|
-
var _dangerousHtml = _interopRequireDefault(require("../../components/dangerous-html"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
var DynamicShareContent = function DynamicShareContent(_ref) {
|
|
21
|
-
var prefix = _ref.prefix,
|
|
22
|
-
content = _ref.content,
|
|
23
|
-
contentRef = _ref.contentRef;
|
|
24
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
25
|
-
className: "".concat(prefix, "__content")
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
27
|
-
className: (0, _classnames["default"])("".concat(prefix, "__content-quoto"), "".concat(prefix, "__content-quoto--left")),
|
|
28
|
-
src: _dynamicLeftQuoto["default"],
|
|
29
|
-
alt: "left"
|
|
30
|
-
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
31
|
-
ref: contentRef
|
|
32
|
-
}, /*#__PURE__*/_react["default"].createElement(_dangerousHtml["default"], {
|
|
33
|
-
htmlText: content
|
|
34
|
-
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
35
|
-
className: (0, _classnames["default"])("".concat(prefix, "__content-quoto"), "".concat(prefix, "__content-quoto--right")),
|
|
36
|
-
src: _dynamicRightQuoto["default"],
|
|
37
|
-
alt: "right"
|
|
38
|
-
})));
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var _default = DynamicShareContent;
|
|
42
|
-
exports["default"] = _default;
|