@pisell/materials 2.2.52 → 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 (151) 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/Pagination/index.d.ts +1 -1
  12. package/es/components/TimeResourceSelector/index.d.ts +21 -0
  13. package/es/components/appVersionControl/index.d.ts +1 -0
  14. package/es/components/collapse/index.d.ts +15 -0
  15. package/es/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
  16. package/es/components/dataSourceComponents/dataSourceMenu/Basic.js +13 -3
  17. package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
  18. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +1 -0
  19. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
  20. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
  21. package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +1 -0
  22. package/es/components/dataSourceComponents/fields/index.d.ts +11 -11
  23. package/es/components/drag-sort-tree/index.d.ts +1 -0
  24. package/es/components/page/index.d.ts +1 -0
  25. package/es/components/pisellAnchor/index.d.ts +1 -1
  26. package/es/components/pisellAnchor/index.js +109 -199
  27. package/es/components/pisellAnchor/index.less +3 -5
  28. package/es/components/pisellAvatar/index.js +2 -1
  29. package/es/components/pisellAvatar/index.less +2 -1
  30. package/es/components/pisellCard/index.d.ts +20 -0
  31. package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  32. package/es/components/pisellDropdown/index.d.ts +20 -0
  33. package/es/components/pisellHeaderProgressBar/index.d.ts +29 -0
  34. package/es/components/pisellImageCarousels/index.d.ts +18 -0
  35. package/es/components/pisellModal/components/MobileModal/index.less +4 -0
  36. package/es/components/pisellSectionHeaders/index.d.ts +21 -0
  37. package/es/components/pisellText/components/Amount/index.d.ts +20 -0
  38. package/es/components/productCard/components/Action/index.d.ts +4 -0
  39. package/es/components/productCard/components/AmountFooter/index.d.ts +4 -0
  40. package/es/components/productCard/components/Divider/index.d.ts +4 -0
  41. package/es/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
  42. package/es/components/productCard/components/Header/index.d.ts +4 -0
  43. package/es/components/productCard/components/MultiDay/index.d.ts +4 -0
  44. package/es/components/productCard/components/MultiDay/utils.d.ts +14 -0
  45. package/es/components/productCard/components/Note/index.d.ts +4 -0
  46. package/es/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
  47. package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
  48. package/es/components/productCard/components/Packages/components/options/index.d.ts +4 -0
  49. package/es/components/productCard/components/Packages/index.d.ts +4 -0
  50. package/es/components/productCard/components/Packages/utils.d.ts +20 -0
  51. package/es/components/productCard/components/Sales/index.d.ts +4 -0
  52. package/es/components/productCard/components/Time/components/Like/index.d.ts +9 -0
  53. package/es/components/productCard/components/Time/index.d.ts +4 -0
  54. package/es/components/productCard/locales.d.ts +3 -0
  55. package/es/components/productCard/locales.js +10 -1
  56. package/es/components/productCard/status.d.ts +32 -0
  57. package/es/components/productCard/types.d.ts +78 -0
  58. package/es/components/productCard/utils.js +8 -2
  59. package/es/components/section-footers/index.d.ts +9 -0
  60. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +1 -0
  61. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +1 -0
  62. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +1 -0
  63. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +1 -0
  64. package/es/components/table/Actions/component/ExportImport/index.d.ts +1 -0
  65. package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
  66. package/es/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
  67. package/es/components/table/Actions/component/Group/index.d.ts +1 -0
  68. package/es/components/table/Actions/component/ViewMode/index.d.ts +1 -0
  69. package/es/components/table/Actions/index.d.ts +1 -0
  70. package/es/components/table/BasicTable/index.d.ts +1 -0
  71. package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
  72. package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
  73. package/es/components/table/Table/tableConfig/SortRow/index.d.ts +1 -0
  74. package/es/components/table/View/index.d.ts +1 -0
  75. package/es/components/virtual-keyboard/Number/index.d.ts +0 -1
  76. package/es/components/walletCard/Guest/index.d.ts +4 -0
  77. package/es/components/walletCard/index.d.ts +65 -0
  78. package/es/index.d.ts +9 -11
  79. package/es/index.js +10 -12
  80. package/lib/components/Pagination/index.d.ts +1 -1
  81. package/lib/components/TimeResourceSelector/index.d.ts +21 -0
  82. package/lib/components/appVersionControl/index.d.ts +1 -0
  83. package/lib/components/collapse/index.d.ts +15 -0
  84. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
  85. package/lib/components/dataSourceComponents/dataSourceMenu/Basic.js +12 -3
  86. package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
  87. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +1 -0
  88. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
  89. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
  90. package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +1 -0
  91. package/lib/components/dataSourceComponents/fields/index.d.ts +11 -11
  92. package/lib/components/drag-sort-tree/index.d.ts +1 -0
  93. package/lib/components/page/index.d.ts +1 -0
  94. package/lib/components/pisellAnchor/index.d.ts +1 -1
  95. package/lib/components/pisellAnchor/index.js +64 -131
  96. package/lib/components/pisellAnchor/index.less +3 -5
  97. package/lib/components/pisellAvatar/index.js +1 -1
  98. package/lib/components/pisellAvatar/index.less +2 -1
  99. package/lib/components/pisellCard/index.d.ts +20 -0
  100. package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  101. package/lib/components/pisellDropdown/index.d.ts +20 -0
  102. package/lib/components/pisellEmpty/index.js +9 -1
  103. package/lib/components/pisellHeaderProgressBar/index.d.ts +29 -0
  104. package/lib/components/pisellImageCarousels/index.d.ts +18 -0
  105. package/lib/components/pisellModal/components/MobileModal/index.less +4 -0
  106. package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
  107. package/lib/components/pisellText/components/Amount/index.d.ts +20 -0
  108. package/lib/components/productCard/components/Action/index.d.ts +4 -0
  109. package/lib/components/productCard/components/AmountFooter/index.d.ts +4 -0
  110. package/lib/components/productCard/components/Divider/index.d.ts +4 -0
  111. package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
  112. package/lib/components/productCard/components/Header/index.d.ts +4 -0
  113. package/lib/components/productCard/components/MultiDay/index.d.ts +4 -0
  114. package/lib/components/productCard/components/MultiDay/utils.d.ts +14 -0
  115. package/lib/components/productCard/components/Note/index.d.ts +4 -0
  116. package/lib/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
  117. package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
  118. package/lib/components/productCard/components/Packages/components/options/index.d.ts +4 -0
  119. package/lib/components/productCard/components/Packages/index.d.ts +4 -0
  120. package/lib/components/productCard/components/Packages/utils.d.ts +20 -0
  121. package/lib/components/productCard/components/Sales/index.d.ts +4 -0
  122. package/lib/components/productCard/components/Time/components/Like/index.d.ts +9 -0
  123. package/lib/components/productCard/components/Time/index.d.ts +4 -0
  124. package/lib/components/productCard/locales.d.ts +3 -0
  125. package/lib/components/productCard/locales.js +4 -1
  126. package/lib/components/productCard/status.d.ts +32 -0
  127. package/lib/components/productCard/types.d.ts +78 -0
  128. package/lib/components/productCard/utils.js +6 -2
  129. package/lib/components/section-footers/index.d.ts +9 -0
  130. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +1 -0
  131. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +1 -0
  132. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +1 -0
  133. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +1 -0
  134. package/lib/components/table/Actions/component/ExportImport/index.d.ts +1 -0
  135. package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
  136. package/lib/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
  137. package/lib/components/table/Actions/component/Group/index.d.ts +1 -0
  138. package/lib/components/table/Actions/component/ViewMode/index.d.ts +1 -0
  139. package/lib/components/table/Actions/index.d.ts +1 -0
  140. package/lib/components/table/BasicTable/index.d.ts +1 -0
  141. package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
  142. package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
  143. package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +1 -0
  144. package/lib/components/table/View/index.d.ts +1 -0
  145. package/lib/components/virtual-keyboard/Number/index.d.ts +0 -1
  146. package/lib/components/walletCard/Guest/index.d.ts +4 -0
  147. package/lib/components/walletCard/index.d.ts +65 -0
  148. package/lib/index.d.ts +9 -11
  149. package/lib/index.js +9 -15
  150. package/lowcode/button-group/meta.ts +1 -4
  151. package/package.json +3 -3
