@iobroker/adapter-react-v5 4.13.3 → 4.13.4
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/AdminConnection.js.map +1 -1
- package/Components/404.js +13 -13
- package/Components/ColorPicker.js +54 -54
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js.map +1 -1
- package/Components/FileBrowser.js +3 -3
- package/Components/FileViewer.js +9 -16
- package/Components/Loader.js +223 -223
- package/Components/Loaders/PT.css +108 -108
- package/Components/Loaders/PT.js +103 -103
- package/Components/Loaders/Vendor.css +13 -13
- package/Components/Loaders/Vendor.js +7 -7
- package/Components/ObjectBrowser.d.ts +2 -2
- package/Components/ObjectBrowser.js +359 -351
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/TabContent.d.ts +3 -7
- package/Components/TabContent.js +1 -3
- package/Components/TableResize.d.ts +20 -13
- package/Components/TableResize.js +244 -262
- package/Components/TreeTable.js +70 -70
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +305 -305
- package/Components/loader.css +221 -221
- package/Components/types.d.ts +82 -82
- package/Components/withWidth.js +2 -2
- package/Components/withWidth.js.map +1 -1
- package/Connection.js.map +1 -1
- package/GenericApp.js +49 -49
- package/LICENSE +22 -22
- package/LegacyConnection.d.ts +4 -0
- package/LegacyConnection.js +14 -0
- package/Prompt.js +7 -7
- package/README.md +845 -841
- package/assets/devices/Alarm Systems.svg +18 -18
- package/assets/devices/Amplifier.svg +21 -21
- package/assets/devices/Awnings.svg +4 -4
- package/assets/devices/Battery Status.svg +4 -4
- package/assets/devices/Ceiling Spotlights.svg +15 -15
- package/assets/devices/Chandelier.svg +6 -6
- package/assets/devices/Climate.svg +11 -11
- package/assets/devices/Coffee Makers.svg +5 -5
- package/assets/devices/Cold Water.svg +31 -31
- package/assets/devices/Computer.svg +21 -21
- package/assets/devices/Consumption.svg +7 -7
- package/assets/devices/Curtains.svg +43 -43
- package/assets/devices/Dishwashers.svg +11 -11
- package/assets/devices/Doors.svg +5 -5
- package/assets/devices/Doorstep.svg +35 -35
- package/assets/devices/Dryer.svg +13 -13
- package/assets/devices/Fan.svg +20 -20
- package/assets/devices/Floor Lamps.svg +4 -4
- package/assets/devices/Garage Doors.svg +9 -9
- package/assets/devices/Gates.svg +32 -32
- package/assets/devices/Hairdryer.svg +23 -23
- package/assets/devices/Handle.svg +6 -6
- package/assets/devices/Hanging Lamps.svg +8 -8
- package/assets/devices/Heater.svg +44 -44
- package/assets/devices/Hoods.svg +11 -11
- package/assets/devices/Hot Water.svg +9 -9
- package/assets/devices/Humidity.svg +41 -41
- package/assets/devices/Iron.svg +4 -4
- package/assets/devices/Irrigation.svg +22 -22
- package/assets/devices/Led Strip.svg +30 -30
- package/assets/devices/Light.svg +29 -29
- package/assets/devices/Lightings.svg +46 -46
- package/assets/devices/Lock.svg +19 -19
- package/assets/devices/Louvre.svg +6 -6
- package/assets/devices/Mowing Machine.svg +8 -8
- package/assets/devices/Music.svg +12 -12
- package/assets/devices/Outdoor Blinds.svg +6 -6
- package/assets/devices/People.svg +19 -19
- package/assets/devices/Pool.svg +7 -7
- package/assets/devices/Power Consumption.svg +12 -12
- package/assets/devices/Printer.svg +9 -9
- package/assets/devices/Pump.svg +9 -9
- package/assets/devices/Receiver.svg +18 -18
- package/assets/devices/Sconces.svg +9 -9
- package/assets/devices/Security.svg +34 -34
- package/assets/devices/Shading.svg +4 -4
- package/assets/devices/Shutters.svg +10 -10
- package/assets/devices/SmokeDetector.svg +12 -12
- package/assets/devices/Sockets.svg +13 -13
- package/assets/devices/Speaker.svg +35 -35
- package/assets/devices/Stove.svg +11 -11
- package/assets/devices/Table Lamps.svg +11 -11
- package/assets/devices/Temperature Sensors.svg +28 -28
- package/assets/devices/Tv.svg +7 -7
- package/assets/devices/Vacuum Cleaner.svg +15 -15
- package/assets/devices/Ventilation.svg +12 -12
- package/assets/devices/Washing Machines.svg +15 -15
- package/assets/devices/Water Consumption.svg +5 -5
- package/assets/devices/Water Heater.svg +8 -8
- package/assets/devices/Water.svg +40 -40
- package/assets/devices/Weather.svg +28 -28
- package/assets/devices/Window.svg +7 -7
- package/assets/devices/list.json +993 -993
- package/assets/devices/names.txt +62 -62
- package/assets/devices/parseNames.js +34 -34
- package/assets/lamp_ceiling.svg +8 -8
- package/assets/lamp_table.svg +7 -7
- package/assets/no_icon.svg +9 -9
- package/assets/rooms/Anteroom.svg +52 -52
- package/assets/rooms/Attic.svg +21 -21
- package/assets/rooms/Balcony.svg +12 -12
- package/assets/rooms/Barn.svg +5 -5
- package/assets/rooms/Basement.svg +4 -4
- package/assets/rooms/Bathroom.svg +38 -38
- package/assets/rooms/Bedroom.svg +5 -5
- package/assets/rooms/Boiler Room.svg +12 -12
- package/assets/rooms/Carport.svg +17 -17
- package/assets/rooms/Cellar.svg +89 -89
- package/assets/rooms/Chamber.svg +9 -9
- package/assets/rooms/Corridor.svg +52 -52
- package/assets/rooms/Dining Area.svg +37 -37
- package/assets/rooms/Dining Room.svg +37 -37
- package/assets/rooms/Dining.svg +37 -37
- package/assets/rooms/Dressing Room.svg +4 -4
- package/assets/rooms/Driveway.svg +14 -14
- package/assets/rooms/Entrance.svg +44 -44
- package/assets/rooms/Equipment Room.svg +14 -14
- package/assets/rooms/Front Yard.svg +64 -64
- package/assets/rooms/Gallery.svg +13 -13
- package/assets/rooms/Garage.svg +20 -20
- package/assets/rooms/Garden.svg +12 -12
- package/assets/rooms/Ground Floor.svg +95 -95
- package/assets/rooms/Guest Bathroom.svg +32 -32
- package/assets/rooms/Guest Room.svg +5 -5
- package/assets/rooms/Gym.svg +4 -4
- package/assets/rooms/Hall.svg +19 -19
- package/assets/rooms/Home Theater.svg +7 -7
- package/assets/rooms/Kitchen.svg +17 -17
- package/assets/rooms/Laundry Room.svg +11 -11
- package/assets/rooms/Living Area.svg +10 -10
- package/assets/rooms/Living Room.svg +10 -10
- package/assets/rooms/Locker Room.svg +16 -16
- package/assets/rooms/Nursery.svg +4 -4
- package/assets/rooms/Office.svg +8 -8
- package/assets/rooms/Outdoors.svg +7 -7
- package/assets/rooms/Playroom.svg +5 -5
- package/assets/rooms/Pool.svg +7 -7
- package/assets/rooms/Rear Wall.svg +30 -30
- package/assets/rooms/Second Floor.svg +95 -95
- package/assets/rooms/Shed.svg +16 -16
- package/assets/rooms/Sleeping Area.svg +22 -22
- package/assets/rooms/Stairway.svg +4 -4
- package/assets/rooms/Stairwell.svg +15 -15
- package/assets/rooms/Storeroom.svg +4 -4
- package/assets/rooms/Summer House.svg +27 -27
- package/assets/rooms/Swimming Pool.svg +21 -21
- package/assets/rooms/Terrace.svg +6 -6
- package/assets/rooms/Toilet.svg +10 -10
- package/assets/rooms/Upstairs.svg +5 -5
- package/assets/rooms/Wardrobe.svg +60 -60
- package/assets/rooms/Washroom.svg +19 -19
- package/assets/rooms/Wc.svg +10 -10
- package/assets/rooms/Windscreen.svg +60 -60
- package/assets/rooms/Workshop.svg +22 -22
- package/assets/rooms/Workspace.svg +8 -8
- package/assets/rooms/list.json +945 -945
- package/assets/rooms/names.txt +59 -59
- package/assets/rooms/parseNames.js +34 -34
- package/craco-module-federation.js +69 -69
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.js +8 -8
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconDocumentReadOnly.js.map +1 -1
- package/icons/IconFx.js +1 -1
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.js +9 -9
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconNoIcon.js +8 -8
- package/icons/IconNoIcon.js.map +1 -1
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.js.map +1 -1
- package/index.css +54 -54
- package/package.json +1 -1
- package/types.d.ts +94 -94
- package/Components/404.js.map +0 -1
- package/Components/CustomModal.js.map +0 -1
- package/Components/FileBrowser.js.map +0 -1
- package/Components/FileViewer.js.map +0 -1
- package/Components/Icon.js.map +0 -1
- package/Components/IconPicker.js.map +0 -1
- package/Components/IconSelector.js.map +0 -1
- package/Components/Image.js.map +0 -1
- package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
- package/Components/JsonConfigComponent/ChipInput.js +0 -763
- package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
- package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
- package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigChip.js +0 -120
- package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
- package/Components/JsonConfigComponent/ConfigColor.js +0 -120
- package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
- package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
- package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
- package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigFile.js +0 -228
- package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
- package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
- package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
- package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigIP.js +0 -130
- package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
- package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
- package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
- package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
- package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
- package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
- package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
- package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPort.js +0 -176
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
- package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
- package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
- package/Components/JsonConfigComponent/ConfigSendto.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
- package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
- package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
- package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
- package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
- package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigText.js +0 -226
- package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
- package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
- package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigUser.js +0 -142
- package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
- package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
- package/Components/JsonConfigComponent/Utils.d.ts +0 -9
- package/Components/JsonConfigComponent/Utils.js +0 -13
- package/Components/JsonConfigComponent/index.d.ts +0 -26
- package/Components/JsonConfigComponent/index.js +0 -520
- package/Components/JsonConfigComponent/index.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
- package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
- package/Components/Loader.js.map +0 -1
- package/Components/Loaders/PT.js.map +0 -1
- package/Components/Loaders/Vendor.js.map +0 -1
- package/Components/Logo.js.map +0 -1
- package/Components/MDUtils.js.map +0 -1
- package/Components/Router.js.map +0 -1
- package/Components/SaveCloseButtons.js.map +0 -1
- package/Components/Schedule.js.map +0 -1
- package/Components/SelectWithIcon.js.map +0 -1
- package/Components/SimpleCron/cron2text.js.map +0 -1
- package/Components/SimpleCron/cronText.js.map +0 -1
- package/Components/SimpleCron/index.js.map +0 -1
- package/Components/SimpleCron/jquery.cron.locale.js.map +0 -1
- package/Components/TabContainer.js.map +0 -1
- package/Components/TabContent.js.map +0 -1
- package/Components/TabHeader.js.map +0 -1
- package/Components/TableResize.js.map +0 -1
- package/Components/TextWithIcon.js.map +0 -1
- package/Components/ToggleThemeMenu.js.map +0 -1
- package/Components/UploadImage.js.map +0 -1
- package/Components/Utils.js.map +0 -1
- package/Components/copy-to-clipboard.d.ts +0 -13
- package/Components/copy-to-clipboard.js +0 -156
- package/Components/copy-to-clipboard.js.map +0 -1
- package/Dialogs/ComplexCron.js.map +0 -1
- package/Dialogs/Confirm.js.map +0 -1
- package/Dialogs/Cron.js.map +0 -1
- package/Dialogs/Error.js.map +0 -1
- package/Dialogs/Message.js.map +0 -1
- package/Dialogs/SelectFile.js.map +0 -1
- package/Dialogs/SelectID.js.map +0 -1
- package/Dialogs/SimpleCron.js.map +0 -1
- package/Dialogs/TextInput.js.map +0 -1
- package/GenericApp.js.map +0 -1
- package/LegacyConnection.js.map +0 -1
- package/Prompt.js.map +0 -1
- package/Theme.js.map +0 -1
- package/i18n.js.map +0 -1
- package/icons/IconExpert.js.map +0 -1
|
@@ -1,646 +0,0 @@
|
|
|
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
|
-
exports.isObject = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
const icons_material_1 = require("@mui/icons-material");
|
|
33
|
-
const i18n_1 = __importDefault(require("./wrapper/i18n"));
|
|
34
|
-
const Utils_1 = __importDefault(require("./wrapper/Components/Utils"));
|
|
35
|
-
const Confirm_1 = __importDefault(require("./wrapper/Dialogs/Confirm"));
|
|
36
|
-
const Icon_1 = __importDefault(require("./wrapper/Components/Icon"));
|
|
37
|
-
// because this class is used in adapter-react-v5, do not include here any foreign files like from '../../helpers/utils.ts'
|
|
38
|
-
function isObject(it) {
|
|
39
|
-
// This is necessary because:
|
|
40
|
-
// typeof null === 'object'
|
|
41
|
-
// typeof [] === 'object'
|
|
42
|
-
// [] instanceof Object === true
|
|
43
|
-
return Object.prototype.toString.call(it) === '[object Object]'; // this code is 25% faster than below one
|
|
44
|
-
// return it && typeof it === 'object' && !(it instanceof Array);
|
|
45
|
-
}
|
|
46
|
-
exports.isObject = isObject;
|
|
47
|
-
class ConfigGeneric extends react_1.Component {
|
|
48
|
-
constructor(props) {
|
|
49
|
-
super(props);
|
|
50
|
-
this.onUpdate = (data) => {
|
|
51
|
-
const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';
|
|
52
|
-
if (this.state.value !== value) {
|
|
53
|
-
this.setState({ value });
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.forceUpdate();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
// @ts-expect-error of course, as we just
|
|
60
|
-
this.state = {
|
|
61
|
-
confirmDialog: false,
|
|
62
|
-
confirmNewValue: null,
|
|
63
|
-
confirmAttr: null,
|
|
64
|
-
confirmData: null,
|
|
65
|
-
};
|
|
66
|
-
this.isError = {};
|
|
67
|
-
if (props.schema) {
|
|
68
|
-
if (props.custom) {
|
|
69
|
-
this.defaultValue = props.schema.defaultFunc
|
|
70
|
-
? this.executeCustom(props.schema.defaultFunc, props.schema.default, props.data, props.instanceObj, props.arrayIndex, props.globalData)
|
|
71
|
-
: props.schema.default;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.defaultValue = props.schema.defaultFunc
|
|
75
|
-
? this.execute(props.schema.defaultFunc, props.schema.default, props.data, props.arrayIndex, props.globalData)
|
|
76
|
-
: props.schema.default;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
this.lang = i18n_1.default.getLanguage();
|
|
80
|
-
}
|
|
81
|
-
componentDidMount() {
|
|
82
|
-
this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr, this.onUpdate);
|
|
83
|
-
const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];
|
|
84
|
-
// init default value
|
|
85
|
-
if (this.defaultValue !== undefined) {
|
|
86
|
-
const value = ConfigGeneric.getValue(this.props.data, this.props.attr);
|
|
87
|
-
if (value === undefined ||
|
|
88
|
-
(LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))) {
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
if (this.props.custom) {
|
|
91
|
-
this.props.onChange(this.props.attr, this.defaultValue, () => setTimeout(() => this.props.forceUpdate([this.props.attr], this.props.data), 100));
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);
|
|
95
|
-
this.props.onChange(this.props.data, undefined, () => this.props.forceUpdate([this.props.attr], this.props.data));
|
|
96
|
-
}
|
|
97
|
-
}, 100);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
else if (this.props.schema.defaultSendTo) {
|
|
101
|
-
this.sendTo();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
sendTo() {
|
|
105
|
-
if (this.props.alive) {
|
|
106
|
-
this.defaultSendToDone = true;
|
|
107
|
-
let data = this.props.schema.data;
|
|
108
|
-
if (data === undefined && this.props.schema.jsonData) {
|
|
109
|
-
data = this.getPattern(this.props.schema.jsonData);
|
|
110
|
-
try {
|
|
111
|
-
data = JSON.parse(data);
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
console.error(`Cannot parse json data: ${data}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
data = {
|
|
119
|
-
attr: this.props.attr,
|
|
120
|
-
value: ConfigGeneric.getValue(this.props.data, this.props.attr),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
if (data === undefined) {
|
|
124
|
-
data = null;
|
|
125
|
-
}
|
|
126
|
-
this.props.socket
|
|
127
|
-
.sendTo(`${this.props.adapterName}.${this.props.instance}`, this.props.schema.defaultSendTo, data)
|
|
128
|
-
.then((value) => {
|
|
129
|
-
if (value !== null && value !== undefined) {
|
|
130
|
-
if (this.props.custom) {
|
|
131
|
-
this.props.onChange(this.props.attr, value, () => this.props.forceUpdate([this.props.attr], this.props.data));
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
ConfigGeneric.setValue(this.props.data, this.props.attr, value);
|
|
135
|
-
this.props.onChange(this.props.data, undefined, () => this.props.forceUpdate([this.props.attr], this.props.data));
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
this.defaultSendToDone = false;
|
|
142
|
-
// show error, that instance did not start
|
|
143
|
-
this.onError(this.props.attr, i18n_1.default.t('ra_Instance %s is not alive', this.props.instance.toString()));
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
componentWillUnmount() {
|
|
147
|
-
this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr);
|
|
148
|
-
if (this.sendToTimeout) {
|
|
149
|
-
clearTimeout(this.sendToTimeout);
|
|
150
|
-
this.sendToTimeout = null;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Extract attribute out of data
|
|
155
|
-
*
|
|
156
|
-
* @param data
|
|
157
|
-
* @param attr
|
|
158
|
-
*/
|
|
159
|
-
static getValue(data, attr) {
|
|
160
|
-
if (typeof attr === 'string') {
|
|
161
|
-
return ConfigGeneric.getValue(data, attr.split('.'));
|
|
162
|
-
}
|
|
163
|
-
if (attr.length === 1) {
|
|
164
|
-
return data[attr[0]];
|
|
165
|
-
}
|
|
166
|
-
const part = attr.shift();
|
|
167
|
-
if (typeof part === 'string' && typeof data[part] === 'object') {
|
|
168
|
-
return ConfigGeneric.getValue(data[part], attr);
|
|
169
|
-
}
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
static setValue(data, attr, value) {
|
|
173
|
-
if (typeof attr === 'string') {
|
|
174
|
-
ConfigGeneric.setValue(data, attr.split('.'), value);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (attr.length === 1) {
|
|
178
|
-
if (value === null) {
|
|
179
|
-
delete data[attr[0]];
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
data[attr[0]] = value;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
const part = attr.shift();
|
|
187
|
-
if (typeof part !== 'string') {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
if (!data[part] || typeof data[part] === 'object') {
|
|
191
|
-
data[part] = data[part] || {};
|
|
192
|
-
}
|
|
193
|
-
ConfigGeneric.setValue(data[part], attr, value);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
getText(text, noTranslation) {
|
|
197
|
-
if (!text) {
|
|
198
|
-
return '';
|
|
199
|
-
}
|
|
200
|
-
if (typeof text === 'string') {
|
|
201
|
-
const strText = noTranslation ? text : i18n_1.default.t(text);
|
|
202
|
-
if (strText.includes('${')) {
|
|
203
|
-
return this.getPattern(strText);
|
|
204
|
-
}
|
|
205
|
-
return strText;
|
|
206
|
-
}
|
|
207
|
-
if (isObject(text)) {
|
|
208
|
-
if (text.func) {
|
|
209
|
-
// calculate pattern
|
|
210
|
-
if (typeof text.func === 'object') {
|
|
211
|
-
return this.getPattern(text.func[this.lang] || text.func.en || '');
|
|
212
|
-
}
|
|
213
|
-
return this.getPattern(text.func);
|
|
214
|
-
}
|
|
215
|
-
return text[this.lang] || text.en || '';
|
|
216
|
-
}
|
|
217
|
-
return text.toString();
|
|
218
|
-
}
|
|
219
|
-
renderConfirmDialog() {
|
|
220
|
-
if (!this.state.confirmDialog) {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
const confirm = this.state.confirmData || this.props.schema.confirm;
|
|
224
|
-
let icon = null;
|
|
225
|
-
if (confirm.type === 'warning') {
|
|
226
|
-
icon = react_1.default.createElement(icons_material_1.Warning, null);
|
|
227
|
-
}
|
|
228
|
-
else if (confirm.type === 'error') {
|
|
229
|
-
icon = react_1.default.createElement(icons_material_1.Error, null);
|
|
230
|
-
}
|
|
231
|
-
else if (confirm.type === 'info') {
|
|
232
|
-
icon = react_1.default.createElement(icons_material_1.Info, null);
|
|
233
|
-
}
|
|
234
|
-
return (react_1.default.createElement(Confirm_1.default, { title: this.getText(confirm.title) || i18n_1.default.t('ra_Please confirm'), text: this.getText(confirm.text), ok: this.getText(confirm.ok) || i18n_1.default.t('ra_Ok'), cancel: this.getText(confirm.cancel) || i18n_1.default.t('ra_Cancel'), icon: icon, onClose: isOk => this.setState({ confirmDialog: false }, () => {
|
|
235
|
-
if (isOk) {
|
|
236
|
-
const data = JSON.parse(JSON.stringify(this.props.data));
|
|
237
|
-
if (this.state.confirmDepAttr) {
|
|
238
|
-
ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);
|
|
239
|
-
}
|
|
240
|
-
ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);
|
|
241
|
-
this.setState({
|
|
242
|
-
confirmDialog: false,
|
|
243
|
-
confirmDepAttr: null,
|
|
244
|
-
confirmDepNewValue: null,
|
|
245
|
-
confirmNewValue: null,
|
|
246
|
-
confirmAttr: null,
|
|
247
|
-
confirmData: null,
|
|
248
|
-
}, () => this.props.onChange(data));
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
this.setState({
|
|
252
|
-
confirmDialog: false,
|
|
253
|
-
confirmDepAttr: null,
|
|
254
|
-
confirmDepNewValue: null,
|
|
255
|
-
confirmNewValue: null,
|
|
256
|
-
confirmAttr: null,
|
|
257
|
-
confirmData: null,
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
}) }));
|
|
261
|
-
}
|
|
262
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
263
|
-
getIcon(iconSettings) {
|
|
264
|
-
iconSettings = iconSettings || this.props.schema.icon;
|
|
265
|
-
let icon = null;
|
|
266
|
-
if (iconSettings === 'auth') {
|
|
267
|
-
icon = react_1.default.createElement(icons_material_1.Key, null);
|
|
268
|
-
}
|
|
269
|
-
else if (iconSettings === 'send') {
|
|
270
|
-
icon = react_1.default.createElement(icons_material_1.Send, null);
|
|
271
|
-
}
|
|
272
|
-
else if (iconSettings === 'web') {
|
|
273
|
-
icon = react_1.default.createElement(icons_material_1.Public, null);
|
|
274
|
-
}
|
|
275
|
-
else if (iconSettings === 'warning') {
|
|
276
|
-
icon = react_1.default.createElement(icons_material_1.Warning, null);
|
|
277
|
-
}
|
|
278
|
-
else if (iconSettings === 'error') {
|
|
279
|
-
icon = react_1.default.createElement(icons_material_1.Error, null);
|
|
280
|
-
}
|
|
281
|
-
else if (iconSettings === 'info') {
|
|
282
|
-
icon = react_1.default.createElement(icons_material_1.Info, null);
|
|
283
|
-
}
|
|
284
|
-
else if (iconSettings === 'search') {
|
|
285
|
-
icon = react_1.default.createElement(icons_material_1.Search, null);
|
|
286
|
-
}
|
|
287
|
-
else if (iconSettings === 'book') {
|
|
288
|
-
icon = react_1.default.createElement(icons_material_1.MenuBook, null);
|
|
289
|
-
}
|
|
290
|
-
else if (iconSettings === 'help') {
|
|
291
|
-
icon = react_1.default.createElement(icons_material_1.Help, null);
|
|
292
|
-
}
|
|
293
|
-
else if (iconSettings === 'upload') {
|
|
294
|
-
icon = react_1.default.createElement(icons_material_1.UploadFile, null);
|
|
295
|
-
}
|
|
296
|
-
else if (iconSettings) {
|
|
297
|
-
if (iconSettings.endsWith('.png') || iconSettings.endsWith('.svg') || iconSettings.endsWith('.jpg')) {
|
|
298
|
-
// this path is relative to ./adapter/NAME
|
|
299
|
-
if (!iconSettings.startsWith('http://') && !iconSettings.startsWith('https://')) {
|
|
300
|
-
iconSettings = `./adapter/${this.props.adapterName}/${iconSettings}`;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
icon = react_1.default.createElement(Icon_1.default, { src: iconSettings, style: { width: 22, height: 22 } });
|
|
304
|
-
}
|
|
305
|
-
return icon;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Trigger onChange, to activate save button on change
|
|
309
|
-
*
|
|
310
|
-
* @param attr the changed attribute
|
|
311
|
-
* @param newValue new value of the attribute
|
|
312
|
-
*/
|
|
313
|
-
onChangeAsync(attr, newValue) {
|
|
314
|
-
return new Promise(resolve => this.onChange(attr, newValue, resolve));
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Trigger onChange, to activate save button on change
|
|
318
|
-
*
|
|
319
|
-
* @param attr the changed attribute
|
|
320
|
-
* @param newValue new value of the attribute
|
|
321
|
-
* @param cb optional callback function, else returns a Promise
|
|
322
|
-
*/
|
|
323
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
324
|
-
onChange(attr, newValue, cb) {
|
|
325
|
-
// Do not use here deep copy, as it is not JsonConfig
|
|
326
|
-
const data = JSON.parse(JSON.stringify(this.props.data));
|
|
327
|
-
ConfigGeneric.setValue(data, attr, newValue);
|
|
328
|
-
if (this.props.schema.confirm &&
|
|
329
|
-
this.execute(this.props.schema.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
|
|
330
|
-
return new Promise(resolve => {
|
|
331
|
-
this.setState({
|
|
332
|
-
confirmDialog: true,
|
|
333
|
-
confirmNewValue: newValue,
|
|
334
|
-
confirmAttr: attr,
|
|
335
|
-
confirmData: null,
|
|
336
|
-
}, () => {
|
|
337
|
-
if (typeof cb === 'function') {
|
|
338
|
-
cb();
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
resolve();
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
// find any inputs with confirmation
|
|
347
|
-
if (this.props.schema.confirmDependsOn) {
|
|
348
|
-
for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {
|
|
349
|
-
const dep = this.props.schema.confirmDependsOn[z];
|
|
350
|
-
if (dep.confirm) {
|
|
351
|
-
const val = ConfigGeneric.getValue(data, dep.attr);
|
|
352
|
-
if (this.execute(dep.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
|
|
353
|
-
return new Promise(resolve => {
|
|
354
|
-
this.setState({
|
|
355
|
-
confirmDialog: true,
|
|
356
|
-
confirmNewValue: newValue,
|
|
357
|
-
confirmAttr: attr,
|
|
358
|
-
confirmDepNewValue: val,
|
|
359
|
-
confirmDepAttr: dep.attr,
|
|
360
|
-
confirmData: dep.confirm,
|
|
361
|
-
}, () => {
|
|
362
|
-
if (typeof cb === 'function') {
|
|
363
|
-
cb();
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
resolve();
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
const changed = [];
|
|
375
|
-
if (this.props.schema.onChangeDependsOn) {
|
|
376
|
-
for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {
|
|
377
|
-
const dep = this.props.schema.onChangeDependsOn[z];
|
|
378
|
-
if (dep.onChange) {
|
|
379
|
-
const val = ConfigGeneric.getValue(data, dep.attr);
|
|
380
|
-
let _newValue;
|
|
381
|
-
if (this.props.custom) {
|
|
382
|
-
_newValue = this.executeCustom(dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
_newValue = this.execute(dep.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);
|
|
386
|
-
}
|
|
387
|
-
if (_newValue !== val) {
|
|
388
|
-
ConfigGeneric.setValue(data, dep.attr, _newValue);
|
|
389
|
-
changed.push(dep.attr);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
if (this.props.schema.hiddenDependsOn) {
|
|
395
|
-
for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {
|
|
396
|
-
const dep = this.props.schema.hiddenDependsOn[z];
|
|
397
|
-
dep.hidden && changed.push(dep.attr);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
if (this.props.schema.labelDependsOn) {
|
|
401
|
-
for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {
|
|
402
|
-
const dep = this.props.schema.labelDependsOn[z];
|
|
403
|
-
dep.hidden && changed.push(dep.attr);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (this.props.schema.helpDependsOn) {
|
|
407
|
-
for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {
|
|
408
|
-
const dep = this.props.schema.helpDependsOn[z];
|
|
409
|
-
dep.hidden && changed.push(dep.attr);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {
|
|
413
|
-
const val = ConfigGeneric.getValue(data, this.props.attr);
|
|
414
|
-
const newValue_ = this.props.custom
|
|
415
|
-
? this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
|
|
416
|
-
: this.execute(this.props.schema.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);
|
|
417
|
-
if (newValue_ !== val) {
|
|
418
|
-
ConfigGeneric.setValue(data, this.props.attr, newValue_);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
if (this.props.custom) {
|
|
422
|
-
this.props.onChange(attr, newValue, () => cb && cb());
|
|
423
|
-
changed &&
|
|
424
|
-
changed.length &&
|
|
425
|
-
changed.forEach((_attr, i) => setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50));
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
this.props.onChange(data, undefined, () => {
|
|
429
|
-
changed.length && this.props.forceUpdate(changed, data);
|
|
430
|
-
cb && cb();
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
return Promise.resolve();
|
|
434
|
-
}
|
|
435
|
-
execute(func, defaultValue, data, arrayIndex, globalData) {
|
|
436
|
-
let fun;
|
|
437
|
-
if (isObject(func)) {
|
|
438
|
-
fun = func.func;
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
fun = func;
|
|
442
|
-
}
|
|
443
|
-
if (!fun) {
|
|
444
|
-
return defaultValue;
|
|
445
|
-
}
|
|
446
|
-
try {
|
|
447
|
-
// eslint-disable-next-line no-new-func
|
|
448
|
-
const f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', 'arrayIndex', 'globalData', '_changed', fun.includes('return') ? fun : `return ${fun}`);
|
|
449
|
-
return f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance, arrayIndex, globalData, this.props.changed);
|
|
450
|
-
}
|
|
451
|
-
catch (e) {
|
|
452
|
-
console.error(`Cannot execute ${func}: ${e}`);
|
|
453
|
-
return defaultValue;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
executeCustom(func, data, customObj, instanceObj, arrayIndex, globalData) {
|
|
457
|
-
let fun;
|
|
458
|
-
if (isObject(func)) {
|
|
459
|
-
fun = func.func;
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
fun = func;
|
|
463
|
-
}
|
|
464
|
-
if (!fun) {
|
|
465
|
-
return null;
|
|
466
|
-
}
|
|
467
|
-
try {
|
|
468
|
-
// eslint-disable-next-line no-new-func
|
|
469
|
-
const f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'arrayIndex', 'globalData', '_changed', fun.includes('return') ? fun : `return ${fun}`);
|
|
470
|
-
return f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket, arrayIndex, globalData, this.props.changed);
|
|
471
|
-
}
|
|
472
|
-
catch (e) {
|
|
473
|
-
console.error(`Cannot execute ${fun}: ${e}`);
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
calculate(schema) {
|
|
478
|
-
let error;
|
|
479
|
-
let disabled;
|
|
480
|
-
let hidden;
|
|
481
|
-
let defaultValue;
|
|
482
|
-
if (this.props.custom) {
|
|
483
|
-
error = schema.validator
|
|
484
|
-
? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
|
|
485
|
-
: false;
|
|
486
|
-
disabled = schema.disabled
|
|
487
|
-
? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
|
|
488
|
-
: false;
|
|
489
|
-
hidden = schema.hidden
|
|
490
|
-
? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
|
|
491
|
-
: false;
|
|
492
|
-
defaultValue = schema.defaultFunc
|
|
493
|
-
? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
|
|
494
|
-
: schema.default;
|
|
495
|
-
}
|
|
496
|
-
else {
|
|
497
|
-
error = schema.validator
|
|
498
|
-
? !this.execute(schema.validator, false, this.props.data, this.props.arrayIndex, this.props.globalData)
|
|
499
|
-
: false;
|
|
500
|
-
disabled = schema.disabled
|
|
501
|
-
? this.execute(schema.disabled, false, this.props.data, this.props.arrayIndex, this.props.globalData)
|
|
502
|
-
: false;
|
|
503
|
-
hidden = schema.hidden
|
|
504
|
-
? this.execute(schema.hidden, false, this.props.data, this.props.arrayIndex, this.props.globalData)
|
|
505
|
-
: false;
|
|
506
|
-
defaultValue = schema.defaultFunc
|
|
507
|
-
? this.execute(schema.defaultFunc, schema.default, this.props.data, this.props.arrayIndex, this.props.globalData)
|
|
508
|
-
: schema.default;
|
|
509
|
-
}
|
|
510
|
-
return {
|
|
511
|
-
error, disabled, hidden, defaultValue,
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
onError(attr, error) {
|
|
515
|
-
if (!error) {
|
|
516
|
-
delete this.isError[attr];
|
|
517
|
-
}
|
|
518
|
-
else {
|
|
519
|
-
this.isError[attr] = error;
|
|
520
|
-
}
|
|
521
|
-
this.props.onError && this.props.onError(attr, error);
|
|
522
|
-
}
|
|
523
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
524
|
-
renderItem(_error, _disabled, _defaultValue) {
|
|
525
|
-
return this.getText(this.props.schema.label) || this.getText(this.props.schema.text);
|
|
526
|
-
}
|
|
527
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
528
|
-
renderHelp(text, link, noTranslation) {
|
|
529
|
-
if (!link) {
|
|
530
|
-
text = this.getText(text, noTranslation) || '';
|
|
531
|
-
if (text &&
|
|
532
|
-
(text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {
|
|
533
|
-
return Utils_1.default.renderTextWithA(text);
|
|
534
|
-
}
|
|
535
|
-
return text;
|
|
536
|
-
}
|
|
537
|
-
return react_1.default.createElement("a", { href: link, target: "_blank", rel: "noreferrer", style: {
|
|
538
|
-
color: this.props.themeType === 'dark' ? '#a147ff' : '#5b238f',
|
|
539
|
-
textDecoration: 'underline',
|
|
540
|
-
} }, this.getText(text, noTranslation));
|
|
541
|
-
}
|
|
542
|
-
getPattern(pattern, data) {
|
|
543
|
-
data = data || this.props.data;
|
|
544
|
-
if (!pattern) {
|
|
545
|
-
return '';
|
|
546
|
-
}
|
|
547
|
-
if (typeof pattern === 'object') {
|
|
548
|
-
if (pattern.func) {
|
|
549
|
-
pattern = pattern.func;
|
|
550
|
-
}
|
|
551
|
-
else {
|
|
552
|
-
console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);
|
|
553
|
-
pattern = JSON.stringify(pattern);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
try {
|
|
557
|
-
if (this.props.custom) {
|
|
558
|
-
// eslint-disable-next-line no-new-func
|
|
559
|
-
const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', 'instanceObj', 'customObj', '_socket', '_changed', `return \`${pattern.replace(/`/g, '\\`')}\``);
|
|
560
|
-
return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.instanceObj, this.props.customObj, this.props.socket, this.props.changed);
|
|
561
|
-
}
|
|
562
|
-
// eslint-disable-next-line no-new-func
|
|
563
|
-
const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', '_alive', '_common', '_socket', '_changed', `return \`${pattern.replace(/`/g, '\\`')}\``);
|
|
564
|
-
return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.changed);
|
|
565
|
-
}
|
|
566
|
-
catch (e) {
|
|
567
|
-
console.error(`Cannot execute ${pattern}: ${e}`);
|
|
568
|
-
return pattern;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
render() {
|
|
572
|
-
const schema = this.props.schema;
|
|
573
|
-
if (!schema) {
|
|
574
|
-
return null;
|
|
575
|
-
}
|
|
576
|
-
if (this.props.alive && this.defaultSendToDone === false) {
|
|
577
|
-
this.sendToTimeout = setTimeout(() => {
|
|
578
|
-
this.sendToTimeout = null;
|
|
579
|
-
this.sendTo();
|
|
580
|
-
}, 200);
|
|
581
|
-
}
|
|
582
|
-
const { error, disabled, hidden, defaultValue, } = this.calculate(schema);
|
|
583
|
-
if (hidden) {
|
|
584
|
-
// Remove all errors if element is hidden
|
|
585
|
-
if (Object.keys(this.isError).length) {
|
|
586
|
-
setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr)), 100, JSON.parse(JSON.stringify(this.isError)));
|
|
587
|
-
this.isError = {};
|
|
588
|
-
}
|
|
589
|
-
if (schema.hideOnlyControl) {
|
|
590
|
-
const item = react_1.default.createElement(material_1.Grid, { item: true, xs: schema.xs || undefined, lg: schema.lg || undefined, md: schema.md || undefined, sm: schema.sm || undefined, style: (Object.assign(Object.assign({ marginBottom: 0, textAlign: 'left' }, schema.style), (this.props.themeType === 'dark' ? schema.darkStyle : {}))) });
|
|
591
|
-
if (schema.newLine) {
|
|
592
|
-
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
593
|
-
react_1.default.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
|
|
594
|
-
item);
|
|
595
|
-
}
|
|
596
|
-
return item;
|
|
597
|
-
}
|
|
598
|
-
return null;
|
|
599
|
-
}
|
|
600
|
-
// Add error
|
|
601
|
-
if (schema.validatorNoSaveOnError) {
|
|
602
|
-
if (error && !Object.keys(this.isError).length) {
|
|
603
|
-
this.isError = {
|
|
604
|
-
[this.props.attr]: schema.validatorErrorText ? i18n_1.default.t(schema.validatorErrorText) : true,
|
|
605
|
-
};
|
|
606
|
-
setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])), 100, JSON.parse(JSON.stringify(this.isError)));
|
|
607
|
-
}
|
|
608
|
-
else if (!error && Object.keys(this.isError).length) {
|
|
609
|
-
setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr)), 100, JSON.parse(JSON.stringify(this.isError)));
|
|
610
|
-
this.isError = {};
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
const renderedItem = this.renderItem(error, disabled || this.props.commandRunning || this.props.disabled, defaultValue);
|
|
614
|
-
if (this.noPlaceRequired) {
|
|
615
|
-
return renderedItem;
|
|
616
|
-
}
|
|
617
|
-
const item = react_1.default.createElement(material_1.Grid, { item: true, title: this.getText(schema.tooltip), xs: schema.xs || undefined, lg: schema.lg || undefined, md: schema.md || undefined, sm: schema.sm || undefined, style: (Object.assign(Object.assign({ marginBottom: 0,
|
|
618
|
-
// marginRight: 8,
|
|
619
|
-
textAlign: 'left', width: schema.type === 'divider' || schema.type === 'header'
|
|
620
|
-
? schema.width || '100%'
|
|
621
|
-
: undefined }, schema.style), (this.props.themeType === 'dark' ? schema.darkStyle : {}))) }, this.props.schema.defaultSendTo && this.props.schema.button ?
|
|
622
|
-
react_1.default.createElement(material_1.Grid, { container: true, style: { width: '100%' } },
|
|
623
|
-
react_1.default.createElement(material_1.Grid, { item: true, flex: 1 }, renderedItem),
|
|
624
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
625
|
-
react_1.default.createElement(material_1.Button, { variant: "outlined", onClick: () => this.sendTo(), title: this.props.schema.buttonTooltip
|
|
626
|
-
? this.getText(this.props.schema.buttonTooltip, this.props.schema.buttonTooltipNoTranslation)
|
|
627
|
-
: i18n_1.default.t('ra_Request data by instance') }, this.getText(this.props.schema.button)))) : renderedItem);
|
|
628
|
-
if (schema.newLine) {
|
|
629
|
-
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
630
|
-
react_1.default.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
|
|
631
|
-
this.renderConfirmDialog(),
|
|
632
|
-
item);
|
|
633
|
-
}
|
|
634
|
-
if (this.state.confirmDialog) {
|
|
635
|
-
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
636
|
-
this.renderConfirmDialog(),
|
|
637
|
-
item);
|
|
638
|
-
}
|
|
639
|
-
return item;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
ConfigGeneric.DIFFERENT_VALUE = '__different__';
|
|
643
|
-
ConfigGeneric.DIFFERENT_LABEL = 'ra___different__';
|
|
644
|
-
ConfigGeneric.NONE_VALUE = '';
|
|
645
|
-
ConfigGeneric.NONE_LABEL = 'ra_none';
|
|
646
|
-
exports.default = ConfigGeneric;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "changed" | "classes" | "disabled" | "data" | "onChange" | "onError" | "common" | "instance" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "adapterName" | "themeType"> & Pick<PropTypes.InferProps<{
|
|
2
|
-
socket: PropTypes.Validator<object>;
|
|
3
|
-
themeType: PropTypes.Requireable<string>;
|
|
4
|
-
themeName: PropTypes.Requireable<string>;
|
|
5
|
-
style: PropTypes.Requireable<object>;
|
|
6
|
-
className: PropTypes.Requireable<string>;
|
|
7
|
-
data: PropTypes.Validator<object>;
|
|
8
|
-
schema: PropTypes.Requireable<object>;
|
|
9
|
-
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
}>, "style" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "changed" | "classes" | "disabled" | "common" | "instance" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "adapterName" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
-
export default _default;
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
|
-
import React from 'react';
|