@topconsultnpm/sdkui-react-beta 6.6.118 → 6.6.120

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.
@@ -80,9 +80,9 @@ const Message = ({ msg }) => {
80
80
  const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', message = '', buttons }) => {
81
81
  const [isVisible, setIsVisible] = useState(true);
82
82
  const [btns, setBtns] = useState(buttons || []);
83
- const [currentWidth, setCurrentWidth] = useState(window.innerWidth);
83
+ // const [currentWidth, setCurrentWidth] = useState<number>(window.innerWidth)
84
84
  let deviceType = useDeviceType();
85
- useEffect(() => { window.addEventListener('resize', () => setCurrentWidth(window.innerWidth)); return () => window.removeEventListener('resize', () => setCurrentWidth(window.innerWidth)); });
85
+ // useEffect(() => { window.addEventListener('resize', () => setCurrentWidth(window.innerWidth)); return () => window.removeEventListener('resize', () => setCurrentWidth(window.innerWidth)) })
86
86
  useEffect(() => {
87
87
  let arr = [];
88
88
  if (buttons) {
@@ -103,8 +103,8 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
103
103
  let dateString = d.getDate() + '/' + d.getMonth() + 1 + '/' + d.getFullYear();
104
104
  let timeString = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds() + ':' + d.getMilliseconds();
105
105
  let message = exception.isApiException ? exception.response.title : exception.message;
106
- const [currentWidth, setCurrentWidth] = useState(window.innerWidth);
107
- useEffect(() => { window.addEventListener('resize', () => setCurrentWidth(window.innerWidth)); return () => window.removeEventListener('resize', () => setCurrentWidth(window.innerWidth)); });
106
+ // const [currentWidth, setCurrentWidth] = useState<number>(window.innerWidth)
107
+ // useEffect(() => { window.addEventListener('resize', () => setCurrentWidth(window.innerWidth)); return () => window.removeEventListener('resize', () => setCurrentWidth(window.innerWidth)) })
108
108
  let deviceType = useDeviceType();
109
109
  const getFullMessage = () => {
110
110
  let fullMessage = '';
@@ -5,12 +5,9 @@ import { FormModes } from "../ts";
5
5
  declare const TABLET_WIDTH = 1024;
6
6
  declare const MOBILE_WIDTH = 640;
7
7
  declare const calcResponsiveDirection: (deviceType: DeviceType, desktopDir: 'horizontal' | 'vertical', tabletDir: 'horizontal' | 'vertical', mobileDir: 'horizontal' | 'vertical') => 'horizontal' | 'vertical';
8
- declare const calcResponsiveDirectionUsingWith: (currentWidth: number, desktopDir: 'horizontal' | 'vertical', tabletDir: 'horizontal' | 'vertical', mobileDir: 'horizontal' | 'vertical') => 'horizontal' | 'vertical';
9
8
  declare const openApps: (appModule: AppModules, tmSession: ITopMediaSession, appRoutes?: any[]) => Promise<void>;
10
9
  export declare const setSDK_GlobalsInfoAsync: (tms: ITopMediaSession | undefined) => Promise<ITopMediaSession>;
11
10
  declare const calcResponsiveSizes: (deviceType: DeviceType | undefined, desktopSize: string, tabletSize: string, mobileSize: string) => string;
12
- declare const calcResponsiveSizesUsingWith: (currentWidth: number, desktopSize: string, tabletSize: string, mobileSize: string) => string;
13
- declare const useWindowWidth: () => number;
14
11
  declare const getColor: (color: ColorsType) => string;
15
12
  declare const makeID: (length: number) => string;
16
13
  declare function genUniqueId(): string;
@@ -26,4 +23,4 @@ export declare const canPrev: (visibleItems: any[], selectedItems: any[]) => boo
26
23
  export declare const getPrev: (visibleItems: any[], selectedItems: any[]) => any;
27
24
  export declare const calcSaveFormTitle: (rootTitle: string | undefined, formMode: FormModes, updateId: number | undefined, pathKeys: string[] | undefined) => string;
28
25
  export declare function calcIsModified(formData: any, formDataOrig: any): boolean;
29
- export { openApps, calcResponsiveDirection, calcResponsiveSizes, getColor, genUniqueId, makeID, useWindowWidth, calcResponsiveSizesUsingWith, calcResponsiveDirectionUsingWith, MOBILE_WIDTH, TABLET_WIDTH };
26
+ export { openApps, calcResponsiveDirection, calcResponsiveSizes, getColor, genUniqueId, makeID, MOBILE_WIDTH, TABLET_WIDTH };
@@ -1,4 +1,3 @@
1
- import { useLayoutEffect, useState } from "react";
2
1
  import { Colors } from "../utils/theme";
3
2
  import { ButtonNames, DeviceType, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
4
3
  import { SDK_Globals, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts-beta";
@@ -15,13 +14,6 @@ const calcResponsiveDirection = (deviceType, desktopDir, tabletDir, mobileDir) =
15
14
  return tabletDir;
16
15
  return mobileDir;
17
16
  };
18
- const calcResponsiveDirectionUsingWith = (currentWidth, desktopDir, tabletDir, mobileDir) => {
19
- if (currentWidth > TABLET_WIDTH)
20
- return desktopDir;
21
- if (currentWidth <= TABLET_WIDTH && currentWidth > MOBILE_WIDTH)
22
- return tabletDir;
23
- return mobileDir;
24
- };
25
17
  const openApps = async (appModule, tmSession, appRoutes) => {
26
18
  try {
27
19
  window.Buffer = Buffer;
@@ -65,22 +57,6 @@ const calcResponsiveSizes = (deviceType, desktopSize, tabletSize, mobileSize) =>
65
57
  return tabletSize;
66
58
  return mobileSize;
67
59
  };
68
- const calcResponsiveSizesUsingWith = (currentWidth, desktopSize, tabletSize, mobileSize) => {
69
- if (currentWidth > TABLET_WIDTH)
70
- return desktopSize;
71
- if (currentWidth <= TABLET_WIDTH && currentWidth > MOBILE_WIDTH)
72
- return tabletSize;
73
- return mobileSize;
74
- };
75
- const useWindowWidth = () => {
76
- const [windowWidth, setWindowWidth] = useState(window.innerWidth);
77
- const handleSize = () => { setWindowWidth(window.innerWidth); };
78
- useLayoutEffect(() => {
79
- window.addEventListener('resize', handleSize);
80
- return () => window.removeEventListener('resize', handleSize);
81
- }, []);
82
- return (windowWidth);
83
- };
84
60
  //#endregion
85
61
  const getColor = (color) => {
86
62
  let c = '';
@@ -278,4 +254,4 @@ export const calcSaveFormTitle = (rootTitle, formMode, updateId, pathKeys) => {
278
254
  };
279
255
  export function calcIsModified(formData, formDataOrig) { return JSON.stringify(formData) !== JSON.stringify(formDataOrig); }
280
256
  //#endregion
281
- export { openApps, calcResponsiveDirection, calcResponsiveSizes, getColor, genUniqueId, makeID, useWindowWidth, calcResponsiveSizesUsingWith, calcResponsiveDirectionUsingWith, MOBILE_WIDTH, TABLET_WIDTH };
257
+ export { openApps, calcResponsiveDirection, calcResponsiveSizes, getColor, genUniqueId, makeID, MOBILE_WIDTH, TABLET_WIDTH };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.6.118",
3
+ "version": "6.6.120",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",