@iobroker/json-config 7.7.2 → 7.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/build/JsonConfigComponent/ChipInput.d.ts +2 -2
- package/build/JsonConfigComponent/ChipInput.js +5 -8
- package/build/JsonConfigComponent/ChipInput.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAccordion.d.ts +5 -0
- package/build/JsonConfigComponent/ConfigAccordion.js +86 -6
- package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +4 -1
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +25 -9
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCheckDocker.d.ts +16 -0
- package/build/JsonConfigComponent/ConfigCheckDocker.js +52 -0
- package/build/JsonConfigComponent/ConfigCheckDocker.js.map +1 -0
- package/build/JsonConfigComponent/ConfigGeneric.js +5 -2
- package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/build/JsonConfigComponent/ConfigJsonEditor.js +10 -2
- package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/build/JsonConfigComponent/ConfigNumber.js +20 -3
- package/build/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPanel.js +2 -0
- package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPort.js +47 -8
- package/build/JsonConfigComponent/ConfigPort.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSelectSendTo.js +1 -1
- package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigState.js +1 -1
- package/build/JsonConfigComponent/ConfigState.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTable.d.ts +5 -0
- package/build/JsonConfigComponent/ConfigTable.js +71 -7
- package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTabs.d.ts +3 -0
- package/build/JsonConfigComponent/ConfigTabs.js +42 -7
- package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.js +4 -2
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.js.map +1 -1
- package/build/JsonConfigComponent/wrapper/Components/Editor.d.ts +1 -1
- package/build/JsonConfigComponent/wrapper/Components/Editor.js +1 -1
- package/build/JsonConfigComponent/wrapper/Components/Editor.js.map +1 -1
- package/build/types.d.ts +15 -5
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigState.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EACH,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,GAAG,EACH,WAAW,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,4BAA4B,CAAC;AAGvE,OAAO,aAAa,MAAM,SAAS,CAAC;AACpC,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAElG,SAAS,cAAc,CAAC,KAAe,EAAE,KAAwB;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO;YACH,uCAAuC,EAAE;gBACrC,IAAI,EAAE;oBACF,KAAK;iBACR;gBACD,MAAM,EAAE;oBACJ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;iBACzD;aACJ;YACD,SAAS,EAAE,2CAA2C;SACzD,CAAC;IACN,CAAC;IACD,OAAO;QACH,kCAAkC,EAAE;YAChC,IAAI,EAAE;g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AC;gBACjF,CAAC;qBAAM,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;oBACxC,KAAK,GAAG,MAAM,CAAC;oBACf,GAAG,GAAG,KAAK,CAAC;gBAChB,CAAC;qBAAM,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;oBAC7C,KAAK,GAAG,WAAW,CAAC;oBACpB,GAAG,GAAG,KAAK,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACJ,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;oBAC/B,GAAG,GAAG,KAAK,CAAC;gBAChB,CAAC;gBAED,OAAO,GAAG,CACN,6BAAK,KAAK,EAAE,QAAQ;oBACf,YAAY;oBACb,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE;wBAC3D,oBAAC,GAAG,IACA,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,IAErD,KAAK,CACJ;wBACL,IAAI,CAAC,CAAC,CAAC,8BAAM,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAG,IAAI,CAAQ,CAAC,CAAC,CAAC,IAAI,CAC9E,CACJ,CACT,CAAC;YACN,CAAC;QACL,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,eAAe,WAAW,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport {\n TextField,\n IconButton,\n Button,\n Switch,\n Slider,\n Box,\n FormControl,\n InputLabel,\n Select,\n MenuItem,\n} from '@mui/material';\n\nimport { I18n, Icon, type IobTheme } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemState } from '../types';\nimport getIconByName from './Icons';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nfunction valueBlinkOnce(theme: IobTheme, color?: string | boolean): any {\n if (typeof color === 'string') {\n return {\n '@keyframes newStateAnimationOnceColor': {\n '0%': {\n color,\n },\n '100%': {\n color: theme.palette.mode === 'dark' ? '#fff' : '#000',\n },\n },\n animation: 'newStateAnimationOnceColor 2s ease-in-out',\n };\n }\n return {\n '@keyframes newStateAnimationOnce': {\n '0%': {\n color: '#00f900',\n },\n '80%': {\n color: theme.palette.mode === 'dark' ? '#518851' : '#008000',\n },\n '100%': {\n color: theme.palette.mode === 'dark' ? '#fff' : '#000',\n },\n },\n animation: 'newStateAnimationOnce 2s ease-in-out',\n };\n}\n\ninterface ConfigStateProps extends ConfigGenericProps {\n schema: ConfigItemState;\n}\n\ninterface ConfigStateState extends ConfigGenericState {\n stateValue?: string | number | boolean | null;\n controlType?: 'text' | 'html' | 'input' | 'slider' | 'select' | 'button' | 'switch' | 'number';\n obj?: ioBroker.Object | null;\n}\n\nclass ConfigState extends ConfigGeneric<ConfigStateProps, ConfigStateState> {\n controlTimeout: ReturnType<typeof setTimeout> | null = null;\n\n delayedUpdate: { timer: ReturnType<typeof setTimeout> | null; value: string | boolean | number | null } = {\n timer: null,\n value: null,\n };\n\n getObjectID(): string {\n let oid = this.props.schema.oid;\n if (oid.includes('${')) {\n oid = this.getPattern(oid, null, true);\n }\n\n if (this.props.schema.foreign) {\n return oid;\n }\n\n return `${this.props.schema.system ? 'system.adapter.' : ''}${this.props.oContext.adapterName}.${this.props.oContext.instance || 0}.${oid}`;\n }\n\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n const obj: ioBroker.StateObject = (await this.props.oContext.socket.getObject(\n this.getObjectID(),\n )) as ioBroker.StateObject;\n\n if (obj?.common?.states && !this.props.schema.options) {\n // Normalize states to object\n if (Array.isArray(obj?.common?.states)) {\n // convert array to object\n const states: Record<string, string> = {};\n obj.common.states.forEach((state, index) => {\n states[index.toString()] = state;\n });\n obj.common.states = states;\n }\n if (!Object.keys(obj.common.states).length) {\n obj.common.states = undefined; // remove empty states\n }\n }\n\n const controlType = this.props.schema.control || this.detectType(obj);\n\n try {\n const state = await this.props.oContext.socket.getState(this.getObjectID());\n\n this.setState({ stateValue: state ? state.val : null, controlType, obj }, async () => {\n await this.props.oContext.socket.subscribeState(this.getObjectID(), this.onStateChanged);\n });\n } catch (e) {\n console.error(`Cannot get state ${this.getObjectID()}: ${e}`);\n this.setState({ controlType, obj });\n }\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.props.oContext.socket.unsubscribeState(this.getObjectID(), this.onStateChanged);\n if (this.delayedUpdate.timer) {\n clearTimeout(this.delayedUpdate.timer);\n this.delayedUpdate.timer = null;\n }\n\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n this.controlTimeout = null;\n this.props.oContext.socket\n .setState(this.getObjectID(), this.state.stateValue, false)\n .catch((e: Error) => console.error(`Cannot control value: ${e.toString()}`));\n }\n }\n\n onStateChanged = (_id: string, state: ioBroker.State | null | undefined): void => {\n let val = state ? state.val : null;\n if (this.state.controlType === 'button' || this.state.controlType === 'switch') {\n val = !!val;\n if (this.state.stateValue !== val) {\n this.setState({ stateValue: val });\n }\n } else if (val !== null && (this.state.controlType === 'slider' || this.state.controlType === 'number')) {\n val = parseFloat(val as unknown as string);\n console.log(`${Date.now()} Received new value: ${val}`);\n if (val !== this.state.stateValue) {\n if (this.delayedUpdate.timer) {\n clearTimeout(this.delayedUpdate.timer);\n this.delayedUpdate.timer = null;\n }\n this.delayedUpdate.value = val;\n this.delayedUpdate.timer = setTimeout(() => {\n this.setState({ stateValue: this.delayedUpdate.value });\n }, 500);\n } else if (this.delayedUpdate.timer) {\n clearTimeout(this.delayedUpdate.timer);\n this.delayedUpdate.timer = null;\n }\n } else if (this.state.stateValue.toString() !== val.toString()) {\n this.setState({ stateValue: val });\n }\n };\n\n detectType(obj: ioBroker.StateObject): 'button' | 'switch' | 'slider' | 'input' | 'text' | 'select' {\n obj ||= {} as ioBroker.StateObject;\n obj.common ||= {} as ioBroker.StateCommon;\n\n // read an object\n if (obj.common.type === 'boolean') {\n if (this.props.schema.controlled !== false) {\n if (obj.common.read === false || this.props.schema.controlled === true) {\n return 'button';\n }\n if (obj.common.write || this.props.schema.controlled === true) {\n return 'switch';\n }\n }\n\n return 'text';\n }\n\n if (obj.common.type === 'number' && this.props.schema.controlled !== false) {\n if (obj.common.write || this.props.schema.controlled === true) {\n if (obj.common.states || this.props.schema.options) {\n return 'select';\n }\n if (obj.common.max !== undefined) {\n return 'slider';\n }\n return 'input';\n }\n return 'text';\n }\n\n if (obj.common.write && this.props.schema.controlled !== false) {\n if (obj.common.states || this.props.schema.options) {\n return 'select';\n }\n return 'input';\n }\n\n return 'text';\n }\n\n getNormalizedStates(): {\n label: string;\n value: number | string;\n hidden?: string | boolean;\n color?: string;\n }[] {\n let states: {\n label: string;\n value: number | string;\n hidden?: string | boolean;\n color?: string;\n }[];\n if (this.props.schema.options) {\n states = this.props.schema.options.map(state => {\n if (typeof state === 'string') {\n return { value: state, label: this.getText(state, this.props.schema.noTranslation) };\n }\n return {\n value: state.value,\n label: this.getText(state.label, this.props.schema.noTranslation),\n color: state.color,\n };\n });\n } else if (this.state.obj.common.states) {\n states = [];\n Object.keys(this.state.obj.common.states).forEach(key => {\n states.push({\n value: key,\n label: this.getText(this.state.obj.common.states[key], this.props.schema.noTranslation),\n });\n });\n } else {\n states = [];\n }\n\n return states;\n }\n\n renderItem(_error: string, disabled: boolean /*, defaultValue */): JSX.Element {\n if (!this.state.obj) {\n return null;\n }\n\n let content: JSX.Element;\n\n if (\n this.state.controlType === 'select' ||\n (!this.state.controlType &&\n (this.state.obj.common.type === 'number' || this.state.obj.common.type === 'string') &&\n this.state.obj.common.write !== false &&\n (this.props.schema.options || this.state.obj.common.states))\n ) {\n const states = this.getNormalizedStates();\n const item = states.find(it => it.value === this.state.stateValue);\n\n content = (\n <FormControl fullWidth>\n <InputLabel>${this.getText(this.props.schema.label)}</InputLabel>\n <Select\n value={this.state.stateValue}\n disabled={!!this.props.schema.readOnly || disabled}\n onChange={e => {\n this.setState({ stateValue: e.target.value }, (): void => {\n let value: string | number = this.state.stateValue as string | number;\n if (this.state.obj.common.type === 'number') {\n value = parseFloat((value as unknown as string).toString().replace(',', '.'));\n }\n\n void this.props.oContext.socket.setState(this.getObjectID(), value, false);\n });\n }}\n renderValue={(val: string) =>\n item?.color ? <div style={{ color: item.color }}>{item.label}</div> : val\n }\n >\n {states.map(item => (\n <MenuItem\n key={(item.value ?? '').toString()}\n value={item.value}\n style={{ color: item.color }}\n >\n ${item.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n } else if (\n this.state.controlType === 'button' ||\n (!this.state.controlType &&\n this.state.obj.common.type === 'boolean' &&\n ((this.state.obj.common.write && this.state.obj.common.read === false) ||\n this.state.obj.common.role?.includes('button')))\n ) {\n let icon: JSX.Element | null = null;\n if (this.props.schema.falseImage) {\n icon = getIconByName(this.props.schema.falseImage);\n }\n\n const text = this.getText(\n this.props.schema.falseText || this.props.schema.label,\n this.props.schema.noTranslation,\n );\n\n if (!text && icon) {\n content = (\n <IconButton\n style={this.props.schema.falseTextStyle}\n disabled={!!this.props.schema.readOnly}\n onClick={async () => {\n if (this.props.schema.confirm) {\n this.setState({\n confirmDialog: true,\n confirmCallback: async (result: boolean) => {\n if (result) {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined ? this.props.schema.buttonValue : true,\n false,\n );\n }\n }}\n >\n {icon}\n </IconButton>\n );\n } else {\n content = (\n <Button\n variant={this.props.schema.variant || 'contained'}\n startIcon={icon}\n style={this.props.schema.falseTextStyle}\n disabled={disabled || !!this.props.schema.readOnly}\n onClick={async () => {\n if (this.props.schema.confirm) {\n this.setState({\n confirmDialog: true,\n confirmCallback: async (result: boolean) => {\n if (result) {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined ? this.props.schema.buttonValue : true,\n false,\n );\n }\n }}\n >\n {text || this.getObjectID().split('.').pop()}\n </Button>\n );\n }\n } else if (\n this.state.controlType === 'input' ||\n (!this.state.controlType && this.state.obj.common.write && this.state.obj.common.type === 'string')\n ) {\n content = (\n <div style={{ width: '100%', display: 'flex', flexDirection: 'row', gap: 8, alignItems: 'baseline' }}>\n <TextField\n style={{ flex: 1 }}\n value={this.state.stateValue}\n variant=\"standard\"\n disabled={!!this.props.schema.readOnly || disabled}\n slotProps={{\n input: {\n endAdornment:\n this.getText(this.props.schema.unit, this.props.schema.noTranslation) ||\n this.state.obj.common.unit ||\n undefined,\n },\n htmlInput: {\n readOnly: !!this.props.schema.readOnly,\n },\n }}\n onKeyUp={e => {\n if (this.props.schema.setOnEnterKey && e.key === 'Enter') {\n void this.props.oContext.socket.setState(\n this.getObjectID(),\n this.state.stateValue,\n false,\n );\n }\n }}\n onChange={e => {\n this.setState({ stateValue: e.target.value }, (): void => {\n if (this.props.schema.setOnEnterKey || this.props.schema.showEnterButton) {\n return;\n }\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n }\n this.controlTimeout = setTimeout(async () => {\n this.controlTimeout = null;\n let value: string | number = this.state.stateValue as string | number;\n if (this.state.obj.common.type === 'number') {\n value = parseFloat((value as unknown as string).toString().replace(',', '.'));\n }\n\n await this.props.oContext.socket.setState(this.getObjectID(), value, false);\n }, this.props.schema.controlDelay || 0);\n });\n }}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n />\n {this.props.schema.showEnterButton && !this.props.schema.readOnly && (\n <Button\n variant=\"outlined\"\n disabled={disabled}\n onClick={() => {\n void this.props.oContext.socket.setState(\n this.getObjectID(),\n this.state.stateValue,\n false,\n );\n }}\n >\n {this.getText(\n typeof this.props.schema.showEnterButton === 'string'\n ? this.props.schema.showEnterButton\n : 'Set',\n )}\n </Button>\n )}\n </div>\n );\n } else {\n let fontSize: number | undefined;\n if (this.props.schema.size === 'normal') {\n fontSize = 16;\n } else if (this.props.schema.size === 'large') {\n fontSize = 20;\n } else if (typeof this.props.schema.size === 'number') {\n fontSize = this.props.schema.size;\n }\n let label = this.getText(this.props.schema.label, this.props.schema.noTranslation);\n\n const divStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n fontSize: fontSize || '1rem',\n gap: 8,\n };\n\n if (!this.props.schema.narrow) {\n divStyle.width = '100%';\n divStyle.justifyContent = 'space-between';\n }\n\n if (label.trim()) {\n if (!label.trim().endsWith(':') && this.props.schema.addColon) {\n label = `${label.trim()}:`;\n }\n }\n\n let blinkStyle: React.CSSProperties | undefined;\n if (this.props.schema.blinkOnUpdate) {\n blinkStyle = valueBlinkOnce(this.props.oContext.theme, this.props.schema.blinkOnUpdate);\n }\n\n let labelIcon: React.JSX.Element | undefined;\n if (this.props.schema.labelIcon) {\n labelIcon = (\n <Icon\n src={this.props.schema.labelIcon}\n style={{ marginRight: 4 }}\n />\n );\n }\n\n let labelControl: React.JSX.Element | undefined;\n if (label && labelIcon) {\n labelControl = (\n <div style={{ whiteSpace: 'nowrap' }}>\n {labelIcon}\n {label}\n </div>\n );\n } else if (label) {\n labelControl = <div style={{ whiteSpace: 'nowrap' }}>{label}</div>;\n } else if (labelIcon) {\n labelControl = labelIcon;\n }\n\n if (\n this.state.controlType === 'switch' ||\n (!this.state.controlType &&\n this.state.obj.common.type === 'boolean' &&\n ((this.state.obj.common.write && this.state.obj.common.read !== false) ||\n this.state.obj.common.role?.includes('switch')))\n ) {\n let iconFalse: JSX.Element | null = null;\n const textFalse = this.getText(this.props.schema.falseText, this.props.schema.noTranslation);\n if (this.props.schema.falseImage) {\n iconFalse = getIconByName(this.props.schema.falseImage, textFalse ? { marginLeft: 8 } : undefined);\n }\n let iconTrue: JSX.Element | null = null;\n const textTrue = this.getText(this.props.schema.trueText, this.props.schema.noTranslation);\n if (this.props.schema.trueImage) {\n iconTrue = getIconByName(this.props.schema.trueImage, textTrue ? { marginRight: 8 } : undefined);\n }\n\n content = (\n <Switch\n checked={!!this.state.stateValue}\n disabled={!!this.props.schema.readOnly || disabled}\n onChange={async () => {\n if (this.props.schema.confirm) {\n this.setState({\n confirmDialog: true,\n confirmCallback: async (result: boolean) => {\n if (result) {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n !this.state.stateValue,\n false,\n );\n }\n },\n });\n } else {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n !this.state.stateValue,\n false,\n );\n }\n }}\n />\n );\n\n if (textFalse || iconFalse || textTrue || iconTrue) {\n content = (\n <div style={{ display: 'flex', alignItems: 'center', fontSize: 14 }}>\n <span style={this.props.schema.falseTextStyle}>\n {textFalse}\n {iconFalse}\n </span>\n {content}\n <span style={this.props.schema.trueTextStyle}>\n {iconTrue}\n {textTrue}\n </span>\n </div>\n );\n }\n\n if (labelControl) {\n content = (\n <div style={divStyle}>\n {labelControl}\n {content}\n </div>\n );\n }\n } else if (\n this.state.controlType === 'slider' ||\n (!this.state.controlType &&\n this.state.obj.common.type === 'number' &&\n ((this.state.obj.common.write &&\n (this.state.obj.common.max !== undefined || this.state.obj.common.unit === '%')) ||\n this.state.obj.common.role?.includes('slider') ||\n this.state.obj.common.role?.includes('dimmer') ||\n this.state.obj.common.role?.includes('blind')))\n ) {\n let iconFalse: JSX.Element | null = null;\n const textFalse = this.getText(this.props.schema.falseText, this.props.schema.noTranslation);\n if (this.props.schema.falseImage) {\n iconFalse = getIconByName(this.props.schema.falseImage, textFalse ? { marginLeft: 8 } : undefined);\n }\n let iconTrue: JSX.Element | null = null;\n const textTrue = this.getText(this.props.schema.trueText, this.props.schema.noTranslation);\n if (this.props.schema.trueImage) {\n iconTrue = getIconByName(this.props.schema.trueImage, textTrue ? { marginRight: 8 } : undefined);\n }\n\n const min =\n this.props.schema.min === undefined ? this.state.obj.common.min || 0 : this.props.schema.min;\n const max =\n this.props.schema.max === undefined\n ? this.state.obj.common.max === undefined\n ? 100\n : this.state.obj.common.max\n : this.props.schema.max;\n const step =\n this.props.schema.step === undefined ? this.state.obj.common.step || 1 : this.props.schema.step;\n\n content = (\n <Slider\n style={{ width: '100%', flexGrow: 1 }}\n min={min}\n max={max}\n disabled={!!this.props.schema.readOnly || disabled}\n step={step}\n value={this.state.stateValue as number}\n valueLabelDisplay=\"auto\"\n valueLabelFormat={(value: number) =>\n `${value}${this.getText(this.props.schema.unit, this.props.schema.noTranslation) || this.state.obj.common.unit || ''}`\n }\n onChange={(_e: Event, value: number) => {\n this.setState({ stateValue: value }, (): void => {\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n }\n this.controlTimeout = setTimeout(async () => {\n console.log(`${Date.now()} Send new value: ${this.state.stateValue}`);\n this.controlTimeout = null;\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.state.stateValue,\n false,\n );\n }, this.props.schema.controlDelay || 0);\n });\n }}\n />\n );\n\n if (textFalse || iconFalse || textTrue || iconTrue) {\n content = (\n <div\n style={{\n display: 'flex',\n width: '100%',\n flexGrow: 1,\n alignItems: 'center',\n }}\n >\n <span style={{ marginRight: 16, ...this.props.schema.falseTextStyle }}>\n {textFalse}\n {iconFalse}\n </span>\n {content}\n <span style={{ marginLeft: 16, ...this.props.schema.trueTextStyle }}>\n {iconTrue}\n {textTrue}\n </span>\n </div>\n );\n }\n if (labelControl) {\n content = (\n <div style={divStyle}>\n {labelControl}\n {content}\n </div>\n );\n }\n } else if (\n this.state.obj.common.type === 'number' &&\n this.state.obj.common.write &&\n !this.state.controlType\n ) {\n // Auto-detection of the type\n const min =\n this.props.schema.min === undefined\n ? this.state.obj.common.min === undefined\n ? undefined\n : this.state.obj.common.min\n : this.props.schema.min;\n const max =\n this.props.schema.max === undefined\n ? this.state.obj.common.max === undefined\n ? undefined\n : this.state.obj.common.max\n : this.props.schema.max;\n const step =\n this.props.schema.step === undefined\n ? this.state.obj.common.step === undefined\n ? undefined\n : this.state.obj.common.step\n : this.props.schema.step;\n\n content = (\n <TextField\n variant=\"standard\"\n style={{ width: '100%' }}\n value={this.state.stateValue}\n type=\"number\"\n disabled={!!this.props.schema.readOnly || disabled}\n slotProps={{\n htmlInput: { min, max, step, readOnly: !!this.props.schema.readOnly },\n input: {\n endAdornment:\n this.getText(this.props.schema.unit, this.props.schema.noTranslation) ||\n this.state.obj.common.unit ||\n undefined,\n },\n }}\n onChange={e => {\n this.setState({ stateValue: e.target.value }, (): void => {\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n }\n this.controlTimeout = setTimeout(async () => {\n this.controlTimeout = null;\n const val = parseFloat(this.state.stateValue as unknown as string);\n await this.props.oContext.socket.setState(this.getObjectID(), val, false);\n }, this.props.schema.controlDelay || 0);\n });\n }}\n label={this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n helperText={this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n />\n );\n } else if (this.state.obj.common.type === 'boolean') {\n let icon: JSX.Element | null = null;\n let text: string;\n let style: React.CSSProperties | undefined;\n if (!this.state.stateValue) {\n text = this.getText(this.props.schema.falseText, this.props.schema.noTranslation);\n if (this.props.schema.falseImage) {\n icon = getIconByName(this.props.schema.falseImage, text ? { marginLeft: 8 } : undefined);\n }\n style = this.props.schema.falseTextStyle;\n } else {\n text = this.getText(this.props.schema.trueText, this.props.schema.noTranslation);\n if (this.props.schema.trueImage) {\n icon = getIconByName(this.props.schema.falseImage, text ? { marginRight: 8 } : undefined);\n }\n style = this.props.schema.trueTextStyle;\n }\n style = Object.assign(divStyle, style);\n\n content = (\n <div style={style}>\n {labelControl}\n <Box\n style={{ display: 'flex', alignItems: 'center', gap: 8 }}\n sx={blinkStyle}\n key={this.props.schema.blinkOnUpdate ? text : undefined}\n >\n {icon}\n {text || (this.state.stateValue ? I18n.t('ra_true') : I18n.t('ra_false'))}\n </Box>\n </div>\n );\n } else {\n // text or HTML\n const unit =\n this.getText(this.props.schema.unit, this.props.schema.noTranslation) || this.state.obj.common.unit;\n\n let mappedValue = this.state.stateValue;\n\n // if options or states are defined, map the value to the label\n if (\n mappedValue !== null &&\n mappedValue !== undefined &&\n (this.props.schema.options || this.state.obj.common.states)\n ) {\n const states = this.getNormalizedStates();\n const state = states.find(s => s.value === mappedValue);\n if (state) {\n mappedValue = state.label;\n }\n }\n\n let value;\n let key: string;\n if (this.state.controlType === 'html') {\n key = (mappedValue || '').toString();\n value = <span dangerouslySetInnerHTML={{ __html: mappedValue as string }} />;\n } else if (this.state.stateValue === null) {\n value = 'null';\n key = value;\n } else if (this.state.stateValue === undefined) {\n value = 'undefined';\n key = value;\n } else {\n value = mappedValue.toString();\n key = value;\n }\n\n content = (\n <div style={divStyle}>\n {labelControl}\n <div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>\n <Box\n sx={blinkStyle}\n key={this.props.schema.blinkOnUpdate ? key : undefined}\n >\n {value}\n </Box>\n {unit ? <span style={{ opacity: 0.7, fontSize: 'smaller' }}>{unit}</span> : null}\n </div>\n </div>\n );\n }\n }\n\n return content;\n }\n}\n\nexport default ConfigState;\n"]}
|
|
1
|
+
{"version":3,"file":"ConfigState.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EACH,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,GAAG,EACH,WAAW,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,4BAA4B,CAAC;AAG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AC,CAAC,SAAS,IAErD,KAAK,CACJ;wBACL,IAAI,CAAC,CAAC,CAAC,8BAAM,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAG,IAAI,CAAQ,CAAC,CAAC,CAAC,IAAI,CAC9E,CACJ,CACT,CAAC;YACN,CAAC;QACL,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,eAAe,WAAW,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport {\n TextField,\n IconButton,\n Button,\n Switch,\n Slider,\n Box,\n FormControl,\n InputLabel,\n Select,\n MenuItem,\n} from '@mui/material';\n\nimport { I18n, Icon, type IobTheme } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemState } from '../types';\nimport getIconByName from './Icons';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nfunction valueBlinkOnce(theme: IobTheme, color?: string | boolean): any {\n if (typeof color === 'string') {\n return {\n '@keyframes newStateAnimationOnceColor': {\n '0%': {\n color,\n },\n '100%': {\n color: theme.palette.mode === 'dark' ? '#fff' : '#000',\n },\n },\n animation: 'newStateAnimationOnceColor 2s ease-in-out',\n };\n }\n return {\n '@keyframes newStateAnimationOnce': {\n '0%': {\n color: '#00f900',\n },\n '80%': {\n color: theme.palette.mode === 'dark' ? '#518851' : '#008000',\n },\n '100%': {\n color: theme.palette.mode === 'dark' ? '#fff' : '#000',\n },\n },\n animation: 'newStateAnimationOnce 2s ease-in-out',\n };\n}\n\ninterface ConfigStateProps extends ConfigGenericProps {\n schema: ConfigItemState;\n}\n\ninterface ConfigStateState extends ConfigGenericState {\n stateValue?: string | number | boolean | null;\n controlType?: 'text' | 'html' | 'input' | 'slider' | 'select' | 'button' | 'switch' | 'number';\n obj?: ioBroker.Object | null;\n}\n\nclass ConfigState extends ConfigGeneric<ConfigStateProps, ConfigStateState> {\n controlTimeout: ReturnType<typeof setTimeout> | null = null;\n\n delayedUpdate: { timer: ReturnType<typeof setTimeout> | null; value: string | boolean | number | null } = {\n timer: null,\n value: null,\n };\n\n getObjectID(): string {\n let oid = (this.props.schema.oid || '').toString();\n if (oid.includes('${')) {\n oid = this.getPattern(oid, null, true);\n }\n\n if (this.props.schema.foreign) {\n return oid;\n }\n\n return `${this.props.schema.system ? 'system.adapter.' : ''}${this.props.oContext.adapterName}.${this.props.oContext.instance || 0}.${oid}`;\n }\n\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n const obj: ioBroker.StateObject = (await this.props.oContext.socket.getObject(\n this.getObjectID(),\n )) as ioBroker.StateObject;\n\n if (obj?.common?.states && !this.props.schema.options) {\n // Normalize states to object\n if (Array.isArray(obj?.common?.states)) {\n // convert array to object\n const states: Record<string, string> = {};\n obj.common.states.forEach((state, index) => {\n states[index.toString()] = state;\n });\n obj.common.states = states;\n }\n if (!Object.keys(obj.common.states).length) {\n obj.common.states = undefined; // remove empty states\n }\n }\n\n const controlType = this.props.schema.control || this.detectType(obj);\n\n try {\n const state = await this.props.oContext.socket.getState(this.getObjectID());\n\n this.setState({ stateValue: state ? state.val : null, controlType, obj }, async () => {\n await this.props.oContext.socket.subscribeState(this.getObjectID(), this.onStateChanged);\n });\n } catch (e) {\n console.error(`Cannot get state ${this.getObjectID()}: ${e}`);\n this.setState({ controlType, obj });\n }\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.props.oContext.socket.unsubscribeState(this.getObjectID(), this.onStateChanged);\n if (this.delayedUpdate.timer) {\n clearTimeout(this.delayedUpdate.timer);\n this.delayedUpdate.timer = null;\n }\n\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n this.controlTimeout = null;\n this.props.oContext.socket\n .setState(this.getObjectID(), this.state.stateValue, false)\n .catch((e: Error) => console.error(`Cannot control value: ${e.toString()}`));\n }\n }\n\n onStateChanged = (_id: string, state: ioBroker.State | null | undefined): void => {\n let val = state ? state.val : null;\n if (this.state.controlType === 'button' || this.state.controlType === 'switch') {\n val = !!val;\n if (this.state.stateValue !== val) {\n this.setState({ stateValue: val });\n }\n } else if (val !== null && (this.state.controlType === 'slider' || this.state.controlType === 'number')) {\n val = parseFloat(val as unknown as string);\n console.log(`${Date.now()} Received new value: ${val}`);\n if (val !== this.state.stateValue) {\n if (this.delayedUpdate.timer) {\n clearTimeout(this.delayedUpdate.timer);\n this.delayedUpdate.timer = null;\n }\n this.delayedUpdate.value = val;\n this.delayedUpdate.timer = setTimeout(() => {\n this.setState({ stateValue: this.delayedUpdate.value });\n }, 500);\n } else if (this.delayedUpdate.timer) {\n clearTimeout(this.delayedUpdate.timer);\n this.delayedUpdate.timer = null;\n }\n } else if (this.state.stateValue.toString() !== val.toString()) {\n this.setState({ stateValue: val });\n }\n };\n\n detectType(obj: ioBroker.StateObject): 'button' | 'switch' | 'slider' | 'input' | 'text' | 'select' {\n obj ||= {} as ioBroker.StateObject;\n obj.common ||= {} as ioBroker.StateCommon;\n\n // read an object\n if (obj.common.type === 'boolean') {\n if (this.props.schema.controlled !== false) {\n if (obj.common.read === false || this.props.schema.controlled === true) {\n return 'button';\n }\n if (obj.common.write || this.props.schema.controlled === true) {\n return 'switch';\n }\n }\n\n return 'text';\n }\n\n if (obj.common.type === 'number' && this.props.schema.controlled !== false) {\n if (obj.common.write || this.props.schema.controlled === true) {\n if (obj.common.states || this.props.schema.options) {\n return 'select';\n }\n if (obj.common.max !== undefined) {\n return 'slider';\n }\n return 'input';\n }\n return 'text';\n }\n\n if (obj.common.write && this.props.schema.controlled !== false) {\n if (obj.common.states || this.props.schema.options) {\n return 'select';\n }\n return 'input';\n }\n\n return 'text';\n }\n\n getNormalizedStates(): {\n label: string;\n value: number | string;\n hidden?: string | boolean;\n color?: string;\n }[] {\n let states: {\n label: string;\n value: number | string;\n hidden?: string | boolean;\n color?: string;\n }[];\n if (this.props.schema.options) {\n states = this.props.schema.options.map(state => {\n if (typeof state === 'string') {\n return { value: state, label: this.getText(state, this.props.schema.noTranslation) };\n }\n return {\n value: state.value,\n label: this.getText(state.label, this.props.schema.noTranslation),\n color: state.color,\n };\n });\n } else if (this.state.obj.common.states) {\n states = [];\n Object.keys(this.state.obj.common.states).forEach(key => {\n states.push({\n value: key,\n label: this.getText(this.state.obj.common.states[key], this.props.schema.noTranslation),\n });\n });\n } else {\n states = [];\n }\n\n return states;\n }\n\n renderItem(_error: string, disabled: boolean /*, defaultValue */): JSX.Element {\n if (!this.state.obj) {\n return null;\n }\n\n let content: JSX.Element;\n\n if (\n this.state.controlType === 'select' ||\n (!this.state.controlType &&\n (this.state.obj.common.type === 'number' || this.state.obj.common.type === 'string') &&\n this.state.obj.common.write !== false &&\n (this.props.schema.options || this.state.obj.common.states))\n ) {\n const states = this.getNormalizedStates();\n const item = states.find(it => it.value === this.state.stateValue);\n\n content = (\n <FormControl fullWidth>\n <InputLabel>${this.getText(this.props.schema.label)}</InputLabel>\n <Select\n value={this.state.stateValue}\n disabled={!!this.props.schema.readOnly || disabled}\n onChange={e => {\n this.setState({ stateValue: e.target.value }, (): void => {\n let value: string | number = this.state.stateValue as string | number;\n if (this.state.obj.common.type === 'number') {\n value = parseFloat((value as unknown as string).toString().replace(',', '.'));\n }\n\n void this.props.oContext.socket.setState(this.getObjectID(), value, false);\n });\n }}\n renderValue={(val: string) =>\n item?.color ? <div style={{ color: item.color }}>{item.label}</div> : val\n }\n >\n {states.map(item => (\n <MenuItem\n key={(item.value ?? '').toString()}\n value={item.value}\n style={{ color: item.color }}\n >\n ${item.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n } else if (\n this.state.controlType === 'button' ||\n (!this.state.controlType &&\n this.state.obj.common.type === 'boolean' &&\n ((this.state.obj.common.write && this.state.obj.common.read === false) ||\n this.state.obj.common.role?.includes('button')))\n ) {\n let icon: JSX.Element | null = null;\n if (this.props.schema.falseImage) {\n icon = getIconByName(this.props.schema.falseImage);\n }\n\n const text = this.getText(\n this.props.schema.falseText || this.props.schema.label,\n this.props.schema.noTranslation,\n );\n\n if (!text && icon) {\n content = (\n <IconButton\n style={this.props.schema.falseTextStyle}\n disabled={!!this.props.schema.readOnly}\n onClick={async () => {\n if (this.props.schema.confirm) {\n this.setState({\n confirmDialog: true,\n confirmCallback: async (result: boolean) => {\n if (result) {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined ? this.props.schema.buttonValue : true,\n false,\n );\n }\n }}\n >\n {icon}\n </IconButton>\n );\n } else {\n content = (\n <Button\n variant={this.props.schema.variant || 'contained'}\n startIcon={icon}\n style={this.props.schema.falseTextStyle}\n disabled={disabled || !!this.props.schema.readOnly}\n onClick={async () => {\n if (this.props.schema.confirm) {\n this.setState({\n confirmDialog: true,\n confirmCallback: async (result: boolean) => {\n if (result) {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.props.schema.buttonValue !== undefined ? this.props.schema.buttonValue : true,\n false,\n );\n }\n }}\n >\n {text || this.getObjectID().split('.').pop()}\n </Button>\n );\n }\n } else if (\n this.state.controlType === 'input' ||\n (!this.state.controlType && this.state.obj.common.write && this.state.obj.common.type === 'string')\n ) {\n content = (\n <div style={{ width: '100%', display: 'flex', flexDirection: 'row', gap: 8, alignItems: 'baseline' }}>\n <TextField\n style={{ flex: 1 }}\n value={this.state.stateValue}\n variant=\"standard\"\n disabled={!!this.props.schema.readOnly || disabled}\n slotProps={{\n input: {\n endAdornment:\n this.getText(this.props.schema.unit, this.props.schema.noTranslation) ||\n this.state.obj.common.unit ||\n undefined,\n },\n htmlInput: {\n readOnly: !!this.props.schema.readOnly,\n },\n }}\n onKeyUp={e => {\n if (this.props.schema.setOnEnterKey && e.key === 'Enter') {\n void this.props.oContext.socket.setState(\n this.getObjectID(),\n this.state.stateValue,\n false,\n );\n }\n }}\n onChange={e => {\n this.setState({ stateValue: e.target.value }, (): void => {\n if (this.props.schema.setOnEnterKey || this.props.schema.showEnterButton) {\n return;\n }\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n }\n this.controlTimeout = setTimeout(async () => {\n this.controlTimeout = null;\n let value: string | number = this.state.stateValue as string | number;\n if (this.state.obj.common.type === 'number') {\n value = parseFloat((value as unknown as string).toString().replace(',', '.'));\n }\n\n await this.props.oContext.socket.setState(this.getObjectID(), value, false);\n }, this.props.schema.controlDelay || 0);\n });\n }}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n />\n {this.props.schema.showEnterButton && !this.props.schema.readOnly && (\n <Button\n variant=\"outlined\"\n disabled={disabled}\n onClick={() => {\n void this.props.oContext.socket.setState(\n this.getObjectID(),\n this.state.stateValue,\n false,\n );\n }}\n >\n {this.getText(\n typeof this.props.schema.showEnterButton === 'string'\n ? this.props.schema.showEnterButton\n : 'Set',\n )}\n </Button>\n )}\n </div>\n );\n } else {\n let fontSize: number | undefined;\n if (this.props.schema.size === 'normal') {\n fontSize = 16;\n } else if (this.props.schema.size === 'large') {\n fontSize = 20;\n } else if (typeof this.props.schema.size === 'number') {\n fontSize = this.props.schema.size;\n }\n let label = this.getText(this.props.schema.label, this.props.schema.noTranslation);\n\n const divStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n fontSize: fontSize || '1rem',\n gap: 8,\n };\n\n if (!this.props.schema.narrow) {\n divStyle.width = '100%';\n divStyle.justifyContent = 'space-between';\n }\n\n if (label.trim()) {\n if (!label.trim().endsWith(':') && this.props.schema.addColon) {\n label = `${label.trim()}:`;\n }\n }\n\n let blinkStyle: React.CSSProperties | undefined;\n if (this.props.schema.blinkOnUpdate) {\n blinkStyle = valueBlinkOnce(this.props.oContext.theme, this.props.schema.blinkOnUpdate);\n }\n\n let labelIcon: React.JSX.Element | undefined;\n if (this.props.schema.labelIcon) {\n labelIcon = (\n <Icon\n src={this.props.schema.labelIcon}\n style={{ marginRight: 4 }}\n />\n );\n }\n\n let labelControl: React.JSX.Element | undefined;\n if (label && labelIcon) {\n labelControl = (\n <div style={{ whiteSpace: 'nowrap' }}>\n {labelIcon}\n {label}\n </div>\n );\n } else if (label) {\n labelControl = <div style={{ whiteSpace: 'nowrap' }}>{label}</div>;\n } else if (labelIcon) {\n labelControl = labelIcon;\n }\n\n if (\n this.state.controlType === 'switch' ||\n (!this.state.controlType &&\n this.state.obj.common.type === 'boolean' &&\n ((this.state.obj.common.write && this.state.obj.common.read !== false) ||\n this.state.obj.common.role?.includes('switch')))\n ) {\n let iconFalse: JSX.Element | null = null;\n const textFalse = this.getText(this.props.schema.falseText, this.props.schema.noTranslation);\n if (this.props.schema.falseImage) {\n iconFalse = getIconByName(this.props.schema.falseImage, textFalse ? { marginLeft: 8 } : undefined);\n }\n let iconTrue: JSX.Element | null = null;\n const textTrue = this.getText(this.props.schema.trueText, this.props.schema.noTranslation);\n if (this.props.schema.trueImage) {\n iconTrue = getIconByName(this.props.schema.trueImage, textTrue ? { marginRight: 8 } : undefined);\n }\n\n content = (\n <Switch\n checked={!!this.state.stateValue}\n disabled={!!this.props.schema.readOnly || disabled}\n onChange={async () => {\n if (this.props.schema.confirm) {\n this.setState({\n confirmDialog: true,\n confirmCallback: async (result: boolean) => {\n if (result) {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n !this.state.stateValue,\n false,\n );\n }\n },\n });\n } else {\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n !this.state.stateValue,\n false,\n );\n }\n }}\n />\n );\n\n if (textFalse || iconFalse || textTrue || iconTrue) {\n content = (\n <div style={{ display: 'flex', alignItems: 'center', fontSize: 14 }}>\n <span style={this.props.schema.falseTextStyle}>\n {textFalse}\n {iconFalse}\n </span>\n {content}\n <span style={this.props.schema.trueTextStyle}>\n {iconTrue}\n {textTrue}\n </span>\n </div>\n );\n }\n\n if (labelControl) {\n content = (\n <div style={divStyle}>\n {labelControl}\n {content}\n </div>\n );\n }\n } else if (\n this.state.controlType === 'slider' ||\n (!this.state.controlType &&\n this.state.obj.common.type === 'number' &&\n ((this.state.obj.common.write &&\n (this.state.obj.common.max !== undefined || this.state.obj.common.unit === '%')) ||\n this.state.obj.common.role?.includes('slider') ||\n this.state.obj.common.role?.includes('dimmer') ||\n this.state.obj.common.role?.includes('blind')))\n ) {\n let iconFalse: JSX.Element | null = null;\n const textFalse = this.getText(this.props.schema.falseText, this.props.schema.noTranslation);\n if (this.props.schema.falseImage) {\n iconFalse = getIconByName(this.props.schema.falseImage, textFalse ? { marginLeft: 8 } : undefined);\n }\n let iconTrue: JSX.Element | null = null;\n const textTrue = this.getText(this.props.schema.trueText, this.props.schema.noTranslation);\n if (this.props.schema.trueImage) {\n iconTrue = getIconByName(this.props.schema.trueImage, textTrue ? { marginRight: 8 } : undefined);\n }\n\n const min =\n this.props.schema.min === undefined ? this.state.obj.common.min || 0 : this.props.schema.min;\n const max =\n this.props.schema.max === undefined\n ? this.state.obj.common.max === undefined\n ? 100\n : this.state.obj.common.max\n : this.props.schema.max;\n const step =\n this.props.schema.step === undefined ? this.state.obj.common.step || 1 : this.props.schema.step;\n\n content = (\n <Slider\n style={{ width: '100%', flexGrow: 1 }}\n min={min}\n max={max}\n disabled={!!this.props.schema.readOnly || disabled}\n step={step}\n value={this.state.stateValue as number}\n valueLabelDisplay=\"auto\"\n valueLabelFormat={(value: number) =>\n `${value}${this.getText(this.props.schema.unit, this.props.schema.noTranslation) || this.state.obj.common.unit || ''}`\n }\n onChange={(_e: Event, value: number) => {\n this.setState({ stateValue: value }, (): void => {\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n }\n this.controlTimeout = setTimeout(async () => {\n console.log(`${Date.now()} Send new value: ${this.state.stateValue}`);\n this.controlTimeout = null;\n await this.props.oContext.socket.setState(\n this.getObjectID(),\n this.state.stateValue,\n false,\n );\n }, this.props.schema.controlDelay || 0);\n });\n }}\n />\n );\n\n if (textFalse || iconFalse || textTrue || iconTrue) {\n content = (\n <div\n style={{\n display: 'flex',\n width: '100%',\n flexGrow: 1,\n alignItems: 'center',\n }}\n >\n <span style={{ marginRight: 16, ...this.props.schema.falseTextStyle }}>\n {textFalse}\n {iconFalse}\n </span>\n {content}\n <span style={{ marginLeft: 16, ...this.props.schema.trueTextStyle }}>\n {iconTrue}\n {textTrue}\n </span>\n </div>\n );\n }\n if (labelControl) {\n content = (\n <div style={divStyle}>\n {labelControl}\n {content}\n </div>\n );\n }\n } else if (\n this.state.obj.common.type === 'number' &&\n this.state.obj.common.write &&\n !this.state.controlType\n ) {\n // Auto-detection of the type\n const min =\n this.props.schema.min === undefined\n ? this.state.obj.common.min === undefined\n ? undefined\n : this.state.obj.common.min\n : this.props.schema.min;\n const max =\n this.props.schema.max === undefined\n ? this.state.obj.common.max === undefined\n ? undefined\n : this.state.obj.common.max\n : this.props.schema.max;\n const step =\n this.props.schema.step === undefined\n ? this.state.obj.common.step === undefined\n ? undefined\n : this.state.obj.common.step\n : this.props.schema.step;\n\n content = (\n <TextField\n variant=\"standard\"\n style={{ width: '100%' }}\n value={this.state.stateValue}\n type=\"number\"\n disabled={!!this.props.schema.readOnly || disabled}\n slotProps={{\n htmlInput: { min, max, step, readOnly: !!this.props.schema.readOnly },\n input: {\n endAdornment:\n this.getText(this.props.schema.unit, this.props.schema.noTranslation) ||\n this.state.obj.common.unit ||\n undefined,\n },\n }}\n onChange={e => {\n this.setState({ stateValue: e.target.value }, (): void => {\n if (this.controlTimeout) {\n clearTimeout(this.controlTimeout);\n }\n this.controlTimeout = setTimeout(async () => {\n this.controlTimeout = null;\n const val = parseFloat(this.state.stateValue as unknown as string);\n await this.props.oContext.socket.setState(this.getObjectID(), val, false);\n }, this.props.schema.controlDelay || 0);\n });\n }}\n label={this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n helperText={this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n />\n );\n } else if (this.state.obj.common.type === 'boolean') {\n let icon: JSX.Element | null = null;\n let text: string;\n let style: React.CSSProperties | undefined;\n if (!this.state.stateValue) {\n text = this.getText(this.props.schema.falseText, this.props.schema.noTranslation);\n if (this.props.schema.falseImage) {\n icon = getIconByName(this.props.schema.falseImage, text ? { marginLeft: 8 } : undefined);\n }\n style = this.props.schema.falseTextStyle;\n } else {\n text = this.getText(this.props.schema.trueText, this.props.schema.noTranslation);\n if (this.props.schema.trueImage) {\n icon = getIconByName(this.props.schema.falseImage, text ? { marginRight: 8 } : undefined);\n }\n style = this.props.schema.trueTextStyle;\n }\n style = Object.assign(divStyle, style);\n\n content = (\n <div style={style}>\n {labelControl}\n <Box\n style={{ display: 'flex', alignItems: 'center', gap: 8 }}\n sx={blinkStyle}\n key={this.props.schema.blinkOnUpdate ? text : undefined}\n >\n {icon}\n {text || (this.state.stateValue ? I18n.t('ra_true') : I18n.t('ra_false'))}\n </Box>\n </div>\n );\n } else {\n // text or HTML\n const unit =\n this.getText(this.props.schema.unit, this.props.schema.noTranslation) || this.state.obj.common.unit;\n\n let mappedValue = this.state.stateValue;\n\n // if options or states are defined, map the value to the label\n if (\n mappedValue !== null &&\n mappedValue !== undefined &&\n (this.props.schema.options || this.state.obj.common.states)\n ) {\n const states = this.getNormalizedStates();\n const state = states.find(s => s.value === mappedValue);\n if (state) {\n mappedValue = state.label;\n }\n }\n\n let value;\n let key: string;\n if (this.state.controlType === 'html') {\n key = (mappedValue || '').toString();\n value = <span dangerouslySetInnerHTML={{ __html: mappedValue as string }} />;\n } else if (this.state.stateValue === null) {\n value = 'null';\n key = value;\n } else if (this.state.stateValue === undefined) {\n value = 'undefined';\n key = value;\n } else {\n value = mappedValue.toString();\n key = value;\n }\n\n content = (\n <div style={divStyle}>\n {labelControl}\n <div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>\n <Box\n sx={blinkStyle}\n key={this.props.schema.blinkOnUpdate ? key : undefined}\n >\n {value}\n </Box>\n {unit ? <span style={{ opacity: 0.7, fontSize: 'smaller' }}>{unit}</span> : null}\n </div>\n </div>\n );\n }\n }\n\n return content;\n }\n}\n\nexport default ConfigState;\n"]}
|
|
@@ -19,6 +19,7 @@ interface ConfigTableState extends ConfigGenericState {
|
|
|
19
19
|
uploadFile: boolean | 'dragging';
|
|
20
20
|
icon: boolean;
|
|
21
21
|
width: number;
|
|
22
|
+
tableErrors: Record<number, Record<string, string>>;
|
|
22
23
|
}
|
|
23
24
|
declare class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableState> {
|
|
24
25
|
private readonly filterRefs;
|
|
@@ -37,6 +38,10 @@ declare class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableSta
|
|
|
37
38
|
* Validate that columns configured in `uniqueColumns` have unique values
|
|
38
39
|
*/
|
|
39
40
|
validateUniqueProps(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Handle errors from table row components
|
|
43
|
+
*/
|
|
44
|
+
onTableRowError: (rowIndex: number) => (attr: string, error?: string) => void;
|
|
40
45
|
static descendingComparator(a: Record<string, any>, b: Record<string, any>, orderBy: string): number;
|
|
41
46
|
static getComparator(order: 'desc' | 'asc', orderBy: string): (a: Record<string, any>, b: Record<string, any>) => number;
|
|
42
47
|
static getFilterValue(el: React.RefObject<HTMLInputElement>): string;
|
|
@@ -244,6 +244,7 @@ class ConfigTable extends ConfigGeneric {
|
|
|
244
244
|
iteration: 0,
|
|
245
245
|
filterOn: [],
|
|
246
246
|
width: 0,
|
|
247
|
+
tableErrors: {},
|
|
247
248
|
}, () => this.validateUniqueProps());
|
|
248
249
|
}
|
|
249
250
|
componentWillUnmount() {
|
|
@@ -275,7 +276,7 @@ class ConfigTable extends ConfigGeneric {
|
|
|
275
276
|
this.validateUniqueProps();
|
|
276
277
|
this.onChangeWrapper(newObj, true);
|
|
277
278
|
});
|
|
278
|
-
}, onError:
|
|
279
|
+
}, onError: this.onTableRowError(idx), originalData: this.props.originalData, schema: schemaItem, table: true, themeName: this.props.themeName }));
|
|
279
280
|
}
|
|
280
281
|
/**
|
|
281
282
|
* Validate that columns configured in `uniqueColumns` have unique values
|
|
@@ -284,26 +285,62 @@ class ConfigTable extends ConfigGeneric {
|
|
|
284
285
|
if (!this.props.schema.uniqueColumns) {
|
|
285
286
|
return;
|
|
286
287
|
}
|
|
288
|
+
let firstErrorColumn = null;
|
|
289
|
+
let firstErrorValue = null;
|
|
290
|
+
// Validate all columns and collect errors
|
|
287
291
|
for (const uniqueCol of this.props.schema.uniqueColumns) {
|
|
288
292
|
const allVals = [];
|
|
289
293
|
const found = this.state.value.find(entry => {
|
|
290
294
|
const val = entry[uniqueCol];
|
|
291
295
|
if (allVals.includes(val)) {
|
|
296
|
+
// Store the first error we encounter
|
|
297
|
+
if (!firstErrorColumn) {
|
|
298
|
+
firstErrorColumn = uniqueCol;
|
|
299
|
+
firstErrorValue = val;
|
|
300
|
+
}
|
|
292
301
|
this.onError(uniqueCol, 'is not unique');
|
|
293
|
-
this.setState({
|
|
294
|
-
errorMessage: I18n.t('Non-allowed duplicate entry "%s" in column "%s"', val, uniqueCol),
|
|
295
|
-
});
|
|
296
302
|
return true;
|
|
297
303
|
}
|
|
298
304
|
allVals.push(val);
|
|
299
305
|
return false;
|
|
300
306
|
});
|
|
307
|
+
// Clear error for this column if no duplicates found
|
|
301
308
|
if (!found) {
|
|
302
309
|
this.onError(uniqueCol, null);
|
|
303
|
-
this.setState({ errorMessage: '' });
|
|
304
310
|
}
|
|
305
311
|
}
|
|
312
|
+
// Set error message based on the first error found (or clear if no errors)
|
|
313
|
+
if (firstErrorColumn) {
|
|
314
|
+
this.setState({
|
|
315
|
+
errorMessage: I18n.t('Non-allowed duplicate entry "%s" in column "%s"', firstErrorValue, firstErrorColumn),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.setState({ errorMessage: '' });
|
|
320
|
+
}
|
|
306
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Handle errors from table row components
|
|
324
|
+
*/
|
|
325
|
+
onTableRowError = (rowIndex) => (attr, error) => {
|
|
326
|
+
const newTableErrors = { ...this.state.tableErrors };
|
|
327
|
+
if (!newTableErrors[rowIndex]) {
|
|
328
|
+
newTableErrors[rowIndex] = {};
|
|
329
|
+
}
|
|
330
|
+
if (!error) {
|
|
331
|
+
delete newTableErrors[rowIndex][attr];
|
|
332
|
+
// Clean up empty row error objects
|
|
333
|
+
if (Object.keys(newTableErrors[rowIndex]).length === 0) {
|
|
334
|
+
delete newTableErrors[rowIndex];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
newTableErrors[rowIndex][attr] = error;
|
|
339
|
+
}
|
|
340
|
+
this.setState({ tableErrors: newTableErrors });
|
|
341
|
+
// Forward error to parent component
|
|
342
|
+
this.props.onError(attr, error);
|
|
343
|
+
};
|
|
307
344
|
static descendingComparator(a, b, orderBy) {
|
|
308
345
|
if (b[orderBy] < a[orderBy]) {
|
|
309
346
|
return -1;
|
|
@@ -412,7 +449,34 @@ class ConfigTable extends ConfigGeneric {
|
|
|
412
449
|
onDelete = (index) => () => {
|
|
413
450
|
const newValue = JSON.parse(JSON.stringify(this.state.value));
|
|
414
451
|
newValue.splice(index, 1);
|
|
415
|
-
|
|
452
|
+
// Clear errors for deleted row and shift remaining error indices
|
|
453
|
+
const newTableErrors = { ...this.state.tableErrors };
|
|
454
|
+
// Clear errors for the deleted row
|
|
455
|
+
if (newTableErrors[index]) {
|
|
456
|
+
// Clear all errors for this row from parent
|
|
457
|
+
Object.keys(newTableErrors[index]).forEach(attr => {
|
|
458
|
+
this.props.onError(attr, undefined);
|
|
459
|
+
});
|
|
460
|
+
delete newTableErrors[index];
|
|
461
|
+
}
|
|
462
|
+
// Shift error indices for rows after the deleted one
|
|
463
|
+
const shiftedErrors = {};
|
|
464
|
+
Object.keys(newTableErrors).forEach(rowIndexStr => {
|
|
465
|
+
const rowIndex = parseInt(rowIndexStr, 10);
|
|
466
|
+
if (rowIndex > index) {
|
|
467
|
+
// Move errors from rowIndex to rowIndex - 1
|
|
468
|
+
shiftedErrors[rowIndex - 1] = newTableErrors[rowIndex];
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
// Keep errors at same index for rows before deleted row
|
|
472
|
+
shiftedErrors[rowIndex] = newTableErrors[rowIndex];
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
this.setState({
|
|
476
|
+
value: newValue,
|
|
477
|
+
iteration: this.state.iteration + 10_000,
|
|
478
|
+
tableErrors: shiftedErrors,
|
|
479
|
+
}, () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)));
|
|
416
480
|
};
|
|
417
481
|
onExport() {
|
|
418
482
|
const { schema } = this.props;
|
|
@@ -422,7 +486,7 @@ class ConfigTable extends ConfigGeneric {
|
|
|
422
486
|
value.forEach(row => {
|
|
423
487
|
const line = [];
|
|
424
488
|
schema.items.forEach((it) => {
|
|
425
|
-
if (row[it.attr]
|
|
489
|
+
if (row[it.attr] && typeof row[it.attr] === 'string' && row[it.attr].includes(';')) {
|
|
426
490
|
line.push(`"${row[it.attr]}"`);
|
|
427
491
|
}
|
|
428
492
|
else {
|