@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 @@
|
|
|
1
|
+
export { AdminConnection } from '@iobroker/socket-client';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminConnection.js","sourceRoot":"./src/","sources":["AdminConnection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { AdminConnection } from '@iobroker/socket-client';\r\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
/*
|
|
4
|
+
Copyright 2019 Robin Selmer
|
|
5
|
+
https://codepen.io/robinselmer/pen/vJjbOZ
|
|
6
|
+
*/
|
|
7
|
+
import { I18n } from '../i18n';
|
|
8
|
+
const styles = {
|
|
9
|
+
content: {
|
|
10
|
+
background: 'black',
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
top: 0,
|
|
13
|
+
bottom: 0,
|
|
14
|
+
left: 0,
|
|
15
|
+
right: 0,
|
|
16
|
+
},
|
|
17
|
+
root: {
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
height: '100%',
|
|
20
|
+
width: '100%',
|
|
21
|
+
backgroundColor: '#000000',
|
|
22
|
+
backgroundImage: 'radial-gradient(#104254 , #05181c)',
|
|
23
|
+
fontFamily: "'Inconsolata', Helvetica, sans-serif",
|
|
24
|
+
fontSize: '1.5rem',
|
|
25
|
+
color: 'rgba(128, 175, 255, 0.8)',
|
|
26
|
+
textShadow: `0 0 1ex rgba(51, 70, 255, 1),
|
|
27
|
+
0 0 2px rgba(255, 255, 255, 0.8)`,
|
|
28
|
+
},
|
|
29
|
+
overlay: {
|
|
30
|
+
pointerEvents: 'none',
|
|
31
|
+
width: '100%',
|
|
32
|
+
height: '100%',
|
|
33
|
+
background: `repeating-linear-gradient(
|
|
34
|
+
180deg,
|
|
35
|
+
rgba(0, 0, 0, 0) 0,
|
|
36
|
+
rgba(0, 0, 0, 0.3) 50%,
|
|
37
|
+
rgba(0, 0, 0, 0) 100%)`,
|
|
38
|
+
backgroundSize: 'auto 4px',
|
|
39
|
+
zIndex: 99,
|
|
40
|
+
'&::before': {
|
|
41
|
+
content: '""',
|
|
42
|
+
pointerEvents: 'none',
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
display: 'block',
|
|
45
|
+
top: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
width: '100%',
|
|
50
|
+
height: '100%',
|
|
51
|
+
backgroundImage: `linear-gradient(
|
|
52
|
+
0deg,
|
|
53
|
+
transparent 0%,
|
|
54
|
+
rgba(32, 50, 128, 0.2) 2%,
|
|
55
|
+
rgba(32, 50, 128, 0.8) 3%,
|
|
56
|
+
rgba(32, 50, 128, 0.2) 3%,
|
|
57
|
+
transparent 100%)`,
|
|
58
|
+
backgroundRepeat: 'no-repeat',
|
|
59
|
+
animation: 'scan 7.5s linear 0s infinite',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
terminal: {
|
|
63
|
+
boxSizing: 'inherit',
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
height: '100%',
|
|
66
|
+
width: 'calc(100% - 8rem)',
|
|
67
|
+
maxWidth: '100%',
|
|
68
|
+
padding: '4rem',
|
|
69
|
+
textTransform: 'uppercase',
|
|
70
|
+
},
|
|
71
|
+
output: {
|
|
72
|
+
color: 'rgba(128, 175, 255, 0.8)',
|
|
73
|
+
textShadow: `
|
|
74
|
+
0 0 1px rgba(51, 70, 255, 0.4),
|
|
75
|
+
0 0 2px rgba(255, 255, 255, 0.8)`,
|
|
76
|
+
'&::before': {
|
|
77
|
+
content: '"> "',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
errorCode: {
|
|
81
|
+
color: 'white',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
/** Generates the 404 error page */
|
|
85
|
+
function Page404() {
|
|
86
|
+
return (React.createElement("div", { style: styles.content },
|
|
87
|
+
React.createElement("div", { style: styles.root },
|
|
88
|
+
React.createElement(Box, { component: "div", sx: styles.overlay },
|
|
89
|
+
React.createElement("div", { style: styles.terminal },
|
|
90
|
+
React.createElement("h1", null,
|
|
91
|
+
I18n.t('ra_Error'),
|
|
92
|
+
React.createElement("span", { style: styles.errorCode }, "404")),
|
|
93
|
+
React.createElement(Box, { component: "p", sx: styles.output }, I18n.t('ra_The page you are looking for was not found')),
|
|
94
|
+
React.createElement(Box, { component: "p", sx: styles.output }, I18n.t('ra_Good luck')))))));
|
|
95
|
+
}
|
|
96
|
+
export default Page404;
|
|
97
|
+
//# sourceMappingURL=404.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"404.js","sourceRoot":"./src/","sources":["Components/404.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC;;;EAGE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,MAAM,GAAwB;IAChC,OAAO,EAAE;QACL,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;KACX;IACD,IAAI,EAAE;QACF,SAAS,EAAE,YAAY;QACvB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,oCAAoC;QACrD,UAAU,EAAE,sCAAsC;QAClD,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,0BAA0B;QACjC,UAAU,EAAE;yCACqB;KACpC;IACD,OAAO,EAAE;QACL,aAAa,EAAE,MAAM;QACrB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,UAAU,EAAE;;;;mCAIe;QAC3B,cAAc,EAAE,UAAU;QAC1B,MAAM,EAAE,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GAAG,IACA,SAAS,EAAC,GAAG,EACb,EAAE,EAAE,MAAM,CAAC,MAAM,IAEhB,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CACrB,CACJ,CACJ,CACJ,CACJ,CACT,CAAC;AACN,CAAC;AAED,eAAe,OAAO,CAAC","sourcesContent":["import React, { type JSX } from 'react';\r\nimport { Box } from '@mui/material';\r\n\r\n/*\r\nCopyright 2019 Robin Selmer\r\nhttps://codepen.io/robinselmer/pen/vJjbOZ\r\n*/\r\n\r\nimport { I18n } from '../i18n';\r\n\r\nconst styles: Record<string, any> = {\r\n content: {\r\n background: 'black',\r\n position: 'absolute',\r\n top: 0,\r\n bottom: 0,\r\n left: 0,\r\n right: 0,\r\n },\r\n root: {\r\n boxSizing: 'border-box',\r\n height: '100%',\r\n width: '100%',\r\n backgroundColor: '#000000',\r\n backgroundImage: 'radial-gradient(#104254 , #05181c)',\r\n fontFamily: \"'Inconsolata', Helvetica, sans-serif\",\r\n fontSize: '1.5rem',\r\n color: 'rgba(128, 175, 255, 0.8)',\r\n textShadow: `0 0 1ex rgba(51, 70, 255, 1),\r\n 0 0 2px rgba(255, 255, 255, 0.8)`,\r\n },\r\n overlay: {\r\n pointerEvents: 'none',\r\n width: '100%',\r\n height: '100%',\r\n background: `repeating-linear-gradient(\r\n 180deg,\r\n rgba(0, 0, 0, 0) 0,\r\n rgba(0, 0, 0, 0.3) 50%,\r\n rgba(0, 0, 0, 0) 100%)`,\r\n backgroundSize: 'auto 4px',\r\n zIndex: 99,\r\n '&::before': {\r\n content: '\"\"',\r\n pointerEvents: 'none',\r\n position: 'absolute',\r\n display: 'block',\r\n top: 0,\r\n left: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: '100%',\r\n height: '100%',\r\n backgroundImage: `linear-gradient(\r\n 0deg,\r\n transparent 0%,\r\n rgba(32, 50, 128, 0.2) 2%,\r\n rgba(32, 50, 128, 0.8) 3%,\r\n rgba(32, 50, 128, 0.2) 3%,\r\n transparent 100%)`,\r\n backgroundRepeat: 'no-repeat',\r\n animation: 'scan 7.5s linear 0s infinite',\r\n },\r\n },\r\n\r\n terminal: {\r\n boxSizing: 'inherit',\r\n position: 'absolute',\r\n height: '100%',\r\n width: 'calc(100% - 8rem)',\r\n maxWidth: '100%',\r\n padding: '4rem',\r\n textTransform: 'uppercase',\r\n },\r\n output: {\r\n color: 'rgba(128, 175, 255, 0.8)',\r\n textShadow: `\r\n 0 0 1px rgba(51, 70, 255, 0.4),\r\n 0 0 2px rgba(255, 255, 255, 0.8)`,\r\n '&::before': {\r\n content: '\"> \"',\r\n },\r\n },\r\n errorCode: {\r\n color: 'white',\r\n },\r\n};\r\n\r\n/** Generates the 404 error page */\r\nfunction Page404(): JSX.Element {\r\n return (\r\n <div style={styles.content}>\r\n <div style={styles.root}>\r\n <Box\r\n component=\"div\"\r\n sx={styles.overlay}\r\n >\r\n <div style={styles.terminal}>\r\n <h1>\r\n {I18n.t('ra_Error')}\r\n <span style={styles.errorCode}>404</span>\r\n </h1>\r\n <Box\r\n component=\"p\"\r\n sx={styles.output}\r\n >\r\n {I18n.t('ra_The page you are looking for was not found')}\r\n </Box>\r\n <Box\r\n component=\"p\"\r\n sx={styles.output}\r\n >\r\n {I18n.t('ra_Good luck')}\r\n </Box>\r\n </div>\r\n </Box>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default Page404;\r\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import React, { Component, type CSSProperties } from 'react';
|
|
17
|
+
import { type RGBColor } from 'react-color';
|
|
18
|
+
import type { IobTheme } from '../types';
|
|
19
|
+
interface ColorPickerProps {
|
|
20
|
+
/** Set to true to disable the color picker. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** The currently selected color. */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** @deprecated The currently selected color use value */
|
|
25
|
+
color?: string;
|
|
26
|
+
/** The color change callback. */
|
|
27
|
+
onChange: (rgba: string) => void;
|
|
28
|
+
/** Label of the color picker. */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** @deprecated TLabel of the color picker use label */
|
|
31
|
+
name?: string;
|
|
32
|
+
/** Additional styling for this component. */
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
/** The CSS class name. */
|
|
35
|
+
className?: string;
|
|
36
|
+
customPalette?: string[];
|
|
37
|
+
noInputField?: boolean;
|
|
38
|
+
barWidth?: number;
|
|
39
|
+
sx?: Record<string, any>;
|
|
40
|
+
theme?: IobTheme;
|
|
41
|
+
}
|
|
42
|
+
interface ColorPickerState {
|
|
43
|
+
displayColorPicker: boolean;
|
|
44
|
+
color: string | RGBColor;
|
|
45
|
+
anchorEl: HTMLDivElement | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A color picker component.
|
|
49
|
+
*/
|
|
50
|
+
export declare class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
|
|
51
|
+
/**
|
|
52
|
+
* Constructor for the color picker.
|
|
53
|
+
*
|
|
54
|
+
* @param props The properties.
|
|
55
|
+
*/
|
|
56
|
+
constructor(props: ColorPickerProps);
|
|
57
|
+
private handleClick;
|
|
58
|
+
private handleClose;
|
|
59
|
+
/**
|
|
60
|
+
* Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.
|
|
61
|
+
*
|
|
62
|
+
* @param color The color to convert.
|
|
63
|
+
* @param isHex If true, the color will be converted to hex format.
|
|
64
|
+
* @returns the hex or rgba representation of the given color.
|
|
65
|
+
*/
|
|
66
|
+
static getColor(color: string | {
|
|
67
|
+
rgb: RGBColor;
|
|
68
|
+
} | RGBColor, isHex?: boolean): string;
|
|
69
|
+
/**
|
|
70
|
+
* Convert rgb() or rgba() format to hex format #rrggbb.
|
|
71
|
+
*
|
|
72
|
+
* @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.
|
|
73
|
+
*/
|
|
74
|
+
static rgb2hex(rgb: string): string;
|
|
75
|
+
private handleChange;
|
|
76
|
+
/**
|
|
77
|
+
* If the props are updated from outside, they should override the state
|
|
78
|
+
*
|
|
79
|
+
* @param _prevProps The previous properties.
|
|
80
|
+
* @param prevState The previous state.
|
|
81
|
+
*/
|
|
82
|
+
componentDidUpdate(_prevProps: ColorPickerProps, prevState: ColorPickerState): void;
|
|
83
|
+
renderCustomPalette(): React.JSX.Element | null;
|
|
84
|
+
render(): React.JSX.Element;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import React, { Component } from 'react';
|
|
17
|
+
import { ChromePicker } from 'react-color';
|
|
18
|
+
import { TextField, Menu, IconButton, Button, Box } from '@mui/material';
|
|
19
|
+
import { Delete as IconDelete, Close as IconClose } from '@mui/icons-material';
|
|
20
|
+
import { I18n } from '../i18n';
|
|
21
|
+
const styles = {
|
|
22
|
+
color: {
|
|
23
|
+
width: 36,
|
|
24
|
+
height: 14,
|
|
25
|
+
borderRadius: 2,
|
|
26
|
+
},
|
|
27
|
+
delButton: {
|
|
28
|
+
marginTop: 16,
|
|
29
|
+
},
|
|
30
|
+
swatch: {
|
|
31
|
+
mt: '16px',
|
|
32
|
+
p: '5px',
|
|
33
|
+
backgroundColor: 'background.paper',
|
|
34
|
+
borderRadius: '1px',
|
|
35
|
+
boxShadow: '0 0 0 1px rgba(0,0,0,.1)',
|
|
36
|
+
display: 'inline-block',
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
verticalAlign: 'middle',
|
|
39
|
+
},
|
|
40
|
+
swatchDisabled: {
|
|
41
|
+
opacity: 0.5,
|
|
42
|
+
cursor: 'default',
|
|
43
|
+
},
|
|
44
|
+
popover: {
|
|
45
|
+
'& .MuiPaper-root': {
|
|
46
|
+
textAlign: 'right',
|
|
47
|
+
backgroundColor: '#00000000',
|
|
48
|
+
boxShadow: 'none',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
popoverList: {
|
|
52
|
+
padding: 0,
|
|
53
|
+
},
|
|
54
|
+
closeButton: (theme) => ({
|
|
55
|
+
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
56
|
+
borderRadius: '0 0 25% 25%',
|
|
57
|
+
'&:hover': {
|
|
58
|
+
backgroundColor: `${theme.palette.secondary.main} !important`,
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
cover: {
|
|
62
|
+
position: 'fixed',
|
|
63
|
+
top: 0,
|
|
64
|
+
right: 0,
|
|
65
|
+
bottom: 0,
|
|
66
|
+
left: 0,
|
|
67
|
+
},
|
|
68
|
+
textDense: {
|
|
69
|
+
mt: 0,
|
|
70
|
+
mb: 0,
|
|
71
|
+
},
|
|
72
|
+
picker: (theme) => ({
|
|
73
|
+
background: `${theme.palette.background.paper} !important`,
|
|
74
|
+
}),
|
|
75
|
+
iconButton: {
|
|
76
|
+
width: 16,
|
|
77
|
+
height: 16,
|
|
78
|
+
},
|
|
79
|
+
button: {
|
|
80
|
+
width: 32,
|
|
81
|
+
height: 32,
|
|
82
|
+
minWidth: 32,
|
|
83
|
+
minHeight: 32,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* A color picker component.
|
|
88
|
+
*/
|
|
89
|
+
export class ColorPicker extends Component {
|
|
90
|
+
/**
|
|
91
|
+
* Constructor for the color picker.
|
|
92
|
+
*
|
|
93
|
+
* @param props The properties.
|
|
94
|
+
*/
|
|
95
|
+
constructor(props) {
|
|
96
|
+
super(props);
|
|
97
|
+
this.state = {
|
|
98
|
+
displayColorPicker: false,
|
|
99
|
+
color: this.props.value || this.props.color || '',
|
|
100
|
+
anchorEl: null,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
handleClick = (e) => {
|
|
104
|
+
this.setState({
|
|
105
|
+
displayColorPicker: !this.state.displayColorPicker,
|
|
106
|
+
anchorEl: this.state.displayColorPicker ? null : e.currentTarget,
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
handleClose = () => {
|
|
110
|
+
this.setState({ displayColorPicker: false, anchorEl: null });
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.
|
|
114
|
+
*
|
|
115
|
+
* @param color The color to convert.
|
|
116
|
+
* @param isHex If true, the color will be converted to hex format.
|
|
117
|
+
* @returns the hex or rgba representation of the given color.
|
|
118
|
+
*/
|
|
119
|
+
static getColor(color, isHex) {
|
|
120
|
+
if (color && typeof color === 'object') {
|
|
121
|
+
const oColor = color;
|
|
122
|
+
if (oColor.rgb) {
|
|
123
|
+
if (isHex) {
|
|
124
|
+
return `#${oColor.rgb.r.toString(16).padStart(2, '0')}${oColor.rgb.g.toString(16).padStart(2, '0')}${oColor.rgb.b.toString(16).padStart(2, '0')}`;
|
|
125
|
+
}
|
|
126
|
+
return `rgba(${oColor.rgb.r},${oColor.rgb.g},${oColor.rgb.b},${oColor.rgb.a})`;
|
|
127
|
+
}
|
|
128
|
+
const rColor = color;
|
|
129
|
+
if (isHex) {
|
|
130
|
+
return `#${rColor.r.toString(16).padStart(2, '0')}${rColor.g.toString(16).padStart(2, '0')}${rColor.b.toString(16).padStart(2, '0')}`;
|
|
131
|
+
}
|
|
132
|
+
return `rgba(${rColor.r},${rColor.g},${rColor.b},${rColor.a})`;
|
|
133
|
+
}
|
|
134
|
+
if (typeof color === 'string') {
|
|
135
|
+
return isHex ? ColorPicker.rgb2hex(color || '') : color || '';
|
|
136
|
+
}
|
|
137
|
+
return '';
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Convert rgb() or rgba() format to hex format #rrggbb.
|
|
141
|
+
*
|
|
142
|
+
* @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.
|
|
143
|
+
*/
|
|
144
|
+
static rgb2hex(rgb) {
|
|
145
|
+
const m = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
146
|
+
if (m) {
|
|
147
|
+
const r = parseInt(m[1], 10).toString(16).padStart(2, '0');
|
|
148
|
+
const g = parseInt(m[2], 10).toString(16).padStart(2, '0');
|
|
149
|
+
const b = parseInt(m[3], 10).toString(16).padStart(2, '0');
|
|
150
|
+
return m?.length === 4 ? `#${r}${g}${b}` : rgb;
|
|
151
|
+
}
|
|
152
|
+
return rgb;
|
|
153
|
+
}
|
|
154
|
+
handleChange = (color) => {
|
|
155
|
+
this.setState({ color }, () => this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* If the props are updated from outside, they should override the state
|
|
159
|
+
*
|
|
160
|
+
* @param _prevProps The previous properties.
|
|
161
|
+
* @param prevState The previous state.
|
|
162
|
+
*/
|
|
163
|
+
componentDidUpdate(_prevProps, prevState) {
|
|
164
|
+
const color = ColorPicker.getColor(this.props.color || this.props.value || '');
|
|
165
|
+
if (color !== prevState.color) {
|
|
166
|
+
this.setState({ color });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
renderCustomPalette() {
|
|
170
|
+
if (!this.props.customPalette) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return (React.createElement("div", { style: { width: '100%', display: 'flex', flexWrap: 'wrap' } }, this.props.customPalette.map(color => (React.createElement(Button, { style: styles.button, key: color, onClick: () => {
|
|
174
|
+
this.handleChange(color);
|
|
175
|
+
setTimeout(() => this.handleClose(), 300);
|
|
176
|
+
} },
|
|
177
|
+
React.createElement("div", { style: { ...styles.iconButton, background: color } }))))));
|
|
178
|
+
}
|
|
179
|
+
render() {
|
|
180
|
+
const style = { ...(this.props.style || {}) };
|
|
181
|
+
style.position = 'relative';
|
|
182
|
+
const { color } = this.state;
|
|
183
|
+
return (React.createElement(Box, { component: "div", style: style, sx: this.props.sx || undefined, className: this.props.className || '' },
|
|
184
|
+
this.props.noInputField ? null : (React.createElement(TextField, { disabled: this.props.disabled, variant: "standard", id: "ar_color_picker_name", label: this.props.label || this.props.name, value: color || '', margin: "dense", sx: {
|
|
185
|
+
'&.MuiFormControl-root': styles.textDense,
|
|
186
|
+
width: color ? 'calc(100% - 80px)' : 'calc(100% - 56px)',
|
|
187
|
+
mr: color ? undefined : 1,
|
|
188
|
+
}, onChange: e => this.handleChange(e.target.value) })),
|
|
189
|
+
!this.props.noInputField && color ? (React.createElement(IconButton, { disabled: this.props.disabled, onClick: () => this.handleChange(''), size: "small", style: this.props.label || this.props.name ? styles.delButton : undefined },
|
|
190
|
+
React.createElement(IconDelete, null))) : null,
|
|
191
|
+
React.createElement(Box, { component: "div", onClick: e => !this.props.disabled && this.handleClick(e), title: I18n.t('ra_Select color'), sx: {
|
|
192
|
+
...styles.swatch,
|
|
193
|
+
...(this.props.disabled ? styles.swatchDisabled : undefined),
|
|
194
|
+
background: color ? undefined : 'transparent',
|
|
195
|
+
border: color ? undefined : '1px dashed #ccc',
|
|
196
|
+
boxSizing: 'border-box',
|
|
197
|
+
marginTop: this.props.noInputField || !(this.props.label || this.props.name) ? 0 : undefined,
|
|
198
|
+
} },
|
|
199
|
+
React.createElement("div", { style: {
|
|
200
|
+
...styles.color,
|
|
201
|
+
background: ColorPicker.getColor(color),
|
|
202
|
+
width: this.props.noInputField ? this.props.barWidth || 16 : this.props.barWidth || 36,
|
|
203
|
+
} })),
|
|
204
|
+
this.state.displayColorPicker && !this.props.disabled ? (React.createElement(Menu, { sx: {
|
|
205
|
+
...styles.popover,
|
|
206
|
+
'&. MuiMenu-list': styles.popoverList,
|
|
207
|
+
}, anchorEl: this.state.anchorEl, open: !0, onClose: () => this.handleClose() },
|
|
208
|
+
React.createElement(ChromePicker, { color: this.state.color || undefined, onChangeComplete: (_color) => this.handleChange(_color.rgb), styles: {
|
|
209
|
+
default: {
|
|
210
|
+
picker: {
|
|
211
|
+
backgroundColor: this.props.theme?.palette.background.paper || '#888',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
} }),
|
|
215
|
+
color && this.props.noInputField ? (React.createElement(IconButton, { sx: styles.closeButton, onClick: () => this.handleChange('') },
|
|
216
|
+
React.createElement(IconDelete, null))) : null,
|
|
217
|
+
React.createElement(IconButton, { sx: styles.closeButton, onClick: () => this.handleClose() },
|
|
218
|
+
React.createElement(IconClose, null)),
|
|
219
|
+
this.renderCustomPalette())) : null));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=ColorPicker.js.map
|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,CAAC,IAAI;gBACR,oBAAC,UAAU,IACP,EAAE,EAAE,MAAM,CAAC,WAAW,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE;oBAEjC,oBAAC,SAAS,OAAG,CACJ;gBACZ,IAAI,CAAC,mBAAmB,EAAE,CACxB,CACV,CAAC,CAAC,CAAC,IAAI,CACN,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["/**\r\n * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>\r\n *\r\n * Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nimport React, { Component, type CSSProperties } from 'react';\r\nimport { ChromePicker, type RGBColor } from 'react-color';\r\n\r\nimport { TextField, Menu, IconButton, Button, Box } from '@mui/material';\r\n\r\nimport { Delete as IconDelete, Close as IconClose } from '@mui/icons-material';\r\n\r\nimport { I18n } from '../i18n';\r\n\r\nimport type { IobTheme } from '../types';\r\n\r\nconst styles: Record<string, any> = {\r\n color: {\r\n width: 36,\r\n height: 14,\r\n borderRadius: 2,\r\n },\r\n delButton: {\r\n marginTop: 16,\r\n },\r\n swatch: {\r\n mt: '16px',\r\n p: '5px',\r\n backgroundColor: 'background.paper',\r\n borderRadius: '1px',\r\n boxShadow: '0 0 0 1px rgba(0,0,0,.1)',\r\n display: 'inline-block',\r\n cursor: 'pointer',\r\n verticalAlign: 'middle',\r\n },\r\n swatchDisabled: {\r\n opacity: 0.5,\r\n cursor: 'default',\r\n },\r\n popover: {\r\n '& .MuiPaper-root': {\r\n textAlign: 'right',\r\n backgroundColor: '#00000000',\r\n boxShadow: 'none',\r\n },\r\n },\r\n popoverList: {\r\n padding: 0,\r\n },\r\n closeButton: (theme: IobTheme) => ({\r\n backgroundColor: `${theme.palette.background.paper} !important`,\r\n borderRadius: '0 0 25% 25%',\r\n '&:hover': {\r\n backgroundColor: `${theme.palette.secondary.main} !important`,\r\n },\r\n }),\r\n cover: {\r\n position: 'fixed',\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n left: 0,\r\n },\r\n textDense: {\r\n mt: 0,\r\n mb: 0,\r\n },\r\n picker: (theme: IobTheme) => ({\r\n background: `${theme.palette.background.paper} !important`,\r\n }),\r\n iconButton: {\r\n width: 16,\r\n height: 16,\r\n },\r\n button: {\r\n width: 32,\r\n height: 32,\r\n minWidth: 32,\r\n minHeight: 32,\r\n },\r\n};\r\n\r\ninterface ColorPickerProps {\r\n /** Set to true to disable the color picker. */\r\n disabled?: boolean;\r\n /** The currently selected color. */\r\n value?: string;\r\n /** @deprecated The currently selected color use value */\r\n color?: string;\r\n /** The color change callback. */\r\n onChange: (rgba: string) => void;\r\n /** Label of the color picker. */\r\n label?: string;\r\n /** @deprecated TLabel of the color picker use label */\r\n name?: string;\r\n /** Additional styling for this component. */\r\n style?: CSSProperties;\r\n /** The CSS class name. */\r\n className?: string;\r\n customPalette?: string[];\r\n noInputField?: boolean;\r\n barWidth?: number;\r\n sx?: Record<string, any>;\r\n theme?: IobTheme;\r\n}\r\n\r\ninterface ColorPickerState {\r\n displayColorPicker: boolean;\r\n color: string | RGBColor;\r\n anchorEl: HTMLDivElement | null;\r\n}\r\n\r\n/**\r\n * A color picker component.\r\n */\r\nexport class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {\r\n /**\r\n * Constructor for the color picker.\r\n *\r\n * @param props The properties.\r\n */\r\n constructor(props: ColorPickerProps) {\r\n super(props);\r\n this.state = {\r\n displayColorPicker: false,\r\n color: this.props.value || this.props.color || '',\r\n anchorEl: null,\r\n };\r\n }\r\n\r\n private handleClick = (e: React.MouseEvent<HTMLDivElement>): void => {\r\n this.setState({\r\n displayColorPicker: !this.state.displayColorPicker,\r\n anchorEl: this.state.displayColorPicker ? null : e.currentTarget,\r\n });\r\n };\r\n\r\n private handleClose = (): void => {\r\n this.setState({ displayColorPicker: false, anchorEl: null });\r\n };\r\n\r\n /**\r\n * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.\r\n *\r\n * @param color The color to convert.\r\n * @param isHex If true, the color will be converted to hex format.\r\n * @returns the hex or rgba representation of the given color.\r\n */\r\n static getColor(color: string | { rgb: RGBColor } | RGBColor, isHex?: boolean): string {\r\n if (color && typeof color === 'object') {\r\n const oColor = color as { rgb: RGBColor };\r\n if (oColor.rgb) {\r\n if (isHex) {\r\n return `#${oColor.rgb.r.toString(16).padStart(2, '0')}${oColor.rgb.g.toString(16).padStart(2, '0')}${oColor.rgb.b.toString(16).padStart(2, '0')}`;\r\n }\r\n return `rgba(${oColor.rgb.r},${oColor.rgb.g},${oColor.rgb.b},${oColor.rgb.a})`;\r\n }\r\n const rColor = color as RGBColor;\r\n if (isHex) {\r\n return `#${rColor.r.toString(16).padStart(2, '0')}${rColor.g.toString(16).padStart(2, '0')}${rColor.b.toString(16).padStart(2, '0')}`;\r\n }\r\n return `rgba(${rColor.r},${rColor.g},${rColor.b},${rColor.a})`;\r\n }\r\n if (typeof color === 'string') {\r\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Convert rgb() or rgba() format to hex format #rrggbb.\r\n *\r\n * @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.\r\n */\r\n static rgb2hex(rgb: string): string {\r\n const m = rgb.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\r\n\r\n if (m) {\r\n const r = parseInt(m[1], 10).toString(16).padStart(2, '0');\r\n const g = parseInt(m[2], 10).toString(16).padStart(2, '0');\r\n const b = parseInt(m[3], 10).toString(16).padStart(2, '0');\r\n\r\n return m?.length === 4 ? `#${r}${g}${b}` : rgb;\r\n }\r\n return rgb;\r\n }\r\n\r\n private handleChange = (color: string | RGBColor): void => {\r\n this.setState({ color }, () => this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));\r\n };\r\n\r\n /**\r\n * If the props are updated from outside, they should override the state\r\n *\r\n * @param _prevProps The previous properties.\r\n * @param prevState The previous state.\r\n */\r\n componentDidUpdate(_prevProps: ColorPickerProps, prevState: ColorPickerState): void {\r\n const color = ColorPicker.getColor(this.props.color || this.props.value || '');\r\n\r\n if (color !== prevState.color) {\r\n this.setState({ color });\r\n }\r\n }\r\n\r\n renderCustomPalette(): React.JSX.Element | null {\r\n if (!this.props.customPalette) {\r\n return null;\r\n }\r\n return (\r\n <div style={{ width: '100%', display: 'flex', flexWrap: 'wrap' }}>\r\n {this.props.customPalette.map(color => (\r\n <Button\r\n style={styles.button}\r\n key={color}\r\n onClick={() => {\r\n this.handleChange(color);\r\n setTimeout(() => this.handleClose(), 300);\r\n }}\r\n >\r\n <div style={{ ...styles.iconButton, background: color }} />\r\n </Button>\r\n ))}\r\n </div>\r\n );\r\n }\r\n\r\n render(): React.JSX.Element {\r\n const style = { ...(this.props.style || {}) };\r\n style.position = 'relative';\r\n const { color } = this.state;\r\n\r\n return (\r\n <Box\r\n component=\"div\"\r\n style={style}\r\n sx={this.props.sx || undefined}\r\n className={this.props.className || ''}\r\n >\r\n {this.props.noInputField ? null : (\r\n <TextField\r\n disabled={this.props.disabled}\r\n variant=\"standard\"\r\n id=\"ar_color_picker_name\"\r\n label={this.props.label || this.props.name}\r\n value={color || ''}\r\n margin=\"dense\"\r\n sx={{\r\n '&.MuiFormControl-root': styles.textDense,\r\n width: color ? 'calc(100% - 80px)' : 'calc(100% - 56px)',\r\n mr: color ? undefined : 1,\r\n }}\r\n onChange={e => this.handleChange(e.target.value)}\r\n />\r\n )}\r\n {!this.props.noInputField && color ? (\r\n <IconButton\r\n disabled={this.props.disabled}\r\n onClick={() => this.handleChange('')}\r\n size=\"small\"\r\n style={this.props.label || this.props.name ? styles.delButton : undefined}\r\n >\r\n <IconDelete />\r\n </IconButton>\r\n ) : null}\r\n <Box\r\n component=\"div\"\r\n onClick={e => !this.props.disabled && this.handleClick(e)}\r\n title={I18n.t('ra_Select color')}\r\n sx={{\r\n ...styles.swatch,\r\n ...(this.props.disabled ? styles.swatchDisabled : undefined),\r\n background: color ? undefined : 'transparent',\r\n border: color ? undefined : '1px dashed #ccc',\r\n boxSizing: 'border-box',\r\n marginTop: this.props.noInputField || !(this.props.label || this.props.name) ? 0 : undefined,\r\n }}\r\n >\r\n <div\r\n style={{\r\n ...styles.color,\r\n background: ColorPicker.getColor(color),\r\n width: this.props.noInputField ? this.props.barWidth || 16 : this.props.barWidth || 36,\r\n }}\r\n />\r\n </Box>\r\n {this.state.displayColorPicker && !this.props.disabled ? (\r\n <Menu\r\n sx={{\r\n ...styles.popover,\r\n '&. MuiMenu-list': styles.popoverList,\r\n }}\r\n anchorEl={this.state.anchorEl}\r\n open={!0}\r\n onClose={() => this.handleClose()}\r\n >\r\n <ChromePicker\r\n color={this.state.color || undefined}\r\n onChangeComplete={(_color: { rgb: RGBColor }) => this.handleChange(_color.rgb)}\r\n styles={{\r\n default: {\r\n picker: {\r\n backgroundColor: this.props.theme?.palette.background.paper || '#888',\r\n },\r\n },\r\n }}\r\n />\r\n {color && this.props.noInputField ? (\r\n <IconButton\r\n sx={styles.closeButton}\r\n onClick={() => this.handleChange('')}\r\n >\r\n <IconDelete />\r\n </IconButton>\r\n ) : null}\r\n <IconButton\r\n sx={styles.closeButton}\r\n onClick={() => this.handleClose()}\r\n >\r\n <IconClose />\r\n </IconButton>\r\n {this.renderCustomPalette()}\r\n </Menu>\r\n ) : null}\r\n </Box>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
type CronNames = 'seconds' | 'minutes' | 'hours' | 'dates' | 'months' | 'dow';
|
|
3
|
+
interface CronProps {
|
|
4
|
+
seconds: string | false | null;
|
|
5
|
+
minutes: string | null;
|
|
6
|
+
hours: string | null;
|
|
7
|
+
dates: string | null;
|
|
8
|
+
months: string | null;
|
|
9
|
+
dow: string | null;
|
|
10
|
+
}
|
|
11
|
+
interface ComplexCronProps {
|
|
12
|
+
cronExpression: string;
|
|
13
|
+
onChange: (cron: string) => void;
|
|
14
|
+
language: ioBroker.Languages;
|
|
15
|
+
}
|
|
16
|
+
interface ComplexCronState {
|
|
17
|
+
extended: boolean;
|
|
18
|
+
tab: number;
|
|
19
|
+
cron: string;
|
|
20
|
+
seconds?: string | false;
|
|
21
|
+
minutes?: string;
|
|
22
|
+
hours?: string;
|
|
23
|
+
dates?: string;
|
|
24
|
+
months?: string;
|
|
25
|
+
dow?: string;
|
|
26
|
+
modes: CronProps;
|
|
27
|
+
}
|
|
28
|
+
export declare class ComplexCron extends Component<ComplexCronProps, ComplexCronState> {
|
|
29
|
+
constructor(props: ComplexCronProps);
|
|
30
|
+
static cron2state(cron: string): CronProps;
|
|
31
|
+
static state2cron(state: ComplexCronState | CronProps): string;
|
|
32
|
+
recalcCron(): void;
|
|
33
|
+
onToggle(i: boolean | number, type: CronNames, max: number): void;
|
|
34
|
+
getDigitsSelector(type: CronNames, max: number): React.JSX.Element[];
|
|
35
|
+
getPeriodsTab(type: CronNames, max: number): React.JSX.Element | null;
|
|
36
|
+
static convertCronToText(cron: string, lang: ioBroker.Languages): string;
|
|
37
|
+
setCronAttr(attr: CronNames, value: string, modes?: CronProps): void;
|
|
38
|
+
render(): React.JSX.Element;
|
|
39
|
+
}
|
|
40
|
+
export {};
|