@topconsultnpm/sdkui-react-beta 6.11.28 → 6.11.30
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.
|
@@ -25,10 +25,12 @@ interface ITMPage<T> {
|
|
|
25
25
|
searchText?: string;
|
|
26
26
|
/** Indica la pagina dell'URL per i link */
|
|
27
27
|
routePage?: string;
|
|
28
|
+
/** Indica quando eseguire il refresh dei dati della lista */
|
|
29
|
+
lastRefreshTime?: Date;
|
|
28
30
|
/** Indica il cambiamento della selezione */
|
|
29
31
|
onSelectionChanged?: (rows: T[]) => void;
|
|
30
32
|
/** Indica il cambiamento dei contatori della lista (totali, selezionati e visibili) */
|
|
31
33
|
onCountersChanged?: (totalItemsCount: number, selectedItemsCount: number, visibleItemsCount: number) => void;
|
|
32
34
|
}
|
|
33
|
-
declare const TMPage: <T>({ id, objClass, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, onSelectionChanged, onCountersChanged }: ITMPage<T>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare const TMPage: <T>({ id, objClass, lastRefreshTime, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, onSelectionChanged, onCountersChanged }: ITMPage<T>) => import("react/jsx-runtime").JSX.Element;
|
|
34
36
|
export default TMPage;
|
|
@@ -17,7 +17,7 @@ import { TMResultManager } from "../forms/TMResultDialog";
|
|
|
17
17
|
import { TMLayoutWaitingContainer } from "../base/TMWaitPanel";
|
|
18
18
|
import TMToolbarCard from "../base/TMToolbarCard";
|
|
19
19
|
let abortController = new AbortController();
|
|
20
|
-
const TMPage = ({ id, objClass = ObjectClasses.None, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, onSelectionChanged, onCountersChanged }) => {
|
|
20
|
+
const TMPage = ({ id, objClass = ObjectClasses.None, lastRefreshTime, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, onSelectionChanged, onCountersChanged }) => {
|
|
21
21
|
const deviceType = useDeviceType();
|
|
22
22
|
let gridInstance;
|
|
23
23
|
const [showId, setShowId] = useState(false);
|
|
@@ -49,6 +49,11 @@ const TMPage = ({ id, objClass = ObjectClasses.None, objType, listInsteadOfConte
|
|
|
49
49
|
setSelectionListDisabled(false);
|
|
50
50
|
(async () => { await loadDataAsync(id); })();
|
|
51
51
|
}, deps && deps.length > 0 ? [deps[0]] : []);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (lastRefreshTime) {
|
|
54
|
+
loadDataAsync(id);
|
|
55
|
+
}
|
|
56
|
+
}, [lastRefreshTime]);
|
|
52
57
|
useEffect(() => { onCountersChanged?.(items.length, selectedItems.length, visibleItems.length); }, [items, selectedItems, visibleItems]);
|
|
53
58
|
const loadDataAsync = async (id) => {
|
|
54
59
|
try {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UserAppSettings } from "@topconsultnpm/sdk-ts-beta";
|
|
2
|
+
import { DeviceType } from "../components";
|
|
2
3
|
export declare class SDKUI_Globals {
|
|
3
4
|
static userAppSettings: UserAppSettings | undefined;
|
|
4
5
|
private static _dataGridShowRowLines;
|
|
@@ -10,4 +11,5 @@ export declare class SDKUI_Globals {
|
|
|
10
11
|
static set dataGridShowColumnLines(theDataGridShowColumnLines: boolean | undefined);
|
|
11
12
|
static get dataGridUseNativeScrollbar(): boolean | undefined;
|
|
12
13
|
static set dataGridUseNativeScrollbar(theDataGridUseNativeScrollbar: boolean | undefined);
|
|
14
|
+
static getListMaxItems(deviceType: DeviceType): number;
|
|
13
15
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeviceType } from "../components";
|
|
1
2
|
export class SDKUI_Globals {
|
|
2
3
|
static get dataGridShowRowLines() { return this._dataGridShowRowLines; }
|
|
3
4
|
static set dataGridShowRowLines(theDataGridShowRowLines) { this._dataGridShowRowLines = theDataGridShowRowLines; }
|
|
@@ -5,4 +6,5 @@ export class SDKUI_Globals {
|
|
|
5
6
|
static set dataGridShowColumnLines(theDataGridShowColumnLines) { this._dataGridShowColumnLines = theDataGridShowColumnLines; }
|
|
6
7
|
static get dataGridUseNativeScrollbar() { return this._dataGridUseNativeScrollbar; }
|
|
7
8
|
static set dataGridUseNativeScrollbar(theDataGridUseNativeScrollbar) { this._dataGridUseNativeScrollbar = theDataGridUseNativeScrollbar; }
|
|
9
|
+
static getListMaxItems(deviceType) { return deviceType === DeviceType.MOBILE ? 8 : 12; }
|
|
8
10
|
}
|