@iobroker/json-config 7.4.22 → 7.5.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.
Files changed (66) hide show
  1. package/build/JsonConfig.d.ts +1 -1
  2. package/build/JsonConfigComponent/ConfigAccordion.d.ts +1 -1
  3. package/build/JsonConfigComponent/ConfigAlive.d.ts +1 -1
  4. package/build/JsonConfigComponent/ConfigAutocomplete.d.ts +1 -1
  5. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +1 -1
  6. package/build/JsonConfigComponent/ConfigCRON.d.ts +1 -1
  7. package/build/JsonConfigComponent/ConfigCertCollection.d.ts +1 -1
  8. package/build/JsonConfigComponent/ConfigCertificateSelect.d.ts +1 -1
  9. package/build/JsonConfigComponent/ConfigCertificates.d.ts +1 -1
  10. package/build/JsonConfigComponent/ConfigCheckLicense.d.ts +1 -1
  11. package/build/JsonConfigComponent/ConfigCheckbox.d.ts +1 -1
  12. package/build/JsonConfigComponent/ConfigChip.d.ts +1 -1
  13. package/build/JsonConfigComponent/ConfigColor.d.ts +1 -1
  14. package/build/JsonConfigComponent/ConfigCoordinates.d.ts +1 -1
  15. package/build/JsonConfigComponent/ConfigCustom.d.ts +1 -1
  16. package/build/JsonConfigComponent/ConfigCustom.js +1 -16
  17. package/build/JsonConfigComponent/ConfigCustom.js.map +1 -1
  18. package/build/JsonConfigComponent/ConfigDatePicker.d.ts +1 -1
  19. package/build/JsonConfigComponent/ConfigDeviceManager.d.ts +1 -1
  20. package/build/JsonConfigComponent/ConfigFile.d.ts +1 -1
  21. package/build/JsonConfigComponent/ConfigFileSelector.d.ts +1 -1
  22. package/build/JsonConfigComponent/ConfigFunc.d.ts +1 -1
  23. package/build/JsonConfigComponent/ConfigGeneric.d.ts +1 -1
  24. package/build/JsonConfigComponent/ConfigIP.d.ts +1 -1
  25. package/build/JsonConfigComponent/ConfigImageSendTo.d.ts +1 -1
  26. package/build/JsonConfigComponent/ConfigImageUpload.d.ts +1 -1
  27. package/build/JsonConfigComponent/ConfigInstanceSelect.d.ts +1 -1
  28. package/build/JsonConfigComponent/ConfigInterface.d.ts +1 -1
  29. package/build/JsonConfigComponent/ConfigJsonEditor.d.ts +1 -1
  30. package/build/JsonConfigComponent/ConfigLanguage.d.ts +1 -1
  31. package/build/JsonConfigComponent/ConfigLicense.d.ts +1 -1
  32. package/build/JsonConfigComponent/ConfigNumber.d.ts +1 -1
  33. package/build/JsonConfigComponent/ConfigObjectId.d.ts +1 -1
  34. package/build/JsonConfigComponent/ConfigPanel.d.ts +1 -1
  35. package/build/JsonConfigComponent/ConfigPanel.js +1 -1
  36. package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
  37. package/build/JsonConfigComponent/ConfigPassword.d.ts +1 -1
  38. package/build/JsonConfigComponent/ConfigPattern.d.ts +1 -1
  39. package/build/JsonConfigComponent/ConfigPort.d.ts +1 -1
  40. package/build/JsonConfigComponent/ConfigQrCode.d.ts +1 -1
  41. package/build/JsonConfigComponent/ConfigRoom.d.ts +1 -1
  42. package/build/JsonConfigComponent/ConfigSelect.d.ts +1 -1
  43. package/build/JsonConfigComponent/ConfigSelectSendTo.d.ts +1 -1
  44. package/build/JsonConfigComponent/ConfigSendto.d.ts +1 -1
  45. package/build/JsonConfigComponent/ConfigSetState.d.ts +1 -1
  46. package/build/JsonConfigComponent/ConfigSlider.d.ts +1 -1
  47. package/build/JsonConfigComponent/ConfigState.d.ts +1 -1
  48. package/build/JsonConfigComponent/ConfigStaticDivider.d.ts +1 -1
  49. package/build/JsonConfigComponent/ConfigStaticHeader.d.ts +1 -1
  50. package/build/JsonConfigComponent/ConfigStaticImage.d.ts +1 -1
  51. package/build/JsonConfigComponent/ConfigStaticInfo.d.ts +1 -1
  52. package/build/JsonConfigComponent/ConfigStaticText.d.ts +1 -1
  53. package/build/JsonConfigComponent/ConfigTable.d.ts +1 -1
  54. package/build/JsonConfigComponent/ConfigTable.js +5 -2
  55. package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
  56. package/build/JsonConfigComponent/ConfigTabs.d.ts +2 -1
  57. package/build/JsonConfigComponent/ConfigTabs.js +26 -13
  58. package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
  59. package/build/JsonConfigComponent/ConfigText.d.ts +1 -1
  60. package/build/JsonConfigComponent/ConfigTextSendTo.d.ts +1 -1
  61. package/build/JsonConfigComponent/ConfigTimePicker.d.ts +1 -1
  62. package/build/JsonConfigComponent/ConfigTopic.d.ts +1 -1
  63. package/build/JsonConfigComponent/ConfigUUID.d.ts +1 -1
  64. package/build/JsonConfigComponent/ConfigUser.d.ts +1 -1
  65. package/build/JsonConfigComponent/index.d.ts +1 -1
  66. package/package.json +3 -4
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { I18n, Router, type AdminConnection, type IobTheme, type ThemeName, type ThemeType } from '@iobroker/adapter-react-v5';
3
- import type { ConfigItemAny, ConfigItemPanel, ConfigItemTabs } from '#JC/types';
3
+ import type { ConfigItemAny, ConfigItemPanel, ConfigItemTabs } from './types';
4
4
  import { type DeviceManagerPropsProps } from './JsonConfigComponent/ConfigGeneric';
5
5
  interface JsonConfigProps {
6
6
  adapterName: string;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemAccordion } from '#JC/types';
2
+ import type { ConfigItemAccordion } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigAccordionProps extends ConfigGenericProps {
5
5
  schema: ConfigItemAccordion;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemAlive } from '#JC/types';
2
+ import type { ConfigItemAlive } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigAliveProps extends ConfigGenericProps {
5
5
  schema: ConfigItemAlive;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemAutocomplete } from '#JC/types';
2
+ import type { ConfigItemAutocomplete } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric';
4
4
  export interface ConfigAutocompleteProps extends ConfigGenericProps {
5
5
  schema: ConfigItemAutocomplete;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemAutocompleteSendTo } from '#JC/types';
