@iobroker/adapter-react-v5 7.2.4 → 7.2.6
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/README.md +6 -6
- package/build/AdminConnection.d.ts +1 -0
- package/build/AdminConnection.js +2 -0
- package/build/AdminConnection.js.map +1 -0
- package/{src/Components/404.tsx → build/Components/404.js} +14 -39
- package/build/Components/404.js.map +1 -0
- package/{Components → build/Components}/ColorPicker.d.ts +2 -2
- package/{Components → build/Components}/ColorPicker.js +50 -65
- package/build/Components/ColorPicker.js.map +1 -0
- package/{Components → build/Components}/ComplexCron.d.ts +2 -2
- package/{Components → build/Components}/ComplexCron.js +43 -71
- package/build/Components/ComplexCron.js.map +1 -0
- package/{Components → build/Components}/CopyToClipboard.d.ts +1 -2
- package/{src/Components/CopyToClipboard.tsx → build/Components/CopyToClipboard.js} +20 -38
- package/build/Components/CopyToClipboard.js.map +1 -0
- package/{Components → build/Components}/CustomModal.d.ts +3 -3
- package/build/Components/CustomModal.js +60 -0
- package/build/Components/CustomModal.js.map +1 -0
- package/{Components → build/Components}/FileBrowser.d.ts +2 -2
- package/{Components → build/Components}/FileBrowser.js +229 -236
- package/build/Components/FileBrowser.js.map +1 -0
- package/build/Components/FileViewer.d.ts +48 -0
- package/build/Components/FileViewer.js +277 -0
- package/build/Components/FileViewer.js.map +1 -0
- package/{Components → build/Components}/Icon.d.ts +1 -1
- package/build/Components/Icon.js +140 -0
- package/build/Components/Icon.js.map +1 -0
- package/{Components → build/Components}/IconPicker.d.ts +2 -2
- package/build/Components/IconPicker.js +73 -0
- package/build/Components/IconPicker.js.map +1 -0
- package/{Components → build/Components}/IconSelector.d.ts +3 -3
- package/{Components → build/Components}/IconSelector.js +29 -57
- package/build/Components/IconSelector.js.map +1 -0
- package/{Components → build/Components}/Image.d.ts +2 -2
- package/{Components → build/Components}/Image.js +16 -22
- package/build/Components/Image.js.map +1 -0
- package/{Components → build/Components}/Loader.d.ts +2 -2
- package/{Components → build/Components}/Loader.js +15 -40
- package/build/Components/Loader.js.map +1 -0
- package/{Components → build/Components}/Loaders/MV.d.ts +2 -2
- package/build/Components/Loaders/MV.js +61 -0
- package/build/Components/Loaders/MV.js.map +1 -0
- package/{Components → build/Components}/Loaders/PT.d.ts +2 -2
- package/{Components → build/Components}/Loaders/PT.js +10 -35
- package/build/Components/Loaders/PT.js.map +1 -0
- package/{Components → build/Components}/Loaders/Vendor.d.ts +2 -2
- package/build/Components/Loaders/Vendor.js +52 -0
- package/build/Components/Loaders/Vendor.js.map +1 -0
- package/{Components → build/Components}/Logo.d.ts +2 -2
- package/build/Components/Logo.js +108 -0
- package/build/Components/Logo.js.map +1 -0
- package/{Components → build/Components}/MDUtils.d.ts +1 -2
- package/{Components → build/Components}/MDUtils.js +4 -9
- package/build/Components/MDUtils.js.map +1 -0
- package/{Components → build/Components}/ObjectBrowser.d.ts +4 -4
- package/{Components → build/Components}/ObjectBrowser.js +1152 -1116
- package/build/Components/ObjectBrowser.js.map +1 -0
- package/{Components → build/Components}/Router.d.ts +1 -2
- package/{Components → build/Components}/Router.js +6 -7
- package/build/Components/Router.js.map +1 -0
- package/{Components → build/Components}/SaveCloseButtons.d.ts +2 -2
- package/build/Components/SaveCloseButtons.js +65 -0
- package/build/Components/SaveCloseButtons.js.map +1 -0
- package/{Components → build/Components}/Schedule.d.ts +2 -2
- package/{Components → build/Components}/Schedule.js +242 -257
- package/build/Components/Schedule.js.map +1 -0
- package/{Components → build/Components}/SelectWithIcon.d.ts +2 -2
- package/build/Components/SelectWithIcon.js +135 -0
- package/build/Components/SelectWithIcon.js.map +1 -0
- package/build/Components/SimpleCron/cronText.js +15 -0
- package/build/Components/SimpleCron/cronText.js.map +1 -0
- package/{Components → build/Components}/SimpleCron/index.d.ts +2 -2
- package/{Components → build/Components}/SimpleCron/index.js +55 -58
- package/build/Components/SimpleCron/index.js.map +1 -0
- package/{Components → build/Components}/TabContainer.d.ts +2 -2
- package/build/Components/TabContainer.js +23 -0
- package/build/Components/TabContainer.js.map +1 -0
- package/{Components → build/Components}/TabContent.d.ts +3 -2
- 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/{Components → build/Components}/TableResize.d.ts +2 -2
- package/{src/Components/TableResize.tsx → build/Components/TableResize.js} +64 -134
- package/build/Components/TableResize.js.map +1 -0
- package/{Components → build/Components}/TextWithIcon.d.ts +2 -2
- package/{src/Components/TextWithIcon.tsx → build/Components/TextWithIcon.js} +30 -75
- package/build/Components/TextWithIcon.js.map +1 -0
- package/{Components → build/Components}/ToggleThemeMenu.d.ts +1 -1
- package/build/Components/ToggleThemeMenu.js +13 -0
- package/build/Components/ToggleThemeMenu.js.map +1 -0
- package/{Components → build/Components}/TreeTable.d.ts +3 -3
- package/{Components → build/Components}/TreeTable.js +87 -99
- package/build/Components/TreeTable.js.map +1 -0
- package/{Components → build/Components}/UploadImage.d.ts +2 -2
- package/{Components → build/Components}/UploadImage.js +46 -69
- package/build/Components/UploadImage.js.map +1 -0
- package/{Components → build/Components}/Utils.d.ts +2 -2
- package/{Components → build/Components}/Utils.js +47 -60
- 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/{Dialogs → build/Dialogs}/ComplexCron.d.ts +2 -2
- package/build/Dialogs/ComplexCron.js +85 -0
- package/build/Dialogs/ComplexCron.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Confirm.d.ts +2 -2
- package/build/Dialogs/Confirm.js +83 -0
- package/build/Dialogs/Confirm.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Cron.d.ts +2 -2
- package/build/Dialogs/Cron.js +72 -0
- package/build/Dialogs/Cron.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Error.d.ts +2 -2
- package/build/Dialogs/Error.js +27 -0
- package/build/Dialogs/Error.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Message.d.ts +2 -2
- package/build/Dialogs/Message.js +29 -0
- package/build/Dialogs/Message.js.map +1 -0
- package/{Dialogs → build/Dialogs}/SelectFile.d.ts +2 -2
- package/build/Dialogs/SelectFile.js +116 -0
- package/build/Dialogs/SelectFile.js.map +1 -0
- package/{Dialogs → build/Dialogs}/SelectID.d.ts +3 -3
- package/{Dialogs → build/Dialogs}/SelectID.js +28 -53
- package/build/Dialogs/SelectID.js.map +1 -0
- package/{Dialogs → build/Dialogs}/SimpleCron.d.ts +2 -2
- 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/{GenericApp.d.ts → build/GenericApp.d.ts} +2 -3
- package/{GenericApp.js → build/GenericApp.js} +162 -176
- package/build/GenericApp.js.map +1 -0
- package/{LegacyConnection.d.ts → build/LegacyConnection.d.ts} +69 -4
- package/{LegacyConnection.js → build/LegacyConnection.js} +106 -99
- package/build/LegacyConnection.js.map +1 -0
- package/{Prompt.d.ts → build/Prompt.d.ts} +1 -1
- package/{Prompt.js → build/Prompt.js} +3 -4
- package/build/Prompt.js.map +1 -0
- package/build/Theme.d.ts +5 -0
- package/{Theme.js → build/Theme.js} +37 -32
- 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/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/dictionary.d.ts +1 -0
- package/build/dictionary.js +25 -0
- package/build/dictionary.js.map +1 -0
- package/build/i18n/de.json +449 -0
- package/build/i18n/en.json +449 -0
- package/build/i18n/es.json +449 -0
- package/build/i18n/fr.json +449 -0
- package/build/i18n/it.json +449 -0
- package/build/i18n/nl.json +449 -0
- package/build/i18n/pl.json +449 -0
- package/build/i18n/pt.json +449 -0
- package/build/i18n/ru.json +449 -0
- package/build/i18n/uk.json +449 -0
- package/build/i18n/zh-cn.json +449 -0
- package/{i18n.d.ts → build/i18n.d.ts} +2 -2
- package/{i18n.js → build/i18n.js} +9 -11
- package/build/i18n.js.map +1 -0
- package/build/icons/IconAdapter.d.ts +3 -0
- package/build/icons/IconAdapter.js +6 -0
- package/build/icons/IconAdapter.js.map +1 -0
- package/build/icons/IconAlias.d.ts +3 -0
- package/build/icons/IconAlias.js +6 -0
- package/build/icons/IconAlias.js.map +1 -0
- package/build/icons/IconChannel.d.ts +3 -0
- package/build/icons/IconChannel.js +9 -0
- package/build/icons/IconChannel.js.map +1 -0
- package/build/icons/IconClearFilter.d.ts +3 -0
- package/build/icons/IconClearFilter.js +7 -0
- package/build/icons/IconClearFilter.js.map +1 -0
- package/build/icons/IconClosed.d.ts +3 -0
- package/build/icons/IconClosed.js +6 -0
- package/build/icons/IconClosed.js.map +1 -0
- package/build/icons/IconCopy.d.ts +3 -0
- package/build/icons/IconCopy.js +5 -0
- package/build/icons/IconCopy.js.map +1 -0
- package/build/icons/IconDevice.d.ts +3 -0
- package/build/icons/IconDevice.js +15 -0
- package/build/icons/IconDevice.js.map +1 -0
- package/build/icons/IconDocument.d.ts +3 -0
- package/build/icons/IconDocument.js +6 -0
- package/build/icons/IconDocument.js.map +1 -0
- package/build/icons/IconDocumentReadOnly.d.ts +3 -0
- package/build/icons/IconDocumentReadOnly.js +7 -0
- package/build/icons/IconDocumentReadOnly.js.map +1 -0
- package/build/icons/IconExpert.d.ts +3 -0
- package/build/icons/IconExpert.js +6 -0
- package/build/icons/IconExpert.js.map +1 -0
- package/build/icons/IconFx.d.ts +3 -0
- package/build/icons/IconFx.js +5 -0
- package/build/icons/IconFx.js.map +1 -0
- package/build/icons/IconInstance.d.ts +3 -0
- package/build/icons/IconInstance.js +6 -0
- package/build/icons/IconInstance.js.map +1 -0
- package/build/icons/IconLogout.d.ts +3 -0
- package/build/icons/IconLogout.js +6 -0
- package/build/icons/IconLogout.js.map +1 -0
- package/build/icons/IconNoIcon.d.ts +3 -0
- package/build/icons/IconNoIcon.js +5 -0
- package/build/icons/IconNoIcon.js.map +1 -0
- package/build/icons/IconOpen.d.ts +3 -0
- package/build/icons/IconOpen.js +6 -0
- package/build/icons/IconOpen.js.map +1 -0
- package/{icons → build/icons}/IconProps.d.ts +1 -1
- package/build/icons/IconProps.js +2 -0
- package/build/icons/IconProps.js.map +1 -0
- package/build/icons/IconState.d.ts +3 -0
- package/build/icons/IconState.js +6 -0
- package/build/icons/IconState.js.map +1 -0
- package/build/index.d.ts +67 -0
- package/build/index.js +67 -0
- package/build/index.js.map +1 -0
- package/{types.d.ts → build/types.d.ts} +1 -1
- package/package.json +84 -48
- package/AdminConnection.d.ts +0 -2
- package/AdminConnection.js +0 -4
- package/Components/404.js +0 -101
- package/Components/CopyToClipboard.js +0 -163
- package/Components/CustomModal.js +0 -88
- package/Components/FileViewer.d.ts +0 -10
- package/Components/FileViewer.js +0 -305
- package/Components/Icon.js +0 -148
- package/Components/IconPicker.js +0 -98
- package/Components/Loaders/MV.js +0 -66
- package/Components/Loaders/Vendor.js +0 -77
- package/Components/Logo.js +0 -117
- package/Components/SaveCloseButtons.js +0 -69
- package/Components/SelectWithIcon.js +0 -168
- package/Components/SimpleCron/cronText.js +0 -19
- package/Components/TabContainer.js +0 -25
- package/Components/TabContent.js +0 -21
- package/Components/TabHeader.d.ts +0 -6
- package/Components/TabHeader.js +0 -11
- package/Components/TableResize.js +0 -226
- package/Components/TextWithIcon.js +0 -119
- package/Components/ToggleThemeMenu.js +0 -18
- package/Components/withWidth.d.ts +0 -3
- package/Components/withWidth.js +0 -27
- package/Connection.d.ts +0 -3
- package/Connection.js +0 -8
- package/Dialogs/ComplexCron.js +0 -90
- package/Dialogs/Confirm.js +0 -111
- package/Dialogs/Cron.js +0 -100
- package/Dialogs/Error.js +0 -55
- package/Dialogs/Message.js +0 -57
- package/Dialogs/SelectFile.js +0 -119
- package/Dialogs/SimpleCron.js +0 -51
- package/Dialogs/TextInput.d.ts +0 -3
- package/Dialogs/TextInput.js +0 -35
- package/Theme.d.ts +0 -6
- package/i18n/de.json +0 -449
- package/i18n/en.json +0 -449
- package/i18n/es.json +0 -449
- package/i18n/fr.json +0 -449
- package/i18n/it.json +0 -449
- package/i18n/nl.json +0 -449
- package/i18n/pl.json +0 -449
- package/i18n/pt.json +0 -449
- package/i18n/ru.json +0 -449
- package/i18n/uk.json +0 -449
- package/i18n/zh-cn.json +0 -449
- package/icons/IconAdapter.d.ts +0 -4
- package/icons/IconAdapter.js +0 -10
- package/icons/IconAlias.d.ts +0 -4
- package/icons/IconAlias.js +0 -10
- package/icons/IconChannel.d.ts +0 -4
- package/icons/IconChannel.js +0 -13
- package/icons/IconClearFilter.d.ts +0 -4
- package/icons/IconClearFilter.js +0 -11
- package/icons/IconClosed.d.ts +0 -4
- package/icons/IconClosed.js +0 -10
- package/icons/IconCopy.d.ts +0 -4
- package/icons/IconCopy.js +0 -9
- package/icons/IconDevice.d.ts +0 -4
- package/icons/IconDevice.js +0 -19
- package/icons/IconDocument.d.ts +0 -4
- package/icons/IconDocument.js +0 -10
- package/icons/IconDocumentReadOnly.d.ts +0 -4
- package/icons/IconDocumentReadOnly.js +0 -11
- package/icons/IconExpert.d.ts +0 -4
- package/icons/IconExpert.js +0 -10
- package/icons/IconFx.d.ts +0 -4
- package/icons/IconFx.js +0 -9
- package/icons/IconInstance.d.ts +0 -4
- package/icons/IconInstance.js +0 -10
- package/icons/IconLogout.d.ts +0 -4
- package/icons/IconLogout.js +0 -10
- package/icons/IconNoIcon.d.ts +0 -4
- package/icons/IconNoIcon.js +0 -9
- package/icons/IconOpen.d.ts +0 -4
- package/icons/IconOpen.js +0 -10
- package/icons/IconProps.js +0 -2
- package/icons/IconState.d.ts +0 -4
- package/icons/IconState.js +0 -10
- package/index.d.ts +0 -128
- package/index.js +0 -215
- package/src/AdminConnection.tsx +0 -3
- package/src/Components/ColorPicker.tsx +0 -343
- package/src/Components/ComplexCron.tsx +0 -561
- package/src/Components/CustomModal.tsx +0 -170
- package/src/Components/FileBrowser.tsx +0 -2560
- package/src/Components/FileViewer.tsx +0 -412
- package/src/Components/Icon.tsx +0 -238
- package/src/Components/IconPicker.tsx +0 -165
- package/src/Components/IconSelector.tsx +0 -2220
- package/src/Components/Image.tsx +0 -193
- package/src/Components/Loader.tsx +0 -328
- package/src/Components/Logo.tsx +0 -176
- package/src/Components/MDUtils.tsx +0 -104
- package/src/Components/ObjectBrowser.tsx +0 -8947
- package/src/Components/Router.tsx +0 -90
- package/src/Components/SaveCloseButtons.tsx +0 -117
- package/src/Components/Schedule.tsx +0 -1998
- package/src/Components/SelectWithIcon.tsx +0 -239
- package/src/Components/TabContainer.tsx +0 -57
- package/src/Components/TabContent.tsx +0 -38
- package/src/Components/TabHeader.tsx +0 -20
- package/src/Components/ToggleThemeMenu.tsx +0 -52
- package/src/Components/TreeTable.tsx +0 -1002
- package/src/Components/UploadImage.tsx +0 -643
- package/src/Components/Utils.tsx +0 -1802
- package/src/Components/loader.css +0 -231
- package/src/Components/withWidth.tsx +0 -32
- package/src/Connection.tsx +0 -5
- package/src/Dialogs/ComplexCron.tsx +0 -163
- package/src/Dialogs/Confirm.tsx +0 -185
- package/src/Dialogs/Cron.tsx +0 -192
- package/src/Dialogs/Error.tsx +0 -67
- package/src/Dialogs/Message.tsx +0 -73
- package/src/Dialogs/SelectFile.tsx +0 -280
- package/src/Dialogs/SelectID.tsx +0 -310
- package/src/Dialogs/SimpleCron.tsx +0 -101
- package/src/Dialogs/TextInput.tsx +0 -99
- package/src/GenericApp.tsx +0 -1076
- package/src/LegacyConnection.tsx +0 -3720
- package/src/Prompt.tsx +0 -22
- package/src/Theme.tsx +0 -472
- package/src/icons/IconAdapter.tsx +0 -22
- package/src/icons/IconAlias.tsx +0 -22
- package/src/icons/IconChannel.tsx +0 -60
- package/src/icons/IconClearFilter.tsx +0 -24
- package/src/icons/IconClosed.tsx +0 -22
- package/src/icons/IconCopy.tsx +0 -21
- package/src/icons/IconDevice.tsx +0 -126
- package/src/icons/IconDocument.tsx +0 -22
- package/src/icons/IconDocumentReadOnly.tsx +0 -27
- package/src/icons/IconExpert.tsx +0 -26
- package/src/icons/IconFx.tsx +0 -38
- package/src/icons/IconInstance.tsx +0 -22
- package/src/icons/IconLogout.tsx +0 -32
- package/src/icons/IconNoIcon.tsx +0 -21
- package/src/icons/IconOpen.tsx +0 -22
- package/src/icons/IconProps.tsx +0 -16
- package/src/icons/IconState.tsx +0 -38
- package/src/index.css +0 -56
- /package/{Components → build/Components}/404.d.ts +0 -0
- /package/{Components → build/Components}/SimpleCron/cronText.d.ts +0 -0
- /package/{assets → build/assets}/devices.json +0 -0
- /package/{assets → build/assets}/lamp_ceiling.svg +0 -0
- /package/{assets → build/assets}/lamp_table.svg +0 -0
- /package/{assets → build/assets}/no_icon.svg +0 -0
- /package/{assets → build/assets}/rooms.json +0 -0
- /package/{index.css → build/index.css} +0 -0
- /package/{tasks.js → tasksExample.js} +0 -0
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ If you want to create the configuration page with ReactJS:
|
|
|
12
12
|
4. Modify package.json file in src directory:
|
|
13
13
|
- Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
|
|
14
14
|
- Add to devDependencies:
|
|
15
|
-
```
|
|
16
|
-
"@iobroker/adapter-react-v5": "^7.2.
|
|
15
|
+
```json
|
|
16
|
+
"@iobroker/adapter-react-v5": "^7.2.6",
|
|
17
17
|
```
|
|
18
18
|
Versions can be higher.
|
|
19
19
|
So your `src/package.json` should look like:
|
|
@@ -24,7 +24,7 @@ If you want to create the configuration page with ReactJS:
|
|
|
24
24
|
"version": "0.1.0",
|
|
25
25
|
"private": true,
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@iobroker/adapter-react-v5": "^7.2.
|
|
27
|
+
"@iobroker/adapter-react-v5": "^7.2.6",
|
|
28
28
|
"@iobroker/build-tools": "^1.0.0",
|
|
29
29
|
"@iobroker/eslint-config": "^0.1.2",
|
|
30
30
|
"@mui/material": "^6.0.2",
|
|
@@ -697,12 +697,12 @@ You can find the migration instructions:
|
|
|
697
697
|
-->
|
|
698
698
|
|
|
699
699
|
## Changelog
|
|
700
|
-
### 7.2.
|
|
700
|
+
### 7.2.3 (2024-10-05)
|
|
701
701
|
|
|
702
|
-
- (@GermanBluefox) Corrected
|
|
703
|
-
- (@GermanBluefox) Changed Open/Close Folder icons
|
|
702
|
+
- (@GermanBluefox) Corrected error in the simple CRON dialog
|
|
704
703
|
|
|
705
704
|
### 7.2.2 (2024-10-04)
|
|
705
|
+
|
|
706
706
|
- (@GermanBluefox) Small layout change for Icon Picker
|
|
707
707
|
|
|
708
708
|
### 7.2.1 (2024-09-30)
|
|
@@ -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';\n"]}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {} from 'react';
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
-
|
|
4
3
|
/*
|
|
5
4
|
Copyright 2019 Robin Selmer
|
|
6
5
|
https://codepen.io/robinselmer/pen/vJjbOZ
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const styles: Record<string, any> = {
|
|
7
|
+
import { I18n } from '../i18n';
|
|
8
|
+
const styles = {
|
|
12
9
|
content: {
|
|
13
10
|
background: 'black',
|
|
14
11
|
position: 'absolute',
|
|
@@ -62,7 +59,6 @@ const styles: Record<string, any> = {
|
|
|
62
59
|
animation: 'scan 7.5s linear 0s infinite',
|
|
63
60
|
},
|
|
64
61
|
},
|
|
65
|
-
|
|
66
62
|
terminal: {
|
|
67
63
|
boxSizing: 'inherit',
|
|
68
64
|
position: 'absolute',
|
|
@@ -85,38 +81,17 @@ const styles: Record<string, any> = {
|
|
|
85
81
|
color: 'white',
|
|
86
82
|
},
|
|
87
83
|
};
|
|
88
|
-
|
|
89
84
|
/** Generates the 404 error page */
|
|
90
|
-
function Page404()
|
|
91
|
-
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{I18n.t('ra_Error')}
|
|
101
|
-
<span style={styles.errorCode}>404</span>
|
|
102
|
-
</h1>
|
|
103
|
-
<Box
|
|
104
|
-
component="p"
|
|
105
|
-
sx={styles.output}
|
|
106
|
-
>
|
|
107
|
-
{I18n.t('ra_The page you are looking for was not found')}
|
|
108
|
-
</Box>
|
|
109
|
-
<Box
|
|
110
|
-
component="p"
|
|
111
|
-
sx={styles.output}
|
|
112
|
-
>
|
|
113
|
-
{I18n.t('ra_Good luck')}
|
|
114
|
-
</Box>
|
|
115
|
-
</div>
|
|
116
|
-
</Box>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
);
|
|
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')))))));
|
|
120
95
|
}
|
|
121
|
-
|
|
122
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,KAAK,EAAE,EAAY,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,EAAE;QACV,WAAW,EAAE;YACT,OAAO,EAAE,IAAI;YACb,aAAa,EAAE,MAAM;YACrB,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,OAAO;YAChB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EA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} from 'react';\nimport { Box } from '@mui/material';\n\n/*\nCopyright 2019 Robin Selmer\nhttps://codepen.io/robinselmer/pen/vJjbOZ\n*/\n\nimport { I18n } from '../i18n';\n\nconst styles: Record<string, any> = {\n content: {\n background: 'black',\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n },\n root: {\n boxSizing: 'border-box',\n height: '100%',\n width: '100%',\n backgroundColor: '#000000',\n backgroundImage: 'radial-gradient(#104254 , #05181c)',\n fontFamily: \"'Inconsolata', Helvetica, sans-serif\",\n fontSize: '1.5rem',\n color: 'rgba(128, 175, 255, 0.8)',\n textShadow: `0 0 1ex rgba(51, 70, 255, 1),\n 0 0 2px rgba(255, 255, 255, 0.8)`,\n },\n overlay: {\n pointerEvents: 'none',\n width: '100%',\n height: '100%',\n background: `repeating-linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0) 0,\n rgba(0, 0, 0, 0.3) 50%,\n rgba(0, 0, 0, 0) 100%)`,\n backgroundSize: 'auto 4px',\n zIndex: 99,\n '&::before': {\n content: '\"\"',\n pointerEvents: 'none',\n position: 'absolute',\n display: 'block',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: '100%',\n height: '100%',\n backgroundImage: `linear-gradient(\n 0deg,\n transparent 0%,\n rgba(32, 50, 128, 0.2) 2%,\n rgba(32, 50, 128, 0.8) 3%,\n rgba(32, 50, 128, 0.2) 3%,\n transparent 100%)`,\n backgroundRepeat: 'no-repeat',\n animation: 'scan 7.5s linear 0s infinite',\n },\n },\n\n terminal: {\n boxSizing: 'inherit',\n position: 'absolute',\n height: '100%',\n width: 'calc(100% - 8rem)',\n maxWidth: '100%',\n padding: '4rem',\n textTransform: 'uppercase',\n },\n output: {\n color: 'rgba(128, 175, 255, 0.8)',\n textShadow: `\n 0 0 1px rgba(51, 70, 255, 0.4),\n 0 0 2px rgba(255, 255, 255, 0.8)`,\n '&::before': {\n content: '\"> \"',\n },\n },\n errorCode: {\n color: 'white',\n },\n};\n\n/** Generates the 404 error page */\nfunction Page404(): JSX.Element {\n return (\n <div style={styles.content}>\n <div style={styles.root}>\n <Box\n component=\"div\"\n sx={styles.overlay}\n >\n <div style={styles.terminal}>\n <h1>\n {I18n.t('ra_Error')}\n <span style={styles.errorCode}>404</span>\n </h1>\n <Box\n component=\"p\"\n sx={styles.output}\n >\n {I18n.t('ra_The page you are looking for was not found')}\n </Box>\n <Box\n component=\"p\"\n sx={styles.output}\n >\n {I18n.t('ra_Good luck')}\n </Box>\n </div>\n </Box>\n </div>\n </div>\n );\n}\n\nexport default Page404;\n"]}
|
|
@@ -47,7 +47,7 @@ interface ColorPickerState {
|
|
|
47
47
|
/**
|
|
48
48
|
* A color picker component.
|
|
49
49
|
*/
|
|
50
|
-
declare class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
|
|
50
|
+
export declare class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
|
|
51
51
|
/**
|
|
52
52
|
* Constructor for the color picker.
|
|
53
53
|
*
|
|
@@ -83,4 +83,4 @@ declare class ColorPicker extends Component<ColorPickerProps, ColorPickerState>
|
|
|
83
83
|
renderCustomPalette(): React.JSX.Element | null;
|
|
84
84
|
render(): React.JSX.Element;
|
|
85
85
|
}
|
|
86
|
-
export
|
|
86
|
+
export {};
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
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;
|
|
17
|
-
});
|
|
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
1
|
/**
|
|
30
2
|
* Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
31
3
|
*
|
|
@@ -41,11 +13,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
13
|
* See the License for the specific language governing permissions and
|
|
42
14
|
* limitations under the License.
|
|
43
15
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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';
|
|
49
21
|
const styles = {
|
|
50
22
|
color: {
|
|
51
23
|
width: 36,
|
|
@@ -114,7 +86,7 @@ const styles = {
|
|
|
114
86
|
/**
|
|
115
87
|
* A color picker component.
|
|
116
88
|
*/
|
|
117
|
-
class ColorPicker extends
|
|
89
|
+
export class ColorPicker extends Component {
|
|
118
90
|
/**
|
|
119
91
|
* Constructor for the color picker.
|
|
120
92
|
*
|
|
@@ -122,24 +94,21 @@ class ColorPicker extends react_1.Component {
|
|
|
122
94
|
*/
|
|
123
95
|
constructor(props) {
|
|
124
96
|
super(props);
|
|
125
|
-
this.handleClick = (e) => {
|
|
126
|
-
this.setState({
|
|
127
|
-
displayColorPicker: !this.state.displayColorPicker,
|
|
128
|
-
anchorEl: this.state.displayColorPicker ? null : e.currentTarget,
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
this.handleClose = () => {
|
|
132
|
-
this.setState({ displayColorPicker: false, anchorEl: null });
|
|
133
|
-
};
|
|
134
|
-
this.handleChange = (color) => {
|
|
135
|
-
this.setState({ color }, () => this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));
|
|
136
|
-
};
|
|
137
97
|
this.state = {
|
|
138
98
|
displayColorPicker: false,
|
|
139
99
|
color: this.props.value || this.props.color || '',
|
|
140
100
|
anchorEl: null,
|
|
141
101
|
};
|
|
142
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
|
+
};
|
|
143
112
|
/**
|
|
144
113
|
* Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.
|
|
145
114
|
*
|
|
@@ -178,10 +147,13 @@ class ColorPicker extends react_1.Component {
|
|
|
178
147
|
const r = parseInt(m[1], 10).toString(16).padStart(2, '0');
|
|
179
148
|
const g = parseInt(m[2], 10).toString(16).padStart(2, '0');
|
|
180
149
|
const b = parseInt(m[3], 10).toString(16).padStart(2, '0');
|
|
181
|
-
return
|
|
150
|
+
return m?.length === 4 ? `#${r}${g}${b}` : rgb;
|
|
182
151
|
}
|
|
183
152
|
return rgb;
|
|
184
153
|
}
|
|
154
|
+
handleChange = (color) => {
|
|
155
|
+
this.setState({ color }, () => this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));
|
|
156
|
+
};
|
|
185
157
|
/**
|
|
186
158
|
* If the props are updated from outside, they should override the state
|
|
187
159
|
*
|
|
@@ -198,40 +170,53 @@ class ColorPicker extends react_1.Component {
|
|
|
198
170
|
if (!this.props.customPalette) {
|
|
199
171
|
return null;
|
|
200
172
|
}
|
|
201
|
-
return (
|
|
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: () => {
|
|
202
174
|
this.handleChange(color);
|
|
203
175
|
setTimeout(() => this.handleClose(), 300);
|
|
204
176
|
} },
|
|
205
|
-
|
|
177
|
+
React.createElement("div", { style: { ...styles.iconButton, background: color } }))))));
|
|
206
178
|
}
|
|
207
179
|
render() {
|
|
208
|
-
|
|
209
|
-
const style = Object.assign({}, (this.props.style || {}));
|
|
180
|
+
const style = { ...(this.props.style || {}) };
|
|
210
181
|
style.position = 'relative';
|
|
211
182
|
const { color } = this.state;
|
|
212
|
-
return (
|
|
213
|
-
this.props.noInputField ? null : (
|
|
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: {
|
|
214
185
|
'&.MuiFormControl-root': styles.textDense,
|
|
215
186
|
width: color ? 'calc(100% - 80px)' : 'calc(100% - 56px)',
|
|
216
187
|
mr: color ? undefined : 1,
|
|
217
188
|
}, onChange: e => this.handleChange(e.target.value) })),
|
|
218
|
-
!this.props.noInputField && color ? (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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: {
|
|
224
209
|
default: {
|
|
225
210
|
picker: {
|
|
226
|
-
backgroundColor:
|
|
211
|
+
backgroundColor: this.props.theme?.palette.background.paper || '#888',
|
|
227
212
|
},
|
|
228
213
|
},
|
|
229
214
|
} }),
|
|
230
|
-
color && this.props.noInputField ? (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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)),
|
|
234
219
|
this.renderCustomPalette())) : null));
|
|
235
220
|
}
|
|
236
221
|
}
|
|
237
|
-
|
|
222
|
+
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","sourceRoot":"./src/","sources":["Components/ColorPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAiB,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI/B,MAAM,MAAM,GAAwB;IAChC,KAAK,EAAE;QACH,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;KAClB;IACD,SAAS,EAAE;QACP,SAAS,EAAE,EAAE;KAChB;IACD,MAAM,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,CAAC,EAAE,KAAK;QACR,eAAe,EAAE,kBAAkB;QACnC,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,0BAA0B;QACrC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,QAAQ;KAC1B;IACD,cAAc,EAAE;QACZ,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,SAAS;KACpB;IACD,OAAO,EAAE;QACL,kBAAkB,EAAE;YAChB,SAAS,EAAE,OAAO;YAClB,eAAe,EAAE,WAAW;YAC5B,SAAS,EAAE,MAAM;SACpB;KACJ;IACD,WAAW,EAAE;QACT,OAAO,EAAE,CAAC;KAC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AC,WAAW,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;oBAEpC,oBAAC,UAAU,OAAG,CACL,CAChB,CAAC,CAAC,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":["/**\n * Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * Licensed under the Creative Commons Attribution-NonCommercial License, Version 4.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { Component, type CSSProperties } from 'react';\nimport { ChromePicker, type RGBColor } from 'react-color';\n\nimport { TextField, Menu, IconButton, Button, Box } from '@mui/material';\n\nimport { Delete as IconDelete, Close as IconClose } from '@mui/icons-material';\n\nimport { I18n } from '../i18n';\n\nimport type { IobTheme } from '../types';\n\nconst styles: Record<string, any> = {\n color: {\n width: 36,\n height: 14,\n borderRadius: 2,\n },\n delButton: {\n marginTop: 16,\n },\n swatch: {\n mt: '16px',\n p: '5px',\n backgroundColor: 'background.paper',\n borderRadius: '1px',\n boxShadow: '0 0 0 1px rgba(0,0,0,.1)',\n display: 'inline-block',\n cursor: 'pointer',\n verticalAlign: 'middle',\n },\n swatchDisabled: {\n opacity: 0.5,\n cursor: 'default',\n },\n popover: {\n '& .MuiPaper-root': {\n textAlign: 'right',\n backgroundColor: '#00000000',\n boxShadow: 'none',\n },\n },\n popoverList: {\n padding: 0,\n },\n closeButton: (theme: IobTheme) => ({\n backgroundColor: `${theme.palette.background.paper} !important`,\n borderRadius: '0 0 25% 25%',\n '&:hover': {\n backgroundColor: `${theme.palette.secondary.main} !important`,\n },\n }),\n cover: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n textDense: {\n mt: 0,\n mb: 0,\n },\n picker: (theme: IobTheme) => ({\n background: `${theme.palette.background.paper} !important`,\n }),\n iconButton: {\n width: 16,\n height: 16,\n },\n button: {\n width: 32,\n height: 32,\n minWidth: 32,\n minHeight: 32,\n },\n};\n\ninterface ColorPickerProps {\n /** Set to true to disable the color picker. */\n disabled?: boolean;\n /** The currently selected color. */\n value?: string;\n /** @deprecated The currently selected color use value */\n color?: string;\n /** The color change callback. */\n onChange: (rgba: string) => void;\n /** Label of the color picker. */\n label?: string;\n /** @deprecated TLabel of the color picker use label */\n name?: string;\n /** Additional styling for this component. */\n style?: CSSProperties;\n /** The CSS class name. */\n className?: string;\n customPalette?: string[];\n noInputField?: boolean;\n barWidth?: number;\n sx?: Record<string, any>;\n theme?: IobTheme;\n}\n\ninterface ColorPickerState {\n displayColorPicker: boolean;\n color: string | RGBColor;\n anchorEl: HTMLDivElement | null;\n}\n\n/**\n * A color picker component.\n */\nexport class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {\n /**\n * Constructor for the color picker.\n *\n * @param props The properties.\n */\n constructor(props: ColorPickerProps) {\n super(props);\n this.state = {\n displayColorPicker: false,\n color: this.props.value || this.props.color || '',\n anchorEl: null,\n };\n }\n\n private handleClick = (e: React.MouseEvent<HTMLDivElement>): void => {\n this.setState({\n displayColorPicker: !this.state.displayColorPicker,\n anchorEl: this.state.displayColorPicker ? null : e.currentTarget,\n });\n };\n\n private handleClose = (): void => {\n this.setState({ displayColorPicker: false, anchorEl: null });\n };\n\n /**\n * Convert the given color to hex ('#rrggbb') or rgba ('rgba(r,g,b,a)') format.\n *\n * @param color The color to convert.\n * @param isHex If true, the color will be converted to hex format.\n * @returns the hex or rgba representation of the given color.\n */\n static getColor(color: string | { rgb: RGBColor } | RGBColor, isHex?: boolean): string {\n if (color && typeof color === 'object') {\n const oColor = color as { rgb: RGBColor };\n if (oColor.rgb) {\n if (isHex) {\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')}`;\n }\n return `rgba(${oColor.rgb.r},${oColor.rgb.g},${oColor.rgb.b},${oColor.rgb.a})`;\n }\n const rColor = color as RGBColor;\n if (isHex) {\n return `#${rColor.r.toString(16).padStart(2, '0')}${rColor.g.toString(16).padStart(2, '0')}${rColor.b.toString(16).padStart(2, '0')}`;\n }\n return `rgba(${rColor.r},${rColor.g},${rColor.b},${rColor.a})`;\n }\n if (typeof color === 'string') {\n return isHex ? ColorPicker.rgb2hex(color || '') : color || '';\n }\n return '';\n }\n\n /**\n * Convert rgb() or rgba() format to hex format #rrggbb.\n *\n * @param rgb The color in rgb() or rgba() format. if not in this format, the color will be returned as is.\n */\n static rgb2hex(rgb: string): string {\n const m = rgb.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\n\n if (m) {\n const r = parseInt(m[1], 10).toString(16).padStart(2, '0');\n const g = parseInt(m[2], 10).toString(16).padStart(2, '0');\n const b = parseInt(m[3], 10).toString(16).padStart(2, '0');\n\n return m?.length === 4 ? `#${r}${g}${b}` : rgb;\n }\n return rgb;\n }\n\n private handleChange = (color: string | RGBColor): void => {\n this.setState({ color }, () => this.props.onChange && this.props.onChange(ColorPicker.getColor(color)));\n };\n\n /**\n * If the props are updated from outside, they should override the state\n *\n * @param _prevProps The previous properties.\n * @param prevState The previous state.\n */\n componentDidUpdate(_prevProps: ColorPickerProps, prevState: ColorPickerState): void {\n const color = ColorPicker.getColor(this.props.color || this.props.value || '');\n\n if (color !== prevState.color) {\n this.setState({ color });\n }\n }\n\n renderCustomPalette(): React.JSX.Element | null {\n if (!this.props.customPalette) {\n return null;\n }\n return (\n <div style={{ width: '100%', display: 'flex', flexWrap: 'wrap' }}>\n {this.props.customPalette.map(color => (\n <Button\n style={styles.button}\n key={color}\n onClick={() => {\n this.handleChange(color);\n setTimeout(() => this.handleClose(), 300);\n }}\n >\n <div style={{ ...styles.iconButton, background: color }} />\n </Button>\n ))}\n </div>\n );\n }\n\n render(): React.JSX.Element {\n const style = { ...(this.props.style || {}) };\n style.position = 'relative';\n const { color } = this.state;\n\n return (\n <Box\n component=\"div\"\n style={style}\n sx={this.props.sx || undefined}\n className={this.props.className || ''}\n >\n {this.props.noInputField ? null : (\n <TextField\n disabled={this.props.disabled}\n variant=\"standard\"\n id=\"ar_color_picker_name\"\n label={this.props.label || this.props.name}\n value={color || ''}\n margin=\"dense\"\n sx={{\n '&.MuiFormControl-root': styles.textDense,\n width: color ? 'calc(100% - 80px)' : 'calc(100% - 56px)',\n mr: color ? undefined : 1,\n }}\n onChange={e => this.handleChange(e.target.value)}\n />\n )}\n {!this.props.noInputField && color ? (\n <IconButton\n disabled={this.props.disabled}\n onClick={() => this.handleChange('')}\n size=\"small\"\n style={this.props.label || this.props.name ? styles.delButton : undefined}\n >\n <IconDelete />\n </IconButton>\n ) : null}\n <Box\n component=\"div\"\n onClick={e => !this.props.disabled && this.handleClick(e)}\n title={I18n.t('ra_Select color')}\n sx={{\n ...styles.swatch,\n ...(this.props.disabled ? styles.swatchDisabled : undefined),\n background: color ? undefined : 'transparent',\n border: color ? undefined : '1px dashed #ccc',\n boxSizing: 'border-box',\n marginTop: this.props.noInputField || !(this.props.label || this.props.name) ? 0 : undefined,\n }}\n >\n <div\n style={{\n ...styles.color,\n background: ColorPicker.getColor(color),\n width: this.props.noInputField ? this.props.barWidth || 16 : this.props.barWidth || 36,\n }}\n />\n </Box>\n {this.state.displayColorPicker && !this.props.disabled ? (\n <Menu\n sx={{\n ...styles.popover,\n '&. MuiMenu-list': styles.popoverList,\n }}\n anchorEl={this.state.anchorEl}\n open={!0}\n onClose={() => this.handleClose()}\n >\n <ChromePicker\n color={this.state.color || undefined}\n onChangeComplete={(_color: { rgb: RGBColor }) => this.handleChange(_color.rgb)}\n styles={{\n default: {\n picker: {\n backgroundColor: this.props.theme?.palette.background.paper || '#888',\n },\n },\n }}\n />\n {color && this.props.noInputField ? (\n <IconButton\n sx={styles.closeButton}\n onClick={() => this.handleChange('')}\n >\n <IconDelete />\n </IconButton>\n ) : null}\n <IconButton\n sx={styles.closeButton}\n onClick={() => this.handleClose()}\n >\n <IconClose />\n </IconButton>\n {this.renderCustomPalette()}\n </Menu>\n ) : null}\n </Box>\n );\n }\n}\n"]}
|
|
@@ -25,7 +25,7 @@ interface ComplexCronState {
|
|
|
25
25
|
dow?: string;
|
|
26
26
|
modes: CronProps;
|
|
27
27
|
}
|
|
28
|
-
declare class ComplexCron extends Component<ComplexCronProps, ComplexCronState> {
|
|
28
|
+
export declare class ComplexCron extends Component<ComplexCronProps, ComplexCronState> {
|
|
29
29
|
constructor(props: ComplexCronProps);
|
|
30
30
|
static cron2state(cron: string): CronProps;
|
|
31
31
|
static state2cron(state: ComplexCronState | CronProps): string;
|
|
@@ -37,4 +37,4 @@ declare class ComplexCron extends Component<ComplexCronProps, ComplexCronState>
|
|
|
37
37
|
setCronAttr(attr: CronNames, value: string, modes?: CronProps): void;
|
|
38
38
|
render(): React.JSX.Element;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
40
|
+
export {};
|
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
17
|
-
});
|
|
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
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const material_1 = require("@mui/material");
|
|
31
|
-
const i18n_1 = __importDefault(require("../i18n"));
|
|
32
|
-
const cronText_1 = __importDefault(require("./SimpleCron/cronText"));
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Checkbox, Button, MenuItem, Select, FormControlLabel, AppBar, Tabs, Tab, TextField } from '@mui/material';
|
|
3
|
+
import { I18n } from '../i18n';
|
|
4
|
+
import convertCronToText from './SimpleCron/cronText';
|
|
33
5
|
const styles = {
|
|
34
6
|
mainDiv: {
|
|
35
7
|
width: '100%',
|
|
@@ -165,7 +137,7 @@ function convertArrayIntoMinus(value, max) {
|
|
|
165
137
|
}
|
|
166
138
|
return newParts.join(',');
|
|
167
139
|
}
|
|
168
|
-
class ComplexCron extends
|
|
140
|
+
export class ComplexCron extends Component {
|
|
169
141
|
constructor(props) {
|
|
170
142
|
super(props);
|
|
171
143
|
let cron = typeof this.props.cronExpression === 'string'
|
|
@@ -274,19 +246,19 @@ class ComplexCron extends react_1.Component {
|
|
|
274
246
|
}
|
|
275
247
|
const parts = convertMinusIntoArray(this.state[type], max);
|
|
276
248
|
return [
|
|
277
|
-
|
|
249
|
+
React.createElement(Button, { key: "removeall", variant: "outlined", style: styles.numberButton,
|
|
278
250
|
// style={{paddingBottom: 20}}
|
|
279
|
-
color: "primary", onClick: () => this.onToggle(false, type, max) },
|
|
280
|
-
|
|
251
|
+
color: "primary", onClick: () => this.onToggle(false, type, max) }, I18n.t('ra_Deselect all')),
|
|
252
|
+
React.createElement(Button, { key: "addall", variant: "contained",
|
|
281
253
|
// style={{paddingBottom: 20}}
|
|
282
|
-
style: styles.numberButton, color: "secondary", onClick: () => this.onToggle(true, type, max) },
|
|
283
|
-
|
|
254
|
+
style: styles.numberButton, color: "secondary", onClick: () => this.onToggle(true, type, max) }, I18n.t('ra_Select all')),
|
|
255
|
+
React.createElement("div", { key: "all" }, values.map(i => [
|
|
284
256
|
(max === 7 && i === 4) ||
|
|
285
257
|
(max === 12 && i === 7) ||
|
|
286
258
|
(max === 31 && !((i - 1) % 10)) ||
|
|
287
259
|
(max === 60 && i && !(i % 10)) ||
|
|
288
|
-
(max === 24 && i && !(i % 6)) ? (
|
|
289
|
-
|
|
260
|
+
(max === 24 && i && !(i % 6)) ? (React.createElement("div", { key: `allInner${i}`, style: { width: '100%' } })) : null,
|
|
261
|
+
React.createElement(Button, { key: `_${i}`, variant: parts.indexOf(i) !== -1 ? 'contained' : 'outlined', style: styles.numberButton, color: parts.indexOf(i) !== -1 ? 'secondary' : 'primary', onClick: () => this.onToggle(i, type, max) }, max === 7 ? I18n.t(WEEKDAYS[i]) : max === 12 ? MONTHS[i - 1] : i),
|
|
290
262
|
])),
|
|
291
263
|
];
|
|
292
264
|
}
|
|
@@ -309,8 +281,8 @@ class ComplexCron extends react_1.Component {
|
|
|
309
281
|
if (everyN && value) {
|
|
310
282
|
valueNumber = parseInt(value.replace('*/', ''), 10) || 1;
|
|
311
283
|
}
|
|
312
|
-
return (
|
|
313
|
-
|
|
284
|
+
return (React.createElement("div", null,
|
|
285
|
+
React.createElement(Select, { variant: "standard", style: { ...styles.periodSelect, verticalAlign: 'bottom' }, value: select, onChange: e => {
|
|
314
286
|
const modes = JSON.parse(JSON.stringify(this.state.modes));
|
|
315
287
|
modes[type] = e.target.value;
|
|
316
288
|
if (e.target.value === 'every') {
|
|
@@ -328,10 +300,10 @@ class ComplexCron extends react_1.Component {
|
|
|
328
300
|
this.setCronAttr(type, convertArrayIntoMinus(num, max), modes);
|
|
329
301
|
}
|
|
330
302
|
} },
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
everyN && (
|
|
303
|
+
React.createElement(MenuItem, { key: "every", value: "every" }, I18n.t(`sc_every_${type}`)),
|
|
304
|
+
React.createElement(MenuItem, { key: "everyN", value: "everyN" }, I18n.t(`sc_everyN_${type}`)),
|
|
305
|
+
React.createElement(MenuItem, { key: "specific", value: "specific" }, I18n.t(`sc_specific_${type}`))),
|
|
306
|
+
everyN && (React.createElement(TextField, { variant: "standard", key: "interval", label: I18n.t(`sc_${type}`), value: valueNumber, slotProps: {
|
|
335
307
|
htmlInput: {
|
|
336
308
|
min: 1,
|
|
337
309
|
max,
|
|
@@ -347,9 +319,9 @@ class ComplexCron extends react_1.Component {
|
|
|
347
319
|
}
|
|
348
320
|
static convertCronToText(cron, lang) {
|
|
349
321
|
if (cron.split(' ').includes('-')) {
|
|
350
|
-
return
|
|
322
|
+
return I18n.t('ra_Invalid CRON');
|
|
351
323
|
}
|
|
352
|
-
return (
|
|
324
|
+
return convertCronToText(cron, lang);
|
|
353
325
|
}
|
|
354
326
|
setCronAttr(attr, value, modes) {
|
|
355
327
|
if (modes) {
|
|
@@ -399,31 +371,31 @@ class ComplexCron extends react_1.Component {
|
|
|
399
371
|
// Detect if every minute or every second is activated
|
|
400
372
|
const everyMinute = this.state.minutes === '*' || this.state.minutes === '*/1';
|
|
401
373
|
const everySecond = this.state.seconds === '*' || this.state.seconds === '*/1';
|
|
402
|
-
return (
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
374
|
+
return (React.createElement("div", { style: styles.mainDiv },
|
|
375
|
+
React.createElement("div", { style: { paddingLeft: 8, width: 'calc(100% - px)' } },
|
|
376
|
+
React.createElement(TextField, { variant: "standard", style: { width: '100%' }, value: this.state.cron, disabled: true })),
|
|
377
|
+
React.createElement("div", { style: { paddingLeft: 8, width: 'calc(100% - px)', height: 60 } },
|
|
406
378
|
ComplexCron.convertCronToText(this.state.cron, this.props.language || 'en'),
|
|
407
|
-
|
|
408
|
-
?
|
|
379
|
+
React.createElement("span", { style: styles.warning }, everySecond
|
|
380
|
+
? I18n.t('ra_warning_every_second')
|
|
409
381
|
: everyMinute
|
|
410
|
-
?
|
|
382
|
+
? I18n.t('ra_warning_every_minute')
|
|
411
383
|
: '')),
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
this.state.seconds !== false && (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
tab === 0 &&
|
|
422
|
-
tab === 1 &&
|
|
423
|
-
tab === 2 &&
|
|
424
|
-
tab === 3 &&
|
|
425
|
-
tab === 4 &&
|
|
426
|
-
tab === 5 &&
|
|
384
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: !!this.state.seconds, onChange: e => this.setState({ seconds: e.target.checked ? '*' : false }, () => this.recalcCron()) }), label: I18n.t('ra_use seconds') }),
|
|
385
|
+
React.createElement(AppBar, { position: "static", sx: { '&.MuiAppBar-root': styles.appBar }, color: "secondary" },
|
|
386
|
+
React.createElement(Tabs, { value: this.state.tab, style: styles.appBar, color: "secondary", onChange: (_active, _tab) => this.setState({ tab: _tab }) },
|
|
387
|
+
this.state.seconds !== false && (React.createElement(Tab, { id: "sc_seconds", label: I18n.t('sc_seconds') })),
|
|
388
|
+
React.createElement(Tab, { id: "minutes", label: I18n.t('sc_minutes') }),
|
|
389
|
+
React.createElement(Tab, { id: "hours", label: I18n.t('sc_hours') }),
|
|
390
|
+
React.createElement(Tab, { id: "dates", label: I18n.t('sc_dates') }),
|
|
391
|
+
React.createElement(Tab, { id: "months", label: I18n.t('sc_months') }),
|
|
392
|
+
React.createElement(Tab, { id: "dow", label: I18n.t('sc_dows') }))),
|
|
393
|
+
tab === 0 && React.createElement("div", { style: styles.tabContent }, this.getPeriodsTab('seconds', 60)),
|
|
394
|
+
tab === 1 && React.createElement("div", { style: styles.tabContent }, this.getPeriodsTab('minutes', 60)),
|
|
395
|
+
tab === 2 && React.createElement("div", { style: styles.tabContent }, this.getPeriodsTab('hours', 24)),
|
|
396
|
+
tab === 3 && React.createElement("div", { style: styles.tabContent }, this.getPeriodsTab('dates', 31)),
|
|
397
|
+
tab === 4 && React.createElement("div", { style: styles.tabContent }, this.getPeriodsTab('months', 12)),
|
|
398
|
+
tab === 5 && React.createElement("div", { style: styles.tabContent }, this.getPeriodsTab('dow', 7))));
|
|
427
399
|
}
|
|
428
400
|
}
|
|
429
|
-
|
|
401
|
+
//# sourceMappingURL=ComplexCron.js.map
|