Skip to content

Commit

Permalink
Converted all files to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Nov 30, 2024
1 parent 24e76de commit 7375bc4
Show file tree
Hide file tree
Showing 52 changed files with 56,216 additions and 55,963 deletions.
108,914 changes: 54,456 additions & 54,458 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/iobroker.vis-2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"lerna": "^8.1.9",
"mocha": "^10.8.2",
"mui-nested-menu": "^3.4.0",
"prop-types": "^15.8.1",
"react-ace": "^13.0.0",
"react-beautiful-dnd": "^13.1.1",
"react-color": "^2.19.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/iobroker.vis-2/src/src/Attributes/CSS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const CSS = (props: CSSProps): React.JSX.Element => {
};

load().catch(e => console.error('Error loading CSS: ', e));
}, []);
});

const save = (value: string, saveType: 'global' | 'local'): void => {
timers[saveType].setValue(value);
Expand Down
11 changes: 3 additions & 8 deletions packages/iobroker.vis-2/src/src/Attributes/Widget/TextDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';

import type { ThemeType } from '@iobroker/adapter-react-v5';

Expand All @@ -8,7 +8,6 @@ import CustomAceEditor from '../../Components/CustomAceEditor';
interface TextDialogProps {
onChange: (value: string) => void;
onClose: () => void;
open: boolean;
themeType: ThemeType;
type: string;
value: string;
Expand All @@ -17,11 +16,7 @@ interface TextDialogProps {
const TextDialog = (props: TextDialogProps): React.JSX.Element => {
const [value, changeValue] = useState('');

useEffect(() => {
changeValue(props.value);
}, [props.open]);

return props.open ? (
return (
<IODialog
keyboardDisabled
title={props.type === 'json' ? 'JSON edit' : props.type === 'html' ? 'HTML edit' : 'Text edit'}
Expand All @@ -41,7 +36,7 @@ const TextDialog = (props: TextDialogProps): React.JSX.Element => {
onChange={newValue => changeValue(newValue)}
/>
</IODialog>
) : null;
);
};

export default TextDialog;
Original file line number Diff line number Diff line change
Expand Up @@ -1644,12 +1644,12 @@ const WidgetField = (props: WidgetFieldProps): string | React.JSX.Element | Reac
<TextField
fullWidth
size="small"
placeholder={isDifferent ? t('different') : null}
placeholder={isDifferent ? t('different') : undefined}
variant="standard"
value={value}
error={!!error}
disabled={disabled}
onChange={e => change(e.target.value)}
onChange={(e: React.ChangeEvent<HTMLInputElement>): void => change(e.target.value)}
InputProps={{
endAdornment: value ? (
<IconButton
Expand Down Expand Up @@ -1725,7 +1725,6 @@ const WidgetField = (props: WidgetFieldProps): string | React.JSX.Element | Reac
/>
{idDialog ? (
<TextDialog
open={!0}
value={value as string}
onChange={newValue => change(newValue)}
onClose={() => setIdDialog(false)}
Expand Down
5 changes: 3 additions & 2 deletions packages/iobroker.vis-2/src/src/Components/WizardHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ const detectDevices = async (socket: LegacyConnection): Promise<DetectorResult[]

return result;
};

export default {
const funcs = {
deviceIcons,
detectDevices,
getObjectIcon,
Expand All @@ -350,3 +349,5 @@ export default {
/** @deprecated use "getNewWidgetId" instead, it will give you the full wid like "w000001" */
getNewWidgetIdNumber,
};

export default funcs;
Loading

0 comments on commit 7375bc4

Please sign in to comment.