@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,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", "children", "imagePlacement", "handleMoreClick", "moreText", "title", "textLines", "type", "itemColumns", "iconList", "itemGap", "itemPadding", "imgWidth", "imgHeight", "itemBgColor", "itemRowAlign", "textAlign", "isShoppingCart", "isWishList", "isUserMenu", "textImgGap"];
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
- imgHeight = _ref.imgHeight,
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 getListStyle = function getListStyle() {
46
- if (itemRowAlign === 'row') {
47
- return {
48
- width: 'auto',
49
- display: 'flex',
50
- gap: itemGap + "px",
51
- overflowX: 'auto',
52
- scrollSnapType: 'x mandatory',
53
- WebkitOverflowScrolling: 'touch'
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 getDataList = function getDataList() {
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
- }, convertChildren(children, 'box-title', {
72
- children: [title]
73
- }), moreText ? /*#__PURE__*/React.createElement("div", {
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
- })) : ''), isUserMenu && /*#__PURE__*/React.createElement("div", {
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 " + (itemRowAlign === 'row' ? 'teletext-list__panel__item-list--row' : ''),
91
- style: getListStyle()
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
- return /*#__PURE__*/React.createElement(TeletextListItemComp, _extends({
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
- }, item), children);
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
- 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;
@@ -3,209 +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", "children", "imagePlacement", "description", "type", "textLines", "itemColumns", "itemPadding", "iconList", "tags", "text3", "text4", "imgWidth", "imgHeight", "itemBgColor", "style", "textAlign", "isShoppingCart", "isWishList", "isUserMenu", "itemType", "textImgGap"];
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"];
13
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); }
14
- /**
15
- * 数据
16
- */
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
+ }
17
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
+ }
18
65
  var TeletextListItem = function TeletextListItem(_ref) {
19
66
  var _ref$onClick = _ref.onClick,
20
67
  onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
21
68
  title = _ref.title,
22
69
  image = _ref.image,
23
- children = _ref.children,
24
70
  imagePlacement = _ref.imagePlacement,
25
71
  description = _ref.description,
26
72
  type = _ref.type,
27
- textLines = _ref.textLines,
73
+ _ref$textLines = _ref.textLines,
74
+ textLines = _ref$textLines === void 0 ? 2 : _ref$textLines,
28
75
  itemColumns = _ref.itemColumns,
29
76
  itemPadding = _ref.itemPadding,
30
77
  iconList = _ref.iconList,
31
- tags = _ref.tags,
32
78
  text3 = _ref.text3,
33
79
  text4 = _ref.text4,
34
- imgWidth = _ref.imgWidth,
35
- imgHeight = _ref.imgHeight,
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,
36
84
  itemBgColor = _ref.itemBgColor,
37
85
  style = _ref.style,
38
86
  textAlign = _ref.textAlign,
39
87
  isShoppingCart = _ref.isShoppingCart,
40
88
  isWishList = _ref.isWishList,
41
- isUserMenu = _ref.isUserMenu,
42
89
  itemType = _ref.itemType,
43
90
  _ref$textImgGap = _ref.textImgGap,
44
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,
45
105
  otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
46
- var normalizeNodeKey = function normalizeNodeKey(rawKey) {
47
- if (rawKey === undefined || rawKey === null) {
48
- return '';
49
- }
50
- return String(rawKey).replace(/^\.?\$?/, '');
51
- };
52
106
  var IconComp = _lowcodeMaterials.Icon;
53
- var resultImage = Array.isArray(image) ? image[0] || '' : image || '';
54
107
  var _otherProps = otherProps || {};
55
- var containerClass = "teletext-list__panel__item image-" + imagePlacement + " itemColumns-" + itemColumns;
56
- var childNodeList = _react["default"].Children.toArray(children);
57
- var getChildPropsByKey = function getChildPropsByKey(key) {
58
- var targetKey = normalizeNodeKey(key);
59
- var targetChild = childNodeList.find(function (child) {
60
- var _child$props;
61
- var childKey = normalizeNodeKey(child === null || child === void 0 ? void 0 : child.key);
62
- var childPropsKey = normalizeNodeKey(child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.key);
63
- return childKey === targetKey || childPropsKey === targetKey;
64
- });
65
- return (targetChild === null || targetChild === void 0 ? void 0 : targetChild.props) || {};
108
+
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
66
119
  };
67
- var imageChildProps = getChildPropsByKey('image');
68
- var imageClassName = ['teletext-list__panel__item_image', imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.className].filter(Boolean).join(' ');
69
- // 合并策略:子节点 style 所有属性(含布局面板设置的 margin-left 等)优先保留;
70
- // width/height 若子节点 style 中没有,则用父级 imgWidth/imgHeight prop 兜底补充;
71
- // 两者都没有时,使用默认尺寸 100px 防止图片无尺寸。
72
- // 布局面板 replace style 时可能只保留 margin-left(丢失 width/height),
73
- // 此时 imgWidth/imgHeight prop 的兜底确保图片尺寸不丢失。
74
- var childStyle = (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {};
75
- var DEFAULT_IMG_SIZE = 100;
76
- var imageStyle = (0, _extends2["default"])({}, childStyle, childStyle.width == null ? {
77
- width: (typeof imgWidth === 'number' ? imgWidth : DEFAULT_IMG_SIZE) + "px"
78
- } : {}, childStyle.height == null ? {
79
- height: (typeof imgHeight === 'number' ? imgHeight : DEFAULT_IMG_SIZE) + "px"
80
- } : {});
120
+ var containerClass = "teletext-list__panel__item image-" + imagePlacement + " itemColumns-" + itemColumns;
81
121
  var containerStyle = (0, _extends2["default"])({
82
- padding: itemPadding + "px",
122
+ padding: itemPadding != null ? itemPadding + "px" : undefined,
83
123
  backgroundColor: itemBgColor,
84
124
  alignItems: textAlign,
85
- 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
86
128
  }, style);
87
129
 
88
- // 生成图标样式
89
- var getIconStyle = function getIconStyle(icon) {
90
- var baseStyle = {
91
- position: 'absolute',
92
- zIndex: 10
93
- };
94
- // 默认偏移值
95
- var defaultPosition = {};
96
- switch (icon.position) {
97
- case 'leftTop':
98
- defaultPosition = {
99
- top: '0px',
100
- left: '10px'
101
- };
102
- break;
103
- case 'leftBottom':
104
- defaultPosition = {
105
- bottom: '0px',
106
- left: '10px'
107
- };
108
- break;
109
- case 'rightTop':
110
- defaultPosition = {
111
- top: '0px',
112
- right: '10px'
113
- };
114
- break;
115
- case 'rightBottom':
116
- defaultPosition = {
117
- bottom: '0px',
118
- right: '10px'
119
- };
120
- break;
121
- case 'customize':
122
- defaultPosition = {
123
- right: (icon.rightOffset || 0) + "px",
124
- top: (icon.topOffset || 0) + "px"
125
- };
126
- break;
127
- default:
128
- defaultPosition = {};
129
- break;
130
- }
131
- return (0, _extends2["default"])({}, baseStyle, defaultPosition);
132
- };
133
- return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
134
- className: containerClass,
135
- onClick: onClick,
136
- style: containerStyle
137
- }, _otherProps), resultImage && (imagePlacement === 'left' || imagePlacement === 'top') && type !== 'textOnly' ? (0, _childrenNodeHandle.convertChildren)(children, 'image', {
138
- imgSrc: resultImage,
139
- 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",
140
135
  style: imageStyle
141
- }) : null, type !== 'imgOnly' && itemType === '开关' && /*#__PURE__*/_react["default"].createElement("div", {
136
+ }) : null;
137
+
138
+ // ── 开关行(原生 CSS toggle switch;点击不冒泡到 item,状态由页面级事件控制)
139
+ var switchRow = type !== 'imgOnly' && itemType === '开关' ? /*#__PURE__*/_react["default"].createElement("div", {
142
140
  className: "teletext-list__panel__item__switch",
143
141
  style: {
144
142
  display: 'flex',
145
143
  alignItems: 'center',
146
144
  justifyContent: 'space-between'
147
145
  }
148
- }, (0, _childrenNodeHandle.convertChildren)(children, "text-1", {
149
- children: [title],
150
- className: "teletext-list__panel__item__switch__title"
151
- }), (0, _childrenNodeHandle.convertChildren)(children, "switch-1", {
152
- children: [itemType],
153
- className: "teletext-list__panel__item__switch__switch"
154
- })), type !== 'imgOnly' && itemType !== '开关' && /*#__PURE__*/_react["default"].createElement("div", {
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", {
155
167
  className: "teletext-list__panel__item__text"
156
168
  }, Array.from({
157
169
  length: textLines
158
170
  }).map(function (_, index) {
159
- // 第一行显示标题,其余行显示描述
160
- var content = function () {
161
- switch (index) {
162
- case 0:
163
- return title;
164
- case 1:
165
- return description;
166
- case 2:
167
- return text3;
168
- case 3:
169
- return text4;
170
- default:
171
- return '';
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
172
184
  }
173
- }();
174
- return (0, _childrenNodeHandle.convertChildren)(children, "text-" + (index + 1), {
175
- children: [content],
176
- className: "teletext-list__panel__item__text__" + (index === 0 ? 'title' : 'description')
177
- });
185
+ }, getTextContent(index, title, description, text3, text4));
178
186
  }), isShoppingCart && /*#__PURE__*/_react["default"].createElement("div", {
179
187
  className: "shopping-cart-select"
180
188
  }, /*#__PURE__*/_react["default"].createElement("div", {
181
189
  className: "select-box"
182
- }, (0, _childrenNodeHandle.convertChildren)(children, 'select-box-1', {
183
- popType: 'dialog',
184
- selectType: 'number',
185
- value: 1,
186
- prefix: '数量',
187
- dialogTitle: '选择数量',
188
- btnText: '确定',
189
- className: 'teletext-list__panel__item__select'
190
- }), (0, _childrenNodeHandle.convertChildren)(children, 'select-box-2', {
191
- popType: 'dialog',
192
- selectType: 'string',
193
- dataList: [{
194
- label: 'M',
195
- value: 'M'
196
- }, {
197
- label: 'X',
198
- value: 'X'
199
- }, {
200
- label: 'XL',
201
- value: 'XL'
202
- }],
203
- value: 'X',
204
- prefix: '尺码',
205
- dialogTitle: '选择尺码',
206
- btnText: '确定',
207
- className: 'teletext-list__panel__item__select'
208
- })), /*#__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", {
209
205
  className: "shopping-cart-select__btn"
210
206
  }, /*#__PURE__*/_react["default"].createElement("div", {
211
207
  className: "shopping-cart-select__btn__item"
@@ -233,11 +229,12 @@ var TeletextListItem = function TeletextListItem(_ref) {
233
229
  className: "shopping-cart-select-img",
234
230
  src: "https://51ymb.com/source/api/upload/1075055372064133120/2025/202502/20250207/1085235703970926592.png",
235
231
  alt: ""
236
- }), "Remove"))), resultImage && (imagePlacement === 'right' || imagePlacement === 'bottom') && type !== 'textOnly' ? (0, _childrenNodeHandle.convertChildren)(children, 'image', {
237
- imgSrc: resultImage,
238
- className: imageClassName,
239
- style: imageStyle
240
- }) : null, iconList === null || iconList === void 0 ? void 0 : iconList.map(function (icon, index) {
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) {
241
238
  return /*#__PURE__*/_react["default"].createElement("div", {
242
239
  key: index,
243
240
  className: "teletext-list__panel__item__icon size-" + icon.size,