@iobroker/gui-components 8.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/LICENSE +22 -0
- package/README.md +1450 -0
- package/build/AdminConnection.d.ts +1 -0
- package/build/AdminConnection.js +2 -0
- package/build/AdminConnection.js.map +1 -0
- package/build/Components/404.d.ts +4 -0
- package/build/Components/404.js +97 -0
- package/build/Components/404.js.map +1 -0
- package/build/Components/ColorPicker.d.ts +86 -0
- package/build/Components/ColorPicker.js +222 -0
- package/build/Components/ColorPicker.js.map +1 -0
- package/build/Components/ComplexCron.d.ts +40 -0
- package/build/Components/ComplexCron.js +401 -0
- package/build/Components/ComplexCron.js.map +1 -0
- package/build/Components/CopyToClipboard.d.ts +14 -0
- package/build/Components/CopyToClipboard.js +160 -0
- package/build/Components/CopyToClipboard.js.map +1 -0
- package/build/Components/CustomModal.d.ts +26 -0
- package/build/Components/CustomModal.js +62 -0
- package/build/Components/CustomModal.js.map +1 -0
- package/build/Components/DeviceType/DeviceTypeIcon.d.ts +29 -0
- package/build/Components/DeviceType/DeviceTypeIcon.js +108 -0
- package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -0
- package/build/Components/DeviceType/DeviceTypeOptions.d.ts +2 -0
- package/build/Components/DeviceType/DeviceTypeOptions.js +69 -0
- package/build/Components/DeviceType/DeviceTypeOptions.js.map +1 -0
- package/build/Components/DeviceType/DeviceTypeSelector.d.ts +20 -0
- package/build/Components/DeviceType/DeviceTypeSelector.js +83 -0
- package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -0
- package/build/Components/DeviceType/deviceTypeTranslations.d.ts +1 -0
- package/build/Components/DeviceType/deviceTypeTranslations.js +30 -0
- package/build/Components/DeviceType/deviceTypeTranslations.js.map +1 -0
- package/build/Components/DeviceType/i18n/de.json +46 -0
- package/build/Components/DeviceType/i18n/en.json +46 -0
- package/build/Components/DeviceType/i18n/fr.json +46 -0
- package/build/Components/DeviceType/i18n/it.json +46 -0
- package/build/Components/DeviceType/i18n/nl.json +46 -0
- package/build/Components/DeviceType/i18n/pl.json +46 -0
- package/build/Components/DeviceType/i18n/pt.json +46 -0
- package/build/Components/DeviceType/i18n/ru.json +46 -0
- package/build/Components/DeviceType/i18n/uk.json +46 -0
- package/build/Components/DeviceType/i18n/zh-cn.json +46 -0
- package/build/Components/DeviceType/icons/Cleaner.d.ts +3 -0
- package/build/Components/DeviceType/icons/Cleaner.js +14 -0
- package/build/Components/DeviceType/icons/Cleaner.js.map +1 -0
- package/build/Components/DeviceType/icons/DoorClosed.d.ts +3 -0
- package/build/Components/DeviceType/icons/DoorClosed.js +7 -0
- package/build/Components/DeviceType/icons/DoorClosed.js.map +1 -0
- package/build/Components/DeviceType/icons/DoorOpened.d.ts +3 -0
- package/build/Components/DeviceType/icons/DoorOpened.js +7 -0
- package/build/Components/DeviceType/icons/DoorOpened.js.map +1 -0
- package/build/Components/DeviceType/icons/FireOff.d.ts +3 -0
- package/build/Components/DeviceType/icons/FireOff.js +8 -0
- package/build/Components/DeviceType/icons/FireOff.js.map +1 -0
- package/build/Components/DeviceType/icons/FireOn.d.ts +3 -0
- package/build/Components/DeviceType/icons/FireOn.js +14 -0
- package/build/Components/DeviceType/icons/FireOn.js.map +1 -0
- package/build/Components/DeviceType/icons/FloodOff.d.ts +3 -0
- package/build/Components/DeviceType/icons/FloodOff.js +11 -0
- package/build/Components/DeviceType/icons/FloodOff.js.map +1 -0
- package/build/Components/DeviceType/icons/FloodOn.d.ts +3 -0
- package/build/Components/DeviceType/icons/FloodOn.js +18 -0
- package/build/Components/DeviceType/icons/FloodOn.js.map +1 -0
- package/build/Components/DeviceType/icons/Gate.d.ts +3 -0
- package/build/Components/DeviceType/icons/Gate.js +8 -0
- package/build/Components/DeviceType/icons/Gate.js.map +1 -0
- package/build/Components/DeviceType/icons/HeatValve.d.ts +3 -0
- package/build/Components/DeviceType/icons/HeatValve.js +6 -0
- package/build/Components/DeviceType/icons/HeatValve.js.map +1 -0
- package/build/Components/DeviceType/icons/Home.d.ts +3 -0
- package/build/Components/DeviceType/icons/Home.js +6 -0
- package/build/Components/DeviceType/icons/Home.js.map +1 -0
- package/build/Components/DeviceType/icons/Humidity.d.ts +3 -0
- package/build/Components/DeviceType/icons/Humidity.js +8 -0
- package/build/Components/DeviceType/icons/Humidity.js.map +1 -0
- package/build/Components/DeviceType/icons/IconHome.d.ts +5 -0
- package/build/Components/DeviceType/icons/IconHome.js +21 -0
- package/build/Components/DeviceType/icons/IconHome.js.map +1 -0
- package/build/Components/DeviceType/icons/Jalousie.d.ts +3 -0
- package/build/Components/DeviceType/icons/Jalousie.js +7 -0
- package/build/Components/DeviceType/icons/Jalousie.js.map +1 -0
- package/build/Components/DeviceType/icons/Material.d.ts +3 -0
- package/build/Components/DeviceType/icons/Material.js +8 -0
- package/build/Components/DeviceType/icons/Material.js.map +1 -0
- package/build/Components/DeviceType/icons/MotionOff.d.ts +3 -0
- package/build/Components/DeviceType/icons/MotionOff.js +11 -0
- package/build/Components/DeviceType/icons/MotionOff.js.map +1 -0
- package/build/Components/DeviceType/icons/MotionOn.d.ts +3 -0
- package/build/Components/DeviceType/icons/MotionOn.js +7 -0
- package/build/Components/DeviceType/icons/MotionOn.js.map +1 -0
- package/build/Components/DeviceType/icons/PushButton.d.ts +3 -0
- package/build/Components/DeviceType/icons/PushButton.js +9 -0
- package/build/Components/DeviceType/icons/PushButton.js.map +1 -0
- package/build/Components/DeviceType/icons/RGB.d.ts +3 -0
- package/build/Components/DeviceType/icons/RGB.js +43 -0
- package/build/Components/DeviceType/icons/RGB.js.map +1 -0
- package/build/Components/DeviceType/icons/RepairExpert.d.ts +3 -0
- package/build/Components/DeviceType/icons/RepairExpert.js +6 -0
- package/build/Components/DeviceType/icons/RepairExpert.js.map +1 -0
- package/build/Components/DeviceType/icons/Socket.d.ts +3 -0
- package/build/Components/DeviceType/icons/Socket.js +8 -0
- package/build/Components/DeviceType/icons/Socket.js.map +1 -0
- package/build/Components/DeviceType/icons/Thermometer.d.ts +3 -0
- package/build/Components/DeviceType/icons/Thermometer.js +7 -0
- package/build/Components/DeviceType/icons/Thermometer.js.map +1 -0
- package/build/Components/DeviceType/icons/ThermometerSimple.d.ts +3 -0
- package/build/Components/DeviceType/icons/ThermometerSimple.js +8 -0
- package/build/Components/DeviceType/icons/ThermometerSimple.js.map +1 -0
- package/build/Components/DeviceType/icons/Thermostat.d.ts +3 -0
- package/build/Components/DeviceType/icons/Thermostat.js +9 -0
- package/build/Components/DeviceType/icons/Thermostat.js.map +1 -0
- package/build/Components/DeviceType/icons/Valve.d.ts +3 -0
- package/build/Components/DeviceType/icons/Valve.js +7 -0
- package/build/Components/DeviceType/icons/Valve.js.map +1 -0
- package/build/Components/DeviceType/icons/WindowClosed.d.ts +3 -0
- package/build/Components/DeviceType/icons/WindowClosed.js +8 -0
- package/build/Components/DeviceType/icons/WindowClosed.js.map +1 -0
- package/build/Components/DeviceType/icons/WindowOpened.d.ts +3 -0
- package/build/Components/DeviceType/icons/WindowOpened.js +9 -0
- package/build/Components/DeviceType/icons/WindowOpened.js.map +1 -0
- package/build/Components/DeviceType/icons/WindowTilted.d.ts +3 -0
- package/build/Components/DeviceType/icons/WindowTilted.js +8 -0
- package/build/Components/DeviceType/icons/WindowTilted.js.map +1 -0
- package/build/Components/DeviceType/icons/index.d.ts +28 -0
- package/build/Components/DeviceType/icons/index.js +28 -0
- package/build/Components/DeviceType/icons/index.js.map +1 -0
- package/build/Components/FileBrowser.d.ts +187 -0
- package/build/Components/FileBrowser.js +1711 -0
- package/build/Components/FileBrowser.js.map +1 -0
- package/build/Components/FileViewer.d.ts +49 -0
- package/build/Components/FileViewer.js +247 -0
- package/build/Components/FileViewer.js.map +1 -0
- package/build/Components/Icon.d.ts +35 -0
- package/build/Components/Icon.js +140 -0
- package/build/Components/Icon.js.map +1 -0
- package/build/Components/IconPicker.d.ts +25 -0
- package/build/Components/IconPicker.js +72 -0
- package/build/Components/IconPicker.js.map +1 -0
- package/build/Components/IconSelector.d.ts +33 -0
- package/build/Components/IconSelector.js +2086 -0
- package/build/Components/IconSelector.js.map +1 -0
- package/build/Components/Image.d.ts +31 -0
- package/build/Components/Image.js +126 -0
- package/build/Components/Image.js.map +1 -0
- package/build/Components/InfoBox.d.ts +37 -0
- package/build/Components/InfoBox.js +115 -0
- package/build/Components/InfoBox.js.map +1 -0
- package/build/Components/IobUri.d.ts +14 -0
- package/build/Components/IobUri.js +168 -0
- package/build/Components/IobUri.js.map +1 -0
- package/build/Components/Loader.d.ts +31 -0
- package/build/Components/Loader.js +265 -0
- package/build/Components/Loader.js.map +1 -0
- package/build/Components/Loaders/MV.d.ts +17 -0
- package/build/Components/Loaders/MV.js +61 -0
- package/build/Components/Loaders/MV.js.map +1 -0
- package/build/Components/Loaders/PT.d.ts +27 -0
- package/build/Components/Loaders/PT.js +150 -0
- package/build/Components/Loaders/PT.js.map +1 -0
- package/build/Components/Loaders/Vendor.d.ts +22 -0
- package/build/Components/Loaders/Vendor.js +52 -0
- package/build/Components/Loaders/Vendor.js.map +1 -0
- package/build/Components/Logo.d.ts +18 -0
- package/build/Components/Logo.js +109 -0
- package/build/Components/Logo.js.map +1 -0
- package/build/Components/MDUtils.d.ts +11 -0
- package/build/Components/MDUtils.js +99 -0
- package/build/Components/MDUtils.js.map +1 -0
- package/build/Components/ObjectBrowser.d.ts +665 -0
- package/build/Components/ObjectBrowser.js +6245 -0
- package/build/Components/ObjectBrowser.js.map +1 -0
- package/build/Components/Router.d.ts +21 -0
- package/build/Components/Router.js +77 -0
- package/build/Components/Router.js.map +1 -0
- package/build/Components/SaveCloseButtons.d.ts +20 -0
- package/build/Components/SaveCloseButtons.js +65 -0
- package/build/Components/SaveCloseButtons.js.map +1 -0
- package/build/Components/Schedule.d.ts +62 -0
- package/build/Components/Schedule.js +1266 -0
- package/build/Components/Schedule.js.map +1 -0
- package/build/Components/SelectWithIcon.d.ts +37 -0
- package/build/Components/SelectWithIcon.js +139 -0
- package/build/Components/SelectWithIcon.js.map +1 -0
- package/build/Components/SimpleCron/cronText.d.ts +10 -0
- package/build/Components/SimpleCron/cronText.js +14 -0
- package/build/Components/SimpleCron/cronText.js.map +1 -0
- package/build/Components/SimpleCron/index.d.ts +55 -0
- package/build/Components/SimpleCron/index.js +698 -0
- package/build/Components/SimpleCron/index.js.map +1 -0
- package/build/Components/TabContainer.d.ts +15 -0
- package/build/Components/TabContainer.js +23 -0
- package/build/Components/TabContainer.js.map +1 -0
- package/build/Components/TabContent.d.ts +11 -0
- package/build/Components/TabContent.js +20 -0
- package/build/Components/TabContent.js.map +1 -0
- package/build/Components/TabHeader.d.ts +6 -0
- package/build/Components/TabHeader.js +6 -0
- package/build/Components/TabHeader.js.map +1 -0
- package/build/Components/TableResize.d.ts +45 -0
- package/build/Components/TableResize.js +204 -0
- package/build/Components/TableResize.js.map +1 -0
- package/build/Components/TextWithIcon.d.ts +21 -0
- package/build/Components/TextWithIcon.js +113 -0
- package/build/Components/TextWithIcon.js.map +1 -0
- package/build/Components/ToggleThemeMenu.d.ts +12 -0
- package/build/Components/ToggleThemeMenu.js +13 -0
- package/build/Components/ToggleThemeMenu.js.map +1 -0
- package/build/Components/TreeTable.d.ts +79 -0
- package/build/Components/TreeTable.js +538 -0
- package/build/Components/TreeTable.js.map +1 -0
- package/build/Components/UploadImage.d.ts +23 -0
- package/build/Components/UploadImage.js +516 -0
- package/build/Components/UploadImage.js.map +1 -0
- package/build/Components/Utils.d.ts +331 -0
- package/build/Components/Utils.js +1605 -0
- package/build/Components/Utils.js.map +1 -0
- package/build/Components/withWidth.d.ts +2 -0
- package/build/Components/withWidth.js +22 -0
- package/build/Components/withWidth.js.map +1 -0
- package/build/Connection.d.ts +1 -0
- package/build/Connection.js +2 -0
- package/build/Connection.js.map +1 -0
- package/build/Dialogs/ComplexCron.d.ts +24 -0
- package/build/Dialogs/ComplexCron.js +85 -0
- package/build/Dialogs/ComplexCron.js.map +1 -0
- package/build/Dialogs/Confirm.d.ts +39 -0
- package/build/Dialogs/Confirm.js +83 -0
- package/build/Dialogs/Confirm.js.map +1 -0
- package/build/Dialogs/Cron.d.ts +29 -0
- package/build/Dialogs/Cron.js +72 -0
- package/build/Dialogs/Cron.js.map +1 -0
- package/build/Dialogs/Error.d.ts +18 -0
- package/build/Dialogs/Error.js +27 -0
- package/build/Dialogs/Error.js.map +1 -0
- package/build/Dialogs/Message.d.ts +20 -0
- package/build/Dialogs/Message.js +29 -0
- package/build/Dialogs/Message.js.map +1 -0
- package/build/Dialogs/SelectFile.d.ts +85 -0
- package/build/Dialogs/SelectFile.js +115 -0
- package/build/Dialogs/SelectFile.js.map +1 -0
- package/build/Dialogs/SelectID.d.ts +102 -0
- package/build/Dialogs/SelectID.js +151 -0
- package/build/Dialogs/SelectID.js.map +1 -0
- package/build/Dialogs/SimpleCron.d.ts +19 -0
- package/build/Dialogs/SimpleCron.js +46 -0
- package/build/Dialogs/SimpleCron.js.map +1 -0
- package/build/Dialogs/TextInput.d.ts +2 -0
- package/build/Dialogs/TextInput.js +31 -0
- package/build/Dialogs/TextInput.js.map +1 -0
- package/build/GenericApp.d.ts +209 -0
- package/build/GenericApp.js +842 -0
- package/build/GenericApp.js.map +1 -0
- package/build/LegacyConnection.d.ts +938 -0
- package/build/LegacyConnection.js +2849 -0
- package/build/LegacyConnection.js.map +1 -0
- package/build/Prompt.d.ts +5 -0
- package/build/Prompt.js +19 -0
- package/build/Prompt.js.map +1 -0
- package/build/Theme.d.ts +5 -0
- package/build/Theme.js +344 -0
- package/build/Theme.js.map +1 -0
- package/build/assets/devices/parseNames.d.ts +0 -0
- package/build/assets/devices/parseNames.js +35 -0
- package/build/assets/devices/parseNames.js.map +1 -0
- package/build/assets/devices.json +1 -0
- package/build/assets/lamp_ceiling.svg +9 -0
- package/build/assets/lamp_table.svg +8 -0
- package/build/assets/no_icon.svg +9 -0
- package/build/assets/rooms/parseNames.d.ts +0 -0
- package/build/assets/rooms/parseNames.js +35 -0
- package/build/assets/rooms/parseNames.js.map +1 -0
- package/build/assets/rooms.json +1 -0
- package/build/dictionary.d.ts +1 -0
- package/build/dictionary.js +25 -0
- package/build/dictionary.js.map +1 -0
- package/build/globals.d.ts +19 -0
- package/build/i18n/de.json +480 -0
- package/build/i18n/en.json +480 -0
- package/build/i18n/es.json +480 -0
- package/build/i18n/fr.json +480 -0
- package/build/i18n/it.json +475 -0
- package/build/i18n/nl.json +475 -0
- package/build/i18n/pl.json +475 -0
- package/build/i18n/pt.json +475 -0
- package/build/i18n/ru.json +475 -0
- package/build/i18n/uk.json +475 -0
- package/build/i18n/zh-cn.json +475 -0
- package/build/i18n.d.ts +84 -0
- package/build/i18n.js +224 -0
- package/build/i18n.js.map +1 -0
- package/build/icons/IconAdapter.d.ts +3 -0
- package/build/icons/IconAdapter.js +7 -0
- package/build/icons/IconAdapter.js.map +1 -0
- package/build/icons/IconAlias.d.ts +3 -0
- package/build/icons/IconAlias.js +7 -0
- package/build/icons/IconAlias.js.map +1 -0
- package/build/icons/IconButtonImage.d.ts +3 -0
- package/build/icons/IconButtonImage.js +9 -0
- package/build/icons/IconButtonImage.js.map +1 -0
- package/build/icons/IconChannel.d.ts +3 -0
- package/build/icons/IconChannel.js +10 -0
- package/build/icons/IconChannel.js.map +1 -0
- package/build/icons/IconClearFilter.d.ts +3 -0
- package/build/icons/IconClearFilter.js +8 -0
- package/build/icons/IconClearFilter.js.map +1 -0
- package/build/icons/IconClosed.d.ts +3 -0
- package/build/icons/IconClosed.js +7 -0
- package/build/icons/IconClosed.js.map +1 -0
- package/build/icons/IconCopy.d.ts +3 -0
- package/build/icons/IconCopy.js +6 -0
- package/build/icons/IconCopy.js.map +1 -0
- package/build/icons/IconDevice.d.ts +3 -0
- package/build/icons/IconDevice.js +16 -0
- package/build/icons/IconDevice.js.map +1 -0
- package/build/icons/IconDocument.d.ts +3 -0
- package/build/icons/IconDocument.js +7 -0
- package/build/icons/IconDocument.js.map +1 -0
- package/build/icons/IconDocumentReadOnly.d.ts +3 -0
- package/build/icons/IconDocumentReadOnly.js +8 -0
- package/build/icons/IconDocumentReadOnly.js.map +1 -0
- package/build/icons/IconExpert.d.ts +3 -0
- package/build/icons/IconExpert.js +7 -0
- package/build/icons/IconExpert.js.map +1 -0
- package/build/icons/IconFx.d.ts +3 -0
- package/build/icons/IconFx.js +6 -0
- package/build/icons/IconFx.js.map +1 -0
- package/build/icons/IconInstance.d.ts +3 -0
- package/build/icons/IconInstance.js +7 -0
- package/build/icons/IconInstance.js.map +1 -0
- package/build/icons/IconLogout.d.ts +3 -0
- package/build/icons/IconLogout.js +7 -0
- package/build/icons/IconLogout.js.map +1 -0
- package/build/icons/IconNoIcon.d.ts +3 -0
- package/build/icons/IconNoIcon.js +6 -0
- package/build/icons/IconNoIcon.js.map +1 -0
- package/build/icons/IconOpen.d.ts +3 -0
- package/build/icons/IconOpen.js +7 -0
- package/build/icons/IconOpen.js.map +1 -0
- package/build/icons/IconState.d.ts +3 -0
- package/build/icons/IconState.js +7 -0
- package/build/icons/IconState.js.map +1 -0
- package/build/icons/IconVacuum.d.ts +3 -0
- package/build/icons/IconVacuum.js +12 -0
- package/build/icons/IconVacuum.js.map +1 -0
- package/build/index.css +56 -0
- package/build/index.d.ts +87 -0
- package/build/index.js +85 -0
- package/build/index.js.map +1 -0
- package/build/modulefederation.admin.config.d.ts +13 -0
- package/build/modulefederation.admin.config.js +45 -0
- package/build/modulefederation.admin.config.js.map +1 -0
- package/build/types.d.ts +236 -0
- package/i18n/de.json +480 -0
- package/i18n/en.json +480 -0
- package/i18n/es.json +480 -0
- package/i18n/fr.json +480 -0
- package/i18n/it.json +475 -0
- package/i18n/nl.json +475 -0
- package/i18n/pl.json +475 -0
- package/i18n/pt.json +475 -0
- package/i18n/ru.json +475 -0
- package/i18n/uk.json +475 -0
- package/i18n/zh-cn.json +475 -0
- package/index.css +56 -0
- package/modulefederation.admin.config.d.ts +20 -0
- package/modulefederation.admin.config.js +54 -0
- package/package.json +86 -0
- package/tasksExample.js +91 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
export declare class Router<P = {}, S = {}> extends Component<P, S> {
|
|
3
|
+
protected onHashChangedBound: () => void;
|
|
4
|
+
constructor(props: P);
|
|
5
|
+
componentDidMount(): void;
|
|
6
|
+
componentWillUnmount(): void;
|
|
7
|
+
onHashChanged(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the location object.
|
|
10
|
+
*/
|
|
11
|
+
static getLocation(): {
|
|
12
|
+
tab: string;
|
|
13
|
+
dialog: string;
|
|
14
|
+
id: string;
|
|
15
|
+
arg: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Navigate to a new location. Any parameters that are not set will be taken from the current location.
|
|
19
|
+
*/
|
|
20
|
+
static doNavigate(tab: string | undefined | null, dialog?: string | null, id?: string | null, arg?: string | null): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
3
|
+
export class Router extends Component {
|
|
4
|
+
onHashChangedBound;
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.onHashChangedBound = this.onHashChanged.bind(this);
|
|
8
|
+
}
|
|
9
|
+
componentDidMount() {
|
|
10
|
+
window.addEventListener('hashchange', this.onHashChangedBound);
|
|
11
|
+
}
|
|
12
|
+
componentWillUnmount() {
|
|
13
|
+
window.removeEventListener('hashchange', this.onHashChangedBound);
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line class-methods-use-this
|
|
16
|
+
onHashChanged() {
|
|
17
|
+
// override this function
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Gets the location object.
|
|
21
|
+
*/
|
|
22
|
+
static getLocation() {
|
|
23
|
+
let hash = window.location.hash;
|
|
24
|
+
hash = hash.replace(/^#/, '');
|
|
25
|
+
const parts = hash.split('/').map(item => {
|
|
26
|
+
try {
|
|
27
|
+
return item ? decodeURIComponent(item) : '';
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
console.error(`Router: Cannot decode ${item}`);
|
|
31
|
+
return item;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
// #tabName/dialogName/deviceId
|
|
35
|
+
return {
|
|
36
|
+
tab: parts[0] || '',
|
|
37
|
+
dialog: parts[1] || '',
|
|
38
|
+
id: parts[2] || '',
|
|
39
|
+
arg: parts[3] || '',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Navigate to a new location. Any parameters that are not set will be taken from the current location.
|
|
44
|
+
*/
|
|
45
|
+
static doNavigate(tab, dialog, id, arg) {
|
|
46
|
+
let hash = '';
|
|
47
|
+
const location = Router.getLocation();
|
|
48
|
+
if (arg !== undefined && !id) {
|
|
49
|
+
id = location.id;
|
|
50
|
+
}
|
|
51
|
+
if (id && !dialog) {
|
|
52
|
+
dialog = location.dialog;
|
|
53
|
+
}
|
|
54
|
+
if (dialog && !tab) {
|
|
55
|
+
tab = location.tab;
|
|
56
|
+
}
|
|
57
|
+
else if (tab === null) {
|
|
58
|
+
tab = location.tab;
|
|
59
|
+
}
|
|
60
|
+
if (tab) {
|
|
61
|
+
hash = `#${tab}`;
|
|
62
|
+
if (dialog) {
|
|
63
|
+
hash += `/${dialog}`;
|
|
64
|
+
if (id) {
|
|
65
|
+
hash += `/${id}`;
|
|
66
|
+
if (arg !== undefined) {
|
|
67
|
+
hash += `/${arg}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (window.location.hash !== hash) {
|
|
73
|
+
window.location.hash = hash;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=Router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.js","sourceRoot":"./src/","sources":["Components/Router.tsx"],"names":[],"mappings":"AAAA,OAAO,E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slint/no-empty-object-type\r\nexport class Router<P = {}, S = {}> extends Component<P, S> {\r\n protected onHashChangedBound: () => void;\r\n\r\n constructor(props: P) {\r\n super(props);\r\n this.onHashChangedBound = this.onHashChanged.bind(this);\r\n }\r\n\r\n componentDidMount(): void {\r\n window.addEventListener('hashchange', this.onHashChangedBound);\r\n }\r\n\r\n componentWillUnmount(): void {\r\n window.removeEventListener('hashchange', this.onHashChangedBound);\r\n }\r\n\r\n // eslint-disable-next-line class-methods-use-this\r\n onHashChanged(): void {\r\n // override this function\r\n }\r\n\r\n /**\r\n * Gets the location object.\r\n */\r\n static getLocation(): { tab: string; dialog: string; id: string; arg: string } {\r\n let hash = window.location.hash;\r\n hash = hash.replace(/^#/, '');\r\n const parts = hash.split('/').map(item => {\r\n try {\r\n return item ? decodeURIComponent(item) : '';\r\n } catch {\r\n console.error(`Router: Cannot decode ${item}`);\r\n return item;\r\n }\r\n });\r\n // #tabName/dialogName/deviceId\r\n return {\r\n tab: parts[0] || '',\r\n dialog: parts[1] || '',\r\n id: parts[2] || '',\r\n arg: parts[3] || '',\r\n };\r\n }\r\n\r\n /**\r\n * Navigate to a new location. Any parameters that are not set will be taken from the current location.\r\n */\r\n static doNavigate(\r\n tab: string | undefined | null,\r\n dialog?: string | null,\r\n id?: string | null,\r\n arg?: string | null,\r\n ): void {\r\n let hash = '';\r\n const location = Router.getLocation();\r\n if (arg !== undefined && !id) {\r\n id = location.id;\r\n }\r\n if (id && !dialog) {\r\n dialog = location.dialog;\r\n }\r\n if (dialog && !tab) {\r\n tab = location.tab;\r\n } else if (tab === null) {\r\n tab = location.tab;\r\n }\r\n\r\n if (tab) {\r\n hash = `#${tab}`;\r\n if (dialog) {\r\n hash += `/${dialog}`;\r\n\r\n if (id) {\r\n hash += `/${id}`;\r\n if (arg !== undefined) {\r\n hash += `/${arg}`;\r\n }\r\n }\r\n }\r\n }\r\n if (window.location.hash !== hash) {\r\n window.location.hash = hash;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { type JSX } from 'react';
|
|
2
|
+
import type { IobTheme } from '../types';
|
|
3
|
+
interface SaveCloseButtonsProps {
|
|
4
|
+
noTextOnButtons?: boolean;
|
|
5
|
+
theme: IobTheme;
|
|
6
|
+
isIFrame?: boolean;
|
|
7
|
+
newReact?: boolean;
|
|
8
|
+
onSave: (close: boolean) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
dense?: boolean;
|
|
11
|
+
paddingLeft?: number;
|
|
12
|
+
changed: boolean;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare class SaveCloseButtons extends React.Component<SaveCloseButtonsProps> {
|
|
16
|
+
private readonly isIFrame;
|
|
17
|
+
constructor(props: SaveCloseButtonsProps);
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Fab, Toolbar } from '@mui/material';
|
|
4
|
+
import { Save as IconSave, Close as IconClose } from '@mui/icons-material';
|
|
5
|
+
import { I18n } from '../i18n';
|
|
6
|
+
const styles = {
|
|
7
|
+
buttonIcon: {
|
|
8
|
+
marginRight: 8,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export class SaveCloseButtons extends React.Component {
|
|
12
|
+
isIFrame;
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
const newReact = props.newReact === undefined ? true : props.newReact;
|
|
16
|
+
if (props.isIFrame !== undefined) {
|
|
17
|
+
this.isIFrame = props.isIFrame;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
try {
|
|
21
|
+
this.isIFrame = !newReact && window.self !== window.top;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
this.isIFrame = !newReact;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const noTextOnButtons = this.props.noTextOnButtons;
|
|
30
|
+
const buttonStyle = {
|
|
31
|
+
borderRadius: this.props.theme.saveToolbar.button.borderRadius || 3,
|
|
32
|
+
height: this.props.theme.saveToolbar.button.height || 32,
|
|
33
|
+
};
|
|
34
|
+
const style = {
|
|
35
|
+
bottom: this.isIFrame ? 38 : 0,
|
|
36
|
+
left: this.props.paddingLeft || 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
background: this.props.theme.saveToolbar.background,
|
|
40
|
+
};
|
|
41
|
+
if (this.props.dense) {
|
|
42
|
+
style.minHeight = 48;
|
|
43
|
+
}
|
|
44
|
+
if (this.props.error) {
|
|
45
|
+
buttonStyle.border = '1px solid red';
|
|
46
|
+
}
|
|
47
|
+
return (React.createElement(Toolbar
|
|
48
|
+
// position="absolute"
|
|
49
|
+
, {
|
|
50
|
+
// position="absolute"
|
|
51
|
+
style: style },
|
|
52
|
+
React.createElement(Fab, { variant: "extended", "aria-label": "Save", disabled: !this.props.changed || this.props.error, onClick: () => this.props.onSave(false), style: buttonStyle },
|
|
53
|
+
React.createElement(IconSave, { style: !noTextOnButtons ? styles.buttonIcon : undefined }),
|
|
54
|
+
!noTextOnButtons && I18n.t('ra_Save')),
|
|
55
|
+
React.createElement(Fab, { variant: "extended", "aria-label": "Save and close", disabled: !this.props.changed || this.props.error, onClick: () => this.props.onSave(true), style: { ...buttonStyle, ...{ marginLeft: 10 } } },
|
|
56
|
+
React.createElement(IconSave, { style: !noTextOnButtons ? styles.buttonIcon : undefined }),
|
|
57
|
+
!noTextOnButtons ? I18n.t('ra_Save and close') : '+',
|
|
58
|
+
noTextOnButtons && React.createElement(IconClose, null)),
|
|
59
|
+
React.createElement("div", { style: { flexGrow: 1 } }),
|
|
60
|
+
React.createElement(Fab, { variant: "extended", "aria-label": "Close", onClick: () => this.props.onClose(), style: buttonStyle },
|
|
61
|
+
React.createElement(IconClose, { style: !noTextOnButtons ? styles.buttonIcon : undefined }),
|
|
62
|
+
!noTextOnButtons && I18n.t('ra_Close'))));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=SaveCloseButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveCloseButtons.js","sourceRoot":"./src/","sources":["Components/SaveCloseButtons.tsx"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,MAAM,MAAM,GAAwC;IAChD,UAAU,EAAE;QACR,WAAW,EAAE,CAAC;KACjB;CACJ,CAAC;AAqBF,MAAM,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAgC;IACvD,QAAQ,CAAU;IAEnC,YAAY,KAA4B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;QAEtE,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QACnC,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC;gBACD,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG,CAAC;YAC5D,CAAC;YAAC,MAAM,CAAC;gBACL,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC;YAC9B,CAAC;QACL,CAAC;IACL,C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C,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GAAI;gBACpE,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CACpC;YACN,oBAAC,GAAG,IACA,OAAO,EAAC,UAAU,gBACP,gBAAgB,EAC3B,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE;gBAEhD,oBAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GAAI;gBACpE,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG;gBACpD,eAAe,IAAI,oBAAC,SAAS,OAAG,CAC/B;YACN,6BAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAI;YAC/B,oBAAC,GAAG,IACA,OAAO,EAAC,UAAU,gBACP,OAAO,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EACnC,KAAK,EAAE,WAAW;gBAElB,oBAAC,SAAS,IAAC,KAAK,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GAAI;gBACrE,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CACrC,CACA,CACb,CAAC;IACN,CAAC;CACJ","sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\r\nimport React, { type JSX } from 'react';\r\n\r\nimport { Fab, Toolbar } from '@mui/material';\r\n\r\nimport { Save as IconSave, Close as IconClose } from '@mui/icons-material';\r\n\r\nimport { I18n } from '../i18n';\r\nimport type { IobTheme } from '../types';\r\n\r\nconst styles: Record<string, React.CSSProperties> = {\r\n buttonIcon: {\r\n marginRight: 8,\r\n },\r\n};\r\n\r\ninterface SaveCloseButtonsProps {\r\n /* Are the buttons without text */\r\n noTextOnButtons?: boolean;\r\n /* Theme object (from this.state.theme) */\r\n theme: IobTheme;\r\n /* bottom position 0 or 38 for iFrame */\r\n isIFrame?: boolean;\r\n /* is used in new React */\r\n newReact?: boolean;\r\n /* on Save handler */\r\n onSave: (close: boolean) => void;\r\n /* on Close handler */\r\n onClose: () => void;\r\n dense?: boolean;\r\n paddingLeft?: number;\r\n changed: boolean;\r\n error?: boolean;\r\n}\r\n\r\nexport class SaveCloseButtons extends React.Component<SaveCloseButtonsProps> {\r\n private readonly isIFrame: boolean;\r\n\r\n constructor(props: SaveCloseButtonsProps) {\r\n super(props);\r\n const newReact = props.newReact === undefined ? true : props.newReact;\r\n\r\n if (props.isIFrame !== undefined) {\r\n this.isIFrame = props.isIFrame;\r\n } else {\r\n try {\r\n this.isIFrame = !newReact && window.self !== window.top;\r\n } catch {\r\n this.isIFrame = !newReact;\r\n }\r\n }\r\n }\r\n\r\n render(): JSX.Element {\r\n const noTextOnButtons = this.props.noTextOnButtons;\r\n const buttonStyle: React.CSSProperties = {\r\n borderRadius: this.props.theme.saveToolbar.button.borderRadius || 3,\r\n height: this.props.theme.saveToolbar.button.height || 32,\r\n };\r\n\r\n const style: React.CSSProperties = {\r\n bottom: this.isIFrame ? 38 : 0,\r\n left: this.props.paddingLeft || 0,\r\n right: 0,\r\n position: 'absolute',\r\n background: this.props.theme.saveToolbar.background,\r\n };\r\n if (this.props.dense) {\r\n style.minHeight = 48;\r\n }\r\n\r\n if (this.props.error) {\r\n buttonStyle.border = '1px solid red';\r\n }\r\n\r\n return (\r\n <Toolbar\r\n // position=\"absolute\"\r\n style={style}\r\n >\r\n <Fab\r\n variant=\"extended\"\r\n aria-label=\"Save\"\r\n disabled={!this.props.changed || this.props.error}\r\n onClick={() => this.props.onSave(false)}\r\n style={buttonStyle}\r\n >\r\n <IconSave style={!noTextOnButtons ? styles.buttonIcon : undefined} />\r\n {!noTextOnButtons && I18n.t('ra_Save')}\r\n </Fab>\r\n <Fab\r\n variant=\"extended\"\r\n aria-label=\"Save and close\"\r\n disabled={!this.props.changed || this.props.error}\r\n onClick={() => this.props.onSave(true)}\r\n style={{ ...buttonStyle, ...{ marginLeft: 10 } }}\r\n >\r\n <IconSave style={!noTextOnButtons ? styles.buttonIcon : undefined} />\r\n {!noTextOnButtons ? I18n.t('ra_Save and close') : '+'}\r\n {noTextOnButtons && <IconClose />}\r\n </Fab>\r\n <div style={{ flexGrow: 1 }} />\r\n <Fab\r\n variant=\"extended\"\r\n aria-label=\"Close\"\r\n onClick={() => this.props.onClose()}\r\n style={buttonStyle}\r\n >\r\n <IconClose style={!noTextOnButtons ? styles.buttonIcon : undefined} />\r\n {!noTextOnButtons && I18n.t('ra_Close')}\r\n </Fab>\r\n </Toolbar>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component, type JSX } from 'react';
|
|
2
|
+
import type { IobTheme } from '../types';
|
|
3
|
+
export interface ScheduleConfig {
|
|
4
|
+
time: {
|
|
5
|
+
exactTime: boolean;
|
|
6
|
+
start: string;
|
|
7
|
+
end: string;
|
|
8
|
+
mode: string;
|
|
9
|
+
interval: number;
|
|
10
|
+
};
|
|
11
|
+
period: {
|
|
12
|
+
once: string;
|
|
13
|
+
days: number;
|
|
14
|
+
dows: string;
|
|
15
|
+
dates: string;
|
|
16
|
+
weeks: number;
|
|
17
|
+
months: string | number;
|
|
18
|
+
years: number;
|
|
19
|
+
yearMonth: number;
|
|
20
|
+
yearDate: number;
|
|
21
|
+
};
|
|
22
|
+
valid: {
|
|
23
|
+
from: string;
|
|
24
|
+
to?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface ScheduleProps {
|
|
28
|
+
schedule: string | ScheduleConfig;
|
|
29
|
+
onChange: (schedule: string, desc?: string) => void;
|
|
30
|
+
theme: IobTheme;
|
|
31
|
+
}
|
|
32
|
+
interface ScheduleState {
|
|
33
|
+
schedule: ScheduleConfig;
|
|
34
|
+
desc: string;
|
|
35
|
+
}
|
|
36
|
+
export declare class Schedule extends Component<ScheduleProps, ScheduleState> {
|
|
37
|
+
private readonly refFrom;
|
|
38
|
+
private readonly refTo;
|
|
39
|
+
private readonly refOnce;
|
|
40
|
+
private timerOnce;
|
|
41
|
+
private timerFrom;
|
|
42
|
+
private timerTo;
|
|
43
|
+
constructor(props: ScheduleProps);
|
|
44
|
+
onChange(schedule: ScheduleConfig, force?: boolean): void;
|
|
45
|
+
static state2text(schedule: string | ScheduleConfig): string;
|
|
46
|
+
getTimePeriodElements(): JSX.Element;
|
|
47
|
+
getTimeExactElements(): JSX.Element;
|
|
48
|
+
static getDivider(): JSX.Element;
|
|
49
|
+
getPeriodModes(): JSX.Element[];
|
|
50
|
+
getPeriodSettingsMinutes(fromTo: boolean): JSX.Element;
|
|
51
|
+
getPeriodSettingsWeekdays(): JSX.Element[];
|
|
52
|
+
getPeriodSettingsDaily(): JSX.Element[] | null;
|
|
53
|
+
getPeriodSettingsWeekly(): JSX.Element[] | null;
|
|
54
|
+
getPeriodSettingsDates(): JSX.Element | null;
|
|
55
|
+
getPeriodSettingsMonthly(): JSX.Element[] | null;
|
|
56
|
+
getPeriodSettingsYearly(): JSX.Element[] | null;
|
|
57
|
+
static now2string(isEnd?: boolean): string;
|
|
58
|
+
static string2date(str: string): Date;
|
|
59
|
+
getValidSettings(): JSX.Element;
|
|
60
|
+
render(): JSX.Element;
|
|
61
|
+
}
|
|
62
|
+
export {};
|