@iobroker/adapter-react-v5 6.1.10 → 7.0.2

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/src/Theme.tsx CHANGED
@@ -295,7 +295,6 @@ function customTheme(type: ThemeName, overrides?: Record<string, any>): IobTheme
295
295
  },
296
296
  expert: '#96fc96',
297
297
  },
298
-
299
298
  };
300
299
  } else if (type === 'PT') {
301
300
  localOverrides = {
@@ -431,7 +430,8 @@ function customTheme(type: ThemeName, overrides?: Record<string, any>): IobTheme
431
430
  {
432
431
  props: { variant: 'contained', color: 'grey' },
433
432
  style: {
434
- color: palette.getContrastText && palette.grey && palette.grey[300] ? palette.getContrastText(palette.grey[300]) : undefined,
433
+ backgroundColor: palette.grey?.[300],
434
+ color: palette.getContrastText && palette.grey?.[300]? palette.getContrastText(palette.grey[300]) : undefined,
435
435
  },
436
436
  },
437
437
  {
package/types.d.ts DELETED
@@ -1,134 +0,0 @@
1
- import React from 'react';
2
- import { Theme as MuiTheme, Palette as MuiPalette } from '@mui/material/styles';
3
- import { AdminConnection, Connection } from '@iobroker/socket-client';
4
- import LegacyConnection from './LegacyConnection';
5
-
6
- export type Translate = (key: string, ...args: (string | number | boolean)[]) => string;
7
-
8
- export interface ConnectionProps {
9
- /** The socket name. */
10
- name?: string;
11
- /** State IDs to always automatically subscribe to. */
12
- autoSubscribes?: string[];
13
- /** Automatically subscribe to logging. */
14
- autoSubscribeLog?: boolean;
15
- /** The protocol to use for the socket.io connection. */
16
- protocol?: string;
17
- /** The host name to use for the socket.io connection. */
18
- host?: string;
19
- /** The port to use for the socket.io connection. */
20
- port?: string | number;
21
- /** The socket.io connection timeout. */
22
- ioTimeout?: number;
23
- /** Flag to indicate if all objects should be loaded or not. Default true (not loaded) */
24
- doNotLoadAllObjects?: boolean;
25
- /** Flag to indicate if AccessControlList for current user will be loaded or not. Default true (not loaded) */
26
- doNotLoadACL?: boolean;
27
- /** Progress callback. */
28
- onProgress?: (progress: number) => void;
29
- /** Ready callback. */
30
- onReady?: (objects: Record<string, ioBroker.Object>) => void;
31
- /** Log callback. */
32
- onLog?: (text: string) => void;
33
- /** Error callback. */
34
- onError?: (error: any) => void;
35
- /** Object change callback. */
36
- onObjectChange?: ioBroker.ObjectChangeHandler;
37
- /** Language callback */
38
- onLanguage?: (lang: ioBroker.Languages) => void;
39
- }
40
-
41
- export interface OldObject {
42
- _id: string;
43
- type: string;
44
- }
45
-
46
- export type ObjectChangeHandler = (id: string, obj: ioBroker.Object | null | undefined, oldObj: OldObject) => void | Promise<void>;
47
-
48
- export type ThemeName = 'dark' | 'light' | 'colored' | 'blue' | 'PT' | 'DX';
49
- export type ThemeType = 'dark' | 'light';
50
-
51
- export interface GenericAppProps {
52
- /** Adapter instance number if known, else will be determined from url */
53
- instance?: number;
54
- /** The name of the adapter. */
55
- adapterName?: string;
56
- /** Should the bottom buttons be shown (default: true). */
57
- bottomButtons?: boolean;
58
- /** Additional translations. */
59
- translations?: { [lang in ioBroker.Languages]?: Record<string, string>; };
60
- /** Fields that should be encrypted/decrypted. */
61
- encryptedFields?: string[];
62
- /** Socket.io configuration. */
63
- socket?: ConnectionProps;
64
- /** Desired connection object */
65
- Connection?: LegacyConnection | Connection | AdminConnection;
66
- /** sentry DNS */
67
- sentryDSN?: string;
68
- /** Callback if user changes the theme. Call it to trigger change */
69
- onThemeChange?: (newThemeName: ThemeName) => void;
70
- classes?: Record<string, string>;
71
- }
72
-
73
- export interface GenericAppSettings extends GenericAppProps {
74
- /** Don't load all objects on start-up. */
75
- doNotLoadAllObjects?: boolean;
76
- }
77
-
78
- interface Palette extends MuiPalette {
79
- mode: ThemeType;
80
- expert: string;
81
- grey: {
82
- main: string;
83
- dark: string;
84
- 50: string;
85
- 100: string;
86
- 200: string;
87
- 300: string;
88
- 400: string;
89
- 500: string;
90
- 600: string;
91
- 700: string;
92
- 800: string;
93
- 900: string;
94
- A100: string;
95
- A200: string;
96
- A400: string;
97
- A700: string;
98
- };
99
- }
100
-
101
- export interface IobTheme extends MuiTheme {
102
- name: ThemeName;
103
- palette: Palette;
104
- toolbar: React.CSSProperties;
105
- saveToolbar: {
106
- background: string;
107
- button: React.CSSProperties;
108
- };
109
- }
110
-
111
- export type Width = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
112
-
113
- export interface GenericAppState {
114
- loaded: boolean;
115
- themeType: ThemeType;
116
- themeName: ThemeName;
117
- theme: IobTheme;
118
- expertMode: boolean;
119
- selectedTab: string;
120
- selectedTabNum: number | undefined;
121
- native: Record<string, any>;
122
- errorText: string | React.JSX.Element;
123
- changed: boolean;
124
- connected: boolean;
125
- isConfigurationError: string;
126
- toast: string | React.JSX.Element;
127
- bottomButtons: boolean;
128
- width: Width;
129
- confirmClose: boolean;
130
- _alert: boolean;
131
- _alertType: 'info' | 'warning' | 'error' | 'success';
132
- _alertMessage: string | React.JSX.Element;
133
- common?: Record<string, any>;
134
- }