@dckj-npm/dc-material 0.1.375 → 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.
Files changed (42) hide show
  1. package/build/docs/colorful-button.html +3 -3
  2. package/build/docs/colorful-input.html +3 -3
  3. package/build/docs/index.html +3 -3
  4. package/build/docs/teletext-list.html +3 -3
  5. package/build/docs/umi.6f6bf535.js +1 -0
  6. package/build/docs/{umi.6743fcd4.css → umi.9770df27.css} +1 -1
  7. package/build/docs/~demos/colorful-button-demo.html +3 -3
  8. package/build/docs/~demos/colorful-input-demo.html +3 -3
  9. package/build/docs/~demos/teletext-list-demo-1.html +3 -3
  10. package/build/docs/~demos/teletext-list-demo.html +3 -3
  11. package/build/lowcode/assets-daily.json +13 -13
  12. package/build/lowcode/assets-dev.json +2 -2
  13. package/build/lowcode/assets-prod.json +13 -13
  14. package/build/lowcode/meta.design.js +1 -1
  15. package/build/lowcode/meta.js +1 -1
  16. package/build/lowcode/render/default/view.css +1 -1
  17. package/build/lowcode/render/default/view.js +1 -1
  18. package/build/lowcode/view.css +1 -1
  19. package/build/lowcode/view.js +1 -1
  20. package/dist/BizComps.css +1 -1
  21. package/dist/BizComps.js +2 -2
  22. package/dist/BizComps.js.map +1 -1
  23. package/es/components/teletext-list/teletext-list-item.d.ts +14 -77
  24. package/es/components/teletext-list/teletext-list-item.js +153 -157
  25. package/es/components/teletext-list/teletext-list-item.scss +53 -4
  26. package/es/components/teletext-list/teletext-list.d.ts +60 -4
  27. package/es/components/teletext-list/teletext-list.js +55 -37
  28. package/lib/components/teletext-list/teletext-list-item.d.ts +14 -77
  29. package/lib/components/teletext-list/teletext-list-item.js +153 -156
  30. package/lib/components/teletext-list/teletext-list-item.scss +53 -4
  31. package/lib/components/teletext-list/teletext-list.d.ts +60 -4
  32. package/lib/components/teletext-list/teletext-list.js +55 -37
  33. package/lowcode/teletext-list/meta.ts +460 -760
  34. package/lowcode/teletext-list/meta.ts.bak +821 -0
  35. package/lowcode_es/meta.js +1 -1
  36. package/lowcode_es/teletext-list/meta.js +686 -646
  37. package/lowcode_es/teletext-list/meta.ts.bak +821 -0
  38. package/lowcode_lib/meta.js +1 -1
  39. package/lowcode_lib/teletext-list/meta.js +688 -648
  40. package/lowcode_lib/teletext-list/meta.ts.bak +821 -0
  41. package/package.json +3 -3
  42. package/build/docs/umi.04debc3c.js +0 -1
@@ -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
- children?: React.ReactNode;
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;
@@ -1,206 +1,201 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["onClick", "title", "image", "children", "imagePlacement", "description", "type", "textLines", "itemColumns", "itemPadding", "iconList", "tags", "text3", "text4", "imgWidth", "imgHeight", "itemBgColor", "style", "textAlign", "isShoppingCart", "isWishList", "isUserMenu", "itemType", "textImgGap"];
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ 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"];
4
4
  import React, { createElement } from 'react';
5
5
  import "./teletext-list-item.scss";
6
- import { convertChildren } from "../../utils/children-node-handle";
7
6
  import { Icon } from '@alilc/lowcode-materials';
7
+ // ─── 图标位置计算(纯函数,无副作用) ────────────────────────────────────────────
8
+ function getIconStyle(icon) {
9
+ var base = {
10
+ position: 'absolute',
11
+ zIndex: 10
12
+ };
13
+ switch (icon.position) {
14
+ case 'leftTop':
15
+ return _extends({}, base, {
16
+ top: '0px',
17
+ left: '10px'
18
+ });
19
+ case 'leftBottom':
20
+ return _extends({}, base, {
21
+ bottom: '0px',
22
+ left: '10px'
23
+ });
24
+ case 'rightTop':
25
+ return _extends({}, base, {
26
+ top: '0px',
27
+ right: '10px'
28
+ });
29
+ case 'rightBottom':
30
+ return _extends({}, base, {
31
+ bottom: '0px',
32
+ right: '10px'
33
+ });
34
+ case 'customize':
35
+ return _extends({}, base, {
36
+ right: (icon.rightOffset || 0) + "px",
37
+ top: (icon.topOffset || 0) + "px"
38
+ });
39
+ default:
40
+ return base;
41
+ }
42
+ }
8
43
 
