@iobroker/gui-components 8.0.2 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +834 -543
- package/build/AdminConnection.js.map +1 -1
- package/build/Components/404.js +13 -13
- package/build/Components/404.js.map +1 -1
- package/build/Components/ColorPicker.js.map +1 -1
- package/build/Components/ComplexCron.js +2 -2
- package/build/Components/ComplexCron.js.map +1 -1
- package/build/Components/CopyToClipboard.js.map +1 -1
- package/build/Components/CustomModal.js +1 -1
- package/build/Components/CustomModal.js.map +1 -1
- package/build/Components/DeviceType/DeviceTypeIcon.js +1 -0
- package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -1
- package/build/Components/DeviceType/DeviceTypeSelector.js +2 -2
- package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -1
- package/build/Components/DeviceType/i18n/de.json +1 -0
- package/build/Components/DeviceType/i18n/en.json +1 -0
- package/build/Components/DeviceType/i18n/fr.json +1 -0
- package/build/Components/DeviceType/i18n/it.json +1 -0
- package/build/Components/DeviceType/i18n/nl.json +1 -0
- package/build/Components/DeviceType/i18n/pl.json +1 -0
- package/build/Components/DeviceType/i18n/pt.json +1 -0
- package/build/Components/DeviceType/i18n/ru.json +1 -0
- package/build/Components/DeviceType/i18n/uk.json +1 -0
- package/build/Components/DeviceType/i18n/zh-cn.json +1 -0
- package/build/Components/FileBrowser.d.ts +39 -4
- package/build/Components/FileBrowser.js +104 -11
- package/build/Components/FileBrowser.js.map +1 -1
- package/build/Components/FileViewer.js +2 -4
- package/build/Components/FileViewer.js.map +1 -1
- package/build/Components/Icon.d.ts +1 -3
- package/build/Components/Icon.js +11 -11
- package/build/Components/Icon.js.map +1 -1
- package/build/Components/Image.js +8 -4
- package/build/Components/Image.js.map +1 -1
- package/build/Components/InfoBox.js +1 -1
- package/build/Components/InfoBox.js.map +1 -1
- package/build/Components/IobUri.js +5 -5
- package/build/Components/IobUri.js.map +1 -1
- package/build/Components/Loader.d.ts +2 -3
- package/build/Components/Loader.js +25 -257
- package/build/Components/Loader.js.map +1 -1
- package/build/Components/Loaders/Community.d.ts +31 -0
- package/build/Components/Loaders/Community.js +265 -0
- package/build/Components/Loaders/Community.js.map +1 -0
- package/build/Components/Loaders/HA.d.ts +17 -0
- package/build/Components/Loaders/HA.js +99 -0
- package/build/Components/Loaders/HA.js.map +1 -0
- package/build/Components/Loaders/MV.js.map +1 -1
- package/build/Components/Loaders/NW.d.ts +17 -0
- package/build/Components/Loaders/NW.js +70 -0
- package/build/Components/Loaders/NW.js.map +1 -0
- package/build/Components/Loaders/PT.js +103 -103
- package/build/Components/Loaders/PT.js.map +1 -1
- package/build/Components/Loaders/Vendor.js +7 -7
- package/build/Components/Loaders/Vendor.js.map +1 -1
- package/build/Components/MDUtils.js.map +1 -1
- package/build/Components/ObjectBrowser.d.ts +25 -406
- package/build/Components/ObjectBrowser.js +460 -1543
- package/build/Components/ObjectBrowser.js.map +1 -1
- package/build/Components/Router.js.map +1 -1
- package/build/Components/SaveCloseButtons.js.map +1 -1
- package/build/Components/Schedule.d.ts +27 -1
- package/build/Components/Schedule.js +60 -50
- package/build/Components/Schedule.js.map +1 -1
- package/build/Components/SelectWithIcon.js +1 -1
- package/build/Components/SelectWithIcon.js.map +1 -1
- package/build/Components/SimpleCron/cronText.js.map +1 -1
- package/build/Components/SimpleCron/index.js +3 -3
- package/build/Components/SimpleCron/index.js.map +1 -1
- package/build/Components/TabContainer.js +7 -2
- package/build/Components/TabContainer.js.map +1 -1
- package/build/Components/TabContent.d.ts +1 -1
- package/build/Components/TabContent.js +5 -5
- package/build/Components/TabContent.js.map +1 -1
- package/build/Components/TabHeader.js +2 -2
- package/build/Components/TabHeader.js.map +1 -1
- package/build/Components/TableResize.js.map +1 -1
- package/build/Components/TextWithIcon.js.map +1 -1
- package/build/Components/TreeTable.d.ts +1 -0
- package/build/Components/TreeTable.js +16 -6
- package/build/Components/TreeTable.js.map +1 -1
- package/build/Components/UploadImage.js +305 -305
- package/build/Components/UploadImage.js.map +1 -1
- package/build/Components/Utils.d.ts +17 -3
- package/build/Components/Utils.js +167 -9
- package/build/Components/Utils.js.map +1 -1
- package/build/Components/objectBrowser.types.d.ts +496 -0
- package/build/Components/objectBrowserUtils.d.ts +170 -0
- package/build/Components/objectBrowserUtils.js +1375 -0
- package/build/Components/objectBrowserUtils.js.map +1 -0
- package/build/Connection.js.map +1 -1
- package/build/Dialogs/ComplexCron.js.map +1 -1
- package/build/Dialogs/Confirm.js.map +1 -1
- package/build/Dialogs/Cron.js.map +1 -1
- package/build/Dialogs/Error.js.map +1 -1
- package/build/Dialogs/Message.js.map +1 -1
- package/build/Dialogs/SelectFile.d.ts +1 -1
- package/build/Dialogs/SelectFile.js +1 -1
- package/build/Dialogs/SelectFile.js.map +1 -1
- package/build/Dialogs/SelectID.d.ts +1 -1
- package/build/Dialogs/SelectID.js +1 -1
- package/build/Dialogs/SelectID.js.map +1 -1
- package/build/Dialogs/SimpleCron.js.map +1 -1
- package/build/Dialogs/TextInput.js +1 -1
- package/build/Dialogs/TextInput.js.map +1 -1
- package/build/GenericApp.d.ts +6 -4
- package/build/GenericApp.js +22 -16
- package/build/GenericApp.js.map +1 -1
- package/build/Prompt.js +7 -7
- package/build/Prompt.js.map +1 -1
- package/build/Theme.js +57 -11
- package/build/Theme.js.map +1 -1
- package/build/assets/devices/parseNames.js +1 -0
- package/build/assets/devices/parseNames.js.map +1 -1
- package/build/assets/rooms/parseNames.js +1 -0
- package/build/assets/rooms/parseNames.js.map +1 -1
- package/build/dictionary.js.map +1 -1
- package/build/globals.d.ts +2 -0
- package/build/i18n/de.json +5 -66
- package/build/i18n/en.json +5 -66
- package/build/i18n/es.json +5 -66
- package/build/i18n/fr.json +5 -66
- package/build/i18n/it.json +5 -61
- package/build/i18n/nl.json +5 -61
- package/build/i18n/pl.json +5 -61
- package/build/i18n/pt.json +5 -61
- package/build/i18n/ru.json +5 -61
- package/build/i18n/uk.json +5 -61
- package/build/i18n/zh-cn.json +5 -61
- package/build/i18n.js +12 -15
- package/build/i18n.js.map +1 -1
- package/build/index.css +56 -56
- package/build/index.d.ts +9 -4
- package/build/index.js +5 -2
- package/build/index.js.map +1 -1
- package/build/modulefederation.admin.config.d.ts +1 -0
- package/build/modulefederation.admin.config.js +1 -1
- package/build/modulefederation.admin.config.js.map +1 -1
- package/build/types.d.ts +4 -84
- package/i18n/de.json +5 -66
- package/i18n/en.json +5 -66
- package/i18n/es.json +5 -66
- package/i18n/fr.json +5 -66
- package/i18n/it.json +5 -61
- package/i18n/nl.json +5 -61
- package/i18n/pl.json +5 -61
- package/i18n/pt.json +5 -61
- package/i18n/ru.json +5 -61
- package/i18n/uk.json +5 -61
- package/i18n/zh-cn.json +5 -61
- package/index.css +56 -56
- package/modulefederation.admin.config.d.ts +1 -0
- package/modulefederation.admin.config.js +1 -2
- package/package.json +50 -35
- package/tasksExample.ts +93 -0
- package/build/LegacyConnection.d.ts +0 -938
- package/build/LegacyConnection.js +0 -2849
- package/build/LegacyConnection.js.map +0 -1
- package/tasksExample.js +0 -91
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/gui-components",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "React components to develop ioBroker interfaces
|
|
3
|
+
"version": "10.0.1",
|
|
4
|
+
"description": "Shared React components (React 19 / MUI 9) to develop ioBroker interfaces. Successor of @iobroker/adapter-react-v5.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
7
7
|
"email": "dogafox@gmail.com"
|
|
@@ -9,22 +9,22 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"prepublishOnly": "npm run build",
|
|
11
11
|
"build:ts": "tsc -p tsconfig.build.json",
|
|
12
|
-
"build": "node tasks --0-clean && node tasks --2-copy && node tasks --3-patchReadme && npm run build:ts",
|
|
12
|
+
"build": "node tasks.ts --0-clean && node tasks.ts --2-copy && node tasks.ts --3-patchReadme && npm run build:ts",
|
|
13
13
|
"release": "release-script --noPush --yes --lf",
|
|
14
14
|
"release-patch": "release-script patch --yes --lf",
|
|
15
15
|
"release-minor": "release-script minor --yes --lf",
|
|
16
16
|
"release-major": "release-script major --yes --lf",
|
|
17
17
|
"update-packages": "npx -y npm-check-updates --upgrade",
|
|
18
|
-
"0-clean": "node tasks --0-clean",
|
|
18
|
+
"0-clean": "node tasks.ts --0-clean",
|
|
19
19
|
"1-build": "tsc -p tsconfig.build.json",
|
|
20
|
-
"2-copy": "node tasks --2-copy",
|
|
21
|
-
"3-patchReadme": "node tasks --3-patchReadme",
|
|
22
|
-
"npm": "npm i
|
|
20
|
+
"2-copy": "node tasks.ts --2-copy",
|
|
21
|
+
"3-patchReadme": "node tasks.ts --3-patchReadme",
|
|
22
|
+
"npm": "npm i",
|
|
23
23
|
"lint": "eslint -c eslint.config.mjs src"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "git+https://github.com/ioBroker/
|
|
27
|
+
"url": "git+https://github.com/ioBroker/adapter-react-v5.git"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
@@ -41,46 +41,61 @@
|
|
|
41
41
|
"i18n/",
|
|
42
42
|
"index.css",
|
|
43
43
|
"LICENSE",
|
|
44
|
-
"tasksExample.
|
|
44
|
+
"tasksExample.ts",
|
|
45
45
|
"craco-module-federation.js",
|
|
46
46
|
"modulefederation.admin.config.d.ts",
|
|
47
47
|
"modulefederation.admin.config.js"
|
|
48
48
|
],
|
|
49
49
|
"license": "MIT",
|
|
50
50
|
"bugs": {
|
|
51
|
-
"url": "https://github.com/ioBroker/
|
|
51
|
+
"url": "https://github.com/ioBroker/adapter-react-v5/issues"
|
|
52
52
|
},
|
|
53
|
-
"homepage": "https://github.com/ioBroker/
|
|
53
|
+
"homepage": "https://github.com/ioBroker/adapter-react-v5#readme",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@iobroker/
|
|
58
|
-
"@iobroker/
|
|
59
|
-
"@iobroker/
|
|
60
|
-
"@
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"@mui/material": "^6.5.0",
|
|
64
|
-
"@sentry/browser": "^10.8.0",
|
|
65
|
-
"cronstrue": "^2.61.0",
|
|
66
|
-
"file-selector": "^2.1.2",
|
|
55
|
+
"@iobroker/js-controller-common": "^7.2.2",
|
|
56
|
+
"@iobroker/js-controller-common-db": "^7.2.2",
|
|
57
|
+
"@iobroker/socket-client": "^5.2.1",
|
|
58
|
+
"@iobroker/type-detector": "^5.0.15",
|
|
59
|
+
"@iobroker/types": "^7.2.2",
|
|
60
|
+
"@sentry/browser": "^10.68.0",
|
|
61
|
+
"cronstrue": "^3.24.0",
|
|
62
|
+
"file-selector": "^4.0.2",
|
|
67
63
|
"react-color": "^2.19.3",
|
|
68
|
-
"react-colorful": "^5.
|
|
64
|
+
"react-colorful": "^5.8.0",
|
|
69
65
|
"react-cropper": "^2.3.3",
|
|
70
|
-
"react-dropzone": "^
|
|
71
|
-
"react-icons": "^5.
|
|
72
|
-
"react-inlinesvg": "^4.
|
|
66
|
+
"react-dropzone": "^19.1.1",
|
|
67
|
+
"react-icons": "^5.7.0",
|
|
68
|
+
"react-inlinesvg": "^4.5.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"react": "^19.0.0",
|
|
72
|
+
"react-dom": "^19.0.0",
|
|
73
|
+
"@mui/icons-material": "^9.0.0",
|
|
74
|
+
"@mui/material": "^9.0.0"
|
|
73
75
|
},
|
|
74
76
|
"devDependencies": {
|
|
75
|
-
"@alcalzone/release-script": "^5.
|
|
76
|
-
"@alcalzone/release-script-plugin-license": "^
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
77
|
+
"@alcalzone/release-script": "^5.2.1",
|
|
78
|
+
"@alcalzone/release-script-plugin-license": "^5.2.0",
|
|
79
|
+
"@emotion/react": "^11.14.0",
|
|
80
|
+
"@emotion/styled": "^11.14.1",
|
|
81
|
+
"@iobroker/build-tools": "^3.0.1",
|
|
82
|
+
"@iobroker/eslint-config": "^2.3.4",
|
|
83
|
+
"@mui/icons-material": "^9.2.0",
|
|
84
|
+
"@mui/material": "^9.2.0",
|
|
85
|
+
"@types/node": "^26.1.1",
|
|
86
|
+
"@types/react": "^19.2.17",
|
|
81
87
|
"@types/react-color": "^3.0.13",
|
|
82
|
-
"
|
|
88
|
+
"@types/react-dom": "^19.2.3",
|
|
89
|
+
"ajv": "^8.20.0",
|
|
90
|
+
"react": "^19.2.5",
|
|
91
|
+
"react-dom": "^19.2.5",
|
|
83
92
|
"ts-node": "^10.9.2",
|
|
84
|
-
"typescript": "~
|
|
93
|
+
"typescript": "~6.0.3"
|
|
94
|
+
},
|
|
95
|
+
"overrides": {
|
|
96
|
+
"react": "^19.2.5",
|
|
97
|
+
"react-dom": "^19.2.5",
|
|
98
|
+
"@types/react": "^19.2.17",
|
|
99
|
+
"@types/react-dom": "^19.2.3"
|
|
85
100
|
}
|
|
86
101
|
}
|
package/tasksExample.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-2026 bluefox <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Example of a build script for an adapter GUI that uses `@iobroker/gui-components`.
|
|
7
|
+
* Copy this file into the root of your adapter as `tasks.ts`.
|
|
8
|
+
*
|
|
9
|
+
* The GUI sources are expected in the `src` directory and are built with vite
|
|
10
|
+
* into `src/build` (see `build.outDir` in `src/vite.config.ts`).
|
|
11
|
+
* The result is copied into the `admin` directory of the adapter.
|
|
12
|
+
*
|
|
13
|
+
* It is executed directly by node (>= 22.18 / >= 23.6), which strips the types at load time,
|
|
14
|
+
* so it must stay CommonJS and use only erasable TypeScript syntax: the `typeof import(...)`
|
|
15
|
+
* annotations provide full typings while `require()` keeps `__dirname` available.
|
|
16
|
+
*/
|
|
17
|
+
'use strict';
|
|
18
|
+
|
|
19
|
+
const fs: typeof import('node:fs') = require('node:fs');
|
|
20
|
+
const {
|
|
21
|
+
deleteFoldersRecursive,
|
|
22
|
+
npmInstall,
|
|
23
|
+
buildReact,
|
|
24
|
+
copyFiles,
|
|
25
|
+
}: typeof import('@iobroker/build-tools') = require('@iobroker/build-tools');
|
|
26
|
+
|
|
27
|
+
const SRC = 'src';
|
|
28
|
+
|
|
29
|
+
/** Inline script in index.html that loads socket.io from the admin instance */
|
|
30
|
+
const SOCKET_IO_LOADER =
|
|
31
|
+
/<script>\s*(?:var|const|let)\s+script\s*=\s*document\.createElement\(["']script["']\)[\s\S]*?<\/script>/;
|
|
32
|
+
|
|
33
|
+
function copyAllFiles(): void {
|
|
34
|
+
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
35
|
+
|
|
36
|
+
copyFiles([`${SRC}/build/**/*`, `!${SRC}/build/**/*.map`], 'admin');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function clean(): void {
|
|
40
|
+
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
41
|
+
deleteFoldersRecursive(`${SRC}/build`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function installNpmLocal(): Promise<void> {
|
|
45
|
+
if (fs.existsSync(`${SRC}/node_modules`)) {
|
|
46
|
+
return Promise.resolve();
|
|
47
|
+
}
|
|
48
|
+
return npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* In the development mode socket.io is loaded from the admin instance on port 8081.
|
|
53
|
+
* In the production build it must be loaded from the admin instance that serves the GUI.
|
|
54
|
+
*/
|
|
55
|
+
function patchFiles(): void {
|
|
56
|
+
for (const file of [`${__dirname}/admin/index.html`, `${__dirname}/${SRC}/build/index.html`]) {
|
|
57
|
+
if (fs.existsSync(file)) {
|
|
58
|
+
const code = fs.readFileSync(file).toString('utf8');
|
|
59
|
+
fs.writeFileSync(
|
|
60
|
+
file,
|
|
61
|
+
code.replace(
|
|
62
|
+
SOCKET_IO_LOADER,
|
|
63
|
+
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (process.argv.find(arg => arg === '--0-clean')) {
|
|
71
|
+
clean();
|
|
72
|
+
} else if (process.argv.find(arg => arg === '--1-npm')) {
|
|
73
|
+
npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`).catch((e: unknown) => {
|
|
74
|
+
console.error(`Cannot install: ${e}`);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
});
|
|
77
|
+
} else if (process.argv.find(arg => arg === '--2-build')) {
|
|
78
|
+
buildReact(SRC, { rootDir: __dirname, vite: true }).catch((e: unknown) => {
|
|
79
|
+
console.error(`Cannot build: ${e}`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
});
|
|
82
|
+
} else if (process.argv.find(arg => arg === '--3-copy')) {
|
|
83
|
+
copyAllFiles();
|
|
84
|
+
} else if (process.argv.find(arg => arg === '--4-patch')) {
|
|
85
|
+
patchFiles();
|
|
86
|
+
} else {
|
|
87
|
+
clean();
|
|
88
|
+
|
|
89
|
+
installNpmLocal()
|
|
90
|
+
.then(() => buildReact(SRC, { rootDir: __dirname, vite: true }))
|
|
91
|
+
.then(() => copyAllFiles())
|
|
92
|
+
.then(() => patchFiles());
|
|
93
|
+
}
|