@iobroker/json-config 8.5.3 → 8.5.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 +4 -0
- package/build/JsonConfigComponent/ConfigState.js +2 -2
- package/build/JsonConfigComponent/ConfigState.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTabs.d.ts +10 -2
- package/build/JsonConfigComponent/ConfigTabs.js +43 -29
- package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1822,6 +1822,10 @@ The schema is used here: https://github.com/SchemaStore/schemastore/blob/6da29cd
|
|
|
1822
1822
|
### **WORK IN PROGRESS**
|
|
1823
1823
|
-->
|
|
1824
1824
|
## Changelog
|
|
1825
|
+
### 8.5.4 (2026-07-23)
|
|
1826
|
+
- (@GermanBluefox) Corrected the displaying of zero number values
|
|
1827
|
+
- (@GermanBluefox) Trying to improve the behaviour of tabs
|
|
1828
|
+
|
|
1825
1829
|
### 8.5.3 (2026-07-20)
|
|
1826
1830
|
- (@GermanBluefox) Changed the handling of Tabs
|
|
1827
1831
|
|
|
@@ -547,7 +547,7 @@ class ConfigState extends ConfigGeneric {
|
|
|
547
547
|
let value;
|
|
548
548
|
let key;
|
|
549
549
|
if (this.state.controlType === 'html') {
|
|
550
|
-
key = (mappedValue
|
|
550
|
+
key = (mappedValue ?? '').toString();
|
|
551
551
|
value = React.createElement("span", { dangerouslySetInnerHTML: { __html: mappedValue } });
|
|
552
552
|
}
|
|
553
553
|
else if (this.state.stateValue === null) {
|
|
@@ -566,7 +566,7 @@ class ConfigState extends ConfigGeneric {
|
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
else {
|
|
569
|
-
value = (mappedValue
|
|
569
|
+
value = (mappedValue ?? '').toString();
|
|
570
570
|
}
|
|
571
571
|
key = value;
|
|
572
572
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigState.js","sourceR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AK,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;oBAC3C,CAAC;oBACD,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 objId?: string;\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 private async getObjectID(): Promise<string> {\n let oid = (this.props.schema.oid || '').toString();\n if (oid.includes('${')) {\n oid = await this.getPatternAsync(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 await super.componentDidMount();\n const objId = await this.getObjectID();\n const obj: ioBroker.StateObject = (await this.getCachedObject(objId)) 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(objId);\n\n this.setState({ stateValue: state ? state.val : null, controlType, obj, objId }, async () => {\n const objId = await this.getObjectID();\n await this.props.oContext.socket.subscribeState(objId, this.onStateChanged);\n });\n } catch (e) {\n console.error(`Cannot get state ${objId}: ${e}`);\n this.setState({ controlType, obj, objId });\n }\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n if (this.state.objId) {\n this.props.oContext.socket.unsubscribeState(this.state.objId, this.onStateChanged);\n }\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 if (this.state.objId) {\n this.props.oContext.socket\n .setState(this.state.objId, this.state.stateValue as ioBroker.StateValue, false)\n .catch((e: Error) => console.error(`Cannot control value: ${e.toString()}`));\n }\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 {\n const oldValue =\n this.state.stateValue === null || this.state.stateValue === undefined\n ? null\n : this.state.stateValue.toString();\n const newValue = val === null || val === undefined ? null : val.toString();\n if (oldValue !== newValue) {\n this.setState({ stateValue: val });\n }\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 | null {\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 as string) ?? ''}\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 if (this.state.objId) {\n void this.props.oContext.socket.setState(this.state.objId, value, false);\n }\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 && this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\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 && this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.props.schema.buttonValue !== undefined ? this.props.schema.buttonValue : true,\n false,\n );\n }\n }}\n >\n {text || (this.state.objId || '').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' && this.state.objId) {\n void this.props.oContext.socket.setState(\n this.state.objId,\n this.state.stateValue as ioBroker.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 if (this.state.objId) {\n await this.props.oContext.socket.setState(this.state.objId, value, false);\n }\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 if (this.state.objId) {\n void this.props.oContext.socket.setState(\n this.state.objId,\n this.state.stateValue as ioBroker.StateValue,\n false,\n );\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 && this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n !this.state.stateValue,\n false,\n );\n }\n },\n });\n } else if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\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 = this.props.schema.min ?? (this.state.obj.common.min || 0);\n const max = this.props.schema.max ?? this.state.obj.common.max ?? 100;\n const step = this.props.schema.step ?? (this.state.obj.common.step || 1);\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 let displayValue: string =\n this.props.schema.digits !== undefined\n ? value.toFixed(this.props.schema.digits)\n : value.toString();\n if (this.props.oContext.isFloatComma) {\n displayValue = displayValue.replace('.', ',');\n }\n return `${displayValue}${this.getText(this.props.schema.unit, this.props.schema.noTranslation) || this.state.obj?.common.unit || ''}`;\n }}\n onChange={(_e: Event, value: number | number[]) => {\n if (Array.isArray(value)) {\n value = value[0];\n }\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 if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.state.stateValue as ioBroker.StateValue,\n false,\n );\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 = this.props.schema.min ?? this.state.obj.common.min ?? undefined;\n const max = this.props.schema.max ?? this.state.obj.common.max ?? undefined;\n const step = this.props.schema.step ?? this.state.obj.common.step ?? undefined;\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 if (this.state.objId) {\n const val = parseFloat(this.state.stateValue as unknown as string);\n await this.props.oContext.socket.setState(this.state.objId, val, false);\n }\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('jc_true') : I18n.t('jc_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 (mappedValue != null && (this.props.schema.options || this.state.obj.common.states)) {\n const states = this.getNormalizedStates();\n const state = states.find(s => s.value.toString() === mappedValue!.toString());\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 if (this.props.schema.digits !== undefined && typeof mappedValue === 'number') {\n value = mappedValue.toFixed(this.props.schema.digits);\n if (this.props.oContext.isFloatComma) {\n value = value.replace('.', ',');\n }\n } else {\n value = (mappedValue || '').toString();\n }\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,WA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ACf,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 objId?: string;\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 private async getObjectID(): Promise<string> {\n let oid = (this.props.schema.oid || '').toString();\n if (oid.includes('${')) {\n oid = await this.getPatternAsync(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 await super.componentDidMount();\n const objId = await this.getObjectID();\n const obj: ioBroker.StateObject = (await this.getCachedObject(objId)) 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(objId);\n\n this.setState({ stateValue: state ? state.val : null, controlType, obj, objId }, async () => {\n const objId = await this.getObjectID();\n await this.props.oContext.socket.subscribeState(objId, this.onStateChanged);\n });\n } catch (e) {\n console.error(`Cannot get state ${objId}: ${e}`);\n this.setState({ controlType, obj, objId });\n }\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n if (this.state.objId) {\n this.props.oContext.socket.unsubscribeState(this.state.objId, this.onStateChanged);\n }\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 if (this.state.objId) {\n this.props.oContext.socket\n .setState(this.state.objId, this.state.stateValue as ioBroker.StateValue, false)\n .catch((e: Error) => console.error(`Cannot control value: ${e.toString()}`));\n }\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 {\n const oldValue =\n this.state.stateValue === null || this.state.stateValue === undefined\n ? null\n : this.state.stateValue.toString();\n const newValue = val === null || val === undefined ? null : val.toString();\n if (oldValue !== newValue) {\n this.setState({ stateValue: val });\n }\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 | null {\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 as string) ?? ''}\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 if (this.state.objId) {\n void this.props.oContext.socket.setState(this.state.objId, value, false);\n }\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 && this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\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 && this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.props.schema.buttonValue !== undefined\n ? this.props.schema.buttonValue\n : true,\n false,\n );\n }\n },\n });\n } else if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.props.schema.buttonValue !== undefined ? this.props.schema.buttonValue : true,\n false,\n );\n }\n }}\n >\n {text || (this.state.objId || '').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' && this.state.objId) {\n void this.props.oContext.socket.setState(\n this.state.objId,\n this.state.stateValue as ioBroker.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 if (this.state.objId) {\n await this.props.oContext.socket.setState(this.state.objId, value, false);\n }\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 if (this.state.objId) {\n void this.props.oContext.socket.setState(\n this.state.objId,\n this.state.stateValue as ioBroker.StateValue,\n false,\n );\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 && this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n !this.state.stateValue,\n false,\n );\n }\n },\n });\n } else if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\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 = this.props.schema.min ?? (this.state.obj.common.min || 0);\n const max = this.props.schema.max ?? this.state.obj.common.max ?? 100;\n const step = this.props.schema.step ?? (this.state.obj.common.step || 1);\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 let displayValue: string =\n this.props.schema.digits !== undefined\n ? value.toFixed(this.props.schema.digits)\n : value.toString();\n if (this.props.oContext.isFloatComma) {\n displayValue = displayValue.replace('.', ',');\n }\n return `${displayValue}${this.getText(this.props.schema.unit, this.props.schema.noTranslation) || this.state.obj?.common.unit || ''}`;\n }}\n onChange={(_e: Event, value: number | number[]) => {\n if (Array.isArray(value)) {\n value = value[0];\n }\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 if (this.state.objId) {\n await this.props.oContext.socket.setState(\n this.state.objId,\n this.state.stateValue as ioBroker.StateValue,\n false,\n );\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 = this.props.schema.min ?? this.state.obj.common.min ?? undefined;\n const max = this.props.schema.max ?? this.state.obj.common.max ?? undefined;\n const step = this.props.schema.step ?? this.state.obj.common.step ?? undefined;\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 if (this.state.objId) {\n const val = parseFloat(this.state.stateValue as unknown as string);\n await this.props.oContext.socket.setState(this.state.objId, val, false);\n }\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('jc_true') : I18n.t('jc_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 (mappedValue != null && (this.props.schema.options || this.state.obj.common.states)) {\n const states = this.getNormalizedStates();\n const state = states.find(s => s.value.toString() === mappedValue!.toString());\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 if (this.props.schema.digits !== undefined && typeof mappedValue === 'number') {\n value = mappedValue.toFixed(this.props.schema.digits);\n if (this.props.oContext.isFloatComma) {\n value = value.replace('.', ',');\n }\n } else {\n value = (mappedValue ?? '').toString();\n }\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"]}
|
|
@@ -8,7 +8,8 @@ interface ConfigTabsProps extends ConfigGenericProps {
|
|
|
8
8
|
}
|
|
9
9
|
interface ConfigTabsState extends ConfigGenericState {
|
|
10
10
|
tab?: string;
|
|
11
|
-
|
|
11
|
+
/** Show the burger menu instead of the tab bar (true only for very narrow widths). Decided with hysteresis. */
|
|
12
|
+
useMenu: boolean;
|
|
12
13
|
openMenu: HTMLButtonElement | null;
|
|
13
14
|
tabErrors: Record<string, Record<string, string>>;
|
|
14
15
|
calculatedValuesTable: Record<string, {
|
|
@@ -17,7 +18,15 @@ interface ConfigTabsState extends ConfigGenericState {
|
|
|
17
18
|
}> | null;
|
|
18
19
|
}
|
|
19
20
|
export default class ConfigTabs extends ConfigGeneric<ConfigTabsProps, ConfigTabsState> {
|
|
21
|
+
/** Below this width the tabs collapse into a burger menu */
|
|
22
|
+
private static readonly MENU_WIDTH;
|
|
23
|
+
/**
|
|
24
|
+
* Dead-band around MENU_WIDTH. A scrollbar appearing/disappearing on a tab change shifts
|
|
25
|
+
* clientWidth by ~15px; without this dead-band that would toggle bar<->menu and flicker.
|
|
26
|
+
*/
|
|
27
|
+
private static readonly MENU_HYSTERESIS;
|
|
20
28
|
private resizeObserver;
|
|
29
|
+
private resizeRaf;
|
|
21
30
|
private calculateTimeoutTable;
|
|
22
31
|
private readonly refDiv;
|
|
23
32
|
constructor(props: ConfigTabsProps);
|
|
@@ -27,7 +36,6 @@ export default class ConfigTabs extends ConfigGeneric<ConfigTabsProps, ConfigTab
|
|
|
27
36
|
componentWillUnmount(): void;
|
|
28
37
|
measureWidth: () => void;
|
|
29
38
|
onHashTabsChanged: () => void;
|
|
30
|
-
getCurrentBreakpoint(): 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
31
39
|
onMenuChange(tab: string): void;
|
|
32
40
|
updateCalculatedValuesForTable(): void;
|
|
33
41
|
render(): JSX.Element | null;
|
|
@@ -20,7 +20,15 @@ const styles = {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
export default class ConfigTabs extends ConfigGeneric {
|
|
23
|
+
/** Below this width the tabs collapse into a burger menu */
|
|
24
|
+
static MENU_WIDTH = 600;
|
|
25
|
+
/**
|
|
26
|
+
* Dead-band around MENU_WIDTH. A scrollbar appearing/disappearing on a tab change shifts
|
|
27
|
+
* clientWidth by ~15px; without this dead-band that would toggle bar<->menu and flicker.
|
|
28
|
+
*/
|
|
29
|
+
static MENU_HYSTERESIS = 40;
|
|
23
30
|
resizeObserver = null;
|
|
31
|
+
resizeRaf = null;
|
|
24
32
|
calculateTimeoutTable = null;
|
|
25
33
|
refDiv;
|
|
26
34
|
constructor(props) {
|
|
@@ -53,7 +61,7 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
this.refDiv = React.createRef();
|
|
56
|
-
Object.assign(this.state, { tab,
|
|
64
|
+
Object.assign(this.state, { tab, useMenu: false, openMenu: null, tabErrors: {} });
|
|
57
65
|
}
|
|
58
66
|
onTabError = (attr, error) => {
|
|
59
67
|
const currentTab = this.state.tab;
|
|
@@ -94,11 +102,26 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
94
102
|
// async detail loading, window/dialog resize) instead of freezing a
|
|
95
103
|
// transient - possibly too narrow - initial measurement.
|
|
96
104
|
if (this.refDiv.current && typeof ResizeObserver !== 'undefined') {
|
|
97
|
-
this.resizeObserver = new ResizeObserver(() =>
|
|
105
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
106
|
+
// Coalesce bursts into a single measurement per frame. This also breaks the
|
|
107
|
+
// ResizeObserver feedback loop: switching bar<->menu changes the layout, which
|
|
108
|
+
// would otherwise notify the observer again immediately and cause flickering.
|
|
109
|
+
if (this.resizeRaf !== null) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.resizeRaf = window.requestAnimationFrame(() => {
|
|
113
|
+
this.resizeRaf = null;
|
|
114
|
+
this.measureWidth();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
98
117
|
this.resizeObserver.observe(this.refDiv.current);
|
|
99
118
|
}
|
|
100
119
|
}
|
|
101
120
|
componentWillUnmount() {
|
|
121
|
+
if (this.resizeRaf !== null) {
|
|
122
|
+
window.cancelAnimationFrame(this.resizeRaf);
|
|
123
|
+
this.resizeRaf = null;
|
|
124
|
+
}
|
|
102
125
|
if (this.resizeObserver) {
|
|
103
126
|
this.resizeObserver.disconnect();
|
|
104
127
|
this.resizeObserver = null;
|
|
@@ -112,8 +135,23 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
112
135
|
}
|
|
113
136
|
measureWidth = () => {
|
|
114
137
|
const width = this.refDiv.current?.clientWidth;
|
|
115
|
-
if (width
|
|
116
|
-
|
|
138
|
+
if (!width) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// Decide with hysteresis whether to collapse the tabs into the burger menu. Switch to the
|
|
142
|
+
// menu once the width drops below MENU_WIDTH, but only switch back to the tab bar once it
|
|
143
|
+
// grows past MENU_WIDTH + MENU_HYSTERESIS. The dead-band in between prevents a scrollbar
|
|
144
|
+
// that appears/disappears on a tab change (shifting the width by ~15px) from toggling the
|
|
145
|
+
// layout back and forth, which is what caused the flickering.
|
|
146
|
+
let useMenu = this.state.useMenu;
|
|
147
|
+
if (!useMenu && width < ConfigTabs.MENU_WIDTH) {
|
|
148
|
+
useMenu = true;
|
|
149
|
+
}
|
|
150
|
+
else if (useMenu && width > ConfigTabs.MENU_WIDTH + ConfigTabs.MENU_HYSTERESIS) {
|
|
151
|
+
useMenu = false;
|
|
152
|
+
}
|
|
153
|
+
if (useMenu !== this.state.useMenu) {
|
|
154
|
+
this.setState({ useMenu });
|
|
117
155
|
}
|
|
118
156
|
};
|
|
119
157
|
onHashTabsChanged = () => {
|
|
@@ -136,29 +174,6 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
136
174
|
}
|
|
137
175
|
}
|
|
138
176
|
};
|
|
139
|
-
getCurrentBreakpoint() {
|
|
140
|
-
// Until the real width is measured (before the first paint in
|
|
141
|
-
// componentDidMount) fall back to a wide breakpoint so tabs - not the
|
|
142
|
-
// menu - are the default. The breakpoint is always derived from the
|
|
143
|
-
// current width and never frozen, so a transient narrow measurement can
|
|
144
|
-
// no longer lock the component into the burger menu.
|
|
145
|
-
if (!this.state.width) {
|
|
146
|
-
return 'md';
|
|
147
|
-
}
|
|
148
|
-
if (this.state.width < 600) {
|
|
149
|
-
return 'xs';
|
|
150
|
-
}
|
|
151
|
-
if (this.state.width < 900) {
|
|
152
|
-
return 'sm';
|
|
153
|
-
}
|
|
154
|
-
if (this.state.width < 1200) {
|
|
155
|
-
return 'md';
|
|
156
|
-
}
|
|
157
|
-
if (this.state.width < 1536) {
|
|
158
|
-
return 'lg';
|
|
159
|
-
}
|
|
160
|
-
return 'xl';
|
|
161
|
-
}
|
|
162
177
|
onMenuChange(tab) {
|
|
163
178
|
(window._localStorage || window.localStorage).setItem(`${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`, tab);
|
|
164
179
|
this.setState({ tab }, () => {
|
|
@@ -233,9 +248,8 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
233
248
|
// Select the first tab if the current tab is not available
|
|
234
249
|
setTimeout(() => this.setState({ tab: elements[0].name }), 50);
|
|
235
250
|
}
|
|
236
|
-
const currentBreakpoint = this.getCurrentBreakpoint();
|
|
237
251
|
let tabs;
|
|
238
|
-
if (
|
|
252
|
+
if (this.state.useMenu && elements.length > 2) {
|
|
239
253
|
tabs = (React.createElement(Toolbar, { style: {
|
|
240
254
|
top: 2,
|
|
241
255
|
backgroundColor: this.props.oContext.themeType === 'dark' ? '#222' : '#DDD',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigTabs.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG3E,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,GAAwC;IAChD,IAAI,EAAE;QACF,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KAChB;IACD,KAAK,EAAE;QACH,KAAK,EAAE,MA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S,EAAE,SAAS,EACpB,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAC/C,CACA,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Tabs, Tab, IconButton, Toolbar, Menu, MenuItem, ListItemIcon, Box } from '@mui/material';\nimport { Menu as MenuIcon, Error as ErrorIcon } from '@mui/icons-material';\n\nimport type { ConfigItemTabs } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\nimport ConfigPanel from './ConfigPanel';\n\nconst styles: Record<string, React.CSSProperties> = {\n tabs: {\n height: '100%',\n width: '100%',\n },\n panel: {\n width: '100%',\n display: 'block',\n },\n panelWithIcons: {\n height: 'calc(100% - 72px)',\n },\n panelWithoutIcons: {\n height: 'calc(100% - 48px)',\n },\n};\n\ninterface ConfigTabsProps extends ConfigGenericProps {\n schema: ConfigItemTabs;\n dialogName?: string;\n withoutSaveButtons?: boolean;\n}\n\ninterface ConfigTabsState extends ConfigGenericState {\n tab?: string;\n width: number;\n openMenu: HTMLButtonElement | null;\n tabErrors: Record<string, Record<string, string>>; // tab -> attr -> error\n calculatedValuesTable: Record<string, { hidden: boolean; disabled: boolean }> | null;\n}\n\nexport default class ConfigTabs extends ConfigGeneric<ConfigTabsProps, ConfigTabsState> {\n private resizeObserver: ResizeObserver | null = null;\n private calculateTimeoutTable: ReturnType<typeof setTimeout> | null = null;\n\n private readonly refDiv: React.RefObject<HTMLDivElement>;\n\n constructor(props: ConfigTabsProps) {\n super(props);\n let tab: string | undefined;\n\n if (this.props.root) {\n // read the path from hash\n // #tab-instances/config/system.adapter.ping.0/<TAB-NAME-OR-INDEX>\n const hash = (window.location.hash || '').replace(/^#/, '').split('/');\n if (hash.length >= 3 && hash[1] === 'config') {\n const tabS = hash[3];\n const tabN = parseInt(tabS, 10);\n if (tabS && tabN.toString() === tabS) {\n if (tabN >= 0 && tabN < Object.keys(this.props.schema.items).length) {\n tab = Object.keys(this.props.schema.items)[tabN];\n }\n } else if (tabS && Object.keys(this.props.schema.items).includes(tabS)) {\n tab = tabS;\n }\n\n // install on hash change handler\n window.addEventListener('hashchange', this.onHashTabsChanged, false);\n }\n }\n\n if (tab === undefined) {\n tab =\n (((window as any)._localStorage as Storage) || window.localStorage).getItem(\n `${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`,\n ) || Object.keys(this.props.schema.items)[0];\n if (!Object.keys(this.props.schema.items).includes(tab)) {\n tab = Object.keys(this.props.schema.items)[0];\n }\n }\n this.refDiv = React.createRef();\n\n Object.assign(this.state, { tab, width: 0, openMenu: null, tabErrors: {} });\n }\n\n onTabError = (attr?: string, error?: string): void => {\n const currentTab = this.state.tab;\n if (!currentTab && attr) {\n // Forward to parent if no current tab\n this.props.onError(attr, error);\n return;\n }\n\n const newTabErrors = { ...this.state.tabErrors };\n\n if (currentTab) {\n newTabErrors[currentTab] ||= {};\n }\n\n if (currentTab && attr) {\n if (!error) {\n delete newTabErrors[currentTab][attr];\n // Clean up empty tab error objects\n if (Object.keys(newTabErrors[currentTab]).length === 0) {\n delete newTabErrors[currentTab];\n }\n } else {\n newTabErrors[currentTab][attr] = error;\n }\n }\n\n this.setState({ tabErrors: newTabErrors });\n\n // Also forward to parent\n this.props.onError(attr, error);\n };\n\n hasTabErrors = (tabName: string): boolean => {\n return !!this.state.tabErrors[tabName] && Object.keys(this.state.tabErrors[tabName]).length > 0;\n };\n\n async componentDidMount(): Promise<void> {\n await super.componentDidMount();\n // Measure the real width synchronously so the first painted frame already\n // uses the correct breakpoint (no visible tabs -> menu switch).\n this.measureWidth();\n // Keep the width up to date on later layout changes (dialog open animation,\n // async detail loading, window/dialog resize) instead of freezing a\n // transient - possibly too narrow - initial measurement.\n if (this.refDiv.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this.measureWidth());\n this.resizeObserver.observe(this.refDiv.current);\n }\n }\n\n componentWillUnmount(): void {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n if (this.calculateTimeoutTable) {\n clearTimeout(this.calculateTimeoutTable);\n this.calculateTimeoutTable = null;\n }\n window.removeEventListener('hashchange', this.onHashTabsChanged, false);\n super.componentWillUnmount();\n }\n\n measureWidth = (): void => {\n const width = this.refDiv.current?.clientWidth;\n if (width && width !== this.state.width) {\n this.setState({ width });\n }\n };\n\n onHashTabsChanged = (): void => {\n const hash = (window.location.hash || '').replace(/^#/, '').split('/');\n if (hash.length > 3 && hash[1] === 'config') {\n const tabS = hash[3];\n const tabN = parseInt(tabS, 10);\n let tab;\n if (tabN.toString() === tabS) {\n if (tabN >= 0 && tabN < Object.keys(this.props.schema.items).length) {\n tab = Object.keys(this.props.schema.items)[tabN];\n }\n } else if (Object.keys(this.props.schema.items).includes(tabS)) {\n tab = tabS;\n }\n if (tab !== undefined && tab !== this.state.tab) {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`,\n tab,\n );\n this.setState({ tab });\n }\n }\n };\n\n getCurrentBreakpoint(): 'xs' | 'sm' | 'md' | 'lg' | 'xl' {\n // Until the real width is measured (before the first paint in\n // componentDidMount) fall back to a wide breakpoint so tabs - not the\n // menu - are the default. The breakpoint is always derived from the\n // current width and never frozen, so a transient narrow measurement can\n // no longer lock the component into the burger menu.\n if (!this.state.width) {\n return 'md';\n }\n if (this.state.width < 600) {\n return 'xs';\n }\n if (this.state.width < 900) {\n return 'sm';\n }\n if (this.state.width < 1200) {\n return 'md';\n }\n if (this.state.width < 1536) {\n return 'lg';\n }\n return 'xl';\n }\n\n onMenuChange(tab: string): void {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`,\n tab,\n );\n this.setState({ tab }, () => {\n if (this.props.root) {\n const hash = (window.location.hash || '').split('/');\n if (hash.length >= 3 && hash[1] === 'config') {\n hash[3] = this.state.tab || '';\n window.location.hash = hash.join('/');\n }\n }\n });\n }\n\n updateCalculatedValuesForTable(): void {\n if (this.calculateTimeoutTable) {\n clearTimeout(this.calculateTimeoutTable);\n }\n this.calculateTimeoutTable = setTimeout(async (): Promise<void> => {\n this.calculateTimeoutTable = null;\n const items = this.props.schema.items;\n const calculatedValuesTable: Record<string, { hidden: boolean; disabled: boolean }> = {};\n for (const name in items) {\n let disabled: boolean;\n if (items[name].expertMode && !this.props.expertMode) {\n calculatedValuesTable[name] = { hidden: true, disabled: false };\n continue;\n }\n\n if (this.props.custom) {\n const hidden = !!(await this.executeCustom(\n items[name].hidden,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.index,\n this.props.globalData,\n ));\n if (hidden) {\n calculatedValuesTable[name] = { hidden: true, disabled: false };\n continue;\n }\n disabled = !!(await this.executeCustom(\n items[name].disabled,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.index,\n this.props.globalData,\n ));\n calculatedValuesTable[name] = { hidden, disabled };\n } else {\n const hidden = !!(await this.execute(\n items[name].hidden,\n false,\n this.props.data,\n this.props.index,\n this.props.globalData,\n ));\n if (hidden) {\n calculatedValuesTable[name] = { hidden: true, disabled: false };\n continue;\n }\n disabled = !!(await this.execute(\n items[name].disabled,\n false,\n this.props.data,\n this.props.index,\n this.props.globalData,\n ));\n calculatedValuesTable[name] = { hidden: false, disabled };\n }\n }\n\n if (JSON.stringify(calculatedValuesTable) !== JSON.stringify(this.state.calculatedValuesTable)) {\n this.setState({ calculatedValuesTable });\n }\n }, 50);\n }\n\n render(): JSX.Element | null {\n const items = this.props.schema.items;\n let withIcons = false;\n\n this.updateCalculatedValuesForTable();\n if (!this.state.calculatedValuesTable) {\n return null;\n }\n const elements: { icon: React.JSX.Element | null; label: string; name: string; disabled: boolean }[] = [];\n\n Object.keys(items)\n .filter(name => !this.state.calculatedValuesTable?.[name]?.hidden)\n .map(name => {\n const icon = this.getIcon(items[name].icon);\n withIcons ||= !!icon;\n elements.push({\n icon,\n disabled: !!this.state.calculatedValuesTable?.[name]?.disabled,\n label: this.getText(items[name].label),\n name,\n });\n });\n\n if (!elements.find(item => item.name === this.state.tab)) {\n // Select the first tab if the current tab is not available\n setTimeout(() => this.setState({ tab: elements[0].name }), 50);\n }\n\n const currentBreakpoint = this.getCurrentBreakpoint();\n let tabs: React.JSX.Element;\n if (currentBreakpoint === 'xs' && elements.length > 2) {\n tabs = (\n <Toolbar\n style={{\n top: 2,\n backgroundColor: this.props.oContext.themeType === 'dark' ? '#222' : '#DDD',\n }}\n variant=\"dense\"\n >\n <IconButton\n onClick={(event: React.MouseEvent<HTMLButtonElement>) =>\n this.setState({ openMenu: event.currentTarget })\n }\n >\n <MenuIcon />\n </IconButton>\n {this.state.openMenu ? (\n <Menu\n open={!0}\n anchorEl={this.state.openMenu}\n onClose={() => this.setState({ openMenu: null })}\n >\n {elements.map(el => {\n const hasErrors = this.hasTabErrors(el.name);\n return (\n <MenuItem\n disabled={el.disabled}\n key={el.name}\n onClick={() => {\n this.setState({ openMenu: null }, () => this.onMenuChange(el.name));\n }}\n selected={el.name === this.state.tab}\n sx={hasErrors ? { color: 'error.main' } : undefined}\n >\n {withIcons ? <ListItemIcon>{el.icon}</ListItemIcon> : null}\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, width: '100%' }}>\n {el.label}\n {hasErrors && <ErrorIcon sx={{ fontSize: 16, color: 'error.main' }} />}\n </Box>\n </MenuItem>\n );\n })}\n </Menu>\n ) : null}\n </Toolbar>\n );\n } else {\n tabs = (\n <Tabs\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n style={this.props.schema.tabsStyle}\n value={this.state.tab}\n onChange={(_e, tab: string): void => this.onMenuChange(tab)}\n >\n {elements.map(el => {\n const hasErrors = this.hasTabErrors(el.name);\n const label = hasErrors ? (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n {el.label}\n <ErrorIcon sx={{ fontSize: 16, color: 'error.main' }} />\n </Box>\n ) : (\n el.label\n );\n\n return (\n <Tab\n id={el.name}\n wrapped\n disabled={el.disabled}\n key={el.name}\n value={el.name}\n iconPosition={this.props.schema.iconPosition || 'start'}\n icon={el.icon || undefined}\n label={label}\n sx={hasErrors ? { '& .MuiTab-wrapper': { color: 'error.main' } } : undefined}\n />\n );\n })}\n </Tabs>\n );\n }\n if (!this.state.tab) {\n return null;\n }\n return (\n <div\n style={styles.tabs}\n ref={this.refDiv}\n >\n {tabs}\n <ConfigPanel\n oContext={this.props.oContext}\n withoutSaveButtons={this.props.withoutSaveButtons}\n isParentTab\n changed={this.props.changed}\n key={this.state.tab}\n expertMode={this.props.expertMode}\n index={1001}\n arrayIndex={this.props.arrayIndex}\n globalData={this.props.globalData}\n commandRunning={this.props.commandRunning}\n style={{\n ...styles.panel,\n ...(withIcons ? styles.panelWithIcons : styles.panelWithoutIcons),\n }}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n onChange={this.props.onChange}\n onError={this.onTabError}\n customObj={this.props.customObj}\n custom={this.props.custom}\n schema={items[this.state.tab]}\n table={this.props.table}\n withIcons={withIcons}\n customComponents={this.props.customComponents}\n />\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ConfigTabs.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG3E,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,GAAwC;IACh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,KAAK,EACvB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EACrC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAC/C,CACA,CACT,CAAC;IACN,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Tabs, Tab, IconButton, Toolbar, Menu, MenuItem, ListItemIcon, Box } from '@mui/material';\nimport { Menu as MenuIcon, Error as ErrorIcon } from '@mui/icons-material';\n\nimport type { ConfigItemTabs } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\nimport ConfigPanel from './ConfigPanel';\n\nconst styles: Record<string, React.CSSProperties> = {\n tabs: {\n height: '100%',\n width: '100%',\n },\n panel: {\n width: '100%',\n display: 'block',\n },\n panelWithIcons: {\n height: 'calc(100% - 72px)',\n },\n panelWithoutIcons: {\n height: 'calc(100% - 48px)',\n },\n};\n\ninterface ConfigTabsProps extends ConfigGenericProps {\n schema: ConfigItemTabs;\n dialogName?: string;\n withoutSaveButtons?: boolean;\n}\n\ninterface ConfigTabsState extends ConfigGenericState {\n tab?: string;\n /** Show the burger menu instead of the tab bar (true only for very narrow widths). Decided with hysteresis. */\n useMenu: boolean;\n openMenu: HTMLButtonElement | null;\n tabErrors: Record<string, Record<string, string>>; // tab -> attr -> error\n calculatedValuesTable: Record<string, { hidden: boolean; disabled: boolean }> | null;\n}\n\nexport default class ConfigTabs extends ConfigGeneric<ConfigTabsProps, ConfigTabsState> {\n /** Below this width the tabs collapse into a burger menu */\n private static readonly MENU_WIDTH = 600;\n /**\n * Dead-band around MENU_WIDTH. A scrollbar appearing/disappearing on a tab change shifts\n * clientWidth by ~15px; without this dead-band that would toggle bar<->menu and flicker.\n */\n private static readonly MENU_HYSTERESIS = 40;\n\n private resizeObserver: ResizeObserver | null = null;\n private resizeRaf: number | null = null;\n private calculateTimeoutTable: ReturnType<typeof setTimeout> | null = null;\n\n private readonly refDiv: React.RefObject<HTMLDivElement>;\n\n constructor(props: ConfigTabsProps) {\n super(props);\n let tab: string | undefined;\n\n if (this.props.root) {\n // read the path from hash\n // #tab-instances/config/system.adapter.ping.0/<TAB-NAME-OR-INDEX>\n const hash = (window.location.hash || '').replace(/^#/, '').split('/');\n if (hash.length >= 3 && hash[1] === 'config') {\n const tabS = hash[3];\n const tabN = parseInt(tabS, 10);\n if (tabS && tabN.toString() === tabS) {\n if (tabN >= 0 && tabN < Object.keys(this.props.schema.items).length) {\n tab = Object.keys(this.props.schema.items)[tabN];\n }\n } else if (tabS && Object.keys(this.props.schema.items).includes(tabS)) {\n tab = tabS;\n }\n\n // install on hash change handler\n window.addEventListener('hashchange', this.onHashTabsChanged, false);\n }\n }\n\n if (tab === undefined) {\n tab =\n (((window as any)._localStorage as Storage) || window.localStorage).getItem(\n `${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`,\n ) || Object.keys(this.props.schema.items)[0];\n if (!Object.keys(this.props.schema.items).includes(tab)) {\n tab = Object.keys(this.props.schema.items)[0];\n }\n }\n this.refDiv = React.createRef();\n\n Object.assign(this.state, { tab, useMenu: false, openMenu: null, tabErrors: {} });\n }\n\n onTabError = (attr?: string, error?: string): void => {\n const currentTab = this.state.tab;\n if (!currentTab && attr) {\n // Forward to parent if no current tab\n this.props.onError(attr, error);\n return;\n }\n\n const newTabErrors = { ...this.state.tabErrors };\n\n if (currentTab) {\n newTabErrors[currentTab] ||= {};\n }\n\n if (currentTab && attr) {\n if (!error) {\n delete newTabErrors[currentTab][attr];\n // Clean up empty tab error objects\n if (Object.keys(newTabErrors[currentTab]).length === 0) {\n delete newTabErrors[currentTab];\n }\n } else {\n newTabErrors[currentTab][attr] = error;\n }\n }\n\n this.setState({ tabErrors: newTabErrors });\n\n // Also forward to parent\n this.props.onError(attr, error);\n };\n\n hasTabErrors = (tabName: string): boolean => {\n return !!this.state.tabErrors[tabName] && Object.keys(this.state.tabErrors[tabName]).length > 0;\n };\n\n async componentDidMount(): Promise<void> {\n await super.componentDidMount();\n // Measure the real width synchronously so the first painted frame already\n // uses the correct breakpoint (no visible tabs -> menu switch).\n this.measureWidth();\n // Keep the width up to date on later layout changes (dialog open animation,\n // async detail loading, window/dialog resize) instead of freezing a\n // transient - possibly too narrow - initial measurement.\n if (this.refDiv.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => {\n // Coalesce bursts into a single measurement per frame. This also breaks the\n // ResizeObserver feedback loop: switching bar<->menu changes the layout, which\n // would otherwise notify the observer again immediately and cause flickering.\n if (this.resizeRaf !== null) {\n return;\n }\n this.resizeRaf = window.requestAnimationFrame(() => {\n this.resizeRaf = null;\n this.measureWidth();\n });\n });\n this.resizeObserver.observe(this.refDiv.current);\n }\n }\n\n componentWillUnmount(): void {\n if (this.resizeRaf !== null) {\n window.cancelAnimationFrame(this.resizeRaf);\n this.resizeRaf = null;\n }\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n if (this.calculateTimeoutTable) {\n clearTimeout(this.calculateTimeoutTable);\n this.calculateTimeoutTable = null;\n }\n window.removeEventListener('hashchange', this.onHashTabsChanged, false);\n super.componentWillUnmount();\n }\n\n measureWidth = (): void => {\n const width = this.refDiv.current?.clientWidth;\n if (!width) {\n return;\n }\n // Decide with hysteresis whether to collapse the tabs into the burger menu. Switch to the\n // menu once the width drops below MENU_WIDTH, but only switch back to the tab bar once it\n // grows past MENU_WIDTH + MENU_HYSTERESIS. The dead-band in between prevents a scrollbar\n // that appears/disappears on a tab change (shifting the width by ~15px) from toggling the\n // layout back and forth, which is what caused the flickering.\n let useMenu = this.state.useMenu;\n if (!useMenu && width < ConfigTabs.MENU_WIDTH) {\n useMenu = true;\n } else if (useMenu && width > ConfigTabs.MENU_WIDTH + ConfigTabs.MENU_HYSTERESIS) {\n useMenu = false;\n }\n if (useMenu !== this.state.useMenu) {\n this.setState({ useMenu });\n }\n };\n\n onHashTabsChanged = (): void => {\n const hash = (window.location.hash || '').replace(/^#/, '').split('/');\n if (hash.length > 3 && hash[1] === 'config') {\n const tabS = hash[3];\n const tabN = parseInt(tabS, 10);\n let tab;\n if (tabN.toString() === tabS) {\n if (tabN >= 0 && tabN < Object.keys(this.props.schema.items).length) {\n tab = Object.keys(this.props.schema.items)[tabN];\n }\n } else if (Object.keys(this.props.schema.items).includes(tabS)) {\n tab = tabS;\n }\n if (tab !== undefined && tab !== this.state.tab) {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`,\n tab,\n );\n this.setState({ tab });\n }\n }\n };\n\n onMenuChange(tab: string): void {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.dialogName || 'App'}.${this.props.oContext.adapterName}`,\n tab,\n );\n this.setState({ tab }, () => {\n if (this.props.root) {\n const hash = (window.location.hash || '').split('/');\n if (hash.length >= 3 && hash[1] === 'config') {\n hash[3] = this.state.tab || '';\n window.location.hash = hash.join('/');\n }\n }\n });\n }\n\n updateCalculatedValuesForTable(): void {\n if (this.calculateTimeoutTable) {\n clearTimeout(this.calculateTimeoutTable);\n }\n this.calculateTimeoutTable = setTimeout(async (): Promise<void> => {\n this.calculateTimeoutTable = null;\n const items = this.props.schema.items;\n const calculatedValuesTable: Record<string, { hidden: boolean; disabled: boolean }> = {};\n for (const name in items) {\n let disabled: boolean;\n if (items[name].expertMode && !this.props.expertMode) {\n calculatedValuesTable[name] = { hidden: true, disabled: false };\n continue;\n }\n\n if (this.props.custom) {\n const hidden = !!(await this.executeCustom(\n items[name].hidden,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.index,\n this.props.globalData,\n ));\n if (hidden) {\n calculatedValuesTable[name] = { hidden: true, disabled: false };\n continue;\n }\n disabled = !!(await this.executeCustom(\n items[name].disabled,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n this.props.index,\n this.props.globalData,\n ));\n calculatedValuesTable[name] = { hidden, disabled };\n } else {\n const hidden = !!(await this.execute(\n items[name].hidden,\n false,\n this.props.data,\n this.props.index,\n this.props.globalData,\n ));\n if (hidden) {\n calculatedValuesTable[name] = { hidden: true, disabled: false };\n continue;\n }\n disabled = !!(await this.execute(\n items[name].disabled,\n false,\n this.props.data,\n this.props.index,\n this.props.globalData,\n ));\n calculatedValuesTable[name] = { hidden: false, disabled };\n }\n }\n\n if (JSON.stringify(calculatedValuesTable) !== JSON.stringify(this.state.calculatedValuesTable)) {\n this.setState({ calculatedValuesTable });\n }\n }, 50);\n }\n\n render(): JSX.Element | null {\n const items = this.props.schema.items;\n let withIcons = false;\n\n this.updateCalculatedValuesForTable();\n if (!this.state.calculatedValuesTable) {\n return null;\n }\n const elements: { icon: React.JSX.Element | null; label: string; name: string; disabled: boolean }[] = [];\n\n Object.keys(items)\n .filter(name => !this.state.calculatedValuesTable?.[name]?.hidden)\n .map(name => {\n const icon = this.getIcon(items[name].icon);\n withIcons ||= !!icon;\n elements.push({\n icon,\n disabled: !!this.state.calculatedValuesTable?.[name]?.disabled,\n label: this.getText(items[name].label),\n name,\n });\n });\n\n if (!elements.find(item => item.name === this.state.tab)) {\n // Select the first tab if the current tab is not available\n setTimeout(() => this.setState({ tab: elements[0].name }), 50);\n }\n\n let tabs: React.JSX.Element;\n if (this.state.useMenu && elements.length > 2) {\n tabs = (\n <Toolbar\n style={{\n top: 2,\n backgroundColor: this.props.oContext.themeType === 'dark' ? '#222' : '#DDD',\n }}\n variant=\"dense\"\n >\n <IconButton\n onClick={(event: React.MouseEvent<HTMLButtonElement>) =>\n this.setState({ openMenu: event.currentTarget })\n }\n >\n <MenuIcon />\n </IconButton>\n {this.state.openMenu ? (\n <Menu\n open={!0}\n anchorEl={this.state.openMenu}\n onClose={() => this.setState({ openMenu: null })}\n >\n {elements.map(el => {\n const hasErrors = this.hasTabErrors(el.name);\n return (\n <MenuItem\n disabled={el.disabled}\n key={el.name}\n onClick={() => {\n this.setState({ openMenu: null }, () => this.onMenuChange(el.name));\n }}\n selected={el.name === this.state.tab}\n sx={hasErrors ? { color: 'error.main' } : undefined}\n >\n {withIcons ? <ListItemIcon>{el.icon}</ListItemIcon> : null}\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, width: '100%' }}>\n {el.label}\n {hasErrors && <ErrorIcon sx={{ fontSize: 16, color: 'error.main' }} />}\n </Box>\n </MenuItem>\n );\n })}\n </Menu>\n ) : null}\n </Toolbar>\n );\n } else {\n tabs = (\n <Tabs\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n style={this.props.schema.tabsStyle}\n value={this.state.tab}\n onChange={(_e, tab: string): void => this.onMenuChange(tab)}\n >\n {elements.map(el => {\n const hasErrors = this.hasTabErrors(el.name);\n const label = hasErrors ? (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n {el.label}\n <ErrorIcon sx={{ fontSize: 16, color: 'error.main' }} />\n </Box>\n ) : (\n el.label\n );\n\n return (\n <Tab\n id={el.name}\n wrapped\n disabled={el.disabled}\n key={el.name}\n value={el.name}\n iconPosition={this.props.schema.iconPosition || 'start'}\n icon={el.icon || undefined}\n label={label}\n sx={hasErrors ? { '& .MuiTab-wrapper': { color: 'error.main' } } : undefined}\n />\n );\n })}\n </Tabs>\n );\n }\n if (!this.state.tab) {\n return null;\n }\n return (\n <div\n style={styles.tabs}\n ref={this.refDiv}\n >\n {tabs}\n <ConfigPanel\n oContext={this.props.oContext}\n withoutSaveButtons={this.props.withoutSaveButtons}\n isParentTab\n changed={this.props.changed}\n key={this.state.tab}\n expertMode={this.props.expertMode}\n index={1001}\n arrayIndex={this.props.arrayIndex}\n globalData={this.props.globalData}\n commandRunning={this.props.commandRunning}\n style={{\n ...styles.panel,\n ...(withIcons ? styles.panelWithIcons : styles.panelWithoutIcons),\n }}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n onChange={this.props.onChange}\n onError={this.onTabError}\n customObj={this.props.customObj}\n custom={this.props.custom}\n schema={items[this.state.tab]}\n table={this.props.table}\n withIcons={withIcons}\n customComponents={this.props.customComponents}\n />\n </div>\n );\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/json-config",
|
|
3
3
|
"description": "This package contains the ioBroker JSON config UI components",
|
|
4
|
-
"version": "8.5.
|
|
4
|
+
"version": "8.5.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
7
7
|
"email": "dogafox@gmail.com"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@emotion/react": "^11.14.0",
|
|
39
39
|
"@emotion/styled": "^11.14.1",
|
|
40
|
-
"@iobroker/adapter-react-v5": "^8.3.
|
|
40
|
+
"@iobroker/adapter-react-v5": "^8.3.2",
|
|
41
41
|
"@module-federation/runtime": "^2.3.3",
|
|
42
42
|
"@mui/x-date-pickers": "^7.29.4",
|
|
43
43
|
"crypto-js": "^4.2.0",
|