@dckj-npm/dc-material 0.1.145 → 0.1.147
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/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +2 -2
- package/dist/BizComps.js.map +1 -1
- package/es/assets/icon/grid-nav/right.png +0 -0
- package/es/assets/icon/position/img.png +0 -0
- package/es/assets/icon/position/location.png +0 -0
- package/es/assets/icon/search/delete.png +0 -0
- package/es/assets/icon/search/search.png +0 -0
- package/es/assets/icon/teletext-list/arr.png +0 -0
- package/es/components/form/form-item.js +79 -0
- package/es/components/form/form-item.scss +20 -0
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +2 -2
- package/es/components/goods-card-list/goods-card-list-common.js +0 -60
- package/es/components/goods-card-list/goods-card-list-common.scss +0 -118
- package/es/components/goods-card-list/goods-card-list.js +0 -156
- package/es/components/goods-card-list/goods-card-list.scss +0 -112
- package/es/components/goods-card-list/index.js +0 -3
- package/es/components/goods-card-list/types.js +0 -1
- package/es/components/grid-nav/grid-nav.js +0 -91
- package/es/components/grid-nav/index.js +0 -2
- package/es/components/grid-nav/index.scss +0 -41
- package/es/components/integral-task/index.js +0 -5
- package/es/components/integral-task/index.scss +0 -35
- package/es/components/integral-task/integral-task.js +0 -54
- package/es/components/menu-list/index.js +0 -6
- package/es/components/menu-list/index.scss +0 -16
- package/es/components/menu-list/menu-list-item.js +0 -32
- package/es/components/menu-list/menu-list-item.scss +0 -49
- package/es/components/menu-list/menu-list.js +0 -25
- package/es/components/menu-list/types.js +0 -1
- package/es/components/message-list/index.js +0 -6
- package/es/components/message-list/index.scss +0 -22
- package/es/components/message-list/message-list-item.js +0 -41
- package/es/components/message-list/message-list-item.scss +0 -60
- package/es/components/message-list/message-list.js +0 -53
- package/es/components/notice-bar/components/ScrollSwitcher.js +0 -45
- package/es/components/notice-bar/components/ScrollSwitcher.scss +0 -17
- package/es/components/notice-bar/index.js +0 -2
- package/es/components/notice-bar/index.scss +0 -42
- package/es/components/notice-bar/notice-bar-item.js +0 -29
- package/es/components/notice-bar/notice-bar-item.scss +0 -26
- package/es/components/notice-bar/notice-bar.js +0 -83
- package/es/components/position/entity.js +0 -1
- package/es/components/position/index.js +0 -2
- package/es/components/position/index.scss +0 -27
- package/es/components/position/position-left.js +0 -28
- package/es/components/position/position-list.js +0 -30
- package/es/components/position/position.js +0 -48
- package/es/components/radio-group/index.js +0 -7
- package/es/components/radio-group/index.scss +0 -40
- package/es/components/radio-group/radio-group-item.js +0 -74
- package/es/components/radio-group/radio-group.js +0 -80
- package/es/components/rich-text/index.js +0 -6
- package/es/components/rich-text/index.scss +0 -19
- package/es/components/rich-text/rich-text.js +0 -37
- package/es/components/search-bar/index.js +0 -2
- package/es/components/search-bar/index.scss +0 -13
- package/es/components/search-bar/search-bar.js +0 -33
- package/es/components/swiper/index.js +0 -2
- package/es/components/swiper/index.scss +0 -12
- package/es/components/swiper/swiper.js +0 -34
- package/es/components/tab/index.js +0 -5
- package/es/components/tab/index.scss +0 -39
- package/es/components/tab/tab.js +0 -50
- package/es/components/tab-container/index.js +0 -2
- package/es/components/tab-container/index.scss +0 -48
- package/es/components/tab-container/tab-container.js +0 -26
- package/es/components/tab-container-item/index.js +0 -2
- package/es/components/tab-container-item/index.scss +0 -0
- package/es/components/tab-container-item/tab-container-item.js +0 -19
- package/es/components/tag/index.js +0 -5
- package/es/components/tag/index.scss +0 -24
- package/es/components/tag/tag.js +0 -14
- package/es/components/teletext-list/index.js +0 -6
- package/es/components/teletext-list/index.scss +0 -19
- package/es/components/teletext-list/teletext-list-item.js +0 -61
- package/es/components/teletext-list/teletext-list-item.scss +0 -55
- package/es/components/teletext-list/teletext-list.js +0 -38
- package/es/components/title/index.js +0 -7
- package/es/components/title/title-1.js +0 -16
- package/es/components/title/title-1.scss +0 -25
- package/es/components/title/title-2.js +0 -31
- package/es/components/title/title-2.scss +0 -22
- package/es/index.js +0 -78
- package/es/index.scss +0 -6
- package/es/style.js +0 -5
- package/es/utils/children-node-handle.js +0 -25
- package/es/utils/component-wrapper.js +0 -38
- package/es/utils/debounce.js +0 -14
- package/es/utils/time-util.js +0 -18
- package/es/variables.js +0 -2
- package/es/variables.scss +0 -3
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
var ExampleComponent = function ExampleComponent(props, ref) {
|
|
5
|
-
var columns = props.columns,
|
|
6
|
-
_props$iconSize = props.iconSize,
|
|
7
|
-
iconSize = _props$iconSize === void 0 ? 'medium' : _props$iconSize,
|
|
8
|
-
_props$fontWeight = props.fontWeight,
|
|
9
|
-
fontWeight = _props$fontWeight === void 0 ? 'normal' : _props$fontWeight,
|
|
10
|
-
_props$fontSize = props.fontSize,
|
|
11
|
-
fontSize = _props$fontSize === void 0 ? 12 : _props$fontSize,
|
|
12
|
-
_props$fontColor = props.fontColor,
|
|
13
|
-
fontColor = _props$fontColor === void 0 ? '#222' : _props$fontColor,
|
|
14
|
-
_props$lineHeight = props.lineHeight,
|
|
15
|
-
lineHeight = _props$lineHeight === void 0 ? 'auto' : _props$lineHeight,
|
|
16
|
-
_props$lineNum = props.lineNum,
|
|
17
|
-
lineNum = _props$lineNum === void 0 ? 1 : _props$lineNum,
|
|
18
|
-
dataSourceSetting = props.dataSourceSetting;
|
|
19
|
-
console.log('dataSourceSetting的值为', dataSourceSetting);
|
|
20
|
-
|
|
21
|
-
// 设置图标尺寸
|
|
22
|
-
var iconStyle = {};
|
|
23
|
-
switch (iconSize) {
|
|
24
|
-
case 'large':
|
|
25
|
-
iconStyle = {
|
|
26
|
-
width: '64px',
|
|
27
|
-
height: '64px'
|
|
28
|
-
};
|
|
29
|
-
break;
|
|
30
|
-
case 'medium':
|
|
31
|
-
iconStyle = {
|
|
32
|
-
width: '48px',
|
|
33
|
-
height: '48px'
|
|
34
|
-
};
|
|
35
|
-
break;
|
|
36
|
-
case 'small':
|
|
37
|
-
iconStyle = {
|
|
38
|
-
width: '32px',
|
|
39
|
-
height: '32px'
|
|
40
|
-
};
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
iconStyle = {
|
|
44
|
-
width: '48px',
|
|
45
|
-
height: '48px'
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 设置字重
|
|
50
|
-
var fontStyle = {
|
|
51
|
-
fontWeight: fontWeight,
|
|
52
|
-
fontSize: fontSize,
|
|
53
|
-
color: fontColor,
|
|
54
|
-
lineHeight: lineHeight
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// 设置行数
|
|
58
|
-
var fontLineStyle = {};
|
|
59
|
-
fontLineStyle = {
|
|
60
|
-
maxWidth: '80px',
|
|
61
|
-
overflow: 'hidden',
|
|
62
|
-
// whiteSpace: lineNum === 1 ? 'nowrap' : 'none',
|
|
63
|
-
textOverflow: 'ellipsis',
|
|
64
|
-
display: '-webkit-box',
|
|
65
|
-
WebkitLineClamp: lineNum,
|
|
66
|
-
WebkitBoxOrient: 'vertical'
|
|
67
|
-
};
|
|
68
|
-
var fontAllStyle = _extends({}, fontStyle, fontLineStyle);
|
|
69
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
ref: ref,
|
|
71
|
-
className: "grid-navigation",
|
|
72
|
-
style: {
|
|
73
|
-
gridTemplateColumns: "repeat(" + columns + ", 1fr)"
|
|
74
|
-
}
|
|
75
|
-
}, dataSourceSetting.map(function (item, index) {
|
|
76
|
-
return item ? /*#__PURE__*/React.createElement("a", {
|
|
77
|
-
key: index,
|
|
78
|
-
href: item.link || '#',
|
|
79
|
-
className: "grid-item"
|
|
80
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
81
|
-
src: item.icon || 'https://qcloudimg.tencent-cloud.cn/raw/fe54a986a821473655ba20afe30a543a.png',
|
|
82
|
-
alt: item.title || '导航',
|
|
83
|
-
style: iconStyle
|
|
84
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
85
|
-
style: fontAllStyle
|
|
86
|
-
}, item.title || '无标题')) : null;
|
|
87
|
-
}));
|
|
88
|
-
};
|
|
89
|
-
var GridNav = /*#__PURE__*/forwardRef(ExampleComponent);
|
|
90
|
-
GridNav.displayName = 'GridNav';
|
|
91
|
-
export default GridNav;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/* write style here */
|
|
2
|
-
.grid-navigation {
|
|
3
|
-
//padding: 10px;
|
|
4
|
-
width: 100%;
|
|
5
|
-
display: grid;
|
|
6
|
-
grid-template-columns: repeat(4, 1fr);
|
|
7
|
-
//gap: 14px 38px; /* 宫格之间的间距 */
|
|
8
|
-
grid-row-gap: 14px;
|
|
9
|
-
margin: 0;
|
|
10
|
-
//padding: 0 18px
|
|
11
|
-
// grid-template-columns: repeat(60px, minmax(1fr));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.grid-item {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: center;
|
|
18
|
-
text-align: center;
|
|
19
|
-
text-decoration: none;
|
|
20
|
-
color: #333;
|
|
21
|
-
position: relative;
|
|
22
|
-
|
|
23
|
-
img {
|
|
24
|
-
width: 48px;
|
|
25
|
-
height: 51px;
|
|
26
|
-
margin-bottom: 3px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
span {
|
|
30
|
-
font-size: 13px;
|
|
31
|
-
color: #222222;
|
|
32
|
-
// overflow: hidden;
|
|
33
|
-
// text-overflow: ellipsis;
|
|
34
|
-
// white-space: nowrap;
|
|
35
|
-
// max-width: 60px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&:hover {
|
|
39
|
-
color: #007bff;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
.integral-task__container {
|
|
2
|
-
padding: 0 12px;
|
|
3
|
-
&__item {
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
align-items: center;
|
|
7
|
-
&__left {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
&__img {
|
|
11
|
-
width: 53px;
|
|
12
|
-
height: 53px;
|
|
13
|
-
margin-right: 9px;
|
|
14
|
-
}
|
|
15
|
-
&__content {
|
|
16
|
-
&__title {
|
|
17
|
-
font-size: 15px;
|
|
18
|
-
color: #333333;
|
|
19
|
-
}
|
|
20
|
-
&__integral {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
&--icon {
|
|
24
|
-
width: 15px;
|
|
25
|
-
height: 15px;
|
|
26
|
-
}
|
|
27
|
-
&--number {
|
|
28
|
-
font-size: 12px;
|
|
29
|
-
color: #EA6A3D;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["list", "icon", "images", "undoneLabel", "completeLabel", "children"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import "./index.scss";
|
|
6
|
-
import { convertChildren } from "../../utils/children-node-handle";
|
|
7
|
-
var Status = /*#__PURE__*/function (Status) {
|
|
8
|
-
Status[Status["undone"] = 0] = "undone";
|
|
9
|
-
Status[Status["complete"] = 1] = "complete";
|
|
10
|
-
return Status;
|
|
11
|
-
}(Status || {});
|
|
12
|
-
var IntegralTask = function IntegralTask(_ref) {
|
|
13
|
-
var list = _ref.list,
|
|
14
|
-
icon = _ref.icon,
|
|
15
|
-
images = _ref.images,
|
|
16
|
-
undoneLabel = _ref.undoneLabel,
|
|
17
|
-
completeLabel = _ref.completeLabel,
|
|
18
|
-
children = _ref.children,
|
|
19
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
|
-
console.log(images, 'images');
|
|
21
|
-
images = images || [];
|
|
22
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
23
|
-
className: "integral-task__container"
|
|
24
|
-
}, otherProps), list && list.length ? list.map(function (item, index) {
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: "integral-task__container__item"
|
|
27
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: "integral-task__container__item__left"
|
|
29
|
-
}, convertChildren(children, 'image-left', {
|
|
30
|
-
src: images[index % images.length],
|
|
31
|
-
className: 'integral-task__container__item__left__img'
|
|
32
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
className: "integral-task__container__item__left__content"
|
|
34
|
-
}, convertChildren(children, 'title', {
|
|
35
|
-
children: item.name,
|
|
36
|
-
className: 'integral-task__container__item__left__content__title'
|
|
37
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
38
|
-
className: "integral-task__container__item__left__content__integral"
|
|
39
|
-
}, icon ? convertChildren(children, 'image-icon', {
|
|
40
|
-
src: icon,
|
|
41
|
-
className: 'integral-task__container__item__left__content__integral--icon'
|
|
42
|
-
}) : '', convertChildren(children, 'integral', {
|
|
43
|
-
children: item.integral + ' 积分',
|
|
44
|
-
className: 'integral-task__container__item__left__content__integral--number'
|
|
45
|
-
})))), /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: "integral-task__container__item__right"
|
|
47
|
-
}, convertChildren(children, 'button2', {
|
|
48
|
-
children: item.integral + ' 积分',
|
|
49
|
-
name: item.status === Status.undone ? undoneLabel : completeLabel,
|
|
50
|
-
color: Status[item.status]
|
|
51
|
-
})));
|
|
52
|
-
}) : '暂无数据');
|
|
53
|
-
};
|
|
54
|
-
export default IntegralTask;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import "./menu-list-item.scss";
|
|
3
|
-
var MenuListItem = function MenuListItem(_ref) {
|
|
4
|
-
var _ref$title = _ref.title,
|
|
5
|
-
title = _ref$title === void 0 ? '菜单名称' : _ref$title,
|
|
6
|
-
_ref$iconUrl = _ref.iconUrl,
|
|
7
|
-
iconUrl = _ref$iconUrl === void 0 ? '' : _ref$iconUrl,
|
|
8
|
-
handleClick = _ref.handleClick;
|
|
9
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
className: "menu-list__panel__item",
|
|
11
|
-
onClick: handleClick
|
|
12
|
-
}, iconUrl ? /*#__PURE__*/React.createElement("div", {
|
|
13
|
-
className: "menu-list__panel__item_icon"
|
|
14
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
15
|
-
alt: "",
|
|
16
|
-
src: iconUrl
|
|
17
|
-
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
18
|
-
className: "menu-list__panel__item_title"
|
|
19
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: "menu-list__panel__item_right"
|
|
21
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
22
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
-
width: "32",
|
|
24
|
-
height: "32",
|
|
25
|
-
viewBox: "0 0 32 32"
|
|
26
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
27
|
-
fill: "currentColor",
|
|
28
|
-
d: "M22 16L12 26l-1.4-1.4l8.6-8.6l-8.6-8.6L12 6z"
|
|
29
|
-
}))));
|
|
30
|
-
};
|
|
31
|
-
MenuListItem.displayName = 'MenuListItem';
|
|
32
|
-
export default MenuListItem;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
@import '../../variables.scss';
|
|
2
|
-
|
|
3
|
-
.menu-list__panel__item {
|
|
4
|
-
display: flex;
|
|
5
|
-
gap: 7px;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
align-items: center;
|
|
8
|
-
height: 45px;
|
|
9
|
-
|
|
10
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
11
|
-
|
|
12
|
-
&:last-child {
|
|
13
|
-
border-bottom: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.menu-list__panel__item_icon {
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
|
|
21
|
-
& > img {
|
|
22
|
-
height: 15px;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.menu-list__panel__item_title {
|
|
27
|
-
font-size: 15px;
|
|
28
|
-
color: #666666;
|
|
29
|
-
font-weight: 500;
|
|
30
|
-
margin-right: auto;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.menu-list__panel__item_right {
|
|
34
|
-
height: 100%;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
|
|
38
|
-
& > svg {
|
|
39
|
-
height: 16px;
|
|
40
|
-
font-size: 12px;
|
|
41
|
-
color: #666666;
|
|
42
|
-
font-weight: 500;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["dataList"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import "./index.scss";
|
|
6
|
-
import MenuListItem from "./menu-list-item";
|
|
7
|
-
var MenuList = function MenuList(_ref) {
|
|
8
|
-
var dataList = _ref.dataList,
|
|
9
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
10
|
-
var _otherProps = otherProps || {};
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
12
|
-
className: "menu-list__panel"
|
|
13
|
-
}, _otherProps), /*#__PURE__*/React.createElement("div", {
|
|
14
|
-
className: "menu-list__panel__item-list"
|
|
15
|
-
}, dataList.map(function (item, index) {
|
|
16
|
-
return /*#__PURE__*/React.createElement(MenuListItem, {
|
|
17
|
-
key: index,
|
|
18
|
-
title: item.title,
|
|
19
|
-
iconUrl: item.iconUrl,
|
|
20
|
-
handleClick: item.handleClick
|
|
21
|
-
});
|
|
22
|
-
})));
|
|
23
|
-
};
|
|
24
|
-
MenuList.displayName = 'MenuList';
|
|
25
|
-
export default MenuList;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
@import '../../variables.scss';
|
|
2
|
-
|
|
3
|
-
.message-list__panel {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
margin: 0;
|
|
7
|
-
&__tab{
|
|
8
|
-
margin-bottom: 20px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&__item-list {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
gap: 10px;
|
|
15
|
-
div:last-child {
|
|
16
|
-
border-bottom: none;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["onClick", "title", "image", "gmtCreate", "children", "description", "isRead"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import "./message-list-item.scss";
|
|
6
|
-
import { convertChildren } from "../../utils/children-node-handle";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 数据
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
var MessageListItem = function MessageListItem(_ref) {
|
|
13
|
-
var _ref$onClick = _ref.onClick,
|
|
14
|
-
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
15
|
-
title = _ref.title,
|
|
16
|
-
image = _ref.image,
|
|
17
|
-
gmtCreate = _ref.gmtCreate,
|
|
18
|
-
children = _ref.children,
|
|
19
|
-
description = _ref.description,
|
|
20
|
-
isRead = _ref.isRead,
|
|
21
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
|
-
var _otherProps = otherProps || {};
|
|
23
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
24
|
-
className: "message-list__panel__item",
|
|
25
|
-
onClick: onClick
|
|
26
|
-
}, _otherProps), convertChildren(children, 'image', {
|
|
27
|
-
src: image
|
|
28
|
-
}), isRead ? null : /*#__PURE__*/React.createElement("span", {
|
|
29
|
-
className: "badge"
|
|
30
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: "message-list__panel__item__text"
|
|
32
|
-
}, convertChildren(children, 'title', {
|
|
33
|
-
children: [title]
|
|
34
|
-
}), convertChildren(children, 'gmtCreate', {
|
|
35
|
-
children: [gmtCreate]
|
|
36
|
-
}), convertChildren(children, 'content', {
|
|
37
|
-
children: [description]
|
|
38
|
-
})));
|
|
39
|
-
};
|
|
40
|
-
MessageListItem.displayName = 'TeletextListItem';
|
|
41
|
-
export default MessageListItem;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
@import '../../variables.scss';
|
|
2
|
-
|
|
3
|
-
.message-list__panel__item {
|
|
4
|
-
display: flex;
|
|
5
|
-
gap: 5px;
|
|
6
|
-
padding-bottom: 15px;
|
|
7
|
-
justify-content: flex-start;
|
|
8
|
-
border-bottom: 1px solid #eeeeee;
|
|
9
|
-
position: relative;
|
|
10
|
-
&_image {
|
|
11
|
-
width: 90px;
|
|
12
|
-
height: 71px;
|
|
13
|
-
border-radius: 5px;
|
|
14
|
-
flex: 0 0 auto;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
position: relative;
|
|
17
|
-
|
|
18
|
-
& > img {
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
object-fit: cover;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.badge {
|
|
25
|
-
display: inline-block;
|
|
26
|
-
width: 7px; // 根据需要设置的大小
|
|
27
|
-
height: 7px;
|
|
28
|
-
border-radius: 50%;
|
|
29
|
-
background-color: #F44341; // 红色背景
|
|
30
|
-
position: absolute; // 绝对定位
|
|
31
|
-
top: 5px; // 根据需要调整位置
|
|
32
|
-
left: 38px; // 根据需要调整位置
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&__text {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
gap: 3px;
|
|
39
|
-
padding-top: 4px;
|
|
40
|
-
|
|
41
|
-
&__title {
|
|
42
|
-
font-size: 15px;
|
|
43
|
-
font-weight: 600;
|
|
44
|
-
color: #000000;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&__description {
|
|
48
|
-
-webkit-line-clamp: 1;
|
|
49
|
-
overflow: hidden;
|
|
50
|
-
color: #686868;
|
|
51
|
-
-webkit-box-orient: vertical;
|
|
52
|
-
display: -webkit-box;
|
|
53
|
-
font-size: 12px;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["dataList", "handleDataList", "onClick", "children", "images"];
|
|
4
|
-
import React, { useEffect } from 'react';
|
|
5
|
-
import "./index.scss";
|
|
6
|
-
import { default as MessageListItem } from "./message-list-item";
|
|
7
|
-
import { convertChildren } from "../../utils/children-node-handle";
|
|
8
|
-
var MessageList = function MessageList(_ref) {
|
|
9
|
-
var dataList = _ref.dataList,
|
|
10
|
-
handleDataList = _ref.handleDataList,
|
|
11
|
-
_ref$onClick = _ref.onClick,
|
|
12
|
-
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
13
|
-
children = _ref.children,
|
|
14
|
-
images = _ref.images,
|
|
15
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
|
-
var _otherProps = otherProps || {};
|
|
17
|
-
var _React$useState = React.useState(dataList || []),
|
|
18
|
-
currentDataList = _React$useState[0],
|
|
19
|
-
setCurrentDataList = _React$useState[1];
|
|
20
|
-
var _React$useState2 = React.useState('all'),
|
|
21
|
-
currentKey = _React$useState2[0],
|
|
22
|
-
setCurrentKey = _React$useState2[1];
|
|
23
|
-
|
|
24
|
-
// 切换数据源
|
|
25
|
-
var handleClick = function handleClick(key) {
|
|
26
|
-
var newDataList = handleDataList(key);
|
|
27
|
-
setCurrentDataList(newDataList);
|
|
28
|
-
setCurrentKey(key);
|
|
29
|
-
};
|
|
30
|
-
images = images || [];
|
|
31
|
-
useEffect(function () {
|
|
32
|
-
setCurrentDataList(dataList || []);
|
|
33
|
-
}, [dataList]);
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
35
|
-
className: "message-list__panel"
|
|
36
|
-
}, _otherProps), /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: "message-list__panel__tab"
|
|
38
|
-
}, convertChildren(children, 'tabMessage', {
|
|
39
|
-
onClickHandle: handleClick
|
|
40
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: "message-list__panel__item-list"
|
|
42
|
-
}, currentDataList ? currentDataList.map(function (item, index) {
|
|
43
|
-
return /*#__PURE__*/React.createElement(MessageListItem, _extends({
|
|
44
|
-
key: index,
|
|
45
|
-
onClick: onClick,
|
|
46
|
-
children: children
|
|
47
|
-
}, item, {
|
|
48
|
-
image: images[index % images.length]
|
|
49
|
-
}));
|
|
50
|
-
}) : /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u6570\u636E")));
|
|
51
|
-
};
|
|
52
|
-
MessageList.displayName = 'MessageList';
|
|
53
|
-
export default MessageList;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import "./ScrollSwitcher.scss"; // 导入样式
|
|
3
|
-
|
|
4
|
-
var ScrollSwitcher = function ScrollSwitcher(_ref) {
|
|
5
|
-
var children = _ref.children,
|
|
6
|
-
_ref$height = _ref.height,
|
|
7
|
-
height = _ref$height === void 0 ? '20px' : _ref$height,
|
|
8
|
-
_ref$interval = _ref.interval,
|
|
9
|
-
interval = _ref$interval === void 0 ? 3000 : _ref$interval;
|
|
10
|
-
var _useState = useState(0),
|
|
11
|
-
currentIndex = _useState[0],
|
|
12
|
-
setCurrentIndex = _useState[1];
|
|
13
|
-
var childrenCount = React.Children.count(children);
|
|
14
|
-
useEffect(function () {
|
|
15
|
-
var timer = setInterval(function () {
|
|
16
|
-
setCurrentIndex(function (prevIndex) {
|
|
17
|
-
return (prevIndex + 1) % React.Children.count(children);
|
|
18
|
-
});
|
|
19
|
-
}, interval);
|
|
20
|
-
return function () {
|
|
21
|
-
return clearInterval(timer);
|
|
22
|
-
}; // 清理定时器
|
|
23
|
-
}, [children, interval]);
|
|
24
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
className: "scroll-switcher",
|
|
26
|
-
style: {
|
|
27
|
-
height: height
|
|
28
|
-
}
|
|
29
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "scroll-switcher-content",
|
|
31
|
-
style: {
|
|
32
|
-
transform: "translateY(-" + currentIndex * 100 + "%)",
|
|
33
|
-
transition: 'transform 0.5s ease'
|
|
34
|
-
}
|
|
35
|
-
}, React.Children.map(children, function (child, index) {
|
|
36
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: "scroll-item",
|
|
38
|
-
key: index
|
|
39
|
-
}, child);
|
|
40
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: "scroll-item",
|
|
42
|
-
key: childrenCount
|
|
43
|
-
}, children)));
|
|
44
|
-
};
|
|
45
|
-
export default ScrollSwitcher;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.scroll-switcher {
|
|
2
|
-
overflow: hidden; /* 隐藏溢出内容 */
|
|
3
|
-
position: relative; /* 使子元素绝对定位 */
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.scroll-switcher-content {
|
|
7
|
-
display: flex; /* 使用 flexbox 使子元素竖直排列 */
|
|
8
|
-
flex-direction: column; /* 子元素垂直排列 */
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.scroll-item {
|
|
12
|
-
height: 100%; /* 使每个子项占满容器的高度 */
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center; /* 垂直居中对齐 */
|
|
15
|
-
justify-content: center; /* 水平居中对齐 */
|
|
16
|
-
}
|
|
17
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
.notice-bar__panel {
|
|
2
|
-
width: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
height: 70px;
|
|
6
|
-
box-shadow: 0px 2px 6px 0px rgba(0,0,0,0.07);
|
|
7
|
-
margin: 0;
|
|
8
|
-
padding: 0 10px;
|
|
9
|
-
border-radius: 12px;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
.notice-bar__panel__item-img {
|
|
12
|
-
width: 46px;
|
|
13
|
-
margin-right: 7px;
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
.notice-bar__panel__item-list {
|
|
17
|
-
width: calc(100% - 53px);
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
align-items: start;
|
|
21
|
-
justify-content: start;
|
|
22
|
-
border-left: 1px solid #f1f1f1;
|
|
23
|
-
padding-left: 10px;
|
|
24
|
-
.notice-bar__panel-loop {
|
|
25
|
-
width: 100%;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
list-style: none;
|
|
28
|
-
text-align: center;
|
|
29
|
-
height: 20px;
|
|
30
|
-
color: #111111;
|
|
31
|
-
padding: 0;
|
|
32
|
-
.notice-bar__panel-loop__item {
|
|
33
|
-
text-align: left;
|
|
34
|
-
height: 20px;
|
|
35
|
-
}
|
|
36
|
-
.toUp {
|
|
37
|
-
margin-top: -25px; //向上移
|
|
38
|
-
transition: all 0.5s;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|