@@ -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
  // 文本头像样式
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { CardProps } from 'antd';
3
+ import './index.less';
4
+ export interface PisellCardProps extends CardProps {
5
+ bordered?: boolean;
6
+ selected?: boolean;
7
+ loading?: boolean;
8
+ padding?: number;
9
+ borderRadius?: number;
10
+ disabled?: boolean;
11
+ onClick?: () => void;
12
+ isClickable?: boolean;
13
+ }
14
+ /**
15
+ * Pisell 卡片容器组件
16
+ * @param props
17
+ * @constructor
18
+ */
19
+ declare const PisellCard: (props: PisellCardProps) => JSX.Element;
20
+ export default PisellCard;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellCustomCheckboxGroupProps {
4
+ dataSource?: any[];
5
+ disabled?: boolean;
6
+ allowAdd?: boolean;
7
+ isMultiple?: boolean;
8
+ id?: string | string[];
9
+ onClick?: (value: any) => void;
10
+ onAdd?: () => void;
11
+ renderAddItem?: (item: any) => React.ReactNode;
12
+ [key: string]: any;
13
+ className?: string;
14
+ }
15
+ declare const PisellCustomCheckboxGroup: React.FC<PisellCustomCheckboxGroupProps>;
16
+ export default PisellCustomCheckboxGroup;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface MenuItemType {
4
+ key: string;
5
+ label: string;
6
+ icon?: React.ReactNode;
7
+ shortcut?: string;
8
+ divider?: boolean;
9
+ }
10
+ export interface PisellDropdownProps {
11
+ trigger?: React.ReactNode;
12
+ items?: MenuItemType[];
13
+ showShortcut?: boolean;
14
+ triggerType?: ('click' | 'hover')[];
15
+ className?: string;
16
+ style?: React.CSSProperties;
17
+ onSelect?: (key: string) => void;
18
+ }
19
+ declare const PisellDropdown: React.FC<PisellDropdownProps>;
20
+ export default PisellDropdown;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellHeaderProgressBarProps {
4
+ title?: React.ReactNode;
5
+ stepText?: React.ReactNode;
6
+ showClose?: boolean;
7
+ /** 是否启用投影 */
8
+ enableShadow?: boolean;
9
+ /** 是否启用描边 */
10
+ enableBorder?: boolean;
11
+ /** 描边粗细 */
12
+ borderWidth?: number;
13
+ /** 描边颜色 */
14
+ borderColor?: string;
15
+ /** 头部背景颜色 */
16
+ backgroundColor?: string;
17
+ /** 自定义类名 */
18
+ className?: string;
19
+ /** 自定义样式 */
20
+ style?: React.CSSProperties;
21
+ /** 是否显示返回键 */
22
+ showBack?: boolean;
23
+ /** 返回按钮点击事件 */
24
+ onBack?: () => void;
25
+ /** 关闭按钮点击事件 */
26
+ onClose?: () => void;
27
+ }
28
+ declare const PisellHeaderProgressBar: React.FC<PisellHeaderProgressBarProps>;
29
+ export default PisellHeaderProgressBar;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import 'swiper/swiper-bundle.css';
3
+ import './index.less';
4
+ export interface PisellImageCarouselsProps {
5
+ dataSource?: string[];
6
+ width?: number | string;
7
+ height?: number;
8
+ showArrows?: boolean;
9
+ showDots?: boolean;
10
+ autoplay?: boolean;
11
+ interval?: number;
12
+ borderRadius?: number;
13
+ loop?: boolean;
14
+ className?: string;
15
+ style?: React.CSSProperties;
16
+ }
17
+ declare const PisellImageCarousels: React.FC<PisellImageCarouselsProps>;
18
+ export default PisellImageCarousels;
@@ -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;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellSectionHeadersProps {
4
+ /** 是否占据空间(true: 占据空间, false: 不占据空间) */
5
+ /** 左侧返回区域 */
6
+ backNode?: React.ReactNode;
7
+ /** 中间内容区域 */
8
+ centerNode?: React.ReactNode;
9
+ /** 右侧操作区域 */
10
+ actionNode?: React.ReactNode;
11
+ /** 自定义类名 */
12
+ className?: string;
13
+ /** 自定义样式 */
14
+ style?: React.CSSProperties;
15
+ /** 返回按钮点击事件 */
16
+ onBack?: () => void;
17
+ /** 操作区域点击事件 */
18
+ onAction?: () => void;
19
+ }
20
+ declare const PisellSectionHeaders: React.FC<PisellSectionHeadersProps>;
21
+ export default PisellSectionHeaders;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { PisellContextType } from '../../../pisell-config-provider/context';
3
+ export interface AmountProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ /** 平台 */
5
+ platform?: PisellContextType['platform'];
6
+ /** 当前数值 */
7
+ value?: number | string;
8
+ /** 小数点后位数 默认是小数点后2位 */
9
+ precision?: number;
10
+ /** 显示货币符号 指的是 ¥$ 等货币符号等显隐,默认是展示 */
11
+ showCurrencySymbol?: boolean;
12
+ /** 千分位 指的是长金额的千分位逗号隔开,比如“123, 245, 315” 这种展现形式,默认是关闭 */
13
+ useThousandsSeparator?: boolean;
14
+ /** 整数位隐藏小数 指的是如果价格为整数,后面的".00" 将被省略以节省页面空间 */
15
+ hideDecimalForWholeNumbers?: boolean;
16
+ /** 货币符号 */
17
+ symbol?: string;
18
+ }
19
+ declare const Amount: (props: AmountProps) => JSX.Element;
20
+ export default Amount;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare const Action: ({ item, onAction }: any) => JSX.Element;
4
+ export default Action;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare const Footer: ({ item, hideDivider, type, isOnlyTotal }: any) => JSX.Element;
4
+ export default Footer;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare const Divider: ({ type }: any) => JSX.Element;
4
+ export default Divider;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare const DeleteButton: ({ onDelete }: any) => JSX.Element;
4
+ export default DeleteButton;