2
+ import type { ConfigItemAutocompleteSendTo } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps } from './ConfigGeneric';
4
4
  import type { ConfigAutocompleteState } from './ConfigAutocomplete';
5
5
  interface ConfigAutocompleteSendToProps extends ConfigGenericProps {
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCRON } from '#JC/types';
2
+ import type { ConfigItemCRON } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigCRONProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCRON;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCertCollection } from '#JC/types';
2
+ import type { ConfigItemCertCollection } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigCertCollectionProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCertCollection;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCertificateSelect } from '#JC/types';
2
+ import type { ConfigItemCertificateSelect } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigCertificateSelectProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCertificateSelect;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCertificates } from '#JC/types';
2
+ import type { ConfigItemCertificates } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigCertificatesProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCertificates;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCheckLicense } from '#JC/types';
2
+ import type { ConfigItemCheckLicense } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  export interface License {
5
5
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCheckbox } from '#JC/types';
2
+ import type { ConfigItemCheckbox } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigCheckboxProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCheckbox;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemChip } from '#JC/types';
2
+ import type { ConfigItemChip } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigChipProps extends ConfigGenericProps {
5
5
  schema: ConfigItemChip;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemText } from '#JC/types';
2
+ import type { ConfigItemText } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigColorProps extends ConfigGenericProps {
5
5
  schema: ConfigItemText;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemCoordinates } from '#JC/types';
2
+ import type { ConfigItemCoordinates } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigCoordinatesProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCoordinates;
@@ -1,5 +1,5 @@
1
1
  import React, { type JSX } from 'react';
2
- import type { ConfigItemCustom } from '#JC/types';
2
+ import type { ConfigItemCustom } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from '../JsonConfigComponent/ConfigGeneric';
4
4
  interface ConfigCustomProps extends ConfigGenericProps {
5
5
  schema: ConfigItemCustom;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Grid2, LinearProgress } from '@mui/material';
2
+ import { LinearProgress } from '@mui/material';
3
3
  import { I18n } from '@iobroker/adapter-react-v5';
4
4
  import ConfigGeneric from '../JsonConfigComponent/ConfigGeneric';
