dce-reactkit 3.5.9 → 3.5.10
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.
- package/dist/cjs/index.js +11 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/AutoscrollToBottomContainer.d.ts +2 -0
- package/dist/esm/index.js +11 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AutoscrollToBottomContainer.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/AutoscrollToBottomContainer.tsx +14 -0
package/dist/cjs/index.js
CHANGED
|
@@ -40837,7 +40837,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
40837
40837
|
/*------------------------------------------------------------------------*/
|
|
40838
40838
|
/* -------------- Props ------------- */
|
|
40839
40839
|
// Destructure all props
|
|
40840
|
-
const { itemsName, items, jumpToBottomButtonVariant = Variant$1.Danger, } = props;
|
|
40840
|
+
const { itemsName, items, jumpToBottomButtonVariant = Variant$1.Danger, messageBeforeItems, messageAfterItems, } = props;
|
|
40841
40841
|
/* -------------- State ------------- */
|
|
40842
40842
|
// Initial state
|
|
40843
40843
|
const initialState = {
|
|
@@ -40931,6 +40931,8 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
40931
40931
|
const currentItemIds = getItemIds(items);
|
|
40932
40932
|
// Check if new content appeared at bottom
|
|
40933
40933
|
const newContentAppeared = (currentItemIds.length > 0
|
|
40934
|
+
&& lastItemIds.current
|
|
40935
|
+
&& lastItemIds.current.length > 0
|
|
40934
40936
|
&& (currentItemIds[currentItemIds.length - 1]
|
|
40935
40937
|
!== lastItemIds.current[lastItemIds.current.length - 1]));
|
|
40936
40938
|
// Do nothing if no new content
|
|
@@ -40974,11 +40976,14 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
40974
40976
|
return (React__default["default"].createElement("div", { className: "AutoscrollToBottomContainer-outer-container" },
|
|
40975
40977
|
React__default["default"].createElement("style", null, style),
|
|
40976
40978
|
jumpToBottomButton,
|
|
40977
|
-
React__default["default"].createElement("div", { className: "AutoscrollToBottomContainer-scrollable-container", onScroll: handleScroll, ref: container },
|
|
40978
|
-
|
|
40979
|
-
|
|
40980
|
-
|
|
40981
|
-
|
|
40979
|
+
React__default["default"].createElement("div", { className: "AutoscrollToBottomContainer-scrollable-container", onScroll: handleScroll, ref: container },
|
|
40980
|
+
messageBeforeItems,
|
|
40981
|
+
items
|
|
40982
|
+
// Render each item with a key
|
|
40983
|
+
.map((item) => {
|
|
40984
|
+
return (React__default["default"].createElement("div", { className: "AutoscrollToBottomContainer-item-container", key: item.id }, item.item));
|
|
40985
|
+
}),
|
|
40986
|
+
messageAfterItems)));
|
|
40982
40987
|
};
|
|
40983
40988
|
|
|
40984
40989
|
/**
|