@iobroker/json-config 9.0.21 → 9.0.23
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 +8 -0
- package/build/JsonConfigComponent/ConfigPanel.js +6 -14
- package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTabs.js +14 -11
- package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/build/JsonConfigComponent/index.js +3 -0
- package/build/JsonConfigComponent/index.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1907,6 +1907,14 @@ The schema is used here: https://github.com/SchemaStore/schemastore/blob/6da29cd
|
|
|
1907
1907
|
### **WORK IN PROGRESS**
|
|
1908
1908
|
-->
|
|
1909
1909
|
## Changelog
|
|
1910
|
+
### 9.0.23 (2026-08-27)
|
|
1911
|
+
(@krobipd) Corrected: the object browser stayed empty after closing the object customization dialog if any object was changed while the dialog was open (ioBroker/ioBroker.admin#3391)
|
|
1912
|
+
(@krobipd) Changed: `ObjectBrowserClass.subscribes` and `.recordStates` are Sets instead of arrays now
|
|
1913
|
+
(@krobipd) Improved: object browser performance on large installations — bursts of object changes cause one tree rebuild instead of several, state-change echoes no longer trigger redraws, subscription bookkeeping is no longer quadratic, and rows outside the viewport skip layout and paint
|
|
1914
|
+
|
|
1915
|
+
### 9.0.22 (2026-08-21)
|
|
1916
|
+
- (@GermanBluefox) Corrected layout of Config view
|
|
1917
|
+
|
|
1910
1918
|
### 9.0.21 (2026-08-19)
|
|
1911
1919
|
- (@GermanBluefox) Added the possibility to show or hide elements depending on the operating system of the host: `os`, `notOs` and the JS variables `_os`, `_arch`, `_host`
|
|
1912
1920
|
- (@GermanBluefox) Added the possibility to show or hide elements depending on the docker installation: `docker` and `_host.docker`
|
|
@@ -139,12 +139,11 @@ const styles = {
|
|
|
139
139
|
width: 'auto !important',
|
|
140
140
|
overflowY: 'auto',
|
|
141
141
|
paddingBottom: 1,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
height: 'calc(100vh - 235px) !important',
|
|
142
|
+
// The height comes from the parent (tabs or the root container of the JSON config),
|
|
143
|
+
// so the panel uses the whole available height and not some pre-calculated value.
|
|
144
|
+
flex: '1 1 auto',
|
|
145
|
+
// Allow the panel to be smaller than its content, so it can scroll itself
|
|
146
|
+
minHeight: 0,
|
|
148
147
|
},
|
|
149
148
|
padding: {
|
|
150
149
|
padding: '10px',
|
|
@@ -268,14 +267,7 @@ export default class ConfigPanel extends ConfigGeneric {
|
|
|
268
267
|
React.createElement(Grid, { container: true, columnSpacing: 2, rowSpacing: 1, sx: { ...schemaStyle, width: '100%', padding: '10px' } }, this.renderItems(items, this.state.calculatedValues.disabled)))));
|
|
269
268
|
}
|
|
270
269
|
else {
|
|
271
|
-
const sx = Utils.getStyle(this.props.oContext.theme, this.props.style, schemaStyle, { width: '100%' }, this.props.isParentTab && styles.paper
|
|
272
|
-
(this.props.withoutSaveButtons
|
|
273
|
-
? this.props.withIcons
|
|
274
|
-
? { height: 'calc(100% - 88px) !important' }
|
|
275
|
-
: { height: 'calc(100% - 64px) !important' }
|
|
276
|
-
: this.props.withIcons
|
|
277
|
-
? styles.paperWithIcons
|
|
278
|
-
: styles.paperWithoutIcons));
|
|
270
|
+
const sx = Utils.getStyle(this.props.oContext.theme, this.props.style, schemaStyle, { width: '100%' }, this.props.isParentTab && styles.paper);
|
|
279
271
|
content = (React.createElement(Box, { component: "div", key: `${this.props.attr}_${this.props.index}`, className: this.props.className, sx: sx },
|
|
280
272
|
React.createElement(Grid, { container: true, columnSpacing: 2, rowSpacing: 1, sx: Utils.getStyle(this.props.oContext.theme, { width: '100%' }, this.props.isParentTab && styles.padding, this.props.schema.innerStyle) }, this.renderItems(items, this.state.calculatedValues.disabled))));
|
|
281
273
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPanel.js","sourceRoot":"src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ordionSummary, AccordionDetails, Typography, Box } from '@mui/material';\n\nimport { ExpandMore as ExpandMoreIcon } from '@mui/icons-material';\n\nimport { type AdminConnection, type IobTheme, Utils } from '@iobroker/gui-components';\nimport type { ConfigItemComponent, ConfigItemPanel } from '../types';\n\nimport ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigAccordion from './ConfigAccordion';\nimport ConfigAlive from './ConfigAlive';\nimport ConfigAutocomplete from './ConfigAutocomplete';\nimport ConfigAutocompleteSendTo from './ConfigAutocompleteSendTo';\nimport ConfigCRON from './ConfigCRON';\nimport ConfigCertificateSelect from './ConfigCertificateSelect';\nimport ConfigCertificates from './ConfigCertificates';\nimport ConfigCertCollection from './ConfigCertCollection';\nimport ConfigCheckDocker from './ConfigCheckDocker';\nimport ConfigCredentialSelect from './ConfigCredentialSelect';\nimport ConfigCheckLicense from './ConfigCheckLicense';\nimport ConfigCheckbox from './ConfigCheckbox';\nimport ConfigChip from './ConfigChip';\nimport ConfigColor from './ConfigColor';\nimport ConfigCoordinates from './ConfigCoordinates';\nimport ConfigCustom from './ConfigCustom';\nimport ConfigDatePicker from './ConfigDatePicker';\nimport ConfigDeviceManager from './ConfigDeviceManager';\nimport ConfigFile from './ConfigFile';\nimport ConfigFileSelector from './ConfigFileSelector';\nimport ConfigFunc from './ConfigFunc';\nimport ConfigIFrame from './ConfigIFrame';\nimport ConfigIFrameSendTo from './ConfigIFrameSendTo';\nimport ConfigIP from './ConfigIP';\nimport ConfigImageSendTo from './ConfigImageSendTo';\nimport ConfigImageUpload from './ConfigImageUpload';\nimport ConfigInfoBox from './ConfigInfoBox';\nimport ConfigInstanceSelect from './ConfigInstanceSelect';\nimport ConfigInterface from './ConfigInterface';\nimport ConfigJsonEditor from './ConfigJsonEditor';\nimport ConfigLanguage from './ConfigLanguage';\nimport ConfigLicense from './ConfigLicense';\nimport ConfigNumber from './ConfigNumber';\nimport ConfigOauth2 from './ConfigOAuth2';\nimport ConfigObjectId from './ConfigObjectId';\nimport ConfigPassword from './ConfigPassword';\nimport ConfigPattern from './ConfigPattern';\nimport ConfigPort from './ConfigPort';\nimport ConfigRoom from './ConfigRoom';\nimport ConfigSelect from './ConfigSelect';\nimport ConfigSelectSendTo from './ConfigSelectSendTo';\nimport ConfigSendTo from './ConfigSendto';\nimport ConfigSetState from './ConfigSetState';\nimport ConfigSlider from './ConfigSlider';\nimport ConfigState from './ConfigState';\nimport ConfigStaticDivider from './ConfigStaticDivider';\nimport ConfigStaticHeader from './ConfigStaticHeader';\nimport ConfigStaticImage from './ConfigStaticImage';\nimport ConfigStaticInfo from './ConfigStaticInfo';\nimport ConfigStaticText from './ConfigStaticText';\nimport ConfigTable from './ConfigTable';\nimport ConfigText from './ConfigText';\nimport ConfigTextSendTo from './ConfigTextSendTo';\nimport ConfigTimePicker from './ConfigTimePicker';\nimport ConfigTopic from './ConfigTopic';\nimport ConfigUUID from './ConfigUUID';\nimport ConfigUser from './ConfigUser';\nimport ConfigYamlEditor from './ConfigYamlEditor';\nimport ConfigQrCode from './ConfigQrCode';\nimport ConfigQrCodeSendTo from './ConfigQrCodeSendTo';\n\nconst components: Record<string, typeof ConfigGeneric<any, any>> = {\n accordion: ConfigAccordion,\n alive: ConfigAlive,\n autocomplete: ConfigAutocomplete,\n autocompleteSendTo: ConfigAutocompleteSendTo,\n certCollection: ConfigCertCollection,\n certificate: ConfigCertificateSelect,\n certificates: ConfigCertificates,\n checkbox: ConfigCheckbox,\n checkDocker: ConfigCheckDocker,\n checkLicense: ConfigCheckLicense,\n chip: ConfigChip, // deprecated. Use \"chips\"\n chips: ConfigChip,\n color: ConfigColor,\n coordinates: ConfigCoordinates,\n credential: ConfigCredentialSelect,\n cron: ConfigCRON,\n custom: ConfigCustom,\n datePicker: ConfigDatePicker,\n deviceManager: ConfigDeviceManager,\n divider: ConfigStaticDivider,\n file: ConfigFile,\n fileSelector: ConfigFileSelector,\n func: ConfigFunc,\n header: ConfigStaticHeader,\n iframe: ConfigIFrame,\n iframeSendTo: ConfigIFrameSendTo,\n image: ConfigImageUpload,\n imageSendTo: ConfigImageSendTo,\n infoBox: ConfigInfoBox,\n instance: ConfigInstanceSelect,\n interface: ConfigInterface,\n ip: ConfigIP,\n jsonEditor: ConfigJsonEditor,\n language: ConfigLanguage,\n license: ConfigLicense,\n number: ConfigNumber,\n oauth2: ConfigOauth2,\n objectId: ConfigObjectId,\n password: ConfigPassword,\n pattern: ConfigPattern,\n port: ConfigPort,\n qrCode: ConfigQrCode,\n qrCodeSendTo: ConfigQrCodeSendTo,\n room: ConfigRoom,\n select: ConfigSelect,\n selectSendTo: ConfigSelectSendTo,\n // @deprecated Use \"sendTo\"\n sendto: ConfigSendTo,\n sendTo: ConfigSendTo,\n setState: ConfigSetState,\n slider: ConfigSlider,\n state: ConfigState,\n staticImage: ConfigStaticImage,\n staticInfo: ConfigStaticInfo,\n staticLink: ConfigStaticText,\n staticText: ConfigStaticText,\n table: ConfigTable,\n text: ConfigText,\n textSendTo: ConfigTextSendTo,\n timePicker: ConfigTimePicker,\n topic: ConfigTopic,\n uuid: ConfigUUID,\n user: ConfigUser,\n yamlEditor: ConfigYamlEditor,\n};\n\nconst styles: Record<string, any> = {\n fullWidth: {\n width: '100%',\n // height: '100%',\n },\n paper: {\n margin: 1,\n width: 'auto !important',\n overflowY: 'auto',\n paddingBottom: 1,\n },\n paperWithIcons: {\n height: 'calc(100vh - 259px) !important',\n },\n paperWithoutIcons: {\n height: 'calc(100vh - 235px) !important',\n },\n padding: {\n padding: '10px',\n },\n heading: {},\n primary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.mode === 'dark' ? 'inherit' : '#FFF',\n }),\n secondary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.secondary.main,\n }),\n};\n\ninterface ConfigPanelProps extends ConfigGenericProps {\n schema: ConfigItemPanel;\n withIcons?: boolean;\n withoutSaveButtons?: boolean;\n}\ninterface ConfigPanelState extends ConfigGenericState {\n expanded?: boolean;\n}\n\nexport default class ConfigPanel extends ConfigGeneric<ConfigPanelProps, ConfigPanelState> {\n async componentDidMount(): Promise<void> {\n await super.componentDidMount();\n if (this.props.schema?.collapsable) {\n this.setState({\n expanded:\n (((window as any)._localStorage as Storage) || window.localStorage).getItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n ) === 'true',\n });\n }\n }\n\n renderItems(items: Record<string, any>, disabled: boolean): (JSX.Element | null)[] | null {\n return items\n ? Object.keys(items).map(attr => {\n if (this.props.oContext.multiEdit && items[attr].noMultiEdit) {\n return null;\n }\n\n // Do not create the component if it is not intended for the host, where the instance\n // runs. In this way, no default value will be written for it and no request will be sent by it\n if (!ConfigGeneric.isHostAllowed(items[attr], this.props.oContext.hostInfo)) {\n return null;\n }\n\n const type = items[attr].type || 'panel';\n let ItemComponent: typeof ConfigGeneric<ConfigGenericProps, any>;\n let socket: string | AdminConnection = 'Use this.props.oContext.socket!';\n if (type === 'custom') {\n // name\n // url\n if (items[attr].url) {\n ItemComponent = ConfigCustom;\n } else if (this.props.oContext.customs && this.props.oContext.customs[items[attr].component]) {\n ItemComponent = this.props.oContext.customs[items[attr].component];\n } else {\n console.error(`Cannot find custom component: ${items[attr].component}`);\n ItemComponent = ConfigGeneric;\n }\n socket = this.props.oContext.socket;\n } else if (type === 'component') {\n const subType = (items[attr] as ConfigItemComponent).subType;\n\n if (subType && this.props.customComponents?.[subType]) {\n ItemComponent = this.props.customComponents[subType];\n } else {\n return (\n <div key={`${attr}_${this.props.index ?? ''}`}>{`Component ${subType} not provided`}</div>\n );\n }\n } else if (type === 'panel') {\n ItemComponent = ConfigPanel;\n } else {\n ItemComponent = components[type] || ConfigGeneric;\n }\n\n return (\n <ItemComponent\n // @ts-expect-error Temporary work-around, till all custom components will not migrate to oContext\n socket={socket}\n globalData={this.props.globalData}\n oContext={this.props.oContext}\n key={`${attr}_${this.props.index ?? ''}`}\n index={this.props.index}\n changed={this.props.changed}\n arrayIndex={this.props.arrayIndex}\n expertMode={this.props.expertMode}\n commandRunning={this.props.commandRunning}\n style={styles.panel}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n onError={this.props.onError}\n onHiddenChanged={this.props.onHiddenChanged}\n onFilterLabelUpdate={this.props.onFilterLabelUpdate}\n onChange={this.props.onChange}\n disabled={disabled}\n customObj={this.props.customObj}\n custom={this.props.custom}\n schema={items[attr]}\n attr={attr}\n table={this.props.table}\n customComponents={this.props.customComponents}\n />\n );\n })\n : null;\n }\n\n render(): JSX.Element | null {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n this.updateCalculatedValues();\n\n if (!this.state.calculatedValues) {\n return null;\n }\n\n const items = this.props.schema.items;\n const schemaStyle = this.props.schema.style || {};\n\n if (this.state.calculatedValues.hidden) {\n if (schema.hideOnlyControl) {\n const item = (\n <Grid\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { marginBottom: 0, textAlign: 'left' /* marginRight: 8, */ },\n schemaStyle,\n this.props.oContext.themeType === 'dark' ? schema.darkStyle : undefined,\n )}\n />\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return null;\n }\n\n if (this.props.table) {\n return this.renderItems(items, this.state.calculatedValues.disabled) as any as JSX.Element;\n }\n\n if (this.props.custom) {\n return (\n <Grid\n key={`${this.props.attr}_${this.props.index}`}\n container\n style={styles.fullWidth}\n columnSpacing={2}\n rowSpacing={1}\n sx={schemaStyle}\n >\n {this.renderItems(items, this.state.calculatedValues.disabled)}\n </Grid>\n );\n }\n\n let content;\n if (schema.collapsable) {\n content = (\n <Accordion\n key={`${this.props.attr}_${this.props.index}`}\n style={styles.fullWidth}\n expanded={!!this.state.expanded}\n onChange={() => {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n this.state.expanded ? 'false' : 'true',\n );\n this.setState({ expanded: !this.state.expanded });\n }}\n >\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n schemaStyle,\n this.props.oContext.themeType && schema.darkStyle,\n schema.color === 'primary'\n ? styles.primary\n : schema.color === 'secondary' && styles.secondary,\n { width: '100%' },\n )}\n >\n <Typography style={styles.heading}>{this.getText(schema.label)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Grid\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={{ ...schemaStyle, width: '100%', padding: '10px' }}\n >\n {this.renderItems(items, this.state.calculatedValues.disabled)}\n </Grid>\n </AccordionDetails>\n </Accordion>\n );\n } else {\n const sx = Utils.getStyle(\n this.props.oContext.theme,\n this.props.style,\n schemaStyle,\n { width: '100%' },\n this.props.isParentTab && styles.paper,\n this.props.isParentTab &&\n (this.props.withoutSaveButtons\n ? this.props.withIcons\n ? { height: 'calc(100% - 88px) !important' }\n : { height: 'calc(100% - 64px) !important' }\n : this.props.withIcons\n ? styles.paperWithIcons\n : styles.paperWithoutIcons),\n );\n\n content = (\n <Box\n component=\"div\"\n key={`${this.props.attr}_${this.props.index}`}\n className={this.props.className}\n sx={sx}\n >\n <Grid\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { width: '100%' },\n this.props.isParentTab && styles.padding,\n this.props.schema.innerStyle,\n )}\n >\n {this.renderItems(items, this.state.calculatedValues.disabled)}\n </Grid>\n </Box>\n );\n }\n\n if (!this.props.isParentTab) {\n const item = (\n <Grid\n title={this.getText(schema.tooltip)}\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={{ marginBottom: 0, /* marginRight: 8, */ textAlign: 'left', ...schemaStyle }}\n >\n {content}\n </Grid>\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return content;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ConfigPanel.js","sourceRoot":"src/","sources":["JsonConfigComponent/ConfigPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAErG,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAuC,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGtF,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,oBAAoB,C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I,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAC/B,IAEA,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAC3D,CACL,CACT,CAAC;QACN,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAG,CACT,oBAAC,IAAI,IACD,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EACnC,IAAI,EAAE;oBACF,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;oBAC1B,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;iBAC7B,EACD,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,IAE/E,OAAO,CACL,CACV,CAAC;YAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,CACH;oBACI,6BAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI;oBAC/C,IAAI,CACN,CACN,CAAC;YACN,CAAC;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Grid, Accordion, AccordionSummary, AccordionDetails, Typography, Box } from '@mui/material';\n\nimport { ExpandMore as ExpandMoreIcon } from '@mui/icons-material';\n\nimport { type AdminConnection, type IobTheme, Utils } from '@iobroker/gui-components';\nimport type { ConfigItemComponent, ConfigItemPanel } from '../types';\n\nimport ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigAccordion from './ConfigAccordion';\nimport ConfigAlive from './ConfigAlive';\nimport ConfigAutocomplete from './ConfigAutocomplete';\nimport ConfigAutocompleteSendTo from './ConfigAutocompleteSendTo';\nimport ConfigCRON from './ConfigCRON';\nimport ConfigCertificateSelect from './ConfigCertificateSelect';\nimport ConfigCertificates from './ConfigCertificates';\nimport ConfigCertCollection from './ConfigCertCollection';\nimport ConfigCheckDocker from './ConfigCheckDocker';\nimport ConfigCredentialSelect from './ConfigCredentialSelect';\nimport ConfigCheckLicense from './ConfigCheckLicense';\nimport ConfigCheckbox from './ConfigCheckbox';\nimport ConfigChip from './ConfigChip';\nimport ConfigColor from './ConfigColor';\nimport ConfigCoordinates from './ConfigCoordinates';\nimport ConfigCustom from './ConfigCustom';\nimport ConfigDatePicker from './ConfigDatePicker';\nimport ConfigDeviceManager from './ConfigDeviceManager';\nimport ConfigFile from './ConfigFile';\nimport ConfigFileSelector from './ConfigFileSelector';\nimport ConfigFunc from './ConfigFunc';\nimport ConfigIFrame from './ConfigIFrame';\nimport ConfigIFrameSendTo from './ConfigIFrameSendTo';\nimport ConfigIP from './ConfigIP';\nimport ConfigImageSendTo from './ConfigImageSendTo';\nimport ConfigImageUpload from './ConfigImageUpload';\nimport ConfigInfoBox from './ConfigInfoBox';\nimport ConfigInstanceSelect from './ConfigInstanceSelect';\nimport ConfigInterface from './ConfigInterface';\nimport ConfigJsonEditor from './ConfigJsonEditor';\nimport ConfigLanguage from './ConfigLanguage';\nimport ConfigLicense from './ConfigLicense';\nimport ConfigNumber from './ConfigNumber';\nimport ConfigOauth2 from './ConfigOAuth2';\nimport ConfigObjectId from './ConfigObjectId';\nimport ConfigPassword from './ConfigPassword';\nimport ConfigPattern from './ConfigPattern';\nimport ConfigPort from './ConfigPort';\nimport ConfigRoom from './ConfigRoom';\nimport ConfigSelect from './ConfigSelect';\nimport ConfigSelectSendTo from './ConfigSelectSendTo';\nimport ConfigSendTo from './ConfigSendto';\nimport ConfigSetState from './ConfigSetState';\nimport ConfigSlider from './ConfigSlider';\nimport ConfigState from './ConfigState';\nimport ConfigStaticDivider from './ConfigStaticDivider';\nimport ConfigStaticHeader from './ConfigStaticHeader';\nimport ConfigStaticImage from './ConfigStaticImage';\nimport ConfigStaticInfo from './ConfigStaticInfo';\nimport ConfigStaticText from './ConfigStaticText';\nimport ConfigTable from './ConfigTable';\nimport ConfigText from './ConfigText';\nimport ConfigTextSendTo from './ConfigTextSendTo';\nimport ConfigTimePicker from './ConfigTimePicker';\nimport ConfigTopic from './ConfigTopic';\nimport ConfigUUID from './ConfigUUID';\nimport ConfigUser from './ConfigUser';\nimport ConfigYamlEditor from './ConfigYamlEditor';\nimport ConfigQrCode from './ConfigQrCode';\nimport ConfigQrCodeSendTo from './ConfigQrCodeSendTo';\n\nconst components: Record<string, typeof ConfigGeneric<any, any>> = {\n accordion: ConfigAccordion,\n alive: ConfigAlive,\n autocomplete: ConfigAutocomplete,\n autocompleteSendTo: ConfigAutocompleteSendTo,\n certCollection: ConfigCertCollection,\n certificate: ConfigCertificateSelect,\n certificates: ConfigCertificates,\n checkbox: ConfigCheckbox,\n checkDocker: ConfigCheckDocker,\n checkLicense: ConfigCheckLicense,\n chip: ConfigChip, // deprecated. Use \"chips\"\n chips: ConfigChip,\n color: ConfigColor,\n coordinates: ConfigCoordinates,\n credential: ConfigCredentialSelect,\n cron: ConfigCRON,\n custom: ConfigCustom,\n datePicker: ConfigDatePicker,\n deviceManager: ConfigDeviceManager,\n divider: ConfigStaticDivider,\n file: ConfigFile,\n fileSelector: ConfigFileSelector,\n func: ConfigFunc,\n header: ConfigStaticHeader,\n iframe: ConfigIFrame,\n iframeSendTo: ConfigIFrameSendTo,\n image: ConfigImageUpload,\n imageSendTo: ConfigImageSendTo,\n infoBox: ConfigInfoBox,\n instance: ConfigInstanceSelect,\n interface: ConfigInterface,\n ip: ConfigIP,\n jsonEditor: ConfigJsonEditor,\n language: ConfigLanguage,\n license: ConfigLicense,\n number: ConfigNumber,\n oauth2: ConfigOauth2,\n objectId: ConfigObjectId,\n password: ConfigPassword,\n pattern: ConfigPattern,\n port: ConfigPort,\n qrCode: ConfigQrCode,\n qrCodeSendTo: ConfigQrCodeSendTo,\n room: ConfigRoom,\n select: ConfigSelect,\n selectSendTo: ConfigSelectSendTo,\n // @deprecated Use \"sendTo\"\n sendto: ConfigSendTo,\n sendTo: ConfigSendTo,\n setState: ConfigSetState,\n slider: ConfigSlider,\n state: ConfigState,\n staticImage: ConfigStaticImage,\n staticInfo: ConfigStaticInfo,\n staticLink: ConfigStaticText,\n staticText: ConfigStaticText,\n table: ConfigTable,\n text: ConfigText,\n textSendTo: ConfigTextSendTo,\n timePicker: ConfigTimePicker,\n topic: ConfigTopic,\n uuid: ConfigUUID,\n user: ConfigUser,\n yamlEditor: ConfigYamlEditor,\n};\n\nconst styles: Record<string, any> = {\n fullWidth: {\n width: '100%',\n // height: '100%',\n },\n paper: {\n margin: 1,\n width: 'auto !important',\n overflowY: 'auto',\n paddingBottom: 1,\n // The height comes from the parent (tabs or the root container of the JSON config),\n // so the panel uses the whole available height and not some pre-calculated value.\n flex: '1 1 auto',\n // Allow the panel to be smaller than its content, so it can scroll itself\n minHeight: 0,\n },\n padding: {\n padding: '10px',\n },\n heading: {},\n primary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.mode === 'dark' ? 'inherit' : '#FFF',\n }),\n secondary: (theme: IobTheme): React.CSSProperties => ({\n backgroundColor: theme.palette.secondary.main,\n }),\n};\n\ninterface ConfigPanelProps extends ConfigGenericProps {\n schema: ConfigItemPanel;\n withIcons?: boolean;\n withoutSaveButtons?: boolean;\n}\ninterface ConfigPanelState extends ConfigGenericState {\n expanded?: boolean;\n}\n\nexport default class ConfigPanel extends ConfigGeneric<ConfigPanelProps, ConfigPanelState> {\n async componentDidMount(): Promise<void> {\n await super.componentDidMount();\n if (this.props.schema?.collapsable) {\n this.setState({\n expanded:\n (((window as any)._localStorage as Storage) || window.localStorage).getItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n ) === 'true',\n });\n }\n }\n\n renderItems(items: Record<string, any>, disabled: boolean): (JSX.Element | null)[] | null {\n return items\n ? Object.keys(items).map(attr => {\n if (this.props.oContext.multiEdit && items[attr].noMultiEdit) {\n return null;\n }\n\n // Do not create the component if it is not intended for the host, where the instance\n // runs. In this way, no default value will be written for it and no request will be sent by it\n if (!ConfigGeneric.isHostAllowed(items[attr], this.props.oContext.hostInfo)) {\n return null;\n }\n\n const type = items[attr].type || 'panel';\n let ItemComponent: typeof ConfigGeneric<ConfigGenericProps, any>;\n let socket: string | AdminConnection = 'Use this.props.oContext.socket!';\n if (type === 'custom') {\n // name\n // url\n if (items[attr].url) {\n ItemComponent = ConfigCustom;\n } else if (this.props.oContext.customs && this.props.oContext.customs[items[attr].component]) {\n ItemComponent = this.props.oContext.customs[items[attr].component];\n } else {\n console.error(`Cannot find custom component: ${items[attr].component}`);\n ItemComponent = ConfigGeneric;\n }\n socket = this.props.oContext.socket;\n } else if (type === 'component') {\n const subType = (items[attr] as ConfigItemComponent).subType;\n\n if (subType && this.props.customComponents?.[subType]) {\n ItemComponent = this.props.customComponents[subType];\n } else {\n return (\n <div key={`${attr}_${this.props.index ?? ''}`}>{`Component ${subType} not provided`}</div>\n );\n }\n } else if (type === 'panel') {\n ItemComponent = ConfigPanel;\n } else {\n ItemComponent = components[type] || ConfigGeneric;\n }\n\n return (\n <ItemComponent\n // @ts-expect-error Temporary work-around, till all custom components will not migrate to oContext\n socket={socket}\n globalData={this.props.globalData}\n oContext={this.props.oContext}\n key={`${attr}_${this.props.index ?? ''}`}\n index={this.props.index}\n changed={this.props.changed}\n arrayIndex={this.props.arrayIndex}\n expertMode={this.props.expertMode}\n commandRunning={this.props.commandRunning}\n style={styles.panel}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n onError={this.props.onError}\n onHiddenChanged={this.props.onHiddenChanged}\n onFilterLabelUpdate={this.props.onFilterLabelUpdate}\n onChange={this.props.onChange}\n disabled={disabled}\n customObj={this.props.customObj}\n custom={this.props.custom}\n schema={items[attr]}\n attr={attr}\n table={this.props.table}\n customComponents={this.props.customComponents}\n />\n );\n })\n : null;\n }\n\n render(): JSX.Element | null {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n this.updateCalculatedValues();\n\n if (!this.state.calculatedValues) {\n return null;\n }\n\n const items = this.props.schema.items;\n const schemaStyle = this.props.schema.style || {};\n\n if (this.state.calculatedValues.hidden) {\n if (schema.hideOnlyControl) {\n const item = (\n <Grid\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { marginBottom: 0, textAlign: 'left' /* marginRight: 8, */ },\n schemaStyle,\n this.props.oContext.themeType === 'dark' ? schema.darkStyle : undefined,\n )}\n />\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return null;\n }\n\n if (this.props.table) {\n return this.renderItems(items, this.state.calculatedValues.disabled) as any as JSX.Element;\n }\n\n if (this.props.custom) {\n return (\n <Grid\n key={`${this.props.attr}_${this.props.index}`}\n container\n style={styles.fullWidth}\n columnSpacing={2}\n rowSpacing={1}\n sx={schemaStyle}\n >\n {this.renderItems(items, this.state.calculatedValues.disabled)}\n </Grid>\n );\n }\n\n let content;\n if (schema.collapsable) {\n content = (\n <Accordion\n key={`${this.props.attr}_${this.props.index}`}\n style={styles.fullWidth}\n expanded={!!this.state.expanded}\n onChange={() => {\n (((window as any)._localStorage as Storage) || window.localStorage).setItem(\n `${this.props.oContext.adapterName}.${this.props.attr}`,\n this.state.expanded ? 'false' : 'true',\n );\n this.setState({ expanded: !this.state.expanded });\n }}\n >\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n schemaStyle,\n this.props.oContext.themeType && schema.darkStyle,\n schema.color === 'primary'\n ? styles.primary\n : schema.color === 'secondary' && styles.secondary,\n { width: '100%' },\n )}\n >\n <Typography style={styles.heading}>{this.getText(schema.label)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Grid\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={{ ...schemaStyle, width: '100%', padding: '10px' }}\n >\n {this.renderItems(items, this.state.calculatedValues.disabled)}\n </Grid>\n </AccordionDetails>\n </Accordion>\n );\n } else {\n const sx = Utils.getStyle(\n this.props.oContext.theme,\n this.props.style,\n schemaStyle,\n { width: '100%' },\n this.props.isParentTab && styles.paper,\n );\n\n content = (\n <Box\n component=\"div\"\n key={`${this.props.attr}_${this.props.index}`}\n className={this.props.className}\n sx={sx}\n >\n <Grid\n container\n columnSpacing={2}\n rowSpacing={1}\n sx={Utils.getStyle(\n this.props.oContext.theme,\n { width: '100%' },\n this.props.isParentTab && styles.padding,\n this.props.schema.innerStyle,\n )}\n >\n {this.renderItems(items, this.state.calculatedValues.disabled)}\n </Grid>\n </Box>\n );\n }\n\n if (!this.props.isParentTab) {\n const item = (\n <Grid\n title={this.getText(schema.tooltip)}\n size={{\n xs: schema.xs || undefined,\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n sx={{ marginBottom: 0, /* marginRight: 8, */ textAlign: 'left', ...schemaStyle }}\n >\n {content}\n </Grid>\n );\n\n if (schema.newLine) {\n return (\n <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>\n );\n }\n return item;\n }\n return content;\n }\n}\n"]}
|
|
@@ -7,16 +7,21 @@ const styles = {
|
|
|
7
7
|
tabs: {
|
|
8
8
|
height: '100%',
|
|
9
9
|
width: '100%',
|
|
10
|
+
// The tab bar keeps its own height, and the panel takes all the rest.
|
|
11
|
+
// Do not calculate the panel height with magic numbers, as the height of the tab bar
|
|
12
|
+
// depends on the theme, on the icons and on the font size.
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
},
|
|
16
|
+
tabsBar: {
|
|
17
|
+
flex: '0 0 auto',
|
|
10
18
|
},
|
|
11
19
|
panel: {
|
|
12
20
|
width: '100%',
|
|
13
21
|
display: 'block',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
panelWithoutIcons: {
|
|
19
|
-
height: 'calc(100% - 48px)',
|
|
22
|
+
flex: '1 1 auto',
|
|
23
|
+
// Allow the panel to be smaller than its content, so it can scroll itself
|
|
24
|
+
minHeight: 0,
|
|
20
25
|
},
|
|
21
26
|
};
|
|
22
27
|
export default class ConfigTabs extends ConfigGeneric {
|
|
@@ -288,6 +293,7 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
288
293
|
let tabs;
|
|
289
294
|
if (this.state.useMenu && elements.length > 2) {
|
|
290
295
|
tabs = (React.createElement(Toolbar, { style: {
|
|
296
|
+
...styles.tabsBar,
|
|
291
297
|
top: 2,
|
|
292
298
|
backgroundColor: this.props.oContext.themeType === 'dark' ? '#222' : '#DDD',
|
|
293
299
|
}, variant: "dense" },
|
|
@@ -305,7 +311,7 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
305
311
|
}))) : null));
|
|
306
312
|
}
|
|
307
313
|
else {
|
|
308
|
-
tabs = (React.createElement(Tabs, { variant: "scrollable", scrollButtons: "auto", style: this.props.schema.tabsStyle, value: this.state.tab, onChange: (_e, tab) => this.onMenuChange(tab) }, elements.map(el => {
|
|
314
|
+
tabs = (React.createElement(Tabs, { variant: "scrollable", scrollButtons: "auto", style: { ...styles.tabsBar, ...this.props.schema.tabsStyle }, value: this.state.tab, onChange: (_e, tab) => this.onMenuChange(tab) }, elements.map(el => {
|
|
309
315
|
const hasErrors = this.hasTabErrors(el.name);
|
|
310
316
|
const label = hasErrors ? (React.createElement(Box, { sx: { display: 'flex', alignItems: 'center', gap: 0.5 } },
|
|
311
317
|
el.label,
|
|
@@ -320,10 +326,7 @@ export default class ConfigTabs extends ConfigGeneric {
|
|
|
320
326
|
? { ...styles.tabs, minWidth: this.state.contentMinWidth }
|
|
321
327
|
: styles.tabs, ref: this.refDiv },
|
|
322
328
|
tabs,
|
|
323
|
-
React.createElement(ConfigPanel, { oContext: this.props.oContext, withoutSaveButtons: this.props.withoutSaveButtons, isParentTab: true, changed: this.props.changed, key: this.state.tab, expertMode: this.props.expertMode, index: 1001, arrayIndex: this.props.arrayIndex, globalData: this.props.globalData, commandRunning: this.props.commandRunning, style:
|
|
324
|
-
...styles.panel,
|
|
325
|
-
...(withIcons ? styles.panelWithIcons : styles.panelWithoutIcons),
|
|
326
|
-
}, common: this.props.common, alive: this.props.alive, themeName: this.props.themeName, data: this.props.data, originalData: this.props.originalData, onChange: this.props.onChange, onError: this.onTabError, customObj: this.props.customObj, custom: this.props.custom, schema: items[this.state.tab], table: this.props.table, withIcons: withIcons, customComponents: this.props.customComponents })));
|
|
329
|
+
React.createElement(ConfigPanel, { oContext: this.props.oContext, withoutSaveButtons: this.props.withoutSaveButtons, isParentTab: true, changed: this.props.changed, key: this.state.tab, expertMode: this.props.expertMode, index: 1001, arrayIndex: this.props.arrayIndex, globalData: this.props.globalData, commandRunning: this.props.commandRunning, style: styles.panel, common: this.props.common, alive: this.props.alive, themeName: this.props.themeName, data: this.props.data, originalData: this.props.originalData, onChange: this.props.onChange, onError: this.onTabError, customObj: this.props.customObj, custom: this.props.custom, schema: items[this.state.tab], table: this.props.table, withIcons: withIcons, customComponents: this.props.customComponents })));
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
332
|
//# sourceMappingURL=ConfigTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigTabs.js","sourceRoot":"src/","sources":["JsonConfigComponent/ConfigTabs.tsx"],"names":[],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CAAC,GAAG,EACnB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,KAAK,EAAE,IAAI,EACX,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACzC,KAAK,EAAE;oBACH,GAAG,MAAM,CAAC,KAAK;oBACf,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC;iBACpE,EACD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,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 * Width (px) reserved on the container while a tab switch is in progress, or undefined when\n * no switch is pending. Prevents the shrink-to-fit dialog from collapsing during the frame\n * where the freshly-mounted panel still renders no content. See pinWidthForTransition().\n */\n contentMinWidth?: number;\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 private pinTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private readonly refDiv: React.RefObject<HTMLDivElement | null>;\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 if (this.pinTimeout) {\n clearTimeout(this.pinTimeout);\n this.pinTimeout = null;\n }\n window.removeEventListener('hashchange', this.onHashTabsChanged, false);\n super.componentWillUnmount();\n }\n\n /**\n * Freeze the current container width for the duration of a tab switch. Switching tabs remounts\n * the panel (key={tab}), and a freshly-mounted ConfigPanel renders `null` for a frame or two\n * while it computes its calculated values. In that gap the widest content is just the tab bar,\n * so the shrink-to-fit dialog collapses and then grows back - the visible width \"jump\".\n *\n * We capture the width shown by the outgoing tab and apply it as a temporary minWidth floor, then\n * release it shortly after so genuine resizes (window/dialog) keep working normally afterwards.\n */\n private pinWidthForTransition(): void {\n const width = this.refDiv.current?.clientWidth;\n if (!width) {\n return;\n }\n if (this.pinTimeout) {\n clearTimeout(this.pinTimeout);\n }\n if (this.state.contentMinWidth !== width) {\n this.setState({ contentMinWidth: width });\n }\n this.pinTimeout = setTimeout(() => {\n this.pinTimeout = null;\n this.setState({ contentMinWidth: undefined });\n }, 500);\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.pinWidthForTransition();\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.pinWidthForTransition();\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 // Do not show the tab if it is not intended for the host, where the instance runs\n if (!ConfigGeneric.isHostAllowed(items[name], this.props.oContext.hostInfo)) {\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={\n this.state.contentMinWidth !== undefined\n ? { ...styles.tabs, minWidth: this.state.contentMinWidth }\n : styles.tabs\n }\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;IAChD,IAAI,EAAE;QACF,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,sEAAsE;QACtE,qFA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EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,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 // The tab bar keeps its own height, and the panel takes all the rest.\n // Do not calculate the panel height with magic numbers, as the height of the tab bar\n // depends on the theme, on the icons and on the font size.\n display: 'flex',\n flexDirection: 'column',\n },\n tabsBar: {\n flex: '0 0 auto',\n },\n panel: {\n width: '100%',\n display: 'block',\n flex: '1 1 auto',\n // Allow the panel to be smaller than its content, so it can scroll itself\n minHeight: 0,\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 * Width (px) reserved on the container while a tab switch is in progress, or undefined when\n * no switch is pending. Prevents the shrink-to-fit dialog from collapsing during the frame\n * where the freshly-mounted panel still renders no content. See pinWidthForTransition().\n */\n contentMinWidth?: number;\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 private pinTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private readonly refDiv: React.RefObject<HTMLDivElement | null>;\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 if (this.pinTimeout) {\n clearTimeout(this.pinTimeout);\n this.pinTimeout = null;\n }\n window.removeEventListener('hashchange', this.onHashTabsChanged, false);\n super.componentWillUnmount();\n }\n\n /**\n * Freeze the current container width for the duration of a tab switch. Switching tabs remounts\n * the panel (key={tab}), and a freshly-mounted ConfigPanel renders `null` for a frame or two\n * while it computes its calculated values. In that gap the widest content is just the tab bar,\n * so the shrink-to-fit dialog collapses and then grows back - the visible width \"jump\".\n *\n * We capture the width shown by the outgoing tab and apply it as a temporary minWidth floor, then\n * release it shortly after so genuine resizes (window/dialog) keep working normally afterwards.\n */\n private pinWidthForTransition(): void {\n const width = this.refDiv.current?.clientWidth;\n if (!width) {\n return;\n }\n if (this.pinTimeout) {\n clearTimeout(this.pinTimeout);\n }\n if (this.state.contentMinWidth !== width) {\n this.setState({ contentMinWidth: width });\n }\n this.pinTimeout = setTimeout(() => {\n this.pinTimeout = null;\n this.setState({ contentMinWidth: undefined });\n }, 500);\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.pinWidthForTransition();\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.pinWidthForTransition();\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 // Do not show the tab if it is not intended for the host, where the instance runs\n if (!ConfigGeneric.isHostAllowed(items[name], this.props.oContext.hostInfo)) {\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 ...styles.tabsBar,\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={{ ...styles.tabsBar, ...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={\n this.state.contentMinWidth !== undefined\n ? { ...styles.tabs, minWidth: this.state.contentMinWidth }\n : styles.tabs\n }\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={styles.panel}\n common={this.props.common}\n alive={this.props.alive}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={this.props.originalData}\n 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["JsonConfigComponent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAwB,IAAI,EAAiD,MAAM,0BAA0B,CAAC;AAKrH,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAErC,+FAA+F;AAC/F,iGAAiG;AACjG,gGAAgG;AAChG,2EAA2E;AAC3E,IA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,CAAC;IACL,CAAC,CAAC;IAEF,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7C,OAAO,oBAAC,cAAc,OAAG,CAAC;QAC9B,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YAChD,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,CACH,6BACI,KAAK,EAAE;gBACH,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBACpF,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;gBACnB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;aAC7B,IAEA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CACjC,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,mBAAmB,CAAC","sourcesContent":["import React, { Component, type JSX } from 'react';\n\nimport { LinearProgress } from '@mui/material';\n\nimport { type AdminConnection, I18n, type ThemeName, type ThemeType, type IobTheme } from '@iobroker/gui-components';\n\nimport type { BackEndCommand, ConfigItemPanel, ConfigItemTabs, JsonConfigContext, JsonConfigHostInfo } from '../types';\nimport type ConfigGeneric from './ConfigGeneric';\nimport { type DeviceManagerPropsProps, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigTabs from './ConfigTabs';\nimport ConfigPanel from './ConfigPanel';\n\nimport de from './i18n/de.json';\nimport en from './i18n/en.json';\nimport ru from './i18n/ru.json';\nimport pt from './i18n/pt.json';\nimport nl from './i18n/nl.json';\nimport fr from './i18n/fr.json';\nimport it from './i18n/it.json';\nimport es from './i18n/es.json';\nimport pl from './i18n/pl.json';\nimport uk from './i18n/uk.json';\nimport zhCn from './i18n/zh-cn.json';\n\n// Register the `jc_*` translations when this module is loaded, NOT when the component is first\n// constructed. `JsonConfig` renders its own toolbar (the export/import buttons) before it mounts\n// `JsonConfigComponent` as a child, so a constructor-based registration came too late and those\n// labels rendered as raw keys such as `jc_Import settings from JSON file`.\nI18n.extendTranslations({\n en,\n de,\n ru,\n pt,\n nl,\n fr,\n it,\n es,\n pl,\n uk,\n 'zh-cn': zhCn,\n});\n\n/** Timeout for the request of the docker information from the host */\nconst DOCKER_INFO_TIMEOUT_MS = 3_000;\n\nconst styles: Record<string, React.CSSProperties> = {\n root: {\n width: '100%',\n height: '100%',\n },\n};\n\ninterface JsonConfigComponentProps {\n socket: AdminConnection;\n themeName: ThemeName;\n themeType: ThemeType;\n adapterName: string;\n instance: number;\n isFloatComma: boolean;\n dateFormat: string;\n imagePrefix?: string;\n schema: ConfigItemTabs | ConfigItemPanel;\n common?: Record<string, any>;\n data: Record<string, any>;\n updateData?: number;\n onError: (error: boolean) => void;\n onChange?: (data: Record<string, any> | null, changed: boolean | undefined, saveConfig: boolean) => void;\n /** Backend request to refresh data */\n onBackEndCommand?: (command?: BackEndCommand) => void;\n custom?: boolean;\n onValueChange?: (attr: string, value: any, saveConfig: boolean) => void;\n embedded?: boolean;\n multiEdit?: boolean;\n instanceObj?: ioBroker.InstanceObject;\n customObj?: ioBroker.Object;\n customs?: Record<string, typeof ConfigGeneric>;\n DeviceManager?: React.FC<DeviceManagerPropsProps>;\n style?: React.CSSProperties;\n theme: IobTheme;\n expertMode?: boolean;\n withoutSaveButtons?: boolean;\n /** User can provide their own components for specific input fields */\n customComponents?: { [componentType: string]: typeof ConfigGeneric<ConfigGenericProps, any> };\n}\n\ninterface JsonConfigComponentState {\n originalData: string;\n changed: boolean;\n errors: Record<string, string>;\n systemConfig: ioBroker.SystemConfigCommon | null;\n hostInfo: JsonConfigHostInfo | null;\n updateData?: number;\n alive: boolean;\n commandRunning: boolean;\n schema: ConfigItemTabs | ConfigItemPanel;\n}\n\nexport class JsonConfigComponent extends Component<JsonConfigComponentProps, JsonConfigComponentState> {\n private readonly forceUpdateHandlers: Record<string, (data: any) => void>;\n private errorTimeout: ReturnType<typeof setTimeout> | null = null;\n private errorCached: Record<string, string> | null = null;\n private oContext: JsonConfigContext | undefined;\n private cachedObjects: Record<string, ioBroker.Object | null> = {};\n constructor(props: JsonConfigComponentProps) {\n super(props);\n\n this.state = {\n originalData: JSON.stringify(this.props.data),\n changed: false,\n errors: {},\n updateData: this.props.updateData || 0,\n systemConfig: null,\n hostInfo: null,\n alive: false,\n commandRunning: false,\n schema: JSON.parse(JSON.stringify(this.props.schema)),\n };\n\n this.forceUpdateHandlers = {};\n\n this.buildDependencies(this.state.schema);\n\n void this.readData().catch(error => console.error(`Cannot read data: ${error}`));\n }\n\n static getDerivedStateFromProps(\n props: JsonConfigComponentProps,\n state: JsonConfigComponentState,\n ): Partial<JsonConfigComponentState> | null {\n if (props.updateData !== state.updateData) {\n return {\n updateData: props.updateData,\n originalData: JSON.stringify(props.data),\n schema: JSON.parse(JSON.stringify(props.schema)),\n };\n }\n return null;\n }\n\n static async loadI18n(\n socket: AdminConnection,\n i18n: boolean | string | Record<string, Record<ioBroker.Languages, string>> | undefined,\n adapterName: string,\n ): Promise<string> {\n if (i18n === true || (i18n && typeof i18n === 'string')) {\n const lang = I18n.getLanguage();\n const path = typeof i18n === 'string' ? i18n : 'i18n';\n let exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}.json`);\n let fileName;\n if (exists) {\n fileName = `${path}/${lang}.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}/translations.json`);\n if (exists) {\n fileName = `${path}/${lang}/translations.json`;\n } else if (lang !== 'en') {\n // fallback to english\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en.json`);\n if (exists) {\n fileName = `${path}/en.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en/translations.json`);\n if (exists) {\n fileName = `${path}/en/translations.json`;\n }\n }\n }\n }\n\n if (fileName) {\n const jsonFile = await socket.readFile(`${adapterName}.admin`, fileName);\n let jsonStr: string;\n if (jsonFile.file !== undefined) {\n jsonStr = jsonFile.file;\n } else {\n // @ts-expect-error deprecated\n jsonStr = jsonFile;\n }\n\n try {\n const json = JSON.parse(jsonStr);\n // apply file to I18n\n I18n.extendTranslations(json, lang);\n } catch (e) {\n console.error(`Cannot parse language file \"${adapterName}.admin/${fileName}: ${e}`);\n return '';\n }\n return fileName;\n }\n console.warn(`Cannot find i18n for ${adapterName} / ${fileName}`);\n return '';\n }\n if (i18n && typeof i18n === 'object') {\n I18n.extendTranslations(i18n);\n return '';\n }\n return '';\n }\n\n onCommandRunning = (commandRunning: boolean): void => this.setState({ commandRunning });\n\n async readData(): Promise<void> {\n let systemConfig: ioBroker.SystemConfigObject | undefined;\n try {\n if (this.props.socket.getCompactSystemConfig) {\n systemConfig = await this.props.socket.getCompactSystemConfig();\n } else {\n systemConfig = ((await this.getCachedObject('system.config')) || undefined) as\n ioBroker.SystemConfigObject | undefined;\n }\n const state = await this.props.socket.getState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n );\n this.setState(\n {\n systemConfig: systemConfig?.common || ({} as ioBroker.SystemConfigCommon),\n hostInfo: await this.readHostInfo(),\n alive: !!state?.val,\n },\n () => {\n this.updateContext(true);\n if (!this.props.custom) {\n void this.props.socket.subscribeState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n this.onAlive,\n );\n }\n },\n );\n } catch (error) {\n console.error(`Cannot read system config: ${error}`);\n }\n }\n\n /**\n * Read the information about the host, on which the configured instance runs.\n *\n * The object `system.host.X` is used and not the message `getHostInfo`, because the object can be read\n * even if the host is not running. The result is used for the `os`/`notOs` attributes and for the\n * `_os`, `_arch` and `_host` variables in the JS functions.\n *\n * Only the docker state cannot be read from the object, so it will be requested from the running host,\n * but only if the configuration really uses it.\n *\n * @returns information about the host. The properties are empty if the host could not be read\n */\n async readHostInfo(): Promise<JsonConfigHostInfo> {\n const hostName: string | undefined =\n (this.props.common?.host as string | undefined) || this.props.instanceObj?.common?.host;\n\n const hostObj = hostName\n ? ((await this.getCachedObject(`system.host.${hostName}`)) as ioBroker.HostObject | null)\n : null;\n\n const hostInfo: JsonConfigHostInfo = {\n id: hostName || '',\n os: hostObj?.native?.os?.platform || '',\n osType: hostObj?.native?.os?.type || '',\n arch: hostObj?.native?.os?.arch || '',\n release: hostObj?.native?.os?.release || '',\n nodeVersion: hostObj?.native?.process?.versions?.node || '',\n controllerVersion: hostObj?.common?.installedVersion || '',\n };\n\n if (hostName && JsonConfigComponent.usesDocker(this.props.schema)) {\n try {\n // If the host is not running, the request would only run into the timeout\n const aliveState = await this.props.socket.getState(`system.host.${hostName}.alive`);\n if (aliveState?.val !== false) {\n const info = await this.props.socket.getHostInfoShort(hostName, false, DOCKER_INFO_TIMEOUT_MS);\n if (info) {\n // Older js-controllers do not deliver `dockerInformation`, but `Platform` is 'docker' then\n hostInfo.docker = info.dockerInformation?.isDocker ?? info.Platform === 'docker';\n if (info.dockerInformation?.isOfficial) {\n hostInfo.dockerVersion = info.dockerInformation.officialVersion;\n }\n }\n }\n } catch (e) {\n // The host does not answer or the user has no rights => the docker state stays unknown\n console.warn(`Cannot read the docker information of ${hostName}: ${e as Error}`);\n }\n }\n\n return hostInfo;\n }\n\n /**\n * Check if the configuration uses the docker state of the host.\n *\n * The docker state can only be requested from a running host, so this request will only be done if\n * the `docker` attribute or the `_host.docker` variable is really used in the configuration.\n *\n * @param schema the configuration schema\n * @returns true if the docker state must be read\n */\n static usesDocker(schema: ConfigItemTabs | ConfigItemPanel): boolean {\n const str = JSON.stringify(schema);\n return str.includes('\"docker\":') || str.includes('_host.docker');\n }\n\n onAlive = (_id: string, state?: ioBroker.State | null): void => {\n if (!!state?.val !== this.state.alive) {\n this.setState({ alive: !!state?.val });\n }\n };\n\n onChange = (\n attrOrData: string | Record<string, any> | undefined,\n value: any,\n cb?: () => void,\n saveConfig?: boolean,\n ): void => {\n if (this.props.onValueChange) {\n this.props.onValueChange(attrOrData as string, value, !!saveConfig);\n cb?.();\n } else if (attrOrData && this.props.onChange) {\n const newState: Partial<JsonConfigComponentState> = {\n changed: JSON.stringify(attrOrData) !== this.state.originalData,\n };\n\n this.setState(newState as JsonConfigComponentState, () => {\n this.props.onChange?.(attrOrData as Record<string, any>, !!newState.changed, !!saveConfig);\n cb?.();\n });\n } else if (saveConfig) {\n this.props.onChange?.(null, undefined, saveConfig);\n }\n };\n\n onError = (attr?: string, error?: string): void => {\n this.errorCached = this.errorCached || JSON.parse(JSON.stringify(this.state.errors));\n const errors = this.errorCached;\n if (errors && attr) {\n if (error) {\n errors[attr] = error;\n } else {\n delete errors[attr];\n }\n }\n\n if (this.errorTimeout) {\n clearTimeout(this.errorTimeout);\n this.errorTimeout = null;\n }\n if (JSON.stringify(errors) !== JSON.stringify(this.state.errors)) {\n this.errorTimeout = setTimeout(\n () =>\n this.setState({ errors: this.errorCached || {} }, () => {\n this.errorTimeout = null;\n this.errorCached = null;\n this.props.onError(!!Object.keys(this.state.errors).length);\n }),\n 50,\n );\n } else {\n this.errorCached = null;\n }\n };\n\n flatten(schema: Record<string, any>, _list?: Record<string, any>): Record<string, any> {\n _list = _list || {};\n if (schema.items) {\n Object.keys(schema.items).forEach(attr => {\n _list[attr] = schema.items[attr];\n this.flatten(schema.items[attr], _list);\n });\n }\n\n return _list;\n }\n\n buildDependencies(schema: ConfigItemTabs | ConfigItemPanel): void {\n const attrs = this.flatten(schema as Record<string, any>);\n Object.keys(attrs).forEach(attr => {\n if (attrs[attr].confirm?.alsoDependsOn) {\n attrs[attr].confirm?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].confirmDependsOn = attrs[dep].confirmDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n if (depObj.confirm) {\n depObj.confirm.cancel = 'Undo';\n }\n\n attrs[dep].confirmDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].onChange?.alsoDependsOn) {\n attrs[attr].onChange?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].onChangeDependsOn = attrs[dep].onChangeDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].onChangeDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].hidden?.alsoDependsOn) {\n attrs[attr].hidden?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].hiddenDependsOn = attrs[dep].hiddenDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].hiddenDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].label?.alsoDependsOn) {\n attrs[attr].label?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].labelDependsOn = attrs[dep].labelDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].labelDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].help?.alsoDependsOn) {\n attrs[attr].help?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].helpDependsOn = attrs[dep].helpDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].helpDependsOn.push(depObj);\n }\n });\n }\n });\n }\n\n getCachedObject = async (id: string): Promise<ioBroker.Object | null> => {\n if (this.cachedObjects[id] !== undefined) {\n return this.cachedObjects[id];\n }\n try {\n this.cachedObjects[id] = (await this.props.socket.getObject(id)) ?? null;\n } catch (e) {\n console.error(e);\n this.cachedObjects[id] = null;\n }\n return this.cachedObjects[id];\n };\n\n updateContext(forceUpdate?: boolean): void {\n this.oContext = {\n DeviceManager: this.props.DeviceManager,\n adapterName: this.props.adapterName,\n changeLanguage: this.changeLanguage,\n common: this.props.common,\n customs: this.props.customs,\n dateFormat: this.props.dateFormat,\n embedded: this.props.embedded,\n forceUpdate: this.forceAttrUpdate,\n imagePrefix: this.props.imagePrefix,\n instance: this.props.instance,\n instanceObj: this.props.instanceObj,\n isFloatComma: this.props.isFloatComma,\n multiEdit: this.props.multiEdit,\n onBackEndCommand: this.props.onBackEndCommand,\n onCommandRunning: this.onCommandRunning,\n onValueChange: this.props.onValueChange,\n registerOnForceUpdate: this.registerOnForceUpdate,\n socket: this.props.socket,\n systemConfig: this.state.systemConfig,\n theme: this.props.theme,\n // could be changed dynamically\n themeType: this.props.themeType,\n _themeName: this.props.themeName,\n updateData: this.state.updateData,\n getCachedObject: this.getCachedObject,\n hostInfo: this.state.hostInfo || undefined,\n } as JsonConfigContext;\n\n if (forceUpdate) {\n this.forceUpdate();\n }\n }\n\n renderItem(item: ConfigItemTabs | ConfigItemPanel): JSX.Element | null {\n if (!this.oContext) {\n return null;\n }\n if (item.type === 'tabs') {\n return (\n <ConfigTabs\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n expertMode={this.props.expertMode}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n if (\n item.type === 'panel' ||\n // @ts-expect-error type could be empty\n !item.type\n ) {\n return (\n <ConfigPanel\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n expertMode={this.props.expertMode}\n index={1000}\n isParentTab={!this.props.embedded && !this.props.withoutSaveButtons}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n console.error(`Unknown item type in root: ${JSON.stringify(item)}`);\n\n return null;\n }\n\n changeLanguage = (): void => {\n this.forceUpdate();\n };\n\n forceAttrUpdate = (attr: string | string[], data: any): void => {\n if (Array.isArray(attr)) {\n attr.forEach(a => this.forceUpdateHandlers[a] && this.forceUpdateHandlers[a](data));\n } else if (this.forceUpdateHandlers[attr]) {\n this.forceUpdateHandlers[attr](data);\n }\n };\n\n registerOnForceUpdate = (attr: string, cb?: ((data: any) => void) | null): void => {\n if (cb) {\n this.forceUpdateHandlers[attr] = cb;\n } else if (this.forceUpdateHandlers[attr]) {\n delete this.forceUpdateHandlers[attr];\n }\n };\n\n render(): JSX.Element {\n if (!this.state.systemConfig || !this.oContext) {\n return <LinearProgress />;\n }\n\n if (this.oContext._themeName !== this.props.themeName) {\n this.oContext._themeName = this.props.themeName;\n setTimeout(() => this.updateContext(true), 0);\n }\n\n return (\n <div\n style={{\n ...(!this.props.embedded || this.props.withoutSaveButtons ? styles.root : undefined),\n ...this.props.style,\n ...this.state.schema.style,\n }}\n >\n {this.renderItem(this.state.schema)}\n </div>\n );\n }\n}\n\nexport default JsonConfigComponent;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["JsonConfigComponent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAwB,IAAI,EAAiD,MAAM,0BAA0B,CAAC;AAKrH,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAErC,+FAA+F;AAC/F,iGAAiG;AACjG,gGAAgG;AAChG,2EAA2E;AAC3E,IAAI,CAAC,kBAAkB,CAAC;IACpB,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EA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AAC,CAAC;IAEF,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7C,OAAO,oBAAC,cAAc,OAAG,CAAC;QAC9B,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YAChD,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,CACH,6BACI,KAAK,EAAE;gBACH,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBACpF,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;gBACnB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;aAC7B,IAEA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CACjC,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,mBAAmB,CAAC","sourcesContent":["import React, { Component, type JSX } from 'react';\n\nimport { LinearProgress } from '@mui/material';\n\nimport { type AdminConnection, I18n, type ThemeName, type ThemeType, type IobTheme } from '@iobroker/gui-components';\n\nimport type { BackEndCommand, ConfigItemPanel, ConfigItemTabs, JsonConfigContext, JsonConfigHostInfo } from '../types';\nimport type ConfigGeneric from './ConfigGeneric';\nimport { type DeviceManagerPropsProps, type ConfigGenericProps } from './ConfigGeneric';\nimport ConfigTabs from './ConfigTabs';\nimport ConfigPanel from './ConfigPanel';\n\nimport de from './i18n/de.json';\nimport en from './i18n/en.json';\nimport ru from './i18n/ru.json';\nimport pt from './i18n/pt.json';\nimport nl from './i18n/nl.json';\nimport fr from './i18n/fr.json';\nimport it from './i18n/it.json';\nimport es from './i18n/es.json';\nimport pl from './i18n/pl.json';\nimport uk from './i18n/uk.json';\nimport zhCn from './i18n/zh-cn.json';\n\n// Register the `jc_*` translations when this module is loaded, NOT when the component is first\n// constructed. `JsonConfig` renders its own toolbar (the export/import buttons) before it mounts\n// `JsonConfigComponent` as a child, so a constructor-based registration came too late and those\n// labels rendered as raw keys such as `jc_Import settings from JSON file`.\nI18n.extendTranslations({\n en,\n de,\n ru,\n pt,\n nl,\n fr,\n it,\n es,\n pl,\n uk,\n 'zh-cn': zhCn,\n});\n\n/** Timeout for the request of the docker information from the host */\nconst DOCKER_INFO_TIMEOUT_MS = 3_000;\n\nconst styles: Record<string, React.CSSProperties> = {\n root: {\n width: '100%',\n height: '100%',\n // The root panel or the tabs must use the whole available height\n display: 'flex',\n flexDirection: 'column',\n },\n};\n\ninterface JsonConfigComponentProps {\n socket: AdminConnection;\n themeName: ThemeName;\n themeType: ThemeType;\n adapterName: string;\n instance: number;\n isFloatComma: boolean;\n dateFormat: string;\n imagePrefix?: string;\n schema: ConfigItemTabs | ConfigItemPanel;\n common?: Record<string, any>;\n data: Record<string, any>;\n updateData?: number;\n onError: (error: boolean) => void;\n onChange?: (data: Record<string, any> | null, changed: boolean | undefined, saveConfig: boolean) => void;\n /** Backend request to refresh data */\n onBackEndCommand?: (command?: BackEndCommand) => void;\n custom?: boolean;\n onValueChange?: (attr: string, value: any, saveConfig: boolean) => void;\n embedded?: boolean;\n multiEdit?: boolean;\n instanceObj?: ioBroker.InstanceObject;\n customObj?: ioBroker.Object;\n customs?: Record<string, typeof ConfigGeneric>;\n DeviceManager?: React.FC<DeviceManagerPropsProps>;\n style?: React.CSSProperties;\n theme: IobTheme;\n expertMode?: boolean;\n withoutSaveButtons?: boolean;\n /** User can provide their own components for specific input fields */\n customComponents?: { [componentType: string]: typeof ConfigGeneric<ConfigGenericProps, any> };\n}\n\ninterface JsonConfigComponentState {\n originalData: string;\n changed: boolean;\n errors: Record<string, string>;\n systemConfig: ioBroker.SystemConfigCommon | null;\n hostInfo: JsonConfigHostInfo | null;\n updateData?: number;\n alive: boolean;\n commandRunning: boolean;\n schema: ConfigItemTabs | ConfigItemPanel;\n}\n\nexport class JsonConfigComponent extends Component<JsonConfigComponentProps, JsonConfigComponentState> {\n private readonly forceUpdateHandlers: Record<string, (data: any) => void>;\n private errorTimeout: ReturnType<typeof setTimeout> | null = null;\n private errorCached: Record<string, string> | null = null;\n private oContext: JsonConfigContext | undefined;\n private cachedObjects: Record<string, ioBroker.Object | null> = {};\n constructor(props: JsonConfigComponentProps) {\n super(props);\n\n this.state = {\n originalData: JSON.stringify(this.props.data),\n changed: false,\n errors: {},\n updateData: this.props.updateData || 0,\n systemConfig: null,\n hostInfo: null,\n alive: false,\n commandRunning: false,\n schema: JSON.parse(JSON.stringify(this.props.schema)),\n };\n\n this.forceUpdateHandlers = {};\n\n this.buildDependencies(this.state.schema);\n\n void this.readData().catch(error => console.error(`Cannot read data: ${error}`));\n }\n\n static getDerivedStateFromProps(\n props: JsonConfigComponentProps,\n state: JsonConfigComponentState,\n ): Partial<JsonConfigComponentState> | null {\n if (props.updateData !== state.updateData) {\n return {\n updateData: props.updateData,\n originalData: JSON.stringify(props.data),\n schema: JSON.parse(JSON.stringify(props.schema)),\n };\n }\n return null;\n }\n\n static async loadI18n(\n socket: AdminConnection,\n i18n: boolean | string | Record<string, Record<ioBroker.Languages, string>> | undefined,\n adapterName: string,\n ): Promise<string> {\n if (i18n === true || (i18n && typeof i18n === 'string')) {\n const lang = I18n.getLanguage();\n const path = typeof i18n === 'string' ? i18n : 'i18n';\n let exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}.json`);\n let fileName;\n if (exists) {\n fileName = `${path}/${lang}.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/${lang}/translations.json`);\n if (exists) {\n fileName = `${path}/${lang}/translations.json`;\n } else if (lang !== 'en') {\n // fallback to english\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en.json`);\n if (exists) {\n fileName = `${path}/en.json`;\n } else {\n exists = await socket.fileExists(`${adapterName}.admin`, `${path}/en/translations.json`);\n if (exists) {\n fileName = `${path}/en/translations.json`;\n }\n }\n }\n }\n\n if (fileName) {\n const jsonFile = await socket.readFile(`${adapterName}.admin`, fileName);\n let jsonStr: string;\n if (jsonFile.file !== undefined) {\n jsonStr = jsonFile.file;\n } else {\n // @ts-expect-error deprecated\n jsonStr = jsonFile;\n }\n\n try {\n const json = JSON.parse(jsonStr);\n // apply file to I18n\n I18n.extendTranslations(json, lang);\n } catch (e) {\n console.error(`Cannot parse language file \"${adapterName}.admin/${fileName}: ${e}`);\n return '';\n }\n return fileName;\n }\n console.warn(`Cannot find i18n for ${adapterName} / ${fileName}`);\n return '';\n }\n if (i18n && typeof i18n === 'object') {\n I18n.extendTranslations(i18n);\n return '';\n }\n return '';\n }\n\n onCommandRunning = (commandRunning: boolean): void => this.setState({ commandRunning });\n\n async readData(): Promise<void> {\n let systemConfig: ioBroker.SystemConfigObject | undefined;\n try {\n if (this.props.socket.getCompactSystemConfig) {\n systemConfig = await this.props.socket.getCompactSystemConfig();\n } else {\n systemConfig = ((await this.getCachedObject('system.config')) || undefined) as\n ioBroker.SystemConfigObject | undefined;\n }\n const state = await this.props.socket.getState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n );\n this.setState(\n {\n systemConfig: systemConfig?.common || ({} as ioBroker.SystemConfigCommon),\n hostInfo: await this.readHostInfo(),\n alive: !!state?.val,\n },\n () => {\n this.updateContext(true);\n if (!this.props.custom) {\n void this.props.socket.subscribeState(\n `system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,\n this.onAlive,\n );\n }\n },\n );\n } catch (error) {\n console.error(`Cannot read system config: ${error}`);\n }\n }\n\n /**\n * Read the information about the host, on which the configured instance runs.\n *\n * The object `system.host.X` is used and not the message `getHostInfo`, because the object can be read\n * even if the host is not running. The result is used for the `os`/`notOs` attributes and for the\n * `_os`, `_arch` and `_host` variables in the JS functions.\n *\n * Only the docker state cannot be read from the object, so it will be requested from the running host,\n * but only if the configuration really uses it.\n *\n * @returns information about the host. The properties are empty if the host could not be read\n */\n async readHostInfo(): Promise<JsonConfigHostInfo> {\n const hostName: string | undefined =\n (this.props.common?.host as string | undefined) || this.props.instanceObj?.common?.host;\n\n const hostObj = hostName\n ? ((await this.getCachedObject(`system.host.${hostName}`)) as ioBroker.HostObject | null)\n : null;\n\n const hostInfo: JsonConfigHostInfo = {\n id: hostName || '',\n os: hostObj?.native?.os?.platform || '',\n osType: hostObj?.native?.os?.type || '',\n arch: hostObj?.native?.os?.arch || '',\n release: hostObj?.native?.os?.release || '',\n nodeVersion: hostObj?.native?.process?.versions?.node || '',\n controllerVersion: hostObj?.common?.installedVersion || '',\n };\n\n if (hostName && JsonConfigComponent.usesDocker(this.props.schema)) {\n try {\n // If the host is not running, the request would only run into the timeout\n const aliveState = await this.props.socket.getState(`system.host.${hostName}.alive`);\n if (aliveState?.val !== false) {\n const info = await this.props.socket.getHostInfoShort(hostName, false, DOCKER_INFO_TIMEOUT_MS);\n if (info) {\n // Older js-controllers do not deliver `dockerInformation`, but `Platform` is 'docker' then\n hostInfo.docker = info.dockerInformation?.isDocker ?? info.Platform === 'docker';\n if (info.dockerInformation?.isOfficial) {\n hostInfo.dockerVersion = info.dockerInformation.officialVersion;\n }\n }\n }\n } catch (e) {\n // The host does not answer or the user has no rights => the docker state stays unknown\n console.warn(`Cannot read the docker information of ${hostName}: ${e as Error}`);\n }\n }\n\n return hostInfo;\n }\n\n /**\n * Check if the configuration uses the docker state of the host.\n *\n * The docker state can only be requested from a running host, so this request will only be done if\n * the `docker` attribute or the `_host.docker` variable is really used in the configuration.\n *\n * @param schema the configuration schema\n * @returns true if the docker state must be read\n */\n static usesDocker(schema: ConfigItemTabs | ConfigItemPanel): boolean {\n const str = JSON.stringify(schema);\n return str.includes('\"docker\":') || str.includes('_host.docker');\n }\n\n onAlive = (_id: string, state?: ioBroker.State | null): void => {\n if (!!state?.val !== this.state.alive) {\n this.setState({ alive: !!state?.val });\n }\n };\n\n onChange = (\n attrOrData: string | Record<string, any> | undefined,\n value: any,\n cb?: () => void,\n saveConfig?: boolean,\n ): void => {\n if (this.props.onValueChange) {\n this.props.onValueChange(attrOrData as string, value, !!saveConfig);\n cb?.();\n } else if (attrOrData && this.props.onChange) {\n const newState: Partial<JsonConfigComponentState> = {\n changed: JSON.stringify(attrOrData) !== this.state.originalData,\n };\n\n this.setState(newState as JsonConfigComponentState, () => {\n this.props.onChange?.(attrOrData as Record<string, any>, !!newState.changed, !!saveConfig);\n cb?.();\n });\n } else if (saveConfig) {\n this.props.onChange?.(null, undefined, saveConfig);\n }\n };\n\n onError = (attr?: string, error?: string): void => {\n this.errorCached = this.errorCached || JSON.parse(JSON.stringify(this.state.errors));\n const errors = this.errorCached;\n if (errors && attr) {\n if (error) {\n errors[attr] = error;\n } else {\n delete errors[attr];\n }\n }\n\n if (this.errorTimeout) {\n clearTimeout(this.errorTimeout);\n this.errorTimeout = null;\n }\n if (JSON.stringify(errors) !== JSON.stringify(this.state.errors)) {\n this.errorTimeout = setTimeout(\n () =>\n this.setState({ errors: this.errorCached || {} }, () => {\n this.errorTimeout = null;\n this.errorCached = null;\n this.props.onError(!!Object.keys(this.state.errors).length);\n }),\n 50,\n );\n } else {\n this.errorCached = null;\n }\n };\n\n flatten(schema: Record<string, any>, _list?: Record<string, any>): Record<string, any> {\n _list = _list || {};\n if (schema.items) {\n Object.keys(schema.items).forEach(attr => {\n _list[attr] = schema.items[attr];\n this.flatten(schema.items[attr], _list);\n });\n }\n\n return _list;\n }\n\n buildDependencies(schema: ConfigItemTabs | ConfigItemPanel): void {\n const attrs = this.flatten(schema as Record<string, any>);\n Object.keys(attrs).forEach(attr => {\n if (attrs[attr].confirm?.alsoDependsOn) {\n attrs[attr].confirm?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].confirmDependsOn = attrs[dep].confirmDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n if (depObj.confirm) {\n depObj.confirm.cancel = 'Undo';\n }\n\n attrs[dep].confirmDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].onChange?.alsoDependsOn) {\n attrs[attr].onChange?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].onChangeDependsOn = attrs[dep].onChangeDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].onChangeDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].hidden?.alsoDependsOn) {\n attrs[attr].hidden?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].hiddenDependsOn = attrs[dep].hiddenDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].hiddenDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].label?.alsoDependsOn) {\n attrs[attr].label?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].labelDependsOn = attrs[dep].labelDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].labelDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].help?.alsoDependsOn) {\n attrs[attr].help?.alsoDependsOn.forEach((dep: string) => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(\n `[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`,\n );\n }\n } else {\n attrs[dep].helpDependsOn = attrs[dep].helpDependsOn || [];\n\n const depObj = { ...attrs[attr], attr };\n\n attrs[dep].helpDependsOn.push(depObj);\n }\n });\n }\n });\n }\n\n getCachedObject = async (id: string): Promise<ioBroker.Object | null> => {\n if (this.cachedObjects[id] !== undefined) {\n return this.cachedObjects[id];\n }\n try {\n this.cachedObjects[id] = (await this.props.socket.getObject(id)) ?? null;\n } catch (e) {\n console.error(e);\n this.cachedObjects[id] = null;\n }\n return this.cachedObjects[id];\n };\n\n updateContext(forceUpdate?: boolean): void {\n this.oContext = {\n DeviceManager: this.props.DeviceManager,\n adapterName: this.props.adapterName,\n changeLanguage: this.changeLanguage,\n common: this.props.common,\n customs: this.props.customs,\n dateFormat: this.props.dateFormat,\n embedded: this.props.embedded,\n forceUpdate: this.forceAttrUpdate,\n imagePrefix: this.props.imagePrefix,\n instance: this.props.instance,\n instanceObj: this.props.instanceObj,\n isFloatComma: this.props.isFloatComma,\n multiEdit: this.props.multiEdit,\n onBackEndCommand: this.props.onBackEndCommand,\n onCommandRunning: this.onCommandRunning,\n onValueChange: this.props.onValueChange,\n registerOnForceUpdate: this.registerOnForceUpdate,\n socket: this.props.socket,\n systemConfig: this.state.systemConfig,\n theme: this.props.theme,\n // could be changed dynamically\n themeType: this.props.themeType,\n _themeName: this.props.themeName,\n updateData: this.state.updateData,\n getCachedObject: this.getCachedObject,\n hostInfo: this.state.hostInfo || undefined,\n } as JsonConfigContext;\n\n if (forceUpdate) {\n this.forceUpdate();\n }\n }\n\n renderItem(item: ConfigItemTabs | ConfigItemPanel): JSX.Element | null {\n if (!this.oContext) {\n return null;\n }\n if (item.type === 'tabs') {\n return (\n <ConfigTabs\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n expertMode={this.props.expertMode}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n if (\n item.type === 'panel' ||\n // @ts-expect-error type could be empty\n !item.type\n ) {\n return (\n <ConfigPanel\n withoutSaveButtons={this.props.withoutSaveButtons}\n oContext={this.oContext}\n alive={this.state.alive}\n changed={this.state.changed}\n commandRunning={this.state.commandRunning}\n common={this.props.common}\n custom={this.props.custom}\n customObj={this.props.customObj}\n data={this.props.data}\n expertMode={this.props.expertMode}\n index={1000}\n isParentTab={!this.props.embedded && !this.props.withoutSaveButtons}\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n originalData={JSON.parse(this.state.originalData)}\n root\n schema={item}\n themeName={this.props.themeName}\n customComponents={this.props.customComponents}\n />\n );\n }\n console.error(`Unknown item type in root: ${JSON.stringify(item)}`);\n\n return null;\n }\n\n changeLanguage = (): void => {\n this.forceUpdate();\n };\n\n forceAttrUpdate = (attr: string | string[], data: any): void => {\n if (Array.isArray(attr)) {\n attr.forEach(a => this.forceUpdateHandlers[a] && this.forceUpdateHandlers[a](data));\n } else if (this.forceUpdateHandlers[attr]) {\n this.forceUpdateHandlers[attr](data);\n }\n };\n\n registerOnForceUpdate = (attr: string, cb?: ((data: any) => void) | null): void => {\n if (cb) {\n this.forceUpdateHandlers[attr] = cb;\n } else if (this.forceUpdateHandlers[attr]) {\n delete this.forceUpdateHandlers[attr];\n }\n };\n\n render(): JSX.Element {\n if (!this.state.systemConfig || !this.oContext) {\n return <LinearProgress />;\n }\n\n if (this.oContext._themeName !== this.props.themeName) {\n this.oContext._themeName = this.props.themeName;\n setTimeout(() => this.updateContext(true), 0);\n }\n\n return (\n <div\n style={{\n ...(!this.props.embedded || this.props.withoutSaveButtons ? styles.root : undefined),\n ...this.props.style,\n ...this.state.schema.style,\n }}\n >\n {this.renderItem(this.state.schema)}\n </div>\n );\n }\n}\n\nexport default JsonConfigComponent;\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": "9.0.
|
|
4
|
+
"version": "9.0.23",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
7
7
|
"email": "dogafox@gmail.com"
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@emotion/react": "^11.14.0",
|
|
39
39
|
"@emotion/styled": "^11.14.1",
|
|
40
|
-
"@iobroker/gui-components": "^10.
|
|
41
|
-
"@module-federation/runtime": "^2.
|
|
40
|
+
"@iobroker/gui-components": "^10.2.0",
|
|
41
|
+
"@module-federation/runtime": "^2.9.0",
|
|
42
42
|
"@mui/icons-material": "^9.3.1",
|
|
43
43
|
"@mui/material": "^9.3.1",
|
|
44
|
-
"@mui/x-date-pickers": "^9.
|
|
44
|
+
"@mui/x-date-pickers": "^9.12.0",
|
|
45
45
|
"crypto-js": "^4.2.0",
|
|
46
46
|
"json5": "^2.2.3",
|
|
47
47
|
"react": "^19.2.8",
|
|
48
48
|
"react-ace": "^15.0.0",
|
|
49
49
|
"react-dom": "^19.2.8",
|
|
50
|
-
"react-dropzone": "^20.1.
|
|
50
|
+
"react-dropzone": "^20.1.1",
|
|
51
51
|
"react-qr-code": "^2.2.0",
|
|
52
52
|
"yaml": "^2.9.0"
|
|
53
53
|
},
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"@iobroker/eslint-config": "^2.3.4",
|
|
59
59
|
"@iobroker/types": "^7.2.2",
|
|
60
60
|
"@types/crypto-js": "^4.2.2",
|
|
61
|
-
"@types/node": "^26.
|
|
61
|
+
"@types/node": "^26.4.0",
|
|
62
62
|
"@types/react": "^19.2.18",
|
|
63
63
|
"@types/react-color": "^3.0.13",
|
|
64
|
-
"@types/react-dom": "^19.2.
|
|
64
|
+
"@types/react-dom": "^19.2.5",
|
|
65
65
|
"ajv": "^8.20.0",
|
|
66
66
|
"date-fns": "^4.4.0",
|
|
67
67
|
"react-color": "^2.19.3",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"react": "^19.2.8",
|
|
73
73
|
"react-dom": "^19.2.8",
|
|
74
74
|
"@types/react": "^19.2.18",
|
|
75
|
-
"@types/react-dom": "^19.2.
|
|
75
|
+
"@types/react-dom": "^19.2.5"
|
|
76
76
|
},
|
|
77
77
|
"files": [
|
|
78
78
|
"build/",
|