@iobroker/adapter-react-v5 4.8.1 → 4.9.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/Logo.d.ts +9 -50
- package/Components/Logo.js +106 -173
- package/Components/ObjectBrowser.d.ts +9 -0
- package/Components/ObjectBrowser.js +370 -165
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/SaveCloseButtons.d.ts +17 -61
- package/Components/SaveCloseButtons.js +64 -124
- package/Components/Schedule.d.ts +31 -6
- package/Components/Schedule.js +1144 -1562
- package/Components/TabContainer.d.ts +9 -37
- package/Components/TabContainer.js +49 -74
- package/Components/TabContent.d.ts +6 -27
- package/Components/TabContent.js +24 -67
- package/Components/TabHeader.d.ts +6 -11
- package/Components/TabHeader.js +11 -40
- package/Components/ToggleThemeMenu.d.ts +10 -8
- package/Components/ToggleThemeMenu.js +16 -36
- package/Components/types.d.ts +10 -2
- package/Dialogs/SelectID.d.ts +39 -139
- package/Dialogs/SelectID.js +141 -271
- package/LegacyConnection.d.ts +1 -1
- package/README.md +9 -2
- package/i18n.d.ts +2 -2
- package/index.d.ts +127 -126
- package/index.js +213 -192
- package/package.json +7 -7
- package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
- package/Components/JsonConfigComponent/ChipInput.js +0 -763
- package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
- package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
- package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
- package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigChip.js +0 -120
- package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
- package/Components/JsonConfigComponent/ConfigColor.js +0 -120
- package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
- package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
- package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
- package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigFile.js +0 -228
- package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
- package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
- package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
- package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigIP.js +0 -130
- package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
- package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
- package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
- package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
- package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
- package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
- package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
- package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPort.js +0 -176
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
- package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
- package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
- package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
- package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
- package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
- package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
- package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigText.js +0 -226
- package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
- package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
- package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigUser.js +0 -142
- package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
- package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
- package/Components/JsonConfigComponent/index.d.ts +0 -26
- package/Components/JsonConfigComponent/index.js +0 -520
- package/Components/JsonConfigComponent/index.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
- package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
- package/Components/Logo.js.map +0 -1
- package/Components/SaveCloseButtons.js.map +0 -1
- package/Components/Schedule.js.map +0 -1
- package/Components/TabContainer.js.map +0 -1
- package/Components/TabContent.js.map +0 -1
- package/Components/TabHeader.js.map +0 -1
- package/Components/ToggleThemeMenu.js.map +0 -1
- package/Dialogs/SelectID.js.map +0 -1
package/Dialogs/SelectID.d.ts
CHANGED
|
@@ -1,159 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
**/
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
|
+
import type Connection from '../Connection';
|
|
9
|
+
import { ObjectBrowserColumn, ObjectBrowserCustomFilter, ObjectBrowserType } from '../Components/types';
|
|
10
|
+
interface SelectIDFilters {
|
|
11
|
+
id?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
room?: string;
|
|
14
|
+
func?: string;
|
|
15
|
+
role?: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
custom?: string;
|
|
18
|
+
}
|
|
19
|
+
interface DialogSelectIDProps {
|
|
6
20
|
dialogName?: string;
|
|
7
|
-
/**
|
|
8
|
-
* The dialog title; default: Please select object ID... (translated)
|
|
9
|
-
*/
|
|
10
21
|
title?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Set to true to allow the selection of multiple IDs.
|
|
13
|
-
*/
|
|
14
22
|
multiSelect?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Show folders before any leaves.
|
|
17
|
-
*/
|
|
18
23
|
foldersFirst?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Prefix (default: '.')
|
|
21
|
-
*/
|
|
22
24
|
imagePrefix?: string;
|
|
23
|
-
|
|
24
|
-
* Show the expert button?
|
|
25
|
-
*/
|
|
25
|
+
prefix?: string;
|
|
26
26
|
showExpertButton?: boolean;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
columns?: import('../Components/types').ObjectBrowserColumn[];
|
|
31
|
-
/**
|
|
32
|
-
* Object types to show; default: 'state' only
|
|
33
|
-
*/
|
|
34
|
-
types?: import('../Components/types').ObjectBrowserType[];
|
|
35
|
-
/**
|
|
36
|
-
* The language.
|
|
37
|
-
*/
|
|
27
|
+
expertMode?: boolean;
|
|
28
|
+
columns?: ObjectBrowserColumn[];
|
|
29
|
+
types?: ObjectBrowserType | ObjectBrowserType[];
|
|
38
30
|
lang?: ioBroker.Languages;
|
|
39
|
-
|
|
40
|
-
* The socket connection.
|
|
41
|
-
*/
|
|
42
|
-
socket: import('../Connection').default;
|
|
43
|
-
/**
|
|
44
|
-
* Can't objects be edited? (default: true)
|
|
45
|
-
*/
|
|
31
|
+
socket: Connection;
|
|
46
32
|
notEditable?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Theme name.
|
|
49
|
-
*/
|
|
50
33
|
themeName?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Theme type.
|
|
53
|
-
*/
|
|
54
34
|
themeType?: string;
|
|
55
|
-
|
|
56
|
-
* Custom filter.
|
|
57
|
-
*/
|
|
58
|
-
customFilter?: import('../Components/types').ObjectBrowserCustomFilter;
|
|
59
|
-
/**
|
|
60
|
-
* The selected IDs.
|
|
61
|
-
*/
|
|
35
|
+
customFilter?: ObjectBrowserCustomFilter;
|
|
62
36
|
selected?: string | string[];
|
|
63
|
-
/**
|
|
64
|
-
* The ok button text; default: OK (translated)
|
|
65
|
-
*/
|
|
66
37
|
ok?: string;
|
|
67
|
-
/**
|
|
68
|
-
* The cancel button text; default: Cancel (translated)
|
|
69
|
-
*/
|
|
70
38
|
cancel?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Close handler that is always called when the dialog is closed.
|
|
73
|
-
*/
|
|
74
39
|
onClose: () => void;
|
|
75
|
-
/**
|
|
76
|
-
* Handler that is called when the user presses OK.
|
|
77
|
-
*/
|
|
78
40
|
onOk: (selected: string | string[] | undefined, name: string) => void;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
* @property {string} [dialogName] The internal name of the dialog; default: "default"
|
|
93
|
-
* @property {string} [title] The dialog title; default: Please select object ID... (translated)
|
|
94
|
-
* @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.
|
|
95
|
-
* @property {boolean} [foldersFirst] Show folders before any leaves.
|
|
96
|
-
* @property {string} [imagePrefix] Prefix (default: '.')
|
|
97
|
-
* @property {boolean} [showExpertButton] Show the expert button?
|
|
98
|
-
* @property {import('../Components/types').ObjectBrowserColumn[]} [columns] Columns to display; default: 'name', 'type', 'role', 'room', 'func', 'val'
|
|
99
|
-
* @property {import('../Components/types').ObjectBrowserType[]} [types] Object types to show; default: 'state' only
|
|
100
|
-
* @property {ioBroker.Languages} [lang] The language.
|
|
101
|
-
* @property {import('../Connection').default} socket The socket connection.
|
|
102
|
-
* @property {boolean} [notEditable] Can't objects be edited? (default: true)
|
|
103
|
-
* @property {string} [themeName] Theme name.
|
|
104
|
-
* @property {string} [themeType] Theme type.
|
|
105
|
-
* @property {import('../Components/types').ObjectBrowserCustomFilter} [customFilter] Custom filter.
|
|
106
|
-
* @property {string | string[]} [selected] The selected IDs.
|
|
107
|
-
* @property {string} [ok] The ok button text; default: OK (translated)
|
|
108
|
-
* @property {string} [cancel] The cancel button text; default: Cancel (translated)
|
|
109
|
-
* @property {() => void} onClose Close handler that is always called when the dialog is closed.
|
|
110
|
-
* @property {(selected: string | string[] | undefined, name: string) => void} onOk Handler that is called when the user presses OK.
|
|
111
|
-
* @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.
|
|
112
|
-
*
|
|
113
|
-
* @extends {React.Component<DialogSelectIDProps>}
|
|
114
|
-
*/
|
|
115
|
-
declare class DialogSelectID extends React.Component<DialogSelectIDProps, any, any> {
|
|
116
|
-
/**
|
|
117
|
-
* @param {DialogSelectIDProps} props
|
|
118
|
-
*/
|
|
41
|
+
classes: Record<string, string>;
|
|
42
|
+
filterFunc?: string | ((obj: ioBroker.Object) => boolean);
|
|
43
|
+
filters: SelectIDFilters;
|
|
44
|
+
root?: string;
|
|
45
|
+
}
|
|
46
|
+
interface DialogSelectIDState {
|
|
47
|
+
selected: string[];
|
|
48
|
+
name: string;
|
|
49
|
+
}
|
|
50
|
+
declare class DialogSelectID extends Component<DialogSelectIDProps, DialogSelectIDState> {
|
|
51
|
+
private readonly dialogName;
|
|
52
|
+
private filters;
|
|
53
|
+
private readonly filterFunc?;
|
|
119
54
|
constructor(props: DialogSelectIDProps);
|
|
120
|
-
dialogName: string;
|
|
121
|
-
filters: any;
|
|
122
|
-
state: {
|
|
123
|
-
selected: string[];
|
|
124
|
-
name: string;
|
|
125
|
-
};
|
|
126
55
|
handleCancel(): void;
|
|
127
56
|
handleOk(): void;
|
|
128
57
|
render(): React.JSX.Element;
|
|
129
58
|
}
|
|
130
|
-
|
|
131
|
-
namespace propTypes {
|
|
132
|
-
let dialogName: PropTypes.Requireable<string>;
|
|
133
|
-
let classes: PropTypes.Requireable<object>;
|
|
134
|
-
let notEditable: PropTypes.Requireable<boolean>;
|
|
135
|
-
let onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
136
|
-
let onOk: PropTypes.Validator<(...args: any[]) => any>;
|
|
137
|
-
let title: PropTypes.Requireable<string>;
|
|
138
|
-
let lang: PropTypes.Requireable<string>;
|
|
139
|
-
let foldersFirst: PropTypes.Requireable<boolean>;
|
|
140
|
-
let selected: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
141
|
-
let filters: PropTypes.Requireable<object>;
|
|
142
|
-
let customFilter: PropTypes.Requireable<object>;
|
|
143
|
-
let socket: PropTypes.Validator<object>;
|
|
144
|
-
let cancel: PropTypes.Requireable<string>;
|
|
145
|
-
let imagePrefix: PropTypes.Requireable<string>;
|
|
146
|
-
let ok: PropTypes.Requireable<string>;
|
|
147
|
-
let themeName: PropTypes.Requireable<string>;
|
|
148
|
-
let themeType: PropTypes.Requireable<string>;
|
|
149
|
-
let showExpertButton: PropTypes.Requireable<boolean>;
|
|
150
|
-
let expertMode: PropTypes.Requireable<boolean>;
|
|
151
|
-
let multiSelect: PropTypes.Requireable<boolean>;
|
|
152
|
-
let types: PropTypes.Requireable<any[]>;
|
|
153
|
-
let columns: PropTypes.Requireable<any[]>;
|
|
154
|
-
let root: PropTypes.Requireable<string>;
|
|
155
|
-
let filterFunc: PropTypes.Requireable<(...args: any[]) => any>;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
import React from 'react';
|
|
159
|
-
import PropTypes from 'prop-types';
|
|
59
|
+
export default DialogSelectID;
|
package/Dialogs/SelectID.js
CHANGED
|
@@ -1,283 +1,153 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
6
17
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
20
|
-
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
21
|
-
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
22
|
-
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
23
|
-
var _Cancel = _interopRequireDefault(require("@mui/icons-material/Cancel"));
|
|
24
|
-
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
25
|
-
var _Utils = _interopRequireDefault(require("../Components/Utils"));
|
|
26
|
-
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
27
|
-
var _ObjectBrowser = _interopRequireDefault(require("../Components/ObjectBrowser"));
|
|
28
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
31
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /**
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
/**
|
|
32
30
|
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
33
31
|
*
|
|
34
32
|
* MIT License
|
|
35
33
|
*
|
|
36
|
-
**/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* @property {import('../Connection').default} socket The socket connection.
|
|
82
|
-
* @property {boolean} [notEditable] Can't objects be edited? (default: true)
|
|
83
|
-
* @property {string} [themeName] Theme name.
|
|
84
|
-
* @property {string} [themeType] Theme type.
|
|
85
|
-
* @property {import('../Components/types').ObjectBrowserCustomFilter} [customFilter] Custom filter.
|
|
86
|
-
* @property {string | string[]} [selected] The selected IDs.
|
|
87
|
-
* @property {string} [ok] The ok button text; default: OK (translated)
|
|
88
|
-
* @property {string} [cancel] The cancel button text; default: Cancel (translated)
|
|
89
|
-
* @property {() => void} onClose Close handler that is always called when the dialog is closed.
|
|
90
|
-
* @property {(selected: string | string[] | undefined, name: string) => void} onOk Handler that is called when the user presses OK.
|
|
91
|
-
* @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.
|
|
92
|
-
*
|
|
93
|
-
* @extends {React.Component<DialogSelectIDProps>}
|
|
94
|
-
*/
|
|
95
|
-
var DialogSelectID = /*#__PURE__*/function (_React$Component) {
|
|
96
|
-
(0, _inherits2["default"])(DialogSelectID, _React$Component);
|
|
97
|
-
var _super = _createSuper(DialogSelectID);
|
|
98
|
-
/**
|
|
99
|
-
* @param {DialogSelectIDProps} props
|
|
100
|
-
*/
|
|
101
|
-
function DialogSelectID(props) {
|
|
102
|
-
var _this;
|
|
103
|
-
(0, _classCallCheck2["default"])(this, DialogSelectID);
|
|
104
|
-
_this = _super.call(this, props);
|
|
105
|
-
_this.dialogName = _this.props.dialogName || 'default';
|
|
106
|
-
_this.dialogName = "SelectID.".concat(_this.dialogName);
|
|
107
|
-
_this.filters = (window._localStorage || window.localStorage).getItem(_this.dialogName) || '{}';
|
|
108
|
-
try {
|
|
109
|
-
_this.filters = JSON.parse(_this.filters);
|
|
110
|
-
} catch (e) {
|
|
111
|
-
_this.filters = {};
|
|
112
|
-
}
|
|
113
|
-
if (props.filters) {
|
|
114
|
-
_this.filters = _objectSpread(_objectSpread({}, _this.filters), props.filters);
|
|
115
|
-
}
|
|
116
|
-
var selected = _this.props.selected || [];
|
|
117
|
-
if ((0, _typeof2["default"])(selected) !== 'object') {
|
|
118
|
-
selected = [selected];
|
|
34
|
+
**/
|
|
35
|
+
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
|
+
const react_1 = __importStar(require("react"));
|
|
37
|
+
const material_1 = require("@mui/material");
|
|
38
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
39
|
+
const i18n_1 = __importDefault(require("../i18n"));
|
|
40
|
+
const ObjectBrowser_1 = __importDefault(require("../Components/ObjectBrowser"));
|
|
41
|
+
class DialogSelectID extends react_1.Component {
|
|
42
|
+
constructor(props) {
|
|
43
|
+
super(props);
|
|
44
|
+
this.dialogName = this.props.dialogName || 'default';
|
|
45
|
+
this.dialogName = `SelectID.${this.dialogName}`;
|
|
46
|
+
const filters = (window._localStorage || window.localStorage).getItem(this.dialogName) || '{}';
|
|
47
|
+
try {
|
|
48
|
+
this.filters = JSON.parse(filters);
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
this.filters = {};
|
|
52
|
+
}
|
|
53
|
+
if (props.filters) {
|
|
54
|
+
this.filters = Object.assign(Object.assign({}, this.filters), props.filters);
|
|
55
|
+
}
|
|
56
|
+
let selected = this.props.selected || [];
|
|
57
|
+
if (!Array.isArray(selected)) {
|
|
58
|
+
selected = [selected];
|
|
59
|
+
}
|
|
60
|
+
selected = selected.filter(id => id);
|
|
61
|
+
if (props.filterFunc) {
|
|
62
|
+
if (typeof props.filterFunc === 'string') {
|
|
63
|
+
try {
|
|
64
|
+
this.filterFunc = new Function('obj', props.filterFunc);
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
console.error(`Cannot parse filter function: "obj => ${props.filterFunc}"`);
|
|
68
|
+
this.filterFunc = undefined;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.filterFunc = props.filterFunc;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
this.state = {
|
|
76
|
+
selected,
|
|
77
|
+
name: '',
|
|
78
|
+
};
|
|
119
79
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
123
|
-
_this.state = {
|
|
124
|
-
selected: selected,
|
|
125
|
-
name: ''
|
|
126
|
-
};
|
|
127
|
-
return _this;
|
|
128
|
-
}
|
|
129
|
-
(0, _createClass2["default"])(DialogSelectID, [{
|
|
130
|
-
key: "handleCancel",
|
|
131
|
-
value: function handleCancel() {
|
|
132
|
-
this.props.onClose();
|
|
80
|
+
handleCancel() {
|
|
81
|
+
this.props.onClose();
|
|
133
82
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this.props.onOk(this.props.multiSelect ? this.state.selected : this.state.selected[0] || '', this.state.name);
|
|
138
|
-
this.props.onClose();
|
|
83
|
+
handleOk() {
|
|
84
|
+
this.props.onOk(this.props.multiSelect ? this.state.selected : this.state.selected[0] || '', this.state.name);
|
|
85
|
+
this.props.onClose();
|
|
139
86
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}, _i18n["default"].t('%s items', this.state.selected.length))];
|
|
87
|
+
render() {
|
|
88
|
+
let title;
|
|
89
|
+
if (this.state.name || this.state.selected.length) {
|
|
90
|
+
if (this.state.selected.length === 1) {
|
|
91
|
+
title = [
|
|
92
|
+
react_1.default.createElement("span", { key: "selected" },
|
|
93
|
+
i18n_1.default.t('ra_Selected'),
|
|
94
|
+
"\u00A0"),
|
|
95
|
+
react_1.default.createElement("span", { key: "id", style: { fontWeight: 'bold', fontStyle: 'italic' } }, (this.state.name || this.state.selected) + (this.state.name ? ` [${this.state.selected}]` : '')),
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
title = [
|
|
100
|
+
react_1.default.createElement("span", { key: "selected" },
|
|
101
|
+
i18n_1.default.t('ra_Selected'),
|
|
102
|
+
"\u00A0"),
|
|
103
|
+
react_1.default.createElement("span", { key: "id", style: { fontWeight: 'bold', fontStyle: 'italic' } }, i18n_1.default.t('%s items', this.state.selected.length.toString())),
|
|
104
|
+
];
|
|
105
|
+
}
|
|
160
106
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
165
|
-
onClose: function onClose() {},
|
|
166
|
-
maxWidth: false,
|
|
167
|
-
classes: {
|
|
168
|
-
paper: _Utils["default"].clsx(this.props.classes.dialog, this.props.classes.dialogMobile)
|
|
169
|
-
},
|
|
170
|
-
fullWidth: true,
|
|
171
|
-
open: !0,
|
|
172
|
-
"aria-labelledby": "ar_dialog_selectid_title"
|
|
173
|
-
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
174
|
-
id: "ar_dialog_selectid_title",
|
|
175
|
-
classes: {
|
|
176
|
-
root: this.props.classes.titleRoot
|
|
107
|
+
else {
|
|
108
|
+
title = this.props.title || i18n_1.default.t('ra_Please select object ID...');
|
|
177
109
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
filterFunc: this.props.filterFunc
|
|
222
|
-
})), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
223
|
-
id: "ar_dialog_selectid_ok_".concat(this.props.dialogName || ''),
|
|
224
|
-
variant: "contained",
|
|
225
|
-
onClick: function onClick() {
|
|
226
|
-
return _this2.handleOk();
|
|
227
|
-
},
|
|
228
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null),
|
|
229
|
-
disabled: !this.state.selected.length,
|
|
230
|
-
color: "primary"
|
|
231
|
-
}, this.props.ok || _i18n["default"].t('ra_Ok')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
232
|
-
id: "ar_dialog_selectid_cancel_".concat(this.props.dialogName || ''),
|
|
233
|
-
color: "grey",
|
|
234
|
-
variant: "contained",
|
|
235
|
-
onClick: function onClick() {
|
|
236
|
-
return _this2.handleCancel();
|
|
237
|
-
},
|
|
238
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_Cancel["default"], null)
|
|
239
|
-
}, this.props.cancel || _i18n["default"].t('ra_Cancel'))));
|
|
110
|
+
return react_1.default.createElement(material_1.Dialog, { onClose: () => { }, maxWidth: false,
|
|
111
|
+
//classes={{ paper: Utils.clsx(this.props.classes.dialog, this.props.classes.dialogMobile) }}
|
|
112
|
+
style: {
|
|
113
|
+
height: '95%',
|
|
114
|
+
padding: 4,
|
|
115
|
+
width: '100%',
|
|
116
|
+
maxWidth: '100%',
|
|
117
|
+
maxHeight: 'calc(100% - 16px)',
|
|
118
|
+
}, fullWidth: true, open: !0, "aria-labelledby": "ar_dialog_selectid_title" },
|
|
119
|
+
react_1.default.createElement(material_1.DialogTitle, { id: "ar_dialog_selectid_title", style: {
|
|
120
|
+
whiteSpace: 'nowrap',
|
|
121
|
+
width: 'calc(100% - 72px)',
|
|
122
|
+
overflow: 'hidden',
|
|
123
|
+
display: 'inline-block',
|
|
124
|
+
textOverflow: 'ellipsis',
|
|
125
|
+
} }, title),
|
|
126
|
+
react_1.default.createElement(material_1.DialogContent, { style: {
|
|
127
|
+
height: '100%',
|
|
128
|
+
overflow: 'hidden',
|
|
129
|
+
padding: '8px 4px',
|
|
130
|
+
} },
|
|
131
|
+
react_1.default.createElement(ObjectBrowser_1.default, { foldersFirst: this.props.foldersFirst, imagePrefix: this.props.imagePrefix || this.props.prefix, defaultFilters: this.filters, dialogName: this.dialogName, showExpertButton: this.props.showExpertButton !== undefined ? this.props.showExpertButton : true, expertMode: this.props.expertMode,
|
|
132
|
+
// style={{ width: '100%', height: '100%' }}
|
|
133
|
+
columns: this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val'], types: this.props.types ? (Array.isArray(this.props.types) ? this.props.types : [this.props.types]) : ['state'], root: this.props.root, t: i18n_1.default.t, lang: this.props.lang || i18n_1.default.getLanguage(), socket: this.props.socket, selected: this.state.selected, multiSelect: this.props.multiSelect, notEditable: this.props.notEditable === undefined ? true : this.props.notEditable,
|
|
134
|
+
// name={this.state.name}
|
|
135
|
+
themeName: this.props.themeName, themeType: this.props.themeType, customFilter: this.props.customFilter, onFilterChanged: filterConfig => {
|
|
136
|
+
this.filters = filterConfig;
|
|
137
|
+
(window._localStorage || window.localStorage).setItem(this.dialogName, JSON.stringify(filterConfig));
|
|
138
|
+
}, onSelect: (selected, name, isDouble) => {
|
|
139
|
+
if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
|
|
140
|
+
this.setState({ selected, name }, () => isDouble && this.handleOk());
|
|
141
|
+
}
|
|
142
|
+
else if (isDouble) {
|
|
143
|
+
this.handleOk();
|
|
144
|
+
}
|
|
145
|
+
}, filterFunc: this.filterFunc, title: "", classes: {} })),
|
|
146
|
+
react_1.default.createElement(material_1.DialogActions, null,
|
|
147
|
+
react_1.default.createElement(material_1.Button, { id: `ar_dialog_selectid_ok_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleOk(), startIcon: react_1.default.createElement(icons_material_1.Check, null), disabled: !this.state.selected.length, color: "primary" }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
148
|
+
react_1.default.createElement(material_1.Button, { id: `ar_dialog_selectid_cancel_${this.props.dialogName || ''}`,
|
|
149
|
+
// @ts-expect-error
|
|
150
|
+
color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
240
151
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}(_react["default"].Component);
|
|
244
|
-
DialogSelectID.propTypes = {
|
|
245
|
-
dialogName: _propTypes["default"].string,
|
|
246
|
-
// where to store settings in localStorage
|
|
247
|
-
classes: _propTypes["default"].object,
|
|
248
|
-
notEditable: _propTypes["default"].bool,
|
|
249
|
-
onClose: _propTypes["default"].func.isRequired,
|
|
250
|
-
onOk: _propTypes["default"].func.isRequired,
|
|
251
|
-
title: _propTypes["default"].string,
|
|
252
|
-
lang: _propTypes["default"].string,
|
|
253
|
-
foldersFirst: _propTypes["default"].bool,
|
|
254
|
-
selected: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].array]),
|
|
255
|
-
filters: _propTypes["default"].object,
|
|
256
|
-
// predefined filter fields, like {"id":"","name":"","room":"","func":"","role":"level","type":"","custom":""}
|
|
257
|
-
customFilter: _propTypes["default"].object,
|
|
258
|
-
// optional {common: {custom: true}} or {common: {custom: 'sql.0'}}
|
|
259
|
-
socket: _propTypes["default"].object.isRequired,
|
|
260
|
-
cancel: _propTypes["default"].string,
|
|
261
|
-
imagePrefix: _propTypes["default"].string,
|
|
262
|
-
ok: _propTypes["default"].string,
|
|
263
|
-
themeName: _propTypes["default"].string,
|
|
264
|
-
themeType: _propTypes["default"].string,
|
|
265
|
-
showExpertButton: _propTypes["default"].bool,
|
|
266
|
-
expertMode: _propTypes["default"].bool,
|
|
267
|
-
// force expert mode
|
|
268
|
-
multiSelect: _propTypes["default"].bool,
|
|
269
|
-
types: _propTypes["default"].array,
|
|
270
|
-
// optional ['state', 'instance', 'channel']
|
|
271
|
-
columns: _propTypes["default"].array,
|
|
272
|
-
// optional ['name', 'type', 'role', 'room', 'func', 'val', 'buttons']
|
|
273
|
-
root: _propTypes["default"].string,
|
|
274
|
-
// optional. Root of tree. Show only this branch of tree
|
|
275
|
-
|
|
276
|
-
filterFunc: _propTypes["default"].func // function to filter out all unnecessary objects. It cannot be used together with "types"
|
|
277
|
-
// Example for function: `obj => obj.common && obj.common.type === 'boolean'` to show only boolean states
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
/** @type {typeof DialogSelectID} */
|
|
281
|
-
var _export = (0, _styles.withStyles)(styles)(DialogSelectID);
|
|
282
|
-
var _default = exports["default"] = _export;
|
|
283
|
-
//# sourceMappingURL=SelectID.js.map
|
|
152
|
+
}
|
|
153
|
+
exports.default = DialogSelectID;
|
package/LegacyConnection.d.ts
CHANGED
|
@@ -331,9 +331,9 @@ declare class Connection {
|
|
|
331
331
|
* @param {string | { [lang in ioBroker.Languages]?: string; }} newName The new name.
|
|
332
332
|
*/
|
|
333
333
|
renameGroup(id: string, newId: string, newName: string | {
|
|
334
|
+
fr?: string;
|
|
334
335
|
pt?: string;
|
|
335
336
|
pl?: string;
|
|
336
|
-
fr?: string;
|
|
337
337
|
en?: string;
|
|
338
338
|
de?: string;
|
|
339
339
|
ru?: string;
|