@iobroker/json-config 9.0.24 → 9.1.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigGeneric.js","sourceRoot":"src/","sources":["JsonConfigComponent/ConfigGeneric.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACH,IAAI,IAAI,QAAQ,EAChB,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,SAAS,EAClB,GAAG,IAAI,QAAQ,EACf,IAAI,IAAI,QAAQ,EAChB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,UAAU,EACpB,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EAChB,UAAU,IAAI,cAAc,EAC5B,IAAI,IAAI,QAAQ,EAChB,MAAM,IAAI,UAAU,EACpB,KAAK,IAAI,SAAS,EAClB,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,EACtB,GAAG,IAAI,OAAO,EACd,OAAO,IAAI,WAAW,EACtB,IAAI,IAAI,QAAQ,EAChB,IAAI,EACJ,SAAS,EACT,SAAS,IAAI,aAAa,EAC1B,gBAAgB,IAAI,UAAU,EAC9B,WAAW,IAAI,YAAY,EAC3B,SAAS,IAAI,SAAS,EACtB,OAAO,IAAI,SAAS,EACpB,QAAQ,IAAI,QAAQ,EACpB,KAAK,IAAI,SAAS,EAClB,SAAS,IAAI,QAAQ,EACrB,YAAY,IAAI,YAAY,EAC5B,MAAM,IAAI,UAAU,EACpB,QAAQ,IAAI,YAAY,EACxB,KAAK,IAAI,UAAU,EACnB,IAAI,IAAI,QAAQ,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,aAAa,EACb,IAAI,EACJ,KAAK,EACL,IAAI,GAKP,MAA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N,CAAC;QACN,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YAC3B,OAAO,CACH;gBACK,IAAI,CAAC,mBAAmB,EAAE;gBAC1B,IAAI,CACN,CACN,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC","sourcesContent":["import React, { Component, type JSX } from 'react';\n\nimport { Grid, Button } from '@mui/material';\n\nimport {\n Info as IconInfo,\n Warning as IconWarning,\n Error as IconError,\n Key as IconAuth,\n Send as IconSend,\n Public as IconWeb,\n Search as IconSearch,\n MenuBook as IconMenuBook,\n Help as IconHelp,\n UploadFile as IconUploadFile,\n Edit as IconEdit,\n Person as IconPerson,\n Group as IconGroup,\n Delete as IconDelete,\n Refresh as IconRefresh,\n Add as IconAdd,\n LinkOff as IconLinkOff,\n Link as LinkIcon,\n Save,\n OpenInNew,\n Highlight as IconBacklight,\n BrightnessMedium as IconDimmer,\n Fingerprint as IconIdentify,\n Lightbulb as IconLight,\n Reorder as IconLines,\n SkipNext as IconNext,\n Pause as IconPause,\n PlayArrow as IconPlay,\n SkipPrevious as IconPrevious,\n QrCode as IconQrCode,\n Settings as IconSettings,\n Power as IconSocket,\n Stop as IconStop,\n} from '@mui/icons-material';\n\nimport {\n DialogConfirm,\n Icon,\n Utils,\n I18n,\n type Connection,\n type ThemeType,\n type ThemeName,\n type IobTheme,\n} from '@iobroker/gui-components';\nimport type {\n ConfigIconType,\n ConfigItem,\n ConfigItemAny,\n ConfigItemConfirmData,\n ConfigItemOs,\n ConfigNamedIcon,\n JsonConfigContext,\n JsonConfigHostInfo,\n} from '../types';\n\nconst DEFAULT_SM_SIZE = window.innerWidth <= 600 ? 12 : undefined;\n\n/**\n * All named icons a schema may use. `Record<ConfigNamedIcon, ...>` is deliberate: adding a name to `ConfigNamedIcon`\n * without a renderer here is a compile error, instead of silently falling through to the image path below.\n */\nconst NAMED_ICONS: Record<ConfigNamedIcon, () => JSX.Element> = {\n add: () => <IconAdd />,\n auth: () => <IconAuth />,\n backlight: () => <IconBacklight />,\n book: () => <IconMenuBook />,\n delete: () => <IconDelete />,\n dimmer: () => <IconDimmer />,\n edit: () => <IconEdit />,\n error: () => <IconError />,\n group: () => <IconGroup />,\n help: () => <IconHelp />,\n identify: () => <IconIdentify />,\n info: () => <IconInfo />,\n light: () => <IconLight />,\n lines: () => <IconLines />,\n next: () => <IconNext />,\n open: () => <OpenInNew />,\n pair: () => <LinkIcon />,\n pause: () => <IconPause />,\n play: () => <IconPlay />,\n previous: () => <IconPrevious />,\n qrcode: () => <IconQrCode />,\n refresh: () => <IconRefresh />,\n save: () => <Save />,\n search: () => <IconSearch />,\n send: () => <IconSend />,\n settings: () => <IconSettings />,\n socket: () => <IconSocket />,\n stop: () => <IconStop />,\n unpair: () => <IconLinkOff />,\n upload: () => <IconUploadFile />,\n user: () => <IconPerson />,\n warning: () => <IconWarning />,\n web: () => <IconWeb />,\n};\n\n// because this class is used in react-components, do not include here any foreign files like from '../../helpers/utils.ts'\nexport function isObject(it: any): it is Record<string, any> {\n // This is necessary because:\n // typeof null === 'object'\n // typeof [] === 'object'\n // [] instanceof Object === true\n return Object.prototype.toString.call(it) === '[object Object]'; // this code is 25% faster than below one\n // return it && typeof it === 'object' && !(it instanceof Array);\n}\n\nexport interface DeviceManagerPropsProps {\n /* socket object */\n socket: Connection;\n /* Instance to communicate with device-manager backend, like `adapterName.X` */\n selectedInstance: string; // adapterName.X\n registerHandler?: (handler: null | ((command: string) => void)) => void;\n themeName: ThemeName;\n theme: IobTheme;\n themeType: ThemeType;\n isFloatComma: boolean;\n dateFormat: string;\n /** Instance to upload images to, like `adapterName.X` */\n uploadImagesToInstance?: string;\n /** Filter devices with this string */\n filter?: string;\n /** If this component is used in GUI with own toolbar. `false` if this list is used with multiple instances and true if only with one (in this case, it will monitor alive itself */\n embedded?: boolean;\n /** If embedded, this text is shown in the toolbar */\n title?: string;\n /** Style of a component that displays all devices */\n style?: React.CSSProperties;\n /** Use small cards for devices */\n smallCards?: boolean;\n}\n\nexport interface ConfigGenericProps {\n oContext: JsonConfigContext;\n alive: boolean;\n arrayIndex?: number;\n attr?: string;\n changed: boolean;\n className?: string;\n expertMode?: boolean;\n commandRunning?: boolean;\n common?: Record<string, any>;\n custom?: boolean;\n customObj?: Record<string, any>;\n data: Record<string, any>;\n disabled?: boolean;\n // filled only by table and represents the obj.native or obj.common.custom['adapter.X'] object\n globalData?: Record<string, any>;\n // filled only by table\n index?: number;\n isParentTab?: boolean;\n onChange: (\n attrOrData: string | Record<string, any> | undefined,\n val?: any,\n cb?: () => void,\n saveConfig?: boolean,\n ) => void;\n onError: (attr: string | undefined, error?: string) => void;\n onHiddenChanged?: (attr: string, hidden?: boolean) => void;\n /** Filled only by table: components with value/label options report their label mappings for table filtering */\n onFilterLabelUpdate?: (attr: string, valueToLabel: Record<string, string>) => void;\n originalData: Record<string, any>;\n /** This indicates that the component is the very firsts one - root */\n root?: boolean;\n /** Provided props by the specific component */\n schema: ConfigItemAny;\n style?: Record<string, any>;\n /** This item is in the table. Maybe some layouts must be changed */\n table?: boolean;\n themeName: ThemeName;\n /** User can provide their own components for specific input fields */\n customComponents?: { [componentType: string]: typeof ConfigGeneric<ConfigGenericProps, any> };\n}\n\nexport interface ConfigGenericState {\n confirmDialog: boolean;\n confirmNewValue: any;\n confirmAttr: any;\n confirmData: ConfigItemConfirmData | null;\n value?: any;\n confirmDepAttr?: any;\n confirmDepNewValue?: any;\n confirmCallback: null | ((result: boolean) => void);\n calculatedValues?: {\n error: boolean;\n disabled: boolean;\n hidden: boolean;\n defaultValue: null | string | number | boolean;\n };\n}\n\nexport default class ConfigGeneric<\n Props extends ConfigGenericProps = ConfigGenericProps,\n State extends ConfigGenericState = ConfigGenericState,\n> extends Component<Props, State> {\n static DIFFERENT_VALUE = '__different__';\n static DIFFERENT_LABEL = 'jc___different__';\n static NONE_VALUE = '';\n static NONE_LABEL = 'jc_none';\n private defaultValue: any;\n private isError: any;\n private readonly lang: ioBroker.Languages;\n private defaultSendToDone?: boolean;\n private sendToTimeout?: any;\n private noPlaceRequired: any;\n private reportedHidden: boolean = false;\n private calculateTimeout: ReturnType<typeof setTimeout> | null = null;\n private readonly AsyncFunction: FunctionConstructor;\n\n constructor(props: Props) {\n super(props);\n this.AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;\n\n // @ts-expect-error of course, as we just\n this.state = {\n confirmDialog: false,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n confirmCallback: null,\n } satisfies ConfigGenericState;\n\n this.isError = {};\n\n this.lang = I18n.getLanguage();\n\n // Initialize literal defaults synchronously so the first render has them.\n // defaultFunc is evaluated asynchronously in componentDidMount.\n if (props.schema) {\n if (props.custom) {\n if (!props.schema.defaultFunc) {\n this.defaultValue = props.schema.default;\n }\n } else if (props.schema.type !== 'state' && !props.schema.defaultFunc) {\n this.defaultValue = props.schema.default;\n }\n }\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n protected async getCachedObject(id: string): Promise<ioBroker.Object | null> {\n if (this.props.oContext.getCachedObject) {\n return this.props.oContext.getCachedObject(id);\n }\n return (await this.props.oContext.socket.getObject(id)) || null;\n }\n\n async componentDidMount(): Promise<void> {\n if (this.props.schema?.defaultFunc) {\n if (this.props.custom) {\n this.defaultValue = await this.executeCustom(\n this.props.schema.defaultFunc,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n );\n } else if (this.props.schema.type !== 'state') {\n this.defaultValue = await this.execute(\n this.props.schema.defaultFunc,\n this.props.schema.default,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n );\n }\n }\n\n if (this.props.attr) {\n this.props.oContext.registerOnForceUpdate?.(this.props.attr, this.onUpdate);\n }\n const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];\n // init default value\n if (this.defaultValue !== undefined && this.props.attr) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (\n value === undefined ||\n (LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))\n ) {\n setTimeout(() => {\n if (!this.props.attr) {\n return;\n }\n if (this.props.custom) {\n this.props.onChange(this.props.attr, this.defaultValue, () =>\n setTimeout(\n () =>\n this.props.attr &&\n this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n 100,\n ),\n );\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);\n this.props.onChange(\n this.props.data,\n undefined,\n () =>\n this.props.attr && this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n );\n }\n }, 100);\n }\n } else if (this.props.schema.defaultSendTo) {\n this.defaultSendTo().catch(e => console.error(e));\n }\n }\n\n private async defaultSendTo(): Promise<void> {\n if (this.props.alive && this.props.schema.defaultSendTo) {\n this.defaultSendToDone = true;\n let data: any = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n const dataStr = await this.getPatternAsync(this.props.schema.jsonData, null, true);\n try {\n data = JSON.parse(dataStr);\n } catch {\n console.error(`Cannot parse json data: ${dataStr}`);\n }\n } else {\n data = {\n attr: this.props.attr,\n value: ConfigGeneric.getValue(this.props.data, this.props.attr),\n };\n }\n\n if (data === undefined) {\n data = null;\n }\n const instance = await this.getPatternAsync(\n (this.props.schema as any).instance ||\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n );\n // Check that instance is alive\n if (instance !== `${this.props.oContext.adapterName}.${this.props.oContext.instance}`) {\n const alive = await this.props.oContext.socket.getState(`system.adapter.${instance}.alive`);\n if (!alive?.val) {\n window.alert(I18n.t('jc_Instance %s is not alive', instance));\n return;\n }\n }\n try {\n const value = await this.props.oContext.socket.sendTo(instance, this.props.schema.defaultSendTo, data);\n if (value !== null && value !== undefined && this.props.attr) {\n if (this.props.custom) {\n this.props.onChange(\n this.props.attr,\n value,\n () =>\n this.props.attr && this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n );\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, value);\n this.props.onChange(\n this.props.data,\n undefined,\n () =>\n this.props.attr && this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n );\n }\n }\n } catch (e) {\n console.error(e);\n }\n } else {\n this.defaultSendToDone = false;\n if (!this.props.schema.allowSaveWithError) {\n // show error, that instance did not start\n this.onError(\n this.props.attr,\n I18n.t('jc_Instance %s is not alive', this.props.oContext.instance.toString()),\n );\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this.props.attr) {\n this.props.oContext.registerOnForceUpdate?.(this.props.attr);\n }\n if (this.sendToTimeout) {\n clearTimeout(this.sendToTimeout);\n this.sendToTimeout = null;\n }\n if (this.calculateTimeout) {\n clearTimeout(this.calculateTimeout);\n this.calculateTimeout = null;\n }\n }\n\n onUpdate = (data: Record<string, any>): void => {\n const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';\n if (this.state.value !== value) {\n this.setState({ value });\n } else {\n this.forceUpdate();\n }\n };\n\n /**\n * Extract attribute out of data\n */\n static getValue(data: Record<string, any>, attr: string | string[] | undefined): any {\n if (!attr) {\n return undefined;\n }\n if (typeof attr === 'string') {\n return ConfigGeneric.getValue(data, attr.split('.'));\n }\n if (attr.length === 1) {\n return data[attr[0]];\n }\n const part = attr.shift();\n\n if (typeof part === 'string' && typeof data[part] === 'object') {\n return ConfigGeneric.getValue(data[part], attr);\n }\n return undefined;\n }\n\n static setValue(data: Record<string, any>, attr: string | string[] | undefined, value: any): void {\n if (!attr) {\n return;\n }\n if (typeof attr === 'string') {\n ConfigGeneric.setValue(data, attr.split('.'), value);\n return;\n }\n if (attr.length === 1) {\n if (value === null) {\n delete data[attr[0]];\n } else {\n data[attr[0]] = value;\n }\n } else {\n const part = attr.shift();\n\n if (typeof part !== 'string') {\n return;\n }\n\n if (!data[part] || typeof data[part] === 'object') {\n data[part] = data[part] || {};\n }\n ConfigGeneric.setValue(data[part], attr, value);\n }\n }\n\n getText(\n text:\n | ioBroker.StringOrTranslated\n | undefined\n | null\n | {\n /** @deprecated */\n func: ioBroker.StringOrTranslated;\n },\n noTranslation?: boolean,\n ): string {\n if (!text) {\n return '';\n }\n\n if (typeof text === 'string') {\n const strText = noTranslation ? text : I18n.t(text);\n if (strText.includes('${')) {\n return this.getPattern(strText, undefined, noTranslation);\n }\n return strText;\n }\n\n if (text && typeof text === 'object') {\n const funcText = text as {\n func: string;\n };\n if (funcText.func) {\n // calculate pattern\n if (typeof funcText.func === 'object') {\n return this.getPattern(\n (funcText.func as ioBroker.Translated)[this.lang] ||\n (funcText.func as ioBroker.Translated).en ||\n '',\n undefined,\n true,\n );\n }\n return this.getPattern(funcText.func, undefined, noTranslation);\n }\n\n return (text as ioBroker.Translated)[this.lang] || (text as ioBroker.Translated).en || '';\n }\n\n return (text as any).toString();\n }\n\n async getTextAsync(text: ioBroker.StringOrTranslated, noTranslation?: boolean): Promise<string> {\n if (!text) {\n return '';\n }\n\n if (typeof text === 'string') {\n const strText = noTranslation ? text : I18n.t(text);\n if (strText.includes('${')) {\n return this.getPatternAsync(strText, null, noTranslation);\n }\n return strText;\n }\n\n if (isObject(text)) {\n // todo\n if ((text as any).func) {\n // calculate pattern\n if (typeof (text as any).func === 'object') {\n return this.getPatternAsync(\n (text as any).func[this.lang] || (text as any).func.en || '',\n null,\n true,\n );\n }\n return this.getPatternAsync((text as any).func, null, noTranslation);\n }\n\n return text[this.lang] || text.en || '';\n }\n\n return (text as any).toString();\n }\n\n renderDialogConfirm(): JSX.Element | null {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n if (!confirm) {\n return null;\n }\n let icon: null | JSX.Element = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return (\n <DialogConfirm\n title={this.getText(confirm.title) || I18n.t('jc_Please confirm')}\n text={this.getText(confirm.text)}\n ok={this.getText(confirm.ok) || I18n.t('jc_Ok')}\n cancel={this.getText(confirm.cancel) || I18n.t('jc_Cancel')}\n icon={icon || undefined}\n onClose={isOk =>\n this.setState({ confirmDialog: false }, () => {\n if (isOk) {\n if (this.state.confirmCallback) {\n const callback = this.state.confirmCallback;\n this.setState({ confirmCallback: null }, () => callback(true));\n return;\n }\n\n const data = JSON.parse(JSON.stringify(this.props.data));\n if (this.state.confirmDepAttr) {\n ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);\n }\n\n ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);\n this.setState(\n {\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n },\n () => this.props.onChange(data),\n );\n } else {\n const callback = this.state.confirmCallback;\n this.setState(\n {\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n confirmCallback: null,\n },\n () => {\n if (callback) {\n callback(false);\n }\n },\n );\n }\n })\n }\n />\n );\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n getIcon(iconSettings?: ConfigIconType | null): JSX.Element | null {\n iconSettings = iconSettings || this.props.schema.icon;\n if (!iconSettings) {\n return null;\n }\n\n const namedIcon = NAMED_ICONS[iconSettings as ConfigNamedIcon];\n if (namedIcon) {\n return namedIcon();\n }\n\n // not a known name, so it must be an image\n if (iconSettings.endsWith('.png') || iconSettings.endsWith('.svg') || iconSettings.endsWith('.jpg')) {\n // this path is relative to ./adapter/NAME\n if (!iconSettings.startsWith('http://') && !iconSettings.startsWith('https://')) {\n iconSettings = `${this.props.oContext.imagePrefix}/adapter/${this.props.oContext.adapterName}/${iconSettings}`;\n }\n }\n\n return (\n <Icon\n src={iconSettings}\n style={{ width: 22, height: 22 }}\n />\n );\n }\n\n /**\n * Trigger onChange, to activate save button on change\n *\n * @param attr the changed attribute\n * @param newValue new value of the attribute\n */\n // eslint-disable-next-line react/no-unused-class-component-methods\n onChangeAsync(attr: string, newValue: unknown): Promise<void> {\n return new Promise(resolve => {\n const mayBePromise = this.onChange(attr, newValue, resolve);\n if (mayBePromise instanceof Promise) {\n mayBePromise.catch(e => console.error(`Cannot set value: ${e}`));\n }\n });\n }\n\n /**\n * Trigger onChange, to activate save button on change\n *\n * @param attr the changed attribute\n * @param newValue new value of the attribute\n * @param cb optional callback function, else returns a Promise\n */\n async onChange(attr: string | undefined, newValue: unknown, cb?: () => void): Promise<void> {\n // Do not use here deep copy, as it is not JsonConfig\n const data = JSON.parse(JSON.stringify(this.props.data));\n ConfigGeneric.setValue(data, attr, newValue);\n\n if (\n this.props.schema.confirm &&\n (await this.execute(\n this.props.schema.confirm.condition,\n false,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'confirm.condition',\n ))\n ) {\n return new Promise<void>(resolve => {\n this.setState(\n {\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmData: null,\n },\n () => {\n if (typeof cb === 'function') {\n cb();\n } else {\n resolve();\n }\n },\n );\n });\n }\n // find any inputs with confirmation\n if (this.props.schema.confirmDependsOn) {\n for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {\n const dep = this.props.schema.confirmDependsOn[z];\n if (dep.confirm) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n if (\n await this.execute(\n dep.confirm.condition,\n false,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'confirm.condition',\n )\n ) {\n return new Promise<void>(resolve => {\n if (!dep.confirm) {\n throw new Error(`Cannot set value: confirm is not defined for ${dep.attr}`);\n }\n this.setState(\n {\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmDepNewValue: val,\n confirmDepAttr: dep.attr,\n confirmData: dep.confirm,\n },\n () => {\n if (typeof cb === 'function') {\n cb();\n } else {\n resolve();\n }\n },\n );\n });\n }\n }\n }\n }\n\n const changed: string[] = [];\n if (this.props.schema.onChangeDependsOn) {\n for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {\n const dep = this.props.schema.onChangeDependsOn[z];\n if (dep.onChange) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n let _newValue;\n if (this.props.custom) {\n _newValue = await this.executeCustom(\n dep.onChange.calculateFunc,\n data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n );\n } else {\n _newValue = await this.execute(\n dep.onChange.calculateFunc,\n val,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n );\n }\n\n if (_newValue !== val && dep.attr) {\n ConfigGeneric.setValue(data, dep.attr, _newValue);\n changed.push(dep.attr);\n }\n }\n }\n }\n\n if (this.props.schema.hiddenDependsOn) {\n for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {\n const dep = this.props.schema.hiddenDependsOn[z];\n if (dep.hidden && dep.attr) {\n changed.push(dep.attr);\n }\n }\n }\n\n if (this.props.schema.labelDependsOn) {\n for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {\n const dep = this.props.schema.labelDependsOn[z];\n if (dep.hidden && dep.attr) {\n changed.push(dep.attr);\n }\n }\n }\n\n if (this.props.schema.helpDependsOn) {\n for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {\n const dep = this.props.schema.helpDependsOn[z];\n if (dep.hidden && dep.attr) {\n changed.push(dep.attr);\n }\n }\n }\n\n if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {\n const val = ConfigGeneric.getValue(data, this.props.attr);\n\n const newValue_ = this.props.custom\n ? await this.executeCustom(\n this.props.schema.onChange.calculateFunc,\n data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n )\n : await this.execute(\n this.props.schema.onChange.calculateFunc,\n val,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n );\n if (newValue_ !== val) {\n ConfigGeneric.setValue(data, this.props.attr, newValue_);\n }\n }\n\n if (this.props.custom) {\n this.props.onChange(attr, newValue, () => cb?.());\n\n if (changed?.length) {\n changed.forEach((_attr, i) =>\n setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50),\n );\n }\n } else {\n this.props.onChange(data, undefined, () => {\n if (changed.length) {\n this.props.oContext.forceUpdate(changed, data);\n }\n cb?.();\n });\n }\n\n return Promise.resolve();\n }\n\n /** Ensure that every bare getObject( call is preceded by \"await\". */\n static ensureAwaitGetObject(code: string): string {\n return code.replace(/(?<![\\w$.])getObject\\(/g, (match, offset) => {\n const before = code.slice(Math.max(0, offset - 10), offset);\n if (/await\\s+$/.test(before)) {\n return match;\n }\n return `await ${match}`;\n });\n }\n\n /**\n * Log the evaluation of a JS function to the browser console if the element has `debug: true`.\n * Requested in https://github.com/ioBroker/ioBroker.admin/issues/3374\n *\n * @param funcName name of the evaluated function, e.g. `hidden`, `disabled`, `validator`\n * @param func the JS function source that was executed\n * @param result the value the function returned (or an Error if it threw)\n * @param data the data object the function was executed against\n */\n protected debugLog(funcName: string, func: string, result: unknown, data?: Record<string, any>): void {\n if (!this.props.schema?.debug) {\n return;\n }\n const attr = this.props.attr || (this.props.schema as { attr?: string })?.attr || '';\n const label = `%c[jsonConfig]%c ${attr ? `${attr} → ` : ''}${funcName}`;\n const payload = {\n function: func,\n result,\n data: data ?? this.props.data,\n arrayIndex: this.props.arrayIndex,\n };\n if (result instanceof Error) {\n console.error(\n label,\n 'background:#b71c1c;color:#fff;border-radius:3px;padding:1px 4px',\n 'color:#e53935',\n payload,\n );\n } else {\n console.log(\n label,\n 'background:#33691e;color:#fff;border-radius:3px;padding:1px 4px',\n 'color:#7cb342',\n payload,\n );\n }\n }\n\n /**\n * Check if the element may be shown on the host, where the instance runs.\n *\n * It evaluates the `os`, `notOs` and `docker` attributes. If the operating system or the docker state\n * cannot be detected, the element will be shown, because it is better to show one element too much\n * than to hide a required one.\n *\n * @param schema config item or select option with the optional `os`, `notOs` and `docker` attributes\n * @param hostInfo information about the host, where the instance runs\n * @returns false if the element must not be shown on this host\n */\n static isHostAllowed(schema: Pick<ConfigItem, 'os' | 'notOs' | 'docker'>, hostInfo?: JsonConfigHostInfo): boolean {\n if (!schema?.os && !schema?.notOs && schema?.docker === undefined) {\n return true;\n }\n const os: ConfigItemOs | '' | undefined = hostInfo?.os;\n // If the operating system of the host is unknown, the `os`/`notOs` attributes will be ignored\n if (os) {\n if (schema.os) {\n const allowed: ConfigItemOs[] = Array.isArray(schema.os) ? schema.os : [schema.os];\n if (!allowed.includes(os)) {\n return false;\n }\n }\n if (schema.notOs) {\n const forbidden: ConfigItemOs[] = Array.isArray(schema.notOs) ? schema.notOs : [schema.notOs];\n if (forbidden.includes(os)) {\n return false;\n }\n }\n }\n // If the docker state of the host is unknown, the `docker` attribute will be ignored\n if (schema.docker !== undefined && hostInfo?.docker !== undefined && schema.docker !== hostInfo.docker) {\n return false;\n }\n return true;\n }\n\n async execute(\n func: string | boolean | Record<string, string> | undefined,\n defaultValue: string | number | boolean | undefined,\n data: Record<string, any> | undefined,\n arrayIndex: number | undefined,\n globalData: Record<string, any> | undefined,\n funcName?: string,\n ): Promise<string | number | boolean | undefined> {\n let fun: string;\n\n if (isObject(func)) {\n fun = func.func;\n } else if (typeof func === 'string') {\n fun = func;\n } else {\n return func;\n }\n\n if (!fun) {\n return defaultValue;\n }\n if (fun.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n fun = ConfigGeneric.ensureAwaitGetObject(fun);\n }\n try {\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n '_system',\n '_alive',\n '_common',\n '_socket',\n '_instance',\n 'arrayIndex',\n 'globalData',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n fun.includes('return') ? fun : `return ${fun}`,\n );\n const result = await f(\n data || this.props.data || {},\n this.props.originalData,\n this.props.oContext.systemConfig,\n this.props.alive,\n this.props.common,\n this.props.oContext.socket,\n this.props.oContext.instance,\n arrayIndex,\n globalData || {},\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n );\n this.debugLog(funcName || 'JS function', fun, result, data);\n return result;\n } catch (e) {\n this.debugLog(funcName || 'JS function', fun, e instanceof Error ? e : new Error(String(e)), data);\n console.error(`Cannot execute ${JSON.stringify(func)}: ${e}`);\n return defaultValue;\n }\n }\n\n async executeCustom(\n func: string | boolean | Record<string, string> | undefined,\n data: Record<string, any>,\n customObj: Record<string, any> | undefined,\n instanceObj: ioBroker.InstanceObject | undefined,\n arrayIndex: number | undefined,\n globalData: Record<string, any> | undefined,\n funcName?: string,\n ): Promise<string | boolean | number | null | undefined> {\n let fun: string;\n\n if (isObject(func)) {\n fun = func.func;\n } else if (typeof func === 'string') {\n fun = func;\n } else {\n return func;\n }\n\n if (!fun) {\n return null;\n }\n if (fun.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n fun = ConfigGeneric.ensureAwaitGetObject(fun);\n }\n try {\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n '_system',\n 'instanceObj',\n 'customObj',\n '_socket',\n 'arrayIndex',\n 'globalData',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n fun.includes('return') ? fun : `return ${fun}`,\n );\n const result = await f(\n data || this.props.data,\n this.props.originalData,\n this.props.oContext.systemConfig,\n instanceObj || {},\n customObj || {},\n this.props.oContext.socket,\n arrayIndex,\n globalData || {},\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n );\n this.debugLog(funcName || 'JS function', fun, result, data);\n return result;\n } catch (e) {\n this.debugLog(funcName || 'JS function', fun, e instanceof Error ? e : new Error(String(e)), data);\n console.error(`Cannot execute ${fun}: ${e}`);\n return null;\n }\n }\n\n async calculate(schema: Record<string, any>): Promise<{\n error: boolean;\n disabled: boolean;\n hidden: boolean;\n defaultValue: null | string | number | boolean;\n }> {\n let error: boolean;\n let disabled: boolean;\n let hidden: boolean;\n let defaultValue: null | string | number | boolean;\n\n if (this.props.custom) {\n error = schema.validator\n ? !(await this.executeCustom(\n schema.validator,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'validator',\n ))\n : false;\n if (schema.disabled === true) {\n disabled = true;\n } else {\n disabled = schema.disabled\n ? ((await this.executeCustom(\n schema.disabled,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'disabled',\n )) as boolean)\n : false;\n }\n if (schema.hidden === true) {\n hidden = true;\n } else {\n hidden = schema.hidden\n ? ((await this.executeCustom(\n schema.hidden,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'hidden',\n )) as boolean)\n : false;\n }\n defaultValue = schema.defaultFunc\n ? await this.executeCustom(\n schema.defaultFunc,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n )\n : schema.default;\n } else {\n error = schema.validator\n ? !(await this.execute(\n schema.validator,\n false,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'validator',\n ))\n : false;\n if (schema.disabled === true) {\n disabled = true;\n } else {\n disabled = schema.disabled\n ? ((await this.execute(\n schema.disabled,\n false,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'disabled',\n )) as boolean)\n : false;\n }\n if (schema.hidden === true) {\n hidden = true;\n } else {\n hidden = schema.hidden\n ? ((await this.execute(\n schema.hidden,\n false,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'hidden',\n )) as boolean)\n : false;\n }\n defaultValue = schema.defaultFunc\n ? await this.execute(\n schema.defaultFunc,\n schema.default,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n )\n : schema.default;\n }\n\n return {\n error,\n disabled,\n hidden,\n defaultValue,\n };\n }\n\n onError(attr: string | undefined, error?: string): void {\n if (attr) {\n if (!error) {\n delete this.isError[attr];\n } else {\n this.isError[attr] = error;\n }\n }\n\n this.props.onError?.(attr, error);\n }\n\n renderItem(_error: unknown, _disabled: boolean, _defaultValue?: unknown): JSX.Element | string | null {\n return this.getText(this.props.schema.label) || this.getText(this.props.schema.text);\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n renderHelp(\n text: ioBroker.StringOrTranslated | undefined | null,\n link?: string | null,\n noTranslation?: boolean,\n ): JSX.Element | JSX.Element[] | string {\n if (!link) {\n text = this.getText(text, noTranslation) || '';\n if (\n text &&\n (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))\n ) {\n return Utils.renderTextWithA(text);\n }\n return text;\n }\n return (\n <a\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{\n color: this.props.oContext.themeType === 'dark' ? '#a147ff' : '#5b238f',\n textDecoration: 'underline',\n }}\n >\n {this.getText(text, noTranslation)}\n </a>\n );\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n async renderHelpAsync(\n text: ioBroker.StringOrTranslated,\n link: string,\n noTranslation: boolean,\n ): Promise<JSX.Element | JSX.Element[] | string> {\n if (!link) {\n text = (await this.getTextAsync(text, noTranslation)) || '';\n if (\n text &&\n (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))\n ) {\n return Utils.renderTextWithA(text);\n }\n return text;\n }\n return (\n <a\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{\n color: this.props.oContext.themeType === 'dark' ? '#a147ff' : '#5b238f',\n textDecoration: 'underline',\n }}\n >\n {await this.getTextAsync(text, noTranslation)}\n </a>\n );\n }\n\n // we have a problem that a string '{\"password\": \"${password}\"}' cannot contain a double quota inside the string\n // escape it with \\\"\n static escapeString(str: string, data: Record<string, any>): string {\n if (typeof str !== 'string') {\n return '';\n }\n str = str.replace(/`/g, '\\\\`');\n // extract all tokens with ${data.token}\n str = str.replace(/\\${([^}]+)}/g, (_match: string, p1: any) => {\n if (p1 && typeof p1 === 'string' && p1.startsWith('data.')) {\n const value = ConfigGeneric.getValue(data, p1.replace(/^data\\./, ''));\n\n if (typeof value === 'string') {\n // Handle both backslashes and quotes to ensure valid JSON\n if (value.includes('\\\\') || value.includes('\"')) {\n return `\\${${p1}.replace(/\\\\\\\\/g, '\\\\\\\\\\\\\\\\').replace(/\"/g, '\\\\\\\\\"')}`;\n }\n }\n }\n return _match;\n });\n\n return str;\n }\n\n /** This function is used in pattern */\n getObject = async (id: string): Promise<ioBroker.Object | null> => {\n try {\n const obj = await this.props.oContext.getCachedObject?.(id);\n return obj || null;\n } catch (e) {\n console.error(e);\n return null;\n }\n };\n\n async getPatternAsync(\n pattern: string | { func: string },\n data?: Record<string, any> | null,\n noTranslation?: boolean,\n ): Promise<string> {\n data ||= this.props.data;\n if (!pattern) {\n return '';\n }\n let patternStr: string;\n if (typeof pattern === 'object') {\n if (pattern.func) {\n patternStr = pattern.func;\n } else {\n console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);\n patternStr = JSON.stringify(pattern);\n }\n } else {\n patternStr = pattern;\n }\n\n if (patternStr.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n patternStr = ConfigGeneric.ensureAwaitGetObject(patternStr);\n }\n\n try {\n if (this.props.custom) {\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n 'instanceObj',\n 'customObj',\n '_socket',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = await f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.oContext.instanceObj,\n this.props.customObj,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n }\n\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n '_alive',\n '_common',\n '_socket',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = await f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.alive,\n this.props.common,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n } catch (e) {\n console.error(`Cannot execute ${patternStr}: ${e}`);\n return patternStr;\n }\n }\n\n getPattern(pattern: string | { func: string }, data?: Record<string, any>, noTranslation?: boolean): string {\n data ||= this.props.data;\n if (!pattern) {\n return '';\n }\n let patternStr: string;\n if (typeof pattern === 'object') {\n if (pattern.func) {\n patternStr = pattern.func;\n } else {\n console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);\n patternStr = JSON.stringify(pattern);\n }\n } else {\n patternStr = pattern;\n }\n\n if (patternStr.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n console.warn(`It is not possible to use getObject function in text patterns: ${patternStr}`);\n }\n\n try {\n if (this.props.custom) {\n const f = new Function(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n 'instanceObj',\n 'customObj',\n '_socket',\n '_changed',\n '_href',\n '_os',\n '_arch',\n '_host',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.oContext.instanceObj,\n this.props.customObj,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n }\n\n const f = new Function(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n '_alive',\n '_common',\n '_socket',\n '_changed',\n '_href',\n '_os',\n '_arch',\n '_host',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.alive,\n this.props.common,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n } catch (e) {\n console.error(`Cannot execute ${patternStr}: ${e}`);\n return patternStr;\n }\n }\n\n updateCalculatedValues(): void {\n if (this.calculateTimeout) {\n clearTimeout(this.calculateTimeout);\n }\n this.calculateTimeout = setTimeout(async (): Promise<void> => {\n this.calculateTimeout = null;\n\n const schema = this.props.schema;\n\n if (!schema) {\n return;\n }\n const { error, disabled, hidden, defaultValue } = await this.calculate(schema);\n if (\n !this.state.calculatedValues ||\n this.state.calculatedValues.error !== error ||\n this.state.calculatedValues.disabled !== disabled ||\n this.state.calculatedValues.hidden !== hidden ||\n this.state.calculatedValues.defaultValue !== defaultValue\n ) {\n this.setState({\n calculatedValues: { error, disabled, hidden, defaultValue },\n });\n }\n }, 50);\n }\n\n render(): string | JSX.Element | null {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n // Do not show this component if expert mode is false\n if (this.props.expertMode === false && schema.expertMode) {\n return null;\n }\n\n // Do not show this component if it is not intended for the host, where the instance runs\n if (!ConfigGeneric.isHostAllowed(schema, this.props.oContext.hostInfo)) {\n return null;\n }\n\n if (this.props.alive && this.defaultSendToDone === false) {\n this.sendToTimeout = setTimeout(async () => {\n this.sendToTimeout = null;\n await this.defaultSendTo();\n }, 200);\n }\n\n this.updateCalculatedValues();\n\n if (!this.state.calculatedValues) {\n return null;\n }\n\n if (this.state.calculatedValues.hidden) {\n // Remove all errors if an element is hidden\n if (Object.keys(this.isError).length) {\n setTimeout(\n isError => Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100,\n JSON.parse(JSON.stringify(this.isError)),\n );\n this.isError = {};\n }\n\n if (schema.hideOnlyControl) {\n const item = (\n <Grid\n size={{\n xs: schema.xs || DEFAULT_SM_SIZE, // if xs is not defined, take the full width\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 /* marginRight: 8, */,\n textAlign: 'left',\n ...schema.style,\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\n // Used in table to not render hidden elements at all, so we need to inform about it\n if (this.props.onHiddenChanged && !this.reportedHidden) {\n this.reportedHidden = true;\n setTimeout(() => this.props.attr && this.props.onHiddenChanged?.(this.props.attr, true), 10);\n }\n return null;\n }\n if (this.props.onHiddenChanged && this.reportedHidden) {\n this.reportedHidden = false;\n setTimeout(() => this.props.attr && this.props.onHiddenChanged?.(this.props.attr, false), 10);\n }\n // Add error\n if (schema.validatorNoSaveOnError && this.props.attr) {\n if (this.state.calculatedValues.error && !Object.keys(this.isError).length) {\n this.isError = {\n [this.props.attr]: schema.validatorErrorText ? I18n.t(schema.validatorErrorText) : true,\n };\n setTimeout(\n isError => Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])),\n 100,\n JSON.parse(JSON.stringify(this.isError)),\n );\n } else if (!this.state.calculatedValues.error && Object.keys(this.isError).length) {\n setTimeout(\n isError => Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100,\n JSON.parse(JSON.stringify(this.isError)),\n );\n this.isError = {};\n }\n }\n\n const renderedItem = this.renderItem(\n this.state.calculatedValues.error,\n this.state.calculatedValues.disabled || this.props.commandRunning || this.props.disabled || false,\n this.state.calculatedValues.defaultValue,\n );\n\n if (this.noPlaceRequired) {\n return renderedItem;\n }\n\n const item = (\n <Grid\n title={this.getText(schema.tooltip)}\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\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 width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined,\n ...schema.style,\n ...(this.props.oContext.themeType === 'dark' ? schema.darkStyle : {}),\n }}\n >\n {this.props.schema.defaultSendTo && this.props.schema.button ? (\n <Grid\n container\n style={{ width: '100%' }}\n >\n <Grid sx={{ flex: 1 }}>{renderedItem}</Grid>\n <Grid>\n <Button\n disabled={this.state.calculatedValues.disabled}\n variant=\"outlined\"\n onClick={() => this.defaultSendTo()}\n title={\n this.props.schema.buttonTooltip\n ? this.getText(\n this.props.schema.buttonTooltip,\n this.props.schema.buttonTooltipNoTranslation,\n )\n : I18n.t('jc_Request data by instance')\n }\n >\n {this.getText(this.props.schema.button as ioBroker.StringOrTranslated)}\n </Button>\n </Grid>\n </Grid>\n ) : (\n renderedItem\n )}\n </Grid>\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {this.renderDialogConfirm()}\n {item}\n </>\n );\n }\n if (this.state.confirmDialog) {\n return (\n <>\n {this.renderDialogConfirm()}\n {item}\n </>\n );\n }\n return item;\n }\n}\n"]}
1
+ {"version":3,"file":"ConfigGeneric.js","sourceRoot":"src/","sources":["JsonConfigComponent/ConfigGeneric.tsx"],"names":[],"mappings":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AE,CAAC,IAAI,CAAC,aAAa,EAAE,EACnC,KAAK,EACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa;wBAC3B,CAAC,CAAC,IAAI,CAAC,OAAO,CACR,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,EAC/B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,0BAA0B,CAC/C;wBACH,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,6BAA6B,CAAC,IAG9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAqC,CAAC,CACjE,CACN,CACJ,CACV,CAAC,CAAC,CAAC,CACA,YAAY,CACf,CACE,CACV,CAAC;QAEF,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,CAAC,mBAAmB,EAAE;gBAC1B,IAAI,CACN,CACN,CAAC;QACN,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YAC3B,OAAO,CACH;gBACK,IAAI,CAAC,mBAAmB,EAAE;gBAC1B,IAAI,CACN,CACN,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC","sourcesContent":["import React, { Component, type JSX } from 'react';\n\nimport { Grid, Button } from '@mui/material';\n\nimport {\n Info as IconInfo,\n Warning as IconWarning,\n Error as IconError,\n Key as IconAuth,\n Send as IconSend,\n Public as IconWeb,\n Search as IconSearch,\n MenuBook as IconMenuBook,\n Help as IconHelp,\n UploadFile as IconUploadFile,\n Edit as IconEdit,\n Person as IconPerson,\n Group as IconGroup,\n Delete as IconDelete,\n Refresh as IconRefresh,\n Add as IconAdd,\n LinkOff as IconLinkOff,\n Link as LinkIcon,\n Save,\n OpenInNew,\n Highlight as IconBacklight,\n BrightnessMedium as IconDimmer,\n Fingerprint as IconIdentify,\n Lightbulb as IconLight,\n Reorder as IconLines,\n SkipNext as IconNext,\n Pause as IconPause,\n PlayArrow as IconPlay,\n SkipPrevious as IconPrevious,\n QrCode as IconQrCode,\n Settings as IconSettings,\n Power as IconSocket,\n Stop as IconStop,\n} from '@mui/icons-material';\n\nimport {\n DialogConfirm,\n Icon,\n Utils,\n I18n,\n type Connection,\n type ThemeType,\n type ThemeName,\n type IobTheme,\n} from '@iobroker/gui-components';\nimport type {\n ConfigIconType,\n ConfigItem,\n ConfigItemAny,\n ConfigItemConfirmData,\n ConfigItemOs,\n ConfigNamedIcon,\n JsonConfigContext,\n JsonConfigHostInfo,\n} from '../types';\n\nconst DEFAULT_SM_SIZE = window.innerWidth <= 600 ? 12 : undefined;\n\n/**\n * All named icons a schema may use. `Record<ConfigNamedIcon, ...>` is deliberate: adding a name to `ConfigNamedIcon`\n * without a renderer here is a compile error, instead of silently falling through to the image path below.\n */\nconst NAMED_ICONS: Record<ConfigNamedIcon, () => JSX.Element> = {\n add: () => <IconAdd />,\n auth: () => <IconAuth />,\n backlight: () => <IconBacklight />,\n book: () => <IconMenuBook />,\n delete: () => <IconDelete />,\n dimmer: () => <IconDimmer />,\n edit: () => <IconEdit />,\n error: () => <IconError />,\n group: () => <IconGroup />,\n help: () => <IconHelp />,\n identify: () => <IconIdentify />,\n info: () => <IconInfo />,\n light: () => <IconLight />,\n lines: () => <IconLines />,\n next: () => <IconNext />,\n open: () => <OpenInNew />,\n pair: () => <LinkIcon />,\n pause: () => <IconPause />,\n play: () => <IconPlay />,\n previous: () => <IconPrevious />,\n qrcode: () => <IconQrCode />,\n refresh: () => <IconRefresh />,\n save: () => <Save />,\n search: () => <IconSearch />,\n send: () => <IconSend />,\n settings: () => <IconSettings />,\n socket: () => <IconSocket />,\n stop: () => <IconStop />,\n unpair: () => <IconLinkOff />,\n upload: () => <IconUploadFile />,\n user: () => <IconPerson />,\n warning: () => <IconWarning />,\n web: () => <IconWeb />,\n};\n\n// because this class is used in react-components, do not include here any foreign files like from '../../helpers/utils.ts'\nexport function isObject(it: any): it is Record<string, any> {\n // This is necessary because:\n // typeof null === 'object'\n // typeof [] === 'object'\n // [] instanceof Object === true\n return Object.prototype.toString.call(it) === '[object Object]'; // this code is 25% faster than below one\n // return it && typeof it === 'object' && !(it instanceof Array);\n}\n\nexport interface DeviceManagerPropsProps {\n /* socket object */\n socket: Connection;\n /* Instance to communicate with device-manager backend, like `adapterName.X` */\n selectedInstance: string; // adapterName.X\n registerHandler?: (handler: null | ((command: string) => void)) => void;\n themeName: ThemeName;\n theme: IobTheme;\n themeType: ThemeType;\n isFloatComma: boolean;\n dateFormat: string;\n /** Instance to upload images to, like `adapterName.X` */\n uploadImagesToInstance?: string;\n /** Filter devices with this string */\n filter?: string;\n /** If this component is used in GUI with own toolbar. `false` if this list is used with multiple instances and true if only with one (in this case, it will monitor alive itself */\n embedded?: boolean;\n /** If embedded, this text is shown in the toolbar */\n title?: string;\n /** Style of a component that displays all devices */\n style?: React.CSSProperties;\n /** Use small cards for devices */\n smallCards?: boolean;\n}\n\nexport interface ConfigGenericProps {\n oContext: JsonConfigContext;\n alive: boolean;\n arrayIndex?: number;\n attr?: string;\n changed: boolean;\n className?: string;\n expertMode?: boolean;\n commandRunning?: boolean;\n common?: Record<string, any>;\n custom?: boolean;\n customObj?: Record<string, any>;\n data: Record<string, any>;\n disabled?: boolean;\n // filled only by table and represents the obj.native or obj.common.custom['adapter.X'] object\n globalData?: Record<string, any>;\n // filled only by table\n index?: number;\n isParentTab?: boolean;\n onChange: (\n attrOrData: string | Record<string, any> | undefined,\n val?: any,\n cb?: () => void,\n saveConfig?: boolean,\n ) => void;\n onError: (attr: string | undefined, error?: string) => void;\n onHiddenChanged?: (attr: string, hidden?: boolean) => void;\n /** Filled only by table: components with value/label options report their label mappings for table filtering */\n onFilterLabelUpdate?: (attr: string, valueToLabel: Record<string, string>) => void;\n originalData: Record<string, any>;\n /** This indicates that the component is the very firsts one - root */\n root?: boolean;\n /** Provided props by the specific component */\n schema: ConfigItemAny;\n style?: Record<string, any>;\n /** This item is in the table. Maybe some layouts must be changed */\n table?: boolean;\n themeName: ThemeName;\n /** User can provide their own components for specific input fields */\n customComponents?: { [componentType: string]: typeof ConfigGeneric<ConfigGenericProps, any> };\n}\n\nexport interface ConfigGenericState {\n confirmDialog: boolean;\n confirmNewValue: any;\n confirmAttr: any;\n confirmData: ConfigItemConfirmData | null;\n value?: any;\n confirmDepAttr?: any;\n confirmDepNewValue?: any;\n confirmCallback: null | ((result: boolean) => void);\n calculatedValues?: {\n error: boolean;\n disabled: boolean;\n hidden: boolean;\n defaultValue: null | string | number | boolean;\n };\n}\n\nexport default class ConfigGeneric<\n Props extends ConfigGenericProps = ConfigGenericProps,\n State extends ConfigGenericState = ConfigGenericState,\n> extends Component<Props, State> {\n static DIFFERENT_VALUE = '__different__';\n static DIFFERENT_LABEL = 'jc___different__';\n static NONE_VALUE = '';\n static NONE_LABEL = 'jc_none';\n private defaultValue: any;\n private isError: any;\n private readonly lang: ioBroker.Languages;\n private defaultSendToDone?: boolean;\n private sendToTimeout?: any;\n private noPlaceRequired: any;\n private reportedHidden: boolean = false;\n private calculateTimeout: ReturnType<typeof setTimeout> | null = null;\n private readonly AsyncFunction: FunctionConstructor;\n /** Resolved `dependsOnStates` of this element: alias => state ID */\n protected stateAliases: Record<string, string> | null = null;\n /** True if this element has subscribed on states, so it must unsubscribe if `dependsOnStates` disappears */\n protected statesSubscribed: boolean = false;\n\n constructor(props: Props) {\n super(props);\n this.AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;\n\n // @ts-expect-error of course, as we just\n this.state = {\n confirmDialog: false,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n confirmCallback: null,\n } satisfies ConfigGenericState;\n\n this.isError = {};\n\n this.lang = I18n.getLanguage();\n\n // Initialize literal defaults synchronously so the first render has them.\n // defaultFunc is evaluated asynchronously in componentDidMount.\n if (props.schema) {\n if (props.custom) {\n if (!props.schema.defaultFunc) {\n this.defaultValue = props.schema.default;\n }\n } else if (props.schema.type !== 'state' && !props.schema.defaultFunc) {\n this.defaultValue = props.schema.default;\n }\n }\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n protected async getCachedObject(id: string): Promise<ioBroker.Object | null> {\n if (this.props.oContext.getCachedObject) {\n return this.props.oContext.getCachedObject(id);\n }\n return (await this.props.oContext.socket.getObject(id)) || null;\n }\n\n /**\n * Bring the `dependsOnStates` attribute into the form `{ alias: stateID }`.\n * In the short array form the state ID is used as an alias too.\n *\n * @param dependsOnStates value of the `dependsOnStates` attribute\n * @returns aliases with the still unresolved state IDs\n */\n static normalizeDependsOnStates(\n dependsOnStates: Record<string, string> | string[] | undefined,\n ): Record<string, string> {\n const result: Record<string, string> = {};\n if (!dependsOnStates) {\n return result;\n }\n if (Array.isArray(dependsOnStates)) {\n dependsOnStates.forEach(id => {\n if (id && typeof id === 'string') {\n result[id] = id;\n }\n });\n } else if (isObject(dependsOnStates)) {\n Object.keys(dependsOnStates).forEach(alias => {\n if (dependsOnStates[alias] && typeof dependsOnStates[alias] === 'string') {\n result[alias] = dependsOnStates[alias];\n }\n });\n } else {\n console.error(`[JsonConfigComponent] Invalid dependsOnStates: ${JSON.stringify(dependsOnStates)}`);\n }\n return result;\n }\n\n /**\n * Build the real state ID out of a `dependsOnStates` entry: resolve the `${data.xxx}` patterns and\n * expand a leading dot (`.info.running`) to the namespace of the own instance.\n *\n * @param id state ID from the schema\n * @returns the resolved state ID or an empty string if it cannot be used\n */\n protected async resolveStateId(id: string): Promise<string> {\n let result = (id || '').toString();\n if (result.includes('${')) {\n result = await this.getPatternAsync(result, null, true);\n }\n result = result.trim();\n if (result.startsWith('.')) {\n result = `${this.props.oContext.adapterName}.${this.props.oContext.instance || 0}${result}`;\n }\n if (result.includes('*')) {\n console.error(`[JsonConfigComponent] Wildcards are not allowed in dependsOnStates: ${result}`);\n return '';\n }\n return result;\n }\n\n /**\n * Resolve all state IDs of a `dependsOnStates` attribute.\n *\n * @param dependsOnStates value of the `dependsOnStates` attribute\n * @returns aliases with the resolved state IDs\n */\n protected async resolveDependsOnStates(\n dependsOnStates: Record<string, string> | string[] | undefined,\n ): Promise<Record<string, string>> {\n const aliases = ConfigGeneric.normalizeDependsOnStates(dependsOnStates);\n const resolved: Record<string, string> = {};\n for (const alias of Object.keys(aliases)) {\n const id = await this.resolveStateId(aliases[alias]);\n if (id) {\n resolved[alias] = id;\n }\n }\n return resolved;\n }\n\n /**\n * Subscribe on the given state IDs. The promise is resolved as soon as all values are known,\n * so the following calculation does not run with unknown states.\n *\n * @param ids resolved state IDs\n */\n protected async subscribeOnStateIds(ids: string[]): Promise<void> {\n if (!ids.length && !this.statesSubscribed) {\n return;\n }\n this.statesSubscribed = !!ids.length;\n await this.props.oContext.subscribeStates?.(this, ids, this.onDependsOnStateChanged);\n }\n\n /**\n * Resolve the `dependsOnStates` attribute of this element and subscribe on the states.\n *\n * It is called before every calculation and not only once, because a state ID can contain a\n * `${data.xxx}` pattern and so it can change if the user changes the configuration.\n */\n protected async updateStateSubscriptions(): Promise<void> {\n this.stateAliases = await this.resolveDependsOnStates(this.props.schema?.dependsOnStates);\n await this.subscribeOnStateIds(Object.values(this.stateAliases));\n }\n\n /** True if this element depends on ioBroker states */\n protected usesDependsOnStates(): boolean {\n return !!this.props.schema?.dependsOnStates || this.statesSubscribed;\n }\n\n /** One of the states from `dependsOnStates` changed => recalculate `hidden`, `disabled`, ... */\n protected onDependsOnStateChanged = (): void => {\n this.forceUpdate();\n };\n\n /**\n * Values of the subscribed states for the JS functions and patterns (`_states.<alias>`).\n *\n * @param aliases alias => state ID. If omitted, the aliases of this element are used\n * @returns alias => state object. `null` if the state does not exist\n */\n protected getStateValues(aliases?: Record<string, string> | null): Record<string, ioBroker.State | null> {\n const map = aliases === undefined ? this.stateAliases : aliases;\n const result: Record<string, ioBroker.State | null> = {};\n if (map) {\n Object.keys(map).forEach(alias => {\n result[alias] = this.props.oContext.getStateValue?.(map[alias]) ?? null;\n });\n }\n return result;\n }\n\n async componentDidMount(): Promise<void> {\n if (this.usesDependsOnStates()) {\n // Subscribe before the first calculation, so `defaultFunc` and `hidden` already see the values\n await this.updateStateSubscriptions();\n }\n\n if (this.props.schema?.defaultFunc) {\n if (this.props.custom) {\n this.defaultValue = await this.executeCustom(\n this.props.schema.defaultFunc,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n );\n } else if (this.props.schema.type !== 'state') {\n this.defaultValue = await this.execute(\n this.props.schema.defaultFunc,\n this.props.schema.default,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n );\n }\n }\n\n if (this.props.attr) {\n this.props.oContext.registerOnForceUpdate?.(this.props.attr, this.onUpdate);\n }\n const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];\n // init default value\n if (this.defaultValue !== undefined && this.props.attr) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (\n value === undefined ||\n (LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))\n ) {\n setTimeout(() => {\n if (!this.props.attr) {\n return;\n }\n if (this.props.custom) {\n this.props.onChange(this.props.attr, this.defaultValue, () =>\n setTimeout(\n () =>\n this.props.attr &&\n this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n 100,\n ),\n );\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);\n this.props.onChange(\n this.props.data,\n undefined,\n () =>\n this.props.attr && this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n );\n }\n }, 100);\n }\n } else if (this.props.schema.defaultSendTo) {\n this.defaultSendTo().catch(e => console.error(e));\n }\n }\n\n private async defaultSendTo(): Promise<void> {\n if (this.props.alive && this.props.schema.defaultSendTo) {\n this.defaultSendToDone = true;\n let data: any = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n const dataStr = await this.getPatternAsync(this.props.schema.jsonData, null, true);\n try {\n data = JSON.parse(dataStr);\n } catch {\n console.error(`Cannot parse json data: ${dataStr}`);\n }\n } else {\n data = {\n attr: this.props.attr,\n value: ConfigGeneric.getValue(this.props.data, this.props.attr),\n };\n }\n\n if (data === undefined) {\n data = null;\n }\n const instance = await this.getPatternAsync(\n (this.props.schema as any).instance ||\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n );\n // Check that instance is alive\n if (instance !== `${this.props.oContext.adapterName}.${this.props.oContext.instance}`) {\n const alive = await this.props.oContext.socket.getState(`system.adapter.${instance}.alive`);\n if (!alive?.val) {\n window.alert(I18n.t('jc_Instance %s is not alive', instance));\n return;\n }\n }\n try {\n const value = await this.props.oContext.socket.sendTo(instance, this.props.schema.defaultSendTo, data);\n if (value !== null && value !== undefined && this.props.attr) {\n if (this.props.custom) {\n this.props.onChange(\n this.props.attr,\n value,\n () =>\n this.props.attr && this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n );\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, value);\n this.props.onChange(\n this.props.data,\n undefined,\n () =>\n this.props.attr && this.props.oContext.forceUpdate([this.props.attr], this.props.data),\n );\n }\n }\n } catch (e) {\n console.error(e);\n }\n } else {\n this.defaultSendToDone = false;\n if (!this.props.schema.allowSaveWithError) {\n // show error, that instance did not start\n this.onError(\n this.props.attr,\n I18n.t('jc_Instance %s is not alive', this.props.oContext.instance.toString()),\n );\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this.props.attr) {\n this.props.oContext.registerOnForceUpdate?.(this.props.attr);\n }\n // Not only if `statesSubscribed` is true: the element could have released its states before (an ID\n // with a `${data.xxx}` pattern was resolved to nothing), but it is still registered in the pool\n this.props.oContext.unsubscribeStates?.(this);\n this.statesSubscribed = false;\n if (this.sendToTimeout) {\n clearTimeout(this.sendToTimeout);\n this.sendToTimeout = null;\n }\n if (this.calculateTimeout) {\n clearTimeout(this.calculateTimeout);\n this.calculateTimeout = null;\n }\n }\n\n onUpdate = (data: Record<string, any>): void => {\n const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';\n if (this.state.value !== value) {\n this.setState({ value });\n } else {\n this.forceUpdate();\n }\n };\n\n /**\n * Extract attribute out of data\n */\n static getValue(data: Record<string, any>, attr: string | string[] | undefined): any {\n if (!attr) {\n return undefined;\n }\n if (typeof attr === 'string') {\n return ConfigGeneric.getValue(data, attr.split('.'));\n }\n if (attr.length === 1) {\n return data[attr[0]];\n }\n const part = attr.shift();\n\n if (typeof part === 'string' && typeof data[part] === 'object') {\n return ConfigGeneric.getValue(data[part], attr);\n }\n return undefined;\n }\n\n static setValue(data: Record<string, any>, attr: string | string[] | undefined, value: any): void {\n if (!attr) {\n return;\n }\n if (typeof attr === 'string') {\n ConfigGeneric.setValue(data, attr.split('.'), value);\n return;\n }\n if (attr.length === 1) {\n if (value === null) {\n delete data[attr[0]];\n } else {\n data[attr[0]] = value;\n }\n } else {\n const part = attr.shift();\n\n if (typeof part !== 'string') {\n return;\n }\n\n if (!data[part] || typeof data[part] === 'object') {\n data[part] = data[part] || {};\n }\n ConfigGeneric.setValue(data[part], attr, value);\n }\n }\n\n getText(\n text:\n | ioBroker.StringOrTranslated\n | undefined\n | null\n | {\n /** @deprecated */\n func: ioBroker.StringOrTranslated;\n },\n noTranslation?: boolean,\n /** Values for `_states`. If omitted, the states of this element are used */\n states?: Record<string, ioBroker.State | null>,\n ): string {\n if (!text) {\n return '';\n }\n\n if (typeof text === 'string') {\n const strText = noTranslation ? text : I18n.t(text);\n if (strText.includes('${')) {\n return this.getPattern(strText, undefined, noTranslation, states);\n }\n return strText;\n }\n\n if (text && typeof text === 'object') {\n const funcText = text as {\n func: string;\n };\n if (funcText.func) {\n // calculate pattern\n if (typeof funcText.func === 'object') {\n return this.getPattern(\n (funcText.func as ioBroker.Translated)[this.lang] ||\n (funcText.func as ioBroker.Translated).en ||\n '',\n undefined,\n true,\n states,\n );\n }\n return this.getPattern(funcText.func, undefined, noTranslation, states);\n }\n\n return (text as ioBroker.Translated)[this.lang] || (text as ioBroker.Translated).en || '';\n }\n\n return (text as any).toString();\n }\n\n async getTextAsync(text: ioBroker.StringOrTranslated, noTranslation?: boolean): Promise<string> {\n if (!text) {\n return '';\n }\n\n if (typeof text === 'string') {\n const strText = noTranslation ? text : I18n.t(text);\n if (strText.includes('${')) {\n return this.getPatternAsync(strText, null, noTranslation);\n }\n return strText;\n }\n\n if (isObject(text)) {\n // todo\n if ((text as any).func) {\n // calculate pattern\n if (typeof (text as any).func === 'object') {\n return this.getPatternAsync(\n (text as any).func[this.lang] || (text as any).func.en || '',\n null,\n true,\n );\n }\n return this.getPatternAsync((text as any).func, null, noTranslation);\n }\n\n return text[this.lang] || text.en || '';\n }\n\n return (text as any).toString();\n }\n\n renderDialogConfirm(): JSX.Element | null {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n if (!confirm) {\n return null;\n }\n let icon: null | JSX.Element = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return (\n <DialogConfirm\n title={this.getText(confirm.title) || I18n.t('jc_Please confirm')}\n text={this.getText(confirm.text)}\n ok={this.getText(confirm.ok) || I18n.t('jc_Ok')}\n cancel={this.getText(confirm.cancel) || I18n.t('jc_Cancel')}\n icon={icon || undefined}\n onClose={isOk =>\n this.setState({ confirmDialog: false }, () => {\n if (isOk) {\n if (this.state.confirmCallback) {\n const callback = this.state.confirmCallback;\n this.setState({ confirmCallback: null }, () => callback(true));\n return;\n }\n\n const data = JSON.parse(JSON.stringify(this.props.data));\n if (this.state.confirmDepAttr) {\n ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);\n }\n\n ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);\n this.setState(\n {\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n },\n () => this.props.onChange(data),\n );\n } else {\n const callback = this.state.confirmCallback;\n this.setState(\n {\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n confirmCallback: null,\n },\n () => {\n if (callback) {\n callback(false);\n }\n },\n );\n }\n })\n }\n />\n );\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n getIcon(iconSettings?: ConfigIconType | null): JSX.Element | null {\n iconSettings = iconSettings || this.props.schema.icon;\n if (!iconSettings) {\n return null;\n }\n\n const namedIcon = NAMED_ICONS[iconSettings as ConfigNamedIcon];\n if (namedIcon) {\n return namedIcon();\n }\n\n // not a known name, so it must be an image\n if (iconSettings.endsWith('.png') || iconSettings.endsWith('.svg') || iconSettings.endsWith('.jpg')) {\n // this path is relative to ./adapter/NAME\n if (!iconSettings.startsWith('http://') && !iconSettings.startsWith('https://')) {\n iconSettings = `${this.props.oContext.imagePrefix}/adapter/${this.props.oContext.adapterName}/${iconSettings}`;\n }\n }\n\n return (\n <Icon\n src={iconSettings}\n style={{ width: 22, height: 22 }}\n />\n );\n }\n\n /**\n * Trigger onChange, to activate save button on change\n *\n * @param attr the changed attribute\n * @param newValue new value of the attribute\n */\n // eslint-disable-next-line react/no-unused-class-component-methods\n onChangeAsync(attr: string, newValue: unknown): Promise<void> {\n return new Promise(resolve => {\n const mayBePromise = this.onChange(attr, newValue, resolve);\n if (mayBePromise instanceof Promise) {\n mayBePromise.catch(e => console.error(`Cannot set value: ${e}`));\n }\n });\n }\n\n /**\n * Trigger onChange, to activate save button on change\n *\n * @param attr the changed attribute\n * @param newValue new value of the attribute\n * @param cb optional callback function, else returns a Promise\n */\n async onChange(attr: string | undefined, newValue: unknown, cb?: () => void): Promise<void> {\n // Do not use here deep copy, as it is not JsonConfig\n const data = JSON.parse(JSON.stringify(this.props.data));\n ConfigGeneric.setValue(data, attr, newValue);\n\n if (\n this.props.schema.confirm &&\n (await this.execute(\n this.props.schema.confirm.condition,\n false,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'confirm.condition',\n ))\n ) {\n return new Promise<void>(resolve => {\n this.setState(\n {\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmData: null,\n },\n () => {\n if (typeof cb === 'function') {\n cb();\n } else {\n resolve();\n }\n },\n );\n });\n }\n // find any inputs with confirmation\n if (this.props.schema.confirmDependsOn) {\n for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {\n const dep = this.props.schema.confirmDependsOn[z];\n if (dep.confirm) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n if (\n await this.execute(\n dep.confirm.condition,\n false,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'confirm.condition',\n )\n ) {\n return new Promise<void>(resolve => {\n if (!dep.confirm) {\n throw new Error(`Cannot set value: confirm is not defined for ${dep.attr}`);\n }\n this.setState(\n {\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmDepNewValue: val,\n confirmDepAttr: dep.attr,\n confirmData: dep.confirm,\n },\n () => {\n if (typeof cb === 'function') {\n cb();\n } else {\n resolve();\n }\n },\n );\n });\n }\n }\n }\n }\n\n const changed: string[] = [];\n if (this.props.schema.onChangeDependsOn) {\n for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {\n const dep = this.props.schema.onChangeDependsOn[z];\n if (dep.onChange) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n let _newValue;\n if (this.props.custom) {\n _newValue = await this.executeCustom(\n dep.onChange.calculateFunc,\n data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n );\n } else {\n _newValue = await this.execute(\n dep.onChange.calculateFunc,\n val,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n );\n }\n\n if (_newValue !== val && dep.attr) {\n ConfigGeneric.setValue(data, dep.attr, _newValue);\n changed.push(dep.attr);\n }\n }\n }\n }\n\n if (this.props.schema.hiddenDependsOn) {\n for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {\n const dep = this.props.schema.hiddenDependsOn[z];\n if (dep.hidden && dep.attr) {\n changed.push(dep.attr);\n }\n }\n }\n\n if (this.props.schema.labelDependsOn) {\n for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {\n const dep = this.props.schema.labelDependsOn[z];\n if (dep.hidden && dep.attr) {\n changed.push(dep.attr);\n }\n }\n }\n\n if (this.props.schema.helpDependsOn) {\n for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {\n const dep = this.props.schema.helpDependsOn[z];\n if (dep.hidden && dep.attr) {\n changed.push(dep.attr);\n }\n }\n }\n\n if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {\n const val = ConfigGeneric.getValue(data, this.props.attr);\n\n const newValue_ = this.props.custom\n ? await this.executeCustom(\n this.props.schema.onChange.calculateFunc,\n data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n )\n : await this.execute(\n this.props.schema.onChange.calculateFunc,\n val,\n data,\n this.props.arrayIndex,\n this.props.globalData,\n 'onChange.calculateFunc',\n );\n if (newValue_ !== val) {\n ConfigGeneric.setValue(data, this.props.attr, newValue_);\n }\n }\n\n if (this.props.custom) {\n this.props.onChange(attr, newValue, () => cb?.());\n\n if (changed?.length) {\n changed.forEach((_attr, i) =>\n setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50),\n );\n }\n } else {\n this.props.onChange(data, undefined, () => {\n if (changed.length) {\n this.props.oContext.forceUpdate(changed, data);\n }\n cb?.();\n });\n }\n\n return Promise.resolve();\n }\n\n /** Ensure that every bare getObject( call is preceded by \"await\". */\n static ensureAwaitGetObject(code: string): string {\n return code.replace(/(?<![\\w$.])getObject\\(/g, (match, offset) => {\n const before = code.slice(Math.max(0, offset - 10), offset);\n if (/await\\s+$/.test(before)) {\n return match;\n }\n return `await ${match}`;\n });\n }\n\n /**\n * Log the evaluation of a JS function to the browser console if the element has `debug: true`.\n * Requested in https://github.com/ioBroker/ioBroker.admin/issues/3374\n *\n * @param funcName name of the evaluated function, e.g. `hidden`, `disabled`, `validator`\n * @param func the JS function source that was executed\n * @param result the value the function returned (or an Error if it threw)\n * @param data the data object the function was executed against\n */\n protected debugLog(funcName: string, func: string, result: unknown, data?: Record<string, any>): void {\n if (!this.props.schema?.debug) {\n return;\n }\n const attr = this.props.attr || (this.props.schema as { attr?: string })?.attr || '';\n const label = `%c[jsonConfig]%c ${attr ? `${attr} → ` : ''}${funcName}`;\n const payload = {\n function: func,\n result,\n data: data ?? this.props.data,\n arrayIndex: this.props.arrayIndex,\n };\n if (result instanceof Error) {\n console.error(\n label,\n 'background:#b71c1c;color:#fff;border-radius:3px;padding:1px 4px',\n 'color:#e53935',\n payload,\n );\n } else {\n console.log(\n label,\n 'background:#33691e;color:#fff;border-radius:3px;padding:1px 4px',\n 'color:#7cb342',\n payload,\n );\n }\n }\n\n /**\n * Check if the element may be shown on the host, where the instance runs.\n *\n * It evaluates the `os`, `notOs` and `docker` attributes. If the operating system or the docker state\n * cannot be detected, the element will be shown, because it is better to show one element too much\n * than to hide a required one.\n *\n * @param schema config item or select option with the optional `os`, `notOs` and `docker` attributes\n * @param hostInfo information about the host, where the instance runs\n * @returns false if the element must not be shown on this host\n */\n static isHostAllowed(schema: Pick<ConfigItem, 'os' | 'notOs' | 'docker'>, hostInfo?: JsonConfigHostInfo): boolean {\n if (!schema?.os && !schema?.notOs && schema?.docker === undefined) {\n return true;\n }\n const os: ConfigItemOs | '' | undefined = hostInfo?.os;\n // If the operating system of the host is unknown, the `os`/`notOs` attributes will be ignored\n if (os) {\n if (schema.os) {\n const allowed: ConfigItemOs[] = Array.isArray(schema.os) ? schema.os : [schema.os];\n if (!allowed.includes(os)) {\n return false;\n }\n }\n if (schema.notOs) {\n const forbidden: ConfigItemOs[] = Array.isArray(schema.notOs) ? schema.notOs : [schema.notOs];\n if (forbidden.includes(os)) {\n return false;\n }\n }\n }\n // If the docker state of the host is unknown, the `docker` attribute will be ignored\n if (schema.docker !== undefined && hostInfo?.docker !== undefined && schema.docker !== hostInfo.docker) {\n return false;\n }\n return true;\n }\n\n async execute(\n func: string | boolean | Record<string, string> | undefined,\n defaultValue: string | number | boolean | undefined,\n data: Record<string, any> | undefined,\n arrayIndex: number | undefined,\n globalData: Record<string, any> | undefined,\n funcName?: string,\n /** Values for `_states`. If omitted, the states of this element are used */\n states?: Record<string, ioBroker.State | null>,\n ): Promise<string | number | boolean | undefined> {\n let fun: string;\n\n if (isObject(func)) {\n fun = func.func;\n } else if (typeof func === 'string') {\n fun = func;\n } else {\n return func;\n }\n\n if (!fun) {\n return defaultValue;\n }\n if (fun.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n fun = ConfigGeneric.ensureAwaitGetObject(fun);\n }\n try {\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n '_system',\n '_alive',\n '_common',\n '_socket',\n '_instance',\n 'arrayIndex',\n 'globalData',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n '_states',\n fun.includes('return') ? fun : `return ${fun}`,\n );\n const result = await f(\n data || this.props.data || {},\n this.props.originalData,\n this.props.oContext.systemConfig,\n this.props.alive,\n this.props.common,\n this.props.oContext.socket,\n this.props.oContext.instance,\n arrayIndex,\n globalData || {},\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n states || this.getStateValues(),\n );\n this.debugLog(funcName || 'JS function', fun, result, data);\n return result;\n } catch (e) {\n this.debugLog(funcName || 'JS function', fun, e instanceof Error ? e : new Error(String(e)), data);\n console.error(`Cannot execute ${JSON.stringify(func)}: ${e}`);\n return defaultValue;\n }\n }\n\n async executeCustom(\n func: string | boolean | Record<string, string> | undefined,\n data: Record<string, any>,\n customObj: Record<string, any> | undefined,\n instanceObj: ioBroker.InstanceObject | undefined,\n arrayIndex: number | undefined,\n globalData: Record<string, any> | undefined,\n funcName?: string,\n /** Values for `_states`. If omitted, the states of this element are used */\n states?: Record<string, ioBroker.State | null>,\n ): Promise<string | boolean | number | null | undefined> {\n let fun: string;\n\n if (isObject(func)) {\n fun = func.func;\n } else if (typeof func === 'string') {\n fun = func;\n } else {\n return func;\n }\n\n if (!fun) {\n return null;\n }\n if (fun.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n fun = ConfigGeneric.ensureAwaitGetObject(fun);\n }\n try {\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n '_system',\n 'instanceObj',\n 'customObj',\n '_socket',\n 'arrayIndex',\n 'globalData',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n '_states',\n fun.includes('return') ? fun : `return ${fun}`,\n );\n const result = await f(\n data || this.props.data,\n this.props.originalData,\n this.props.oContext.systemConfig,\n instanceObj || {},\n customObj || {},\n this.props.oContext.socket,\n arrayIndex,\n globalData || {},\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n states || this.getStateValues(),\n );\n this.debugLog(funcName || 'JS function', fun, result, data);\n return result;\n } catch (e) {\n this.debugLog(funcName || 'JS function', fun, e instanceof Error ? e : new Error(String(e)), data);\n console.error(`Cannot execute ${fun}: ${e}`);\n return null;\n }\n }\n\n async calculate(schema: Record<string, any>): Promise<{\n error: boolean;\n disabled: boolean;\n hidden: boolean;\n defaultValue: null | string | number | boolean;\n }> {\n let error: boolean;\n let disabled: boolean;\n let hidden: boolean;\n let defaultValue: null | string | number | boolean;\n\n if (this.props.custom) {\n error = schema.validator\n ? !(await this.executeCustom(\n schema.validator,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'validator',\n ))\n : false;\n if (schema.disabled === true) {\n disabled = true;\n } else {\n disabled = schema.disabled\n ? ((await this.executeCustom(\n schema.disabled,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'disabled',\n )) as boolean)\n : false;\n }\n if (schema.hidden === true) {\n hidden = true;\n } else {\n hidden = schema.hidden\n ? ((await this.executeCustom(\n schema.hidden,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'hidden',\n )) as boolean)\n : false;\n }\n defaultValue = schema.defaultFunc\n ? await this.executeCustom(\n schema.defaultFunc,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n )\n : schema.default;\n } else {\n error = schema.validator\n ? !(await this.execute(\n schema.validator,\n false,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'validator',\n ))\n : false;\n if (schema.disabled === true) {\n disabled = true;\n } else {\n disabled = schema.disabled\n ? ((await this.execute(\n schema.disabled,\n false,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'disabled',\n )) as boolean)\n : false;\n }\n if (schema.hidden === true) {\n hidden = true;\n } else {\n hidden = schema.hidden\n ? ((await this.execute(\n schema.hidden,\n false,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'hidden',\n )) as boolean)\n : false;\n }\n defaultValue = schema.defaultFunc\n ? await this.execute(\n schema.defaultFunc,\n schema.default,\n this.props.data,\n this.props.arrayIndex,\n this.props.globalData,\n 'defaultFunc',\n )\n : schema.default;\n }\n\n return {\n error,\n disabled,\n hidden,\n defaultValue,\n };\n }\n\n onError(attr: string | undefined, error?: string): void {\n if (attr) {\n if (!error) {\n delete this.isError[attr];\n } else {\n this.isError[attr] = error;\n }\n }\n\n this.props.onError?.(attr, error);\n }\n\n renderItem(_error: unknown, _disabled: boolean, _defaultValue?: unknown): JSX.Element | string | null {\n return this.getText(this.props.schema.label) || this.getText(this.props.schema.text);\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n renderHelp(\n text: ioBroker.StringOrTranslated | undefined | null,\n link?: string | null,\n noTranslation?: boolean,\n ): JSX.Element | JSX.Element[] | string {\n if (!link) {\n text = this.getText(text, noTranslation) || '';\n if (\n text &&\n (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))\n ) {\n return Utils.renderTextWithA(text);\n }\n return text;\n }\n return (\n <a\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{\n color: this.props.oContext.themeType === 'dark' ? '#a147ff' : '#5b238f',\n textDecoration: 'underline',\n }}\n >\n {this.getText(text, noTranslation)}\n </a>\n );\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n async renderHelpAsync(\n text: ioBroker.StringOrTranslated,\n link: string,\n noTranslation: boolean,\n ): Promise<JSX.Element | JSX.Element[] | string> {\n if (!link) {\n text = (await this.getTextAsync(text, noTranslation)) || '';\n if (\n text &&\n (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))\n ) {\n return Utils.renderTextWithA(text);\n }\n return text;\n }\n return (\n <a\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{\n color: this.props.oContext.themeType === 'dark' ? '#a147ff' : '#5b238f',\n textDecoration: 'underline',\n }}\n >\n {await this.getTextAsync(text, noTranslation)}\n </a>\n );\n }\n\n // we have a problem that a string '{\"password\": \"${password}\"}' cannot contain a double quota inside the string\n // escape it with \\\"\n static escapeString(str: string, data: Record<string, any>): string {\n if (typeof str !== 'string') {\n return '';\n }\n str = str.replace(/`/g, '\\\\`');\n // extract all tokens with ${data.token}\n str = str.replace(/\\${([^}]+)}/g, (_match: string, p1: any) => {\n if (p1 && typeof p1 === 'string' && p1.startsWith('data.')) {\n const value = ConfigGeneric.getValue(data, p1.replace(/^data\\./, ''));\n\n if (typeof value === 'string') {\n // Handle both backslashes and quotes to ensure valid JSON\n if (value.includes('\\\\') || value.includes('\"')) {\n return `\\${${p1}.replace(/\\\\\\\\/g, '\\\\\\\\\\\\\\\\').replace(/\"/g, '\\\\\\\\\"')}`;\n }\n }\n }\n return _match;\n });\n\n return str;\n }\n\n /** This function is used in pattern */\n getObject = async (id: string): Promise<ioBroker.Object | null> => {\n try {\n const obj = await this.props.oContext.getCachedObject?.(id);\n return obj || null;\n } catch (e) {\n console.error(e);\n return null;\n }\n };\n\n async getPatternAsync(\n pattern: string | { func: string },\n data?: Record<string, any> | null,\n noTranslation?: boolean,\n /** Values for `_states`. If omitted, the states of this element are used */\n states?: Record<string, ioBroker.State | null>,\n ): Promise<string> {\n data ||= this.props.data;\n if (!pattern) {\n return '';\n }\n let patternStr: string;\n if (typeof pattern === 'object') {\n if (pattern.func) {\n patternStr = pattern.func;\n } else {\n console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);\n patternStr = JSON.stringify(pattern);\n }\n } else {\n patternStr = pattern;\n }\n\n if (patternStr.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n patternStr = ConfigGeneric.ensureAwaitGetObject(patternStr);\n }\n\n try {\n if (this.props.custom) {\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n 'instanceObj',\n 'customObj',\n '_socket',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n '_states',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = await f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.oContext.instanceObj,\n this.props.customObj,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n states || this.getStateValues(),\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n }\n\n const f = new this.AsyncFunction(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n '_alive',\n '_common',\n '_socket',\n '_changed',\n '_href',\n 'getObject',\n '_os',\n '_arch',\n '_host',\n '_states',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = await f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.alive,\n this.props.common,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.getObject,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n states || this.getStateValues(),\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n } catch (e) {\n console.error(`Cannot execute ${patternStr}: ${e}`);\n return patternStr;\n }\n }\n\n getPattern(\n pattern: string | { func: string },\n data?: Record<string, any>,\n noTranslation?: boolean,\n /** Values for `_states`. If omitted, the states of this element are used */\n states?: Record<string, ioBroker.State | null>,\n ): string {\n data ||= this.props.data;\n if (!pattern) {\n return '';\n }\n let patternStr: string;\n if (typeof pattern === 'object') {\n if (pattern.func) {\n patternStr = pattern.func;\n } else {\n console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);\n patternStr = JSON.stringify(pattern);\n }\n } else {\n patternStr = pattern;\n }\n\n if (patternStr.includes('getObject(')) {\n // ensure, that await is placed in front of getObject\n console.warn(`It is not possible to use getObject function in text patterns: ${patternStr}`);\n }\n\n try {\n if (this.props.custom) {\n const f = new Function(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n 'instanceObj',\n 'customObj',\n '_socket',\n '_changed',\n '_href',\n '_os',\n '_arch',\n '_host',\n '_states',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.oContext.instanceObj,\n this.props.customObj,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n states || this.getStateValues(),\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n }\n\n const f = new Function(\n 'data',\n 'originalData',\n 'arrayIndex',\n 'globalData',\n '_system',\n '_alive',\n '_common',\n '_socket',\n '_changed',\n '_href',\n '_os',\n '_arch',\n '_host',\n '_states',\n `return \\`${ConfigGeneric.escapeString(patternStr, data)}\\``,\n );\n const text = f(\n data,\n this.props.originalData,\n this.props.arrayIndex,\n this.props.globalData,\n this.props.oContext.systemConfig,\n this.props.alive,\n this.props.common,\n this.props.oContext.socket,\n this.props.changed,\n window.location.href,\n this.props.oContext.hostInfo?.os || '',\n this.props.oContext.hostInfo?.arch || '',\n this.props.oContext.hostInfo || {},\n states || this.getStateValues(),\n );\n if (noTranslation) {\n return text;\n }\n return I18n.t(text);\n } catch (e) {\n console.error(`Cannot execute ${patternStr}: ${e}`);\n return patternStr;\n }\n }\n\n updateCalculatedValues(): void {\n if (this.calculateTimeout) {\n clearTimeout(this.calculateTimeout);\n }\n this.calculateTimeout = setTimeout(async (): Promise<void> => {\n this.calculateTimeout = null;\n\n const schema = this.props.schema;\n\n if (!schema) {\n return;\n }\n if (this.usesDependsOnStates()) {\n // The state IDs can contain `${data.xxx}` patterns, so they must be resolved anew if the data changed.\n // It waits for the first values, so the element is not calculated with unknown states.\n await this.updateStateSubscriptions();\n }\n const { error, disabled, hidden, defaultValue } = await this.calculate(schema);\n if (\n !this.state.calculatedValues ||\n this.state.calculatedValues.error !== error ||\n this.state.calculatedValues.disabled !== disabled ||\n this.state.calculatedValues.hidden !== hidden ||\n this.state.calculatedValues.defaultValue !== defaultValue\n ) {\n this.setState({\n calculatedValues: { error, disabled, hidden, defaultValue },\n });\n }\n }, 50);\n }\n\n render(): string | JSX.Element | null {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n // Do not show this component if expert mode is false\n if (this.props.expertMode === false && schema.expertMode) {\n return null;\n }\n\n // Do not show this component if it is not intended for the host, where the instance runs\n if (!ConfigGeneric.isHostAllowed(schema, this.props.oContext.hostInfo)) {\n return null;\n }\n\n if (this.props.alive && this.defaultSendToDone === false) {\n this.sendToTimeout = setTimeout(async () => {\n this.sendToTimeout = null;\n await this.defaultSendTo();\n }, 200);\n }\n\n this.updateCalculatedValues();\n\n if (!this.state.calculatedValues) {\n return null;\n }\n\n if (this.state.calculatedValues.hidden) {\n // Remove all errors if an element is hidden\n if (Object.keys(this.isError).length) {\n setTimeout(\n isError => Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100,\n JSON.parse(JSON.stringify(this.isError)),\n );\n this.isError = {};\n }\n\n if (schema.hideOnlyControl) {\n const item = (\n <Grid\n size={{\n xs: schema.xs || DEFAULT_SM_SIZE, // if xs is not defined, take the full width\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 /* marginRight: 8, */,\n textAlign: 'left',\n ...schema.style,\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\n // Used in table to not render hidden elements at all, so we need to inform about it\n if (this.props.onHiddenChanged && !this.reportedHidden) {\n this.reportedHidden = true;\n setTimeout(() => this.props.attr && this.props.onHiddenChanged?.(this.props.attr, true), 10);\n }\n return null;\n }\n if (this.props.onHiddenChanged && this.reportedHidden) {\n this.reportedHidden = false;\n setTimeout(() => this.props.attr && this.props.onHiddenChanged?.(this.props.attr, false), 10);\n }\n // Add error\n if (schema.validatorNoSaveOnError && this.props.attr) {\n if (this.state.calculatedValues.error && !Object.keys(this.isError).length) {\n this.isError = {\n [this.props.attr]: schema.validatorErrorText ? I18n.t(schema.validatorErrorText) : true,\n };\n setTimeout(\n isError => Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])),\n 100,\n JSON.parse(JSON.stringify(this.isError)),\n );\n } else if (!this.state.calculatedValues.error && Object.keys(this.isError).length) {\n setTimeout(\n isError => Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100,\n JSON.parse(JSON.stringify(this.isError)),\n );\n this.isError = {};\n }\n }\n\n const renderedItem = this.renderItem(\n this.state.calculatedValues.error,\n this.state.calculatedValues.disabled || this.props.commandRunning || this.props.disabled || false,\n this.state.calculatedValues.defaultValue,\n );\n\n if (this.noPlaceRequired) {\n return renderedItem;\n }\n\n const item = (\n <Grid\n title={this.getText(schema.tooltip)}\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\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 width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined,\n ...schema.style,\n ...(this.props.oContext.themeType === 'dark' ? schema.darkStyle : {}),\n }}\n >\n {this.props.schema.defaultSendTo && this.props.schema.button ? (\n <Grid\n container\n style={{ width: '100%' }}\n >\n <Grid sx={{ flex: 1 }}>{renderedItem}</Grid>\n <Grid>\n <Button\n disabled={this.state.calculatedValues.disabled}\n variant=\"outlined\"\n onClick={() => this.defaultSendTo()}\n title={\n this.props.schema.buttonTooltip\n ? this.getText(\n this.props.schema.buttonTooltip,\n this.props.schema.buttonTooltipNoTranslation,\n )\n : I18n.t('jc_Request data by instance')\n }\n >\n {this.getText(this.props.schema.button as ioBroker.StringOrTranslated)}\n </Button>\n </Grid>\n </Grid>\n ) : (\n renderedItem\n )}\n </Grid>\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {this.renderDialogConfirm()}\n {item}\n </>\n );\n }\n if (this.state.confirmDialog) {\n return (\n <>\n {this.renderDialogConfirm()}\n {item}\n </>\n );\n }\n return item;\n }\n}\n"]}
@@ -35,6 +35,11 @@ export default class ConfigTabs extends ConfigGeneric<ConfigTabsProps, ConfigTab
35
35
  private resizeRaf;
36
36
  private calculateTimeoutTable;
37
37
  private pinTimeout;
38
+ /**
39
+ * Resolved `dependsOnStates` of the tabs: tab name => (alias => state ID).
40
+ * The tab bar calculates `hidden`/`disabled` of the tabs itself, so it must subscribe to their states too.
41
+ */
42
+ private tabStateAliases;
38
43
  private readonly refDiv;
39
44
  constructor(props: ConfigTabsProps);
40
45
  onTabError: (attr?: string, error?: string) => void;
@@ -54,6 +59,10 @@ export default class ConfigTabs extends ConfigGeneric<ConfigTabsProps, ConfigTab
54
59
  measureWidth: () => void;
55
60
  onHashTabsChanged: () => void;
56
61
  onMenuChange(tab: string): void;
62
+ /** The tab bar depends on the states of all its tabs, because it calculates their `hidden`/`disabled` */
63
+ protected usesDependsOnStates(): boolean;
64
+ /** Subscribe on the own states and additionally on the states of all tabs */
65
+ protected updateStateSubscriptions(): Promise<void>;
57
66
  updateCalculatedValuesForTable(): void;
58
67
  render(): JSX.Element | null;
59
68
  }