@pisell/materials 2.2.53 → 2.2.54

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/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +14 -14
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +14 -14
  11. package/es/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
  12. package/es/components/dataSourceComponents/dataSourceMenu/Basic.js +13 -3
  13. package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
  14. package/es/components/pisellAnchor/index.d.ts +1 -1
  15. package/es/components/pisellAnchor/index.js +109 -199
  16. package/es/components/pisellAnchor/index.less +3 -5
  17. package/es/components/pisellAvatar/index.js +2 -1
  18. package/es/components/pisellAvatar/index.less +2 -1
  19. package/es/components/pisellModal/components/MobileModal/index.less +4 -0
  20. package/es/components/productCard/locales.d.ts +3 -0
  21. package/es/components/productCard/locales.js +10 -1
  22. package/es/components/productCard/utils.js +8 -2
  23. package/es/components/virtual-keyboard/Number/index.d.ts +0 -1
  24. package/es/index.d.ts +9 -11
  25. package/es/index.js +10 -12
  26. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
  27. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.js +12 -3
  28. package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
  29. package/lib/components/pisellAnchor/index.d.ts +1 -1
  30. package/lib/components/pisellAnchor/index.js +64 -131
  31. package/lib/components/pisellAnchor/index.less +3 -5
  32. package/lib/components/pisellAvatar/index.js +1 -1
  33. package/lib/components/pisellAvatar/index.less +2 -1
  34. package/lib/components/pisellEmpty/index.js +9 -1
  35. package/lib/components/pisellModal/components/MobileModal/index.less +4 -0
  36. package/lib/components/productCard/locales.d.ts +3 -0
  37. package/lib/components/productCard/locales.js +4 -1
  38. package/lib/components/productCard/utils.js +6 -2
  39. package/lib/components/virtual-keyboard/Number/index.d.ts +0 -1
  40. package/lib/index.d.ts +9 -11
  41. package/lib/index.js +9 -15
  42. package/package.json +1 -1
@@ -1,2 +1,8 @@
1
- declare const _default: any;
2
- export default _default;
1
+ import React from 'react';
2
+ import { PisellMenuProps } from '../../pisellMenu/types';
3
+ /**
4
+ * @title: 数据源表单组件
5
+ * @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
6
+ */
7
+ declare const DataSourceMenu: React.ForwardRefExoticComponent<PisellMenuProps & React.RefAttributes<any>>;
8
+ export default DataSourceMenu;
@@ -7,7 +7,7 @@ import BaseMenu from "../../pisellMenu";
7
7
  * @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
8
8
  */
