@dckj-npm/dc-material 0.1.376 → 0.1.377
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/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/teletext-list.html +3 -3
- package/build/docs/umi.6f6bf535.js +1 -0
- package/build/docs/{umi.6743fcd4.css → umi.9770df27.css} +1 -1
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/docs/~demos/teletext-list-demo-1.html +3 -3
- package/build/docs/~demos/teletext-list-demo.html +3 -3
- 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/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +2 -2
- package/dist/BizComps.js.map +1 -1
- package/es/components/teletext-list/teletext-list-item.d.ts +14 -77
- package/es/components/teletext-list/teletext-list-item.js +153 -165
- package/es/components/teletext-list/teletext-list-item.scss +53 -4
- package/es/components/teletext-list/teletext-list.d.ts +60 -4
- package/es/components/teletext-list/teletext-list.js +55 -37
- package/lib/components/teletext-list/teletext-list-item.d.ts +14 -77
- package/lib/components/teletext-list/teletext-list-item.js +153 -164
- package/lib/components/teletext-list/teletext-list-item.scss +53 -4
- package/lib/components/teletext-list/teletext-list.d.ts +60 -4
- package/lib/components/teletext-list/teletext-list.js +55 -37
- package/lowcode/teletext-list/meta.ts +457 -703
- package/lowcode/teletext-list/meta.ts.bak +821 -0
- package/lowcode_es/meta.js +1 -1
- package/lowcode_es/teletext-list/meta.js +689 -598
- package/lowcode_es/teletext-list/meta.ts.bak +821 -0
- package/lowcode_lib/meta.js +1 -1
- package/lowcode_lib/teletext-list/meta.js +689 -598
- package/lowcode_lib/teletext-list/meta.ts.bak +821 -0
- package/package.json +3 -3
- package/build/docs/umi.d20b1d99.js +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["dataList", "onClick", "
|
|
3
|
+
var _excluded = ["dataList", "onClick", "imagePlacement", "handleMoreClick", "moreText", "title", "textLines", "type", "itemColumns", "iconList", "itemGap", "itemPadding", "imgWidth", "imgHeight", "itemBgColor", "itemRowAlign", "textAlign", "isShoppingCart", "isWishList", "isUserMenu", "textImgGap", "imgBorderRadius", "imgObjectFit", "titleColor", "titleFontSize", "titleFontWeight", "titleLineClamp", "descriptionColor", "descriptionFontSize", "descriptionFontWeight", "descriptionLineClamp", "itemBorderRadius", "itemBorderColor", "itemBorderWidth"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import "./index.scss";
|
|
6
6
|
import { default as TeletextListItem } from "./teletext-list-item";
|
|
7
|
-
import { convertChildren } from "../../utils/children-node-handle";
|
|
8
7
|
import arr from "../../assets/icon/teletext-list/arr.png";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -15,7 +14,6 @@ var TeletextList = function TeletextList(_ref) {
|
|
|
15
14
|
var dataList = _ref.dataList,
|
|
16
15
|
_ref$onClick = _ref.onClick,
|
|
17
16
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
18
|
-
children = _ref.children,
|
|
19
17
|
_ref$imagePlacement = _ref.imagePlacement,
|
|
20
18
|
imagePlacement = _ref$imagePlacement === void 0 ? 'left' : _ref$imagePlacement,
|
|
21
19
|
handleMoreClick = _ref.handleMoreClick,
|
|
@@ -25,13 +23,16 @@ var TeletextList = function TeletextList(_ref) {
|
|
|
25
23
|
_ref$textLines = _ref.textLines,
|
|
26
24
|
textLines = _ref$textLines === void 0 ? 2 : _ref$textLines,
|
|
27
25
|
type = _ref.type,
|
|
28
|
-
itemColumns = _ref.itemColumns,
|
|
26
|
+
_ref$itemColumns = _ref.itemColumns,
|
|
27
|
+
itemColumns = _ref$itemColumns === void 0 ? 1 : _ref$itemColumns,
|
|
29
28
|
iconList = _ref.iconList,
|
|
30
29
|
_ref$itemGap = _ref.itemGap,
|
|
31
30
|
itemGap = _ref$itemGap === void 0 ? 16 : _ref$itemGap,
|
|
32
31
|
itemPadding = _ref.itemPadding,
|
|
33
|
-
imgWidth = _ref.imgWidth,
|
|
34
|
-
|
|
32
|
+
_ref$imgWidth = _ref.imgWidth,
|
|
33
|
+
imgWidth = _ref$imgWidth === void 0 ? 100 : _ref$imgWidth,
|
|
34
|
+
_ref$imgHeight = _ref.imgHeight,
|
|
35
|
+
imgHeight = _ref$imgHeight === void 0 ? 100 : _ref$imgHeight,
|
|
35
36
|
itemBgColor = _ref.itemBgColor,
|
|
36
37
|
itemRowAlign = _ref.itemRowAlign,
|
|
37
38
|
textAlign = _ref.textAlign,
|
|
@@ -39,38 +40,41 @@ var TeletextList = function TeletextList(_ref) {
|
|
|
39
40
|
isWishList = _ref.isWishList,
|
|
40
41
|
isUserMenu = _ref.isUserMenu,
|
|
41
42
|
textImgGap = _ref.textImgGap,
|
|
43
|
+
imgBorderRadius = _ref.imgBorderRadius,
|
|
44
|
+
imgObjectFit = _ref.imgObjectFit,
|
|
45
|
+
titleColor = _ref.titleColor,
|
|
46
|
+
titleFontSize = _ref.titleFontSize,
|
|
47
|
+
titleFontWeight = _ref.titleFontWeight,
|
|
48
|
+
titleLineClamp = _ref.titleLineClamp,
|
|
49
|
+
descriptionColor = _ref.descriptionColor,
|
|
50
|
+
descriptionFontSize = _ref.descriptionFontSize,
|
|
51
|
+
descriptionFontWeight = _ref.descriptionFontWeight,
|
|
52
|
+
descriptionLineClamp = _ref.descriptionLineClamp,
|
|
53
|
+
itemBorderRadius = _ref.itemBorderRadius,
|
|
54
|
+
itemBorderColor = _ref.itemBorderColor,
|
|
55
|
+
itemBorderWidth = _ref.itemBorderWidth,
|
|
42
56
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
|
-
var TeletextListItemComp = TeletextListItem;
|
|
44
57
|
var _otherProps = otherProps || {};
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
display: 'grid',
|
|
58
|
-
gridTemplateColumns: "repeat(" + itemColumns + ",1fr)",
|
|
59
|
-
gap: itemGap + "px"
|
|
60
|
-
};
|
|
58
|
+
var listStyle = itemRowAlign === 'row' ? {
|
|
59
|
+
width: 'auto',
|
|
60
|
+
display: 'flex',
|
|
61
|
+
gap: itemGap + "px",
|
|
62
|
+
overflowX: 'auto',
|
|
63
|
+
scrollSnapType: 'x mandatory',
|
|
64
|
+
WebkitOverflowScrolling: 'touch'
|
|
65
|
+
} : {
|
|
66
|
+
display: 'grid',
|
|
67
|
+
gridTemplateColumns: "repeat(" + itemColumns + ", 1fr)",
|
|
68
|
+
gap: itemGap + "px"
|
|
61
69
|
};
|
|
62
|
-
var
|
|
63
|
-
if (!dataList) return [];
|
|
64
|
-
return Array.isArray(dataList) ? dataList : [dataList];
|
|
65
|
-
};
|
|
66
|
-
var dataItems = getDataList();
|
|
70
|
+
var dataItems = dataList ? Array.isArray(dataList) ? dataList : [dataList] : [];
|
|
67
71
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
68
72
|
className: "teletext-list__panel"
|
|
69
73
|
}, _otherProps), /*#__PURE__*/React.createElement("div", {
|
|
70
74
|
className: "teletext-list__panel-head"
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
}), moreText
|
|
75
|
+
}, title && /*#__PURE__*/React.createElement("h5", {
|
|
76
|
+
className: "teletext-list__panel-head-title"
|
|
77
|
+
}, title), moreText && /*#__PURE__*/React.createElement("div", {
|
|
74
78
|
className: "teletext-list__panel-head-more",
|
|
75
79
|
onClick: handleMoreClick
|
|
76
80
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -78,7 +82,7 @@ var TeletextList = function TeletextList(_ref) {
|
|
|
78
82
|
}, moreText), /*#__PURE__*/React.createElement("img", {
|
|
79
83
|
src: arr,
|
|
80
84
|
className: "teletext-list__panel-head-more-img"
|
|
81
|
-
}))
|
|
85
|
+
}))), isUserMenu && /*#__PURE__*/React.createElement("div", {
|
|
82
86
|
className: "teletext-list__panel-head-user-menu"
|
|
83
87
|
}, /*#__PURE__*/React.createElement("img", {
|
|
84
88
|
className: "teletext-list__panel-head-user-menu-img",
|
|
@@ -87,10 +91,11 @@ var TeletextList = function TeletextList(_ref) {
|
|
|
87
91
|
}), /*#__PURE__*/React.createElement("div", {
|
|
88
92
|
className: "teletext-list__panel-head-user-menu-text"
|
|
89
93
|
}, "Hello, Paige Turner")), /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: "teletext-list__panel__item-list
|
|
91
|
-
style:
|
|
94
|
+
className: "teletext-list__panel__item-list" + (itemRowAlign === 'row' ? ' teletext-list__panel__item-list--row' : ''),
|
|
95
|
+
style: listStyle
|
|
92
96
|
}, dataItems.length > 0 ? dataItems.map(function (item, index) {
|
|
93
|
-
|
|
97
|
+
var ItemComp = TeletextListItem;
|
|
98
|
+
return /*#__PURE__*/React.createElement(ItemComp, _extends({
|
|
94
99
|
key: index,
|
|
95
100
|
onClick: onClick,
|
|
96
101
|
imagePlacement: imagePlacement,
|
|
@@ -109,8 +114,21 @@ var TeletextList = function TeletextList(_ref) {
|
|
|
109
114
|
isShoppingCart: isShoppingCart,
|
|
110
115
|
isWishList: isWishList,
|
|
111
116
|
isUserMenu: isUserMenu,
|
|
112
|
-
textImgGap: textImgGap
|
|
113
|
-
|
|
117
|
+
textImgGap: textImgGap,
|
|
118
|
+
imgBorderRadius: imgBorderRadius,
|
|
119
|
+
imgObjectFit: imgObjectFit,
|
|
120
|
+
titleColor: titleColor,
|
|
121
|
+
titleFontSize: titleFontSize,
|
|
122
|
+
titleFontWeight: titleFontWeight,
|
|
123
|
+
titleLineClamp: titleLineClamp,
|
|
124
|
+
descriptionColor: descriptionColor,
|
|
125
|
+
descriptionFontSize: descriptionFontSize,
|
|
126
|
+
descriptionFontWeight: descriptionFontWeight,
|
|
127
|
+
descriptionLineClamp: descriptionLineClamp,
|
|
128
|
+
itemBorderRadius: itemBorderRadius,
|
|
129
|
+
itemBorderColor: itemBorderColor,
|
|
130
|
+
itemBorderWidth: itemBorderWidth
|
|
131
|
+
}, item));
|
|
114
132
|
}) : /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u6570\u636E")));
|
|
115
133
|
};
|
|
116
134
|
TeletextList.displayName = 'TeletextList';
|
|
@@ -1,106 +1,43 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './teletext-list-item.scss';
|
|
3
3
|
import { IconListProps } from './teletext-list';
|
|
4
|
-
/**
|
|
5
|
-
* 数据
|
|
6
|
-
*/
|
|
7
4
|
export interface TeletextListItemProps {
|
|
8
|
-
/**
|
|
9
|
-
* 点击事件
|
|
10
|
-
*/
|
|
11
5
|
onClick?: (e: any) => void;
|
|
12
|
-
/**
|
|
13
|
-
* 标题
|
|
14
|
-
*/
|
|
15
6
|
title?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 图片地址
|
|
18
|
-
*/
|
|
19
7
|
image?: string | string[];
|
|
20
|
-
|
|
21
|
-
* 图片位置
|
|
22
|
-
*/
|
|
23
|
-
imagePlacement?: 'left' | 'right' | 'top' | 'bottom' | 'left-right' | 'none';
|
|
24
|
-
/**
|
|
25
|
-
* 说明
|
|
26
|
-
*/
|
|
8
|
+
imagePlacement?: 'left' | 'right' | 'top' | 'bottom' | 'none';
|
|
27
9
|
description?: string;
|
|
28
|
-
/**
|
|
29
|
-
* 标签列表
|
|
30
|
-
*/
|
|
31
10
|
tags?: string;
|
|
32
|
-
/**
|
|
33
|
-
* 控件类型
|
|
34
|
-
*/
|
|
35
11
|
type?: 'textAndImg' | 'imgOnly' | 'textOnly';
|
|
36
|
-
/**
|
|
37
|
-
* 行数
|
|
38
|
-
*/
|
|
39
12
|
textLines?: number;
|
|
40
|
-
/**
|
|
41
|
-
* 子项列数
|
|
42
|
-
*/
|
|
43
13
|
itemColumns?: number;
|
|
44
|
-
/**
|
|
45
|
-
* 图标列表
|
|
46
|
-
*/
|
|
47
14
|
iconList?: IconListProps[];
|
|
48
|
-
/**
|
|
49
|
-
* 列表项内边距
|
|
50
|
-
*/
|
|
51
15
|
itemPadding?: number;
|
|
52
|
-
/**
|
|
53
|
-
* 行数3
|
|
54
|
-
*/
|
|
55
16
|
text3?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 行数4
|
|
58
|
-
*/
|
|
59
17
|
text4?: string;
|
|
60
|
-
/**
|
|
61
|
-
* 图片宽度
|
|
62
|
-
*/
|
|
63
18
|
imgWidth?: number;
|
|
64
|
-
/**
|
|
65
|
-
* 图片高度
|
|
66
|
-
*/
|
|
67
19
|
imgHeight?: number;
|
|
68
|
-
/**
|
|
69
|
-
* 背景颜色
|
|
70
|
-
*/
|
|
71
20
|
itemBgColor?: string;
|
|
72
|
-
/**
|
|
73
|
-
* 样式
|
|
74
|
-
*/
|
|
75
21
|
style?: React.CSSProperties;
|
|
76
|
-
/**
|
|
77
|
-
* 图文对齐方式
|
|
78
|
-
*/
|
|
79
22
|
textAlign?: 'flex-start' | 'flex-end' | 'center';
|
|
80
|
-
/**
|
|
81
|
-
* 是否为购物车列表
|
|
82
|
-
*/
|
|
83
23
|
isShoppingCart?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* 是否为愿望单列表
|
|
86
|
-
*/
|
|
87
24
|
isWishList?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* 是否为用户菜单列表
|
|
90
|
-
*/
|
|
91
25
|
isUserMenu?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* 类型
|
|
94
|
-
*/
|
|
95
26
|
itemType?: string;
|
|
96
|
-
/**
|
|
97
|
-
* 图文间距
|
|
98
|
-
*/
|
|
99
27
|
textImgGap?: number;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
28
|
+
imgBorderRadius?: number;
|
|
29
|
+
imgObjectFit?: 'cover' | 'contain' | 'fill' | 'none';
|
|
30
|
+
titleColor?: string;
|
|
31
|
+
titleFontSize?: number;
|
|
32
|
+
titleFontWeight?: 'normal' | '500' | '600' | 'bold';
|
|
33
|
+
titleLineClamp?: number;
|
|
34
|
+
descriptionColor?: string;
|
|
35
|
+
descriptionFontSize?: number;
|
|
36
|
+
descriptionFontWeight?: 'normal' | '500' | '600' | 'bold';
|
|
37
|
+
descriptionLineClamp?: number;
|
|
38
|
+
itemBorderRadius?: number;
|
|
39
|
+
itemBorderColor?: string;
|
|
40
|
+
itemBorderWidth?: number;
|
|
104
41
|
}
|
|
105
42
|
declare const TeletextListItem: React.FC<TeletextListItemProps>;
|
|
106
43
|
export default TeletextListItem;
|
|
@@ -3,217 +3,205 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
6
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
require("./teletext-list-item.scss");
|
|
10
|
-
var _childrenNodeHandle = require("../../utils/children-node-handle");
|
|
11
10
|
var _lowcodeMaterials = require("@alilc/lowcode-materials");
|
|
12
|
-
var _excluded = ["onClick", "title", "image", "
|
|
13
|
-
_excluded2 = ["width", "height"];
|
|
11
|
+
var _excluded = ["onClick", "title", "image", "imagePlacement", "description", "type", "textLines", "itemColumns", "itemPadding", "iconList", "text3", "text4", "imgWidth", "imgHeight", "itemBgColor", "style", "textAlign", "isShoppingCart", "isWishList", "itemType", "textImgGap", "imgBorderRadius", "imgObjectFit", "titleColor", "titleFontSize", "titleFontWeight", "titleLineClamp", "descriptionColor", "descriptionFontSize", "descriptionFontWeight", "descriptionLineClamp", "itemBorderRadius", "itemBorderColor", "itemBorderWidth"];
|
|
14
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
// ─── 图标位置计算(纯函数,无副作用) ────────────────────────────────────────────
|
|
14
|
+
function getIconStyle(icon) {
|
|
15
|
+
var base = {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
zIndex: 10
|
|
18
|
+
};
|
|
19
|
+
switch (icon.position) {
|
|
20
|
+
case 'leftTop':
|
|
21
|
+
return (0, _extends2["default"])({}, base, {
|
|
22
|
+
top: '0px',
|
|
23
|
+
left: '10px'
|
|
24
|
+
});
|
|
25
|
+
case 'leftBottom':
|
|
26
|
+
return (0, _extends2["default"])({}, base, {
|
|
27
|
+
bottom: '0px',
|
|
28
|
+
left: '10px'
|
|
29
|
+
});
|
|
30
|
+
case 'rightTop':
|
|
31
|
+
return (0, _extends2["default"])({}, base, {
|
|
32
|
+
top: '0px',
|
|
33
|
+
right: '10px'
|
|
34
|
+
});
|
|
35
|
+
case 'rightBottom':
|
|
36
|
+
return (0, _extends2["default"])({}, base, {
|
|
37
|
+
bottom: '0px',
|
|
38
|
+
right: '10px'
|
|
39
|
+
});
|
|
40
|
+
case 'customize':
|
|
41
|
+
return (0, _extends2["default"])({}, base, {
|
|
42
|
+
right: (icon.rightOffset || 0) + "px",
|
|
43
|
+
top: (icon.topOffset || 0) + "px"
|
|
44
|
+
});
|
|
45
|
+
default:
|
|
46
|
+
return base;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
18
49
|
|
|
50
|
+
// ─── 文本行内容映射(纯函数) ─────────────────────────────────────────────────────
|
|
51
|
+
function getTextContent(index, title, description, text3, text4) {
|
|
52
|
+
switch (index) {
|
|
53
|
+
case 0:
|
|
54
|
+
return title || '';
|
|
55
|
+
case 1:
|
|
56
|
+
return description || '';
|
|
57
|
+
case 2:
|
|
58
|
+
return text3 || '';
|
|
59
|
+
case 3:
|
|
60
|
+
return text4 || '';
|
|
61
|
+
default:
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
19
65
|
var TeletextListItem = function TeletextListItem(_ref) {
|
|
20
66
|
var _ref$onClick = _ref.onClick,
|
|
21
67
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
22
68
|
title = _ref.title,
|
|
23
69
|
image = _ref.image,
|
|
24
|
-
children = _ref.children,
|
|
25
70
|
imagePlacement = _ref.imagePlacement,
|
|
26
71
|
description = _ref.description,
|
|
27
72
|
type = _ref.type,
|
|
28
|
-
textLines = _ref.textLines,
|
|
73
|
+
_ref$textLines = _ref.textLines,
|
|
74
|
+
textLines = _ref$textLines === void 0 ? 2 : _ref$textLines,
|
|
29
75
|
itemColumns = _ref.itemColumns,
|
|
30
76
|
itemPadding = _ref.itemPadding,
|
|
31
77
|
iconList = _ref.iconList,
|
|
32
|
-
tags = _ref.tags,
|
|
33
78
|
text3 = _ref.text3,
|
|
34
79
|
text4 = _ref.text4,
|
|
35
|
-
imgWidth = _ref.imgWidth,
|
|
36
|
-
|
|
80
|
+
_ref$imgWidth = _ref.imgWidth,
|
|
81
|
+
imgWidth = _ref$imgWidth === void 0 ? 100 : _ref$imgWidth,
|
|
82
|
+
_ref$imgHeight = _ref.imgHeight,
|
|
83
|
+
imgHeight = _ref$imgHeight === void 0 ? 100 : _ref$imgHeight,
|
|
37
84
|
itemBgColor = _ref.itemBgColor,
|
|
38
85
|
style = _ref.style,
|
|
39
86
|
textAlign = _ref.textAlign,
|
|
40
87
|
isShoppingCart = _ref.isShoppingCart,
|
|
41
88
|
isWishList = _ref.isWishList,
|
|
42
|
-
isUserMenu = _ref.isUserMenu,
|
|
43
89
|
itemType = _ref.itemType,
|
|
44
90
|
_ref$textImgGap = _ref.textImgGap,
|
|
45
91
|
textImgGap = _ref$textImgGap === void 0 ? 16 : _ref$textImgGap,
|
|
92
|
+
imgBorderRadius = _ref.imgBorderRadius,
|
|
93
|
+
imgObjectFit = _ref.imgObjectFit,
|
|
94
|
+
titleColor = _ref.titleColor,
|
|
95
|
+
titleFontSize = _ref.titleFontSize,
|
|
96
|
+
titleFontWeight = _ref.titleFontWeight,
|
|
97
|
+
titleLineClamp = _ref.titleLineClamp,
|
|
98
|
+
descriptionColor = _ref.descriptionColor,
|
|
99
|
+
descriptionFontSize = _ref.descriptionFontSize,
|
|
100
|
+
descriptionFontWeight = _ref.descriptionFontWeight,
|
|
101
|
+
descriptionLineClamp = _ref.descriptionLineClamp,
|
|
102
|
+
itemBorderRadius = _ref.itemBorderRadius,
|
|
103
|
+
itemBorderColor = _ref.itemBorderColor,
|
|
104
|
+
itemBorderWidth = _ref.itemBorderWidth,
|
|
46
105
|
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
47
|
-
var normalizeNodeKey = function normalizeNodeKey(rawKey) {
|
|
48
|
-
if (rawKey === undefined || rawKey === null) {
|
|
49
|
-
return '';
|
|
50
|
-
}
|
|
51
|
-
return String(rawKey).replace(/^\.?\$?/, '');
|
|
52
|
-
};
|
|
53
106
|
var IconComp = _lowcodeMaterials.Icon;
|
|
54
|
-
var resultImage = Array.isArray(image) ? image[0] || '' : image || '';
|
|
55
107
|
var _otherProps = otherProps || {};
|
|
56
|
-
var containerClass = "teletext-list__panel__item image-" + imagePlacement + " itemColumns-" + itemColumns;
|
|
57
|
-
var childNodeList = _react["default"].Children.toArray(children);
|
|
58
|
-
var getChildPropsByKey = function getChildPropsByKey(key) {
|
|
59
|
-
var targetKey = normalizeNodeKey(key);
|
|
60
|
-
var targetChild = childNodeList.find(function (child) {
|
|
61
|
-
var _child$props;
|
|
62
|
-
var childKey = normalizeNodeKey(child === null || child === void 0 ? void 0 : child.key);
|
|
63
|
-
var childPropsKey = normalizeNodeKey(child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.key);
|
|
64
|
-
return childKey === targetKey || childPropsKey === targetKey;
|
|
65
|
-
});
|
|
66
|
-
return (targetChild === null || targetChild === void 0 ? void 0 : targetChild.props) || {};
|
|
67
|
-
};
|
|
68
|
-
var imageChildProps = getChildPropsByKey('image');
|
|
69
|
-
var imageClassName = ['teletext-list__panel__item_image', imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.className].filter(Boolean).join(' ');
|
|
70
108
|
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
childLayoutStyle = (0, _objectWithoutPropertiesLoose2["default"])(childStyle, _excluded2);
|
|
84
|
-
var DEFAULT_IMG_SIZE = 100;
|
|
85
|
-
var imageStyle = (0, _extends2["default"])({}, childLayoutStyle, {
|
|
86
|
-
width: typeof imgWidth === 'number' ? imgWidth + "px" : _childW != null ? _childW : DEFAULT_IMG_SIZE + "px",
|
|
87
|
-
height: typeof imgHeight === 'number' ? imgHeight + "px" : _childH != null ? _childH : DEFAULT_IMG_SIZE + "px"
|
|
88
|
-
});
|
|
109
|
+
// 图片地址:唯一来源是 dataList[i].image prop,不依赖任何子节点 schema
|
|
110
|
+
var resultImage = Array.isArray(image) ? image[0] || '' : image || '';
|
|
111
|
+
|
|
112
|
+
// 图片尺寸:唯一来源是 imgWidth / imgHeight prop(由父组件 TeletextList 统一下发)
|
|
113
|
+
// 不读取、不写入任何子节点 style,彻底消除与低代码引擎节点级重渲染的冲突
|
|
114
|
+
var imageStyle = {
|
|
115
|
+
width: imgWidth + "px",
|
|
116
|
+
height: imgHeight + "px",
|
|
117
|
+
borderRadius: imgBorderRadius != null ? imgBorderRadius + "px" : undefined,
|
|
118
|
+
objectFit: imgObjectFit
|
|
119
|
+
};
|
|
120
|
+
var containerClass = "teletext-list__panel__item image-" + imagePlacement + " itemColumns-" + itemColumns;
|
|
89
121
|
var containerStyle = (0, _extends2["default"])({
|
|
90
|
-
padding: itemPadding + "px",
|
|
122
|
+
padding: itemPadding != null ? itemPadding + "px" : undefined,
|
|
91
123
|
backgroundColor: itemBgColor,
|
|
92
124
|
alignItems: textAlign,
|
|
93
|
-
gap: textImgGap + "px"
|
|
125
|
+
gap: textImgGap + "px",
|
|
126
|
+
borderRadius: itemBorderRadius != null ? itemBorderRadius + "px" : undefined,
|
|
127
|
+
border: itemBorderWidth != null || itemBorderColor ? (itemBorderWidth !== null && itemBorderWidth !== void 0 ? itemBorderWidth : 1) + "px solid " + (itemBorderColor !== null && itemBorderColor !== void 0 ? itemBorderColor : 'transparent') : undefined
|
|
94
128
|
}, style);
|
|
95
129
|
|
|
96
|
-
//
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
// 默认偏移值
|
|
103
|
-
var defaultPosition = {};
|
|
104
|
-
switch (icon.position) {
|
|
105
|
-
case 'leftTop':
|
|
106
|
-
defaultPosition = {
|
|
107
|
-
top: '0px',
|
|
108
|
-
left: '10px'
|
|
109
|
-
};
|
|
110
|
-
break;
|
|
111
|
-
case 'leftBottom':
|
|
112
|
-
defaultPosition = {
|
|
113
|
-
bottom: '0px',
|
|
114
|
-
left: '10px'
|
|
115
|
-
};
|
|
116
|
-
break;
|
|
117
|
-
case 'rightTop':
|
|
118
|
-
defaultPosition = {
|
|
119
|
-
top: '0px',
|
|
120
|
-
right: '10px'
|
|
121
|
-
};
|
|
122
|
-
break;
|
|
123
|
-
case 'rightBottom':
|
|
124
|
-
defaultPosition = {
|
|
125
|
-
bottom: '0px',
|
|
126
|
-
right: '10px'
|
|
127
|
-
};
|
|
128
|
-
break;
|
|
129
|
-
case 'customize':
|
|
130
|
-
defaultPosition = {
|
|
131
|
-
right: (icon.rightOffset || 0) + "px",
|
|
132
|
-
top: (icon.topOffset || 0) + "px"
|
|
133
|
-
};
|
|
134
|
-
break;
|
|
135
|
-
default:
|
|
136
|
-
defaultPosition = {};
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
return (0, _extends2["default"])({}, baseStyle, defaultPosition);
|
|
140
|
-
};
|
|
141
|
-
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
142
|
-
className: containerClass,
|
|
143
|
-
onClick: onClick,
|
|
144
|
-
style: containerStyle
|
|
145
|
-
}, _otherProps), resultImage && (imagePlacement === 'left' || imagePlacement === 'top') && type !== 'textOnly' ? (0, _childrenNodeHandle.convertChildren)(children, 'image', {
|
|
146
|
-
imgSrc: resultImage,
|
|
147
|
-
className: imageClassName,
|
|
130
|
+
// ── 图片元素(原生 img,不依赖低代码 Image 组件 / convertChildren / cloneElement)
|
|
131
|
+
var imageEl = resultImage && type !== 'textOnly' ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
132
|
+
src: resultImage,
|
|
133
|
+
alt: title || '',
|
|
134
|
+
className: "teletext-list__panel__item_image",
|
|
148
135
|
style: imageStyle
|
|
149
|
-
}) : null
|
|
136
|
+
}) : null;
|
|
137
|
+
|
|
138
|
+
// ── 开关行(原生 CSS toggle switch;点击不冒泡到 item,状态由页面级事件控制)
|
|
139
|
+
var switchRow = type !== 'imgOnly' && itemType === '开关' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
140
|
className: "teletext-list__panel__item__switch",
|
|
151
141
|
style: {
|
|
152
142
|
display: 'flex',
|
|
153
143
|
alignItems: 'center',
|
|
154
144
|
justifyContent: 'space-between'
|
|
155
145
|
}
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
146
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
147
|
+
className: "teletext-list__panel__item__switch__title",
|
|
148
|
+
style: {
|
|
149
|
+
color: titleColor,
|
|
150
|
+
fontSize: titleFontSize != null ? titleFontSize + "px" : undefined,
|
|
151
|
+
fontWeight: titleFontWeight,
|
|
152
|
+
WebkitLineClamp: titleLineClamp
|
|
153
|
+
}
|
|
154
|
+
}, title), /*#__PURE__*/_react["default"].createElement("label", {
|
|
155
|
+
className: "teletext-list__panel__item__switch__toggle",
|
|
156
|
+
onClick: function onClick(e) {
|
|
157
|
+
return e.stopPropagation();
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
160
|
+
type: "checkbox"
|
|
161
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
162
|
+
className: "teletext-list__panel__item__switch__slider"
|
|
163
|
+
}))) : null;
|
|
164
|
+
|
|
165
|
+
// ── 文本区
|
|
166
|
+
var textArea = type !== 'imgOnly' && itemType !== '开关' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
163
167
|
className: "teletext-list__panel__item__text"
|
|
164
168
|
}, Array.from({
|
|
165
169
|
length: textLines
|
|
166
170
|
}).map(function (_, index) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
172
|
+
key: index,
|
|
173
|
+
className: "teletext-list__panel__item__text__" + (index === 0 ? 'title' : 'description'),
|
|
174
|
+
style: index === 0 ? {
|
|
175
|
+
color: titleColor,
|
|
176
|
+
fontSize: titleFontSize != null ? titleFontSize + "px" : undefined,
|
|
177
|
+
fontWeight: titleFontWeight,
|
|
178
|
+
WebkitLineClamp: titleLineClamp
|
|
179
|
+
} : {
|
|
180
|
+
color: descriptionColor,
|
|
181
|
+
fontSize: descriptionFontSize != null ? descriptionFontSize + "px" : undefined,
|
|
182
|
+
fontWeight: descriptionFontWeight,
|
|
183
|
+
WebkitLineClamp: descriptionLineClamp
|
|
180
184
|
}
|
|
181
|
-
}();
|
|
182
|
-
return (0, _childrenNodeHandle.convertChildren)(children, "text-" + (index + 1), {
|
|
183
|
-
children: [content],
|
|
184
|
-
className: "teletext-list__panel__item__text__" + (index === 0 ? 'title' : 'description')
|
|
185
|
-
});
|
|
185
|
+
}, getTextContent(index, title, description, text3, text4));
|
|
186
186
|
}), isShoppingCart && /*#__PURE__*/_react["default"].createElement("div", {
|
|
187
187
|
className: "shopping-cart-select"
|
|
188
188
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
189
189
|
className: "select-box"
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
label: 'X',
|
|
206
|
-
value: 'X'
|
|
207
|
-
}, {
|
|
208
|
-
label: 'XL',
|
|
209
|
-
value: 'XL'
|
|
210
|
-
}],
|
|
211
|
-
value: 'X',
|
|
212
|
-
prefix: '尺码',
|
|
213
|
-
dialogTitle: '选择尺码',
|
|
214
|
-
btnText: '确定',
|
|
215
|
-
className: 'teletext-list__panel__item__select'
|
|
216
|
-
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
190
|
+
}, /*#__PURE__*/_react["default"].createElement("select", {
|
|
191
|
+
className: "teletext-list__panel__item__select"
|
|
192
|
+
}, [1, 2, 3, 4, 5].map(function (n) {
|
|
193
|
+
return /*#__PURE__*/_react["default"].createElement("option", {
|
|
194
|
+
key: n,
|
|
195
|
+
value: n
|
|
196
|
+
}, "\u6570\u91CF: ", n);
|
|
197
|
+
})), /*#__PURE__*/_react["default"].createElement("select", {
|
|
198
|
+
className: "teletext-list__panel__item__select"
|
|
199
|
+
}, ['M', 'X', 'XL'].map(function (s) {
|
|
200
|
+
return /*#__PURE__*/_react["default"].createElement("option", {
|
|
201
|
+
key: s,
|
|
202
|
+
value: s
|
|
203
|
+
}, "\u5C3A\u7801: ", s);
|
|
204
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
217
205
|
className: "shopping-cart-select__btn"
|
|
218
206
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
219
207
|
className: "shopping-cart-select__btn__item"
|
|
@@ -241,11 +229,12 @@ var TeletextListItem = function TeletextListItem(_ref) {
|
|
|
241
229
|
className: "shopping-cart-select-img",
|
|
242
230
|
src: "https://51ymb.com/source/api/upload/1075055372064133120/2025/202502/20250207/1085235703970926592.png",
|
|
243
231
|
alt: ""
|
|
244
|
-
}), "Remove")))
|
|
245
|
-
|
|
246
|
-
className:
|
|
247
|
-
|
|
248
|
-
|
|
232
|
+
}), "Remove"))) : null;
|
|
233
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
234
|
+
className: containerClass,
|
|
235
|
+
onClick: onClick,
|
|
236
|
+
style: containerStyle
|
|
237
|
+
}, _otherProps), (imagePlacement === 'left' || imagePlacement === 'top') && imageEl, switchRow, textArea, (imagePlacement === 'right' || imagePlacement === 'bottom') && imageEl, iconList === null || iconList === void 0 ? void 0 : iconList.map(function (icon, index) {
|
|
249
238
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
250
239
|
key: index,
|
|
251
240
|
className: "teletext-list__panel__item__icon size-" + icon.size,
|