5
5
  const getOrLoadRemote = (remote, shareScope, remoteFallbackUrl) => new Promise((resolve, reject) => {
@@ -190,21 +190,6 @@ export default class ConfigCustom extends ConfigGeneric {
190
190
  let item = CustomComponent ? (React.createElement(CustomComponent, { ...this.props,
191
191
  // @ts-expect-error BF (2024-12-18) Remove after the 7.4 will be mainstream. All following lines
192
192
  socket: this.props.oContext.socket, theme: this.props.oContext.theme, themeType: this.props.oContext.themeType, instance: this.props.oContext.instance, adapterName: this.props.oContext.adapterName, systemConfig: this.props.oContext.systemConfig, forceUpdate: this.props.oContext.forceUpdate })) : this.state.error ? (React.createElement("div", null, this.state.error)) : (React.createElement(LinearProgress, null));
193
- // If any widths are defined
194
- if (schema.xs || schema.sm || schema.md || schema.lg || schema.xl) {
195
- item = (React.createElement(Grid2, { size: {
196
- xs: schema.xs || 12,
197
- sm: schema.sm || undefined,
198
- md: schema.md || undefined,
199
- lg: schema.lg || undefined,
200
- xl: schema.xl || undefined,
201
- }, style: {
202
- marginBottom: 0,
203
- textAlign: 'left',
204
- ...schema.style,
205
- ...(this.props.oContext.themeType === 'dark' ? schema.darkStyle : {}),
206
- } }, item));
207
- }
208
193
  if (schema.newLine) {
209
194
  return (React.createElement(React.Fragment, null,
210
195
  React.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigCustom.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigCustom.tsx"],"names":[],"mappings":"AAAA,OAAO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,KAAK,CAAO,CAChC,CAAC,CAAC,CAAC,CACA,oBAAC,cAAc,OAAG,CACrB,CAAC;QAEF,4BAA4B;QAC5B,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;YAChE,IAAI,GAAG,CACH,oBAAC,KAAK,IACF,IAAI,EAAE;oBACF,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE;oBACnB,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;iBAC7B,EACD,KAAK,EAAE;oBACH,YAAY,EAAE,CAAC;oBACf,SAAS,EAAE,MAAM;oBACjB,GAAG,MAAM,CAAC,KAAK;oBACf,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;iBACxE,IAEA,IAAI,CACD,CACX,CAAC;QACN,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CACH;gBACI,6BAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI;gBAC/C,IAAI,CACN,CACN,CAAC;QACN,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC","sourcesContent":["import React, { type JSX } from 'react';\nimport { Grid2, LinearProgress } from '@mui/material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemCustom } from '#JC/types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from '#JC/JsonConfigComponent/ConfigGeneric';\n\nconst getOrLoadRemote = (\n remote: string,\n shareScope: string,\n remoteFallbackUrl?: string,\n): Promise<{ get: (module: string) => () => Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> }> =>\n new Promise((resolve, reject) => {\n // check if remote exists on the global `window`object\n if (!(window as any)[remote]) {\n // search dom to see if remote tag exists, but might still be loading (async)\n const existingRemote: HTMLScriptElement = document.querySelector(`script[data-webpack=\"${remote}\"]`);\n // when remote is loaded.\n const onload = async (): Promise<void> => {\n // check if it was initialized\n if ((window as any)[remote]) {\n if (!(window as any)[remote].__initialized) {\n // if share scope doesn't exist (like in webpack 4) then expect shareScope to be a manual object\n // @ts-expect-error it is a trick and must be so\n if (typeof __webpack_share_scopes__ === 'undefined') {\n // use a default share scope object passed in manually\n await (window as any)[remote].init(shareScope);\n } else {\n // otherwise, init share scope as usual\n // @ts-expect-error it is a trick and must be so\n await (window as any)[remote].init((__webpack_share_scopes__ as any)[shareScope]);\n }\n // mark remote as initialized\n (window as any)[remote].__initialized = true;\n }\n } else {\n console.error(`Cannot load ${remote}`);\n reject(new Error(`Cannot load ${remote}`));\n return;\n }\n // resolve promise so marking remote as loaded\n resolve((window as any)[remote]);\n };\n\n if (existingRemote) {\n // if existing remote but not loaded, hook into its onload and wait for it to be ready\n existingRemote.onload = onload;\n existingRemote.onerror = reject;\n // check if remote fallback exists as param passed to function\n // TODO: should scan public config for a matching key if no override exists\n } else if (remoteFallbackUrl) {\n // inject remote if a fallback exists and call the same onload function\n const d = document;\n const script = d.createElement('script');\n script.type = 'text/javascript';\n // mark as data-webpack so runtime can track it internally\n script.setAttribute('data-webpack', `${remote}`);\n script.async = true;\n script.onerror = reject;\n script.onload = onload;\n script.src = remoteFallbackUrl;\n d.getElementsByTagName('head')[0].appendChild(script);\n } else {\n // no remote and no fallback exist, reject\n reject(new Error(`Cannot Find Remote ${remote} to inject`));\n }\n } else {\n // remote already instantiated, resolve\n resolve((window as any)[remote]);\n }\n });\n\nfunction loadComponent(\n remote: string,\n sharedScope: string,\n module: string,\n url: string,\n): () => Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> {\n return async (): Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> => {\n const container = await getOrLoadRemote(remote, sharedScope, url);\n // eslint-disable-next-line @typescript-eslint/await-thenable\n const factory = await container.get(module);\n return factory();\n };\n}\n\ninterface ConfigCustomProps extends ConfigGenericProps {\n schema: ConfigItemCustom;\n}\n\ninterface ConfigCustomState extends ConfigGenericState {\n Component: React.FC<ConfigGenericProps> | null;\n error: string;\n}\n\nexport default class ConfigCustom extends ConfigGeneric<ConfigCustomProps, ConfigCustomState> {\n static runningLoads: Record<string, Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }>> = {};\n\n constructor(props: ConfigCustomProps) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n Object.assign(this.state, {\n Component: null,\n error: '',\n });\n }\n\n // load component dynamically\n async componentDidMount(): Promise<void> {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n /*\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else\n */\n if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;\n }\n const [uniqueName, fileToLoad, ...componentNameParts] = this.props.schema.name.split('/');\n const componentName = componentNameParts.join('/');\n if (!url) {\n console.error(\n 'Cannot find URL for custom component! Please define \"url\" as \"custom/customComponents.js\" in the schema',\n );\n return;\n }\n if (!uniqueName || !fileToLoad || !componentName) {\n console.error(\n 'Invalid format of \"name\"! Please define \"name\" as \"ConfigCustomBackItUpSet/Components/AdapterExist\" in the schema',\n );\n return;\n }\n let setPromise: Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> | undefined =\n ConfigCustom.runningLoads[`${url}!${fileToLoad}`];\n\n if (!(setPromise instanceof Promise)) {\n let i18nPromise: Promise<void> | undefined;\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL: string;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = I18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n i18nPromise = fetch(file)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(error => {\n if (lang !== 'en') {\n // try to load English\n fetch(`${i18nURL}/i18n/en.json`)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(err => console.log(`Cannot load i18n \"${file}\": ${err}`));\n return;\n }\n console.log(`Cannot load i18n \"${file}\": ${error}`);\n });\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n I18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n try {\n console.log(uniqueName, fileToLoad, componentName);\n setPromise = loadComponent(\n uniqueName,\n 'default',\n fileToLoad.startsWith('http://') || fileToLoad.startsWith('https://') || fileToLoad.startsWith('.')\n ? fileToLoad\n : `./${fileToLoad}`,\n url,\n )();\n if (i18nPromise instanceof Promise) {\n setPromise = Promise.all([setPromise, i18nPromise]).then(result => result[0]);\n }\n // remember promise\n ConfigCustom.runningLoads[`${url}!${fileToLoad}`] = setPromise;\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n try {\n const component: Record<string, React.FC<ConfigGenericProps>> = (await setPromise).default;\n\n if (!component?.[componentName]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({\n error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}`,\n });\n } else {\n this.setState({ Component: component[componentName] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render(): JSX.Element {\n const CustomComponent: React.FC<ConfigGenericProps> = this.state.Component;\n const schema = this.props.schema || ({} as ConfigItemCustom);\n\n let item = CustomComponent ? (\n <CustomComponent\n {...this.props}\n // @ts-expect-error BF (2024-12-18) Remove after the 7.4 will be mainstream. All following lines\n socket={this.props.oContext.socket}\n theme={this.props.oContext.theme}\n themeType={this.props.oContext.themeType}\n instance={this.props.oContext.instance}\n adapterName={this.props.oContext.adapterName}\n systemConfig={this.props.oContext.systemConfig}\n forceUpdate={this.props.oContext.forceUpdate}\n />\n ) : this.state.error ? (\n <div>{this.state.error}</div>\n ) : (\n <LinearProgress />\n );\n\n // If any widths are defined\n if (schema.xs || schema.sm || schema.md || schema.lg || schema.xl) {\n item = (\n <Grid2\n size={{\n xs: schema.xs || 12,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n style={{\n marginBottom: 0,\n textAlign: 'left',\n ...schema.style,\n ...(this.props.oContext.themeType === 'dark' ? schema.darkStyle : {}),\n }}\n >\n {item}\n </Grid2>\n );\n }\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n\n return item;\n }\n}\n"]}
1
+ {"version":3,"file":"ConfigCustom.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigCustom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAS,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,aAAmE,MAAM,uCAAuC,CAAC;AAExH,MAAM,eAAe,GAAG,CACpB,MAAc,EACd,UAAkB,EAClB,iBAA0B,EACoF,EAAE,CAChH,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE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X } from 'react';\nimport { Grid2, LinearProgress } from '@mui/material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemCustom } from '#JC/types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from '#JC/JsonConfigComponent/ConfigGeneric';\n\nconst getOrLoadRemote = (\n remote: string,\n shareScope: string,\n remoteFallbackUrl?: string,\n): Promise<{ get: (module: string) => () => Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> }> =>\n new Promise((resolve, reject) => {\n // check if remote exists on the global `window`object\n if (!(window as any)[remote]) {\n // search dom to see if remote tag exists, but might still be loading (async)\n const existingRemote: HTMLScriptElement = document.querySelector(`script[data-webpack=\"${remote}\"]`);\n // when remote is loaded.\n const onload = async (): Promise<void> => {\n // check if it was initialized\n if ((window as any)[remote]) {\n if (!(window as any)[remote].__initialized) {\n // if share scope doesn't exist (like in webpack 4) then expect shareScope to be a manual object\n // @ts-expect-error it is a trick and must be so\n if (typeof __webpack_share_scopes__ === 'undefined') {\n // use a default share scope object passed in manually\n await (window as any)[remote].init(shareScope);\n } else {\n // otherwise, init share scope as usual\n // @ts-expect-error it is a trick and must be so\n await (window as any)[remote].init((__webpack_share_scopes__ as any)[shareScope]);\n }\n // mark remote as initialized\n (window as any)[remote].__initialized = true;\n }\n } else {\n console.error(`Cannot load ${remote}`);\n reject(new Error(`Cannot load ${remote}`));\n return;\n }\n // resolve promise so marking remote as loaded\n resolve((window as any)[remote]);\n };\n\n if (existingRemote) {\n // if existing remote but not loaded, hook into its onload and wait for it to be ready\n existingRemote.onload = onload;\n existingRemote.onerror = reject;\n // check if remote fallback exists as param passed to function\n // TODO: should scan public config for a matching key if no override exists\n } else if (remoteFallbackUrl) {\n // inject remote if a fallback exists and call the same onload function\n const d = document;\n const script = d.createElement('script');\n script.type = 'text/javascript';\n // mark as data-webpack so runtime can track it internally\n script.setAttribute('data-webpack', `${remote}`);\n script.async = true;\n script.onerror = reject;\n script.onload = onload;\n script.src = remoteFallbackUrl;\n d.getElementsByTagName('head')[0].appendChild(script);\n } else {\n // no remote and no fallback exist, reject\n reject(new Error(`Cannot Find Remote ${remote} to inject`));\n }\n } else {\n // remote already instantiated, resolve\n resolve((window as any)[remote]);\n }\n });\n\nfunction loadComponent(\n remote: string,\n sharedScope: string,\n module: string,\n url: string,\n): () => Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> {\n return async (): Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> => {\n const container = await getOrLoadRemote(remote, sharedScope, url);\n // eslint-disable-next-line @typescript-eslint/await-thenable\n const factory = await container.get(module);\n return factory();\n };\n}\n\ninterface ConfigCustomProps extends ConfigGenericProps {\n schema: ConfigItemCustom;\n}\n\ninterface ConfigCustomState extends ConfigGenericState {\n Component: React.FC<ConfigGenericProps> | null;\n error: string;\n}\n\nexport default class ConfigCustom extends ConfigGeneric<ConfigCustomProps, ConfigCustomState> {\n static runningLoads: Record<string, Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }>> = {};\n\n constructor(props: ConfigCustomProps) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n Object.assign(this.state, {\n Component: null,\n error: '',\n });\n }\n\n // load component dynamically\n async componentDidMount(): Promise<void> {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n /*\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else\n */\n if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;\n }\n const [uniqueName, fileToLoad, ...componentNameParts] = this.props.schema.name.split('/');\n const componentName = componentNameParts.join('/');\n if (!url) {\n console.error(\n 'Cannot find URL for custom component! Please define \"url\" as \"custom/customComponents.js\" in the schema',\n );\n return;\n }\n if (!uniqueName || !fileToLoad || !componentName) {\n console.error(\n 'Invalid format of \"name\"! Please define \"name\" as \"ConfigCustomBackItUpSet/Components/AdapterExist\" in the schema',\n );\n return;\n }\n let setPromise: Promise<{ default: Record<string, React.FC<ConfigGenericProps>> }> | undefined =\n ConfigCustom.runningLoads[`${url}!${fileToLoad}`];\n\n if (!(setPromise instanceof Promise)) {\n let i18nPromise: Promise<void> | undefined;\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL: string;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = I18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n i18nPromise = fetch(file)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(error => {\n if (lang !== 'en') {\n // try to load English\n fetch(`${i18nURL}/i18n/en.json`)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(err => console.log(`Cannot load i18n \"${file}\": ${err}`));\n return;\n }\n console.log(`Cannot load i18n \"${file}\": ${error}`);\n });\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n I18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n try {\n console.log(uniqueName, fileToLoad, componentName);\n setPromise = loadComponent(\n uniqueName,\n 'default',\n fileToLoad.startsWith('http://') || fileToLoad.startsWith('https://') || fileToLoad.startsWith('.')\n ? fileToLoad\n : `./${fileToLoad}`,\n url,\n )();\n if (i18nPromise instanceof Promise) {\n setPromise = Promise.all([setPromise, i18nPromise]).then(result => result[0]);\n }\n // remember promise\n ConfigCustom.runningLoads[`${url}!${fileToLoad}`] = setPromise;\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n try {\n const component: Record<string, React.FC<ConfigGenericProps>> = (await setPromise).default;\n\n if (!component?.[componentName]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({\n error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}`,\n });\n } else {\n this.setState({ Component: component[componentName] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render(): JSX.Element {\n const CustomComponent: React.FC<ConfigGenericProps> = this.state.Component;\n const schema = this.props.schema || ({} as ConfigItemCustom);\n\n let item = CustomComponent ? (\n <CustomComponent\n {...this.props}\n // @ts-expect-error BF (2024-12-18) Remove after the 7.4 will be mainstream. All following lines\n socket={this.props.oContext.socket}\n theme={this.props.oContext.theme}\n themeType={this.props.oContext.themeType}\n instance={this.props.oContext.instance}\n adapterName={this.props.oContext.adapterName}\n systemConfig={this.props.oContext.systemConfig}\n forceUpdate={this.props.oContext.forceUpdate}\n />\n ) : this.state.error ? (\n <div>{this.state.error}</div>\n ) : (\n <LinearProgress />\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n\n return item;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemDatePicker } from '#JC/types';
2
+ import type { ConfigItemDatePicker } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps } from './ConfigGeneric';
4
4
  interface ConfigDatePickerProps extends ConfigGenericProps {
5
5
  schema: ConfigItemDatePicker;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemDeviceManager } from '#JC/types';
2
+ import type { ConfigItemDeviceManager } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigDeviceManagerProps extends ConfigGenericProps {
5
5
  schema: ConfigItemDeviceManager;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemFile } from '#JC/types';
2
+ import type { ConfigItemFile } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigFileProps extends ConfigGenericProps {
5
5
  schema: ConfigItemFile;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemFileSelector } from '#JC/types';
2
+ import type { ConfigItemFileSelector } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigFileSelectorProps extends ConfigGenericProps {
5
5
  schema: ConfigItemFileSelector;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemFunc } from '#JC/types';
2
+ import type { ConfigItemFunc } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigFuncProps extends ConfigGenericProps {
5
5
  schema: ConfigItemFunc;
@@ -1,6 +1,6 @@
1
1
  import React, { Component, type JSX } from 'react';
2
2
  import { type Connection, type ThemeType, type ThemeName, type IobTheme } from '@iobroker/adapter-react-v5';
3
- import type { ConfigIconType, ConfigItemAny, ConfigItemConfirmData, JsonConfigContext } from '#JC/types';
3
+ import type { ConfigIconType, ConfigItemAny, ConfigItemConfirmData, JsonConfigContext } from '../types';
4
4
  export declare function isObject(it: any): it is Record<string, any>;
5
5
  export interface DeviceManagerPropsProps {
6
6
  socket: Connection;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemIP } from '#JC/types';
2
+ import type { ConfigItemIP } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigIPProps extends ConfigGenericProps {
5
5
  schema: ConfigItemIP;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemImageSendTo } from '#JC/types';
2
+ import type { ConfigItemImageSendTo } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigImageSendToProps extends ConfigGenericProps {
5
5
  schema: ConfigItemImageSendTo;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemImageUpload } from '#JC/types';
2
+ import type { ConfigItemImageUpload } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigImageUploadProps extends ConfigGenericProps {
5
5
  schema: ConfigItemImageUpload;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemInstanceSelect } from '#JC/types';
2
+ import type { ConfigItemInstanceSelect } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigInstanceSelectProps extends ConfigGenericProps {
5
5
  schema: ConfigItemInstanceSelect;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemInterface } from '#JC/types';
2
+ import type { ConfigItemInterface } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigInterfaceProps extends ConfigGenericProps {
5
5
  schema: ConfigItemInterface;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemJsonEditor } from '#JC/types';
2
+ import type { ConfigItemJsonEditor } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigJsonEditorProps extends ConfigGenericProps {
5
5
  schema: ConfigItemJsonEditor;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemLanguage } from '#JC/types';
2
+ import type { ConfigItemLanguage } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface LanguageSelectOption {
5
5
  /** Value to save */
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemLicense } from '#JC/types';
2
+ import type { ConfigItemLicense } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigLicenseProps extends ConfigGenericProps {
5
5
  schema: ConfigItemLicense;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemNumber } from '#JC/types';
2
+ import type { ConfigItemNumber } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigNumberProps extends ConfigGenericProps {
5
5
  schema: ConfigItemNumber;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemObjectId } from '#JC/types';
2
+ import type { ConfigItemObjectId } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigObjectIdProps extends ConfigGenericProps {
5
5
  schema: ConfigItemObjectId;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemPanel } from '#JC/types';
2
+ import type { ConfigItemPanel } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric';
4
4
  interface ConfigPanelProps extends ConfigGenericProps {
5
5
  schema: ConfigItemPanel;
@@ -145,7 +145,7 @@ const styles = {
145
145
  class ConfigPanel extends ConfigGeneric {
146
146
  componentDidMount() {
147
147
  super.componentDidMount();
148
- if (this.props.schema && this.props.schema.collapsable) {
148
+ if (this.props.schema?.collapsable) {
149
149
  this.setState({
150
150
  expanded: (window._localStorage || window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`) === 'true',
151
151
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigPanel.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,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,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;iBAC7B,EACD,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,IAE/E,OAAO,CACJ,CACX,CAAC;YAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,CACH;oBACI,6BAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI;oBAC/C,IAAI,CACN,CACN,CAAC;YACN,CAAC;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,eAAe,WAAW,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Grid2, Accordion, AccordionSummary, AccordionDetails, Typography, Box } from '@mui/material';\n\nimport { ExpandMore as ExpandMoreIcon } from '@mui/icons-material';\n\nimport { type AdminConnection, type IobTheme, Utils } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemPanel } from '#JC/types';\n\nimport ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigAccordion from './ConfigAccordion';\nimport ConfigAlive from './ConfigAlive';\nimport ConfigAutocomplete from './ConfigAutocomplete';\nimport ConfigAutocompleteSendTo from './ConfigAutocompleteSendTo';\nimport ConfigCRON from './ConfigCRON';\nimport ConfigCertificateSelect from './ConfigCertificateSelect';\nimport ConfigCertificates from './ConfigCertificates';\nimport ConfigCertCollection from './ConfigCertCollection';\nimport ConfigCheckLicense from './ConfigCheckLicense';\nimport ConfigCheckbox from './ConfigCheckbox';\nimport ConfigChip from './ConfigChip';\nimport ConfigColor from './ConfigColor';\nimport ConfigCoordinates from './ConfigCoordinates';\nimport ConfigCustom from './ConfigCustom';\nimport ConfigDatePicker from './ConfigDatePicker';\nimport ConfigDeviceManager from './ConfigDeviceManager';\nimport ConfigFile from './ConfigFile';\nimport ConfigFileSelector from './ConfigFileSelector';\nimport ConfigFunc from './ConfigFunc';\nimport ConfigIP from './ConfigIP';\nimport ConfigImageSendTo from './ConfigImageSendTo';\nimport ConfigImageUpload from './ConfigImageUpload';\nimport ConfigInstanceSelect from './ConfigInstanceSelect';\nimport ConfigInterface from './ConfigInterface';\nimport ConfigJsonEditor from './ConfigJsonEditor';\nimport ConfigLanguage from './ConfigLanguage';\nimport ConfigLicense from './ConfigLicense';\nimport ConfigNumber from './ConfigNumber';\nimport ConfigObjectId from './ConfigObjectId';\nimport ConfigPassword from './ConfigPassword';\nimport ConfigPattern from './ConfigPattern';\nimport ConfigPort from './ConfigPort';\nimport ConfigRoom from './ConfigRoom';\nimport ConfigSelect from './ConfigSelect';\nimport ConfigSelectSendTo from './ConfigSelectSendTo';\nimport ConfigSendTo from './ConfigSendto';\nimport ConfigSetState from './ConfigSetState';\nimport ConfigSlider from './ConfigSlider';\nimport ConfigState from './ConfigState';\nimport ConfigStaticDivider from './ConfigStaticDivider';\nimport ConfigStaticHeader from './ConfigStaticHeader';\nimport ConfigStaticImage from './ConfigStaticImage';\nimport ConfigStaticInfo from './ConfigStaticInfo';\nimport ConfigStaticText from './ConfigStaticText';\nimport ConfigTable from './ConfigTable';\nimport ConfigText from './ConfigText';\nimport ConfigTextSendTo from './ConfigTextSendTo';\nimport ConfigTimePicker from './ConfigTimePicker';\nimport ConfigTopic from './ConfigTopic';\nimport ConfigUUID from './ConfigUUID';\nimport ConfigUser from './ConfigUser';\nimport ConfigQrCode from './ConfigQrCode';\n\nconst components: Record<string, typeof ConfigGeneric<any, any>> = {\n accordion: ConfigAccordion,\n alive: ConfigAlive,\n autocomplete: ConfigAutocomplete,\n autocompleteSendTo: ConfigAutocompleteSendTo,\n certCollection: ConfigCertCollection,\n certificate: ConfigCertificateSelect,\n certificates: ConfigCertificates,\n checkbox: ConfigCheckbox,\n checkLicense: ConfigCheckLicense,\n chip: ConfigChip, // deprecated. Use \"chips\"\n chips: ConfigChip,\n color: ConfigColor,\n coordinates: ConfigCoordinates,\n cron: ConfigCRON,\n custom: ConfigCustom,\n datePicker: ConfigDatePicker,\n deviceManager: ConfigDeviceManager,\n divider: ConfigStaticDivider,\n file: ConfigFile,\n fileSelector: ConfigFileSelector,\n func: ConfigFunc,\n header: ConfigStaticHeader,\n image: ConfigImageUpload,\n imageSendTo: ConfigImageSendTo,\n instance: ConfigInstanceSelect,\n interface: ConfigInterface,\n ip: ConfigIP,\n jsonEditor: ConfigJsonEditor,\n language: ConfigLanguage,\n license: ConfigLicense,\n number: ConfigNumber,\n objectId: ConfigObjectId,\n password: ConfigPassword,\n pattern: ConfigPattern,\n port: ConfigPort,\n qrCode: ConfigQrCode,\n room: ConfigRoom,\n select: ConfigSelect,\n selectSendTo: ConfigSelectSendTo,\n // @deprecated Use \"sendTo\"\n sendto: ConfigSendTo,\n sendTo: ConfigSendTo,\n setState: ConfigSetState,\n slider: ConfigSlider,\n state: ConfigState,\n staticImage: ConfigStaticImage,\n staticInfo: ConfigStaticInfo,\n staticLink: ConfigStaticText,\n staticText: ConfigStaticText,\n table: ConfigTable,\n text: ConfigText,\n textSendTo: ConfigTextSendTo,\n timePicker: ConfigTimePicker,\n topic: ConfigTopic,\n uuid: ConfigUUID,\n user: ConfigUser,\n};\n\nconst styles: Record<string, any> = {\n fullWidth: {\n width: '100%',\n // height: '100%',\n },\n paper: {\n margin: 1,\n width: 'auto !important',\n overflowY: 'auto',\n paddingBottom: 1,\n },\n paperWithIcons: {\n height: 'calc(100vh - 259px) !important',\n },\n paperWithoutIcons: {\n height: 'calc(100vh - 235px) !important',\n },\n padding: {\n padding: '10px',\n },\n heading: {},\n primary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.mode === 'dark' ? 'inherit' : '#FFF',\n }),\n secondary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.secondary.main,\n }),\n};\n\ninterface ConfigPanelProps extends ConfigGenericProps {\n schema: ConfigItemPanel;\n withIcons?: boolean;\n}\ninterface ConfigPanelState extends ConfigGenericState {\n expanded?: boolean;\n}\n\nclass ConfigPanel extends ConfigGeneric<ConfigPanelProps, ConfigPanelState> {\n componentDidMount(): void {\n super.componentDidMount();\n if (this.props.schema && this.props.schema.collapsable) {\n this.setState({\n expanded:\n (((window as any)._localStorage as Storage) || window.localStorage).getItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n ) === 'true',\n });\n }\n }\n\n renderItems(items: Record<string, any>, disabled: boolean): JSX.Element[] | null {\n return items\n ? Object.keys(items).map(attr => {\n if (this.props.oContext.multiEdit && items[attr].noMultiEdit) {\n return null;\n }\n\n const type = items[attr].type || 'panel';\n let ItemComponent: typeof ConfigGeneric<ConfigGenericProps, any>;\n let socket: string | AdminConnection = 'Use this.props.oContext.socket!';\n if (type === 'custom') {\n // name\n // url\n if (items[attr].url) {\n ItemComponent = ConfigCustom;\n } else if (this.props.oContext.customs && this.props.oContext.customs[items[attr].component]) {\n ItemComponent = this.props.oContext.customs[items[attr].component];\n } else {\n console.error(`Cannot find custom component: ${items[attr].component}`);\n ItemComponent = ConfigGeneric;\n }\n socket = this.props.oContext.socket;\n } else if (type === 'panel') {\n ItemComponent = ConfigPanel;\n } else {\n ItemComponent = components[type] || ConfigGeneric;\n }\n\n return (\n <ItemComponent\n // @ts-expect-error Temporary work-around, till all custom components will not migrate to oContext\n socket={socket}\n globalData={this.props.globalData}\n oContext={this.props.oContext}\n key={`${attr}_${this.props.index === undefined ? '' : this.props.index}`}\n index={this.props.index}\n changed={this.props.changed}\n arrayIndex={this.props.arrayIndex}\n commandRunning={this.props.commandRunning}\n style={styles.panel}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n onError={this.props.onError}\n onChange={this.props.onChange}\n disabled={disabled}\n customObj={this.props.customObj}\n custom={this.props.custom}\n schema={items[attr]}\n attr={attr}\n table={this.props.table}\n />\n );\n })\n : null;\n }\n\n render(): JSX.Element | null {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n const { disabled, hidden } = this.calculate(schema);\n\n const items = this.props.schema.items;\n const schemaStyle = this.props.schema.style || {};\n\n if (hidden) {\n if (schema.hideOnlyControl) {\n const item = (\n <Grid2\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { marginBottom: 0, textAlign: 'left' /* marginRight: 8, */ },\n schemaStyle,\n this.props.oContext.themeType === 'dark' && schema.darkStyle,\n )}\n />\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return null;\n }\n\n if (this.props.table) {\n return this.renderItems(items, disabled) as any as JSX.Element;\n }\n\n if (this.props.custom) {\n return (\n <Grid2\n key={`${this.props.attr}_${this.props.index}`}\n container\n style={styles.fullWidth}\n columnSpacing={2}\n rowSpacing={1}\n sx={schemaStyle}\n >\n {this.renderItems(items, disabled)}\n </Grid2>\n );\n }\n\n let content;\n if (schema.collapsable) {\n content = (\n <Accordion\n key={`${this.props.attr}_${this.props.index}`}\n style={styles.fullWidth}\n expanded={!!this.state.expanded}\n onChange={() => {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n this.state.expanded ? 'false' : 'true',\n );\n this.setState({ expanded: !this.state.expanded });\n }}\n >\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n schemaStyle,\n this.props.oContext.themeType && schema.darkStyle,\n schema.color === 'primary'\n ? styles.primary\n : schema.color === 'secondary' && styles.secondary,\n { width: '100%' },\n )}\n >\n <Typography style={styles.heading}>{this.getText(schema.label)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Grid2\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={{ ...schemaStyle, width: '100%', padding: '10px' }}\n >\n {this.renderItems(items, disabled)}\n </Grid2>\n </AccordionDetails>\n </Accordion>\n );\n } else {\n content = (\n <Box\n component=\"div\"\n key={`${this.props.attr}_${this.props.index}`}\n className={this.props.className}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n this.props.style,\n schemaStyle,\n { width: '100%' },\n this.props.isParentTab && styles.paper,\n this.props.isParentTab &&\n (this.props.withIcons ? styles.paperWithIcons : styles.paperWithoutIcons),\n )}\n >\n <Grid2\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { width: '100%' },\n this.props.isParentTab && styles.padding,\n this.props.schema.innerStyle,\n )}\n >\n {this.renderItems(items, disabled)}\n </Grid2>\n </Box>\n );\n }\n\n if (!this.props.isParentTab) {\n const item = (\n <Grid2\n title={this.getText(schema.tooltip)}\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={{ marginBottom: 0, /* marginRight: 8, */ textAlign: 'left', ...schemaStyle }}\n >\n {content}\n </Grid2>\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return content;\n }\n}\n\nexport default ConfigPanel;\n"]}
1
+ {"version":3,"file":"ConfigPanel.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAuC,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGx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EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI;oBAC/C,IAAI,CACN,CACN,CAAC;YACN,CAAC;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,eAAe,WAAW,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Grid2, Accordion, AccordionSummary, AccordionDetails, Typography, Box } from '@mui/material';\n\nimport { ExpandMore as ExpandMoreIcon } from '@mui/icons-material';\n\nimport { type AdminConnection, type IobTheme, Utils } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemPanel } from '#JC/types';\n\nimport ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigAccordion from './ConfigAccordion';\nimport ConfigAlive from './ConfigAlive';\nimport ConfigAutocomplete from './ConfigAutocomplete';\nimport ConfigAutocompleteSendTo from './ConfigAutocompleteSendTo';\nimport ConfigCRON from './ConfigCRON';\nimport ConfigCertificateSelect from './ConfigCertificateSelect';\nimport ConfigCertificates from './ConfigCertificates';\nimport ConfigCertCollection from './ConfigCertCollection';\nimport ConfigCheckLicense from './ConfigCheckLicense';\nimport ConfigCheckbox from './ConfigCheckbox';\nimport ConfigChip from './ConfigChip';\nimport ConfigColor from './ConfigColor';\nimport ConfigCoordinates from './ConfigCoordinates';\nimport ConfigCustom from './ConfigCustom';\nimport ConfigDatePicker from './ConfigDatePicker';\nimport ConfigDeviceManager from './ConfigDeviceManager';\nimport ConfigFile from './ConfigFile';\nimport ConfigFileSelector from './ConfigFileSelector';\nimport ConfigFunc from './ConfigFunc';\nimport ConfigIP from './ConfigIP';\nimport ConfigImageSendTo from './ConfigImageSendTo';\nimport ConfigImageUpload from './ConfigImageUpload';\nimport ConfigInstanceSelect from './ConfigInstanceSelect';\nimport ConfigInterface from './ConfigInterface';\nimport ConfigJsonEditor from './ConfigJsonEditor';\nimport ConfigLanguage from './ConfigLanguage';\nimport ConfigLicense from './ConfigLicense';\nimport ConfigNumber from './ConfigNumber';\nimport ConfigObjectId from './ConfigObjectId';\nimport ConfigPassword from './ConfigPassword';\nimport ConfigPattern from './ConfigPattern';\nimport ConfigPort from './ConfigPort';\nimport ConfigRoom from './ConfigRoom';\nimport ConfigSelect from './ConfigSelect';\nimport ConfigSelectSendTo from './ConfigSelectSendTo';\nimport ConfigSendTo from './ConfigSendto';\nimport ConfigSetState from './ConfigSetState';\nimport ConfigSlider from './ConfigSlider';\nimport ConfigState from './ConfigState';\nimport ConfigStaticDivider from './ConfigStaticDivider';\nimport ConfigStaticHeader from './ConfigStaticHeader';\nimport ConfigStaticImage from './ConfigStaticImage';\nimport ConfigStaticInfo from './ConfigStaticInfo';\nimport ConfigStaticText from './ConfigStaticText';\nimport ConfigTable from './ConfigTable';\nimport ConfigText from './ConfigText';\nimport ConfigTextSendTo from './ConfigTextSendTo';\nimport ConfigTimePicker from './ConfigTimePicker';\nimport ConfigTopic from './ConfigTopic';\nimport ConfigUUID from './ConfigUUID';\nimport ConfigUser from './ConfigUser';\nimport ConfigQrCode from './ConfigQrCode';\n\nconst components: Record<string, typeof ConfigGeneric<any, any>> = {\n accordion: ConfigAccordion,\n alive: ConfigAlive,\n autocomplete: ConfigAutocomplete,\n autocompleteSendTo: ConfigAutocompleteSendTo,\n certCollection: ConfigCertCollection,\n certificate: ConfigCertificateSelect,\n certificates: ConfigCertificates,\n checkbox: ConfigCheckbox,\n checkLicense: ConfigCheckLicense,\n chip: ConfigChip, // deprecated. Use \"chips\"\n chips: ConfigChip,\n color: ConfigColor,\n coordinates: ConfigCoordinates,\n cron: ConfigCRON,\n custom: ConfigCustom,\n datePicker: ConfigDatePicker,\n deviceManager: ConfigDeviceManager,\n divider: ConfigStaticDivider,\n file: ConfigFile,\n fileSelector: ConfigFileSelector,\n func: ConfigFunc,\n header: ConfigStaticHeader,\n image: ConfigImageUpload,\n imageSendTo: ConfigImageSendTo,\n instance: ConfigInstanceSelect,\n interface: ConfigInterface,\n ip: ConfigIP,\n jsonEditor: ConfigJsonEditor,\n language: ConfigLanguage,\n license: ConfigLicense,\n number: ConfigNumber,\n objectId: ConfigObjectId,\n password: ConfigPassword,\n pattern: ConfigPattern,\n port: ConfigPort,\n qrCode: ConfigQrCode,\n room: ConfigRoom,\n select: ConfigSelect,\n selectSendTo: ConfigSelectSendTo,\n // @deprecated Use \"sendTo\"\n sendto: ConfigSendTo,\n sendTo: ConfigSendTo,\n setState: ConfigSetState,\n slider: ConfigSlider,\n state: ConfigState,\n staticImage: ConfigStaticImage,\n staticInfo: ConfigStaticInfo,\n staticLink: ConfigStaticText,\n staticText: ConfigStaticText,\n table: ConfigTable,\n text: ConfigText,\n textSendTo: ConfigTextSendTo,\n timePicker: ConfigTimePicker,\n topic: ConfigTopic,\n uuid: ConfigUUID,\n user: ConfigUser,\n};\n\nconst styles: Record<string, any> = {\n fullWidth: {\n width: '100%',\n // height: '100%',\n },\n paper: {\n margin: 1,\n width: 'auto !important',\n overflowY: 'auto',\n paddingBottom: 1,\n },\n paperWithIcons: {\n height: 'calc(100vh - 259px) !important',\n },\n paperWithoutIcons: {\n height: 'calc(100vh - 235px) !important',\n },\n padding: {\n padding: '10px',\n },\n heading: {},\n primary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.mode === 'dark' ? 'inherit' : '#FFF',\n }),\n secondary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.secondary.main,\n }),\n};\n\ninterface ConfigPanelProps extends ConfigGenericProps {\n schema: ConfigItemPanel;\n withIcons?: boolean;\n}\ninterface ConfigPanelState extends ConfigGenericState {\n expanded?: boolean;\n}\n\nclass ConfigPanel extends ConfigGeneric<ConfigPanelProps, ConfigPanelState> {\n componentDidMount(): void {\n super.componentDidMount();\n if (this.props.schema?.collapsable) {\n this.setState({\n expanded:\n (((window as any)._localStorage as Storage) || window.localStorage).getItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n ) === 'true',\n });\n }\n }\n\n renderItems(items: Record<string, any>, disabled: boolean): JSX.Element[] | null {\n return items\n ? Object.keys(items).map(attr => {\n if (this.props.oContext.multiEdit && items[attr].noMultiEdit) {\n return null;\n }\n\n const type = items[attr].type || 'panel';\n let ItemComponent: typeof ConfigGeneric<ConfigGenericProps, any>;\n let socket: string | AdminConnection = 'Use this.props.oContext.socket!';\n if (type === 'custom') {\n // name\n // url\n if (items[attr].url) {\n ItemComponent = ConfigCustom;\n } else if (this.props.oContext.customs && this.props.oContext.customs[items[attr].component]) {\n ItemComponent = this.props.oContext.customs[items[attr].component];\n } else {\n console.error(`Cannot find custom component: ${items[attr].component}`);\n ItemComponent = ConfigGeneric;\n }\n socket = this.props.oContext.socket;\n } else if (type === 'panel') {\n ItemComponent = ConfigPanel;\n } else {\n ItemComponent = components[type] || ConfigGeneric;\n }\n\n return (\n <ItemComponent\n // @ts-expect-error Temporary work-around, till all custom components will not migrate to oContext\n socket={socket}\n globalData={this.props.globalData}\n oContext={this.props.oContext}\n key={`${attr}_${this.props.index === undefined ? '' : this.props.index}`}\n index={this.props.index}\n changed={this.props.changed}\n arrayIndex={this.props.arrayIndex}\n commandRunning={this.props.commandRunning}\n style={styles.panel}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n onError={this.props.onError}\n onChange={this.props.onChange}\n disabled={disabled}\n customObj={this.props.customObj}\n custom={this.props.custom}\n schema={items[attr]}\n attr={attr}\n table={this.props.table}\n />\n );\n })\n : null;\n }\n\n render(): JSX.Element | null {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n const { disabled, hidden } = this.calculate(schema);\n\n const items = this.props.schema.items;\n const schemaStyle = this.props.schema.style || {};\n\n if (hidden) {\n if (schema.hideOnlyControl) {\n const item = (\n <Grid2\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { marginBottom: 0, textAlign: 'left' /* marginRight: 8, */ },\n schemaStyle,\n this.props.oContext.themeType === 'dark' && schema.darkStyle,\n )}\n />\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return null;\n }\n\n if (this.props.table) {\n return this.renderItems(items, disabled) as any as JSX.Element;\n }\n\n if (this.props.custom) {\n return (\n <Grid2\n key={`${this.props.attr}_${this.props.index}`}\n container\n style={styles.fullWidth}\n columnSpacing={2}\n rowSpacing={1}\n sx={schemaStyle}\n >\n {this.renderItems(items, disabled)}\n </Grid2>\n );\n }\n\n let content;\n if (schema.collapsable) {\n content = (\n <Accordion\n key={`${this.props.attr}_${this.props.index}`}\n style={styles.fullWidth}\n expanded={!!this.state.expanded}\n onChange={() => {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n this.state.expanded ? 'false' : 'true',\n );\n this.setState({ expanded: !this.state.expanded });\n }}\n >\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n schemaStyle,\n this.props.oContext.themeType && schema.darkStyle,\n schema.color === 'primary'\n ? styles.primary\n : schema.color === 'secondary' && styles.secondary,\n { width: '100%' },\n )}\n >\n <Typography style={styles.heading}>{this.getText(schema.label)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Grid2\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={{ ...schemaStyle, width: '100%', padding: '10px' }}\n >\n {this.renderItems(items, disabled)}\n </Grid2>\n </AccordionDetails>\n </Accordion>\n );\n } else {\n content = (\n <Box\n component=\"div\"\n key={`${this.props.attr}_${this.props.index}`}\n className={this.props.className}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n this.props.style,\n schemaStyle,\n { width: '100%' },\n this.props.isParentTab && styles.paper,\n this.props.isParentTab &&\n (this.props.withIcons ? styles.paperWithIcons : styles.paperWithoutIcons),\n )}\n >\n <Grid2\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { width: '100%' },\n this.props.isParentTab && styles.padding,\n this.props.schema.innerStyle,\n )}\n >\n {this.renderItems(items, disabled)}\n </Grid2>\n </Box>\n );\n }\n\n if (!this.props.isParentTab) {\n const item = (\n <Grid2\n title={this.getText(schema.tooltip)}\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={{ marginBottom: 0, /* marginRight: 8, */ textAlign: 'left', ...schemaStyle }}\n >\n {content}\n </Grid2>\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return content;\n }\n}\n\nexport default ConfigPanel;\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemPassword } from '#JC/types';
2
+ import type { ConfigItemPassword } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigPasswordProps extends ConfigGenericProps {
5
5
  schema: ConfigItemPassword;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemPattern } from '#JC/types';
2
+ import type { ConfigItemPattern } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigPatternProps extends ConfigGenericProps {
5
5
  schema: ConfigItemPattern;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemPort } from '#JC/types';
2
+ import type { ConfigItemPort } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface Port {
5
5
  name: string;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
2
  import type QRCode from 'react-qr-code';
3
- import type { ConfigItemQrCode } from '#JC/types';
3
+ import type { ConfigItemQrCode } from '../types';
4
4
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
5
5
  interface ConfigQrCodeProps extends ConfigGenericProps {
6
6
  schema: ConfigItemQrCode;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemRoom } from '#JC/types';
2
+ import type { ConfigItemRoom } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigRoomProps extends ConfigGenericProps {
5
5
  schema: ConfigItemRoom;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemSelect } from '#JC/types';
2
+ import type { ConfigItemSelect } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigInstanceSelectProps extends ConfigGenericProps {
5
5
  schema: ConfigItemSelect;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import type { ConfigItemSelectSendTo } from '#JC/types';
2
+ import type { ConfigItemSelectSendTo } from '../types';
3
3
  import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigSelectSendToProps extends ConfigGenericProps {
5
5
  schema: ConfigItemSelectSendTo;