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/esm/index.js
CHANGED
|
@@ -40811,7 +40811,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
40811
40811
|
/*------------------------------------------------------------------------*/
|
|
40812
40812
|
/* -------------- Props ------------- */
|
|
40813
40813
|
// Destructure all props
|
|
40814
|
-
const { itemsName, items, jumpToBottomButtonVariant = Variant$1.Danger, } = props;
|
|
40814
|
+
const { itemsName, items, jumpToBottomButtonVariant = Variant$1.Danger, messageBeforeItems, messageAfterItems, } = props;
|
|
40815
40815
|
/* -------------- State ------------- */
|
|
40816
40816
|
// Initial state
|
|
40817
40817
|
const initialState = {
|
|
@@ -40905,6 +40905,8 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
40905
40905
|
const currentItemIds = getItemIds(items);
|
|
40906
40906
|
// Check if new content appeared at bottom
|
|
40907
40907
|
const newContentAppeared = (currentItemIds.length > 0
|
|
40908
|
+
&& lastItemIds.current
|
|
40909
|
+
&& lastItemIds.current.length > 0
|
|
40908
40910
|
&& (currentItemIds[currentItemIds.length - 1]
|
|
40909
40911
|
!== lastItemIds.current[lastItemIds.current.length - 1]));
|
|
40910
40912
|
// Do nothing if no new content
|
|
@@ -40948,11 +40950,14 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
40948
40950
|
return (React__default.createElement("div", { className: "AutoscrollToBottomContainer-outer-container" },
|
|
40949
40951
|
React__default.createElement("style", null, style),
|
|
40950
40952
|
jumpToBottomButton,
|
|
40951
|
-
React__default.createElement("div", { className: "AutoscrollToBottomContainer-scrollable-container", onScroll: handleScroll, ref: container },
|
|
40952
|
-
|
|
40953
|
-
|
|
40954
|
-
|
|
40955
|
-
|
|
40953
|
+
React__default.createElement("div", { className: "AutoscrollToBottomContainer-scrollable-container", onScroll: handleScroll, ref: container },
|
|
40954
|
+
messageBeforeItems,
|
|
40955
|
+
items
|
|
40956
|
+
// Render each item with a key
|
|
40957
|
+
.map((item) => {
|
|
40958
|
+
return (React__default.createElement("div", { className: "AutoscrollToBottomContainer-item-container", key: item.id }, item.item));
|
|
40959
|
+
}),
|
|
40960
|
+
messageAfterItems)));
|
|
40956
40961
|
};
|
|
40957
40962
|
|
|
40958
40963
|
/**
|