dce-reactkit 3.5.6 → 3.5.7
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 +14 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/{ScrollLockToBottomContainer.d.ts → AutoscrollToBottomContainer.d.ts} +5 -3
- package/dist/cjs/types/index.d.ts +2 -2
- package/dist/esm/index.js +14 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/{ScrollLockToBottomContainer.d.ts → AutoscrollToBottomContainer.d.ts} +5 -3
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/index.d.ts +5 -3
- package/package.json +1 -1
- package/src/components/{ScrollLockToBottomContainer.tsx → AutoscrollToBottomContainer.tsx} +14 -12
- package/src/index.ts +2 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Container that automatically scrolls when new items are added,
|
|
3
3
|
* lets the user scroll up to see old items, but resumes
|
|
4
|
-
* autoscroll when the user scrolls back to the bottom
|
|
4
|
+
* autoscroll when the user scrolls back to the bottom.
|
|
5
|
+
* Note: takes up full height of parent, so parent should
|
|
6
|
+
* have a determined height for the scroll to work.
|
|
5
7
|
* @author Gabe Abrams
|
|
6
8
|
*/
|
|
7
9
|
import React from 'react';
|
|
@@ -15,5 +17,5 @@ type AutoScrollItem = {
|
|
|
15
17
|
id: string | number;
|
|
16
18
|
item: React.ReactNode;
|
|
17
19
|
};
|
|
18
|
-
declare const
|
|
19
|
-
export default
|
|
20
|
+
declare const AutoscrollToBottomContainer: React.FC<Props>;
|
|
21
|
+
export default AutoscrollToBottomContainer;
|
|
@@ -19,7 +19,7 @@ import CSVDownloadButton from './components/CSVDownloadButton';
|
|
|
19
19
|
import DBEntryManagerPanel from './components/DBEntryManagerPanel';
|
|
20
20
|
import Tooltip from './components/Tooltip';
|
|
21
21
|
import ToggleSwitch from './components/ToggleSwitch';
|
|
22
|
-
import
|
|
22
|
+
import AutoscrollToBottomContainer from './components/AutoscrollToBottomContainer';
|
|
23
23
|
import ErrorWithCode from './errors/ErrorWithCode';
|
|
24
24
|
import MINUTE_IN_MS from './constants/MINUTE_IN_MS';
|
|
25
25
|
import HOUR_IN_MS from './constants/HOUR_IN_MS';
|
|
@@ -83,4 +83,4 @@ import PickableItem from './components/ItemPicker/types/PickableItem';
|
|
|
83
83
|
import DBEntry from './components/DBEntryManagerPanel/types/DBEntry';
|
|
84
84
|
import DBEntryField from './components/DBEntryManagerPanel/types/DBEntryField';
|
|
85
85
|
import DBEntryFieldType from './components/DBEntryManagerPanel/types/DBEntryFieldType';
|
|
86
|
-
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch,
|
|
86
|
+
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
|
package/dist/index.d.ts
CHANGED
|
@@ -609,7 +609,9 @@ declare const ToggleSwitch: React.FC<Props$1>;
|
|
|
609
609
|
/**
|
|
610
610
|
* Container that automatically scrolls when new items are added,
|
|
611
611
|
* lets the user scroll up to see old items, but resumes
|
|
612
|
-
* autoscroll when the user scrolls back to the bottom
|
|
612
|
+
* autoscroll when the user scrolls back to the bottom.
|
|
613
|
+
* Note: takes up full height of parent, so parent should
|
|
614
|
+
* have a determined height for the scroll to work.
|
|
613
615
|
* @author Gabe Abrams
|
|
614
616
|
*/
|
|
615
617
|
|
|
@@ -622,7 +624,7 @@ type AutoScrollItem = {
|
|
|
622
624
|
id: string | number;
|
|
623
625
|
item: React.ReactNode;
|
|
624
626
|
};
|
|
625
|
-
declare const
|
|
627
|
+
declare const AutoscrollToBottomContainer: React.FC<Props>;
|
|
626
628
|
|
|
627
629
|
/**
|
|
628
630
|
* An error with a code
|
|
@@ -1410,4 +1412,4 @@ declare const LogBuiltInMetadata: {
|
|
|
1410
1412
|
};
|
|
1411
1413
|
};
|
|
1412
1414
|
|
|
1413
|
-
export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode,
|
|
1415
|
+
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntry, DBEntryField, DBEntryFieldType, DBEntryManagerPanel, DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Container that automatically scrolls when new items are added,
|
|
3
3
|
* lets the user scroll up to see old items, but resumes
|
|
4
|
-
* autoscroll when the user scrolls back to the bottom
|
|
4
|
+
* autoscroll when the user scrolls back to the bottom.
|
|
5
|
+
* Note: takes up full height of parent, so parent should
|
|
6
|
+
* have a determined height for the scroll to work.
|
|
5
7
|
* @author Gabe Abrams
|
|
6
8
|
*/
|
|
7
9
|
|
|
@@ -48,13 +50,13 @@ type AutoScrollItem = {
|
|
|
48
50
|
/*------------------------------------------------------------------------*/
|
|
49
51
|
|
|
50
52
|
const style = `
|
|
51
|
-
.
|
|
53
|
+
.AutoscrollToBottomContainer-outer-container {
|
|
52
54
|
/* Take up all space */
|
|
53
55
|
height: 100%;
|
|
54
56
|
position: relative;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
.
|
|
59
|
+
.AutoscrollToBottomContainer-scrollable-container {
|
|
58
60
|
/* Take up max 100% height, don't take it up if not needed */
|
|
59
61
|
/* (so column-reverse layout doesn't start at the bottom) */
|
|
60
62
|
max-height: 100%;
|
|
@@ -69,7 +71,7 @@ const style = `
|
|
|
69
71
|
flex-direction: column-reverse;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
.
|
|
74
|
+
.AutoscrollToBottomContainer-jump-to-bottom-container {
|
|
73
75
|
/* Don't take any space in parent */
|
|
74
76
|
height: 0;
|
|
75
77
|
overflow: visible;
|
|
@@ -86,7 +88,7 @@ const style = `
|
|
|
86
88
|
text-align: center;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
.
|
|
91
|
+
.AutoscrollToBottomContainer-item-container {
|
|
90
92
|
/* Normal Height */
|
|
91
93
|
position: relative;
|
|
92
94
|
z-index: 1;
|
|
@@ -197,7 +199,7 @@ const reducer = (state: State, action: Action): State => {
|
|
|
197
199
|
/* ------------------------------ Component ----------------------------- */
|
|
198
200
|
/*------------------------------------------------------------------------*/
|
|
199
201
|
|
|
200
|
-
const
|
|
202
|
+
const AutoscrollToBottomContainer: React.FC<Props> = (props) => {
|
|
201
203
|
/*------------------------------------------------------------------------*/
|
|
202
204
|
/* -------------------------------- Setup ------------------------------- */
|
|
203
205
|
/*------------------------------------------------------------------------*/
|
|
@@ -385,10 +387,10 @@ const ScrollLockToBottom: React.FC<Props> = (props) => {
|
|
|
385
387
|
let jumpToBottomButton: React.ReactNode;
|
|
386
388
|
if (jumpToBottomButtonVisible) {
|
|
387
389
|
jumpToBottomButton = (
|
|
388
|
-
<div className={`
|
|
390
|
+
<div className={`AutoscrollToBottomContainer-jump-to-bottom-container AutoscrollToBottomContainer-for-${idify(itemsName ?? 'items')}`}>
|
|
389
391
|
<button
|
|
390
392
|
type="button"
|
|
391
|
-
className={`
|
|
393
|
+
className={`AutoscrollToBottomContainer-jump-to-bottom-button AutoscrollToBottomContainer-jump-to-bottom-button-for-${idify(itemsName ?? 'items')} btn btn-sm btn-${jumpToBottomButtonVariant} pt-0 pb-0`}
|
|
392
394
|
onClick={scrollToBottom}
|
|
393
395
|
aria-label="scroll back to bottom and show new content"
|
|
394
396
|
>
|
|
@@ -406,7 +408,7 @@ const ScrollLockToBottom: React.FC<Props> = (props) => {
|
|
|
406
408
|
|
|
407
409
|
// Main UI
|
|
408
410
|
return (
|
|
409
|
-
<div className="
|
|
411
|
+
<div className="AutoscrollToBottomContainer-outer-container">
|
|
410
412
|
{/* Style */}
|
|
411
413
|
<style>
|
|
412
414
|
{style}
|
|
@@ -417,7 +419,7 @@ const ScrollLockToBottom: React.FC<Props> = (props) => {
|
|
|
417
419
|
|
|
418
420
|
{/* Scrollable Item Container */}
|
|
419
421
|
<div
|
|
420
|
-
className="
|
|
422
|
+
className="AutoscrollToBottomContainer-scrollable-container"
|
|
421
423
|
onScroll={() => {
|
|
422
424
|
handleScroll();
|
|
423
425
|
}}
|
|
@@ -430,7 +432,7 @@ const ScrollLockToBottom: React.FC<Props> = (props) => {
|
|
|
430
432
|
.map((item) => {
|
|
431
433
|
return (
|
|
432
434
|
<div
|
|
433
|
-
className="
|
|
435
|
+
className="AutoscrollToBottomContainer-item-container"
|
|
434
436
|
key={item.id}
|
|
435
437
|
>
|
|
436
438
|
{item.item}
|
|
@@ -450,4 +452,4 @@ const ScrollLockToBottom: React.FC<Props> = (props) => {
|
|
|
450
452
|
/*------------------------------------------------------------------------*/
|
|
451
453
|
|
|
452
454
|
// Export component
|
|
453
|
-
export default
|
|
455
|
+
export default AutoscrollToBottomContainer;
|
package/src/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ import CSVDownloadButton from './components/CSVDownloadButton';
|
|
|
25
25
|
import DBEntryManagerPanel from './components/DBEntryManagerPanel';
|
|
26
26
|
import Tooltip from './components/Tooltip';
|
|
27
27
|
import ToggleSwitch from './components/ToggleSwitch';
|
|
28
|
-
import
|
|
28
|
+
import AutoscrollToBottomContainer from './components/AutoscrollToBottomContainer';
|
|
29
29
|
|
|
30
30
|
// Import errors
|
|
31
31
|
import ErrorWithCode from './errors/ErrorWithCode';
|
|
@@ -126,7 +126,7 @@ export {
|
|
|
126
126
|
DBEntryManagerPanel,
|
|
127
127
|
Tooltip,
|
|
128
128
|
ToggleSwitch,
|
|
129
|
-
|
|
129
|
+
AutoscrollToBottomContainer,
|
|
130
130
|
// Global functions
|
|
131
131
|
alert,
|
|
132
132
|
confirm,
|