@iobroker/adapter-react-v5 5.0.8 → 6.0.1
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/Components/404.d.ts +2 -5
- package/Components/404.js +10 -10
- package/Components/ColorPicker.d.ts +41 -4
- package/Components/ColorPicker.js +35 -32
- package/Components/ComplexCron.d.ts +35 -4
- package/Components/ComplexCron.js +14 -15
- package/Components/CustomModal.d.ts +4 -3
- package/Components/CustomModal.js +13 -14
- package/Components/FileBrowser.d.ts +116 -4
- package/Components/FileBrowser.js +160 -164
- package/Components/FileViewer.js +10 -8
- package/Components/Icon.d.ts +1 -0
- package/Components/Icon.js +11 -4
- package/Components/IconPicker.d.ts +5 -1
- package/Components/IconPicker.js +47 -49
- package/Components/ObjectBrowser.d.ts +12 -15
- package/Components/ObjectBrowser.js +331 -326
- package/Components/SaveCloseButtons.d.ts +6 -3
- package/Components/SaveCloseButtons.js +4 -5
- package/Components/Schedule.d.ts +62 -3
- package/Components/Schedule.js +112 -117
- package/Components/SelectWithIcon.d.ts +17 -4
- package/Components/SelectWithIcon.js +11 -7
- package/Components/SimpleCron/index.d.ts +19 -3
- package/Components/SimpleCron/index.js +8 -9
- package/Components/TabContainer.d.ts +3 -4
- package/Components/TabContainer.js +3 -7
- package/Components/TabContent.d.ts +2 -3
- package/Components/TabContent.js +2 -4
- package/Components/TableResize.d.ts +26 -3
- package/Components/TableResize.js +1 -39
- package/Components/TextWithIcon.d.ts +4 -4
- package/Components/TextWithIcon.js +6 -7
- package/Components/TreeTable.d.ts +42 -5
- package/Components/TreeTable.js +39 -37
- package/Components/UploadImage.d.ts +13 -4
- package/Components/UploadImage.js +11 -13
- package/Components/Utils.d.ts +2 -1
- package/Components/Utils.js +31 -0
- package/Dialogs/ComplexCron.d.ts +11 -3
- package/Dialogs/ComplexCron.js +2 -3
- package/Dialogs/Confirm.d.ts +20 -7
- package/Dialogs/Confirm.js +4 -15
- package/Dialogs/Cron.d.ts +14 -3
- package/Dialogs/Cron.js +3 -11
- package/Dialogs/SelectFile.d.ts +12 -3
- package/Dialogs/SelectFile.js +8 -9
- package/Dialogs/SelectID.d.ts +1 -1
- package/Dialogs/SelectID.js +1 -1
- package/Dialogs/SimpleCron.d.ts +10 -3
- package/Dialogs/SimpleCron.js +2 -10
- package/README.md +74 -0
- package/package.json +6 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
2
|
import { InputProps } from '@mui/material/Input';
|
|
3
3
|
import { ThemeType, Translate } from '../types';
|
|
4
4
|
interface SelectWithIconProps {
|
|
@@ -18,8 +18,21 @@ interface SelectWithIconProps {
|
|
|
18
18
|
removePrefix?: string;
|
|
19
19
|
allowNone?: boolean;
|
|
20
20
|
inputProps?: InputProps['inputProps'];
|
|
21
|
-
classes: Record<string, string>;
|
|
22
21
|
dense?: boolean;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
interface TextWithIconItem {
|
|
24
|
+
name: string;
|
|
25
|
+
value: string;
|
|
26
|
+
icon?: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
}
|
|
29
|
+
interface SelectWithIconState {
|
|
30
|
+
list: TextWithIconItem[];
|
|
31
|
+
}
|
|
32
|
+
declare class SelectWithIcon extends Component<SelectWithIconProps, SelectWithIconState> {
|
|
33
|
+
private readonly wordDifferent;
|
|
34
|
+
private timeout;
|
|
35
|
+
constructor(props: SelectWithIconProps);
|
|
36
|
+
render(): React.JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
export default SelectWithIcon;
|
|
@@ -27,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const styles_1 = require("@mui/styles");
|
|
31
30
|
const material_1 = require("@mui/material");
|
|
32
31
|
const Icon_1 = __importDefault(require("./Icon"));
|
|
33
32
|
const Utils_1 = __importDefault(require("./Utils"));
|
|
@@ -119,9 +118,11 @@ class SelectWithIcon extends react_1.Component {
|
|
|
119
118
|
Object.assign(style, this.props.style);
|
|
120
119
|
}
|
|
121
120
|
const select = react_1.default.createElement(material_1.Select, { variant: "standard", disabled: this.props.disabled, value: this.props.value, inputProps: this.props.inputProps, renderValue: ( /* value */) => react_1.default.createElement("span", null,
|
|
122
|
-
(item === null || item === void 0 ? void 0 : item.icon) ? react_1.default.createElement(Icon_1.default, { src: item === null || item === void 0 ? void 0 : item.icon,
|
|
123
|
-
item.name),
|
|
124
|
-
root:
|
|
121
|
+
(item === null || item === void 0 ? void 0 : item.icon) ? react_1.default.createElement(Icon_1.default, { src: item === null || item === void 0 ? void 0 : item.icon, style: styles.icon }) : null, item === null || item === void 0 ? void 0 :
|
|
122
|
+
item.name), sx: {
|
|
123
|
+
'&.MuiSelect-root': this.props.value === this.props.different ? styles.different : {},
|
|
124
|
+
}, classes: {
|
|
125
|
+
root: this.props.dense ? this.props.className : '',
|
|
125
126
|
}, style: style, onChange: el => {
|
|
126
127
|
if (this.props.different && el.target.value !== this.props.different) {
|
|
127
128
|
let pos = null;
|
|
@@ -139,8 +140,11 @@ class SelectWithIcon extends react_1.Component {
|
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
this.props.onChange(this.props.removePrefix ? el.target.value.replace(this.props.removePrefix, '') : el.target.value);
|
|
142
|
-
} }, this.state.list.map(el => react_1.default.createElement(material_1.MenuItem, {
|
|
143
|
-
|
|
143
|
+
} }, this.state.list.map(el => react_1.default.createElement(material_1.MenuItem, { style: this.props.different && el.value === this.props.different ? styles.different : {
|
|
144
|
+
color: el.color || undefined,
|
|
145
|
+
backgroundColor: Utils_1.default.getInvertedColor(el.color || '', this.props.themeType),
|
|
146
|
+
}, key: el.value, value: el.value },
|
|
147
|
+
el.icon ? react_1.default.createElement(Icon_1.default, { src: el.icon, style: styles.icon }) : null,
|
|
144
148
|
el.name)));
|
|
145
149
|
if (this.props.dense) {
|
|
146
150
|
return select;
|
|
@@ -150,4 +154,4 @@ class SelectWithIcon extends react_1.Component {
|
|
|
150
154
|
select);
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
|
-
exports.default =
|
|
157
|
+
exports.default = SelectWithIcon;
|
|
@@ -4,7 +4,6 @@ interface SimpleCronProps {
|
|
|
4
4
|
cronExpression?: string;
|
|
5
5
|
onChange: (cron: string) => void;
|
|
6
6
|
language: ioBroker.Languages;
|
|
7
|
-
classes: Record<string, string>;
|
|
8
7
|
}
|
|
9
8
|
interface SimpleCronState {
|
|
10
9
|
extended: boolean;
|
|
@@ -35,5 +34,22 @@ interface SimpleCronState {
|
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
36
|
export declare function cron2state(cron: string, force?: boolean): Partial<SimpleCronState> | null;
|
|
38
|
-
declare
|
|
39
|
-
|
|
37
|
+
declare class SimpleCron extends React.Component<SimpleCronProps, SimpleCronState> {
|
|
38
|
+
constructor(props: SimpleCronProps);
|
|
39
|
+
static periodArray2text(list: number[], max?: number): string;
|
|
40
|
+
static text2weekdays(text: string): number[];
|
|
41
|
+
static state2cron(state: Partial<SimpleCronState>): string;
|
|
42
|
+
recalcCron(): void;
|
|
43
|
+
getControlsWeekdaysElements(type: 'intervalBetween' | 'specific'): React.JSX.Element;
|
|
44
|
+
getControlsPeriodElements(type: 'interval' | 'intervalBetween'): React.JSX.Element;
|
|
45
|
+
getControlsTime(type: 'once' | 'specific'): React.JSX.Element;
|
|
46
|
+
getControlsDate(): React.JSX.Element;
|
|
47
|
+
getOnceElements(): React.JSX.Element;
|
|
48
|
+
getIntervalElements(): React.JSX.Element;
|
|
49
|
+
getIntervalBetweenElements(): React.JSX.Element[];
|
|
50
|
+
getSpecificTimeElements(): React.JSX.Element[];
|
|
51
|
+
onModeChange(mode: 'once' | 'interval' | 'intervalBetween' | 'specific'): void;
|
|
52
|
+
onChange(cron: string): void;
|
|
53
|
+
render(): React.JSX.Element;
|
|
54
|
+
}
|
|
55
|
+
export default SimpleCron;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.cron2state = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const styles_1 = require("@mui/styles");
|
|
9
8
|
const material_1 = require("@mui/material");
|
|
10
9
|
const cronText_1 = __importDefault(require("./cronText"));
|
|
11
10
|
const i18n_1 = __importDefault(require("../../i18n"));
|
|
@@ -528,7 +527,7 @@ class SimpleCron extends react_1.default.Component {
|
|
|
528
527
|
}
|
|
529
528
|
getControlsTime(type) {
|
|
530
529
|
const settings = type === 'once' ? this.state.once : this.state.specific;
|
|
531
|
-
return react_1.default.createElement(material_1.FormControl, { variant: "standard",
|
|
530
|
+
return react_1.default.createElement(material_1.FormControl, { variant: "standard", sx: Object.assign(Object.assign({}, styles.formControl), { '&.MuiFormControl-root': styles.formControlMarginRight }) },
|
|
532
531
|
react_1.default.createElement(material_1.TextField, { variant: "standard", key: "at", label: i18n_1.default.t('sc_time'), value: settings.time, type: "time", onChange: e => {
|
|
533
532
|
const _settings = JSON.parse(JSON.stringify(this.state[type]));
|
|
534
533
|
_settings.time = e.target.value;
|
|
@@ -547,8 +546,8 @@ class SimpleCron extends react_1.default.Component {
|
|
|
547
546
|
settings.date = `${d.getDate()}.${padding(d.getMonth() + 1)}`;
|
|
548
547
|
}
|
|
549
548
|
// <InputLabel htmlFor="formatted-text-mask-input">{I18n.t('sc_at')}</InputLabel>
|
|
550
|
-
return react_1.default.createElement(material_1.FormControl, { variant: "standard",
|
|
551
|
-
react_1.default.createElement(material_1.TextField, { variant: "standard", key: "date", label: i18n_1.default.t('sc_date'), value: settings.date, type: "text", inputProps: {
|
|
549
|
+
return react_1.default.createElement(material_1.FormControl, { variant: "standard", style: styles.formControl },
|
|
550
|
+
react_1.default.createElement(material_1.TextField, { variant: "standard", key: "date", label: i18n_1.default.t('sc_date'), value: settings.date, type: "text", inputProps: { style: styles.formControlPaddingTop }, onChange: e => {
|
|
552
551
|
const _settings = JSON.parse(JSON.stringify(this.state.once));
|
|
553
552
|
_settings.date = e.target.value;
|
|
554
553
|
this.setState({ once: _settings }, () => this.recalcCron());
|
|
@@ -568,14 +567,14 @@ class SimpleCron extends react_1.default.Component {
|
|
|
568
567
|
this.getControlsPeriodElements('intervalBetween'),
|
|
569
568
|
react_1.default.createElement("div", { key: "between", style: { paddingLeft: 8, display: 'inline-block', verticalAlign: 'top' } },
|
|
570
569
|
react_1.default.createElement("h5", { style: { marginBottom: 5 } }, i18n_1.default.t('sc_hours')),
|
|
571
|
-
react_1.default.createElement(material_1.FormControl, { variant: "standard",
|
|
570
|
+
react_1.default.createElement(material_1.FormControl, { variant: "standard", style: styles.formControl },
|
|
572
571
|
react_1.default.createElement(material_1.InputLabel, { shrink: true, htmlFor: "age-label-placeholder" }, i18n_1.default.t('sc_from')),
|
|
573
572
|
react_1.default.createElement(material_1.Select, { variant: "standard", style: { width: 100 }, value: settings.timeFrom, onChange: e => {
|
|
574
573
|
const _settings = JSON.parse(JSON.stringify(this.state.intervalBetween));
|
|
575
574
|
_settings.timeFrom = parseInt(e.target.value, 10);
|
|
576
575
|
this.setState({ intervalBetween: _settings }, () => this.recalcCron());
|
|
577
576
|
} }, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23].map(hour => react_1.default.createElement(material_1.MenuItem, { key: `B_${hour}`, value: hour }, `${padding(hour)}:00`)))),
|
|
578
|
-
react_1.default.createElement(material_1.FormControl, { variant: "standard",
|
|
577
|
+
react_1.default.createElement(material_1.FormControl, { variant: "standard", style: styles.formControl },
|
|
579
578
|
react_1.default.createElement(material_1.InputLabel, { shrink: true, htmlFor: "age-label-placeholder" }, i18n_1.default.t('sc_to')),
|
|
580
579
|
react_1.default.createElement(material_1.Select, { variant: "standard", style: { width: 100 }, value: settings.timeTo, onChange: e => {
|
|
581
580
|
const _settings = JSON.parse(JSON.stringify(this.state.intervalBetween));
|
|
@@ -603,12 +602,12 @@ class SimpleCron extends react_1.default.Component {
|
|
|
603
602
|
}
|
|
604
603
|
}
|
|
605
604
|
render() {
|
|
606
|
-
return react_1.default.createElement("div", {
|
|
605
|
+
return react_1.default.createElement("div", { style: styles.mainDiv },
|
|
607
606
|
react_1.default.createElement("div", { style: { paddingLeft: 8, width: '100%' } },
|
|
608
607
|
react_1.default.createElement(material_1.TextField, { style: { width: '100%' }, value: this.state.cron, disabled: true })),
|
|
609
608
|
react_1.default.createElement("div", { style: { paddingLeft: 8, width: '100%', height: 60 } }, (0, cronText_1.default)(this.state.cron, this.props.language || 'en')),
|
|
610
609
|
react_1.default.createElement("div", null,
|
|
611
|
-
react_1.default.createElement(material_1.FormControl, { variant: "standard", style: { marginLeft: 8, marginTop: 8 }
|
|
610
|
+
react_1.default.createElement(material_1.FormControl, { variant: "standard", style: Object.assign(Object.assign({}, styles.formControl), { marginLeft: 8, marginTop: 8 }) },
|
|
612
611
|
react_1.default.createElement(material_1.InputLabel, null, i18n_1.default.t('ra_Repeat')),
|
|
613
612
|
react_1.default.createElement(material_1.Select, { variant: "standard", value: this.state.mode, onChange: e => this.onModeChange(e.target.value), inputProps: { name: 'mode', id: 'mode' } },
|
|
614
613
|
react_1.default.createElement(material_1.MenuItem, { value: "once" }, i18n_1.default.t('sc_once')),
|
|
@@ -621,4 +620,4 @@ class SimpleCron extends react_1.default.Component {
|
|
|
621
620
|
this.state.mode === 'specific' && this.getSpecificTimeElements());
|
|
622
621
|
}
|
|
623
622
|
}
|
|
624
|
-
exports.default =
|
|
623
|
+
exports.default = SimpleCron;
|
|
@@ -3,11 +3,10 @@ interface TabContainerProps {
|
|
|
3
3
|
elevation?: number;
|
|
4
4
|
overflow?: string;
|
|
5
5
|
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
6
7
|
onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
7
8
|
tabIndex?: number;
|
|
8
|
-
classes: Record<string, string>;
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export default _export;
|
|
11
|
+
declare function TabContainer(props: TabContainerProps): React.JSX.Element;
|
|
12
|
+
export default TabContainer;
|
|
@@ -4,9 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const styles_1 = require("@mui/styles");
|
|
8
7
|
const material_1 = require("@mui/material");
|
|
9
|
-
const Utils_1 = __importDefault(require("./Utils"));
|
|
10
8
|
const styles = {
|
|
11
9
|
root: {
|
|
12
10
|
width: '100%',
|
|
@@ -20,9 +18,7 @@ const styles = {
|
|
|
20
18
|
},
|
|
21
19
|
};
|
|
22
20
|
function TabContainer(props) {
|
|
23
|
-
return react_1.default.createElement(material_1.Paper, { elevation: !Number.isNaN(props.elevation) ? props.elevation : 1, className:
|
|
24
|
-
react_1.default.createElement(material_1.Grid, { container: true, direction: "column", wrap: "nowrap",
|
|
21
|
+
return react_1.default.createElement(material_1.Paper, { elevation: !Number.isNaN(props.elevation) ? props.elevation : 1, className: props.className, style: Object.assign(Object.assign(Object.assign({}, styles.root), (props.overflow !== 'visible' ? styles.overflowHidden : undefined)), props.style), onKeyDown: props.onKeyDown, tabIndex: props.tabIndex },
|
|
22
|
+
react_1.default.createElement(material_1.Grid, { container: true, direction: "column", wrap: "nowrap", sx: styles.container }, props.children));
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
const _export = (0, styles_1.withStyles)(styles)(TabContainer);
|
|
28
|
-
exports.default = _export;
|
|
24
|
+
exports.default = TabContainer;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface TabContentProps {
|
|
3
3
|
overflow?: string;
|
|
4
|
-
classes: Record<string, string>;
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
}
|
|
7
|
-
declare
|
|
8
|
-
export default
|
|
6
|
+
declare function TabContent(props: TabContentProps): React.JSX.Element;
|
|
7
|
+
export default TabContent;
|
package/Components/TabContent.js
CHANGED
|
@@ -5,9 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const styles_1 = require("@mui/styles");
|
|
9
8
|
const material_1 = require("@mui/material");
|
|
10
|
-
const Utils_1 = __importDefault(require("./Utils"));
|
|
11
9
|
const styles = {
|
|
12
10
|
root: {
|
|
13
11
|
height: '100%',
|
|
@@ -18,6 +16,6 @@ const styles = {
|
|
|
18
16
|
},
|
|
19
17
|
};
|
|
20
18
|
function TabContent(props) {
|
|
21
|
-
return react_1.default.createElement(material_1.Grid, { item: true,
|
|
19
|
+
return react_1.default.createElement(material_1.Grid, { item: true, sx: Object.assign(Object.assign({}, styles.root), (props.overflow === 'auto' ? styles.overflowAuto : undefined)) }, props.children);
|
|
22
20
|
}
|
|
23
|
-
exports.default =
|
|
21
|
+
exports.default = TabContent;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
6
|
* */
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
8
|
interface TableResizeProps {
|
|
9
9
|
name?: string;
|
|
10
10
|
ready?: boolean;
|
|
@@ -17,5 +17,28 @@ interface TableResizeProps {
|
|
|
17
17
|
dblTitle?: string;
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
|
-
declare
|
|
21
|
-
|
|
20
|
+
declare class TableResize extends Component<TableResizeProps> {
|
|
21
|
+
private readonly resizerRefTable;
|
|
22
|
+
private resizerActiveIndex;
|
|
23
|
+
private resizerActiveDiv;
|
|
24
|
+
private resizerCurrentWidths;
|
|
25
|
+
private widthFilled;
|
|
26
|
+
private installTimeout;
|
|
27
|
+
private resizerMin;
|
|
28
|
+
private resizerMinNext;
|
|
29
|
+
private resizerPosition;
|
|
30
|
+
private resizerOldWidth;
|
|
31
|
+
private resizerOldWidthNext;
|
|
32
|
+
constructor(props: TableResizeProps);
|
|
33
|
+
componentDidMount(): void;
|
|
34
|
+
componentWillUnmount(): void;
|
|
35
|
+
resizerInstall(): void;
|
|
36
|
+
resizerReset: () => void;
|
|
37
|
+
resizerUninstall(): void;
|
|
38
|
+
resizerApplyWidths(): string;
|
|
39
|
+
resizerMouseMove: (e: MouseEvent) => void;
|
|
40
|
+
resizerMouseUp: () => void;
|
|
41
|
+
resizerMouseDown: (e: MouseEvent) => void;
|
|
42
|
+
render(): React.JSX.Element;
|
|
43
|
+
}
|
|
44
|
+
export default TableResize;
|
|
@@ -30,45 +30,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
*
|
|
31
31
|
* */
|
|
32
32
|
const react_1 = __importStar(require("react"));
|
|
33
|
-
const styles_1 = require("@mui/styles");
|
|
34
33
|
const material_1 = require("@mui/material");
|
|
35
|
-
const styles = {
|
|
36
|
-
table: {
|
|
37
|
-
display: 'grid',
|
|
38
|
-
'& tr': {
|
|
39
|
-
display: 'contents',
|
|
40
|
-
},
|
|
41
|
-
'& thead': {
|
|
42
|
-
display: 'contents',
|
|
43
|
-
},
|
|
44
|
-
'& tbody': {
|
|
45
|
-
display: 'contents',
|
|
46
|
-
},
|
|
47
|
-
'& th': {
|
|
48
|
-
position: 'sticky',
|
|
49
|
-
userSelect: 'none',
|
|
50
|
-
},
|
|
51
|
-
'& .resize-handle': {
|
|
52
|
-
display: 'block',
|
|
53
|
-
position: 'absolute',
|
|
54
|
-
cursor: 'col-resize',
|
|
55
|
-
width: 7,
|
|
56
|
-
right: 0,
|
|
57
|
-
top: 2,
|
|
58
|
-
bottom: 2,
|
|
59
|
-
zIndex: 1,
|
|
60
|
-
borderRight: '2px dotted #888',
|
|
61
|
-
'&:hover': {
|
|
62
|
-
borderColor: '#ccc',
|
|
63
|
-
borderRightStyle: 'solid',
|
|
64
|
-
},
|
|
65
|
-
'&.active': {
|
|
66
|
-
borderColor: '#517ea5',
|
|
67
|
-
borderRightStyle: 'solid',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
34
|
class TableResize extends react_1.Component {
|
|
73
35
|
constructor(props) {
|
|
74
36
|
super(props);
|
|
@@ -261,4 +223,4 @@ class TableResize extends react_1.Component {
|
|
|
261
223
|
return react_1.default.createElement(material_1.Table, { stickyHeader: this.props.stickyHeader, size: this.props.size || 'small', className: this.props.className, ref: this.resizerRefTable, style: (Object.assign(Object.assign({}, this.props.style || {}), style)) }, this.props.children);
|
|
262
224
|
}
|
|
263
225
|
}
|
|
264
|
-
exports.default =
|
|
226
|
+
exports.default = TableResize;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ThemeType } from '../types';
|
|
2
3
|
interface TextWithIconProps {
|
|
3
4
|
lang: ioBroker.Languages;
|
|
4
|
-
themeType?:
|
|
5
|
+
themeType?: ThemeType;
|
|
5
6
|
value: string | Record<string, any>;
|
|
6
7
|
list?: ioBroker.Object[] | Record<string, ioBroker.Object>;
|
|
7
8
|
options?: Record<string, any>;
|
|
@@ -16,7 +17,6 @@ interface TextWithIconProps {
|
|
|
16
17
|
};
|
|
17
18
|
icon?: string;
|
|
18
19
|
color?: string;
|
|
19
|
-
classes: Record<string, string>;
|
|
20
20
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export default
|
|
21
|
+
declare const TextWithIcon: (props: TextWithIconProps) => React.JSX.Element;
|
|
22
|
+
export default TextWithIcon;
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const styles_1 = require("@mui/styles");
|
|
8
7
|
const Icon_1 = __importDefault(require("./Icon"));
|
|
9
8
|
const Utils_1 = __importDefault(require("./Utils"));
|
|
10
9
|
const styles = {
|
|
@@ -37,7 +36,7 @@ const TextWithIcon = (props) => {
|
|
|
37
36
|
if (typeof value === 'string') {
|
|
38
37
|
const list = props.list || props.options;
|
|
39
38
|
if (list) {
|
|
40
|
-
// if list is array, then it is list of ioBroker.Object
|
|
39
|
+
// if a list is array, then it is list of ioBroker.Object
|
|
41
40
|
if (Array.isArray(list)) {
|
|
42
41
|
const _item = list.find((obj) => obj._id === prefix + value);
|
|
43
42
|
if (_item) {
|
|
@@ -108,11 +107,11 @@ const TextWithIcon = (props) => {
|
|
|
108
107
|
}
|
|
109
108
|
const style = (item === null || item === void 0 ? void 0 : item.color) ? {
|
|
110
109
|
border: `1px solid ${Utils_1.default.invertColor(item === null || item === void 0 ? void 0 : item.color)}`,
|
|
111
|
-
color: Utils_1.default.getInvertedColor(item === null || item === void 0 ? void 0 : item.color, props.themeType, true) || undefined,
|
|
110
|
+
color: Utils_1.default.getInvertedColor(item === null || item === void 0 ? void 0 : item.color, props.themeType || 'light', true) || undefined,
|
|
112
111
|
backgroundColor: item === null || item === void 0 ? void 0 : item.color,
|
|
113
112
|
} : {};
|
|
114
|
-
return react_1.default.createElement("div", { style: Object.assign(
|
|
115
|
-
(item === null || item === void 0 ? void 0 : item.icon) ? react_1.default.createElement(Icon_1.default, { src: item === null || item === void 0 ? void 0 : item.icon, className:
|
|
116
|
-
react_1.default.createElement("div", {
|
|
113
|
+
return react_1.default.createElement("div", { style: Object.assign({}, props.style, styles.div, style), className: Utils_1.default.clsx(props.className, (_g = props.moreClasses) === null || _g === void 0 ? void 0 : _g.root), title: props.title || item.value },
|
|
114
|
+
(item === null || item === void 0 ? void 0 : item.icon) ? react_1.default.createElement(Icon_1.default, { src: item === null || item === void 0 ? void 0 : item.icon, className: (_h = props.moreClasses) === null || _h === void 0 ? void 0 : _h.icon, style: styles.icon }) : null,
|
|
115
|
+
react_1.default.createElement("div", { style: styles.text, className: (_j = props.moreClasses) === null || _j === void 0 ? void 0 : _j.text }, item === null || item === void 0 ? void 0 : item.name));
|
|
117
116
|
};
|
|
118
|
-
exports.default =
|
|
117
|
+
exports.default = TextWithIcon;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
2
|
import type Connection from '../Connection';
|
|
3
|
+
import { IobTheme } from '../types';
|
|
3
4
|
interface Column {
|
|
4
5
|
cellStyle?: Record<string, any>;
|
|
5
|
-
editComponent?: React.
|
|
6
|
+
editComponent?: React.FC<{
|
|
6
7
|
value: any;
|
|
7
8
|
rowData: Record<string, any>;
|
|
8
9
|
onChange: (newValue: any) => void;
|
|
@@ -36,7 +37,43 @@ interface TreeTableProps {
|
|
|
36
37
|
/** Shift in pixels for every level */
|
|
37
38
|
levelShift?: number;
|
|
38
39
|
adapterName: string;
|
|
39
|
-
|
|
40
|
+
theme: IobTheme;
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
interface TreeTableState {
|
|
43
|
+
opened: string[];
|
|
44
|
+
editMode: number | false;
|
|
45
|
+
deleteMode: number | false;
|
|
46
|
+
editData: Record<string, any> | null;
|
|
47
|
+
order: 'desc' | 'asc';
|
|
48
|
+
update: string[] | null;
|
|
49
|
+
orderBy: string;
|
|
50
|
+
showSelectColor: boolean;
|
|
51
|
+
selectIdValue?: string | null;
|
|
52
|
+
showSelectId?: boolean;
|
|
53
|
+
data?: Record<string, any>[];
|
|
54
|
+
}
|
|
55
|
+
declare class TreeTable extends Component<TreeTableProps, TreeTableState> {
|
|
56
|
+
private selectCallback;
|
|
57
|
+
private updateTimeout;
|
|
58
|
+
constructor(props: TreeTableProps);
|
|
59
|
+
static getDerivedStateFromProps(props: TreeTableProps, state: TreeTableState): Partial<TreeTableState>;
|
|
60
|
+
renderCellEdit(item: Record<string, any>, col: Column): React.JSX.Element;
|
|
61
|
+
onChange(col: Column, oldValue: string | number | boolean, newValue: string | number | boolean): void;
|
|
62
|
+
renderCellEditSelect(col: Column, val: string | number): React.JSX.Element;
|
|
63
|
+
renderCellEditString(col: Column, val: string): React.JSX.Element;
|
|
64
|
+
renderCellEditNumber(col: Column, val: number): React.JSX.Element;
|
|
65
|
+
renderCellEditCustom(col: Column, val: any, item: Record<string, any>): React.JSX.Element;
|
|
66
|
+
renderCellEditBoolean(col: Column, val: boolean): React.JSX.Element;
|
|
67
|
+
renderSelectColorDialog(): React.JSX.Element;
|
|
68
|
+
renderCellEditColor(col: Column, val: string): React.JSX.Element;
|
|
69
|
+
renderSelectIdDialog(): React.JSX.Element;
|
|
70
|
+
renderCellEditObjectID(col: Column, val: string): React.JSX.Element;
|
|
71
|
+
static renderCellNonEdit(item: Record<string, any>, col: Column): any;
|
|
72
|
+
renderCell(item: Record<string, any>, col: Column, level: number, i: number): React.JSX.Element;
|
|
73
|
+
renderCellWithSubField(item: Record<string, any>, col: Column): React.JSX.Element;
|
|
74
|
+
renderLine(item: Record<string, any>, level?: number): React.JSX.Element | React.JSX.Element[] | null;
|
|
75
|
+
handleRequestSort(property: string): void;
|
|
76
|
+
renderHead(): React.JSX.Element;
|
|
77
|
+
render(): React.JSX.Element;
|
|
78
|
+
}
|
|
79
|
+
export default TreeTable;
|