@topconsultnpm/sdkui-react-beta 6.8.16 → 6.8.17
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/lib/helper/helpers.d.ts +1 -0
- package/lib/helper/helpers.js +12 -0
- package/package.json +1 -1
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ export declare function buildtype(module: moduleTypes): string;
|
|
|
29
29
|
export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
|
|
30
30
|
export declare const svgToString: (icon: React.ReactElement) => string;
|
|
31
31
|
export declare function sleep(ms: number): Promise<void>;
|
|
32
|
+
export declare const dialogConfirmOperation: (title: string, msg: string, operationAsync: () => Promise<void>) => void;
|
|
32
33
|
export declare function getExceptionMessage(ex: any): string;
|
package/lib/helper/helpers.js
CHANGED
|
@@ -299,6 +299,18 @@ export const svgToString = (icon) => {
|
|
|
299
299
|
export async function sleep(ms) {
|
|
300
300
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
301
301
|
}
|
|
302
|
+
// #region Dialog
|
|
303
|
+
export const dialogConfirmOperation = (title, msg, operationAsync) => {
|
|
304
|
+
TMMessageBoxManager.show({
|
|
305
|
+
title: title, message: msg, buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
306
|
+
onButtonClick: async (e) => {
|
|
307
|
+
if (e !== ButtonNames.YES)
|
|
308
|
+
return;
|
|
309
|
+
await operationAsync();
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
// #endregion
|
|
302
314
|
// #region Exception
|
|
303
315
|
export function getExceptionMessage(ex) {
|
|
304
316
|
let msg = ex.isApiException ? ex.response.title : ex.message;
|