bhd-components 0.10.26 → 0.10.28

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.
@@ -14532,6 +14532,9 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
14532
14532
  setDataSource(function(data) {
14533
14533
  return _to_consumable_array(data).concat(_to_consumable_array(list));
14534
14534
  });
14535
+ setFirstItemIndex(function(num) {
14536
+ return num + 1;
14537
+ });
14535
14538
  // timerRef.current.scrollTimer = setTimeout(() => {
14536
14539
  scrollToBottom();
14537
14540
  // }, 100);
@@ -14549,12 +14552,18 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
14549
14552
  return getList(page, pageSize).then(function(listObj) {
14550
14553
  setLoading(false);
14551
14554
  setDataSource(function(data) {
14552
- return _to_consumable_array(data).concat(_to_consumable_array(listObj.dataSource));
14555
+ return _to_consumable_array(listObj.dataSource).concat(_to_consumable_array(data));
14553
14556
  });
14554
14557
  setTotal(listObj.total);
14555
14558
  setPage(page);
14556
14559
  setPageSize(pageSize);
14557
- setFirstItemIndex(listObj.total - pageSize * (page - 1));
14560
+ if (page === 1) {
14561
+ setFirstItemIndex(listObj.total);
14562
+ } else {
14563
+ setFirstItemIndex(function(prev) {
14564
+ return prev - listObj.dataSource.length;
14565
+ });
14566
+ }
14558
14567
  });
14559
14568
  };
14560
14569
  var getCls = function(clsName) {
@@ -14724,7 +14733,7 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
14724
14733
  };
14725
14734
  var renderAction = function(location, item) {
14726
14735
  if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId || item.hideAction) {
14727
- if (location === "floatBottom") {
14736
+ if (location === "floatBottom" || location === "floatTop") {
14728
14737
  return /*#__PURE__*/ jsx("div", {
14729
14738
  className: "".concat(getCls("msgItem-action-empty"))
14730
14739
  });