@iobroker/adapter-react-v5 7.0.2 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/404.d.ts +3 -2
- package/Components/404.js +3 -2
- package/Components/ColorPicker.d.ts +22 -8
- package/Components/ColorPicker.js +34 -17
- package/Components/ComplexCron.js +24 -24
- package/Components/CopyToClipboard.d.ts +10 -1
- package/Components/CopyToClipboard.js +17 -8
- package/Components/CustomModal.d.ts +1 -1
- package/Components/CustomModal.js +8 -8
- package/Components/FileBrowser.d.ts +11 -11
- package/Components/FileBrowser.js +135 -152
- package/Components/FileViewer.js +34 -23
- package/Components/Icon.d.ts +16 -2
- package/Components/Icon.js +19 -8
- package/Components/IconPicker.js +10 -14
- package/Components/IconSelector.d.ts +1 -1
- package/Components/IconSelector.js +64 -74
- package/Components/Image.d.ts +8 -4
- package/Components/Image.js +13 -32
- package/Components/Loader.d.ts +2 -2
- package/Components/Loader.js +21 -18
- package/Components/Loaders/MV.d.ts +6 -1
- package/Components/Loaders/MV.js +23 -7
- package/Components/Loaders/PT.d.ts +7 -2
- package/Components/Loaders/PT.js +20 -7
- package/Components/Loaders/Vendor.d.ts +2 -2
- package/Components/Loaders/Vendor.js +15 -7
- package/Components/Logo.js +16 -18
- package/Components/MDUtils.d.ts +1 -1
- package/Components/MDUtils.js +8 -4
- package/Components/ObjectBrowser.d.ts +40 -39
- package/Components/ObjectBrowser.js +550 -435
- package/Components/Router.d.ts +1 -3
- package/Components/Router.js +3 -1
- package/Components/SaveCloseButtons.d.ts +3 -3
- package/Components/SaveCloseButtons.js +3 -3
- package/Components/Schedule.d.ts +15 -15
- package/Components/Schedule.js +177 -154
- package/Components/SelectWithIcon.d.ts +2 -2
- package/Components/SelectWithIcon.js +45 -34
- package/Components/SimpleCron/index.js +83 -43
- package/Components/TabContainer.js +2 -2
- package/Components/TabContent.js +1 -1
- package/Components/TabHeader.js +1 -1
- package/Components/TableResize.d.ts +2 -2
- package/Components/TableResize.js +5 -5
- package/Components/TextWithIcon.d.ts +1 -1
- package/Components/TextWithIcon.js +10 -8
- package/Components/ToggleThemeMenu.d.ts +2 -2
- package/Components/ToggleThemeMenu.js +3 -3
- package/Components/TreeTable.d.ts +18 -18
- package/Components/TreeTable.js +76 -72
- package/Components/UploadImage.d.ts +2 -2
- package/Components/UploadImage.js +25 -21
- package/Components/Utils.d.ts +42 -22
- package/Components/Utils.js +66 -65
- package/Components/withWidth.d.ts +2 -2
- package/Components/withWidth.js +10 -6
- package/Dialogs/ComplexCron.d.ts +2 -2
- package/Dialogs/ComplexCron.js +3 -3
- package/Dialogs/Confirm.d.ts +4 -4
- package/Dialogs/Confirm.js +18 -8
- package/Dialogs/Cron.d.ts +3 -3
- package/Dialogs/Cron.js +21 -17
- package/Dialogs/Error.d.ts +3 -3
- package/Dialogs/Error.js +6 -4
- package/Dialogs/Message.d.ts +3 -3
- package/Dialogs/Message.js +6 -4
- package/Dialogs/SelectFile.d.ts +4 -4
- package/Dialogs/SelectFile.js +6 -4
- package/Dialogs/SelectID.d.ts +12 -10
- package/Dialogs/SelectID.js +12 -8
- package/Dialogs/SimpleCron.d.ts +2 -2
- package/Dialogs/SimpleCron.js +2 -2
- package/Dialogs/TextInput.d.ts +2 -2
- package/Dialogs/TextInput.js +3 -3
- package/GenericApp.d.ts +19 -13
- package/GenericApp.js +128 -85
- package/LegacyConnection.d.ts +240 -248
- package/LegacyConnection.js +500 -525
- package/README.md +1264 -1171
- package/Theme.d.ts +1 -1
- package/Theme.js +9 -12
- package/assets/devices.json +1 -0
- package/assets/rooms.json +1 -0
- package/craco-module-federation.js +3 -12
- package/i18n/de.json +434 -434
- package/i18n/en.json +434 -434
- package/i18n/es.json +434 -434
- package/i18n/fr.json +434 -434
- package/i18n/it.json +434 -434
- package/i18n/nl.json +434 -434
- package/i18n/pl.json +434 -434
- package/i18n/pt.json +434 -434
- package/i18n/ru.json +434 -434
- package/i18n/uk.json +434 -434
- package/i18n/zh-cn.json +434 -434
- package/i18n.d.ts +26 -19
- package/i18n.js +28 -22
- package/icons/IconAdapter.js +2 -2
- package/icons/IconAlias.js +2 -2
- package/icons/IconChannel.js +2 -2
- package/icons/IconClearFilter.js +2 -2
- package/icons/IconClosed.js +2 -2
- package/icons/IconCopy.js +2 -2
- package/icons/IconDevice.js +2 -2
- package/icons/IconDocument.js +2 -2
- package/icons/IconDocumentReadOnly.js +2 -2
- package/icons/IconExpert.js +2 -2
- package/icons/IconFx.js +2 -2
- package/icons/IconInstance.js +2 -2
- package/icons/IconLogout.js +2 -2
- package/icons/IconNoIcon.js +2 -2
- package/icons/IconOpen.d.ts +2 -2
- package/icons/IconOpen.js +2 -2
- package/icons/IconProps.d.ts +4 -3
- package/icons/IconState.d.ts +2 -2
- package/icons/IconState.js +2 -2
- package/index.css +3 -2
- package/package.json +4 -4
- package/src/Components/404.tsx +32 -31
- package/src/Components/ColorPicker.tsx +142 -114
- package/src/Components/ComplexCron.tsx +174 -137
- package/src/Components/CopyToClipboard.tsx +22 -9
- package/src/Components/CustomModal.tsx +76 -69
- package/src/Components/FileBrowser.tsx +959 -852
- package/src/Components/FileViewer.tsx +146 -127
- package/src/Components/Icon.tsx +80 -52
- package/src/Components/IconPicker.tsx +83 -67
- package/src/Components/IconSelector.tsx +159 -141
- package/src/Components/Image.tsx +43 -26
- package/src/Components/Loader.tsx +56 -32
- package/src/Components/Logo.tsx +62 -52
- package/src/Components/MDUtils.tsx +10 -6
- package/src/Components/ObjectBrowser.tsx +3198 -2478
- package/src/Components/Router.tsx +11 -11
- package/src/Components/SaveCloseButtons.tsx +43 -39
- package/src/Components/Schedule.tsx +1091 -853
- package/src/Components/SelectWithIcon.tsx +135 -93
- package/src/Components/TabContainer.tsx +22 -20
- package/src/Components/TabContent.tsx +13 -12
- package/src/Components/TabHeader.tsx +10 -9
- package/src/Components/TableResize.tsx +52 -37
- package/src/Components/TextWithIcon.tsx +30 -19
- package/src/Components/ToggleThemeMenu.tsx +31 -13
- package/src/Components/TreeTable.tsx +468 -385
- package/src/Components/UploadImage.tsx +153 -121
- package/src/Components/Utils.tsx +135 -127
- package/src/Components/loader.css +40 -31
- package/src/Components/withWidth.tsx +23 -12
- package/src/Connection.tsx +1 -3
- package/src/Dialogs/ComplexCron.tsx +55 -61
- package/src/Dialogs/Confirm.tsx +88 -65
- package/src/Dialogs/Cron.tsx +122 -112
- package/src/Dialogs/Error.tsx +37 -42
- package/src/Dialogs/Message.tsx +39 -37
- package/src/Dialogs/SelectFile.tsx +95 -85
- package/src/Dialogs/SelectID.tsx +141 -129
- package/src/Dialogs/SimpleCron.tsx +44 -44
- package/src/Dialogs/TextInput.tsx +60 -68
- package/src/GenericApp.tsx +342 -242
- package/src/LegacyConnection.tsx +972 -842
- package/src/Prompt.tsx +3 -1
- package/src/Theme.tsx +19 -26
- package/src/icons/IconAdapter.tsx +16 -14
- package/src/icons/IconAlias.tsx +16 -14
- package/src/icons/IconChannel.tsx +55 -16
- package/src/icons/IconClearFilter.tsx +17 -15
- package/src/icons/IconClosed.tsx +16 -11
- package/src/icons/IconCopy.tsx +16 -11
- package/src/icons/IconDevice.tsx +121 -22
- package/src/icons/IconDocument.tsx +16 -11
- package/src/icons/IconDocumentReadOnly.tsx +21 -12
- package/src/icons/IconExpert.tsx +20 -12
- package/src/icons/IconFx.tsx +16 -14
- package/src/icons/IconInstance.tsx +16 -14
- package/src/icons/IconLogout.tsx +20 -18
- package/src/icons/IconNoIcon.tsx +16 -14
- package/src/icons/IconOpen.tsx +17 -12
- package/src/icons/IconProps.tsx +4 -3
- package/src/icons/IconState.tsx +34 -13
- package/src/index.css +3 -2
- package/tasks.js +91 -0
- package/types.d.ts +141 -0
- package/Components/Loaders/PT.css +0 -109
- package/Components/Loaders/Vendor.css +0 -13
- package/Components/loader.css +0 -222
- package/Components/types.d.ts +0 -82
- package/assets/devices/Alarm Systems.svg +0 -19
- package/assets/devices/Amplifier.svg +0 -22
- package/assets/devices/Awnings.svg +0 -5
- package/assets/devices/Battery Status.svg +0 -5
- package/assets/devices/Ceiling Spotlights.svg +0 -16
- package/assets/devices/Chandelier.svg +0 -7
- package/assets/devices/Climate.svg +0 -12
- package/assets/devices/Coffee Makers.svg +0 -6
- package/assets/devices/Cold Water.svg +0 -31
- package/assets/devices/Computer.svg +0 -21
- package/assets/devices/Consumption.svg +0 -8
- package/assets/devices/Curtains.svg +0 -43
- package/assets/devices/Dishwashers.svg +0 -12
- package/assets/devices/Doors.svg +0 -6
- package/assets/devices/Doorstep.svg +0 -35
- package/assets/devices/Dryer.svg +0 -14
- package/assets/devices/Fan.svg +0 -20
- package/assets/devices/Floor Lamps.svg +0 -5
- package/assets/devices/Garage Doors.svg +0 -9
- package/assets/devices/Gates.svg +0 -32
- package/assets/devices/Hairdryer.svg +0 -23
- package/assets/devices/Handle.svg +0 -6
- package/assets/devices/Hanging Lamps.svg +0 -9
- package/assets/devices/Heater.svg +0 -44
- package/assets/devices/Hoods.svg +0 -12
- package/assets/devices/Hot Water.svg +0 -10
- package/assets/devices/Humidity.svg +0 -41
- package/assets/devices/Iron.svg +0 -5
- package/assets/devices/Irrigation.svg +0 -23
- package/assets/devices/Led Strip.svg +0 -31
- package/assets/devices/Light.svg +0 -30
- package/assets/devices/Lightings.svg +0 -46
- package/assets/devices/Lock.svg +0 -19
- package/assets/devices/Louvre.svg +0 -7
- package/assets/devices/Mowing Machine.svg +0 -9
- package/assets/devices/Music.svg +0 -13
- package/assets/devices/Outdoor Blinds.svg +0 -7
- package/assets/devices/People.svg +0 -19
- package/assets/devices/Pool.svg +0 -8
- package/assets/devices/Power Consumption.svg +0 -13
- package/assets/devices/Printer.svg +0 -10
- package/assets/devices/Pump.svg +0 -10
- package/assets/devices/Receiver.svg +0 -19
- package/assets/devices/Sconces.svg +0 -10
- package/assets/devices/Security.svg +0 -34
- package/assets/devices/Shading.svg +0 -5
- package/assets/devices/Shutters.svg +0 -11
- package/assets/devices/SmokeDetector.svg +0 -13
- package/assets/devices/Sockets.svg +0 -13
- package/assets/devices/Speaker.svg +0 -35
- package/assets/devices/Stove.svg +0 -12
- package/assets/devices/Table Lamps.svg +0 -12
- package/assets/devices/Temperature Sensors.svg +0 -28
- package/assets/devices/Tv.svg +0 -8
- package/assets/devices/Vacuum Cleaner.svg +0 -16
- package/assets/devices/Ventilation.svg +0 -12
- package/assets/devices/Washing Machines.svg +0 -16
- package/assets/devices/Water Consumption.svg +0 -6
- package/assets/devices/Water Heater.svg +0 -8
- package/assets/devices/Water.svg +0 -40
- package/assets/devices/Weather.svg +0 -28
- package/assets/devices/Window.svg +0 -8
- package/assets/rooms/Anteroom.svg +0 -53
- package/assets/rooms/Attic.svg +0 -21
- package/assets/rooms/Balcony.svg +0 -13
- package/assets/rooms/Barn.svg +0 -6
- package/assets/rooms/Basement.svg +0 -5
- package/assets/rooms/Bathroom.svg +0 -38
- package/assets/rooms/Bedroom.svg +0 -5
- package/assets/rooms/Boiler Room.svg +0 -13
- package/assets/rooms/Carport.svg +0 -17
- package/assets/rooms/Cellar.svg +0 -89
- package/assets/rooms/Chamber.svg +0 -9
- package/assets/rooms/Corridor.svg +0 -53
- package/assets/rooms/Dining Area.svg +0 -37
- package/assets/rooms/Dining Room.svg +0 -37
- package/assets/rooms/Dining.svg +0 -37
- package/assets/rooms/Dressing Room.svg +0 -5
- package/assets/rooms/Driveway.svg +0 -15
- package/assets/rooms/Entrance.svg +0 -44
- package/assets/rooms/Equipment Room.svg +0 -15
- package/assets/rooms/Front Yard.svg +0 -64
- package/assets/rooms/Gallery.svg +0 -14
- package/assets/rooms/Garage.svg +0 -20
- package/assets/rooms/Garden.svg +0 -13
- package/assets/rooms/Ground Floor.svg +0 -95
- package/assets/rooms/Guest Bathroom.svg +0 -33
- package/assets/rooms/Guest Room.svg +0 -5
- package/assets/rooms/Gym.svg +0 -5
- package/assets/rooms/Hall.svg +0 -19
- package/assets/rooms/Home Theater.svg +0 -8
- package/assets/rooms/Kitchen.svg +0 -18
- package/assets/rooms/Laundry Room.svg +0 -12
- package/assets/rooms/Living Area.svg +0 -11
- package/assets/rooms/Living Room.svg +0 -10
- package/assets/rooms/Locker Room.svg +0 -17
- package/assets/rooms/Nursery.svg +0 -5
- package/assets/rooms/Office.svg +0 -8
- package/assets/rooms/Outdoors.svg +0 -7
- package/assets/rooms/Playroom.svg +0 -6
- package/assets/rooms/Pool.svg +0 -8
- package/assets/rooms/Rear Wall.svg +0 -30
- package/assets/rooms/Second Floor.svg +0 -95
- package/assets/rooms/Shed.svg +0 -16
- package/assets/rooms/Sleeping Area.svg +0 -22
- package/assets/rooms/Stairway.svg +0 -5
- package/assets/rooms/Stairwell.svg +0 -15
- package/assets/rooms/Storeroom.svg +0 -5
- package/assets/rooms/Summer House.svg +0 -27
- package/assets/rooms/Swimming Pool.svg +0 -21
- package/assets/rooms/Terrace.svg +0 -7
- package/assets/rooms/Toilet.svg +0 -10
- package/assets/rooms/Upstairs.svg +0 -6
- package/assets/rooms/Wardrobe.svg +0 -60
- package/assets/rooms/Washroom.svg +0 -20
- package/assets/rooms/Wc.svg +0 -10
- package/assets/rooms/Windscreen.svg +0 -60
- package/assets/rooms/Workshop.svg +0 -23
- package/assets/rooms/Workspace.svg +0 -8
|
@@ -39,7 +39,7 @@ exports.getSelectIdIconFromObjects = getSelectIdIconFromObjects;
|
|
|
39
39
|
*
|
|
40
40
|
* MIT License
|
|
41
41
|
*
|
|
42
|
-
|
|
42
|
+
*/
|
|
43
43
|
const react_1 = __importStar(require("react"));
|
|
44
44
|
const react_inlinesvg_1 = __importDefault(require("react-inlinesvg"));
|
|
45
45
|
const material_1 = require("@mui/material");
|
|
@@ -515,7 +515,7 @@ const styles = {
|
|
|
515
515
|
cursor: 'pointer',
|
|
516
516
|
},
|
|
517
517
|
cellButtonsValueButtonEdit: {
|
|
518
|
-
right:
|
|
518
|
+
right: SMALL_BUTTON_SIZE / 2 + 16,
|
|
519
519
|
},
|
|
520
520
|
cellDetailsLine: {
|
|
521
521
|
display: 'flex',
|
|
@@ -749,10 +749,10 @@ const styles = {
|
|
|
749
749
|
},
|
|
750
750
|
};
|
|
751
751
|
function ButtonIcon(props) {
|
|
752
|
-
return react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 436 436", style: props === null || props === void 0 ? void 0 : props.style, width: "24", height: "24", className: "admin-button" },
|
|
752
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 436 436", style: props === null || props === void 0 ? void 0 : props.style, width: "24", height: "24", className: "admin-button" },
|
|
753
753
|
react_1.default.createElement("g", { fill: "currentColor" },
|
|
754
754
|
react_1.default.createElement("path", { d: "m195.23077,24.30769c-36,3 -67,12 -96,26c-49,24 -82,61 -93,104l-3,11l-1,50c0,46 0,49 2,59l5,20c21,58 84,103 165,116c16,3 53,4 70,2c60,-6 111,-28 147,-64c21,-21 36,-49 40,-74a866,866 0 0 0 1,-104c-3,-18 -6,-28 -13,-43c-26,-52 -87,-90 -162,-101c-16,-2 -48,-3 -63,-2l1,0zm60,23c36,5 70,18 95,35c31,20 51,47 59,77c2,7 2,11 2,25c1,15 0,18 -2,26c-19,69 -104,117 -200,114c-47,-2 -90,-15 -124,-38c-31,-20 -51,-47 -59,-77c-3,-11 -4,-32 -2,-43c8,-42 41,-78 91,-101a260,260 0 0 1 140,-19l0,1zm-221,222c21,26 57,49 95,62c81,27 174,14 239,-32c14,-10 31,-27 41,-41c2,-2 2,-2 2,7c-1,23 -16,50 -38,72c-78,74 -233,74 -311,-1a121,121 0 0 1 -39,-76l0,-6l3,4l8,11z" }),
|
|
755
|
-
react_1.default.createElement("path", { d: "m201.23077,47.30769c-40,3 -79,19 -104,44c-55,55 -38,133 37,171c52,26 122,24 172,-5c30,-17 51,-42 58,-71c3,-11 3,-34 0,-45c-6,-23 -21,-44 -40,-60l-27,-16a184,184 0 0 0 -96,-18zm30,21c56,5 100,35 112,75c4,11 4,30 0,41c-8,25 -26,45 -54,59a166,166 0 0 1 -160,-8a98,98 0 0 1 -41,-53c-5,-18 -2,-39 8,-57c23,-39 79,-62 135,-57z" })));
|
|
755
|
+
react_1.default.createElement("path", { d: "m201.23077,47.30769c-40,3 -79,19 -104,44c-55,55 -38,133 37,171c52,26 122,24 172,-5c30,-17 51,-42 58,-71c3,-11 3,-34 0,-45c-6,-23 -21,-44 -40,-60l-27,-16a184,184 0 0 0 -96,-18zm30,21c56,5 100,35 112,75c4,11 4,30 0,41c-8,25 -26,45 -54,59a166,166 0 0 1 -160,-8a98,98 0 0 1 -41,-53c-5,-18 -2,-39 8,-57c23,-39 79,-62 135,-57z" }))));
|
|
756
756
|
}
|
|
757
757
|
/**
|
|
758
758
|
* Function that walks through all keys of an object or array and applies a function to each key.
|
|
@@ -835,7 +835,9 @@ options) {
|
|
|
835
835
|
if (options.excludeSystemRepositories) {
|
|
836
836
|
filterKeys.push('system.repositories');
|
|
837
837
|
}
|
|
838
|
-
const filteredObject = filterKeys.length > 0 || options.excludeTranslations
|
|
838
|
+
const filteredObject = filterKeys.length > 0 || options.excludeTranslations
|
|
839
|
+
? filterObject(obj, filterKeys, options.excludeTranslations)
|
|
840
|
+
: obj;
|
|
839
841
|
const data = options.beautify ? JSON.stringify(filteredObject, null, 2) : JSON.stringify(filteredObject);
|
|
840
842
|
el.setAttribute('href', `data:application/json;charset=utf-8,${encodeURIComponent(data)}`);
|
|
841
843
|
el.setAttribute('download', fileName);
|
|
@@ -874,7 +876,7 @@ function getName(name, lang) {
|
|
|
874
876
|
}
|
|
875
877
|
return (name || '').toString();
|
|
876
878
|
}
|
|
877
|
-
function getSelectIdIconFromObjects(objects, id, imagePrefix) {
|
|
879
|
+
function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
|
|
878
880
|
// `admin` has prefix '.' and `web` has '../..'
|
|
879
881
|
imagePrefix = imagePrefix || '.'; // http://localhost:8081';
|
|
880
882
|
let src = '';
|
|
@@ -884,7 +886,13 @@ function getSelectIdIconFromObjects(objects, id, imagePrefix) {
|
|
|
884
886
|
// if not BASE64
|
|
885
887
|
if (!aIcon.startsWith('data:image/')) {
|
|
886
888
|
if (aIcon.includes('.')) {
|
|
887
|
-
|
|
889
|
+
const name = objects[_id_].common.name;
|
|
890
|
+
if (typeof name === 'object') {
|
|
891
|
+
src = `${imagePrefix}/adapter/${name[lang] || name.en}/${aIcon}`;
|
|
892
|
+
}
|
|
893
|
+
else {
|
|
894
|
+
src = `${imagePrefix}/adapter/${name}/${aIcon}`;
|
|
895
|
+
}
|
|
888
896
|
}
|
|
889
897
|
else if (aIcon && aIcon.length < 3) {
|
|
890
898
|
return aIcon; // utf-8
|
|
@@ -894,7 +902,7 @@ function getSelectIdIconFromObjects(objects, id, imagePrefix) {
|
|
|
894
902
|
}
|
|
895
903
|
}
|
|
896
904
|
else if (aIcon.startsWith('data:image/svg')) {
|
|
897
|
-
src = react_1.default.createElement(react_inlinesvg_1.default, { className: "iconOwn", src: aIcon, width: 28, height: 28 });
|
|
905
|
+
src = (react_1.default.createElement(react_inlinesvg_1.default, { className: "iconOwn", src: aIcon, width: 28, height: 28 }));
|
|
898
906
|
}
|
|
899
907
|
else {
|
|
900
908
|
src = aIcon;
|
|
@@ -909,7 +917,12 @@ function getSelectIdIconFromObjects(objects, id, imagePrefix) {
|
|
|
909
917
|
if (cIcon.includes('.')) {
|
|
910
918
|
let instance;
|
|
911
919
|
if (objects[id].type === 'instance' || objects[id].type === 'adapter') {
|
|
912
|
-
|
|
920
|
+
if (typeof common.name === 'object') {
|
|
921
|
+
src = `${imagePrefix}/adapter/${common.name[lang] || common.name.en}/${cIcon}`;
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
src = `${imagePrefix}/adapter/${common.name}/${cIcon}`;
|
|
925
|
+
}
|
|
913
926
|
}
|
|
914
927
|
else if (id && id.startsWith('system.adapter.')) {
|
|
915
928
|
instance = id.split('.', 3);
|
|
@@ -941,7 +954,7 @@ function getSelectIdIconFromObjects(objects, id, imagePrefix) {
|
|
|
941
954
|
}
|
|
942
955
|
else if (cIcon.startsWith('data:image/svg')) {
|
|
943
956
|
// if base 64 image
|
|
944
|
-
src = react_1.default.createElement(react_inlinesvg_1.default, { className: "iconOwn", src: cIcon, width: 28, height: 28 });
|
|
957
|
+
src = (react_1.default.createElement(react_inlinesvg_1.default, { className: "iconOwn", src: cIcon, width: 28, height: 28 }));
|
|
945
958
|
}
|
|
946
959
|
else {
|
|
947
960
|
src = cIcon;
|
|
@@ -1039,7 +1052,8 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
|
|
|
1039
1052
|
filteredOut = true;
|
|
1040
1053
|
}
|
|
1041
1054
|
}
|
|
1042
|
-
else if (Array.isArray(filterOfCustom)) {
|
|
1055
|
+
else if (Array.isArray(filterOfCustom)) {
|
|
1056
|
+
// here are ['influxdb.', 'telegram.']
|
|
1043
1057
|
const customs = Object.keys(common.custom); // here are ['influxdb.0', 'telegram.2']
|
|
1044
1058
|
if (filterOfCustom.find(cst => customs.find(id => id.startsWith(cst)))) {
|
|
1045
1059
|
filteredOut = true;
|
|
@@ -1147,20 +1161,20 @@ function getVisibleItems(item, type, objects, _result) {
|
|
|
1147
1161
|
}
|
|
1148
1162
|
return _result;
|
|
1149
1163
|
}
|
|
1150
|
-
function getSystemIcon(objects, id, level, themeType, imagePrefix) {
|
|
1164
|
+
function getSystemIcon(objects, id, level, themeType, lang, imagePrefix) {
|
|
1151
1165
|
let icon;
|
|
1152
1166
|
// system or design has special icons
|
|
1153
1167
|
if (id === 'alias' || id === 'alias.0') {
|
|
1154
|
-
icon = react_1.default.createElement(icons_material_1.Link, { className: "iconOwn", style: { color: COLOR_NAME_ALIAS(themeType) } });
|
|
1168
|
+
icon = (react_1.default.createElement(icons_material_1.Link, { className: "iconOwn", style: { color: COLOR_NAME_ALIAS(themeType) } }));
|
|
1155
1169
|
}
|
|
1156
1170
|
else if (id === '0_userdata' || id === '0_userdata.0') {
|
|
1157
|
-
icon = react_1.default.createElement(icons_material_1.DataObject, { className: "iconOwn", style: { color: COLOR_NAME_USERDATA(themeType) } });
|
|
1171
|
+
icon = (react_1.default.createElement(icons_material_1.DataObject, { className: "iconOwn", style: { color: COLOR_NAME_USERDATA(themeType) } }));
|
|
1158
1172
|
}
|
|
1159
1173
|
else if (id.startsWith('_design/') || id === 'system') {
|
|
1160
|
-
icon = react_1.default.createElement(icons_material_1.SettingsApplications, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM(themeType) } });
|
|
1174
|
+
icon = (react_1.default.createElement(icons_material_1.SettingsApplications, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM(themeType) } }));
|
|
1161
1175
|
}
|
|
1162
1176
|
else if (id === 'system.adapter') {
|
|
1163
|
-
icon = react_1.default.createElement(icons_material_1.SettingsApplications, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM_ADAPTER(themeType) } });
|
|
1177
|
+
icon = (react_1.default.createElement(icons_material_1.SettingsApplications, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM_ADAPTER(themeType) } }));
|
|
1164
1178
|
}
|
|
1165
1179
|
else if (id === 'system.group') {
|
|
1166
1180
|
icon = react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "iconOwn" });
|
|
@@ -1183,7 +1197,7 @@ function getSystemIcon(objects, id, level, themeType, imagePrefix) {
|
|
|
1183
1197
|
else if (level < 2) {
|
|
1184
1198
|
// detect "cloud.0"
|
|
1185
1199
|
if (objects[`system.adapter.${id}`]) {
|
|
1186
|
-
icon = getSelectIdIconFromObjects(objects, `system.adapter.${id}`, imagePrefix);
|
|
1200
|
+
icon = getSelectIdIconFromObjects(objects, `system.adapter.${id}`, lang, imagePrefix);
|
|
1187
1201
|
}
|
|
1188
1202
|
}
|
|
1189
1203
|
return icon || null;
|
|
@@ -1198,7 +1212,7 @@ function getObjectTooltip(data, lang) {
|
|
|
1198
1212
|
function getIdFieldTooltip(data, lang) {
|
|
1199
1213
|
const tooltip = getObjectTooltip(data, lang);
|
|
1200
1214
|
if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.startsWith('http')) {
|
|
1201
|
-
return react_1.default.createElement(material_1.Box, { component: "a", sx: styles.cellIdTooltipLink, href: tooltip, target: "_blank", rel: "noreferrer" }, tooltip);
|
|
1215
|
+
return (react_1.default.createElement(material_1.Box, { component: "a", sx: styles.cellIdTooltipLink, href: tooltip, target: "_blank", rel: "noreferrer" }, tooltip));
|
|
1202
1216
|
}
|
|
1203
1217
|
return react_1.default.createElement("span", { style: styles.cellIdTooltip }, tooltip || data.id || '');
|
|
1204
1218
|
}
|
|
@@ -1330,7 +1344,7 @@ function buildTree(objects, options) {
|
|
|
1330
1344
|
id: curPath,
|
|
1331
1345
|
obj: objects[curPath],
|
|
1332
1346
|
level: k,
|
|
1333
|
-
icon: getSystemIcon(objects, curPath, k, options.themeType, imagePrefix),
|
|
1347
|
+
icon: getSystemIcon(objects, curPath, k, options.themeType, options.lang, imagePrefix),
|
|
1334
1348
|
generated: true,
|
|
1335
1349
|
},
|
|
1336
1350
|
};
|
|
@@ -1350,8 +1364,8 @@ function buildTree(objects, options) {
|
|
|
1350
1364
|
title: getName((_d = obj === null || obj === void 0 ? void 0 : obj.common) === null || _d === void 0 ? void 0 : _d.name, options.lang),
|
|
1351
1365
|
obj,
|
|
1352
1366
|
parent: cRoot,
|
|
1353
|
-
icon: getSelectIdIconFromObjects(objects, id, imagePrefix) ||
|
|
1354
|
-
getSystemIcon(objects, id, 0, options.themeType, imagePrefix),
|
|
1367
|
+
icon: getSelectIdIconFromObjects(objects, id, options.lang, imagePrefix) ||
|
|
1368
|
+
getSystemIcon(objects, id, 0, options.themeType, options.lang, imagePrefix),
|
|
1355
1369
|
id,
|
|
1356
1370
|
hasCustoms: !!(((_e = obj.common) === null || _e === void 0 ? void 0 : _e.custom) && Object.keys(obj.common.custom).length),
|
|
1357
1371
|
level: parts.length - 1,
|
|
@@ -1361,8 +1375,10 @@ function buildTree(objects, options) {
|
|
|
1361
1375
|
typeof obj.common.role === 'string' &&
|
|
1362
1376
|
obj.common.role.startsWith('button') &&
|
|
1363
1377
|
((_g = obj.common) === null || _g === void 0 ? void 0 : _g.write) !== false,
|
|
1364
|
-
switch: obj.type === 'state' &&
|
|
1365
|
-
((
|
|
1378
|
+
switch: obj.type === 'state' &&
|
|
1379
|
+
((_h = obj.common) === null || _h === void 0 ? void 0 : _h.type) === 'boolean' &&
|
|
1380
|
+
((_j = obj.common) === null || _j === void 0 ? void 0 : _j.write) !== false &&
|
|
1381
|
+
((_k = obj.common) === null || _k === void 0 ? void 0 : _k.read) !== false,
|
|
1366
1382
|
},
|
|
1367
1383
|
};
|
|
1368
1384
|
cRoot.children = cRoot.children || [];
|
|
@@ -1550,7 +1566,7 @@ function quality2text(q) {
|
|
|
1550
1566
|
* Format a state value for visualization
|
|
1551
1567
|
*/
|
|
1552
1568
|
function formatValue(options) {
|
|
1553
|
-
const { dateFormat, state, isFloatComma, texts, obj
|
|
1569
|
+
const { dateFormat, state, isFloatComma, texts, obj } = options;
|
|
1554
1570
|
const states = Utils_1.default.getStates(obj);
|
|
1555
1571
|
const isCommon = obj.common;
|
|
1556
1572
|
let fileViewer;
|
|
@@ -1711,21 +1727,21 @@ function prepareSparkData(values, from) {
|
|
|
1711
1727
|
return v;
|
|
1712
1728
|
}
|
|
1713
1729
|
exports.ITEM_IMAGES = {
|
|
1714
|
-
state: react_1.default.createElement(IconState_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1715
|
-
channel: react_1.default.createElement(IconChannel_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1716
|
-
device: react_1.default.createElement(IconDevice_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1717
|
-
adapter: react_1.default.createElement(IconAdapter_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1718
|
-
meta: react_1.default.createElement(icons_material_1.Description, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1719
|
-
instance: react_1.default.createElement(IconInstance_1.default, { className: "itemIcon", style: { color: '#7da7ff', verticalAlign: 'middle' } }),
|
|
1720
|
-
enum: react_1.default.createElement(icons_material_1.ListAlt, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1721
|
-
chart: react_1.default.createElement(icons_material_1.ShowChart, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1722
|
-
config: react_1.default.createElement(icons_material_1.Settings, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1723
|
-
group: react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1724
|
-
user: react_1.default.createElement(icons_material_1.PersonOutlined, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1725
|
-
host: react_1.default.createElement(icons_material_1.Router, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1726
|
-
schedule: react_1.default.createElement(icons_material_1.CalendarToday, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1727
|
-
script: react_1.default.createElement(icons_material_1.Code, { className: "itemIcon", style: { verticalAlign: 'middle' } }),
|
|
1728
|
-
folder: react_1.default.createElement(IconClosed_1.default, { className: "itemIcon itemIconFolder", style: { verticalAlign: 'middle' } }),
|
|
1730
|
+
state: (react_1.default.createElement(IconState_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1731
|
+
channel: (react_1.default.createElement(IconChannel_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1732
|
+
device: (react_1.default.createElement(IconDevice_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1733
|
+
adapter: (react_1.default.createElement(IconAdapter_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1734
|
+
meta: (react_1.default.createElement(icons_material_1.Description, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1735
|
+
instance: (react_1.default.createElement(IconInstance_1.default, { className: "itemIcon", style: { color: '#7da7ff', verticalAlign: 'middle' } })),
|
|
1736
|
+
enum: (react_1.default.createElement(icons_material_1.ListAlt, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1737
|
+
chart: (react_1.default.createElement(icons_material_1.ShowChart, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1738
|
+
config: (react_1.default.createElement(icons_material_1.Settings, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1739
|
+
group: (react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1740
|
+
user: (react_1.default.createElement(icons_material_1.PersonOutlined, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1741
|
+
host: (react_1.default.createElement(icons_material_1.Router, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1742
|
+
schedule: (react_1.default.createElement(icons_material_1.CalendarToday, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1743
|
+
script: (react_1.default.createElement(icons_material_1.Code, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
|
|
1744
|
+
folder: (react_1.default.createElement(IconClosed_1.default, { className: "itemIcon itemIconFolder", style: { verticalAlign: 'middle' } })),
|
|
1729
1745
|
};
|
|
1730
1746
|
const SCREEN_WIDTHS = {
|
|
1731
1747
|
// extra-small: 0px
|
|
@@ -1820,6 +1836,19 @@ const DEFAULT_FILTER = {
|
|
|
1820
1836
|
class ObjectBrowserClass extends react_1.Component {
|
|
1821
1837
|
constructor(props) {
|
|
1822
1838
|
super(props);
|
|
1839
|
+
// do not define the type as null to save the performance, so we must check it every time
|
|
1840
|
+
this.info = {
|
|
1841
|
+
funcEnums: [],
|
|
1842
|
+
roomEnums: [],
|
|
1843
|
+
roles: [],
|
|
1844
|
+
ids: [],
|
|
1845
|
+
types: [],
|
|
1846
|
+
objects: {},
|
|
1847
|
+
customs: [],
|
|
1848
|
+
enums: [],
|
|
1849
|
+
hasSomeCustoms: false,
|
|
1850
|
+
aliasesMap: {},
|
|
1851
|
+
};
|
|
1823
1852
|
this.localStorage = window._localStorage || window.localStorage;
|
|
1824
1853
|
this.lastAppliedFilter = null;
|
|
1825
1854
|
this.pausedSubscribes = false;
|
|
@@ -1853,6 +1882,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
1853
1882
|
this.resizerNextDiv = null;
|
|
1854
1883
|
this.storedWidths = null;
|
|
1855
1884
|
this.defaultHistory = '';
|
|
1885
|
+
this.columnsVisibility = {};
|
|
1856
1886
|
this.changedIds = null;
|
|
1857
1887
|
this.contextMenu = null;
|
|
1858
1888
|
this.recordStates = [];
|
|
@@ -1979,15 +2009,17 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
1979
2009
|
// if enum does not exist
|
|
1980
2010
|
if (!oldObj) {
|
|
1981
2011
|
// create a new one
|
|
1982
|
-
oldObj =
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2012
|
+
oldObj =
|
|
2013
|
+
newObj ||
|
|
2014
|
+
{
|
|
2015
|
+
_id: id,
|
|
2016
|
+
common: {
|
|
2017
|
+
name: id.split('.').pop(),
|
|
2018
|
+
members: [],
|
|
2019
|
+
},
|
|
2020
|
+
native: {},
|
|
2021
|
+
type: 'enum',
|
|
2022
|
+
};
|
|
1991
2023
|
oldObj.common = oldObj.common || {};
|
|
1992
2024
|
oldObj.common.members = [objId];
|
|
1993
2025
|
oldObj.type = 'enum';
|
|
@@ -2121,14 +2153,11 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2121
2153
|
const funcRenderStateObject = (value) => {
|
|
2122
2154
|
const rights = acl[value];
|
|
2123
2155
|
check.forEach((el, i) => {
|
|
2124
|
-
// eslint-disable-next-line no-bitwise
|
|
2125
2156
|
if (rights & el.valueNum) {
|
|
2126
2157
|
arrayTooltipText.push(react_1.default.createElement("span", { key: value + i },
|
|
2127
2158
|
this.texts[`acl${el.group}_${el.title}_${value}`],
|
|
2128
2159
|
",",
|
|
2129
|
-
react_1.default.createElement("span", { style: value === 'object'
|
|
2130
|
-
? styles.rightsObject
|
|
2131
|
-
: styles.rightsState }, el.value)));
|
|
2160
|
+
react_1.default.createElement("span", { style: value === 'object' ? styles.rightsObject : styles.rightsState }, el.value)));
|
|
2132
2161
|
}
|
|
2133
2162
|
});
|
|
2134
2163
|
};
|
|
@@ -2138,7 +2167,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2138
2167
|
if (acl.state) {
|
|
2139
2168
|
funcRenderStateObject('state');
|
|
2140
2169
|
}
|
|
2141
|
-
return arrayTooltipText.length ? react_1.default.createElement("span", { style: styles.tooltipAccessControl }, arrayTooltipText.map(el => el)) : null;
|
|
2170
|
+
return arrayTooltipText.length ? (react_1.default.createElement("span", { style: styles.tooltipAccessControl }, arrayTooltipText.map(el => el))) : null;
|
|
2142
2171
|
};
|
|
2143
2172
|
this.resizerMouseMove = (e) => {
|
|
2144
2173
|
if (this.resizerActiveDiv) {
|
|
@@ -2152,7 +2181,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2152
2181
|
width = this.resizerOldWidth + e.clientX - this.resizerPosition;
|
|
2153
2182
|
widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;
|
|
2154
2183
|
}
|
|
2155
|
-
if (this.resizerActiveName &&
|
|
2184
|
+
if (this.resizerActiveName &&
|
|
2185
|
+
this.resizerNextName &&
|
|
2156
2186
|
(!this.resizerMin || width > this.resizerMin) &&
|
|
2157
2187
|
(!this.resizerNextMin || widthNext > this.resizerNextMin)) {
|
|
2158
2188
|
this.resizerCurrentWidths[this.resizerActiveName] = width;
|
|
@@ -2192,7 +2222,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2192
2222
|
window.removeEventListener('mouseup', this.resizerMouseUp);
|
|
2193
2223
|
};
|
|
2194
2224
|
this.resizerMouseDown = (e) => {
|
|
2195
|
-
this.storedWidths =
|
|
2225
|
+
this.storedWidths =
|
|
2226
|
+
this.storedWidths ||
|
|
2227
|
+
JSON.parse(JSON.stringify(SCREEN_WIDTHS[this.props.width || 'lg']));
|
|
2196
2228
|
this.resizerCurrentWidths = this.resizerCurrentWidths || {};
|
|
2197
2229
|
this.resizerActiveDiv = e.target.parentNode;
|
|
2198
2230
|
this.resizerActiveName = this.resizerActiveDiv.dataset.name || null;
|
|
@@ -2241,6 +2273,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2241
2273
|
this.forceUpdate();
|
|
2242
2274
|
};
|
|
2243
2275
|
const lastSelectedItemStr = this.localStorage.getItem(`${props.dialogName || 'App'}.objectSelected`) || '';
|
|
2276
|
+
this.selectFirst = '';
|
|
2244
2277
|
if (lastSelectedItemStr.startsWith('[')) {
|
|
2245
2278
|
try {
|
|
2246
2279
|
const lastSelectedItems = JSON.parse(lastSelectedItemStr);
|
|
@@ -2282,7 +2315,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2282
2315
|
filter.expertMode =
|
|
2283
2316
|
props.expertMode !== undefined
|
|
2284
2317
|
? props.expertMode
|
|
2285
|
-
: (window._sessionStorage || window.sessionStorage).getItem('App.expertMode') ===
|
|
2318
|
+
: (window._sessionStorage || window.sessionStorage).getItem('App.expertMode') ===
|
|
2319
|
+
'true';
|
|
2286
2320
|
this.tableRef = (0, react_1.createRef)();
|
|
2287
2321
|
this.filterRefs = {};
|
|
2288
2322
|
Object.keys(DEFAULT_FILTER).forEach(name => (this.filterRefs[name] = (0, react_1.createRef)()));
|
|
@@ -2460,8 +2494,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2460
2494
|
SCREEN_WIDTHS[width].widths.name = resizerCurrentWidths[id];
|
|
2461
2495
|
}
|
|
2462
2496
|
else if (SCREEN_WIDTHS[width].widths[id] !== undefined) {
|
|
2463
|
-
SCREEN_WIDTHS[width].widths[id] =
|
|
2464
|
-
resizerCurrentWidths[id];
|
|
2497
|
+
SCREEN_WIDTHS[width].widths[id] = resizerCurrentWidths[id];
|
|
2465
2498
|
}
|
|
2466
2499
|
});
|
|
2467
2500
|
this.customWidth = true;
|
|
@@ -2653,7 +2686,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2653
2686
|
this.selectFirst = '';
|
|
2654
2687
|
}
|
|
2655
2688
|
if (this.state.selected.length === 1 && this.objects[this.state.selected[0]]) {
|
|
2656
|
-
const name = Utils_1.default.getObjectName(this.objects, this.state.selected[0], null, {
|
|
2689
|
+
const name = Utils_1.default.getObjectName(this.objects, this.state.selected[0], null, {
|
|
2690
|
+
language: this.props.lang,
|
|
2691
|
+
});
|
|
2657
2692
|
if (this.props.onSelect) {
|
|
2658
2693
|
this.props.onSelect(this.state.selected, name, isDouble);
|
|
2659
2694
|
}
|
|
@@ -2706,7 +2741,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2706
2741
|
this.props.objectsWorker.unregisterHandler(this.onObjectChangeFromWorker, true);
|
|
2707
2742
|
}
|
|
2708
2743
|
else {
|
|
2709
|
-
this.props.socket
|
|
2744
|
+
void this.props.socket
|
|
2745
|
+
.unsubscribeObject('*', this.onObjectChange)
|
|
2746
|
+
.catch(e => console.error(`Cannot unsubscribe *: ${e}`));
|
|
2710
2747
|
}
|
|
2711
2748
|
// remove all subscribes
|
|
2712
2749
|
this.subscribes.forEach(pattern => {
|
|
@@ -2749,18 +2786,20 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2749
2786
|
this.props.socket.unsubscribeState(pattern, this.onStateChange);
|
|
2750
2787
|
});
|
|
2751
2788
|
this.subscribes = [];
|
|
2752
|
-
this.loadAllObjects(true)
|
|
2789
|
+
this.loadAllObjects(true)
|
|
2790
|
+
.then(() => console.log('updated!'))
|
|
2791
|
+
.catch(e => this.showError(e));
|
|
2753
2792
|
}
|
|
2754
2793
|
/**
|
|
2755
2794
|
* Renders the error dialog.
|
|
2756
2795
|
*/
|
|
2757
2796
|
renderErrorDialog() {
|
|
2758
|
-
return this.state.error ? react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "sm", fullWidth: true, onClose: () => this.setState({ error: '' }), "aria-labelledby": "error-dialog-title", "aria-describedby": "error-dialog-description" },
|
|
2797
|
+
return this.state.error ? (react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "sm", fullWidth: true, onClose: () => this.setState({ error: '' }), "aria-labelledby": "error-dialog-title", "aria-describedby": "error-dialog-description" },
|
|
2759
2798
|
react_1.default.createElement(material_1.DialogTitle, { id: "alert-dialog-title" }, this.props.t('ra_Error')),
|
|
2760
2799
|
react_1.default.createElement(material_1.DialogContent, null,
|
|
2761
2800
|
react_1.default.createElement(material_1.DialogContentText, { id: "alert-dialog-description" }, this.state.error)),
|
|
2762
2801
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
2763
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.setState({ error: '' }), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.t('ra_Ok')))) : null;
|
|
2802
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.setState({ error: '' }), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.t('ra_Ok'))))) : null;
|
|
2764
2803
|
}
|
|
2765
2804
|
/**
|
|
2766
2805
|
* Show the error dialog.
|
|
@@ -2835,11 +2874,10 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2835
2874
|
}
|
|
2836
2875
|
}
|
|
2837
2876
|
return cols
|
|
2838
|
-
.filter(id => (isLast && (id === 'val' || id === 'buttons')) ||
|
|
2839
|
-
(!isLast && id !== 'val' && id !== 'buttons'))
|
|
2877
|
+
.filter(id => (isLast && (id === 'val' || id === 'buttons')) || (!isLast && id !== 'val' && id !== 'buttons'))
|
|
2840
2878
|
.map(id => {
|
|
2841
2879
|
var _b;
|
|
2842
|
-
return react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
|
|
2880
|
+
return (react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
|
|
2843
2881
|
if (!this.state.columnsAuto && id !== 'id') {
|
|
2844
2882
|
const columns = [...(this.state.columns || [])];
|
|
2845
2883
|
const pos = columns.indexOf(id);
|
|
@@ -2859,7 +2897,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2859
2897
|
!!(this.state.columnsAuto
|
|
2860
2898
|
? this.visibleCols.includes(id)
|
|
2861
2899
|
: (_b = this.state.columns) === null || _b === void 0 ? void 0 : _b.includes(id)), disableRipple: true }),
|
|
2862
|
-
react_1.default.createElement(material_1.ListItemText, { primary: this.texts[`filter_${id}`] || this.props.t(`ra_${id}`) }));
|
|
2900
|
+
react_1.default.createElement(material_1.ListItemText, { primary: this.texts[`filter_${id}`] || this.props.t(`ra_${id}`) })));
|
|
2863
2901
|
});
|
|
2864
2902
|
}
|
|
2865
2903
|
/**
|
|
@@ -2869,7 +2907,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2869
2907
|
if (!this.state.columnsSelectorShow) {
|
|
2870
2908
|
return null;
|
|
2871
2909
|
}
|
|
2872
|
-
return react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsSelectorShow: false }), open: !0, sx: {
|
|
2910
|
+
return (react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsSelectorShow: false }), open: !0, sx: {
|
|
2873
2911
|
'& .MuiPaper-root': Utils_1.default.getStyle(this.props.theme, styles.dialogColumns, styles[`transparent_${this.state.columnsDialogTransparent}`]),
|
|
2874
2912
|
} },
|
|
2875
2913
|
react_1.default.createElement(material_1.DialogTitle, { sx: styles.fontSizeTitle }, this.props.t('ra_Configure')),
|
|
@@ -2899,40 +2937,41 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2899
2937
|
} }), label: this.props.t('ra_Auto (no custom columns)') }),
|
|
2900
2938
|
react_1.default.createElement(material_1.List, null,
|
|
2901
2939
|
this._renderDefinedList(false),
|
|
2902
|
-
this.state.columnsForAdmin &&
|
|
2903
|
-
.
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2940
|
+
this.state.columnsForAdmin &&
|
|
2941
|
+
Object.keys(this.state.columnsForAdmin)
|
|
2942
|
+
.sort()
|
|
2943
|
+
.map(adapter => this.state.columnsForAdmin &&
|
|
2944
|
+
this.state.columnsForAdmin[adapter].map(column => {
|
|
2945
|
+
var _b;
|
|
2946
|
+
return (react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
|
|
2947
|
+
if (!this.state.columnsAuto) {
|
|
2948
|
+
const columns = [...(this.state.columns || [])];
|
|
2949
|
+
const id = `_${adapter}_${column.path}`;
|
|
2950
|
+
const pos = columns.indexOf(id);
|
|
2951
|
+
if (pos === -1) {
|
|
2952
|
+
columns.push(id);
|
|
2953
|
+
columns.sort();
|
|
2954
|
+
}
|
|
2955
|
+
else {
|
|
2956
|
+
columns.splice(pos, 1);
|
|
2957
|
+
}
|
|
2958
|
+
this.calculateColumnsVisibility(null, columns);
|
|
2959
|
+
this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
|
|
2960
|
+
this.setState({ columns });
|
|
2961
|
+
}
|
|
2962
|
+
}, key: `${adapter}_${column.name}` },
|
|
2963
|
+
react_1.default.createElement(material_1.ListItemIcon, null,
|
|
2964
|
+
react_1.default.createElement(material_1.Checkbox, { disabled: this.state.columnsAuto, edge: "start", checked: !this.state.columnsAuto &&
|
|
2965
|
+
((_b = this.state.columns) === null || _b === void 0 ? void 0 : _b.includes(`_${adapter}_${column.path}`)), disableRipple: true })),
|
|
2966
|
+
react_1.default.createElement(material_1.ListItemText, { primary: `${column.name} (${adapter})` })));
|
|
2967
|
+
})),
|
|
2928
2968
|
this._renderDefinedList(true))),
|
|
2929
2969
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
2930
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.setState({ columnsSelectorShow: false }), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.texts.close)));
|
|
2970
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.setState({ columnsSelectorShow: false }), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.texts.close))));
|
|
2931
2971
|
}
|
|
2932
2972
|
async getAdditionalColumns() {
|
|
2933
2973
|
try {
|
|
2934
|
-
const instances = await this.props.socket
|
|
2935
|
-
.getAdapters();
|
|
2974
|
+
const instances = await this.props.socket.getAdapters();
|
|
2936
2975
|
let columnsForAdmin = null;
|
|
2937
2976
|
// find all additional columns
|
|
2938
2977
|
instances.forEach(obj => (columnsForAdmin = this.parseObjectForAdmins(columnsForAdmin, obj)));
|
|
@@ -3031,7 +3070,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3031
3070
|
}
|
|
3032
3071
|
if (cColumns && cColumns.length) {
|
|
3033
3072
|
columnsForAdmin = columnsForAdmin || {};
|
|
3034
|
-
columnsForAdmin[obj.common.name] = cColumns.sort((a, b) =>
|
|
3073
|
+
columnsForAdmin[obj.common.name] = cColumns.sort((a, b) => a.path > b.path ? -1 : a.path < b.path ? 1 : 0);
|
|
3035
3074
|
}
|
|
3036
3075
|
}
|
|
3037
3076
|
else if (obj.common && obj.common.name && columnsForAdmin && columnsForAdmin[obj.common.name]) {
|
|
@@ -3067,8 +3106,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3067
3106
|
return;
|
|
3068
3107
|
}
|
|
3069
3108
|
// Rebuild aliases map
|
|
3070
|
-
const aliasesIds = Object.keys(this.objects)
|
|
3071
|
-
.filter(id => id.startsWith('alias.0'));
|
|
3109
|
+
const aliasesIds = Object.keys(this.objects).filter(id => id.startsWith('alias.0'));
|
|
3072
3110
|
this.info.aliasesMap = {};
|
|
3073
3111
|
for (const id of aliasesIds) {
|
|
3074
3112
|
const obj = this.objects[id];
|
|
@@ -3107,13 +3145,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3107
3145
|
}
|
|
3108
3146
|
/**
|
|
3109
3147
|
* Processes a single element in regard to certain filters, columns for admin and updates object dict
|
|
3148
|
+
*
|
|
3149
|
+
* @param id The id of the object
|
|
3150
|
+
* @param obj The object itself
|
|
3110
3151
|
* @returns Returns an object containing the new state (if any) and whether the object was filtered.
|
|
3111
3152
|
*/
|
|
3112
|
-
processOnObjectChangeElement(
|
|
3113
|
-
/** The id of the object */
|
|
3114
|
-
id,
|
|
3115
|
-
/** The object itself */
|
|
3116
|
-
obj) {
|
|
3153
|
+
processOnObjectChangeElement(id, obj) {
|
|
3117
3154
|
console.log(`> objectChange ${id}`);
|
|
3118
3155
|
const type = obj === null || obj === void 0 ? void 0 : obj.type;
|
|
3119
3156
|
// If the object is filtered out, we don't need to update the React state
|
|
@@ -3150,7 +3187,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3150
3187
|
this.subscribes.push(id);
|
|
3151
3188
|
console.log(`+ subscribe ${id}`);
|
|
3152
3189
|
if (!this.pausedSubscribes) {
|
|
3153
|
-
this.props.socket
|
|
3190
|
+
this.props.socket
|
|
3191
|
+
.subscribeState(id, this.onStateChange)
|
|
3192
|
+
.catch(e => console.error(`Cannot subscribe on state ${id}: ${e}`));
|
|
3154
3193
|
}
|
|
3155
3194
|
}
|
|
3156
3195
|
}
|
|
@@ -3224,13 +3263,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3224
3263
|
}
|
|
3225
3264
|
}
|
|
3226
3265
|
isFilterEmpty() {
|
|
3227
|
-
const someNotEmpty = Object.keys(this.state.filter)
|
|
3228
|
-
.find(attr => attr !== 'expertMode' && this.state.filter[attr]);
|
|
3266
|
+
const someNotEmpty = Object.keys(this.state.filter).find(attr => attr !== 'expertMode' && this.state.filter[attr]);
|
|
3229
3267
|
return !someNotEmpty;
|
|
3230
3268
|
}
|
|
3231
3269
|
getFilterInput(filterName) {
|
|
3232
3270
|
var _b, _c, _d;
|
|
3233
|
-
return react_1.default.createElement(material_1.FormControl, { sx: this.styles.filterInput, key: `${filterName}_${this.state.filterKey}`,
|
|
3271
|
+
return (react_1.default.createElement(material_1.FormControl, { sx: this.styles.filterInput, key: `${filterName}_${this.state.filterKey}`,
|
|
3234
3272
|
// style={{ marginTop: 0, marginBottom: 0 }}
|
|
3235
3273
|
margin: "dense" },
|
|
3236
3274
|
react_1.default.createElement(material_1.Input, { ref: this.filterRefs[filterName], classes: { underline: 'no-underline' }, id: filterName, placeholder: this.texts[`filter_${filterName}`], defaultValue: this.state.filter[filterName] || '', onChange: () => {
|
|
@@ -3239,7 +3277,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3239
3277
|
}
|
|
3240
3278
|
this.filterTimer = setTimeout(() => this.onFilter(), 400);
|
|
3241
3279
|
}, autoComplete: "off" }),
|
|
3242
|
-
((_d = (_c = (_b = this.filterRefs[filterName]) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.firstChild) === null || _d === void 0 ? void 0 : _d.value) ? react_1.default.createElement("div", { style: {
|
|
3280
|
+
((_d = (_c = (_b = this.filterRefs[filterName]) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.firstChild) === null || _d === void 0 ? void 0 : _d.value) ? (react_1.default.createElement("div", { style: {
|
|
3243
3281
|
position: 'absolute',
|
|
3244
3282
|
right: 0,
|
|
3245
3283
|
} },
|
|
@@ -3248,12 +3286,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3248
3286
|
((_b = this.filterRefs[filterName].current) === null || _b === void 0 ? void 0 : _b.firstChild).value = '';
|
|
3249
3287
|
this.onFilter(filterName, '');
|
|
3250
3288
|
} },
|
|
3251
|
-
react_1.default.createElement(icons_material_1.Close, null))) : null);
|
|
3289
|
+
react_1.default.createElement(icons_material_1.Close, null)))) : null));
|
|
3252
3290
|
}
|
|
3253
3291
|
getFilterSelect(name, values) {
|
|
3254
3292
|
var _b, _c, _d;
|
|
3255
3293
|
const hasIcons = !!(values === null || values === void 0 ? void 0 : values.find(item => item.icon));
|
|
3256
|
-
return react_1.default.createElement("div", { style: { position: 'relative' } },
|
|
3294
|
+
return (react_1.default.createElement("div", { style: { position: 'relative' } },
|
|
3257
3295
|
react_1.default.createElement(material_1.Select, { variant: "standard", key: `${name}_${this.state.filterKey}`, ref: this.filterRefs[name], sx: styles.headerCellInput, className: "no-underline", onChange: () => {
|
|
3258
3296
|
if (this.filterTimer) {
|
|
3259
3297
|
clearTimeout(this.filterTimer);
|
|
@@ -3275,11 +3313,11 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3275
3313
|
id = item;
|
|
3276
3314
|
_name = item;
|
|
3277
3315
|
}
|
|
3278
|
-
return react_1.default.createElement(material_1.MenuItem, { sx: styles.headerCellSelectItem, key: id, value: id },
|
|
3316
|
+
return (react_1.default.createElement(material_1.MenuItem, { sx: styles.headerCellSelectItem, key: id, value: id },
|
|
3279
3317
|
icon || (hasIcons ? react_1.default.createElement("div", { className: "itemIcon" }) : null),
|
|
3280
|
-
_name);
|
|
3318
|
+
_name));
|
|
3281
3319
|
})),
|
|
3282
|
-
((_d = (_c = (_b = this.filterRefs[name]) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.childNodes[1]) === null || _d === void 0 ? void 0 : _d.value) ? react_1.default.createElement(material_1.Box, { component: "div", sx: styles.selectClearButton },
|
|
3320
|
+
((_d = (_c = (_b = this.filterRefs[name]) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.childNodes[1]) === null || _d === void 0 ? void 0 : _d.value) ? (react_1.default.createElement(material_1.Box, { component: "div", sx: styles.selectClearButton },
|
|
3283
3321
|
react_1.default.createElement(material_1.IconButton, { size: "small", onClick: () => {
|
|
3284
3322
|
var _b;
|
|
3285
3323
|
const newFilter = Object.assign({}, this.state.filter);
|
|
@@ -3288,7 +3326,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3288
3326
|
this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectFilter`, JSON.stringify(newFilter));
|
|
3289
3327
|
this.setState({ filter: newFilter, filterKey: this.state.filterKey + 1 }, () => this.props.onFilterChanged && this.props.onFilterChanged(newFilter));
|
|
3290
3328
|
} },
|
|
3291
|
-
react_1.default.createElement(icons_material_1.Close, null))) : null);
|
|
3329
|
+
react_1.default.createElement(icons_material_1.Close, null)))) : null));
|
|
3292
3330
|
}
|
|
3293
3331
|
getFilterSelectRole() {
|
|
3294
3332
|
return this.getFilterSelect('role', this.info.roles);
|
|
@@ -3299,7 +3337,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3299
3337
|
return ({
|
|
3300
3338
|
name: getName((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name, this.props.lang) || id.split('.').pop(),
|
|
3301
3339
|
value: id,
|
|
3302
|
-
icon: react_1.default.createElement(Icon_1.default, { src: ((_e = (_d = this.objects[id]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.icon) || '', style: styles.selectIcon }),
|
|
3340
|
+
icon: (react_1.default.createElement(Icon_1.default, { src: ((_e = (_d = this.objects[id]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.icon) || '', style: styles.selectIcon })),
|
|
3303
3341
|
});
|
|
3304
3342
|
});
|
|
3305
3343
|
return this.getFilterSelect('room', rooms);
|
|
@@ -3310,7 +3348,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3310
3348
|
return ({
|
|
3311
3349
|
name: getName((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name, this.props.lang) || id.split('.').pop(),
|
|
3312
3350
|
value: id,
|
|
3313
|
-
icon: react_1.default.createElement(Icon_1.default, { src: ((_e = (_d = this.objects[id]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.icon) || '', style: styles.selectIcon }),
|
|
3351
|
+
icon: (react_1.default.createElement(Icon_1.default, { src: ((_e = (_d = this.objects[id]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.icon) || '', style: styles.selectIcon })),
|
|
3314
3352
|
});
|
|
3315
3353
|
});
|
|
3316
3354
|
return this.getFilterSelect('func', func);
|
|
@@ -3328,7 +3366,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3328
3366
|
const customs = this.info.customs.map(id => ({
|
|
3329
3367
|
name: id === '_' ? this.texts.filterCustomsWithout : id,
|
|
3330
3368
|
value: id,
|
|
3331
|
-
icon: id === '_' ? null : react_1.default.createElement(Icon_1.default, { src: getSelectIdIconFromObjects(this.objects, id, this.imagePrefix) || '', style: styles.selectIcon }),
|
|
3369
|
+
icon: id === '_' ? null : (react_1.default.createElement(Icon_1.default, { src: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix) || '', style: styles.selectIcon })),
|
|
3332
3370
|
}));
|
|
3333
3371
|
return this.getFilterSelect('custom', customs);
|
|
3334
3372
|
}
|
|
@@ -3525,10 +3563,10 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3525
3563
|
if (this.state.showExportDialog === false) {
|
|
3526
3564
|
return null;
|
|
3527
3565
|
}
|
|
3528
|
-
return react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "lg" },
|
|
3566
|
+
return (react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "lg" },
|
|
3529
3567
|
react_1.default.createElement(material_1.DialogTitle, null, this.props.t('ra_Select type of export')),
|
|
3530
3568
|
react_1.default.createElement(material_1.DialogContent, null,
|
|
3531
|
-
react_1.default.createElement(material_1.DialogContentText, null, this.state.filter.expertMode || this.state.showAllExportOptions ? react_1.default.createElement(react_1.default.Fragment, null,
|
|
3569
|
+
react_1.default.createElement(material_1.DialogContentText, null, this.state.filter.expertMode || this.state.showAllExportOptions ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
3532
3570
|
this.props.t('ra_You can export all objects or just the selected branch.'),
|
|
3533
3571
|
react_1.default.createElement("br", null),
|
|
3534
3572
|
this.props.t('ra_Selected %s object(s)', this.state.showExportDialog),
|
|
@@ -3539,9 +3577,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3539
3577
|
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.beautifyJsonExport, onChange: e => this.setState({ beautifyJsonExport: e.target.checked }) }), label: this.props.t('Beautify JSON output') }),
|
|
3540
3578
|
react_1.default.createElement("br", null),
|
|
3541
3579
|
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.excludeSystemRepositoriesFromExport, onChange: e => this.setState({ excludeSystemRepositoriesFromExport: e.target.checked }) }), label: this.props.t('Exclude system repositories from export JSON') }),
|
|
3542
|
-
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.excludeTranslations, onChange: e => this.setState({ excludeTranslations: e.target.checked }) }), label: this.props.t('Exclude translations (except english) from export JSON') })) : null)),
|
|
3580
|
+
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.excludeTranslations, onChange: e => this.setState({ excludeTranslations: e.target.checked }) }), label: this.props.t('Exclude translations (except english) from export JSON') }))) : null)),
|
|
3543
3581
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
3544
|
-
this.state.filter.expertMode || this.state.showAllExportOptions ? react_1.default.createElement(material_1.Button, { color: "grey", variant: "outlined", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
|
|
3582
|
+
this.state.filter.expertMode || this.state.showAllExportOptions ? (react_1.default.createElement(material_1.Button, { color: "grey", variant: "outlined", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
|
|
3545
3583
|
isAll: true,
|
|
3546
3584
|
noStatesByExportImport: this.state.noStatesByExportImport,
|
|
3547
3585
|
beautify: this.state.beautifyJsonExport,
|
|
@@ -3551,7 +3589,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3551
3589
|
react_1.default.createElement("span", { style: { marginRight: 8 } }, this.props.t('ra_All objects')),
|
|
3552
3590
|
"(",
|
|
3553
3591
|
Object.keys(this.objects).length,
|
|
3554
|
-
")") : react_1.default.createElement(material_1.Button, { color: "grey", variant: "outlined", startIcon: react_1.default.createElement(IconExpert_1.default, null), onClick: () => this.setState({ showAllExportOptions: true }) }, this.props.t('ra_Advanced options')),
|
|
3592
|
+
")")) : (react_1.default.createElement(material_1.Button, { color: "grey", variant: "outlined", startIcon: react_1.default.createElement(IconExpert_1.default, null), onClick: () => this.setState({ showAllExportOptions: true }) }, this.props.t('ra_Advanced options'))),
|
|
3555
3593
|
react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", autoFocus: true, onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
|
|
3556
3594
|
isAll: false,
|
|
3557
3595
|
noStatesByExportImport: this.state.noStatesByExportImport,
|
|
@@ -3563,7 +3601,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3563
3601
|
"(",
|
|
3564
3602
|
this.state.showExportDialog,
|
|
3565
3603
|
")"),
|
|
3566
|
-
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.t('ra_Cancel'))));
|
|
3604
|
+
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.t('ra_Cancel')))));
|
|
3567
3605
|
}
|
|
3568
3606
|
handleJsonUpload(evt) {
|
|
3569
3607
|
var _b;
|
|
@@ -3662,7 +3700,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3662
3700
|
allowObjectCreation = true;
|
|
3663
3701
|
}
|
|
3664
3702
|
}
|
|
3665
|
-
return react_1.default.createElement("div", { style: {
|
|
3703
|
+
return (react_1.default.createElement("div", { style: {
|
|
3666
3704
|
display: 'flex',
|
|
3667
3705
|
width: '100%',
|
|
3668
3706
|
alignItems: 'center',
|
|
@@ -3677,19 +3715,19 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3677
3715
|
react_1.default.createElement("div", null,
|
|
3678
3716
|
react_1.default.createElement(material_1.IconButton, { onClick: () => this.refreshComponent(), disabled: this.state.updating, size: "large" },
|
|
3679
3717
|
react_1.default.createElement(icons_material_1.Refresh, null)))),
|
|
3680
|
-
this.props.showExpertButton && !this.props.expertMode && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_expertMode'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3718
|
+
this.props.showExpertButton && !this.props.expertMode && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_expertMode'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3681
3719
|
react_1.default.createElement(material_1.IconButton, { key: "expertMode", color: this.state.filter.expertMode ? 'secondary' : 'default', onClick: () => this.onFilter('expertMode', !this.state.filter.expertMode), size: "large" },
|
|
3682
|
-
react_1.default.createElement(IconExpert_1.default, null))),
|
|
3683
|
-
!this.props.disableColumnSelector && this.props.width !== 'xs' && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Configure'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3720
|
+
react_1.default.createElement(IconExpert_1.default, null)))),
|
|
3721
|
+
!this.props.disableColumnSelector && this.props.width !== 'xs' && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Configure'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3684
3722
|
react_1.default.createElement(material_1.IconButton, { key: "columnSelector", color: this.state.columnsAuto ? 'primary' : 'default', onClick: () => this.setState({ columnsSelectorShow: true }), size: "large" },
|
|
3685
|
-
react_1.default.createElement(icons_material_1.ViewColumn, null))),
|
|
3686
|
-
this.props.width !== 'xs' && this.state.expandAllVisible && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Expand all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3723
|
+
react_1.default.createElement(icons_material_1.ViewColumn, null)))),
|
|
3724
|
+
this.props.width !== 'xs' && this.state.expandAllVisible && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Expand all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3687
3725
|
react_1.default.createElement(material_1.IconButton, { key: "expandAll", onClick: () => this.onExpandAll(), size: "large" },
|
|
3688
|
-
react_1.default.createElement(IconOpen_1.default, null))),
|
|
3726
|
+
react_1.default.createElement(IconOpen_1.default, null)))),
|
|
3689
3727
|
react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Collapse all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3690
3728
|
react_1.default.createElement(material_1.IconButton, { key: "collapseAll", onClick: () => this.onCollapseAll(), size: "large" },
|
|
3691
3729
|
react_1.default.createElement(IconClosed_1.default, null))),
|
|
3692
|
-
this.props.width !== 'xs' && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Expand one step node'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3730
|
+
this.props.width !== 'xs' && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Expand one step node'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3693
3731
|
react_1.default.createElement(material_1.IconButton, { key: "expandVisible", color: "primary", onClick: () => this.onExpandVisible(), size: "large" },
|
|
3694
3732
|
react_1.default.createElement(material_1.Badge, { badgeContent: this.state.depth, color: "secondary", sx: (theme) => ({
|
|
3695
3733
|
badge: {
|
|
@@ -3699,8 +3737,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3699
3737
|
padding: '0 4px',
|
|
3700
3738
|
},
|
|
3701
3739
|
}) },
|
|
3702
|
-
react_1.default.createElement(IconOpen_1.default, null)))),
|
|
3703
|
-
this.props.width !== 'xs' && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Collapse one step node'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3740
|
+
react_1.default.createElement(IconOpen_1.default, null))))),
|
|
3741
|
+
this.props.width !== 'xs' && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Collapse one step node'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3704
3742
|
react_1.default.createElement(material_1.IconButton, { key: "collapseVisible", color: "primary", onClick: () => this.onCollapseVisible(), size: "large" },
|
|
3705
3743
|
react_1.default.createElement(material_1.Badge, { sx: (theme) => ({
|
|
3706
3744
|
badge: {
|
|
@@ -3710,25 +3748,25 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3710
3748
|
padding: '0 4px',
|
|
3711
3749
|
},
|
|
3712
3750
|
}), badgeContent: this.state.depth, color: "secondary" },
|
|
3713
|
-
react_1.default.createElement(IconClosed_1.default, null)))),
|
|
3714
|
-
this.props.objectStatesView && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Toggle the states view'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3751
|
+
react_1.default.createElement(IconClosed_1.default, null))))),
|
|
3752
|
+
this.props.objectStatesView && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Toggle the states view'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3715
3753
|
react_1.default.createElement(material_1.IconButton, { onClick: () => this.onStatesViewVisible(), size: "large" },
|
|
3716
|
-
react_1.default.createElement(icons_material_1.LooksOne, { color: this.state.statesView ? 'primary' : 'inherit' }))),
|
|
3754
|
+
react_1.default.createElement(icons_material_1.LooksOne, { color: this.state.statesView ? 'primary' : 'inherit' })))),
|
|
3717
3755
|
react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Show/Hide object descriptions'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3718
3756
|
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
3719
3757
|
this.localStorage.setItem(`${this.props.dialogName || 'App'}.desc`, this.state.showDescription ? 'false' : 'true');
|
|
3720
3758
|
this.setState({ showDescription: !this.state.showDescription });
|
|
3721
3759
|
}, size: "large" },
|
|
3722
3760
|
react_1.default.createElement(icons_material_1.TextFields, { color: this.state.showDescription ? 'primary' : 'inherit' }))),
|
|
3723
|
-
this.props.objectAddBoolean ? react_1.default.createElement(material_1.Tooltip, { title: this.toolTipObjectCreating(), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3761
|
+
this.props.objectAddBoolean ? (react_1.default.createElement(material_1.Tooltip, { title: this.toolTipObjectCreating(), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3724
3762
|
react_1.default.createElement("div", null,
|
|
3725
3763
|
react_1.default.createElement(material_1.IconButton, { disabled: !allowObjectCreation, onClick: () => this.setState({
|
|
3726
3764
|
modalNewObj: {
|
|
3727
3765
|
id: this.state.selected[0] || this.state.selectedNonObject,
|
|
3728
3766
|
},
|
|
3729
3767
|
}), size: "large" },
|
|
3730
|
-
react_1.default.createElement(icons_material_1.Add, null)))) : null,
|
|
3731
|
-
this.props.objectImportExport && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Add objects tree from JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3768
|
+
react_1.default.createElement(icons_material_1.Add, null))))) : null,
|
|
3769
|
+
this.props.objectImportExport && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Add objects tree from JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3732
3770
|
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
3733
3771
|
const input = document.createElement('input');
|
|
3734
3772
|
input.setAttribute('type', 'file');
|
|
@@ -3737,14 +3775,13 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3737
3775
|
input.addEventListener('change', (e) => this.handleJsonUpload(e), false);
|
|
3738
3776
|
input.click();
|
|
3739
3777
|
}, size: "large" },
|
|
3740
|
-
react_1.default.createElement(icons_material_1.Publish, null))),
|
|
3778
|
+
react_1.default.createElement(icons_material_1.Publish, null)))),
|
|
3741
3779
|
this.props.objectImportExport &&
|
|
3742
|
-
(!!this.state.selected.length || this.state.selectedNonObject) &&
|
|
3743
|
-
react_1.default.createElement(material_1.
|
|
3744
|
-
react_1.default.createElement(
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
this.props.objectEditBoolean && react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Edit custom config'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3780
|
+
(!!this.state.selected.length || this.state.selectedNonObject) && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Save objects tree as JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3781
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => this.setState({ showExportDialog: this._getSelectedIdsForExport().length }), size: "large" },
|
|
3782
|
+
react_1.default.createElement(icons_material_1.Publish, { style: { transform: 'rotate(180deg)' } }))))),
|
|
3783
|
+
!!this.props.objectBrowserEditObject && this.props.width !== 'xs' && (react_1.default.createElement("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, `${this.props.t('ra_Objects')}: ${Object.keys(this.info.objects).length}, ${this.props.t('ra_States')}: ${Object.keys(this.info.objects).filter(el => this.info.objects[el].type === 'state').length}`)),
|
|
3784
|
+
this.props.objectEditBoolean && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Edit custom config'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
3748
3785
|
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
3749
3786
|
var _b;
|
|
3750
3787
|
// get all visible states
|
|
@@ -3761,7 +3798,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3761
3798
|
this.setState({ toast: this.props.t('ra_please select object') });
|
|
3762
3799
|
}
|
|
3763
3800
|
}, size: "large" },
|
|
3764
|
-
react_1.default.createElement(icons_material_1.Build, null))));
|
|
3801
|
+
react_1.default.createElement(icons_material_1.Build, null))))));
|
|
3765
3802
|
}
|
|
3766
3803
|
toggleExpanded(id) {
|
|
3767
3804
|
const expanded = JSON.parse(JSON.stringify(this.state.expanded));
|
|
@@ -3790,10 +3827,10 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3790
3827
|
renderColumnButtons(id, item) {
|
|
3791
3828
|
var _b, _c, _d;
|
|
3792
3829
|
if (!item.data.obj) {
|
|
3793
|
-
return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? react_1.default.createElement("div", { style: styles.buttonDiv },
|
|
3794
|
-
this.state.filter.expertMode && this.props.objectEditOfAccessControl ? react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonsEmptyButton), styles.cellButtonMinWidth), onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
|
|
3795
|
-
react_1.default.createElement("div", { style: { height: 15 } }, "---")) : null,
|
|
3796
|
-
this.props.onObjectDelete && item.children && item.children.length ? react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonsButtonAlone), size: "small", "aria-label": "delete", title: this.texts.deleteObject, onClick: () => {
|
|
3830
|
+
return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? (react_1.default.createElement("div", { style: styles.buttonDiv },
|
|
3831
|
+
this.state.filter.expertMode && this.props.objectEditOfAccessControl ? (react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonsEmptyButton), styles.cellButtonMinWidth), onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
|
|
3832
|
+
react_1.default.createElement("div", { style: { height: 15 } }, "---"))) : null,
|
|
3833
|
+
this.props.onObjectDelete && item.children && item.children.length ? (react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonsButtonAlone), size: "small", "aria-label": "delete", title: this.texts.deleteObject, onClick: () => {
|
|
3797
3834
|
var _b;
|
|
3798
3835
|
// calculate the number of children
|
|
3799
3836
|
const keys = Object.keys(this.objects);
|
|
@@ -3812,9 +3849,10 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3812
3849
|
this.props.onObjectDelete(id, !!((_b = item.children) === null || _b === void 0 ? void 0 : _b.length), false, count + 1);
|
|
3813
3850
|
}
|
|
3814
3851
|
} },
|
|
3815
|
-
react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon })) : null) : null;
|
|
3852
|
+
react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon }))) : null)) : null;
|
|
3816
3853
|
}
|
|
3817
|
-
item.data.aclTooltip =
|
|
3854
|
+
item.data.aclTooltip =
|
|
3855
|
+
item.data.aclTooltip || this.renderTooltipAccessControl(item.data.obj.acl);
|
|
3818
3856
|
const acl = item.data.obj.acl
|
|
3819
3857
|
? item.data.obj.type === 'state'
|
|
3820
3858
|
? item.data.obj.acl.state
|
|
@@ -3826,19 +3864,17 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3826
3864
|
: this.systemConfig.common.defaultNewAcl.object);
|
|
3827
3865
|
const showEdit = this.state.filter.expertMode || _a.isNonExpertId(item.data.id);
|
|
3828
3866
|
return [
|
|
3829
|
-
this.state.filter.expertMode && this.props.objectEditOfAccessControl ? react_1.default.createElement(material_1.Tooltip, { key: "acl", title: item.data.aclTooltip, slotProps: { popper: { sx: styles.tooltip } } },
|
|
3867
|
+
this.state.filter.expertMode && this.props.objectEditOfAccessControl ? (react_1.default.createElement(material_1.Tooltip, { key: "acl", title: item.data.aclTooltip, slotProps: { popper: { sx: styles.tooltip } } },
|
|
3830
3868
|
react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonMinWidth), { opacity: 1 }), onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
|
|
3831
3869
|
react_1.default.createElement("div", { style: styles.aclText }, Number.isNaN(Number(acl))
|
|
3832
3870
|
? Number(aclSystemConfig).toString(16)
|
|
3833
|
-
: Number(acl).toString(16)))) :
|
|
3834
|
-
|
|
3835
|
-
showEdit ? react_1.default.createElement(material_1.IconButton, { key: "edit", sx: Object.assign({ marginRight: '2px' }, styles.cellButtonsButton), size: "small", "aria-label": "edit", title: this.texts.editObject, onClick: () => {
|
|
3871
|
+
: Number(acl).toString(16))))) : (react_1.default.createElement("div", { key: "aclEmpty", style: styles.cellButtonMinWidth })),
|
|
3872
|
+
showEdit ? (react_1.default.createElement(material_1.IconButton, { key: "edit", sx: Object.assign({ marginRight: '2px' }, styles.cellButtonsButton), size: "small", "aria-label": "edit", title: this.texts.editObject, onClick: () => {
|
|
3836
3873
|
this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, id);
|
|
3837
3874
|
this.setState({ editObjectDialog: id, editObjectAlias: false });
|
|
3838
3875
|
} },
|
|
3839
|
-
react_1.default.createElement(icons_material_1.Edit, { style: styles.cellButtonsButtonIcon })) :
|
|
3840
|
-
|
|
3841
|
-
this.props.onObjectDelete && (((_b = item.children) === null || _b === void 0 ? void 0 : _b.length) || !((_c = item.data.obj.common) === null || _c === void 0 ? void 0 : _c.dontDelete)) ? react_1.default.createElement(material_1.IconButton, { key: "delete", sx: styles.cellButtonsButton, size: "small", "aria-label": "delete", onClick: () => {
|
|
3876
|
+
react_1.default.createElement(icons_material_1.Edit, { style: styles.cellButtonsButtonIcon }))) : (react_1.default.createElement(material_1.Box, { component: "div", key: "editDisabled", sx: styles.cellButtonsButton })),
|
|
3877
|
+
this.props.onObjectDelete && (((_b = item.children) === null || _b === void 0 ? void 0 : _b.length) || !((_c = item.data.obj.common) === null || _c === void 0 ? void 0 : _c.dontDelete)) ? (react_1.default.createElement(material_1.IconButton, { key: "delete", sx: styles.cellButtonsButton, size: "small", "aria-label": "delete", onClick: () => {
|
|
3842
3878
|
var _b, _c, _d;
|
|
3843
3879
|
const keys = Object.keys(this.objects);
|
|
3844
3880
|
keys.sort();
|
|
@@ -3856,12 +3892,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3856
3892
|
this.props.onObjectDelete(id, !!((_b = item.children) === null || _b === void 0 ? void 0 : _b.length), !((_d = (_c = item.data.obj) === null || _c === void 0 ? void 0 : _c.common) === null || _d === void 0 ? void 0 : _d.dontDelete), count);
|
|
3857
3893
|
}
|
|
3858
3894
|
}, title: this.texts.deleteObject },
|
|
3859
|
-
react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon })) : null,
|
|
3895
|
+
react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon }))) : null,
|
|
3860
3896
|
this.props.objectCustomDialog &&
|
|
3861
3897
|
this.info.hasSomeCustoms &&
|
|
3862
3898
|
item.data.obj.type === 'state' &&
|
|
3863
3899
|
// @ts-expect-error deprecated from js-controller 6
|
|
3864
|
-
((_d = item.data.obj.common) === null || _d === void 0 ? void 0 : _d.type) !== 'file' ? react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign({}, styles.cellButtonsButton), (item.data.hasCustoms
|
|
3900
|
+
((_d = item.data.obj.common) === null || _d === void 0 ? void 0 : _d.type) !== 'file' ? (react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign({}, styles.cellButtonsButton), (item.data.hasCustoms
|
|
3865
3901
|
? this.styles.cellButtonsButtonWithCustoms
|
|
3866
3902
|
: styles.cellButtonsButtonWithoutCustoms)), key: "custom", size: "small", "aria-label": "config", title: this.texts.customConfig, onClick: () => {
|
|
3867
3903
|
var _b;
|
|
@@ -3870,7 +3906,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3870
3906
|
(_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate(null, 'customs', id);
|
|
3871
3907
|
this.setState({ customDialog: [id], customDialogAll: false });
|
|
3872
3908
|
} },
|
|
3873
|
-
react_1.default.createElement(icons_material_1.Settings, { style: styles.cellButtonsButtonIcon })) : null,
|
|
3909
|
+
react_1.default.createElement(icons_material_1.Settings, { style: styles.cellButtonsButtonIcon }))) : null,
|
|
3874
3910
|
];
|
|
3875
3911
|
}
|
|
3876
3912
|
readHistory(id) {
|
|
@@ -3976,7 +4012,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
3976
4012
|
return null;
|
|
3977
4013
|
}
|
|
3978
4014
|
if (((_b = obj.common) === null || _b === void 0 ? void 0 : _b.type) === 'file') {
|
|
3979
|
-
return react_1.default.createElement(material_1.Box, { component: "div", sx: Object.assign(Object.assign({}, styles.cellValueText), styles.cellValueFile) }, "[file]");
|
|
4015
|
+
return (react_1.default.createElement(material_1.Box, { component: "div", sx: Object.assign(Object.assign({}, styles.cellValueText), styles.cellValueFile) }, "[file]"));
|
|
3980
4016
|
}
|
|
3981
4017
|
if (!this.states[id]) {
|
|
3982
4018
|
if (obj.type === 'state') {
|
|
@@ -4000,7 +4036,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4000
4036
|
obj: obj,
|
|
4001
4037
|
texts: this.texts,
|
|
4002
4038
|
dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat,
|
|
4003
|
-
isFloatComma: this.props.isFloatComma === undefined
|
|
4039
|
+
isFloatComma: this.props.isFloatComma === undefined
|
|
4040
|
+
? this.systemConfig.common.isFloatComma
|
|
4041
|
+
: this.props.isFloatComma,
|
|
4004
4042
|
});
|
|
4005
4043
|
const valTextRx = [];
|
|
4006
4044
|
item.data.state = { valTextRx };
|
|
@@ -4030,23 +4068,32 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4030
4068
|
let val = info.valTextRx;
|
|
4031
4069
|
if (!this.state.filter.expertMode) {
|
|
4032
4070
|
if (item.data.button) {
|
|
4033
|
-
val = [
|
|
4071
|
+
val = [
|
|
4072
|
+
react_1.default.createElement(ButtonIcon, { key: "button", style: Object.assign({ color: info.style.color }, styles.cellValueButton) }),
|
|
4073
|
+
];
|
|
4034
4074
|
}
|
|
4035
4075
|
else if (item.data.switch) {
|
|
4036
|
-
val = [
|
|
4076
|
+
val = [
|
|
4077
|
+
react_1.default.createElement(material_1.Switch, { key: "switch", sx: {
|
|
4037
4078
|
'& .MuiSwitch-thumb': { color: info.style.color },
|
|
4038
|
-
'& .MuiSwitch-track':
|
|
4039
|
-
|
|
4040
|
-
|
|
4079
|
+
'& .MuiSwitch-track': {
|
|
4080
|
+
backgroundColor: !!this.states[id].val && this.state.selected.includes(id)
|
|
4081
|
+
? this.props.themeType === 'dark'
|
|
4082
|
+
? '#FFF !important'
|
|
4083
|
+
: '#111 !important'
|
|
4084
|
+
: undefined,
|
|
4085
|
+
},
|
|
4086
|
+
}, checked: !!this.states[id].val }),
|
|
4087
|
+
];
|
|
4041
4088
|
}
|
|
4042
4089
|
}
|
|
4043
|
-
return react_1.default.createElement(material_1.Tooltip, { key: "value", title: (_c = this.state.tooltipInfo) === null || _c === void 0 ? void 0 : _c.el, slotProps: {
|
|
4090
|
+
return (react_1.default.createElement(material_1.Tooltip, { key: "value", title: (_c = this.state.tooltipInfo) === null || _c === void 0 ? void 0 : _c.el, slotProps: {
|
|
4044
4091
|
popper: { sx: styles.cellValueTooltipBox },
|
|
4045
4092
|
tooltip: { sx: styles.cellValueTooltip },
|
|
4046
4093
|
}, onOpen: () => this.getTooltipInfo(id, () => this.readHistory(id)), onClose: () => { var _b; return ((_b = this.state.tooltipInfo) === null || _b === void 0 ? void 0 : _b.id) === id && this.setState({ tooltipInfo: null }); } },
|
|
4047
4094
|
react_1.default.createElement(material_1.Box, { component: "div", style: info.style, sx: Object.assign(Object.assign({}, styles.cellValueText), { height: narrowStyleWithDetails ? undefined : ROW_HEIGHT, '& .admin-button:active': {
|
|
4048
4095
|
transform: 'translate(0, 2px)',
|
|
4049
|
-
} }) }, val));
|
|
4096
|
+
} }) }, val)));
|
|
4050
4097
|
}
|
|
4051
4098
|
_syncEnum(id, enumIds, newArray, cb) {
|
|
4052
4099
|
var _b, _c, _d;
|
|
@@ -4084,8 +4131,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4084
4131
|
.catch(e => this.showError(e)));
|
|
4085
4132
|
}
|
|
4086
4133
|
}
|
|
4087
|
-
Promise.all(promises)
|
|
4088
|
-
.then(() => {
|
|
4134
|
+
void Promise.all(promises).then(() => {
|
|
4089
4135
|
setTimeout(() => this._syncEnum(id, enumIds, newArray, cb), 0);
|
|
4090
4136
|
});
|
|
4091
4137
|
}
|
|
@@ -4112,18 +4158,18 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4112
4158
|
return ({
|
|
4113
4159
|
name: getName(((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name) || id.split('.').pop() || '', this.props.lang),
|
|
4114
4160
|
value: id,
|
|
4115
|
-
icon: getSelectIdIconFromObjects(this.objects, id, this.imagePrefix),
|
|
4161
|
+
icon: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix),
|
|
4116
4162
|
});
|
|
4117
4163
|
})
|
|
4118
4164
|
.sort((a, b) => (a.name > b.name ? 1 : -1));
|
|
4119
4165
|
enums.forEach(_item => {
|
|
4120
4166
|
if (_item.icon && typeof _item.icon === 'string') {
|
|
4121
|
-
_item.icon = react_1.default.createElement(material_1.Box, { style: styles.enumIconDiv },
|
|
4122
|
-
react_1.default.createElement("img", { src: _item.icon, style: styles.enumIcon, alt: _item.name }));
|
|
4167
|
+
_item.icon = (react_1.default.createElement(material_1.Box, { style: styles.enumIconDiv },
|
|
4168
|
+
react_1.default.createElement("img", { src: _item.icon, style: styles.enumIcon, alt: _item.name })));
|
|
4123
4169
|
}
|
|
4124
4170
|
});
|
|
4125
4171
|
// const hasIcons = !!enums.find(item => item.icon);
|
|
4126
|
-
return react_1.default.createElement(material_1.Dialog, { sx: { '& .MuiPaper-root': styles.enumDialog }, onClose: () => this.setState({ enumDialog: null }), "aria-labelledby": "enum-dialog-title", open: !0 },
|
|
4172
|
+
return (react_1.default.createElement(material_1.Dialog, { sx: { '& .MuiPaper-root': styles.enumDialog }, onClose: () => this.setState({ enumDialog: null }), "aria-labelledby": "enum-dialog-title", open: !0 },
|
|
4127
4173
|
react_1.default.createElement(material_1.DialogTitle, { id: "enum-dialog-title" },
|
|
4128
4174
|
type === 'func' ? this.props.t('ra_Define functions') : this.props.t('ra_Define rooms'),
|
|
4129
4175
|
react_1.default.createElement(material_1.Fab, { sx: styles.enumButton, color: "primary", disabled: enumsOriginal === JSON.stringify(itemEnums), size: "small", onClick: () => this.syncEnum(item.data.id, type, itemEnums).then(() => this.setState({ enumDialog: null, enumDialogEnums: null })) },
|
|
@@ -4142,7 +4188,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4142
4188
|
name = _item;
|
|
4143
4189
|
}
|
|
4144
4190
|
const labelId = `checkbox-list-label-${id}`;
|
|
4145
|
-
return react_1.default.createElement(material_1.ListItem, { sx: styles.headerCellSelectItem, key: id, onClick: () => {
|
|
4191
|
+
return (react_1.default.createElement(material_1.ListItem, { sx: styles.headerCellSelectItem, key: id, onClick: () => {
|
|
4146
4192
|
const pos = itemEnums.indexOf(id);
|
|
4147
4193
|
const enumDialogEnums = JSON.parse(JSON.stringify(this.state.enumDialogEnums));
|
|
4148
4194
|
if (pos === -1) {
|
|
@@ -4156,8 +4202,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4156
4202
|
}, secondaryAction: icon },
|
|
4157
4203
|
react_1.default.createElement(material_1.ListItemIcon, { sx: { '&.MuiListItemIcon-root': styles.enumCheckbox } },
|
|
4158
4204
|
react_1.default.createElement(material_1.Checkbox, { edge: "start", checked: itemEnums.includes(id), tabIndex: -1, disableRipple: true, inputProps: { 'aria-labelledby': labelId } })),
|
|
4159
|
-
react_1.default.createElement(material_1.ListItemText, { id: labelId }, name));
|
|
4160
|
-
})));
|
|
4205
|
+
react_1.default.createElement(material_1.ListItemText, { id: labelId }, name)));
|
|
4206
|
+
}))));
|
|
4161
4207
|
}
|
|
4162
4208
|
renderEditRoleDialog() {
|
|
4163
4209
|
if (!this.state.roleDialog || !this.props.objectBrowserEditRole) {
|
|
@@ -4165,12 +4211,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4165
4211
|
}
|
|
4166
4212
|
if (this.state.roleDialog && this.props.objectBrowserEditRole) {
|
|
4167
4213
|
const ObjectBrowserEditRole = this.props.objectBrowserEditRole;
|
|
4168
|
-
return react_1.default.createElement(ObjectBrowserEditRole, { key: "objectBrowserEditRole", id: this.state.roleDialog, socket: this.props.socket, t: this.props.t, roles: this.info.roles, onClose: (obj) => {
|
|
4214
|
+
return (react_1.default.createElement(ObjectBrowserEditRole, { key: "objectBrowserEditRole", id: this.state.roleDialog, socket: this.props.socket, t: this.props.t, roles: this.info.roles, onClose: (obj) => {
|
|
4169
4215
|
if (obj) {
|
|
4170
4216
|
this.info.objects[this.state.roleDialog] = obj;
|
|
4171
4217
|
}
|
|
4172
4218
|
this.setState({ roleDialog: null });
|
|
4173
|
-
} });
|
|
4219
|
+
} }));
|
|
4174
4220
|
}
|
|
4175
4221
|
return null;
|
|
4176
4222
|
}
|
|
@@ -4191,7 +4237,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4191
4237
|
.getObject(((_c = (_b = this.state.columnsEditCustomDialog) === null || _b === void 0 ? void 0 : _b.obj) === null || _c === void 0 ? void 0 : _c._id) || '')
|
|
4192
4238
|
.then(obj => {
|
|
4193
4239
|
var _b;
|
|
4194
|
-
if (obj &&
|
|
4240
|
+
if (obj &&
|
|
4241
|
+
_a.setCustomValue(obj, (_b = this.state.columnsEditCustomDialog) === null || _b === void 0 ? void 0 : _b.it, value)) {
|
|
4195
4242
|
return this.props.socket.setObject(obj._id, obj);
|
|
4196
4243
|
}
|
|
4197
4244
|
throw new Error(this.props.t('ra_Cannot update attribute, because not found in the object'));
|
|
@@ -4216,27 +4263,27 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4216
4263
|
value: (value === null || value === undefined ? '' : value).toString(),
|
|
4217
4264
|
};
|
|
4218
4265
|
}
|
|
4219
|
-
return react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsEditCustomDialog: null }), maxWidth: "md", "aria-labelledby": "custom-dialog-title", open: !0 },
|
|
4266
|
+
return (react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsEditCustomDialog: null }), maxWidth: "md", "aria-labelledby": "custom-dialog-title", open: !0 },
|
|
4220
4267
|
react_1.default.createElement(material_1.DialogTitle, { id: "custom-dialog-title" }, `${this.props.t('ra_Edit object field')}: ${this.state.columnsEditCustomDialog.obj._id}`),
|
|
4221
4268
|
react_1.default.createElement(material_1.DialogContent, null,
|
|
4222
|
-
react_1.default.createElement(material_1.DialogContentText, { id: "alert-dialog-description" }, this.customColumnDialog.type === 'boolean' ? react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), defaultChecked: this.customColumnDialog.value === 'true', onChange: e => {
|
|
4269
|
+
react_1.default.createElement(material_1.DialogContentText, { id: "alert-dialog-description" }, this.customColumnDialog.type === 'boolean' ? (react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), defaultChecked: this.customColumnDialog.value === 'true', onChange: e => {
|
|
4223
4270
|
const customColumnDialog = this.customColumnDialog;
|
|
4224
4271
|
customColumnDialog.value = e.target.checked.toString();
|
|
4225
4272
|
const changed = customColumnDialog.value !== customColumnDialog.initValue;
|
|
4226
4273
|
if (changed === !this.state.customColumnDialogValueChanged) {
|
|
4227
4274
|
this.setState({ customColumnDialogValueChanged: changed });
|
|
4228
4275
|
}
|
|
4229
|
-
} }), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})` }) : react_1.default.createElement(material_1.TextField, { variant: "standard", defaultValue: this.customColumnDialog.value, fullWidth: true, onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})`, onChange: e => {
|
|
4276
|
+
} }), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})` })) : (react_1.default.createElement(material_1.TextField, { variant: "standard", defaultValue: this.customColumnDialog.value, fullWidth: true, onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})`, onChange: e => {
|
|
4230
4277
|
const customColumnDialog = this.customColumnDialog;
|
|
4231
4278
|
customColumnDialog.value = e.target.value;
|
|
4232
4279
|
const changed = customColumnDialog.value !== customColumnDialog.initValue;
|
|
4233
4280
|
if (changed === !this.state.customColumnDialogValueChanged) {
|
|
4234
4281
|
this.setState({ customColumnDialogValueChanged: changed });
|
|
4235
4282
|
}
|
|
4236
|
-
}, autoFocus: true }))),
|
|
4283
|
+
}, autoFocus: true })))),
|
|
4237
4284
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
4238
4285
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(true), disabled: !this.state.customColumnDialogValueChanged, color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.t('ra_Update')),
|
|
4239
|
-
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.t('ra_Cancel'))));
|
|
4286
|
+
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.t('ra_Cancel')))));
|
|
4240
4287
|
}
|
|
4241
4288
|
static getCustomValue(obj, it) {
|
|
4242
4289
|
var _b;
|
|
@@ -4250,7 +4297,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4250
4297
|
value = anyObj[p[0]][p[1]];
|
|
4251
4298
|
}
|
|
4252
4299
|
else if (p.length === 3) {
|
|
4253
|
-
value =
|
|
4300
|
+
value =
|
|
4301
|
+
anyObj[p[0]][p[1]] && typeof anyObj[p[0]][p[1]] === 'object' ? anyObj[p[0]][p[1]][p[2]] : null;
|
|
4254
4302
|
}
|
|
4255
4303
|
else if (p.length === 4) {
|
|
4256
4304
|
value =
|
|
@@ -4346,24 +4394,24 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4346
4394
|
const text = _a.getCustomValue(obj, it);
|
|
4347
4395
|
if (text !== null && text !== undefined) {
|
|
4348
4396
|
if (it.edit && !this.props.notEditable && (!it.objTypes || it.objTypes.includes(obj.type))) {
|
|
4349
|
-
return react_1.default.createElement(material_1.Box, { component: "div", style: Object.assign(Object.assign(Object.assign({}, styles.columnCustom), styles.columnCustomEditable), styles[`columnCustom_${it.align}`]), onClick: () => this.setState({
|
|
4397
|
+
return (react_1.default.createElement(material_1.Box, { component: "div", style: Object.assign(Object.assign(Object.assign({}, styles.columnCustom), styles.columnCustomEditable), styles[`columnCustom_${it.align}`]), onClick: () => this.setState({
|
|
4350
4398
|
columnsEditCustomDialog: { item, it, obj },
|
|
4351
4399
|
customColumnDialogValueChanged: false,
|
|
4352
|
-
}) }, text);
|
|
4400
|
+
}) }, text));
|
|
4353
4401
|
}
|
|
4354
|
-
return react_1.default.createElement(material_1.Box, { component: "div", style: Object.assign(Object.assign({}, styles.columnCustom), styles[`columnCustom_${it.align}`]) }, text);
|
|
4402
|
+
return (react_1.default.createElement(material_1.Box, { component: "div", style: Object.assign(Object.assign({}, styles.columnCustom), styles[`columnCustom_${it.align}`]) }, text));
|
|
4355
4403
|
}
|
|
4356
4404
|
return null;
|
|
4357
4405
|
}
|
|
4358
4406
|
renderAliasLink(id, index, customStyle) {
|
|
4407
|
+
const _index = index || 0;
|
|
4359
4408
|
// read the type of operation
|
|
4360
|
-
const aliasObj = this.objects[this.info.aliasesMap[id][
|
|
4409
|
+
const aliasObj = this.objects[this.info.aliasesMap[id][_index]].common.alias.id;
|
|
4361
4410
|
if (aliasObj) {
|
|
4362
|
-
|
|
4363
|
-
return react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4411
|
+
return (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4364
4412
|
e.stopPropagation();
|
|
4365
4413
|
e.preventDefault();
|
|
4366
|
-
const aliasId = this.info.aliasesMap[id][
|
|
4414
|
+
const aliasId = this.info.aliasesMap[id][_index];
|
|
4367
4415
|
// if more than one alias, close the menu
|
|
4368
4416
|
if (this.info.aliasesMap[id].length > 1) {
|
|
4369
4417
|
this.setState({ aliasMenu: '' });
|
|
@@ -4371,9 +4419,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4371
4419
|
this.onSelect(aliasId);
|
|
4372
4420
|
setTimeout(() => this.expandAllSelected(() => this.scrollToItem(aliasId)), 100);
|
|
4373
4421
|
}, sx: customStyle || this.styles.aliasAlone },
|
|
4374
|
-
react_1.default.createElement("span", { className: "admin-browser-arrow" },
|
|
4375
|
-
|
|
4376
|
-
|
|
4422
|
+
react_1.default.createElement("span", { className: "admin-browser-arrow" }, typeof aliasObj === 'string' || (aliasObj.read === id && aliasObj.write === id)
|
|
4423
|
+
? '↔'
|
|
4424
|
+
: aliasObj.read === id
|
|
4425
|
+
? '→'
|
|
4426
|
+
: '←'),
|
|
4427
|
+
this.info.aliasesMap[id][_index]));
|
|
4377
4428
|
}
|
|
4378
4429
|
return null;
|
|
4379
4430
|
}
|
|
@@ -4394,9 +4445,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4394
4445
|
itemType === 'device' ||
|
|
4395
4446
|
itemType === 'channel' ||
|
|
4396
4447
|
itemType === 'meta') {
|
|
4397
|
-
iconFolder = isExpanded ?
|
|
4398
|
-
react_1.default.createElement(IconOpen_1.default, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) }) :
|
|
4399
|
-
react_1.default.createElement(IconClosed_1.default, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) });
|
|
4448
|
+
iconFolder = isExpanded ? (react_1.default.createElement(IconOpen_1.default, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) })) : (react_1.default.createElement(IconClosed_1.default, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) }));
|
|
4400
4449
|
}
|
|
4401
4450
|
else if (obj && obj.common && obj.common.write === false && obj.type === 'state') {
|
|
4402
4451
|
iconFolder = react_1.default.createElement(IconDocumentReadOnly_1.default, { style: this.styles.cellIdIconDocument });
|
|
@@ -4408,10 +4457,10 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4408
4457
|
if (item.data.icon) {
|
|
4409
4458
|
if (typeof item.data.icon === 'string') {
|
|
4410
4459
|
if (item.data.icon.length < 3) {
|
|
4411
|
-
iconItem = react_1.default.createElement("span", { className: "iconOwn", style: styles.cellIdIconOwn }, item.data.icon); // utf-8 char
|
|
4460
|
+
iconItem = (react_1.default.createElement("span", { className: "iconOwn", style: styles.cellIdIconOwn }, item.data.icon)); // utf-8 char
|
|
4412
4461
|
}
|
|
4413
4462
|
else {
|
|
4414
|
-
iconItem = react_1.default.createElement(Icon_1.default, { style: styles.cellIdIconOwn, className: "iconOwn", src: item.data.icon, alt: "" });
|
|
4463
|
+
iconItem = (react_1.default.createElement(Icon_1.default, { style: styles.cellIdIconOwn, className: "iconOwn", src: item.data.icon, alt: "" }));
|
|
4415
4464
|
}
|
|
4416
4465
|
}
|
|
4417
4466
|
else {
|
|
@@ -4433,8 +4482,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4433
4482
|
}
|
|
4434
4483
|
const checkbox = this.props.multiSelect &&
|
|
4435
4484
|
this.objects[id] &&
|
|
4436
|
-
(!this.props.types || this.props.types.includes(this.objects[id].type)) ?
|
|
4437
|
-
react_1.default.createElement(material_1.Checkbox, { style: styles.checkBox, checked: this.state.selected.includes(id) }) : null;
|
|
4485
|
+
(!this.props.types || this.props.types.includes(this.objects[id].type)) ? (react_1.default.createElement(material_1.Checkbox, { style: styles.checkBox, checked: this.state.selected.includes(id) })) : null;
|
|
4438
4486
|
let valueEditable = !this.props.notEditable &&
|
|
4439
4487
|
itemType === 'state' &&
|
|
4440
4488
|
(this.state.filter.expertMode || (common === null || common === void 0 ? void 0 : common.write) !== false);
|
|
@@ -4478,44 +4526,44 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4478
4526
|
if (id.startsWith('alias.') && ((_c = common === null || common === void 0 ? void 0 : common.alias) === null || _c === void 0 ? void 0 : _c.id)) {
|
|
4479
4527
|
readWriteAlias = typeof common.alias.id === 'object';
|
|
4480
4528
|
if (readWriteAlias) {
|
|
4481
|
-
alias = react_1.default.createElement("div", { style: styles.cellIdAliasReadWriteDiv },
|
|
4482
|
-
common.alias.id.read ? react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4529
|
+
alias = (react_1.default.createElement("div", { style: styles.cellIdAliasReadWriteDiv },
|
|
4530
|
+
common.alias.id.read ? (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4483
4531
|
e.stopPropagation();
|
|
4484
4532
|
e.preventDefault();
|
|
4485
4533
|
this.onSelect(common.alias.id.read);
|
|
4486
4534
|
setTimeout(() => this.expandAllSelected(() => this.scrollToItem(common.alias.id.read)), 100);
|
|
4487
4535
|
}, sx: this.styles.aliasReadWrite },
|
|
4488
4536
|
"\u2190",
|
|
4489
|
-
common.alias.id.read) : null,
|
|
4490
|
-
common.alias.id.write ? react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4537
|
+
common.alias.id.read)) : null,
|
|
4538
|
+
common.alias.id.write ? (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4491
4539
|
e.stopPropagation();
|
|
4492
4540
|
e.preventDefault();
|
|
4493
4541
|
this.onSelect(common.alias.id.write);
|
|
4494
4542
|
setTimeout(() => this.expandAllSelected(() => this.scrollToItem(common.alias.id.write)), 100);
|
|
4495
4543
|
}, sx: this.styles.aliasReadWrite },
|
|
4496
4544
|
"\u2192",
|
|
4497
|
-
common.alias.id.write) : null);
|
|
4545
|
+
common.alias.id.write)) : null));
|
|
4498
4546
|
}
|
|
4499
4547
|
else {
|
|
4500
|
-
alias = react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4548
|
+
alias = (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
|
|
4501
4549
|
e.stopPropagation();
|
|
4502
4550
|
e.preventDefault();
|
|
4503
4551
|
this.onSelect(common.alias.id);
|
|
4504
4552
|
setTimeout(() => this.expandAllSelected(() => this.scrollToItem(common.alias.id)), 100);
|
|
4505
4553
|
}, sx: this.styles.aliasAlone },
|
|
4506
4554
|
"\u2192",
|
|
4507
|
-
common.alias.id);
|
|
4555
|
+
common.alias.id));
|
|
4508
4556
|
}
|
|
4509
4557
|
}
|
|
4510
4558
|
else if (this.info.aliasesMap[id]) {
|
|
4511
4559
|
// Some alias points to this object. It can be more than one
|
|
4512
4560
|
if (this.info.aliasesMap[id].length > 1) {
|
|
4513
4561
|
// Show number of aliases and open a menu by click
|
|
4514
|
-
alias = react_1.default.createElement(material_1.Box, { component: "div", id: `alias_${id}`, onClick: e => {
|
|
4562
|
+
alias = (react_1.default.createElement(material_1.Box, { component: "div", id: `alias_${id}`, onClick: e => {
|
|
4515
4563
|
e.stopPropagation();
|
|
4516
4564
|
e.preventDefault();
|
|
4517
4565
|
this.setState({ aliasMenu: id });
|
|
4518
|
-
}, sx: this.styles.aliasAlone }, this.props.t('ra_%s links from aliases', this.info.aliasesMap[id].length));
|
|
4566
|
+
}, sx: this.styles.aliasAlone }, this.props.t('ra_%s links from aliases', this.info.aliasesMap[id].length)));
|
|
4519
4567
|
}
|
|
4520
4568
|
else {
|
|
4521
4569
|
// Show name of alias and open it by click
|
|
@@ -4663,7 +4711,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4663
4711
|
}
|
|
4664
4712
|
}
|
|
4665
4713
|
const narrowStyleWithDetails = this.props.width === 'xs' && this.state.focused === id;
|
|
4666
|
-
const colID = react_1.default.createElement(material_1.Grid2, { container: true, wrap: "nowrap", direction: "row", sx: styles.cellId, style: { width: this.columnsVisibility.id, paddingLeft } },
|
|
4714
|
+
const colID = (react_1.default.createElement(material_1.Grid2, { container: true, wrap: "nowrap", direction: "row", sx: styles.cellId, style: { width: this.columnsVisibility.id, paddingLeft } },
|
|
4667
4715
|
react_1.default.createElement(material_1.Grid2, { container: true, alignItems: "center" },
|
|
4668
4716
|
checkbox,
|
|
4669
4717
|
iconFolder),
|
|
@@ -4674,143 +4722,188 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4674
4722
|
icons),
|
|
4675
4723
|
react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.grow), (invertBackground ? this.styles.invertedBackgroundFlex : {})) }),
|
|
4676
4724
|
react_1.default.createElement(material_1.Grid2, { container: true, alignItems: "center" }, iconItem),
|
|
4677
|
-
this.props.width !== 'xs' ? react_1.default.createElement("div", null,
|
|
4678
|
-
react_1.default.createElement(IconCopy_1.default, { className: narrowStyleWithDetails ? '' : 'copyButton', style: styles.cellCopyButton, onClick: e => this.onCopy(e, id) })) : null);
|
|
4679
|
-
let colName = (narrowStyleWithDetails && name) || this.columnsVisibility.name ? react_1.default.createElement(material_1.Box, { component: "div", sx: Object.assign(Object.assign(Object.assign({}, styles.cellName), (useDesc ? styles.cellNameWithDesc : undefined)), { width: this.props.width !== 'xs' ? this.columnsVisibility.name : undefined, ml: narrowStyleWithDetails ? 0 : '5px' }) },
|
|
4725
|
+
this.props.width !== 'xs' ? (react_1.default.createElement("div", null,
|
|
4726
|
+
react_1.default.createElement(IconCopy_1.default, { className: narrowStyleWithDetails ? '' : 'copyButton', style: styles.cellCopyButton, onClick: e => this.onCopy(e, id) }))) : null));
|
|
4727
|
+
let colName = (narrowStyleWithDetails && name) || this.columnsVisibility.name ? (react_1.default.createElement(material_1.Box, { component: "div", sx: Object.assign(Object.assign(Object.assign({}, styles.cellName), (useDesc ? styles.cellNameWithDesc : undefined)), { width: this.props.width !== 'xs' ? this.columnsVisibility.name : undefined, ml: narrowStyleWithDetails ? 0 : '5px' }) },
|
|
4680
4728
|
name,
|
|
4681
|
-
!narrowStyleWithDetails && ((_f = item.data) === null || _f === void 0 ? void 0 : _f.title) ? react_1.default.createElement(material_1.Box, { style: { color: checkColor } },
|
|
4682
|
-
react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButton, onClick: e => { var _b; return this.onCopy(e, (_b = item.data) === null || _b === void 0 ? void 0 : _b.title); } })) : null) : null;
|
|
4729
|
+
!narrowStyleWithDetails && ((_f = item.data) === null || _f === void 0 ? void 0 : _f.title) ? (react_1.default.createElement(material_1.Box, { style: { color: checkColor } },
|
|
4730
|
+
react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButton, onClick: e => { var _b; return this.onCopy(e, (_b = item.data) === null || _b === void 0 ? void 0 : _b.title); } }))) : null)) : null;
|
|
4683
4731
|
let colMiddle;
|
|
4684
4732
|
if (!this.state.statesView) {
|
|
4685
4733
|
colMiddle = [
|
|
4686
|
-
(narrowStyleWithDetails && (obj === null || obj === void 0 ? void 0 : obj.type)) || this.columnsVisibility.type
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4734
|
+
(narrowStyleWithDetails && (obj === null || obj === void 0 ? void 0 : obj.type)) || this.columnsVisibility.type
|
|
4735
|
+
? {
|
|
4736
|
+
el: (react_1.default.createElement("div", { key: "type", style: Object.assign(Object.assign({}, styles.cellType), { width: this.props.width !== 'xs' ? this.columnsVisibility.type : undefined }) },
|
|
4737
|
+
typeImg,
|
|
4738
|
+
"\u00A0", obj === null || obj === void 0 ? void 0 :
|
|
4739
|
+
obj.type)),
|
|
4740
|
+
type: 'filter_type',
|
|
4741
|
+
}
|
|
4742
|
+
: null,
|
|
4743
|
+
(narrowStyleWithDetails && common) || this.columnsVisibility.role
|
|
4744
|
+
? {
|
|
4745
|
+
el: (react_1.default.createElement("div", { key: "role", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.role : '100%', cursor: this.state.filter.expertMode &&
|
|
4746
|
+
enumEditable &&
|
|
4747
|
+
this.props.objectBrowserEditRole
|
|
4748
|
+
? 'text'
|
|
4749
|
+
: 'default' }), onClick: !narrowStyleWithDetails &&
|
|
4750
|
+
this.state.filter.expertMode &&
|
|
4751
|
+
enumEditable &&
|
|
4752
|
+
this.props.objectBrowserEditRole
|
|
4753
|
+
? () => this.setState({ roleDialog: item.data.id })
|
|
4754
|
+
: undefined }, common === null || common === void 0 ? void 0 : common.role)),
|
|
4755
|
+
type: 'filter_role',
|
|
4756
|
+
onClick: narrowStyleWithDetails &&
|
|
4757
|
+
this.state.filter.expertMode &&
|
|
4758
|
+
enumEditable &&
|
|
4759
|
+
this.props.objectBrowserEditRole
|
|
4698
4760
|
? () => this.setState({ roleDialog: item.data.id })
|
|
4699
|
-
: undefined
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4761
|
+
: undefined,
|
|
4762
|
+
}
|
|
4763
|
+
: null,
|
|
4764
|
+
(narrowStyleWithDetails && common) || this.columnsVisibility.room
|
|
4765
|
+
? {
|
|
4766
|
+
el: (react_1.default.createElement("div", { key: "room", style: Object.assign(Object.assign(Object.assign({}, styles.cellRoom), (item.data.per ? styles.cellEnumParent : {})), { width: this.props.width !== 'xs' ? this.columnsVisibility.room : '100%', cursor: enumEditable ? 'text' : 'default' }), onClick: !narrowStyleWithDetails && enumEditable
|
|
4767
|
+
? () => {
|
|
4768
|
+
const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
|
|
4769
|
+
this.setState({
|
|
4770
|
+
enumDialogEnums: enums,
|
|
4771
|
+
enumDialog: {
|
|
4772
|
+
item,
|
|
4773
|
+
type: 'room',
|
|
4774
|
+
enumsOriginal: JSON.stringify(enums),
|
|
4775
|
+
},
|
|
4776
|
+
});
|
|
4777
|
+
}
|
|
4778
|
+
: undefined }, item.data.rooms)),
|
|
4779
|
+
type: 'filter_room',
|
|
4780
|
+
onClick: narrowStyleWithDetails && enumEditable
|
|
4781
|
+
? () => {
|
|
4782
|
+
const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
|
|
4783
|
+
this.setState({
|
|
4784
|
+
enumDialogEnums: enums,
|
|
4785
|
+
enumDialog: {
|
|
4786
|
+
item,
|
|
4787
|
+
type: 'room',
|
|
4788
|
+
enumsOriginal: JSON.stringify(enums),
|
|
4789
|
+
},
|
|
4790
|
+
});
|
|
4791
|
+
}
|
|
4792
|
+
: undefined,
|
|
4793
|
+
}
|
|
4794
|
+
: null,
|
|
4795
|
+
(narrowStyleWithDetails && common) || this.columnsVisibility.func
|
|
4796
|
+
? {
|
|
4797
|
+
el: (react_1.default.createElement("div", { key: "func", style: Object.assign(Object.assign(Object.assign({}, styles.cellFunc), (item.data.pef ? styles.cellEnumParent : {})), { width: this.props.width !== 'xs' ? this.columnsVisibility.func : '100%', cursor: enumEditable ? 'text' : 'default' }), onClick: !narrowStyleWithDetails && enumEditable
|
|
4798
|
+
? () => {
|
|
4799
|
+
const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
|
|
4800
|
+
this.setState({
|
|
4801
|
+
enumDialogEnums: enums,
|
|
4802
|
+
enumDialog: {
|
|
4803
|
+
item,
|
|
4804
|
+
type: 'func',
|
|
4805
|
+
enumsOriginal: JSON.stringify(enums),
|
|
4806
|
+
},
|
|
4807
|
+
});
|
|
4808
|
+
}
|
|
4809
|
+
: undefined }, item.data.funcs)),
|
|
4810
|
+
type: 'filter_func',
|
|
4811
|
+
onClick: narrowStyleWithDetails && enumEditable
|
|
4812
|
+
? () => {
|
|
4813
|
+
const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
|
|
4814
|
+
this.setState({
|
|
4815
|
+
enumDialogEnums: enums,
|
|
4816
|
+
enumDialog: {
|
|
4817
|
+
item,
|
|
4818
|
+
type: 'func',
|
|
4819
|
+
enumsOriginal: JSON.stringify(enums),
|
|
4820
|
+
},
|
|
4821
|
+
});
|
|
4822
|
+
}
|
|
4823
|
+
: undefined,
|
|
4824
|
+
}
|
|
4825
|
+
: null,
|
|
4755
4826
|
];
|
|
4756
4827
|
}
|
|
4757
4828
|
else {
|
|
4758
4829
|
colMiddle = [
|
|
4759
|
-
(narrowStyleWithDetails && checkVisibleObjectType && ((_g = this.states[id]) === null || _g === void 0 ? void 0 : _g.from)) ||
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4830
|
+
(narrowStyleWithDetails && checkVisibleObjectType && ((_g = this.states[id]) === null || _g === void 0 ? void 0 : _g.from)) ||
|
|
4831
|
+
this.columnsVisibility.changedFrom
|
|
4832
|
+
? {
|
|
4833
|
+
el: (react_1.default.createElement("div", { key: "from", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.changedFrom : undefined }), title: newValueTitle.join('\n') }, checkVisibleObjectType && ((_h = this.states[id]) === null || _h === void 0 ? void 0 : _h.from) ? newValue : null)),
|
|
4834
|
+
type: 'from',
|
|
4835
|
+
}
|
|
4836
|
+
: null,
|
|
4837
|
+
(narrowStyleWithDetails && q) || this.columnsVisibility.qualityCode
|
|
4838
|
+
? {
|
|
4839
|
+
el: (react_1.default.createElement("div", { key: "q", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.qualityCode : undefined }), title: q || '' }, q)),
|
|
4840
|
+
type: 'quality',
|
|
4841
|
+
}
|
|
4842
|
+
: null,
|
|
4843
|
+
(narrowStyleWithDetails && checkVisibleObjectType && ((_j = this.states[id]) === null || _j === void 0 ? void 0 : _j.ts)) ||
|
|
4844
|
+
this.columnsVisibility.timestamp
|
|
4845
|
+
? {
|
|
4846
|
+
el: (react_1.default.createElement("div", { key: "ts", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.timestamp : undefined }) }, checkVisibleObjectType && ((_k = this.states[id]) === null || _k === void 0 ? void 0 : _k.ts)
|
|
4847
|
+
? Utils_1.default.formatDate(new Date(this.states[id].ts), this.props.dateFormat || this.systemConfig.common.dateFormat)
|
|
4848
|
+
: null)),
|
|
4849
|
+
type: 'ts',
|
|
4850
|
+
}
|
|
4851
|
+
: null,
|
|
4852
|
+
(narrowStyleWithDetails && checkVisibleObjectType && ((_l = this.states[id]) === null || _l === void 0 ? void 0 : _l.lc)) ||
|
|
4853
|
+
this.columnsVisibility.lastChange
|
|
4854
|
+
? {
|
|
4855
|
+
el: (react_1.default.createElement("div", { key: "lc", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.lastChange : undefined }) }, checkVisibleObjectType && ((_m = this.states[id]) === null || _m === void 0 ? void 0 : _m.lc)
|
|
4856
|
+
? Utils_1.default.formatDate(new Date(this.states[id].lc), this.props.dateFormat || this.systemConfig.common.dateFormat)
|
|
4857
|
+
: null)),
|
|
4858
|
+
type: 'lc',
|
|
4859
|
+
}
|
|
4860
|
+
: null,
|
|
4779
4861
|
];
|
|
4780
4862
|
}
|
|
4781
|
-
let colCustom = ((_o = this.adapterColumns) === null || _o === void 0 ? void 0 : _o.map(it => react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellAdapter), { width: this.props.width !== 'xs'
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4863
|
+
let colCustom = ((_o = this.adapterColumns) === null || _o === void 0 ? void 0 : _o.map(it => (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellAdapter), { width: this.props.width !== 'xs'
|
|
4864
|
+
? this.columnsVisibility[it.id]
|
|
4865
|
+
: undefined }), key: it.id, title: `${it.adapter} => ${it.pathText}` }, obj ? this.renderCustomValue(obj, it, item) : null)))) || null;
|
|
4866
|
+
const columnValue = narrowStyleWithDetails || this.columnsVisibility.val
|
|
4867
|
+
? this.renderColumnValue(id, item, narrowStyleWithDetails)
|
|
4868
|
+
: null;
|
|
4869
|
+
let colValue = (narrowStyleWithDetails && columnValue) || this.columnsVisibility.val ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellValue), { width: this.props.width !== 'xs' ? this.columnsVisibility.val : 'calc(100% - 100px)', cursor: valueEditable
|
|
4870
|
+
? (common === null || common === void 0 ? void 0 : common.type) === 'file'
|
|
4871
|
+
? 'zoom-in'
|
|
4872
|
+
: item.data.button
|
|
4873
|
+
? 'grab'
|
|
4874
|
+
: 'text'
|
|
4875
|
+
: 'default' }), onClick: valueEditable
|
|
4876
|
+
? () => {
|
|
4877
|
+
if (!obj || !this.states) {
|
|
4878
|
+
// return;
|
|
4879
|
+
}
|
|
4880
|
+
else if ((common === null || common === void 0 ? void 0 : common.type) === 'file') {
|
|
4881
|
+
this.setState({ viewFileDialog: id });
|
|
4882
|
+
}
|
|
4883
|
+
else if (!this.state.filter.expertMode && item.data.button) {
|
|
4884
|
+
// in non-expert mode control button directly
|
|
4885
|
+
this.props.socket
|
|
4886
|
+
.setState(id, true)
|
|
4887
|
+
.catch(e => window.alert(`Cannot write state "${id}": ${e}`));
|
|
4888
|
+
}
|
|
4889
|
+
else if (!this.state.filter.expertMode && item.data.switch) {
|
|
4890
|
+
// in non-expert mode control switch directly
|
|
4891
|
+
this.props.socket
|
|
4892
|
+
.setState(id, !this.states[id].val)
|
|
4893
|
+
.catch(e => window.alert(`Cannot write state "${id}": ${e}`));
|
|
4894
|
+
}
|
|
4895
|
+
else {
|
|
4896
|
+
this.edit = {
|
|
4897
|
+
val: this.states[id] ? this.states[id].val : '',
|
|
4898
|
+
q: this.states[id] ? this.states[id].q || 0 : 0,
|
|
4899
|
+
ack: false,
|
|
4900
|
+
id,
|
|
4901
|
+
};
|
|
4902
|
+
this.setState({ updateOpened: true });
|
|
4903
|
+
}
|
|
4811
4904
|
}
|
|
4812
|
-
|
|
4813
|
-
let colButtons = narrowStyleWithDetails || this.columnsVisibility.buttons ? react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellButtons), { width: this.props.width !== 'xs' ? this.columnsVisibility.buttons : undefined }) }, this.renderColumnButtons(id, item)) : null;
|
|
4905
|
+
: undefined }, columnValue)) : null;
|
|
4906
|
+
let colButtons = narrowStyleWithDetails || this.columnsVisibility.buttons ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellButtons), { width: this.props.width !== 'xs' ? this.columnsVisibility.buttons : undefined }) }, this.renderColumnButtons(id, item))) : null;
|
|
4814
4907
|
let colDetails = null;
|
|
4815
4908
|
if (this.props.width === 'xs' && this.state.focused === id) {
|
|
4816
4909
|
colMiddle = colMiddle.filter(a => a);
|
|
@@ -4819,18 +4912,27 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4819
4912
|
renderedMiddle = null;
|
|
4820
4913
|
}
|
|
4821
4914
|
else {
|
|
4822
|
-
renderedMiddle = colMiddle.map(it =>
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
it.
|
|
4827
|
-
|
|
4828
|
-
|
|
4915
|
+
renderedMiddle = colMiddle.map(it => {
|
|
4916
|
+
if (!it) {
|
|
4917
|
+
return null;
|
|
4918
|
+
}
|
|
4919
|
+
return (react_1.default.createElement("div", { key: it.type, style: styles.cellDetailsLine },
|
|
4920
|
+
react_1.default.createElement("span", { style: styles.cellDetailsName },
|
|
4921
|
+
this.texts[it.type],
|
|
4922
|
+
":"),
|
|
4923
|
+
it.el,
|
|
4924
|
+
react_1.default.createElement("div", { style: { flexGrow: 1 } }),
|
|
4925
|
+
it.onClick ? (react_1.default.createElement(icons_material_1.Edit, { style: styles.cellCopyButtonInDetails, onClick: () => {
|
|
4926
|
+
if (it === null || it === void 0 ? void 0 : it.onClick) {
|
|
4927
|
+
it.onClick();
|
|
4928
|
+
}
|
|
4929
|
+
} })) : null));
|
|
4930
|
+
});
|
|
4829
4931
|
}
|
|
4830
4932
|
if (!colCustom.length) {
|
|
4831
4933
|
colCustom = null;
|
|
4832
4934
|
}
|
|
4833
|
-
colDetails = react_1.default.createElement(material_1.Paper, { style: {
|
|
4935
|
+
colDetails = (react_1.default.createElement(material_1.Paper, { style: {
|
|
4834
4936
|
width: '100%',
|
|
4835
4937
|
display: 'flex',
|
|
4836
4938
|
flexDirection: 'column',
|
|
@@ -4840,16 +4942,16 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4840
4942
|
react_1.default.createElement("div", { style: styles.cellDetailsLine },
|
|
4841
4943
|
react_1.default.createElement("div", { style: { flexGrow: 1 } }),
|
|
4842
4944
|
react_1.default.createElement(IconCopy_1.default, { style: styles.cellCopyButtonInDetails, onClick: e => this.onCopy(e, id) })),
|
|
4843
|
-
colName && react_1.default.createElement("div", { style: styles.cellDetailsLine },
|
|
4945
|
+
colName && (react_1.default.createElement("div", { style: styles.cellDetailsLine },
|
|
4844
4946
|
react_1.default.createElement("span", { style: styles.cellDetailsName },
|
|
4845
4947
|
this.texts.name,
|
|
4846
4948
|
":"),
|
|
4847
4949
|
colName,
|
|
4848
4950
|
react_1.default.createElement("div", { style: { flexGrow: 1 } }),
|
|
4849
|
-
((_p = item.data) === null || _p === void 0 ? void 0 : _p.title) ? react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButtonInDetails, onClick: e => { var _b; return this.onCopy(e, (_b = item.data) === null || _b === void 0 ? void 0 : _b.title); } }) : null),
|
|
4951
|
+
((_p = item.data) === null || _p === void 0 ? void 0 : _p.title) ? (react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButtonInDetails, onClick: e => { var _b; return this.onCopy(e, (_b = item.data) === null || _b === void 0 ? void 0 : _b.title); } })) : null)),
|
|
4850
4952
|
renderedMiddle,
|
|
4851
4953
|
colCustom && react_1.default.createElement("div", { style: styles.cellDetailsLine }, colCustom),
|
|
4852
|
-
((_q = this.objects[id]) === null || _q === void 0 ? void 0 : _q.type) === 'state' && react_1.default.createElement("div", { style: styles.cellDetailsLine },
|
|
4954
|
+
((_q = this.objects[id]) === null || _q === void 0 ? void 0 : _q.type) === 'state' && (react_1.default.createElement("div", { style: styles.cellDetailsLine },
|
|
4853
4955
|
react_1.default.createElement("span", { style: styles.cellDetailsName },
|
|
4854
4956
|
this.texts.value,
|
|
4855
4957
|
":"),
|
|
@@ -4861,18 +4963,20 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4861
4963
|
obj: this.objects[id],
|
|
4862
4964
|
texts: this.texts,
|
|
4863
4965
|
dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat,
|
|
4864
|
-
isFloatComma: this.props.isFloatComma === undefined
|
|
4966
|
+
isFloatComma: this.props.isFloatComma === undefined
|
|
4967
|
+
? this.systemConfig.common.isFloatComma
|
|
4968
|
+
: this.props.isFloatComma,
|
|
4865
4969
|
});
|
|
4866
4970
|
this.onCopy(e, valText.v.toString());
|
|
4867
|
-
}, key: "cc" })),
|
|
4868
|
-
colButtons && react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellDetailsLine), { justifyContent: 'right' }) }, colButtons));
|
|
4971
|
+
}, key: "cc" }))),
|
|
4972
|
+
colButtons && (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellDetailsLine), { justifyContent: 'right' }) }, colButtons))));
|
|
4869
4973
|
colName = null;
|
|
4870
4974
|
colMiddle = null;
|
|
4871
4975
|
colCustom = null;
|
|
4872
4976
|
colValue = null;
|
|
4873
4977
|
colButtons = null;
|
|
4874
4978
|
}
|
|
4875
|
-
const row = react_1.default.createElement(material_1.Grid2, { container: true, direction: "row", wrap: "nowrap", sx: Utils_1.default.getStyle(this.props.theme, styles.tableRow, this.state.linesEnabled && styles.tableRowLines, !this.props.dragEnabled && styles.tableRowNoDragging, alias && styles.tableRowAlias, readWriteAlias && styles.tableRowAliasReadWrite, this.state.focused === id && this.props.multiSelect && styles.tableRowFocused, !item.data.visible && styles.filteredOut, item.data.hasVisibleParent &&
|
|
4979
|
+
const row = (react_1.default.createElement(material_1.Grid2, { container: true, direction: "row", wrap: "nowrap", sx: Utils_1.default.getStyle(this.props.theme, styles.tableRow, this.state.linesEnabled && styles.tableRowLines, !this.props.dragEnabled && styles.tableRowNoDragging, alias && styles.tableRowAlias, readWriteAlias && styles.tableRowAliasReadWrite, this.state.focused === id && this.props.multiSelect && styles.tableRowFocused, !item.data.visible && styles.filteredOut, item.data.hasVisibleParent &&
|
|
4876
4980
|
!item.data.visible &&
|
|
4877
4981
|
!item.data.hasVisibleChildren &&
|
|
4878
4982
|
styles.filteredParentOut, this.state.selected.includes(id) && styles.itemSelected, this.state.selectedNonObject === id && styles.itemSelected), key: id, id: id, onMouseDown: e => {
|
|
@@ -4908,7 +5012,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4908
5012
|
colMiddle.map(it => it === null || it === void 0 ? void 0 : it.el),
|
|
4909
5013
|
colCustom,
|
|
4910
5014
|
colValue,
|
|
4911
|
-
colButtons);
|
|
5015
|
+
colButtons));
|
|
4912
5016
|
return { row, details: colDetails };
|
|
4913
5017
|
}
|
|
4914
5018
|
/**
|
|
@@ -4922,11 +5026,11 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
4922
5026
|
const DragWrapper = this.props.DragWrapper;
|
|
4923
5027
|
if (this.props.dragEnabled && DragWrapper) {
|
|
4924
5028
|
if (root.data.sumVisibility) {
|
|
4925
|
-
leaf = react_1.default.createElement(DragWrapper, { key: root.data.id, item: root, style: styles.draggable }, result.row);
|
|
5029
|
+
leaf = (react_1.default.createElement(DragWrapper, { key: root.data.id, item: root, style: styles.draggable }, result.row));
|
|
4926
5030
|
}
|
|
4927
5031
|
else {
|
|
4928
5032
|
// change cursor
|
|
4929
|
-
leaf = react_1.default.createElement("div", { key: root.data.id, style: styles.nonDraggable }, result.row);
|
|
5033
|
+
leaf = (react_1.default.createElement("div", { key: root.data.id, style: styles.nonDraggable }, result.row));
|
|
4930
5034
|
}
|
|
4931
5035
|
}
|
|
4932
5036
|
else {
|
|
@@ -5081,8 +5185,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5081
5185
|
if (columnsForAdmin && columns) {
|
|
5082
5186
|
Object.keys(columnsForAdmin)
|
|
5083
5187
|
.sort()
|
|
5084
|
-
.forEach(adapter => columnsForAdmin[adapter]
|
|
5085
|
-
.forEach(column => {
|
|
5188
|
+
.forEach(adapter => columnsForAdmin[adapter].forEach(column => {
|
|
5086
5189
|
const id = `_${adapter}_${column.path}`;
|
|
5087
5190
|
if (columns.includes(id)) {
|
|
5088
5191
|
const item = {
|
|
@@ -5106,7 +5209,8 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5106
5209
|
columnsWidths[item.id] ||
|
|
5107
5210
|
column.width ||
|
|
5108
5211
|
SCREEN_WIDTHS[width].widths.func ||
|
|
5109
|
-
SCREEN_WIDTHS.xl.widths.func ||
|
|
5212
|
+
SCREEN_WIDTHS.xl.widths.func ||
|
|
5213
|
+
0;
|
|
5110
5214
|
widthSum += this.columnsVisibility[id];
|
|
5111
5215
|
}
|
|
5112
5216
|
else {
|
|
@@ -5131,8 +5235,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5131
5235
|
this.columnsVisibility.nameHeader = `calc(100% - ${widthSum + 5 + this.state.scrollBarWidth}px)`;
|
|
5132
5236
|
}
|
|
5133
5237
|
else {
|
|
5134
|
-
const newWidth = Object.keys(this.columnsVisibility)
|
|
5135
|
-
.reduce((accumulator, name) => {
|
|
5238
|
+
const newWidth = Object.keys(this.columnsVisibility).reduce((accumulator, name) => {
|
|
5136
5239
|
// do not summarize strings
|
|
5137
5240
|
if (name === 'id' ||
|
|
5138
5241
|
typeof this.columnsVisibility[name] === 'string' ||
|
|
@@ -5202,40 +5305,40 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5202
5305
|
* Render the right handle for resizing
|
|
5203
5306
|
*/
|
|
5204
5307
|
renderHandleRight() {
|
|
5205
|
-
return react_1.default.createElement(material_1.Box, { component: "div", className: "iob-ob-resize-handler", sx: Object.assign(Object.assign({}, styles.resizeHandle), styles.resizeHandleRight), onMouseDown: this.resizerMouseDown, onDoubleClick: this.resizerReset, title: this.props.t('ra_Double click to reset table layout') });
|
|
5308
|
+
return (react_1.default.createElement(material_1.Box, { component: "div", className: "iob-ob-resize-handler", sx: Object.assign(Object.assign({}, styles.resizeHandle), styles.resizeHandleRight), onMouseDown: this.resizerMouseDown, onDoubleClick: this.resizerReset, title: this.props.t('ra_Double click to reset table layout') }));
|
|
5206
5309
|
}
|
|
5207
5310
|
renderHeader() {
|
|
5208
5311
|
let filterClearInValue = null;
|
|
5209
5312
|
if (!this.columnsVisibility.buttons && !this.isFilterEmpty()) {
|
|
5210
|
-
filterClearInValue = react_1.default.createElement(material_1.IconButton, { onClick: () => this.clearFilter(), style: styles.buttonClearFilter, title: this.props.t('ra_Clear filter'), size: "large" },
|
|
5313
|
+
filterClearInValue = (react_1.default.createElement(material_1.IconButton, { onClick: () => this.clearFilter(), style: styles.buttonClearFilter, title: this.props.t('ra_Clear filter'), size: "large" },
|
|
5211
5314
|
react_1.default.createElement(IconClearFilter_1.default, null),
|
|
5212
|
-
react_1.default.createElement(icons_material_1.Close, { style: styles.buttonClearFilterIcon }));
|
|
5315
|
+
react_1.default.createElement(icons_material_1.Close, { style: styles.buttonClearFilterIcon })));
|
|
5213
5316
|
}
|
|
5214
5317
|
if (this.props.width === 'xs') {
|
|
5215
|
-
return react_1.default.createElement("div", { style: styles.headerRow },
|
|
5216
|
-
react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: '100%' }) }, this.getFilterInput('id')));
|
|
5318
|
+
return (react_1.default.createElement("div", { style: styles.headerRow },
|
|
5319
|
+
react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: '100%' }) }, this.getFilterInput('id'))));
|
|
5217
5320
|
}
|
|
5218
|
-
return react_1.default.createElement("div", { style: styles.headerRow },
|
|
5321
|
+
return (react_1.default.createElement("div", { style: styles.headerRow },
|
|
5219
5322
|
react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.id, position: 'relative' }), "data-min": 240, "data-name": "id" },
|
|
5220
5323
|
this.getFilterInput('id'),
|
|
5221
5324
|
this.renderHandleRight()),
|
|
5222
|
-
this.columnsVisibility.name ? react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.nameHeader, position: 'relative' }), "data-min": 100, "data-name": "nameHeader" },
|
|
5325
|
+
this.columnsVisibility.name ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.nameHeader, position: 'relative' }), "data-min": 100, "data-name": "nameHeader" },
|
|
5223
5326
|
this.getFilterInput('name'),
|
|
5224
|
-
this.renderHandleRight()) : null,
|
|
5225
|
-
!this.state.statesView && react_1.default.createElement(react_1.default.Fragment, null,
|
|
5226
|
-
this.columnsVisibility.type ? react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.type, position: 'relative' }), "data-min": 100, "data-name": "type" },
|
|
5327
|
+
this.renderHandleRight())) : null,
|
|
5328
|
+
!this.state.statesView && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5329
|
+
this.columnsVisibility.type ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.type, position: 'relative' }), "data-min": 100, "data-name": "type" },
|
|
5227
5330
|
this.getFilterSelectType(),
|
|
5228
|
-
this.renderHandleRight()) : null,
|
|
5229
|
-
this.columnsVisibility.role ? react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.role, position: 'relative' }), "data-min": 100, "data-name": "role" },
|
|
5331
|
+
this.renderHandleRight())) : null,
|
|
5332
|
+
this.columnsVisibility.role ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.role, position: 'relative' }), "data-min": 100, "data-name": "role" },
|
|
5230
5333
|
this.getFilterSelectRole(),
|
|
5231
|
-
this.renderHandleRight()) : null,
|
|
5232
|
-
this.columnsVisibility.room ? react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.room, position: 'relative' }), "data-min": 100, "data-name": "room" },
|
|
5334
|
+
this.renderHandleRight())) : null,
|
|
5335
|
+
this.columnsVisibility.room ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.room, position: 'relative' }), "data-min": 100, "data-name": "room" },
|
|
5233
5336
|
this.getFilterSelectRoom(),
|
|
5234
|
-
this.renderHandleRight()) : null,
|
|
5235
|
-
this.columnsVisibility.func ? react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.func, position: 'relative' }), "data-min": 100, "data-name": "func" },
|
|
5337
|
+
this.renderHandleRight())) : null,
|
|
5338
|
+
this.columnsVisibility.func ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.func, position: 'relative' }), "data-min": 100, "data-name": "func" },
|
|
5236
5339
|
this.getFilterSelectFunction(),
|
|
5237
|
-
this.renderHandleRight()) : null),
|
|
5238
|
-
this.state.statesView && react_1.default.createElement(react_1.default.Fragment, null,
|
|
5340
|
+
this.renderHandleRight())) : null)),
|
|
5341
|
+
this.state.statesView && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5239
5342
|
react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.changedFrom, position: 'relative' }), "data-min": 100, "data-name": "changedFrom" },
|
|
5240
5343
|
this.props.t('ra_Changed from'),
|
|
5241
5344
|
this.renderHandleRight()),
|
|
@@ -5247,18 +5350,18 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5247
5350
|
this.renderHandleRight()),
|
|
5248
5351
|
react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.lastChange, position: 'relative' }), "data-min": 100, "data-name": "lastChange" },
|
|
5249
5352
|
this.props.t('ra_Last change'),
|
|
5250
|
-
this.renderHandleRight())),
|
|
5251
|
-
this.adapterColumns.map(item => react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility[item.id] }), title: item.adapter, key: item.id, "data-min": 100, "data-name": item.id }, item.name)),
|
|
5252
|
-
this.columnsVisibility.val ? react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.val, position: 'relative' }), "data-min": 120, "data-name": "val" },
|
|
5353
|
+
this.renderHandleRight()))),
|
|
5354
|
+
this.adapterColumns.map(item => (react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility[item.id] }), title: item.adapter, key: item.id, "data-min": 100, "data-name": item.id }, item.name))),
|
|
5355
|
+
this.columnsVisibility.val ? (react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.val, position: 'relative' }), "data-min": 120, "data-name": "val" },
|
|
5253
5356
|
this.props.t('ra_Value'),
|
|
5254
|
-
filterClearInValue) : null,
|
|
5255
|
-
this.columnsVisibility.buttons ? react_1.default.createElement("div", { title: this.texts.filter_custom, style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.buttons }) },
|
|
5357
|
+
filterClearInValue)) : null,
|
|
5358
|
+
this.columnsVisibility.buttons ? (react_1.default.createElement("div", { title: this.texts.filter_custom, style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.buttons }) },
|
|
5256
5359
|
' ',
|
|
5257
|
-
this.getFilterSelectCustoms()) : null);
|
|
5360
|
+
this.getFilterSelectCustoms())) : null));
|
|
5258
5361
|
}
|
|
5259
5362
|
renderToast() {
|
|
5260
|
-
return react_1.default.createElement(material_1.Snackbar, { open: !!this.state.toast, autoHideDuration: 3000, onClick: () => this.setState({ toast: '' }), onClose: () => this.setState({ toast: '' }), message: this.state.toast, action: react_1.default.createElement(material_1.IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: () => this.setState({ toast: '' }) },
|
|
5261
|
-
react_1.default.createElement(icons_material_1.Close, { fontSize: "small" })) });
|
|
5363
|
+
return (react_1.default.createElement(material_1.Snackbar, { open: !!this.state.toast, autoHideDuration: 3000, onClick: () => this.setState({ toast: '' }), onClose: () => this.setState({ toast: '' }), message: this.state.toast, action: react_1.default.createElement(material_1.IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: () => this.setState({ toast: '' }) },
|
|
5364
|
+
react_1.default.createElement(icons_material_1.Close, { fontSize: "small" })) }));
|
|
5262
5365
|
}
|
|
5263
5366
|
/**
|
|
5264
5367
|
* Called when component is updated.
|
|
@@ -5286,7 +5389,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5286
5389
|
renderCustomDialog() {
|
|
5287
5390
|
if (this.state.customDialog && this.props.objectCustomDialog) {
|
|
5288
5391
|
const ObjectCustomDialog = this.props.objectCustomDialog;
|
|
5289
|
-
return react_1.default.createElement(ObjectCustomDialog, { reportChangedIds: (changedIds) => (this.changedIds = [...changedIds]), objectIDs: this.state.customDialog, allVisibleObjects: !!this.state.customDialogAll, expertMode: this.state.filter.expertMode, isFloatComma: this.props.isFloatComma === undefined
|
|
5392
|
+
return (react_1.default.createElement(ObjectCustomDialog, { reportChangedIds: (changedIds) => (this.changedIds = [...changedIds]), objectIDs: this.state.customDialog, allVisibleObjects: !!this.state.customDialogAll, expertMode: this.state.filter.expertMode, isFloatComma: this.props.isFloatComma === undefined
|
|
5393
|
+
? this.systemConfig.common.isFloatComma
|
|
5394
|
+
: this.props.isFloatComma, t: this.props.t, lang: this.props.lang, socket: this.props.socket, themeName: this.props.themeName, themeType: this.props.themeType, theme: this.props.theme, objects: this.objects, customsInstances: this.info.customs, onClose: () => {
|
|
5290
5395
|
var _b;
|
|
5291
5396
|
this.pauseSubscribe(false);
|
|
5292
5397
|
this.setState({ customDialog: null });
|
|
@@ -5296,7 +5401,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5296
5401
|
this.forceUpdate();
|
|
5297
5402
|
}
|
|
5298
5403
|
(_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate('tab-objects');
|
|
5299
|
-
}, systemConfig: this.systemConfig });
|
|
5404
|
+
}, systemConfig: this.systemConfig }));
|
|
5300
5405
|
}
|
|
5301
5406
|
return null;
|
|
5302
5407
|
}
|
|
@@ -5315,7 +5420,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5315
5420
|
return null;
|
|
5316
5421
|
}
|
|
5317
5422
|
const ObjectBrowserEditObject = this.props.objectBrowserEditObject;
|
|
5318
|
-
return react_1.default.createElement(ObjectBrowserEditObject, { key: this.state.editObjectDialog, obj: this.objects[this.state.editObjectDialog], roleArray: this.info.roles, objects: this.objects, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
|
|
5423
|
+
return (react_1.default.createElement(ObjectBrowserEditObject, { key: this.state.editObjectDialog, obj: this.objects[this.state.editObjectDialog], roleArray: this.info.roles, objects: this.objects, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
|
|
5424
|
+
? this.systemConfig.common.isFloatComma
|
|
5425
|
+
: this.props.isFloatComma, themeType: this.props.themeType, theme: this.props.theme, socket: this.props.socket, dialogName: this.props.dialogName, aliasTab: this.state.editObjectAlias, t: this.props.t, expertMode: !!this.state.filter.expertMode, onNewObject: (obj) => this.props.socket
|
|
5319
5426
|
.setObject(obj._id, obj)
|
|
5320
5427
|
.then(() => this.setState({ editObjectDialog: obj._id, editObjectAlias: false }, () => this.onSelect(obj._id)))
|
|
5321
5428
|
.catch(e => this.showError(`Cannot write object: ${e}`)), onClose: (obj) => {
|
|
@@ -5339,28 +5446,28 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5339
5446
|
.catch(e => this.showError(`Cannot write object: ${e}`));
|
|
5340
5447
|
}
|
|
5341
5448
|
this.setState({ editObjectDialog: '', editObjectAlias: false });
|
|
5342
|
-
}, width: this.props.width });
|
|
5449
|
+
}, width: this.props.width }));
|
|
5343
5450
|
}
|
|
5344
5451
|
renderViewObjectFileDialog() {
|
|
5345
5452
|
if (!this.state.viewFileDialog || !this.props.objectBrowserViewFile) {
|
|
5346
5453
|
return null;
|
|
5347
5454
|
}
|
|
5348
5455
|
const ObjectBrowserViewFile = this.props.objectBrowserViewFile;
|
|
5349
|
-
return react_1.default.createElement(ObjectBrowserViewFile, { key: "viewFile", obj: this.objects[this.state.viewFileDialog], socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ viewFileDialog: '' }) });
|
|
5456
|
+
return (react_1.default.createElement(ObjectBrowserViewFile, { key: "viewFile", obj: this.objects[this.state.viewFileDialog], socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ viewFileDialog: '' }) }));
|
|
5350
5457
|
}
|
|
5351
5458
|
renderAliasEditorDialog() {
|
|
5352
5459
|
if (!this.props.objectBrowserAliasEditor || !this.state.showAliasEditor) {
|
|
5353
5460
|
return null;
|
|
5354
5461
|
}
|
|
5355
5462
|
const ObjectBrowserAliasEditor = this.props.objectBrowserAliasEditor;
|
|
5356
|
-
return react_1.default.createElement(ObjectBrowserAliasEditor, { key: "editAlias", obj: this.objects[this.state.showAliasEditor], objects: this.objects, socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ showAliasEditor: '' }), onRedirect: (id, timeout) => setTimeout(() => this.onSelect(id, false, () => this.expandAllSelected(() => {
|
|
5463
|
+
return (react_1.default.createElement(ObjectBrowserAliasEditor, { key: "editAlias", obj: this.objects[this.state.showAliasEditor], objects: this.objects, socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ showAliasEditor: '' }), onRedirect: (id, timeout) => setTimeout(() => this.onSelect(id, false, () => this.expandAllSelected(() => {
|
|
5357
5464
|
this.scrollToItem(id);
|
|
5358
5465
|
setTimeout(() => this.setState({
|
|
5359
5466
|
editObjectDialog: id,
|
|
5360
5467
|
showAliasEditor: '',
|
|
5361
5468
|
editObjectAlias: true,
|
|
5362
5469
|
}), 300);
|
|
5363
|
-
})), timeout || 0) });
|
|
5470
|
+
})), timeout || 0) }));
|
|
5364
5471
|
}
|
|
5365
5472
|
showAddDataPointDialog(id, initialType, initialStateType) {
|
|
5366
5473
|
this.setState({
|
|
@@ -5377,12 +5484,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5377
5484
|
if (!this.state.aliasMenu) {
|
|
5378
5485
|
return null;
|
|
5379
5486
|
}
|
|
5380
|
-
return react_1.default.createElement(material_1.Menu, { key: "aliasmenu", open: !0, anchorEl: window.document.getElementById(`alias_${this.state.aliasMenu}`), onClose: () => this.setState({ aliasMenu: '' }) }, this.info.aliasesMap[this.state.aliasMenu].map((aliasId, i) => react_1.default.createElement(material_1.MenuItem, { key: aliasId, onClick: () => this.onSelect(aliasId) },
|
|
5487
|
+
return (react_1.default.createElement(material_1.Menu, { key: "aliasmenu", open: !0, anchorEl: window.document.getElementById(`alias_${this.state.aliasMenu}`), onClose: () => this.setState({ aliasMenu: '' }) }, this.info.aliasesMap[this.state.aliasMenu].map((aliasId, i) => (react_1.default.createElement(material_1.MenuItem, { key: aliasId, onClick: () => this.onSelect(aliasId) },
|
|
5381
5488
|
react_1.default.createElement(material_1.ListItemText, null, this.renderAliasLink(this.state.aliasMenu, i, {
|
|
5382
5489
|
'& .admin-browser-arrow': {
|
|
5383
5490
|
mr: '8px',
|
|
5384
5491
|
},
|
|
5385
|
-
})))));
|
|
5492
|
+
})))))));
|
|
5386
5493
|
}
|
|
5387
5494
|
/**
|
|
5388
5495
|
* Renders the right mouse button context menu
|
|
@@ -5439,7 +5546,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5439
5546
|
visibility: !!(this.props.objectBrowserEditObject &&
|
|
5440
5547
|
obj &&
|
|
5441
5548
|
(this.state.filter.expertMode || _a.isNonExpertId(id))),
|
|
5442
|
-
icon: react_1.default.createElement(icons_material_1.Edit, { fontSize: "small", style: this.styles.contextMenuEdit }),
|
|
5549
|
+
icon: (react_1.default.createElement(icons_material_1.Edit, { fontSize: "small", style: this.styles.contextMenuEdit })),
|
|
5443
5550
|
label: this.texts.editObject,
|
|
5444
5551
|
onClick: () => this.setState({ editObjectDialog: item.data.id, showContextMenu: null, editObjectAlias: false }),
|
|
5445
5552
|
},
|
|
@@ -5452,7 +5559,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5452
5559
|
// @ts-expect-error deprecated from js-controller 6
|
|
5453
5560
|
((_b = obj.common) === null || _b === void 0 ? void 0 : _b.type) !== 'file' &&
|
|
5454
5561
|
(this.state.filter.expertMode || obj.common.write !== false)),
|
|
5455
|
-
icon: react_1.default.createElement(icons_material_1.FormatItalic, { fontSize: "small", style: this.styles.contextMenuEditValue }),
|
|
5562
|
+
icon: (react_1.default.createElement(icons_material_1.FormatItalic, { fontSize: "small", style: this.styles.contextMenuEditValue })),
|
|
5456
5563
|
label: this.props.t('ra_Edit value'),
|
|
5457
5564
|
onClick: () => {
|
|
5458
5565
|
this.edit = {
|
|
@@ -5465,10 +5572,11 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5465
5572
|
},
|
|
5466
5573
|
},
|
|
5467
5574
|
VIEW: {
|
|
5468
|
-
visibility: !!this.props.objectBrowserViewFile &&
|
|
5575
|
+
visibility: !!this.props.objectBrowserViewFile &&
|
|
5576
|
+
(obj === null || obj === void 0 ? void 0 : obj.type) === 'state' &&
|
|
5469
5577
|
// @ts-expect-error deprecated from js-controller 6
|
|
5470
5578
|
((_c = obj.common) === null || _c === void 0 ? void 0 : _c.type) === 'file',
|
|
5471
|
-
icon: react_1.default.createElement(icons_material_1.FindInPage, { fontSize: "small", style: this.styles.contextMenuView }),
|
|
5579
|
+
icon: (react_1.default.createElement(icons_material_1.FindInPage, { fontSize: "small", style: this.styles.contextMenuView })),
|
|
5472
5580
|
label: this.props.t('ra_View file'),
|
|
5473
5581
|
onClick: () => this.setState({ viewFileDialog: (obj === null || obj === void 0 ? void 0 : obj._id) || '', showContextMenu: null }),
|
|
5474
5582
|
},
|
|
@@ -5480,9 +5588,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5480
5588
|
obj.type === 'state' &&
|
|
5481
5589
|
// @ts-expect-error deprecated from js-controller 6
|
|
5482
5590
|
((_d = obj.common) === null || _d === void 0 ? void 0 : _d.type) !== 'file'),
|
|
5483
|
-
icon: react_1.default.createElement(icons_material_1.Settings, { fontSize: "small", style: item.data.hasCustoms
|
|
5591
|
+
icon: (react_1.default.createElement(icons_material_1.Settings, { fontSize: "small", style: item.data.hasCustoms
|
|
5484
5592
|
? this.styles.cellButtonsButtonWithCustoms
|
|
5485
|
-
: styles.cellButtonsButtonWithoutCustoms }),
|
|
5593
|
+
: styles.cellButtonsButtonWithoutCustoms })),
|
|
5486
5594
|
style: this.styles.contextMenuCustom,
|
|
5487
5595
|
label: this.texts.customConfig,
|
|
5488
5596
|
onClick: () => {
|
|
@@ -5509,14 +5617,14 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5509
5617
|
ROLE: {
|
|
5510
5618
|
key: '4',
|
|
5511
5619
|
visibility: !!(this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole),
|
|
5512
|
-
icon: react_1.default.createElement(icons_material_1.BorderColor, { fontSize: "small", style: this.styles.contextMenuRole }),
|
|
5620
|
+
icon: (react_1.default.createElement(icons_material_1.BorderColor, { fontSize: "small", style: this.styles.contextMenuRole })),
|
|
5513
5621
|
label: this.props.t('ra_Edit role'),
|
|
5514
5622
|
onClick: () => this.setState({ roleDialog: item.data.id, showContextMenu: null }),
|
|
5515
5623
|
},
|
|
5516
5624
|
FUNCTION: {
|
|
5517
5625
|
key: '5',
|
|
5518
5626
|
visibility: !!enumEditable,
|
|
5519
|
-
icon: react_1.default.createElement(icons_material_1.BedroomParent, { fontSize: "small", style: this.styles.contextMenuRole }),
|
|
5627
|
+
icon: (react_1.default.createElement(icons_material_1.BedroomParent, { fontSize: "small", style: this.styles.contextMenuRole })),
|
|
5520
5628
|
label: this.props.t('ra_Edit function'),
|
|
5521
5629
|
onClick: () => {
|
|
5522
5630
|
const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
|
|
@@ -5534,7 +5642,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5534
5642
|
ROOM: {
|
|
5535
5643
|
key: '6',
|
|
5536
5644
|
visibility: !!enumEditable,
|
|
5537
|
-
icon: react_1.default.createElement(icons_material_1.Construction, { fontSize: "small", style: this.styles.contextMenuRoom }),
|
|
5645
|
+
icon: (react_1.default.createElement(icons_material_1.Construction, { fontSize: "small", style: this.styles.contextMenuRoom })),
|
|
5538
5646
|
label: this.props.t('ra_Edit room'),
|
|
5539
5647
|
onClick: () => {
|
|
5540
5648
|
const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
|
|
@@ -5558,10 +5666,12 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5558
5666
|
(obj === null || obj === void 0 ? void 0 : obj.type) === 'state' &&
|
|
5559
5667
|
// @ts-expect-error deprecated from js-controller 6
|
|
5560
5668
|
((_e = obj.common) === null || _e === void 0 ? void 0 : _e.type) !== 'file'),
|
|
5561
|
-
icon: react_1.default.createElement(icons_material_1.Link, { style: ((_f = obj === null || obj === void 0 ? void 0 : obj.common) === null || _f === void 0 ? void 0 : _f.alias)
|
|
5669
|
+
icon: (react_1.default.createElement(icons_material_1.Link, { style: ((_f = obj === null || obj === void 0 ? void 0 : obj.common) === null || _f === void 0 ? void 0 : _f.alias)
|
|
5562
5670
|
? this.styles.cellButtonsButtonWithCustoms
|
|
5563
|
-
: styles.cellButtonsButtonWithoutCustoms }),
|
|
5564
|
-
label: this.info.aliasesMap[item.data.id]
|
|
5671
|
+
: styles.cellButtonsButtonWithoutCustoms })),
|
|
5672
|
+
label: this.info.aliasesMap[item.data.id]
|
|
5673
|
+
? this.props.t('ra_Edit alias')
|
|
5674
|
+
: this.props.t('ra_Create alias'),
|
|
5565
5675
|
onClick: () => {
|
|
5566
5676
|
var _b;
|
|
5567
5677
|
if ((_b = obj === null || obj === void 0 ? void 0 : obj.common) === null || _b === void 0 ? void 0 : _b.alias) {
|
|
@@ -5576,7 +5686,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5576
5686
|
key: '+',
|
|
5577
5687
|
visibility: (item.data.id.startsWith('0_userdata.0') || item.data.id.startsWith('javascript.')) &&
|
|
5578
5688
|
(createStateVisible || createChannelVisible || createDeviceVisible || createFolderVisible),
|
|
5579
|
-
icon: react_1.default.createElement(icons_material_1.Add, { fontSize: "small", style: this.styles.cellButtonsButtonWithCustoms }),
|
|
5689
|
+
icon: (react_1.default.createElement(icons_material_1.Add, { fontSize: "small", style: this.styles.cellButtonsButtonWithCustoms })),
|
|
5580
5690
|
style: styles.contextMenuWithSubMenu,
|
|
5581
5691
|
label: this.texts.create,
|
|
5582
5692
|
subMenu: [
|
|
@@ -5626,8 +5736,9 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5626
5736
|
},
|
|
5627
5737
|
DELETE: {
|
|
5628
5738
|
key: 'Delete',
|
|
5629
|
-
visibility: !!(this.props.onObjectDelete &&
|
|
5630
|
-
|
|
5739
|
+
visibility: !!(this.props.onObjectDelete &&
|
|
5740
|
+
(((_g = item.children) === null || _g === void 0 ? void 0 : _g.length) || (obj && !((_h = obj.common) === null || _h === void 0 ? void 0 : _h.dontDelete)))),
|
|
5741
|
+
icon: (react_1.default.createElement(icons_material_1.Delete, { fontSize: "small", style: this.styles.contextMenuDelete })),
|
|
5631
5742
|
style: this.styles.contextMenuDelete,
|
|
5632
5743
|
label: this.texts.deleteObject,
|
|
5633
5744
|
onClick: () => this.setState({ showContextMenu: null }, () => this.showDeleteDialog({
|
|
@@ -5641,14 +5752,15 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5641
5752
|
var _b, _c;
|
|
5642
5753
|
if (ITEMS[key].visibility) {
|
|
5643
5754
|
if (ITEMS[key].subMenu) {
|
|
5644
|
-
items.push(react_1.default.createElement(material_1.MenuItem, { key: key, href: "", onClick: (e) => this.state.showContextMenu &&
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5755
|
+
items.push(react_1.default.createElement(material_1.MenuItem, { key: key, href: "", onClick: (e) => this.state.showContextMenu &&
|
|
5756
|
+
this.setState({
|
|
5757
|
+
showContextMenu: {
|
|
5758
|
+
item: this.state.showContextMenu.item,
|
|
5759
|
+
position: this.state.showContextMenu.position,
|
|
5760
|
+
subItem: key,
|
|
5761
|
+
subAnchor: e.target,
|
|
5762
|
+
},
|
|
5763
|
+
}), style: ITEMS[key].style },
|
|
5652
5764
|
react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, ITEMS[key].iconStyle), ITEMS[key].listItemIconStyle) }, ITEMS[key].icon),
|
|
5653
5765
|
react_1.default.createElement(material_1.ListItemText, null,
|
|
5654
5766
|
ITEMS[key].label,
|
|
@@ -5666,16 +5778,16 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5666
5778
|
});
|
|
5667
5779
|
}
|
|
5668
5780
|
this.contextMenu = null;
|
|
5669
|
-
} }, (_c = ITEMS[key].subMenu) === null || _c === void 0 ? void 0 : _c.map(subItem =>
|
|
5781
|
+
} }, (_c = ITEMS[key].subMenu) === null || _c === void 0 ? void 0 : _c.map(subItem => subItem.visibility ? (react_1.default.createElement(material_1.MenuItem, { key: subItem.label, onClick: subItem.onClick, style: subItem.style },
|
|
5670
5782
|
react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, subItem.iconStyle), (subItem.listItemIconStyle || undefined)) }, subItem.icon),
|
|
5671
|
-
react_1.default.createElement(material_1.ListItemText, null, subItem.label)) : null)))
|
|
5783
|
+
react_1.default.createElement(material_1.ListItemText, null, subItem.label))) : null)));
|
|
5672
5784
|
}
|
|
5673
5785
|
}
|
|
5674
5786
|
else {
|
|
5675
5787
|
items.push(react_1.default.createElement(material_1.MenuItem, { key: key, onClick: ITEMS[key].onClick, sx: ITEMS[key].style },
|
|
5676
5788
|
react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, ITEMS[key].iconStyle), ITEMS[key].listItemIconStyle) }, ITEMS[key].icon),
|
|
5677
5789
|
react_1.default.createElement(material_1.ListItemText, null, ITEMS[key].label),
|
|
5678
|
-
ITEMS[key].key ? react_1.default.createElement("div", { style: styles.contextMenuKeys }, `Alt+${ITEMS[key].key === 'Delete' ? this.props.t('ra_Del') : ITEMS[key].key}`) : null));
|
|
5790
|
+
ITEMS[key].key ? (react_1.default.createElement("div", { style: styles.contextMenuKeys }, `Alt+${ITEMS[key].key === 'Delete' ? this.props.t('ra_Del') : ITEMS[key].key}`)) : null));
|
|
5679
5791
|
}
|
|
5680
5792
|
}
|
|
5681
5793
|
});
|
|
@@ -5683,7 +5795,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5683
5795
|
setTimeout(() => this.setState({ showContextMenu: null }), 100);
|
|
5684
5796
|
return null;
|
|
5685
5797
|
}
|
|
5686
|
-
return react_1.default.createElement(material_1.Menu, { key: "contextMenu", open: !0, onKeyUp: e => {
|
|
5798
|
+
return (react_1.default.createElement(material_1.Menu, { key: "contextMenu", open: !0, onKeyUp: e => {
|
|
5687
5799
|
e.preventDefault();
|
|
5688
5800
|
if (e.altKey) {
|
|
5689
5801
|
Object.keys(ITEMS).forEach(key => {
|
|
@@ -5695,7 +5807,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5695
5807
|
}, anchorReference: "anchorPosition", anchorPosition: this.state.showContextMenu.position, onClose: () => {
|
|
5696
5808
|
this.setState({ showContextMenu: null });
|
|
5697
5809
|
this.contextMenu = null;
|
|
5698
|
-
} }, items);
|
|
5810
|
+
} }, items));
|
|
5699
5811
|
}
|
|
5700
5812
|
renderEditValueDialog() {
|
|
5701
5813
|
var _b;
|
|
@@ -5715,12 +5827,14 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5715
5827
|
: typeof this.edit.val;
|
|
5716
5828
|
const role = this.objects[this.edit.id].common.role;
|
|
5717
5829
|
const ObjectBrowserValue = this.props.objectBrowserValue;
|
|
5718
|
-
return react_1.default.createElement(ObjectBrowserValue, { t: this.props.t, lang: this.props.lang, type: type, role: role || '', states: Utils_1.default.getStates(this.objects[this.edit.id]), themeType: this.props.themeType, theme: this.props.theme, expertMode: !!this.state.filter.expertMode, value: this.edit.val, socket: this.props.socket, object: this.objects[this.edit.id], defaultHistory: this.defaultHistory, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
|
|
5830
|
+
return (react_1.default.createElement(ObjectBrowserValue, { t: this.props.t, lang: this.props.lang, type: type, role: role || '', states: Utils_1.default.getStates(this.objects[this.edit.id]), themeType: this.props.themeType, theme: this.props.theme, expertMode: !!this.state.filter.expertMode, value: this.edit.val, socket: this.props.socket, object: this.objects[this.edit.id], defaultHistory: this.defaultHistory, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
|
|
5831
|
+
? this.systemConfig.common.isFloatComma
|
|
5832
|
+
: this.props.isFloatComma, onClose: (res) => {
|
|
5719
5833
|
this.setState({ updateOpened: false });
|
|
5720
5834
|
if (res) {
|
|
5721
5835
|
this.onUpdate(res);
|
|
5722
5836
|
}
|
|
5723
|
-
}, width: this.props.width });
|
|
5837
|
+
}, width: this.props.width }));
|
|
5724
5838
|
}
|
|
5725
5839
|
/**
|
|
5726
5840
|
* The rendering method of this component.
|
|
@@ -5776,7 +5890,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5776
5890
|
return react_1.default.createElement(material_1.CircularProgress, { key: `${this.props.dialogName}_c` });
|
|
5777
5891
|
}
|
|
5778
5892
|
const items = this.root ? this.renderItem(this.root, undefined) : null;
|
|
5779
|
-
return react_1.default.createElement(TabContainer_1.default, { key: this.props.dialogName },
|
|
5893
|
+
return (react_1.default.createElement(TabContainer_1.default, { key: this.props.dialogName },
|
|
5780
5894
|
react_1.default.createElement("style", null, `
|
|
5781
5895
|
@keyframes newValueAnimation-light {
|
|
5782
5896
|
0% {
|
|
@@ -5826,9 +5940,10 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5826
5940
|
this.renderErrorDialog(),
|
|
5827
5941
|
this.renderExportDialog(),
|
|
5828
5942
|
this.state.modalNewObj && this.props.modalNewObject && this.props.modalNewObject(this),
|
|
5829
|
-
this.state.modalEditOfAccess &&
|
|
5943
|
+
this.state.modalEditOfAccess &&
|
|
5944
|
+
this.state.modalEditOfAccessObjData &&
|
|
5830
5945
|
this.props.modalEditOfAccessControl &&
|
|
5831
|
-
this.props.modalEditOfAccessControl(this, this.state.modalEditOfAccessObjData));
|
|
5946
|
+
this.props.modalEditOfAccessControl(this, this.state.modalEditOfAccessObjData)));
|
|
5832
5947
|
}
|
|
5833
5948
|
}
|
|
5834
5949
|
exports.ObjectBrowserClass = ObjectBrowserClass;
|