@dckj-npm/dc-material 0.1.76 → 0.1.77
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/dist/BizComps.css +1 -1
- package/dist/BizComps.js +2 -2
- package/dist/BizComps.js.map +1 -1
- package/es/components/goods-card-list/goods-card-list-common.d.ts +5 -0
- package/es/components/goods-card-list/goods-card-list-common.js +60 -0
- package/es/components/goods-card-list/goods-card-list-common.scss +118 -0
- package/es/components/goods-card-list/index.d.ts +2 -1
- package/es/components/goods-card-list/index.js +2 -1
- package/es/components/grid-nav/index.scss +35 -31
- package/es/components/message-list/message-list-item.d.ts +4 -0
- package/es/components/message-list/message-list-item.js +4 -1
- package/es/components/message-list/message-list-item.scss +16 -6
- package/es/components/message-list/message-list.d.ts +4 -8
- package/es/components/message-list/message-list.js +9 -16
- package/es/components/notice-bar/notice-bar-item.scss +1 -1
- package/es/components/rich-text/index.d.ts +6 -0
- package/es/components/rich-text/index.js +6 -0
- package/es/components/rich-text/index.scss +19 -0
- package/es/components/rich-text/rich-text.d.ts +14 -0
- package/es/components/rich-text/rich-text.js +37 -0
- package/es/components/tab/index.scss +16 -0
- package/es/components/tab/tab.d.ts +4 -0
- package/es/components/tab/tab.js +6 -2
- package/es/components/tab-container-item/tab-container-item.d.ts +2 -0
- package/es/components/tab-container-item/tab-container-item.js +7 -2
- package/es/components/teletext-list/teletext-list-item.d.ts +2 -11
- package/es/components/teletext-list/teletext-list-item.js +11 -5
- package/es/components/teletext-list/teletext-list.d.ts +2 -11
- package/es/index.d.ts +3 -1
- package/es/index.js +5 -1
- package/lib/components/goods-card-list/goods-card-list-common.d.ts +5 -0
- package/lib/components/goods-card-list/goods-card-list-common.js +65 -0
- package/lib/components/goods-card-list/goods-card-list-common.scss +118 -0
- package/lib/components/goods-card-list/index.d.ts +2 -1
- package/lib/components/goods-card-list/index.js +3 -1
- package/lib/components/grid-nav/index.scss +35 -31
- package/lib/components/message-list/message-list-item.d.ts +4 -0
- package/lib/components/message-list/message-list-item.js +4 -1
- package/lib/components/message-list/message-list-item.scss +16 -6
- package/lib/components/message-list/message-list.d.ts +4 -8
- package/lib/components/message-list/message-list.js +9 -16
- package/lib/components/notice-bar/notice-bar-item.scss +1 -1
- package/lib/components/rich-text/index.d.ts +6 -0
- package/lib/components/rich-text/index.js +6 -0
- package/lib/components/rich-text/index.scss +19 -0
- package/lib/components/rich-text/rich-text.d.ts +14 -0
- package/lib/components/rich-text/rich-text.js +42 -0
- package/lib/components/tab/index.scss +16 -0
- package/lib/components/tab/tab.d.ts +4 -0
- package/lib/components/tab/tab.js +6 -2
- package/lib/components/tab-container-item/tab-container-item.d.ts +2 -0
- package/lib/components/tab-container-item/tab-container-item.js +7 -2
- package/lib/components/teletext-list/teletext-list-item.d.ts +2 -11
- package/lib/components/teletext-list/teletext-list-item.js +11 -5
- package/lib/components/teletext-list/teletext-list.d.ts +2 -11
- package/lib/index.d.ts +3 -1
- package/lib/index.js +6 -1
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +4 -4
- package/build/lowcode/assets-daily.json +0 -71
- package/build/lowcode/assets-dev.json +0 -71
- package/build/lowcode/assets-prod.json +0 -71
- package/build/lowcode/designer.html +0 -302
- package/build/lowcode/index.html +0 -304
- package/build/lowcode/index.js +0 -1
- package/build/lowcode/meta.design.js +0 -1
- package/build/lowcode/meta.js +0 -1
- package/build/lowcode/preview.css +0 -1
- package/build/lowcode/preview.html +0 -33
- package/build/lowcode/preview.js +0 -308
- package/build/lowcode/render/default/view.css +0 -1
- package/build/lowcode/render/default/view.js +0 -295
- package/build/lowcode/view.css +0 -1
- package/build/lowcode/view.js +0 -295
|
@@ -24,6 +24,12 @@ var TeletextListItem = function TeletextListItem(_ref) {
|
|
|
24
24
|
var resultImage = image && image.length > 0 ? image[0] : '';
|
|
25
25
|
var _otherProps = otherProps || {};
|
|
26
26
|
var tagColorArray = ['orange', 'green'];
|
|
27
|
+
var tagList = (typeof tags === 'string' ? tags.split(',') : []).map(function (tag) {
|
|
28
|
+
return {
|
|
29
|
+
name: tag
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
console.log('tagList', tagList, 'type of tags', typeof tags === 'string');
|
|
27
33
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
28
34
|
className: "teletext-list__panel__item",
|
|
29
35
|
onClick: onClick
|
|
@@ -40,11 +46,11 @@ var TeletextListItem = function TeletextListItem(_ref) {
|
|
|
40
46
|
className: 'teletext-list__panel__item__text__description'
|
|
41
47
|
}), tags ? /*#__PURE__*/React.createElement("div", {
|
|
42
48
|
className: "teletext-list__panel__item__text__tags"
|
|
43
|
-
},
|
|
44
|
-
return convertChildren(children,
|
|
45
|
-
name: tag.name
|
|
46
|
-
key: tagIndex,
|
|
47
|
-
color: tagColorArray[tagIndex % tagColorArray.length]
|
|
49
|
+
}, tagList.map(function (tag, tagIndex) {
|
|
50
|
+
return convertChildren(children, "teletext-tagc-" + (tagIndex % tagColorArray.length + 1), {
|
|
51
|
+
name: tag.name
|
|
52
|
+
// key: tagIndex,
|
|
53
|
+
// color: tagColorArray[tagIndex % tagColorArray.length],
|
|
48
54
|
});
|
|
49
55
|
})) : null), resultImage && imagePlacement === 'right' ? convertChildren(children, 'image', {
|
|
50
56
|
src: resultImage,
|
|
@@ -19,16 +19,7 @@ interface DataProps {
|
|
|
19
19
|
/**
|
|
20
20
|
* 标签列表
|
|
21
21
|
*/
|
|
22
|
-
tags?:
|
|
23
|
-
/**
|
|
24
|
-
* 标签名称
|
|
25
|
-
*/
|
|
26
|
-
name: string;
|
|
27
|
-
/**
|
|
28
|
-
* 标签颜色
|
|
29
|
-
*/
|
|
30
|
-
color: string;
|
|
31
|
-
}[] | string;
|
|
22
|
+
tags?: string;
|
|
32
23
|
/**
|
|
33
24
|
* 链接地址
|
|
34
25
|
*/
|
|
@@ -55,7 +46,7 @@ export interface TeletextListProps {
|
|
|
55
46
|
/**
|
|
56
47
|
* 图片位置
|
|
57
48
|
*/
|
|
58
|
-
imagePlacement?:
|
|
49
|
+
imagePlacement?: 'left' | 'right' | 'none';
|
|
59
50
|
}
|
|
60
51
|
declare const TeletextList: React.FC<TeletextListProps>;
|
|
61
52
|
export default TeletextList;
|
package/es/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export { default as Button2 } from './components/button';
|
|
|
35
35
|
export type { RadioGroupProps, RadioGroupItemProps } from './components/radio-group';
|
|
36
36
|
export { CustomRadioGroup, CustomRadioGroupItem } from './components/radio-group';
|
|
37
37
|
export type { GoodsCardListProps } from './components/goods-card-list';
|
|
38
|
-
export { GoodsCardList } from './components/goods-card-list';
|
|
38
|
+
export { GoodsCardList, GoodsCardListCommon } from './components/goods-card-list';
|
|
39
|
+
export type { RichTextProps } from './components/rich-text';
|
|
40
|
+
export { RichText } from './components/rich-text';
|
|
39
41
|
declare const bizCssPrefix = "bizpack";
|
|
40
42
|
export { bizCssPrefix };
|
package/es/index.js
CHANGED
|
@@ -69,6 +69,10 @@ export { CustomRadioGroup, CustomRadioGroupItem } from "./components/radio-group
|
|
|
69
69
|
|
|
70
70
|
// 商品卡片列表
|
|
71
71
|
|
|
72
|
-
export { GoodsCardList } from "./components/goods-card-list";
|
|
72
|
+
export { GoodsCardList, GoodsCardListCommon } from "./components/goods-card-list";
|
|
73
|
+
|
|
74
|
+
// 富文本
|
|
75
|
+
|
|
76
|
+
export { RichText } from "./components/rich-text";
|
|
73
77
|
var bizCssPrefix = 'bizpack';
|
|
74
78
|
export { bizCssPrefix };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _carousel = _interopRequireDefault(require("../carousel/carousel"));
|
|
10
|
+
require("./goods-card-list-common.scss");
|
|
11
|
+
var _excluded = ["dataList", "maxSales", "onClick"];
|
|
12
|
+
var GoodsCardListCommon = function GoodsCardListCommon(_ref) {
|
|
13
|
+
var _ref$dataList = _ref.dataList,
|
|
14
|
+
dataList = _ref$dataList === void 0 ? [] : _ref$dataList,
|
|
15
|
+
_ref$maxSales = _ref.maxSales,
|
|
16
|
+
maxSales = _ref$maxSales === void 0 ? 1000 : _ref$maxSales,
|
|
17
|
+
_ref$onClick = _ref.onClick,
|
|
18
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
19
|
+
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
20
|
+
var _otherProps = otherProps || {};
|
|
21
|
+
var resolveResultDesc = function resolveResultDesc(desc) {
|
|
22
|
+
var htmlString = "<div>" + desc + "</div>";
|
|
23
|
+
// 创建一个虚拟的 DOM 容器
|
|
24
|
+
var tempDiv = document.createElement('div');
|
|
25
|
+
tempDiv.innerHTML = htmlString;
|
|
26
|
+
// 提取文本
|
|
27
|
+
return tempDiv.textContent || tempDiv.innerText;
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
30
|
+
className: "card-list-goods-common__container"
|
|
31
|
+
}, _otherProps), dataList.map(function (item) {
|
|
32
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
33
|
+
key: item.key,
|
|
34
|
+
className: "card-list-goods__item",
|
|
35
|
+
onClick: function onClick() {
|
|
36
|
+
return _onClick(item);
|
|
37
|
+
}
|
|
38
|
+
}, item.imageList && item.imageList.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
|
+
className: "card-list-goods__image"
|
|
40
|
+
}, /*#__PURE__*/_react["default"].createElement(_carousel["default"], {
|
|
41
|
+
images: item.imageList,
|
|
42
|
+
interval: 3000
|
|
43
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
44
|
+
className: "card-list-goods__content"
|
|
45
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
46
|
+
className: "card-list-goods__title"
|
|
47
|
+
}, item.title), /*#__PURE__*/_react["default"].createElement("div", {
|
|
48
|
+
className: "card-list-goods__desc"
|
|
49
|
+
}, resolveResultDesc(item.desc)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
|
+
className: "card-list-goods__bottom"
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
+
className: "card-list-goods__unit"
|
|
53
|
+
}, "\uFFE5"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
54
|
+
className: "card-list-goods__price"
|
|
55
|
+
}, item.activePrice || item.price), item.activePrice && /*#__PURE__*/_react["default"].createElement("div", {
|
|
56
|
+
className: "card-list-goods__unit__delete"
|
|
57
|
+
}, "\uFFE5"), item.activePrice && /*#__PURE__*/_react["default"].createElement("div", {
|
|
58
|
+
className: "card-list-goods__price__delete"
|
|
59
|
+
}, item.price), /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
|
+
className: "card-list-goods__sales"
|
|
61
|
+
}, "\u5DF2\u552E", item.sales > maxSales ? maxSales + "+" : item.sales))));
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
GoodsCardListCommon.displayName = 'GoodsCardListCommon';
|
|
65
|
+
var _default = exports["default"] = GoodsCardListCommon;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.card-list-goods-common__container {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns:repeat(2, minmax(0, 1fr));
|
|
4
|
+
row-gap: 12px;
|
|
5
|
+
column-gap: 10px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
|
|
8
|
+
& > .card-list-goods__item {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
transition: top 0.35s ease, left 0.35s ease, width 0.35s ease;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
box-shadow: 0 3px 9px 1px rgba(204, 204, 204, 0.35);
|
|
14
|
+
|
|
15
|
+
& > .card-list-goods__image {
|
|
16
|
+
height: 200px;
|
|
17
|
+
width: 100%;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
display: flex;
|
|
20
|
+
|
|
21
|
+
& > img {
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: 100%;
|
|
24
|
+
object-fit: cover;
|
|
25
|
+
//object-position: center;
|
|
26
|
+
object-position: 50% 50%;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
& > .card-list-goods__content {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
padding: 0.5rem;
|
|
35
|
+
|
|
36
|
+
.card-list-goods__title {
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
display: -webkit-box;
|
|
39
|
+
-webkit-box-orient: vertical;
|
|
40
|
+
-webkit-line-clamp: 2;
|
|
41
|
+
line-clamp: 2;
|
|
42
|
+
margin-top: 0.25rem;
|
|
43
|
+
margin-bottom: 0.25rem;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.card-list-goods__desc {
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
line-clamp: 2;
|
|
53
|
+
margin-top: 0.25rem;
|
|
54
|
+
margin-bottom: 0.25rem;
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
color: #333333;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.card-list-goods__bottom {
|
|
60
|
+
margin-top: 0.25rem;
|
|
61
|
+
margin-bottom: 0.25rem;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: baseline;
|
|
64
|
+
flex-wrap: wrap;
|
|
65
|
+
row-gap: 0.5rem;
|
|
66
|
+
|
|
67
|
+
& > div {
|
|
68
|
+
display: flex;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.card-list-goods__unit {
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
color: #F57D51;
|
|
74
|
+
font-weight: 700;
|
|
75
|
+
line-height: 1;
|
|
76
|
+
|
|
77
|
+
&__delete {
|
|
78
|
+
margin-left: 0;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
color: #666666;
|
|
81
|
+
line-height: 1;
|
|
82
|
+
text-decoration: line-through
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card-list-goods__price {
|
|
88
|
+
font-size: 17px;
|
|
89
|
+
color: #F57D51;
|
|
90
|
+
font-weight: 700;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
|
|
93
|
+
&__delete {
|
|
94
|
+
margin-left: 0;
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
color: #666666;
|
|
97
|
+
line-height: 1;
|
|
98
|
+
text-decoration: line-through
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.card-list-goods__sales {
|
|
103
|
+
margin-left: 3px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
color: #666666;
|
|
106
|
+
line-height: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
var _goodsCardList = _interopRequireDefault(require("./goods-card-list"));
|
|
6
|
-
exports.GoodsCardList = _goodsCardList["default"];
|
|
6
|
+
exports.GoodsCardList = _goodsCardList["default"];
|
|
7
|
+
var _goodsCardListCommon = _interopRequireDefault(require("./goods-card-list-common"));
|
|
8
|
+
exports.GoodsCardListCommon = _goodsCardListCommon["default"];
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
/* write style here */
|
|
2
2
|
.grid-navigation {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
10
22
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
text-decoration: none;
|
|
17
|
-
color: #333;
|
|
18
|
-
position: relative;
|
|
19
|
-
img {
|
|
20
|
-
width: 48px;
|
|
21
|
-
height: 51px;
|
|
22
|
-
margin-bottom: 3px;
|
|
23
|
-
}
|
|
23
|
+
img {
|
|
24
|
+
width: 48px;
|
|
25
|
+
height: 51px;
|
|
26
|
+
margin-bottom: 3px;
|
|
27
|
+
}
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
}
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
38
|
+
&:hover {
|
|
39
|
+
color: #007bff;
|
|
37
40
|
}
|
|
41
|
+
}
|
|
@@ -8,7 +8,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
require("./message-list-item.scss");
|
|
10
10
|
var _childrenNodeHandle = require("../../utils/children-node-handle");
|
|
11
|
-
var _excluded = ["onClick", "title", "image", "gmtCreate", "children", "description"];
|
|
11
|
+
var _excluded = ["onClick", "title", "image", "gmtCreate", "children", "description", "isRead"];
|
|
12
12
|
/**
|
|
13
13
|
* 数据
|
|
14
14
|
*/
|
|
@@ -21,6 +21,7 @@ var MessageListItem = function MessageListItem(_ref) {
|
|
|
21
21
|
gmtCreate = _ref.gmtCreate,
|
|
22
22
|
children = _ref.children,
|
|
23
23
|
description = _ref.description,
|
|
24
|
+
isRead = _ref.isRead,
|
|
24
25
|
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
25
26
|
var _otherProps = otherProps || {};
|
|
26
27
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
@@ -28,6 +29,8 @@ var MessageListItem = function MessageListItem(_ref) {
|
|
|
28
29
|
onClick: onClick
|
|
29
30
|
}, _otherProps), (0, _childrenNodeHandle.convertChildren)(children, 'image', {
|
|
30
31
|
src: image
|
|
32
|
+
}), isRead ? null : /*#__PURE__*/_react["default"].createElement("span", {
|
|
33
|
+
className: "badge"
|
|
31
34
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
32
35
|
className: "message-list__panel__item__text"
|
|
33
36
|
}, (0, _childrenNodeHandle.convertChildren)(children, 'title', {
|
|
@@ -5,33 +5,42 @@
|
|
|
5
5
|
gap: 5px;
|
|
6
6
|
padding-bottom: 15px;
|
|
7
7
|
justify-content: flex-start;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
border-bottom: 1px solid #eeeeee;
|
|
9
|
+
position: relative;
|
|
11
10
|
&_image {
|
|
12
11
|
width: 90px;
|
|
13
12
|
height: 71px;
|
|
14
13
|
border-radius: 5px;
|
|
15
14
|
flex: 0 0 auto;
|
|
16
15
|
overflow: hidden;
|
|
16
|
+
position: relative;
|
|
17
17
|
|
|
18
18
|
& > img {
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
21
|
object-fit: cover;
|
|
22
22
|
}
|
|
23
|
-
|
|
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; // 根据需要调整位置
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
&__text {
|
|
27
36
|
display: flex;
|
|
28
37
|
flex-direction: column;
|
|
29
38
|
gap: 3px;
|
|
30
|
-
padding-top:
|
|
39
|
+
padding-top: 4px;
|
|
31
40
|
|
|
32
41
|
&__title {
|
|
33
42
|
font-size: 15px;
|
|
34
|
-
font-weight:
|
|
43
|
+
font-weight: 600;
|
|
35
44
|
color: #000000;
|
|
36
45
|
}
|
|
37
46
|
|
|
@@ -46,5 +55,6 @@
|
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
}
|
|
58
|
+
|
|
49
59
|
|
|
50
60
|
}
|
|
@@ -6,14 +6,6 @@ export interface MessageListProps {
|
|
|
6
6
|
* 全部的数据
|
|
7
7
|
*/
|
|
8
8
|
dataList?: DataProps[];
|
|
9
|
-
/**
|
|
10
|
-
* 已读的数据
|
|
11
|
-
*/
|
|
12
|
-
readDataList?: DataProps[];
|
|
13
|
-
/**
|
|
14
|
-
* 未读的数据
|
|
15
|
-
*/
|
|
16
|
-
unReadDataList?: DataProps[];
|
|
17
9
|
/**
|
|
18
10
|
* 点击事件
|
|
19
11
|
* @param e
|
|
@@ -27,6 +19,10 @@ export interface MessageListProps {
|
|
|
27
19
|
* 图片
|
|
28
20
|
*/
|
|
29
21
|
images: string[];
|
|
22
|
+
/**
|
|
23
|
+
* 切换数据源
|
|
24
|
+
*/
|
|
25
|
+
handleDataList: (key: string) => DataProps[];
|
|
30
26
|
}
|
|
31
27
|
declare const MessageList: React.FC<MessageListProps>;
|
|
32
28
|
export default MessageList;
|
|
@@ -9,42 +9,35 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
require("./index.scss");
|
|
10
10
|
var _messageListItem = _interopRequireDefault(require("./message-list-item"));
|
|
11
11
|
var _childrenNodeHandle = require("../../utils/children-node-handle");
|
|
12
|
-
var _excluded = ["dataList", "
|
|
12
|
+
var _excluded = ["dataList", "handleDataList", "onClick", "children", "images"];
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
15
|
var MessageList = function MessageList(_ref) {
|
|
16
16
|
var dataList = _ref.dataList,
|
|
17
|
-
|
|
18
|
-
unReadDataList = _ref.unReadDataList,
|
|
17
|
+
handleDataList = _ref.handleDataList,
|
|
19
18
|
_ref$onClick = _ref.onClick,
|
|
20
19
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
21
20
|
children = _ref.children,
|
|
22
21
|
images = _ref.images,
|
|
23
22
|
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
24
23
|
var _otherProps = otherProps || {};
|
|
25
|
-
var _React$useState = _react["default"].useState(dataList),
|
|
24
|
+
var _React$useState = _react["default"].useState(dataList || []),
|
|
26
25
|
currentDataList = _React$useState[0],
|
|
27
26
|
setCurrentDataList = _React$useState[1];
|
|
28
27
|
var _React$useState2 = _react["default"].useState('all'),
|
|
29
28
|
currentKey = _React$useState2[0],
|
|
30
29
|
setCurrentKey = _React$useState2[1];
|
|
30
|
+
|
|
31
31
|
// 切换数据源
|
|
32
32
|
var handleClick = function handleClick(key) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} else if (key === 'unRead') {
|
|
37
|
-
setCurrentDataList(unReadDataList);
|
|
38
|
-
setCurrentKey('unRead');
|
|
39
|
-
} else {
|
|
40
|
-
setCurrentDataList(dataList);
|
|
41
|
-
setCurrentKey('all');
|
|
42
|
-
}
|
|
33
|
+
var newDataList = handleDataList(key);
|
|
34
|
+
setCurrentDataList(newDataList);
|
|
35
|
+
setCurrentKey(key);
|
|
43
36
|
};
|
|
44
37
|
images = images || [];
|
|
45
38
|
(0, _react.useEffect)(function () {
|
|
46
|
-
|
|
47
|
-
});
|
|
39
|
+
setCurrentDataList(dataList || []);
|
|
40
|
+
}, [dataList]);
|
|
48
41
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
49
42
|
className: "message-list__panel"
|
|
50
43
|
}, _otherProps), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.rich-text {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
padding: 0; /* 添加内边距 */
|
|
6
|
+
margin: 0; /* 去除外边距 */
|
|
7
|
+
word-break: break-word; /* 处理长单词换行 */
|
|
8
|
+
overflow-wrap: break-word; /* 支持长单词换行 */
|
|
9
|
+
overflow: hidden; /* 隐藏超出部分 */
|
|
10
|
+
}
|
|
11
|
+
p {
|
|
12
|
+
padding: 0;
|
|
13
|
+
margin: 0 0 20px 0 !important;
|
|
14
|
+
}
|
|
15
|
+
img {
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
height: auto; /* 保持纵横比 */
|
|
18
|
+
object-fit: contain; /* 确保图片保持在容器内 */
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface DataProps {
|
|
4
|
+
content?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RichTextProps {
|
|
7
|
+
content?: string;
|
|
8
|
+
dataList?: DataProps[];
|
|
9
|
+
}
|
|
10
|
+
declare const RichText: {
|
|
11
|
+
(props: RichTextProps): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export default RichText;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
require("./index.scss");
|
|
10
|
+
var _excluded = ["content", "dataList"];
|
|
11
|
+
// 富文本
|
|
12
|
+
|
|
13
|
+
// 用于处理富文本内容的函数
|
|
14
|
+
var processContent = function processContent(content) {
|
|
15
|
+
// 检查内容是否为字符串
|
|
16
|
+
if (typeof content !== 'string') {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
// 替换转义符号(这里可以根据需要添加更多处理逻辑)
|
|
20
|
+
return content.replace(/\\/g, '');
|
|
21
|
+
};
|
|
22
|
+
var RichText = function RichText(props) {
|
|
23
|
+
var content = props.content,
|
|
24
|
+
dataList = props.dataList,
|
|
25
|
+
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
|
26
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
27
|
+
className: "rich-text"
|
|
28
|
+
}, otherProps), dataList && dataList.length > 0 ? dataList.map(function (item, index) {
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
30
|
+
key: index,
|
|
31
|
+
dangerouslySetInnerHTML: {
|
|
32
|
+
__html: processContent(item.content)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
36
|
+
dangerouslySetInnerHTML: {
|
|
37
|
+
__html: processContent(content)
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
RichText.displayName = 'RichText';
|
|
42
|
+
var _default = exports["default"] = RichText;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
margin-right: 6px;
|
|
10
10
|
letter-spacing: 2px;
|
|
11
|
+
position: relative;
|
|
11
12
|
&--selected {
|
|
12
13
|
background-color: #ED794A;
|
|
13
14
|
color: #FFFFFF;
|
|
@@ -20,4 +21,19 @@
|
|
|
20
21
|
padding: 14px 30px;
|
|
21
22
|
border-radius: 28px;
|
|
22
23
|
}
|
|
24
|
+
.badge {
|
|
25
|
+
display: flex;
|
|
26
|
+
padding: 2px 4px;
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
background-color: #F44341; // 红色背景
|
|
29
|
+
color: white; // 字体颜色
|
|
30
|
+
// text-align: center;
|
|
31
|
+
letter-spacing: 0;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
line-height: normal; // 垂直居中
|
|
34
|
+
font-size: 10px; // 根据需要调整字体大小
|
|
35
|
+
position: absolute; // 绝对定位
|
|
36
|
+
top: 0; // 根据需要调整位置
|
|
37
|
+
right: 3px; // 根据需要调整位置
|
|
38
|
+
}
|
|
23
39
|
}
|