9
9
  var DataSourceMenu = /*#__PURE__*/forwardRef(function (props, ref) {
10
- var _appHelper$utils, _appHelper$utils$getA2;
10
+ var _appHelper$utils, _appHelper$utils$getA2, _appHelper$utils2, _appHelper$utils2$get;
11
11
  var _useEngineContext = useEngineContext(),
12
12
  appHelper = _useEngineContext.appHelper;
13
13
  var _appHelper$utils$getA = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 || (_appHelper$utils$getA2 = _appHelper$utils.getApp) === null || _appHelper$utils$getA2 === void 0 || (_appHelper$utils$getA2 = _appHelper$utils$getA2.call(_appHelper$utils)) === null || _appHelper$utils$getA2 === void 0 || (_appHelper$utils$getA2 = _appHelper$utils$getA2.menuManager) === null || _appHelper$utils$getA2 === void 0 ? void 0 : _appHelper$utils$getA2.useMenu(),
@@ -17,6 +17,16 @@ var DataSourceMenu = /*#__PURE__*/forwardRef(function (props, ref) {
17
17
  setOpenKeys = _appHelper$utils$getA.setOpenKeys,
18
18
  getShowChildren = _appHelper$utils$getA.getShowChildren,
19
19
  handleClick = _appHelper$utils$getA.handleClick;
20
+ var translation = (appHelper === null || appHelper === void 0 || (_appHelper$utils2 = appHelper.utils) === null || _appHelper$utils2 === void 0 || (_appHelper$utils2$get = _appHelper$utils2.getApp) === null || _appHelper$utils2$get === void 0 || (_appHelper$utils2$get = _appHelper$utils2$get.call(_appHelper$utils2)) === null || _appHelper$utils2$get === void 0 || (_appHelper$utils2$get = _appHelper$utils2$get.locales) === null || _appHelper$utils2$get === void 0 ? void 0 : _appHelper$utils2$get.translation) || function (str) {
21
+ if (!str) {
22
+ return '';
23
+ }
24
+ if (typeof str === 'string') {
25
+ return str;
26
+ }
27
+ return JSON.stringify(str);
28
+ };
29
+
20
30
  // 递归渲染菜单项
21
31
  var renderMenuItems = function renderMenuItems(items) {
22
32
  return items.map(function (item) {
@@ -27,7 +37,7 @@ var DataSourceMenu = /*#__PURE__*/forwardRef(function (props, ref) {
27
37
  if (_children !== null && _children !== void 0 && _children.length) {
28
38
  return /*#__PURE__*/React.createElement(BaseMenu.SubMenu, {
29
39
  key: item.key,
30
- title: item.label,
40
+ title: translation(item.label),
31
41
  icon: item.icon,
32
42
  router: item.path
33
43
  }, renderMenuItems(_children));
@@ -36,7 +46,7 @@ var DataSourceMenu = /*#__PURE__*/forwardRef(function (props, ref) {
36
46
  key: item.key,
37
47
  icon: item.icon,
38
48
  router: item.path
39
- }, item.label);
49
+ }, translation(item.label));
40
50
  });
41
51
  };
42
52
  return /*#__PURE__*/React.createElement(BaseMenu, _extends({
@@ -1,2 +1,8 @@
1
- declare const _default: any;
2
- export default _default;
1
+ import React from 'react';
2
+ import { PisellMenuProps } from '../../pisellMenu/types';
3
+ /**
4
+ * @title: 数据源表单组件
5
+ * @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
6
+ */
7
+ declare const DataSourceMenu: (props: PisellMenuProps, ref: React.Ref<any>) => JSX.Element;
8
+ export default DataSourceMenu;
@@ -19,5 +19,5 @@ export interface PisellAnchorProps {
19
19
  */
20
20
  platform?: 'pc' | 'h5';
21
21
  }
22
- declare const PisellAnchor: React.ForwardRefExoticComponent<PisellAnchorProps & React.RefAttributes<any>>;
22
+ declare const PisellAnchor: React.FC<PisellAnchorProps>;
23
23
  export default PisellAnchor;
@@ -5,27 +5,25 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
5
5
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
6
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- import React, { useState, forwardRef, useRef, useEffect } from 'react';
8
+ import React, { useState, useRef, useEffect } from 'react';
9
9
  import classNames from 'classnames';
10
- import { useDebounceFn, useThrottleFn } from 'ahooks';
10
+ import { useDebounceFn } from 'ahooks';
11
11
  import ChevronLeft from '@pisell/icon/es/ChevronLeft';
12
12
  import ChevronRight from '@pisell/icon/es/ChevronRight';
13
13
  import "./index.less";
14
- var PisellAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
15
- var _props$options = props.options,
16
- options = _props$options === void 0 ? [] : _props$options,
17
- tab = props.tab,
18
- className = props.className,
19
- style = props.style,
20
- onChange = props.onChange,
21
- onTabClick = props.onTabClick,
22
- containerRef = props.containerRef,
23
- _props$platform = props.platform,
24
- platform = _props$platform === void 0 ? 'pc' : _props$platform;
14
+ var PisellAnchor = function PisellAnchor(_ref) {
15
+ var _ref$options = _ref.options,
16
+ options = _ref$options === void 0 ? [] : _ref$options,
17
+ tab = _ref.tab,
18
+ className = _ref.className,
19
+ style = _ref.style,
20
+ onChange = _ref.onChange,
21
+ onTabClick = _ref.onTabClick,
22
+ containerRef = _ref.containerRef,
23
+ _ref$platform = _ref.platform,
24
+ platform = _ref$platform === void 0 ? 'pc' : _ref$platform;
25
25
  var contentRef = useRef(null);
26
- var scrollTimeoutRef = useRef(null);
27
26
  var isClickScrolling = useRef(false);
28
- var clickedTabRef = useRef(null);
29
27
  var _useState = useState(0),
30
28
  _useState2 = _slicedToArray(_useState, 2),
31
29
  leftWidth = _useState2[0],
@@ -38,12 +36,8 @@ var PisellAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
38
36
  _useState6 = _slicedToArray(_useState5, 2),
39
37
  showButtons = _useState6[0],
40
38
  setShowButtons = _useState6[1];
41
- var _useState7 = useState(null),
42
- _useState8 = _slicedToArray(_useState7, 2),
43
- hoveredTab = _useState8[0],
44
- setHoveredTab = _useState8[1];
45
39
 
46
- // 检查是否需要显示按钮
40
+ // 检查是否需要显示左右滚动按钮
47
41
  useEffect(function () {
48
42
  if (contentRef.current) {
49
43
  var _contentRef$current = contentRef.current,
@@ -53,199 +47,124 @@ var PisellAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
53
47
  }
54
48
  }, [options]);
55
49
 
56
- // 清理定时器
57
- useEffect(function () {
58
- return function () {
59
- if (scrollTimeoutRef.current) {
60
- clearTimeout(scrollTimeoutRef.current);
61
- }
62
- };
63
- }, []);
64
-
65
50
  // 处理水平滚动
66
- var _useDebounceFn = useDebounceFn(function (e) {
67
- var _e$target = e.target,
68
- scrollLeft = _e$target.scrollLeft,
69
- scrollWidth = _e$target.scrollWidth,
70
- clientWidth = _e$target.clientWidth;
71
- setLeftWidth(scrollLeft > 0 ? 40 : 0);
72
- setRightWidth(scrollLeft + clientWidth >= scrollWidth ? 0 : 40);
73
- }, {
74
- wait: 200
75
- }),
76
- onScrollDebounced = _useDebounceFn.run;
77
-
78
- // 处理垂直滚动
79
- var _useThrottleFn = useThrottleFn(function () {
80
- // 如果是点击触发的滚动,不处理滚动检测
81
- if (isClickScrolling.current) return;
82
- if (!(containerRef !== null && containerRef !== void 0 && containerRef.current)) return;
83
- var container = containerRef.current;
84
- var headerHeight = 65;
85
- var containerRect = container.getBoundingClientRect();
86
- var scrollTop = container.scrollTop;
87
- var containerHeight = containerRect.height;
88
- var scrollHeight = container.scrollHeight;
89
-
90
- // 检查是否滚动到底部
91
- var isAtBottom = scrollTop + containerHeight >= scrollHeight - 50;
92
- if (isAtBottom) {
93
- var lastOption = options[options.length - 1];
94
- // 不要切回到之前点击的 tab
95
- if (tab !== lastOption.id && lastOption.id !== clickedTabRef.current) {
96
- onChange === null || onChange === void 0 || onChange(lastOption.id);
97
- }
98
- return;
51
+ var handleHorizontalScroll = useDebounceFn(function (e) {
52
+ var target = e.target;
53
+ var scrollLeft = target.scrollLeft,
54
+ scrollWidth = target.scrollWidth,
55
+ clientWidth = target.clientWidth;
56
+ setLeftWidth(scrollLeft > 0 ? 40 : 0);
57
+ setRightWidth(scrollLeft + clientWidth >= scrollWidth ? 0 : 40);
58
+ }, {
59
+ wait: 200
60
+ }).run;
61
+
62
+ // 处理内容区域滚动
63
+ var handleContentScroll = useDebounceFn(function () {
64
+ if (isClickScrolling.current || !(containerRef !== null && containerRef !== void 0 && containerRef.current)) return;
65
+ var container = containerRef.current;
66
+ var scrollTop = container.scrollTop;
67
+ var containerHeight = container.clientHeight;
68
+ var scrollHeight = container.scrollHeight;
69
+ // 优先检查是否滚动到底部
70
+ var isAtBottom = Math.abs(scrollTop + containerHeight - scrollHeight) < 1;
71
+ if (isAtBottom) {
72
+ var lastOption = options[options.length - 1];
73
+ if (lastOption && tab !== lastOption.id) {
74
+ onChange === null || onChange === void 0 || onChange(lastOption.id);
99
75
  }
76
+ return; // 如果在底部,直接返回,不再计算可视占比
77
+ }
100
78
 
101
- // 找到当前可见的元素
102
- var closestOption = null;
103
- var minDistance = Infinity;
104
- var _iterator = _createForOfIteratorHelper(options),
105
- _step;
106
- try {
107
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
108
- var option = _step.value;
109
- // 尝试通过ID和data属性查找元素
110
- var elementById = document.getElementById(option.id);
111
- var elementByDataAttr = document.querySelector("[data-section=\"".concat(option.id, "\"]"));
112
- var element = elementById || elementByDataAttr;
113
- if (element) {
114
- // 使用类型断言解决TS错误
115
- var htmlElement = element;
116
-
117
- // 使用offsetTop计算更准确
118
- var elementOffsetTop = htmlElement.offsetTop;
119
- var elementHeight = htmlElement.offsetHeight;
120
-
121
- // 计算可见度
122
- var elementTopRelativeToViewport = elementOffsetTop - scrollTop;
123
- var isTopVisible = elementTopRelativeToViewport >= headerHeight && elementTopRelativeToViewport <= containerHeight;
124
- var isBottomVisible = elementTopRelativeToViewport + elementHeight >= headerHeight && elementTopRelativeToViewport + elementHeight <= containerHeight;
125
- var isElementPartiallyVisible = isTopVisible || isBottomVisible || elementTopRelativeToViewport < headerHeight && elementTopRelativeToViewport + elementHeight > containerHeight;
126
- var distance = Math.abs(elementTopRelativeToViewport - headerHeight);
127
- if (distance < minDistance) {
128
- minDistance = distance;
129
- closestOption = option;
130
- }
79
+ // 如果不在底部,再计算可视占比
80
+ var maxVisibleRatio = 0;
81
+ var activeOption = null;
82
+ var _iterator = _createForOfIteratorHelper(options),
83
+ _step;
84
+ try {
85
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
86
+ var option = _step.value;
87
+ var element = document.querySelector("[data-section=\"".concat(option.id, "\"]"));
88
+ if (element instanceof HTMLElement) {
89
+ var elementTop = element.offsetTop;
90
+ var elementHeight = element.offsetHeight;
91
+ var elementBottom = elementTop + elementHeight;
92
+ var visibleTop = Math.max(elementTop, scrollTop);
93
+ var visibleBottom = Math.min(elementBottom, scrollTop + containerHeight);
94
+ var visibleHeight = Math.max(0, visibleBottom - visibleTop);
95
+ var visibleRatio = visibleHeight / elementHeight;
96
+ if (visibleRatio > maxVisibleRatio) {
97
+ maxVisibleRatio = visibleRatio;
98
+ activeOption = option;
131
99
  }
132
100
  }
133
-
134
- // 不要切回到之前点击的 tab
135
- } catch (err) {
136
- _iterator.e(err);
137
- } finally {
138
- _iterator.f();
139
- }
140
- if (closestOption && tab !== closestOption.id && closestOption.id !== clickedTabRef.current && minDistance < 50) {
141
- onChange === null || onChange === void 0 || onChange(closestOption.id);
142
101
  }
143
- }, {
144
- wait: 150
145
- }),
146
- handleScrollThrottled = _useThrottleFn.run;
102
+ } catch (err) {
103
+ _iterator.e(err);
104
+ } finally {
105
+ _iterator.f();
106
+ }
107
+ if (activeOption && tab !== activeOption.id) {
108
+ onChange === null || onChange === void 0 || onChange(activeOption.id);
109
+ }
110
+ }, {
111
+ wait: 100
112
+ }).run;
147
113
 
148
114
  // 监听容器滚动
149
115
  useEffect(function () {
150
- if (!(containerRef !== null && containerRef !== void 0 && containerRef.current)) return;
151
- var handleScroll = function handleScroll() {
152
- if (!isClickScrolling.current) {
153
- handleScrollThrottled();
154
- }
155
- };
156
- var container = containerRef.current;
157
- container.addEventListener('scroll', handleScroll);
116
+ var container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
117
+ if (!container) return;
118
+ container.addEventListener('scroll', handleContentScroll);
158
119
  return function () {
159
- container.removeEventListener('scroll', handleScroll);
120
+ return container.removeEventListener('scroll', handleContentScroll);
160
121
  };
161
- }, [handleScrollThrottled]);
122
+ }, [handleContentScroll]);
162
123
 
163
- // 点击选项时更新选中项并滚动
124
+ // 点击锚点,滚动到对应位置
164
125
  var handleOptionClick = function handleOptionClick(item) {
165
- // 添加调试日志
166
- console.log('PisellAnchor: Tab clicked', item.id);
167
- if (scrollTimeoutRef.current) {
168
- clearTimeout(scrollTimeoutRef.current);
169
- }
170
-
171
- // 更新选中项
172
126
  onChange === null || onChange === void 0 || onChange(item.id);
173
-
174
- // 触发点击事件回调
175
127
  onTabClick === null || onTabClick === void 0 || onTabClick();
176
-
177
- // 统一PC和H5的交互逻辑,无论什么平台都执行滚动
178
- // 尝试多种方式查找目标元素
179
- var elementById = document.getElementById(String(item.id));
180
- var elementByDataAttr = document.querySelector("[data-section=\"".concat(String(item.id), "\"]"));
181
- var element = elementById || elementByDataAttr;
182
-
183
- // 添加调试日志
184
- console.log('PisellAnchor: Target element found?', !!element);
185
- console.log('PisellAnchor: Container ref exists?', !!(containerRef !== null && containerRef !== void 0 && containerRef.current));
186
- if (element && containerRef !== null && containerRef !== void 0 && containerRef.current) {
128
+ var targetElement = document.querySelector("[data-section=\"".concat(item.id, "\"]"));
129
+ if (targetElement instanceof HTMLElement && containerRef !== null && containerRef !== void 0 && containerRef.current) {
187
130
  isClickScrolling.current = true;
188
- clickedTabRef.current = item.id;
189
-
190
- // 使用requestAnimationFrame确保DOM更新后再滚动
191
- requestAnimationFrame(function () {
192
- if (!(containerRef !== null && containerRef !== void 0 && containerRef.current)) return;
193
-
194
- // 使用类型断言解决TS错误
195
- var htmlElement = element;
196
-
197
- // 更准确的滚动位置计算
198
- var headerHeight = 65; // 使用一致的头部高度
199
- var elementOffsetTop = htmlElement.offsetTop; // 使用offsetTop而不是getBoundingClientRect()
200
-
201
- // 添加调试日志
202
- console.log('PisellAnchor: Scrolling using offsetTop', {
203
- elementOffsetTop: elementOffsetTop,
204
- targetScrollTop: elementOffsetTop - headerHeight
205
- });
206
-
207
- // 执行滚动 - 使用更直接的offsetTop定位
208
- containerRef.current.scrollTo({
209
- top: elementOffsetTop - headerHeight,
210
- behavior: 'smooth'
211
- });
212
-
213
- // 添加备份滚动机制
214
- setTimeout(function () {
215
- if (!(containerRef !== null && containerRef !== void 0 && containerRef.current)) return;
216
131
 
217
- // 强制再次滚动以确保滚动效果
218
- containerRef.current.scrollTo({
219
- top: elementOffsetTop - headerHeight,
220
- behavior: 'auto' // 使用即时滚动确保位置准确
221
- });
222
- }, 300);
132
+ // 计算目标元素之前所有元素的高度总和
133
+ var scrollDistance = 0;
134
+ var _iterator2 = _createForOfIteratorHelper(options),
135
+ _step2;
136
+ try {
137
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
138
+ var option = _step2.value;
139
+ if (option.id === item.id) break;
140
+ var element = document.querySelector("[data-section=\"".concat(option.id, "\"]"));
141
+ if (element instanceof HTMLElement) {
142
+ scrollDistance += element.offsetHeight;
143
+ }
144
+ }
145
+ } catch (err) {
146
+ _iterator2.e(err);
147
+ } finally {
148
+ _iterator2.f();
149
+ }
150
+ containerRef.current.scrollTo({
151
+ top: scrollDistance,
152
+ behavior: 'smooth'
223
153
  });
224
-
225
- // 延迟重置状态
226
- scrollTimeoutRef.current = setTimeout(function () {
154
+ setTimeout(function () {
227
155
  isClickScrolling.current = false;
228
- clickedTabRef.current = null;
229
156
  }, 1000);
230
- } else {
231
- console.warn('PisellAnchor: Cannot scroll, element or container not found', {
232
- elementId: item.id,
233
- elementByIdExists: !!elementById,
234
- elementByDataAttrExists: !!elementByDataAttr,
235
- containerExists: !!(containerRef !== null && containerRef !== void 0 && containerRef.current)
236
- });
237
157
  }
238
158
  };
239
159
 
240
160
  // 左右按钮点击处理
241
- var onPageChange = function onPageChange(type) {
161
+ var handlePageChange = function handlePageChange(type) {
242
162
  if (contentRef.current) {
243
163
  var _contentRef$current2 = contentRef.current,
244
164
  scrollLeft = _contentRef$current2.scrollLeft,
245
165
  clientWidth = _contentRef$current2.clientWidth;
246
- var newScrollLeft = scrollLeft + (type === 'left' ? -clientWidth : clientWidth);
247
166
  contentRef.current.scrollTo({
248
- left: newScrollLeft,
167
+ left: scrollLeft + (type === 'left' ? -clientWidth : clientWidth),
249
168
  behavior: 'smooth'
250
169
  });
251
170
  }
@@ -259,34 +178,25 @@ var PisellAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
259
178
  width: leftWidth
260
179
  },
261
180
  onClick: function onClick() {
262
- return onPageChange('left');
181
+ return handlePageChange('left');
263
182
  }
264
183
  }, /*#__PURE__*/React.createElement(ChevronLeft, {
265
184
  className: "pisell-anchor-tabs-btn-icon"
266
185
  })), /*#__PURE__*/React.createElement("div", {
267
186
  ref: contentRef,
268
187
  className: "pisell-anchor-tabs-content",
269
- id: "tab-".concat(tab, "-content"),
270
- onScroll: onScrollDebounced
188
+ onScroll: handleHorizontalScroll
271
189
  }, options.map(function (item) {
272
190
  return /*#__PURE__*/React.createElement("div", {
273
191
  key: item.id,
274
- id: "tab-".concat(item.id),
275
192
  className: classNames('pisell-anchor-tabs-tab', {
276
193
  'pisell-anchor-tabs-tab-active': tab === item.id
277
194
  }),
278
195
  onClick: function onClick() {
279
- console.log('PisellAnchor: Tab div clicked', item.id);
280
- handleOptionClick(item);
196
+ return handleOptionClick(item);
281
197
  }
282
198
  }, /*#__PURE__*/React.createElement("span", {
283
- className: "pisell-anchor-tabs-tab-content",
284
- onClick: function onClick(e) {
285
- // 防止事件冒泡问题
286
- e.stopPropagation();
287
- console.log('PisellAnchor: Tab span clicked', item.id);
288
- handleOptionClick(item);
289
- }
199
+ className: "pisell-anchor-tabs-tab-content"
290
200
  }, item.name));
291
201
  })), showButtons && /*#__PURE__*/React.createElement("div", {
292
202
  className: "pisell-anchor-tabs-btn-right",
@@ -294,10 +204,10 @@ var PisellAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
294
204
  width: rightWidth
295
205
  },
296
206
  onClick: function onClick() {
297
- return onPageChange('right');
207
+ return handlePageChange('right');
298
208
  }
299
209
  }, /*#__PURE__*/React.createElement(ChevronRight, {
300
210
  className: "pisell-anchor-tabs-btn-icon"
301
211
  })));
302
- });
212
+ };
303
213
  export default PisellAnchor;
@@ -114,7 +114,7 @@
114
114
  display: flex;
115
115
  align-items: center;
116
116
  justify-content: center;
117
- background: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0.8) 100%);
117
+ background:none;
118
118
  cursor: pointer;
119
119
  transition: width 300ms ease;
120
120
  user-select: none;
@@ -134,12 +134,10 @@
134
134
 
135
135
  .pisell-anchor-tabs-btn-left {
136
136
  left: 0;
137
- background: linear-gradient(270deg, rgba(255, 255, 255, 0.8) 0%, #fff 70%);
138
137
  }
139
138
 
140
139
  .pisell-anchor-tabs-btn-right {
141
140
  right: 0;
142
- background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, #fff 70%);
143
141
  }
144
142
 
145
143
  .pisell-anchor-tabs-content {
@@ -172,7 +170,7 @@
172
170
  border-radius: 100px;
173
171
 
174
172
  &:hover:not(.pisell-anchor-tabs-tab-active) {
175
- color: var(--theme-color, #7f56d9);
173
+ color: inherit;
176
174
  }
177
175
 
178
176
  &.pisell-anchor-tabs-tab-active {
@@ -189,7 +187,7 @@
189
187
  }
190
188
 
191
189
  .pisell-anchor {
192
- border-bottom: 1px solid #EAECF0;
190
+ border-bottom: 1px solid #eaecf0;
193
191
 
194
192
  &.pisell-anchor-no-border {
195
193
  border-bottom: none;
@@ -73,7 +73,8 @@ var PisellAvatar = function PisellAvatar(_ref) {
73
73
  return children;
74
74
  }
75
75
  return /*#__PURE__*/React.createElement(Iconfont, {
76
- type: "pisell2-user-01"
76
+ type: "pisell2-user-01",
77
+ className: "pisell-avatar-icon"
77
78
  });
78
79
  }, [useTextAvatar, children]);
79
80
  return /*#__PURE__*/React.createElement(Avatar, _extends({}, restProps, {
@@ -5,7 +5,7 @@
5
5
  align-items: center;
6
6
  justify-content: center;
7
7
  background: var(--Gray-100, #f2f4f7); // 默认背景色
8
- border: 1px solid #D0D5DD; // 移除默认边框
8
+ border: 1px solid #d0d5dd; // 移除默认边框
9
9
  box-sizing: border-box;
10
10
 
11
11
  img {
@@ -14,6 +14,7 @@
14
14
 
15
15
  .anticon {
16
16
  font-size: inherit !important;
17
+ color: var(--Gray-600, #475467) !important;
17
18
  }
18
19
 
19
20
  // 文本头像样式
@@ -17,14 +17,18 @@
17
17
  overflow: hidden;
18
18
  max-height: 90%;
19
19
  min-height: 200px;
20
+ display: flex;
21
+ flex-direction: column;
20
22
  }
21
23
  .pisell-lowcode-modal-content {
24
+ flex: 1;
22
25
  padding: 0;
23
26
  border-radius: 0;
24
27
  height: 100%;
25
28
  display: flex;
26
29
  flex-direction: column;
27
30
  max-height: none;
31
+ min-height: 200px;
28
32
  .pisell-lowcode-modal-close {
29
33
  padding: 10px;
30
34
  top: 8px;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  en: {
3
3
  'pisell2.product.card.day': (val: number) => string;
4
+ 'pisell2.product.card.day.event': (val: number) => string;
4
5
  'pisell2.product.card.discount.reason': string;
5
6
  'pisell2.product.card.discount.note': string;
6
7
  'pisell2.product.card.discount.add.note': string;
@@ -14,6 +15,7 @@ declare const _default: {
14
15
  };
15
16
  'zh-CN': {
16
17
  'pisell2.product.card.day': (val: number) => string;
18
+ 'pisell2.product.card.day.event': (val: number) => string;
17
19
  'pisell2.product.card.discount.reason': string;
18
20
  'pisell2.product.card.discount.note': string;
19
21
  'pisell2.product.card.discount.add.note': string;
@@ -27,6 +29,7 @@ declare const _default: {
27
29
  };
28
30
  'zh-HK': {
29
31
  'pisell2.product.card.day': (val: number) => string;
32
+ 'pisell2.product.card.day.event': (val: number) => string;
30
33
  'pisell2.product.card.discount.reason': string;
31
34
  'pisell2.product.card.discount.note': string;
32
35
  'pisell2.product.card.discount.add.note': string;
@@ -1,7 +1,10 @@
1
1
  export default {
2
2
  'en': {
3
3
  'pisell2.product.card.day': function pisell2ProductCardDay(val) {
4
- return "".concat(val > 1 ? 'days' : 'day');
4
+ return "".concat(val > 1 ? ' days' : ' day');
5
+ },
6
+ 'pisell2.product.card.day.event': function pisell2ProductCardDayEvent(val) {
7
+ return "".concat(val > 1 ? ' events' : ' event');
5
8
  },
6
9
  'pisell2.product.card.discount.reason': 'Discount reason',
7
10
  'pisell2.product.card.discount.note': 'Note',
@@ -18,6 +21,9 @@ export default {
18
21
  'pisell2.product.card.day': function pisell2ProductCardDay(val) {
19
22
  return '天';
20
23
  },
24
+ 'pisell2.product.card.day.event': function pisell2ProductCardDayEvent(val) {
25
+ return '个活动';
26
+ },
21
27
  'pisell2.product.card.discount.reason': '折扣原因',
22
28
  'pisell2.product.card.discount.note': '备注',
23
29
  'pisell2.product.card.discount.add.note': '添加备注',
@@ -33,6 +39,9 @@ export default {
33
39
  'pisell2.product.card.day': function pisell2ProductCardDay(val) {
34
40
  return '天';
35
41
  },
42
+ 'pisell2.product.card.day.event': function pisell2ProductCardDayEvent(val) {
43
+ return '个活動';
44
+ },
36
45
  'pisell2.product.card.discount.reason': '折扣原因',
37
46
  'pisell2.product.card.discount.note': '備註',
38
47
  'pisell2.product.card.discount.add.note': '添加備註',
@@ -68,7 +68,7 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
68
68
  dayjs.locale(localeTypes[locale]);
69
69
  var startDate = dayjs(item === null || item === void 0 ? void 0 : item.start_date);
70
70
  var endDate = dayjs(item === null || item === void 0 ? void 0 : item.end_date);
71
- var diffInDays = endDate.diff(startDate, 'day');
71
+ var diffInDays = (item === null || item === void 0 ? void 0 : item.custom_day_count) || endDate.diff(startDate, 'day');
72
72
  var _format = isEn ? 'ddd, DD/MM/YYYY' : 'YYYY-MM-DD,ddd';
73
73
 
74
74
  // 是否自定义格式
@@ -83,6 +83,12 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
83
83
  endDate = dayjs("".concat(item === null || item === void 0 ? void 0 : item.end_date, " ").concat(item === null || item === void 0 ? void 0 : item.end_time));
84
84
  }
85
85
  var date = "".concat(startDate.format(_format), " ~ ").concat(endDate.format(_format));
86
- var duration = "".concat(diffInDays, " ").concat(locales.getText('pisell2.product.card.day')(diffInDays));
86
+
87
+ // 自定义文案
88
+ var text = locales.getText('pisell2.product.card.day')(diffInDays);
89
+ if (item !== null && item !== void 0 && item.custom_day_count) {
90
+ text = locales.getText('pisell2.product.card.day.event')(diffInDays);
91
+ }
92
+ var duration = "".concat(diffInDays).concat(text);
87
93
  return "".concat(date, " (").concat(duration, ")");
88
94
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface NumberProps {
3
2
  max?: number;
4
3
  min?: number;