9
- /**
10
- * 数据
11
- */
12
-
44
+ // ─── 文本行内容映射(纯函数) ─────────────────────────────────────────────────────
45
+ function getTextContent(index, title, description, text3, text4) {
46
+ switch (index) {
47
+ case 0:
48
+ return title || '';
49
+ case 1:
50
+ return description || '';
51
+ case 2:
52
+ return text3 || '';
53
+ case 3:
54
+ return text4 || '';
55
+ default:
56
+ return '';
57
+ }
58
+ }
13
59
  var TeletextListItem = function TeletextListItem(_ref) {
14
60
  var _ref$onClick = _ref.onClick,
15
61
  onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
16
62
  title = _ref.title,
17
63
  image = _ref.image,
18
- children = _ref.children,
19
64
  imagePlacement = _ref.imagePlacement,
20
65
  description = _ref.description,
21
66
  type = _ref.type,
22
- textLines = _ref.textLines,
67
+ _ref$textLines = _ref.textLines,
68
+ textLines = _ref$textLines === void 0 ? 2 : _ref$textLines,
23
69
  itemColumns = _ref.itemColumns,
24
70
  itemPadding = _ref.itemPadding,
25
71
  iconList = _ref.iconList,
26
- tags = _ref.tags,
27
72
  text3 = _ref.text3,
28
73
  text4 = _ref.text4,
29
- imgWidth = _ref.imgWidth,
30
- imgHeight = _ref.imgHeight,
74
+ _ref$imgWidth = _ref.imgWidth,
75
+ imgWidth = _ref$imgWidth === void 0 ? 100 : _ref$imgWidth,
76
+ _ref$imgHeight = _ref.imgHeight,
77
+ imgHeight = _ref$imgHeight === void 0 ? 100 : _ref$imgHeight,
31
78
  itemBgColor = _ref.itemBgColor,
32
79
  style = _ref.style,
33
80
  textAlign = _ref.textAlign,
34
81
  isShoppingCart = _ref.isShoppingCart,
35
82
  isWishList = _ref.isWishList,
36
- isUserMenu = _ref.isUserMenu,
37
83
  itemType = _ref.itemType,
38
84
  _ref$textImgGap = _ref.textImgGap,
39
85
  textImgGap = _ref$textImgGap === void 0 ? 16 : _ref$textImgGap,
86
+ imgBorderRadius = _ref.imgBorderRadius,
87
+ imgObjectFit = _ref.imgObjectFit,
88
+ titleColor = _ref.titleColor,
89
+ titleFontSize = _ref.titleFontSize,
90
+ titleFontWeight = _ref.titleFontWeight,
91
+ titleLineClamp = _ref.titleLineClamp,
92
+ descriptionColor = _ref.descriptionColor,
93
+ descriptionFontSize = _ref.descriptionFontSize,
94
+ descriptionFontWeight = _ref.descriptionFontWeight,
95
+ descriptionLineClamp = _ref.descriptionLineClamp,
96
+ itemBorderRadius = _ref.itemBorderRadius,
97
+ itemBorderColor = _ref.itemBorderColor,
98
+ itemBorderWidth = _ref.itemBorderWidth,
40
99
  otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
41
- var normalizeNodeKey = function normalizeNodeKey(rawKey) {
42
- if (rawKey === undefined || rawKey === null) {
43
- return '';
44
- }
45
- return String(rawKey).replace(/^\.?\$?/, '');
46
- };
47
100
  var IconComp = Icon;
48
- var resultImage = Array.isArray(image) ? image[0] || '' : image || '';
49
101
  var _otherProps = otherProps || {};
50
- var containerClass = "teletext-list__panel__item image-" + imagePlacement + " itemColumns-" + itemColumns;
51
- var childNodeList = React.Children.toArray(children);
52
- var getChildPropsByKey = function getChildPropsByKey(key) {
53
- var targetKey = normalizeNodeKey(key);
54
- var targetChild = childNodeList.find(function (child) {
55
- var _child$props;
56
- var childKey = normalizeNodeKey(child === null || child === void 0 ? void 0 : child.key);
57
- var childPropsKey = normalizeNodeKey(child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.key);
58
- return childKey === targetKey || childPropsKey === targetKey;
59
- });
60
- return (targetChild === null || targetChild === void 0 ? void 0 : targetChild.props) || {};
102
+
103
+ // 图片地址:唯一来源是 dataList[i].image prop,不依赖任何子节点 schema
104
+ var resultImage = Array.isArray(image) ? image[0] || '' : image || '';
105
+
106
+ // 图片尺寸:唯一来源是 imgWidth / imgHeight prop(由父组件 TeletextList 统一下发)
107
+ // 不读取、不写入任何子节点 style,彻底消除与低代码引擎节点级重渲染的冲突
108
+ var imageStyle = {
109
+ width: imgWidth + "px",
110
+ height: imgHeight + "px",
111
+ borderRadius: imgBorderRadius != null ? imgBorderRadius + "px" : undefined,
112
+ objectFit: imgObjectFit
61
113
  };
62
- var imageChildProps = getChildPropsByKey('image');
63
- var imageClassName = ['teletext-list__panel__item_image', imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.className].filter(Boolean).join(' ');
64
- // 合并策略:子节点 style 所有属性(含布局面板设置的 margin-left 等)优先保留;
65
- // width/height 若子节点 style 中没有,则用父级 imgWidth/imgHeight prop 兜底补充;
66
- // 两者都没有时,使用默认尺寸 100px 防止图片无尺寸。
67
- // 布局面板 replace style 时可能只保留 margin-left(丢失 width/height),
68
- // 此时 imgWidth/imgHeight prop 的兜底确保图片尺寸不丢失。
69
- var childStyle = (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {};
70
- var DEFAULT_IMG_SIZE = 100;
71
- var imageStyle = _extends({}, childStyle, childStyle.width == null ? {
72
- width: (typeof imgWidth === 'number' ? imgWidth : DEFAULT_IMG_SIZE) + "px"
73
- } : {}, childStyle.height == null ? {
74
- height: (typeof imgHeight === 'number' ? imgHeight : DEFAULT_IMG_SIZE) + "px"
75
- } : {});
114
+ var containerClass = "teletext-list__panel__item image-" + imagePlacement + " itemColumns-" + itemColumns;
76
115
  var containerStyle = _extends({
77
- padding: itemPadding + "px",
116
+ padding: itemPadding != null ? itemPadding + "px" : undefined,
78
117
  backgroundColor: itemBgColor,
79
118
  alignItems: textAlign,
80
- gap: textImgGap + "px"
119
+ gap: textImgGap + "px",
120
+ borderRadius: itemBorderRadius != null ? itemBorderRadius + "px" : undefined,
121
+ border: itemBorderWidth != null || itemBorderColor ? (itemBorderWidth !== null && itemBorderWidth !== void 0 ? itemBorderWidth : 1) + "px solid " + (itemBorderColor !== null && itemBorderColor !== void 0 ? itemBorderColor : 'transparent') : undefined
81
122
  }, style);
82
123
 
83
- // 生成图标样式
84
- var getIconStyle = function getIconStyle(icon) {
85
- var baseStyle = {
86
- position: 'absolute',
87
- zIndex: 10
88
- };
89
- // 默认偏移值
90
- var defaultPosition = {};
91
- switch (icon.position) {
92
- case 'leftTop':
93
- defaultPosition = {
94
- top: '0px',
95
- left: '10px'
96
- };
97
- break;
98
- case 'leftBottom':
99
- defaultPosition = {
100
- bottom: '0px',
101
- left: '10px'
102
- };
103
- break;
104
- case 'rightTop':
105
- defaultPosition = {
106
- top: '0px',
107
- right: '10px'
108
- };
109
- break;
110
- case 'rightBottom':
111
- defaultPosition = {
112
- bottom: '0px',
113
- right: '10px'
114
- };
115
- break;
116
- case 'customize':
117
- defaultPosition = {
118
- right: (icon.rightOffset || 0) + "px",
119
- top: (icon.topOffset || 0) + "px"
120
- };
121
- break;
122
- default:
123
- defaultPosition = {};
124
- break;
125
- }
126
- return _extends({}, baseStyle, defaultPosition);
127
- };
128
- return /*#__PURE__*/React.createElement("div", _extends({
129
- className: containerClass,
130
- onClick: onClick,
131
- style: containerStyle
132
- }, _otherProps), resultImage && (imagePlacement === 'left' || imagePlacement === 'top') && type !== 'textOnly' ? convertChildren(children, 'image', {
133
- imgSrc: resultImage,
134
- className: imageClassName,
124
+ // ── 图片元素(原生 img,不依赖低代码 Image 组件 / convertChildren / cloneElement)
125
+ var imageEl = resultImage && type !== 'textOnly' ? /*#__PURE__*/React.createElement("img", {
126
+ src: resultImage,
127
+ alt: title || '',
128
+ className: "teletext-list__panel__item_image",
135
129
  style: imageStyle
136
- }) : null, type !== 'imgOnly' && itemType === '开关' && /*#__PURE__*/React.createElement("div", {
130
+ }) : null;
131
+
132
+ // ── 开关行(原生 CSS toggle switch;点击不冒泡到 item,状态由页面级事件控制)
133
+ var switchRow = type !== 'imgOnly' && itemType === '开关' ? /*#__PURE__*/React.createElement("div", {
137
134
  className: "teletext-list__panel__item__switch",
138
135
  style: {
139
136
  display: 'flex',
140
137
  alignItems: 'center',
141
138
  justifyContent: 'space-between'
142
139
  }
143
- }, convertChildren(children, "text-1", {
144
- children: [title],
145
- className: "teletext-list__panel__item__switch__title"
146
- }), convertChildren(children, "switch-1", {
147
- children: [itemType],
148
- className: "teletext-list__panel__item__switch__switch"
149
- })), type !== 'imgOnly' && itemType !== '开关' && /*#__PURE__*/React.createElement("div", {
140
+ }, /*#__PURE__*/React.createElement("span", {
141
+ className: "teletext-list__panel__item__switch__title",
142
+ style: {
143
+ color: titleColor,
144
+ fontSize: titleFontSize != null ? titleFontSize + "px" : undefined,
145
+ fontWeight: titleFontWeight,
146
+ WebkitLineClamp: titleLineClamp
147
+ }
148
+ }, title), /*#__PURE__*/React.createElement("label", {
149
+ className: "teletext-list__panel__item__switch__toggle",
150
+ onClick: function onClick(e) {
151
+ return e.stopPropagation();
152
+ }
153
+ }, /*#__PURE__*/React.createElement("input", {
154
+ type: "checkbox"
155
+ }), /*#__PURE__*/React.createElement("span", {
156
+ className: "teletext-list__panel__item__switch__slider"
157
+ }))) : null;
158
+
159
+ // ── 文本区
160
+ var textArea = type !== 'imgOnly' && itemType !== '开关' ? /*#__PURE__*/React.createElement("div", {
150
161
  className: "teletext-list__panel__item__text"
151
162
  }, Array.from({
152
163
  length: textLines
153
164
  }).map(function (_, index) {
154
- // 第一行显示标题,其余行显示描述
155
- var content = function () {
156
- switch (index) {
157
- case 0:
158
- return title;
159
- case 1:
160
- return description;
161
- case 2:
162
- return text3;
163
- case 3:
164
- return text4;
165
- default:
166
- return '';
165
+ return /*#__PURE__*/React.createElement("span", {
166
+ key: index,
167
+ className: "teletext-list__panel__item__text__" + (index === 0 ? 'title' : 'description'),
168
+ style: index === 0 ? {
169
+ color: titleColor,
170
+ fontSize: titleFontSize != null ? titleFontSize + "px" : undefined,
171
+ fontWeight: titleFontWeight,
172
+ WebkitLineClamp: titleLineClamp
173
+ } : {
174
+ color: descriptionColor,
175
+ fontSize: descriptionFontSize != null ? descriptionFontSize + "px" : undefined,
176
+ fontWeight: descriptionFontWeight,
177
+ WebkitLineClamp: descriptionLineClamp
167
178
  }
168
- }();
169
- return convertChildren(children, "text-" + (index + 1), {
170
- children: [content],
171
- className: "teletext-list__panel__item__text__" + (index === 0 ? 'title' : 'description')
172
- });
179
+ }, getTextContent(index, title, description, text3, text4));
173
180
  }), isShoppingCart && /*#__PURE__*/React.createElement("div", {
174
181
  className: "shopping-cart-select"
175
182
  }, /*#__PURE__*/React.createElement("div", {
176
183
  className: "select-box"
177
- }, convertChildren(children, 'select-box-1', {
178
- popType: 'dialog',
179
- selectType: 'number',
180
- value: 1,
181
- prefix: '数量',
182
- dialogTitle: '选择数量',
183
- btnText: '确定',
184
- className: 'teletext-list__panel__item__select'
185
- }), convertChildren(children, 'select-box-2', {
186
- popType: 'dialog',
187
- selectType: 'string',
188
- dataList: [{
189
- label: 'M',
190
- value: 'M'
191
- }, {
192
- label: 'X',
193
- value: 'X'
194
- }, {
195
- label: 'XL',
196
- value: 'XL'
197
- }],
198
- value: 'X',
199
- prefix: '尺码',
200
- dialogTitle: '选择尺码',
201
- btnText: '确定',
202
- className: 'teletext-list__panel__item__select'
203
- })), /*#__PURE__*/React.createElement("div", {
184
+ }, /*#__PURE__*/React.createElement("select", {
185
+ className: "teletext-list__panel__item__select"
186
+ }, [1, 2, 3, 4, 5].map(function (n) {
187
+ return /*#__PURE__*/React.createElement("option", {
188
+ key: n,
189
+ value: n
190
+ }, "\u6570\u91CF: ", n);
191
+ })), /*#__PURE__*/React.createElement("select", {
192
+ className: "teletext-list__panel__item__select"
193
+ }, ['M', 'X', 'XL'].map(function (s) {
194
+ return /*#__PURE__*/React.createElement("option", {
195
+ key: s,
196
+ value: s
197
+ }, "\u5C3A\u7801: ", s);
198
+ }))), /*#__PURE__*/React.createElement("div", {
204
199
  className: "shopping-cart-select__btn"
205
200
  }, /*#__PURE__*/React.createElement("div", {
206
201
  className: "shopping-cart-select__btn__item"
@@ -228,11 +223,12 @@ var TeletextListItem = function TeletextListItem(_ref) {
228
223
  className: "shopping-cart-select-img",
229
224
  src: "https://51ymb.com/source/api/upload/1075055372064133120/2025/202502/20250207/1085235703970926592.png",
230
225
  alt: ""
231
- }), "Remove"))), resultImage && (imagePlacement === 'right' || imagePlacement === 'bottom') && type !== 'textOnly' ? convertChildren(children, 'image', {
232
- imgSrc: resultImage,
233
- className: imageClassName,
234
- style: imageStyle
235
- }) : null, iconList === null || iconList === void 0 ? void 0 : iconList.map(function (icon, index) {
226
+ }), "Remove"))) : null;
227
+ return /*#__PURE__*/React.createElement("div", _extends({
228
+ className: containerClass,
229
+ onClick: onClick,
230
+ style: containerStyle
231
+ }, _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) {
236
232
  return /*#__PURE__*/React.createElement("div", {
237
233
  key: index,
238
234
  className: "teletext-list__panel__item__icon size-" + icon.size,
@@ -80,12 +80,61 @@
80
80
  display: -webkit-box;
81
81
  text-overflow: ellipsis;
82
82
  }
83
- .teletext-list__panel__item__switch__switch {
84
- font-size: 14px;
85
- font-weight: 600;
86
- color: #222222;
83
+ // ─── 原生 toggle switch ────────────────────────────────────────────────────────
84
+ .teletext-list__panel__item__switch__toggle {
85
+ position: relative;
86
+ display: inline-block;
87
+ width: 44px;
88
+ height: 24px;
89
+ flex-shrink: 0;
90
+ cursor: pointer;
91
+
92
+ input {
93
+ opacity: 0;
94
+ width: 0;
95
+ height: 0;
96
+ position: absolute;
97
+ }
98
+
99
+ .teletext-list__panel__item__switch__slider {
100
+ position: absolute;
101
+ inset: 0;
102
+ background-color: #cccccc;
103
+ border-radius: 24px;
104
+ transition: background-color 0.2s;
105
+
106
+ &::before {
107
+ content: '';
108
+ position: absolute;
109
+ width: 18px;
110
+ height: 18px;
111
+ left: 3px;
112
+ top: 3px;
113
+ background-color: #fff;
114
+ border-radius: 50%;
115
+ transition: transform 0.2s;
116
+ }
117
+ }
118
+
119
+ input:checked + .teletext-list__panel__item__switch__slider {
120
+ background-color: #4c84ff;
121
+ &::before {
122
+ transform: translateX(20px);
123
+ }
124
+ }
87
125
  }
88
126
  }
127
+ // ─── 购物车 select 下拉菜单 ──────────────────────────────────────────────────────
128
+ .teletext-list__panel__item__select {
129
+ padding: 4px 8px;
130
+ border: 1px solid #dddddd;
131
+ border-radius: 4px;
132
+ font-size: 12px;
133
+ background: #fff;
134
+ color: #333333;
135
+ outline: none;
136
+ cursor: pointer;
137
+ }
89
138
  .shopping-cart-select {
90
139
  display: flex;
91
140
  flex-direction: column;
@@ -28,6 +28,14 @@ interface DataProps {
28
28
  * 类型
29
29
  */
30
30
  itemType?: string;
31
+ /**
32
+ * 扩展文本行3(textLines >= 3 时显示)
33
+ */
34
+ text3?: string;
35
+ /**
36
+ * 扩展文本行4(textLines >= 4 时显示)
37
+ */
38
+ text4?: string;
31
39
  }
32
40
  export interface IconListProps {
33
41
  /**
@@ -65,10 +73,6 @@ export interface TeletextListProps {
65
73
  * @param e
66
74
  */
67
75
  onClick?: (e: any) => void;
68
- /**
69
- * 子节点
70
- */
71
- children?: React.ReactNode;
72
76
  /**
73
77
  * 图片位置
74
78
  */
@@ -142,6 +146,58 @@ export interface TeletextListProps {
142
146
  * 图文间距
143
147
  */
144
148
  textImgGap?: number;
149
+ /**
150
+ * 图片圆角
151
+ */
152
+ imgBorderRadius?: number;
153
+ /**
154
+ * 图片填充方式
155
+ */
156
+ imgObjectFit?: 'cover' | 'contain' | 'fill' | 'none';
157
+ /**
158
+ * 标题颜色
159
+ */
160
+ titleColor?: string;
161
+ /**
162
+ * 标题字体大小
163
+ */
164
+ titleFontSize?: number;
165
+ /**
166
+ * 标题字重
167
+ */
168
+ titleFontWeight?: 'normal' | '500' | '600' | 'bold';
169
+ /**
170
+ * 标题最大行数(超出省略)
171
+ */
172
+ titleLineClamp?: number;
173
+ /**
174
+ * 说明颜色
175
+ */
176
+ descriptionColor?: string;
177
+ /**
178
+ * 说明字体大小
179
+ */
180
+ descriptionFontSize?: number;
181
+ /**
182
+ * 说明字重
183
+ */
184
+ descriptionFontWeight?: 'normal' | '500' | '600' | 'bold';
185
+ /**
186
+ * 说明最大行数(超出省略)
187
+ */
188
+ descriptionLineClamp?: number;
189
+ /**
190
+ * 列表项圆角
191
+ */
192
+ itemBorderRadius?: number;
193
+ /**
194
+ * 列表项边框颜色
195
+ */
196
+ itemBorderColor?: string;
197
+ /**
198
+ * 列表项边框宽度
199
+ */
200
+ itemBorderWidth?: number;
145
201
  }
146
202
  declare const TeletextList: React.FC<TeletextListProps>;
147
203
  export default TeletextList;