@iobroker/json-config 7.7.2 → 7.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +15 -3
  2. package/build/JsonConfigComponent/ChipInput.d.ts +2 -2
  3. package/build/JsonConfigComponent/ChipInput.js +5 -8
  4. package/build/JsonConfigComponent/ChipInput.js.map +1 -1
  5. package/build/JsonConfigComponent/ConfigAccordion.d.ts +5 -0
  6. package/build/JsonConfigComponent/ConfigAccordion.js +86 -6
  7. package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -1
  8. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +4 -1
  9. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +25 -9
  10. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
  11. package/build/JsonConfigComponent/ConfigCheckDocker.d.ts +16 -0
  12. package/build/JsonConfigComponent/ConfigCheckDocker.js +52 -0
  13. package/build/JsonConfigComponent/ConfigCheckDocker.js.map +1 -0
  14. package/build/JsonConfigComponent/ConfigGeneric.js +5 -2
  15. package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  16. package/build/JsonConfigComponent/ConfigJsonEditor.js +10 -2
  17. package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
  18. package/build/JsonConfigComponent/ConfigNumber.js +20 -3
  19. package/build/JsonConfigComponent/ConfigNumber.js.map +1 -1
  20. package/build/JsonConfigComponent/ConfigPanel.js +2 -0
  21. package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
  22. package/build/JsonConfigComponent/ConfigPort.js +47 -8
  23. package/build/JsonConfigComponent/ConfigPort.js.map +1 -1
  24. package/build/JsonConfigComponent/ConfigSelectSendTo.js +1 -1
  25. package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
  26. package/build/JsonConfigComponent/ConfigState.js +1 -1
  27. package/build/JsonConfigComponent/ConfigState.js.map +1 -1
  28. package/build/JsonConfigComponent/ConfigTable.d.ts +5 -0
  29. package/build/JsonConfigComponent/ConfigTable.js +71 -7
  30. package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
  31. package/build/JsonConfigComponent/ConfigTabs.d.ts +3 -0
  32. package/build/JsonConfigComponent/ConfigTabs.js +42 -7
  33. package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
  34. package/build/JsonConfigComponent/wrapper/Components/CustomModal.js +4 -2
  35. package/build/JsonConfigComponent/wrapper/Components/CustomModal.js.map +1 -1
  36. package/build/JsonConfigComponent/wrapper/Components/Editor.d.ts +1 -1
  37. package/build/JsonConfigComponent/wrapper/Components/Editor.js +1 -1
  38. package/build/JsonConfigComponent/wrapper/Components/Editor.js.map +1 -1
  39. package/build/types.d.ts +15 -5
  40. package/package.json +3 -3
package/README.md CHANGED
@@ -137,6 +137,7 @@ You can install it via GitHub icon in admin by entering `iobroker.jsonconfig-dem
137
137
  - [**`certificateCollection`:**](#certificatecollection) Selects a collection for Let's Encrypt certificates
138
138
  - [**`certificates`:**](#certificates) Universal type for managing different certificate types (from Admin 6.4.0)
139
139
  - [**`checkbox`:**](#checkbox) Checkbox for boolean values
140
+ - [**`checkDocker`:**](#checkdocker) Special component to check if the docker available and if yes, you can activate a checkbox (from Admin 7.8.0)
140
141
  - [**`checkLicense`:**](#checklicense) Very special component to check the license online
141
142
  - [**`chips`:**](#chips) User can enter words that are added to an array
142
143
  - [**`color`:**](#color) Color picker
@@ -756,6 +757,7 @@ Button to open a JSON(5) editor. JSON5 is supported from admin version 5.7.3
756
757
  | `allowEmpty` | if true, the JSON will be validated only if the value is not empty |
757
758
  | `json5` | if JSON5 format allowed (From 7.5.3) |
758
759
  | `doNotApplyWithError` | Do not allow to save the value if error in JSON or JSON5 (From 7.5.3) |
760
+ | `readOnly` | Open the editor in read-only mode - editor can be opened but content cannot be modified |
759
761
 
760
762
  ### `language`
761
763
 
@@ -1085,7 +1087,7 @@ Determines current location and used `system.config` coordinates if not possible
1085
1087
 
1086
1088
  ### `interface`
1087
1089
 
1088
- Selects the interface of the host, where the instance runs
1090
+ Select the interface of the host, where the instance runs
1089
1091
 
1090
1092
  | Property | Description |
1091
1093
  |------------------|----------------------------------------------------------------|
@@ -1104,6 +1106,16 @@ shows the license information if not already accepted. One of attributes `texts`
1104
1106
  | `agreeText` | Text of the agreed button |
1105
1107
  | `checkBox` | If defined, the checkbox with the given name will be shown. If checked, the agreed button will be enabled. |
1106
1108
 
1109
+ ### `checkDocker`
1110
+ - (admin >= 7.7.2) initial implementation
1111
+
1112
+ Special component to check if Docker is installed and running.
1113
+ If docker is installed, a checkbox will be shown to allow the usage of docker.
1114
+
1115
+ | Property | Description |
1116
+ |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
1117
+ | `hideVersion` | If the information about docker version or error should be hidden (e.g. if used more than one such element on the page the error or version will be shown once |
1118
+
1107
1119
  ### `checkLicense`
1108
1120
 
1109
1121
  Very special component to check the license online. It's required exactly `license` and `useLicenseManager` properties in native.
@@ -1127,8 +1139,8 @@ Special input for ports. It checks automatically if port is used by other instan
1127
1139
 
1128
1140
  ### `state`
1129
1141
 
1130
- (admin >= 7.1.0) Show control or information from the state
1131
- (admin >= 7.6.4) attributes `showEnterButton` and `setOnEnterKey`
1142
+ - (admin >= 7.1.0) Show control or information from the state
1143
+ - (admin >= 7.6.4) attributes `showEnterButton` and `setOnEnterKey`
1132
1144
 
1133
1145
  | Property | Description |
1134
1146
  |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -95,7 +95,7 @@ interface ChipInputState {
95
95
  prevPropsValue: string[];
96
96
  variant: 'outlined' | 'standard' | 'filled';
97
97
  }
98
- declare class ChipInput extends React.Component<ChipInputProps, ChipInputState> {
98
+ export default class ChipInput extends React.Component<ChipInputProps, ChipInputState> {
99
99
  private readonly labelRef;
100
100
  private labelNode;
101
101
  private readonly input;
@@ -150,4 +150,4 @@ declare class ChipInput extends React.Component<ChipInputProps, ChipInputState>
150
150
  setActualInputRef: (ref: HTMLInputElement) => void;
151
151
  render(): JSX.Element;
152
152
  }
153
- export default ChipInput;
153
+ export {};
@@ -170,7 +170,7 @@ export const defaultChipRenderer = ({ value, isFocused, isDisabled, isReadOnly,
170
170
  pointerEvents: isDisabled || isReadOnly ? 'none' : undefined,
171
171
  backgroundColor: isFocused ? blue[300] : undefined,
172
172
  }, onClick: handleClick, onDelete: handleDelete, label: value }));
173
- class ChipInput extends React.Component {
173
+ export default class ChipInput extends React.Component {
174
174
  labelRef;
175
175
  labelNode = null;
176
176
  input;
@@ -290,9 +290,7 @@ class ChipInput extends React.Component {
290
290
  };
291
291
  handleInputFocus = (event) => {
292
292
  this.setState({ isFocused: true });
293
- if (this.props.onFocus) {
294
- this.props.onFocus(event);
295
- }
293
+ this.props.onFocus?.(event);
296
294
  };
297
295
  handleKeyDown = (event) => {
298
296
  const { focusedChip } = this.state;
@@ -425,7 +423,7 @@ class ChipInput extends React.Component {
425
423
  if (this.state.focusedChip === i) {
426
424
  focusedChip = null;
427
425
  }
428
- else if (this.state.focusedChip > i) {
426
+ else if (this.state.focusedChip !== null && this.state.focusedChip > i) {
429
427
  focusedChip = this.state.focusedChip - 1;
430
428
  }
431
429
  this.updateChips(chips, { focusedChip });
@@ -484,7 +482,7 @@ class ChipInput extends React.Component {
484
482
  const chipComponents = chips.map((chip, i) => chipRenderer({
485
483
  value: chip,
486
484
  isDisabled: !!disabled,
487
- isReadOnly: readOnly,
485
+ isReadOnly: !!readOnly,
488
486
  isFocused: this.state.focusedChip === i,
489
487
  handleClick: () => this.setState({ focusedChip: i }),
490
488
  handleDelete: () => this.handleDeleteChip(chip, i),
@@ -525,9 +523,8 @@ class ChipInput extends React.Component {
525
523
  onKeyUp: this.handleKeyUp, onFocus: this.handleInputFocus, onBlur: this.handleInputBlur, inputRef: this.setActualInputRef, disabled: disabled, fullWidth: fullWidthInput, placeholder: (!hasInput && (shrinkFloatingLabel || label === null || label === undefined)) ||
526
524
  alwaysShowPlaceholder
527
525
  ? placeholder
528
- : null, readOnly: readOnly, ...InputProps, ...InputMore })),
526
+ : undefined, readOnly: readOnly, ...InputProps, ...InputMore })),
529
527
  helperText && (React.createElement(FormHelperText, { ...FormHelperTextProps, className: FormHelperTextProps?.className, style: this.styles.helperText }, helperText))));
530
528
  }
531
529
  }
532
- export default ChipInput;
533
530
  //# sourceMappingURL=ChipInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipInput.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ChipInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAE7C,OAAO,EAAiC,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAElF,MAAM,gBAAgB,GAAG;IACrB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,MAAM,GAAwB,CAAC,KAAe,EAAuB,EAAE;IACzE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC;IAC7C,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,0BAA0B,CAAC;IAEnF,OAAO;QACH,IAAI,EAAE,EAAE;QACR,SAAS,EAAE;YACP,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,CAAC;YACP,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;YACZ,6CAA6C,EAAE;gBAC3C,SAAS,EAAE,YAA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AAmB,EACvB,SAAS,EAAE,mBAAmB,EAAE,SAAS,EACzC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,IAE5B,UAAU,CACE,CACpB,CACS,CACjB,CAAC;IACN,CAAC;CACJ;AAED,eAAe,SAAS,CAAC","sourcesContent":["/**\n * Notice: Some code was adapted from Material-UI's text field.\n * Copyright (c) 2014 Call-Em-All (https://github.com/callemall/material-ui)\n */\nimport React, { type RefObject, type JSX } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Input, OutlinedInput, InputLabel, Chip, FormControl, FormHelperText, Box } from '@mui/material';\nimport FilledInput from '@mui/material/FilledInput/FilledInput';\nimport blue from '@mui/material/colors/blue';\n\nimport { type IobTheme, type ThemeType, Utils } from '@iobroker/adapter-react-v5';\n\nconst variantComponent = {\n standard: Input,\n filled: FilledInput,\n outlined: OutlinedInput,\n};\n\nconst styles: Record<string, any> = (theme: IobTheme): Record<string, any> => {\n const light = theme.palette.mode === 'light';\n const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';\n\n return {\n root: {},\n inputRoot: {\n display: 'inline-flex',\n flexWrap: 'wrap',\n flex: 1,\n marginTop: 0,\n minWidth: 70,\n '&.mui-variant-outlined,&.mui-variant-filled': {\n boxSizing: 'border-box',\n },\n '&.mui-variant-outlined': {\n paddingTop: '14px',\n },\n '&.mui-variant-filled': {\n paddingTop: '28px',\n },\n },\n input: {\n display: 'inline-block',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n appearance: 'none', // Remove border in Safari, doesn't seem to break anything in other browsers\n WebkitTapHighlightColor: 'rgba(0,0,0,0)', // Remove mobile color flashing (deprecated style).\n float: 'left',\n flex: 1,\n },\n chipContainer: {\n display: 'flex',\n flexFlow: 'row wrap',\n alignItems: 'center',\n cursor: 'text',\n marginBottom: '-2px',\n minHeight: 40,\n },\n outlined: {\n '& input': {\n height: 16,\n paddingTop: '4px',\n paddingBottom: '12px',\n marginTop: '4px',\n marginBottom: '4px',\n },\n },\n standard: {\n marginTop: '18px',\n },\n filled: {\n '& input': {\n height: 22,\n marginBottom: '4px',\n marginTop: '4px',\n paddingTop: 0,\n },\n '$marginDense & input': {\n height: 26,\n },\n },\n labeled: {},\n label: {\n top: 4,\n '&$outlined&:not($labelShrink)': {\n top: 2,\n '$marginDense &': {\n top: 5,\n },\n },\n '&$filled&:not($labelShrink)': {\n top: 15,\n '$marginDense &': {\n top: 20,\n },\n },\n },\n labelShrink: {\n top: 0,\n },\n helperText: {\n marginBottom: -20,\n },\n focused: {},\n disabled: {},\n underline: {\n '&:after': {\n borderBottom: `2px solid ${theme.palette.primary[light ? 'dark' : 'light']}`,\n left: 0,\n bottom: 0,\n // Doing the other way around a crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\"',\n position: 'absolute',\n right: 0,\n transform: 'scaleX(0)',\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut,\n }),\n pointerEvents: 'none', // Transparent to the hover style.\n },\n '&$focused:after': {\n transform: 'scaleX(1)',\n },\n '&$error:after': {\n borderBottomColor: theme.palette.error.main,\n transform: 'scaleX(1)', // error is always underlined in red\n },\n '&:before': {\n borderBottom: `1px solid ${bottomLineColor}`,\n left: 0,\n bottom: 0,\n // Doing the other way around a crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\\\\00a0\"',\n position: 'absolute',\n right: 0,\n transition: theme.transitions.create('border-bottom-color', {\n duration: theme.transitions.duration.shorter,\n }),\n pointerEvents: 'none', // Transparent to the hover style.\n },\n '&:hover:not($disabled):not($focused):not($error):before': {\n borderBottom: `2px solid ${theme.palette.text.primary}`,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n borderBottom: `1px solid ${bottomLineColor}`,\n },\n },\n '&$disabled:before': {\n borderBottomStyle: 'dotted',\n },\n },\n error: {\n '&:after': {\n backgroundColor: theme.palette.error.main,\n transform: 'scaleX(1)', // error is always underlined in red\n },\n },\n chip: {\n margin: '0 8px 8px 0',\n float: 'left',\n },\n marginDense: {},\n };\n};\n\nconst keyCodes = {\n BACKSPACE: 8,\n DELETE: 46,\n LEFT_ARROW: 37,\n RIGHT_ARROW: 39,\n};\n\ninterface ChipRendererProps {\n value: string;\n isFocused: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n handleClick: () => void;\n handleDelete: () => void;\n style: React.CSSProperties;\n}\n\nexport const defaultChipRenderer = (\n { value, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, style }: ChipRendererProps,\n key: string,\n): JSX.Element => (\n <Chip\n key={key}\n style={{\n ...style,\n pointerEvents: isDisabled || isReadOnly ? 'none' : undefined,\n backgroundColor: isFocused ? blue[300] : undefined,\n }}\n onClick={handleClick}\n onDelete={handleDelete}\n label={value}\n />\n);\n\ninterface ChipInputProps {\n /** Allows duplicate chips if set to true. */\n allowDuplicates?: boolean;\n /** If true, the placeholder will always be visible. */\n alwaysShowPlaceholder?: boolean;\n /** Behavior when the chip input is blurred: `'clear'` clears the input, `'add'` creates a chip and `'ignore'` keeps the input. */\n blurBehavior?: 'clear' | 'add' | 'add-or-clear' | 'ignore';\n /** A function of the type `({ value, text, chip, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, className }, key) => node` that returns a chip based on the given properties. This can be used to customize chip styles. Each item in the `dataSource` array will be passed to `chipRenderer` as arguments `chip`, `value` and `text`. If `dataSource` is an array of objects and `dataSourceConfig` is present, then `value` and `text` will instead correspond to the object values defined in `dataSourceConfig`. If `dataSourceConfig` is not set and `dataSource` is an array of objects, then a custom `chipRenderer` must be set. `chip` is always the raw value from `dataSource`, either an object or a string. */\n chipRenderer?: (props: ChipRendererProps) => JSX.Element;\n /** Whether the input value should be cleared if the `value` prop is changed. */\n clearInputValueOnChange?: boolean;\n /** Data source for auto complete. This should be an array of strings or objects. */\n dataSource?: string[];\n /** The chips to display by default (for uncontrolled mode). */\n defaultValue?: string[];\n /** Whether to use `setTimeout` to delay adding chips in case other input events like `onSelection` need to fire first */\n delayBeforeAdd?: boolean;\n /** Disables the chip input if set to true. */\n disabled?: boolean;\n /** Disable the input underline. Only valid for 'standard' variant */\n disableUnderline?: boolean;\n /** Props to pass through to the `FormHelperText` component. */\n FormHelperTextProps?: Record<string, any>;\n /** If true, the chip input will fill the available width. */\n fullWidth?: boolean;\n /** If true, the input field will always be below the chips and fill the available space. By default, it will try to be beside the chips. */\n fullWidthInput?: boolean;\n /** Helper text that is displayed below the input. */\n helperText?: string | JSX.Element;\n /** Props to pass through to the `InputLabel`. */\n InputLabelProps?: Record<string, any>;\n /** Props to pass through to the `Input`. */\n InputProps?: Record<string, any>;\n /** Use this property to pass a ref callback to the native input component. */\n inputRef?: (el: HTMLInputElement) => void;\n /** The input value (enables controlled mode for the text input if set). */\n inputValue?: string;\n /* The content of the floating label. */\n label?: string | JSX.Element;\n /** The key codes (`KeyboardEvent.keyCode`) used to determine when to create a new chip. */\n newChipKeyCodes?: number[];\n /** The keys (`KeyboardEvent.key`) used to determine when to create a new chip. */\n newChipKeys?: string[];\n /** Callback function that is called when a new chip was added (in controlled mode). */\n onAdd?: (chip: string) => void;\n /** Callback function that is called with the chip to be added and should return true to add the chip or false to prevent the chip from being added without clearing the text input. */\n onBeforeAdd?: (chip: string) => boolean;\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n // onKeyPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Callback function that is called when the chips change (in uncontrolled mode). */\n onChange?: (chips: string[]) => void;\n /** Callback function that is called when a new chip was removed (in controlled mode). */\n onDelete: (chip: string, i: number) => void;\n /** Callback function that is called when the input changes. */\n onUpdateInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n /** A placeholder that is displayed if the input has no values. */\n placeholder?: string;\n /** Makes the chip input read-only if set to true. */\n readOnly?: boolean;\n /** The chips to display (enables controlled mode if set). */\n value?: string[];\n /** The variant of the Input component */\n variant?: 'outlined' | 'standard' | 'filled';\n className?: string;\n error?: boolean;\n id?: string;\n required?: boolean;\n rootRef?: RefObject<HTMLDivElement>;\n margin?: 'dense' | 'normal' | 'none';\n theme: IobTheme;\n}\n\ninterface ChipInputState {\n chips: string[];\n focusedChip: number | null;\n inputValue: string;\n isFocused: boolean;\n chipsUpdated: boolean;\n prevPropsValue: string[];\n variant: 'outlined' | 'standard' | 'filled';\n}\n\nclass ChipInput extends React.Component<ChipInputProps, ChipInputState> {\n private readonly labelRef: React.RefObject<HTMLLabelElement>;\n\n private labelNode: HTMLLabelElement | null = null;\n\n private readonly input: React.RefObject<HTMLInputElement>;\n\n private readonly newChipKeyCodes: number[];\n\n private readonly newChipKeys: string[];\n\n private actualInput: HTMLInputElement | null = null;\n\n private inputBlurTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private _keyPressed: boolean;\n\n private _preventChipCreation: boolean;\n\n private styles: Record<string, any> = {};\n\n private styleTheme: ThemeType | null = null;\n\n constructor(props: ChipInputProps) {\n super(props);\n this.state = {\n chips: props.defaultValue || [],\n focusedChip: null,\n inputValue: '',\n isFocused: false,\n chipsUpdated: false,\n prevPropsValue: [],\n variant: this.props.variant || 'standard',\n };\n this.newChipKeyCodes = props.newChipKeyCodes || [13];\n this.newChipKeys = props.newChipKeys || ['Enter'];\n\n this.labelRef = React.createRef();\n this.input = React.createRef();\n }\n\n componentDidMount(): void {\n if (this.state.variant === 'outlined') {\n // eslint-disable-next-line react/no-find-dom-node\n this.labelNode = ReactDOM.findDOMNode(this.labelRef.current) as HTMLLabelElement;\n this.forceUpdate();\n }\n }\n\n componentWillUnmount(): void {\n if (this.inputBlurTimeout) {\n clearTimeout(this.inputBlurTimeout);\n }\n }\n\n static getDerivedStateFromProps(props: ChipInputProps, state: ChipInputState): Partial<ChipInputState> | null {\n let newState: Partial<ChipInputState> | null = null;\n\n if (props.value && props.value.length !== state.prevPropsValue.length) {\n newState = { prevPropsValue: props.value };\n if (props.clearInputValueOnChange) {\n newState.inputValue = '';\n }\n }\n\n // if change detection is only necessary for clearInputValueOnChange\n if (props.clearInputValueOnChange && props.value && props.value.length !== state.prevPropsValue.length) {\n newState = { prevPropsValue: props.value, inputValue: '' };\n }\n\n if (props.disabled) {\n newState = { ...newState, focusedChip: null };\n }\n\n if (!state.chipsUpdated && props.defaultValue) {\n newState = { ...newState, chips: props.defaultValue };\n }\n\n return newState;\n }\n\n /**\n * Blurs this component.\n */\n // blur() {\n // if (this.input) {\n // this.actualInput.blur();\n // }\n // }\n\n /**\n * Focuses this component.\n */\n focus = (): void => {\n this.actualInput?.focus();\n if (this.state.focusedChip) {\n this.setState({ focusedChip: null });\n }\n };\n\n handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n this.setState({ isFocused: false });\n if (this.state.focusedChip) {\n this.setState({ focusedChip: null });\n }\n const value = event.target.value;\n let addChipOptions: { clearInputOnFail: boolean };\n switch (this.props.blurBehavior || 'clear') {\n case 'add-or-clear':\n addChipOptions = { clearInputOnFail: true };\n // falls through\n case 'add':\n if (this.props.delayBeforeAdd) {\n // Let's assume that we only want to add the existing content as chip, when\n // another event has not added a chip within 200ms.\n // e.g., onSelection Callback in Autocomplete case\n const numChipsBefore = (this.props.value || this.state.chips).length;\n this.inputBlurTimeout = setTimeout(() => {\n const numChipsAfter = (this.props.value || this.state.chips).length;\n if (numChipsBefore === numChipsAfter) {\n this.handleAddChip(value, addChipOptions);\n } else {\n this.clearInput();\n }\n }, 150);\n } else {\n this.handleAddChip(value, addChipOptions);\n }\n break;\n\n case 'clear':\n this.clearInput();\n break;\n\n default:\n break;\n }\n };\n\n handleInputFocus = (event: React.FocusEvent<HTMLInputElement>): void => {\n this.setState({ isFocused: true });\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n const { focusedChip } = this.state;\n this._keyPressed = false;\n this._preventChipCreation = false;\n\n if (this.props.onKeyDown) {\n // Needed for arrow controls on a menu in autocomplete scenario\n this.props.onKeyDown(event);\n // Check if the callback marked the event as isDefaultPrevented() and skip further actions\n // enter key, for example, should not always add the current value of the inputField\n if (event.isDefaultPrevented()) {\n return;\n }\n }\n const chips = this.props.value || this.state.chips;\n if (this.newChipKeyCodes.includes(event.keyCode) || this.newChipKeys.includes(event.key)) {\n const result = this.handleAddChip((event.target as HTMLInputElement).value);\n if (result !== false) {\n event.preventDefault();\n }\n return;\n }\n\n switch (event.keyCode) {\n case keyCodes.BACKSPACE:\n if ((event.target as HTMLInputElement).value === '') {\n if (focusedChip) {\n this.handleDeleteChip(chips[focusedChip], focusedChip);\n if (focusedChip) {\n this.setState({ focusedChip: focusedChip - 1 });\n }\n } else {\n this.setState({ focusedChip: chips.length - 1 });\n }\n }\n break;\n case keyCodes.DELETE:\n if ((event.target as HTMLInputElement).value === '' && focusedChip) {\n this.handleDeleteChip(chips[focusedChip], focusedChip);\n if (focusedChip <= chips.length - 1) {\n this.setState({ focusedChip });\n }\n }\n break;\n case keyCodes.LEFT_ARROW:\n if (focusedChip === null && (event.target as HTMLInputElement).value === '' && chips.length) {\n this.setState({ focusedChip: chips.length - 1 });\n } else if (focusedChip !== null && focusedChip > 0) {\n this.setState({ focusedChip: focusedChip - 1 });\n }\n break;\n case keyCodes.RIGHT_ARROW:\n if (focusedChip !== null && focusedChip < chips.length - 1) {\n this.setState({ focusedChip: focusedChip + 1 });\n } else {\n this.setState({ focusedChip: null });\n }\n break;\n default:\n this.setState({ focusedChip: null });\n break;\n }\n };\n\n handleKeyUp = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n if (\n !this._preventChipCreation &&\n (this.newChipKeyCodes.includes(event.keyCode) || this.newChipKeys.includes(event.key)) &&\n this._keyPressed\n ) {\n this.clearInput();\n } else {\n this.updateInput((event.target as HTMLInputElement).value);\n }\n if (this.props.onKeyUp) {\n this.props.onKeyUp(event);\n }\n };\n\n // handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n // this._keyPressed = true;\n // if (this.props.onKeyPress) {\n // this.props.onKeyPress(event);\n // }\n // };\n\n handleUpdateInput = (e: React.ChangeEvent<HTMLInputElement>): void => {\n if (this.props.inputValue === null || this.props.inputValue === undefined) {\n this.updateInput(e.target.value);\n }\n\n if (this.props.onUpdateInput) {\n this.props.onUpdateInput(e);\n }\n };\n\n /**\n * Handles adding a chip.\n *\n * @param chip Value of the chip, either a string or an object (if dataSourceConfig is set)\n * @param options Additional options\n * @param options.clearInputOnFail If `true`, and `onBeforeAdd` returns `false`, clear the input\n * @returns True if the chip was added (or at least `onAdd` was called), false if adding the chip was prevented\n */\n handleAddChip(chip: string, options?: { clearInputOnFail: boolean }): boolean {\n if (this.props.onBeforeAdd && !this.props.onBeforeAdd(chip)) {\n this._preventChipCreation = true;\n if (options && options.clearInputOnFail) {\n this.clearInput();\n }\n return false;\n }\n this.clearInput();\n const chips = this.props.value || this.state.chips;\n\n if (chip.trim().length) {\n if (this.props.allowDuplicates || !chips.includes(chip)) {\n if (this.props.value && this.props.onAdd) {\n this.props.onAdd(chip);\n } else {\n this.updateChips([...this.state.chips, chip]);\n }\n }\n return true;\n }\n return false;\n }\n\n handleDeleteChip(chip: string, i: number): void {\n if (!this.props.value) {\n const chips = this.state.chips.slice();\n const changed = chips.splice(i, 1); // remove the chip at index i\n if (changed) {\n let focusedChip = this.state.focusedChip;\n if (this.state.focusedChip === i) {\n focusedChip = null;\n } else if (this.state.focusedChip > i) {\n focusedChip = this.state.focusedChip - 1;\n }\n this.updateChips(chips, { focusedChip });\n }\n } else if (this.props.onDelete) {\n this.props.onDelete(chip, i);\n }\n }\n\n updateChips(chips: string[], additionalUpdates = {}): void {\n this.setState({ chips, chipsUpdated: true, ...additionalUpdates });\n if (this.props.onChange) {\n this.props.onChange(chips);\n }\n }\n\n /**\n * Clears the text field for adding new chips.\n * This only works in uncontrolled input mode, i.e., if the inputValue prop is not used.\n */\n clearInput(): void {\n this.updateInput('');\n }\n\n updateInput(value: string): void {\n this.setState({ inputValue: value });\n }\n\n /**\n * Set the reference to the actual input, that is the input of the Input.\n *\n * @param ref - The reference\n */\n setActualInputRef = (ref: HTMLInputElement): void => {\n this.actualInput = ref;\n if (this.props.inputRef) {\n this.props.inputRef(ref);\n }\n };\n\n render(): JSX.Element {\n const {\n alwaysShowPlaceholder,\n chipRenderer = defaultChipRenderer,\n className,\n disabled,\n disableUnderline,\n error,\n FormHelperTextProps,\n fullWidth,\n fullWidthInput,\n helperText,\n id,\n InputProps = {},\n InputLabelProps = {},\n inputValue,\n label,\n placeholder,\n readOnly,\n required,\n rootRef,\n value,\n margin,\n } = this.props;\n const variant = this.state.variant;\n\n if (this.styleTheme !== this.props.theme.palette.mode) {\n this.styleTheme = this.props.theme.palette.mode;\n this.styles = Utils.getStyle(this.props.theme, styles);\n }\n\n let chips = value || this.state.chips || [];\n if (!Array.isArray(chips)) {\n chips = ((chips as string) || '')\n .toString()\n .split(/[,\\s]+/)\n .map((c: string) => c.trim());\n }\n const actualInputValue = inputValue ?? this.state.inputValue;\n\n const hasInput = (this.props.value || actualInputValue).length || actualInputValue.length;\n const shrinkFloatingLabel =\n typeof InputLabelProps.shrink === 'boolean'\n ? InputLabelProps.shrink\n : label !== null && (hasInput || this.state.isFocused || chips.length);\n\n const chipComponents = chips.map((chip, i) =>\n chipRenderer(\n {\n value: chip,\n isDisabled: !!disabled,\n isReadOnly: readOnly,\n isFocused: this.state.focusedChip === i,\n handleClick: () => this.setState({ focusedChip: i }),\n handleDelete: () => this.handleDeleteChip(chip, i),\n style: this.styles.chip,\n },\n i.toString(),\n ),\n );\n\n const InputMore: { notched?: boolean; labelWidth?: number; startAdornment?: JSX.Element[] } = {};\n if (variant === 'outlined') {\n InputMore.notched = !!shrinkFloatingLabel;\n InputMore.labelWidth = (shrinkFloatingLabel && this.labelNode && this.labelNode.offsetWidth) || 0;\n }\n\n if (variant !== 'standard') {\n InputMore.startAdornment = chipComponents;\n } else {\n InputProps.disableUnderline = true;\n }\n\n const InputComponent = variantComponent[variant];\n\n return (\n <FormControl\n ref={rootRef}\n fullWidth={fullWidth}\n className={className}\n sx={{ ...this.styles.root, ...(margin === 'dense' ? this.styles.marginDense : {}) }}\n error={error}\n required={chips.length > 0 ? undefined : required}\n onClick={this.focus}\n disabled={disabled}\n variant={variant}\n component=\"div\"\n margin={margin}\n >\n {label && (\n <InputLabel\n htmlFor={id}\n sx={{\n '&.MuiInputLabel-root': this.styles.label,\n '&.MuiInputLabel-shrink': this.styles.labelShrink,\n }}\n shrink={!!shrinkFloatingLabel}\n focused={this.state.isFocused}\n variant={variant}\n ref={this.labelRef}\n required={required}\n component=\"label\"\n {...InputLabelProps}\n >\n {label}\n </InputLabel>\n )}\n <Box\n component=\"div\"\n id=\"input-chip-container\"\n sx={{\n ...this.styles[variant],\n ...this.styles.chipContainer,\n ...(this.state.isFocused ? this.styles.focused : undefined),\n ...(!disableUnderline && variant === 'standard' ? this.styles.underline : undefined),\n ...(disabled ? this.styles.disabled : undefined),\n ...(label ? this.styles.labeled : undefined),\n ...(error ? this.styles.error : undefined),\n }}\n >\n {variant === 'standard' && chipComponents}\n <InputComponent\n ref={this.input}\n className={`mui-variant-${this.styles[variant]} ${label ? 'mui-chip-with-label' : 'mui-chip-no-label'}`}\n sx={{\n '&.MuiInputBase-input': { ...this.styles.input, ...this.styles[variant] },\n '&.MuiInputBase-root': { ...this.styles.inputRoot },\n }}\n id={id}\n value={actualInputValue}\n onChange={this.handleUpdateInput}\n onKeyDown={this.handleKeyDown}\n // onKeyPress={this.handleKeyPress}\n onKeyUp={this.handleKeyUp}\n onFocus={this.handleInputFocus}\n onBlur={this.handleInputBlur}\n inputRef={this.setActualInputRef}\n disabled={disabled}\n fullWidth={fullWidthInput}\n placeholder={\n (!hasInput && (shrinkFloatingLabel || label === null || label === undefined)) ||\n alwaysShowPlaceholder\n ? placeholder\n : null\n }\n readOnly={readOnly}\n {...InputProps}\n {...InputMore}\n />\n </Box>\n {helperText && (\n <FormHelperText\n {...FormHelperTextProps}\n className={FormHelperTextProps?.className}\n style={this.styles.helperText}\n >\n {helperText}\n </FormHelperText>\n )}\n </FormControl>\n );\n }\n}\n\nexport default ChipInput;\n"]}
1
+ {"version":3,"file":"ChipInput.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ChipInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAE7C,OAAO,EAAiC,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAElF,MAAM,gBAAgB,GAAG;IACrB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,MAAM,GAAwB,CAAC,KAAe,EAAuB,EAAE;IACzE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC;IAC7C,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,0BAA0B,CAAC;IAEnF,OAAO;QACH,IAAI,EAAE,EAAE;QACR,SAAS,EAAE;YACP,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,CAAC;YACP,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;YACZ,6CAA6C,EAAE;gBAC3C,SAAS,EAAE,YA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,oBAAC,cAAc,OACP,mBAAmB,EACvB,SAAS,EAAE,mBAAmB,EAAE,SAAS,EACzC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,IAE5B,UAAU,CACE,CACpB,CACS,CACjB,CAAC;IACN,CAAC;CACJ","sourcesContent":["/**\n * Notice: Some code was adapted from Material-UI's text field.\n * Copyright (c) 2014 Call-Em-All (https://github.com/callemall/material-ui)\n */\nimport React, { type RefObject, type JSX } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Input, OutlinedInput, InputLabel, Chip, FormControl, FormHelperText, Box } from '@mui/material';\nimport FilledInput from '@mui/material/FilledInput/FilledInput';\nimport blue from '@mui/material/colors/blue';\n\nimport { type IobTheme, type ThemeType, Utils } from '@iobroker/adapter-react-v5';\n\nconst variantComponent = {\n standard: Input,\n filled: FilledInput,\n outlined: OutlinedInput,\n};\n\nconst styles: Record<string, any> = (theme: IobTheme): Record<string, any> => {\n const light = theme.palette.mode === 'light';\n const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';\n\n return {\n root: {},\n inputRoot: {\n display: 'inline-flex',\n flexWrap: 'wrap',\n flex: 1,\n marginTop: 0,\n minWidth: 70,\n '&.mui-variant-outlined,&.mui-variant-filled': {\n boxSizing: 'border-box',\n },\n '&.mui-variant-outlined': {\n paddingTop: '14px',\n },\n '&.mui-variant-filled': {\n paddingTop: '28px',\n },\n },\n input: {\n display: 'inline-block',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n appearance: 'none', // Remove border in Safari, doesn't seem to break anything in other browsers\n WebkitTapHighlightColor: 'rgba(0,0,0,0)', // Remove mobile color flashing (deprecated style).\n float: 'left',\n flex: 1,\n },\n chipContainer: {\n display: 'flex',\n flexFlow: 'row wrap',\n alignItems: 'center',\n cursor: 'text',\n marginBottom: '-2px',\n minHeight: 40,\n },\n outlined: {\n '& input': {\n height: 16,\n paddingTop: '4px',\n paddingBottom: '12px',\n marginTop: '4px',\n marginBottom: '4px',\n },\n },\n standard: {\n marginTop: '18px',\n },\n filled: {\n '& input': {\n height: 22,\n marginBottom: '4px',\n marginTop: '4px',\n paddingTop: 0,\n },\n '$marginDense & input': {\n height: 26,\n },\n },\n labeled: {},\n label: {\n top: 4,\n '&$outlined&:not($labelShrink)': {\n top: 2,\n '$marginDense &': {\n top: 5,\n },\n },\n '&$filled&:not($labelShrink)': {\n top: 15,\n '$marginDense &': {\n top: 20,\n },\n },\n },\n labelShrink: {\n top: 0,\n },\n helperText: {\n marginBottom: -20,\n },\n focused: {},\n disabled: {},\n underline: {\n '&:after': {\n borderBottom: `2px solid ${theme.palette.primary[light ? 'dark' : 'light']}`,\n left: 0,\n bottom: 0,\n // Doing the other way around a crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\"',\n position: 'absolute',\n right: 0,\n transform: 'scaleX(0)',\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut,\n }),\n pointerEvents: 'none', // Transparent to the hover style.\n },\n '&$focused:after': {\n transform: 'scaleX(1)',\n },\n '&$error:after': {\n borderBottomColor: theme.palette.error.main,\n transform: 'scaleX(1)', // error is always underlined in red\n },\n '&:before': {\n borderBottom: `1px solid ${bottomLineColor}`,\n left: 0,\n bottom: 0,\n // Doing the other way around a crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\\\\00a0\"',\n position: 'absolute',\n right: 0,\n transition: theme.transitions.create('border-bottom-color', {\n duration: theme.transitions.duration.shorter,\n }),\n pointerEvents: 'none', // Transparent to the hover style.\n },\n '&:hover:not($disabled):not($focused):not($error):before': {\n borderBottom: `2px solid ${theme.palette.text.primary}`,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n borderBottom: `1px solid ${bottomLineColor}`,\n },\n },\n '&$disabled:before': {\n borderBottomStyle: 'dotted',\n },\n },\n error: {\n '&:after': {\n backgroundColor: theme.palette.error.main,\n transform: 'scaleX(1)', // error is always underlined in red\n },\n },\n chip: {\n margin: '0 8px 8px 0',\n float: 'left',\n },\n marginDense: {},\n };\n};\n\nconst keyCodes = {\n BACKSPACE: 8,\n DELETE: 46,\n LEFT_ARROW: 37,\n RIGHT_ARROW: 39,\n};\n\ninterface ChipRendererProps {\n value: string;\n isFocused: boolean;\n isDisabled: boolean;\n isReadOnly: boolean;\n handleClick: () => void;\n handleDelete: () => void;\n style: React.CSSProperties;\n}\n\nexport const defaultChipRenderer = (\n { value, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, style }: ChipRendererProps,\n key: string,\n): JSX.Element => (\n <Chip\n key={key}\n style={{\n ...style,\n pointerEvents: isDisabled || isReadOnly ? 'none' : undefined,\n backgroundColor: isFocused ? blue[300] : undefined,\n }}\n onClick={handleClick}\n onDelete={handleDelete}\n label={value}\n />\n);\n\ninterface ChipInputProps {\n /** Allows duplicate chips if set to true. */\n allowDuplicates?: boolean;\n /** If true, the placeholder will always be visible. */\n alwaysShowPlaceholder?: boolean;\n /** Behavior when the chip input is blurred: `'clear'` clears the input, `'add'` creates a chip and `'ignore'` keeps the input. */\n blurBehavior?: 'clear' | 'add' | 'add-or-clear' | 'ignore';\n /** A function of the type `({ value, text, chip, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, className }, key) => node` that returns a chip based on the given properties. This can be used to customize chip styles. Each item in the `dataSource` array will be passed to `chipRenderer` as arguments `chip`, `value` and `text`. If `dataSource` is an array of objects and `dataSourceConfig` is present, then `value` and `text` will instead correspond to the object values defined in `dataSourceConfig`. If `dataSourceConfig` is not set and `dataSource` is an array of objects, then a custom `chipRenderer` must be set. `chip` is always the raw value from `dataSource`, either an object or a string. */\n chipRenderer?: (props: ChipRendererProps) => JSX.Element;\n /** Whether the input value should be cleared if the `value` prop is changed. */\n clearInputValueOnChange?: boolean;\n /** Data source for auto complete. This should be an array of strings or objects. */\n dataSource?: string[];\n /** The chips to display by default (for uncontrolled mode). */\n defaultValue?: string[];\n /** Whether to use `setTimeout` to delay adding chips in case other input events like `onSelection` need to fire first */\n delayBeforeAdd?: boolean;\n /** Disables the chip input if set to true. */\n disabled?: boolean;\n /** Disable the input underline. Only valid for 'standard' variant */\n disableUnderline?: boolean;\n /** Props to pass through to the `FormHelperText` component. */\n FormHelperTextProps?: Record<string, any>;\n /** If true, the chip input will fill the available width. */\n fullWidth?: boolean;\n /** If true, the input field will always be below the chips and fill the available space. By default, it will try to be beside the chips. */\n fullWidthInput?: boolean;\n /** Helper text that is displayed below the input. */\n helperText?: string | JSX.Element;\n /** Props to pass through to the `InputLabel`. */\n InputLabelProps?: Record<string, any>;\n /** Props to pass through to the `Input`. */\n InputProps?: Record<string, any>;\n /** Use this property to pass a ref callback to the native input component. */\n inputRef?: (el: HTMLInputElement) => void;\n /** The input value (enables controlled mode for the text input if set). */\n inputValue?: string;\n /* The content of the floating label. */\n label?: string | JSX.Element;\n /** The key codes (`KeyboardEvent.keyCode`) used to determine when to create a new chip. */\n newChipKeyCodes?: number[];\n /** The keys (`KeyboardEvent.key`) used to determine when to create a new chip. */\n newChipKeys?: string[];\n /** Callback function that is called when a new chip was added (in controlled mode). */\n onAdd?: (chip: string) => void;\n /** Callback function that is called with the chip to be added and should return true to add the chip or false to prevent the chip from being added without clearing the text input. */\n onBeforeAdd?: (chip: string) => boolean;\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n // onKeyPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Callback function that is called when the chips change (in uncontrolled mode). */\n onChange?: (chips: string[]) => void;\n /** Callback function that is called when a new chip was removed (in controlled mode). */\n onDelete: (chip: string, i: number) => void;\n /** Callback function that is called when the input changes. */\n onUpdateInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n /** A placeholder that is displayed if the input has no values. */\n placeholder?: string;\n /** Makes the chip input read-only if set to true. */\n readOnly?: boolean;\n /** The chips to display (enables controlled mode if set). */\n value?: string[];\n /** The variant of the Input component */\n variant?: 'outlined' | 'standard' | 'filled';\n className?: string;\n error?: boolean;\n id?: string;\n required?: boolean;\n rootRef?: RefObject<HTMLDivElement>;\n margin?: 'dense' | 'normal' | 'none';\n theme: IobTheme;\n}\n\ninterface ChipInputState {\n chips: string[];\n focusedChip: number | null;\n inputValue: string;\n isFocused: boolean;\n chipsUpdated: boolean;\n prevPropsValue: string[];\n variant: 'outlined' | 'standard' | 'filled';\n}\n\nexport default class ChipInput extends React.Component<ChipInputProps, ChipInputState> {\n private readonly labelRef: React.RefObject<HTMLLabelElement>;\n\n private labelNode: HTMLLabelElement | null = null;\n\n private readonly input: React.RefObject<HTMLInputElement>;\n\n private readonly newChipKeyCodes: number[];\n\n private readonly newChipKeys: string[];\n\n private actualInput: HTMLInputElement | null = null;\n\n private inputBlurTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private _keyPressed: boolean;\n\n private _preventChipCreation: boolean;\n\n private styles: Record<string, any> = {};\n\n private styleTheme: ThemeType | null = null;\n\n constructor(props: ChipInputProps) {\n super(props);\n this.state = {\n chips: props.defaultValue || [],\n focusedChip: null,\n inputValue: '',\n isFocused: false,\n chipsUpdated: false,\n prevPropsValue: [],\n variant: this.props.variant || 'standard',\n };\n this.newChipKeyCodes = props.newChipKeyCodes || [13];\n this.newChipKeys = props.newChipKeys || ['Enter'];\n\n this.labelRef = React.createRef();\n this.input = React.createRef();\n }\n\n componentDidMount(): void {\n if (this.state.variant === 'outlined') {\n // eslint-disable-next-line react/no-find-dom-node\n this.labelNode = ReactDOM.findDOMNode(this.labelRef.current) as HTMLLabelElement;\n this.forceUpdate();\n }\n }\n\n componentWillUnmount(): void {\n if (this.inputBlurTimeout) {\n clearTimeout(this.inputBlurTimeout);\n }\n }\n\n static getDerivedStateFromProps(props: ChipInputProps, state: ChipInputState): Partial<ChipInputState> | null {\n let newState: Partial<ChipInputState> | null = null;\n\n if (props.value && props.value.length !== state.prevPropsValue.length) {\n newState = { prevPropsValue: props.value };\n if (props.clearInputValueOnChange) {\n newState.inputValue = '';\n }\n }\n\n // if change detection is only necessary for clearInputValueOnChange\n if (props.clearInputValueOnChange && props.value && props.value.length !== state.prevPropsValue.length) {\n newState = { prevPropsValue: props.value, inputValue: '' };\n }\n\n if (props.disabled) {\n newState = { ...newState, focusedChip: null };\n }\n\n if (!state.chipsUpdated && props.defaultValue) {\n newState = { ...newState, chips: props.defaultValue };\n }\n\n return newState;\n }\n\n /**\n * Blurs this component.\n */\n // blur() {\n // if (this.input) {\n // this.actualInput.blur();\n // }\n // }\n\n /**\n * Focuses this component.\n */\n focus = (): void => {\n this.actualInput?.focus();\n if (this.state.focusedChip) {\n this.setState({ focusedChip: null });\n }\n };\n\n handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n this.setState({ isFocused: false });\n if (this.state.focusedChip) {\n this.setState({ focusedChip: null });\n }\n const value = event.target.value;\n let addChipOptions: { clearInputOnFail: boolean } | undefined;\n switch (this.props.blurBehavior || 'clear') {\n case 'add-or-clear':\n addChipOptions = { clearInputOnFail: true };\n // falls through\n case 'add':\n if (this.props.delayBeforeAdd) {\n // Let's assume that we only want to add the existing content as chip, when\n // another event has not added a chip within 200ms.\n // e.g., onSelection Callback in Autocomplete case\n const numChipsBefore = (this.props.value || this.state.chips).length;\n this.inputBlurTimeout = setTimeout(() => {\n const numChipsAfter = (this.props.value || this.state.chips).length;\n if (numChipsBefore === numChipsAfter) {\n this.handleAddChip(value, addChipOptions);\n } else {\n this.clearInput();\n }\n }, 150);\n } else {\n this.handleAddChip(value, addChipOptions);\n }\n break;\n\n case 'clear':\n this.clearInput();\n break;\n\n default:\n break;\n }\n };\n\n handleInputFocus = (event: React.FocusEvent<HTMLInputElement>): void => {\n this.setState({ isFocused: true });\n this.props.onFocus?.(event);\n };\n\n handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n const { focusedChip } = this.state;\n this._keyPressed = false;\n this._preventChipCreation = false;\n\n if (this.props.onKeyDown) {\n // Needed for arrow controls on a menu in autocomplete scenario\n this.props.onKeyDown(event);\n // Check if the callback marked the event as isDefaultPrevented() and skip further actions\n // enter key, for example, should not always add the current value of the inputField\n if (event.isDefaultPrevented()) {\n return;\n }\n }\n const chips = this.props.value || this.state.chips;\n if (this.newChipKeyCodes.includes(event.keyCode) || this.newChipKeys.includes(event.key)) {\n const result = this.handleAddChip((event.target as HTMLInputElement).value);\n if (result !== false) {\n event.preventDefault();\n }\n return;\n }\n\n switch (event.keyCode) {\n case keyCodes.BACKSPACE:\n if ((event.target as HTMLInputElement).value === '') {\n if (focusedChip) {\n this.handleDeleteChip(chips[focusedChip], focusedChip);\n if (focusedChip) {\n this.setState({ focusedChip: focusedChip - 1 });\n }\n } else {\n this.setState({ focusedChip: chips.length - 1 });\n }\n }\n break;\n case keyCodes.DELETE:\n if ((event.target as HTMLInputElement).value === '' && focusedChip) {\n this.handleDeleteChip(chips[focusedChip], focusedChip);\n if (focusedChip <= chips.length - 1) {\n this.setState({ focusedChip });\n }\n }\n break;\n case keyCodes.LEFT_ARROW:\n if (focusedChip === null && (event.target as HTMLInputElement).value === '' && chips.length) {\n this.setState({ focusedChip: chips.length - 1 });\n } else if (focusedChip !== null && focusedChip > 0) {\n this.setState({ focusedChip: focusedChip - 1 });\n }\n break;\n case keyCodes.RIGHT_ARROW:\n if (focusedChip !== null && focusedChip < chips.length - 1) {\n this.setState({ focusedChip: focusedChip + 1 });\n } else {\n this.setState({ focusedChip: null });\n }\n break;\n default:\n this.setState({ focusedChip: null });\n break;\n }\n };\n\n handleKeyUp = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n if (\n !this._preventChipCreation &&\n (this.newChipKeyCodes.includes(event.keyCode) || this.newChipKeys.includes(event.key)) &&\n this._keyPressed\n ) {\n this.clearInput();\n } else {\n this.updateInput((event.target as HTMLInputElement).value);\n }\n if (this.props.onKeyUp) {\n this.props.onKeyUp(event);\n }\n };\n\n // handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n // this._keyPressed = true;\n // if (this.props.onKeyPress) {\n // this.props.onKeyPress(event);\n // }\n // };\n\n handleUpdateInput = (e: React.ChangeEvent<HTMLInputElement>): void => {\n if (this.props.inputValue === null || this.props.inputValue === undefined) {\n this.updateInput(e.target.value);\n }\n\n if (this.props.onUpdateInput) {\n this.props.onUpdateInput(e);\n }\n };\n\n /**\n * Handles adding a chip.\n *\n * @param chip Value of the chip, either a string or an object (if dataSourceConfig is set)\n * @param options Additional options\n * @param options.clearInputOnFail If `true`, and `onBeforeAdd` returns `false`, clear the input\n * @returns True if the chip was added (or at least `onAdd` was called), false if adding the chip was prevented\n */\n handleAddChip(chip: string, options?: { clearInputOnFail: boolean }): boolean {\n if (this.props.onBeforeAdd && !this.props.onBeforeAdd(chip)) {\n this._preventChipCreation = true;\n if (options && options.clearInputOnFail) {\n this.clearInput();\n }\n return false;\n }\n this.clearInput();\n const chips = this.props.value || this.state.chips;\n\n if (chip.trim().length) {\n if (this.props.allowDuplicates || !chips.includes(chip)) {\n if (this.props.value && this.props.onAdd) {\n this.props.onAdd(chip);\n } else {\n this.updateChips([...this.state.chips, chip]);\n }\n }\n return true;\n }\n return false;\n }\n\n handleDeleteChip(chip: string, i: number): void {\n if (!this.props.value) {\n const chips = this.state.chips.slice();\n const changed = chips.splice(i, 1); // remove the chip at index i\n if (changed) {\n let focusedChip = this.state.focusedChip;\n if (this.state.focusedChip === i) {\n focusedChip = null;\n } else if (this.state.focusedChip !== null && this.state.focusedChip > i) {\n focusedChip = this.state.focusedChip - 1;\n }\n this.updateChips(chips, { focusedChip });\n }\n } else if (this.props.onDelete) {\n this.props.onDelete(chip, i);\n }\n }\n\n updateChips(chips: string[], additionalUpdates = {}): void {\n this.setState({ chips, chipsUpdated: true, ...additionalUpdates });\n if (this.props.onChange) {\n this.props.onChange(chips);\n }\n }\n\n /**\n * Clears the text field for adding new chips.\n * This only works in uncontrolled input mode, i.e., if the inputValue prop is not used.\n */\n clearInput(): void {\n this.updateInput('');\n }\n\n updateInput(value: string): void {\n this.setState({ inputValue: value });\n }\n\n /**\n * Set the reference to the actual input, that is the input of the Input.\n *\n * @param ref - The reference\n */\n setActualInputRef = (ref: HTMLInputElement): void => {\n this.actualInput = ref;\n if (this.props.inputRef) {\n this.props.inputRef(ref);\n }\n };\n\n render(): JSX.Element {\n const {\n alwaysShowPlaceholder,\n chipRenderer = defaultChipRenderer,\n className,\n disabled,\n disableUnderline,\n error,\n FormHelperTextProps,\n fullWidth,\n fullWidthInput,\n helperText,\n id,\n InputProps = {},\n InputLabelProps = {},\n inputValue,\n label,\n placeholder,\n readOnly,\n required,\n rootRef,\n value,\n margin,\n } = this.props;\n const variant = this.state.variant;\n\n if (this.styleTheme !== this.props.theme.palette.mode) {\n this.styleTheme = this.props.theme.palette.mode;\n this.styles = Utils.getStyle(this.props.theme, styles);\n }\n\n let chips = value || this.state.chips || [];\n if (!Array.isArray(chips)) {\n chips = ((chips as string) || '')\n .toString()\n .split(/[,\\s]+/)\n .map((c: string) => c.trim());\n }\n const actualInputValue = inputValue ?? this.state.inputValue;\n\n const hasInput = (this.props.value || actualInputValue).length || actualInputValue.length;\n const shrinkFloatingLabel =\n typeof InputLabelProps.shrink === 'boolean'\n ? InputLabelProps.shrink\n : label !== null && (hasInput || this.state.isFocused || chips.length);\n\n const chipComponents = chips.map((chip, i) =>\n chipRenderer(\n {\n value: chip,\n isDisabled: !!disabled,\n isReadOnly: !!readOnly,\n isFocused: this.state.focusedChip === i,\n handleClick: () => this.setState({ focusedChip: i }),\n handleDelete: () => this.handleDeleteChip(chip, i),\n style: this.styles.chip,\n },\n i.toString(),\n ),\n );\n\n const InputMore: { notched?: boolean; labelWidth?: number; startAdornment?: JSX.Element[] } = {};\n if (variant === 'outlined') {\n InputMore.notched = !!shrinkFloatingLabel;\n InputMore.labelWidth = (shrinkFloatingLabel && this.labelNode && this.labelNode.offsetWidth) || 0;\n }\n\n if (variant !== 'standard') {\n InputMore.startAdornment = chipComponents;\n } else {\n InputProps.disableUnderline = true;\n }\n\n const InputComponent = variantComponent[variant];\n\n return (\n <FormControl\n ref={rootRef}\n fullWidth={fullWidth}\n className={className}\n sx={{ ...this.styles.root, ...(margin === 'dense' ? this.styles.marginDense : {}) }}\n error={error}\n required={chips.length > 0 ? undefined : required}\n onClick={this.focus}\n disabled={disabled}\n variant={variant}\n component=\"div\"\n margin={margin}\n >\n {label && (\n <InputLabel\n htmlFor={id}\n sx={{\n '&.MuiInputLabel-root': this.styles.label,\n '&.MuiInputLabel-shrink': this.styles.labelShrink,\n }}\n shrink={!!shrinkFloatingLabel}\n focused={this.state.isFocused}\n variant={variant}\n ref={this.labelRef}\n required={required}\n component=\"label\"\n {...InputLabelProps}\n >\n {label}\n </InputLabel>\n )}\n <Box\n component=\"div\"\n id=\"input-chip-container\"\n sx={{\n ...this.styles[variant],\n ...this.styles.chipContainer,\n ...(this.state.isFocused ? this.styles.focused : undefined),\n ...(!disableUnderline && variant === 'standard' ? this.styles.underline : undefined),\n ...(disabled ? this.styles.disabled : undefined),\n ...(label ? this.styles.labeled : undefined),\n ...(error ? this.styles.error : undefined),\n }}\n >\n {variant === 'standard' && chipComponents}\n <InputComponent\n ref={this.input}\n className={`mui-variant-${this.styles[variant]} ${label ? 'mui-chip-with-label' : 'mui-chip-no-label'}`}\n sx={{\n '&.MuiInputBase-input': { ...this.styles.input, ...this.styles[variant] },\n '&.MuiInputBase-root': { ...this.styles.inputRoot },\n }}\n id={id}\n value={actualInputValue}\n onChange={this.handleUpdateInput}\n onKeyDown={this.handleKeyDown}\n // onKeyPress={this.handleKeyPress}\n onKeyUp={this.handleKeyUp}\n onFocus={this.handleInputFocus}\n onBlur={this.handleInputBlur}\n inputRef={this.setActualInputRef}\n disabled={disabled}\n fullWidth={fullWidthInput}\n placeholder={\n (!hasInput && (shrinkFloatingLabel || label === null || label === undefined)) ||\n alwaysShowPlaceholder\n ? placeholder\n : undefined\n }\n readOnly={readOnly}\n {...InputProps}\n {...InputMore}\n />\n </Box>\n {helperText && (\n <FormHelperText\n {...FormHelperTextProps}\n className={FormHelperTextProps?.className}\n style={this.styles.helperText}\n >\n {helperText}\n </FormHelperText>\n )}\n </FormControl>\n );\n }\n}\n"]}
@@ -8,12 +8,15 @@ interface ConfigAccordionState extends ConfigGenericState {
8
8
  value: Record<string, any>[];
9
9
  activeIndex: number;
10
10
  iteration: number;
11
+ accordionErrors: Record<number, Record<string, string>>;
11
12
  }
12
13
  declare class ConfigAccordion extends ConfigGeneric<ConfigAccordionProps, ConfigAccordionState> {
13
14
  private typingTimer;
14
15
  constructor(props: ConfigAccordionProps);
15
16
  componentDidMount(): void;
16
17
  componentWillUnmount(): void;
18
+ onAccordionError: (accordionIndex: number) => (attr: string, error?: string) => void;
19
+ hasAccordionErrors: (accordionIndex: number) => boolean;
17
20
  itemAccordion(data: Record<string, any>, idx: number): JSX.Element;
18
21
  onDelete: (index: number) => () => void;
19
22
  onClone: (index: number) => () => void;
@@ -21,6 +24,8 @@ declare class ConfigAccordion extends ConfigGeneric<ConfigAccordionProps, Config
21
24
  onAdd: () => void;
22
25
  onMoveUp(idx: number): void;
23
26
  onMoveDown(idx: number): void;
27
+ onExport: () => void;
28
+ onImport: (replace: boolean) => void;
24
29
  renderItem(): JSX.Element | null;
25
30
  }
26
31
  export default ConfigAccordion;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { FormHelperText, Accordion, AccordionSummary, AccordionDetails, IconButton, Paper, Toolbar, Tooltip, Typography, } from '@mui/material';
3
- import { Add as AddIcon, Delete as DeleteIcon, ArrowUpward as UpIcon, ArrowDownward as DownIcon, ContentCopy as CopyContentIcon, ExpandMore as ExpandMoreIcon, } from '@mui/icons-material';
2
+ import { FormHelperText, Accordion, AccordionSummary, AccordionDetails, IconButton, Paper, Toolbar, Tooltip, Typography, Box, } from '@mui/material';
3
+ import { Add as AddIcon, Delete as DeleteIcon, ArrowUpward as UpIcon, ArrowDownward as DownIcon, ContentCopy as CopyContentIcon, ExpandMore as ExpandMoreIcon, Error as ErrorIcon, FileDownload as FileDownloadIcon, FileUpload as FileUploadIcon, AddCircle as AddCircleIcon, } from '@mui/icons-material';
4
4
  import { I18n, Utils } from '@iobroker/adapter-react-v5';
5
5
  import ConfigGeneric from './ConfigGeneric';
6
6
  import ConfigPanel from './ConfigPanel';
@@ -38,6 +38,7 @@ class ConfigAccordion extends ConfigGeneric {
38
38
  value,
39
39
  activeIndex: -1,
40
40
  iteration: 0,
41
+ accordionErrors: {},
41
42
  });
42
43
  }
43
44
  componentWillUnmount() {
@@ -47,6 +48,29 @@ class ConfigAccordion extends ConfigGeneric {
47
48
  }
48
49
  super.componentWillUnmount();
49
50
  }
51
+ onAccordionError = (accordionIndex) => (attr, error) => {
52
+ const newAccordionErrors = { ...this.state.accordionErrors };
53
+ if (!newAccordionErrors[accordionIndex]) {
54
+ newAccordionErrors[accordionIndex] = {};
55
+ }
56
+ if (!error) {
57
+ delete newAccordionErrors[accordionIndex][attr];
58
+ // Clean up empty accordion error objects
59
+ if (Object.keys(newAccordionErrors[accordionIndex]).length === 0) {
60
+ delete newAccordionErrors[accordionIndex];
61
+ }
62
+ }
63
+ else {
64
+ newAccordionErrors[accordionIndex][attr] = error;
65
+ }
66
+ this.setState({ accordionErrors: newAccordionErrors });
67
+ // Also forward to parent
68
+ this.props.onError(attr, error);
69
+ };
70
+ hasAccordionErrors = (accordionIndex) => {
71
+ return !!(this.state.accordionErrors[accordionIndex] &&
72
+ Object.keys(this.state.accordionErrors[accordionIndex]).length > 0);
73
+ };
50
74
  itemAccordion(data, idx) {
51
75
  const { value } = this.state;
52
76
  const { schema } = this.props;
@@ -62,7 +86,7 @@ class ConfigAccordion extends ConfigGeneric {
62
86
  const newObj = JSON.parse(JSON.stringify(value));
63
87
  newObj[idx][attr] = valueChange;
64
88
  this.setState({ value: newObj }, () => this.onChangeWrapper(newObj));
65
- }, onError: (error, attr) => this.onError(error, attr), table: this.props.table }));
89
+ }, onError: this.onAccordionError(idx), table: this.props.table }));
66
90
  }
67
91
  onDelete = (index) => () => {
68
92
  const newValue = JSON.parse(JSON.stringify(this.state.value));
@@ -150,6 +174,50 @@ class ConfigAccordion extends ConfigGeneric {
150
174
  const newIndex = this.state.activeIndex + 1;
151
175
  this.setState({ value: newValue, activeIndex: newIndex, iteration: this.state.iteration + 10000 }, () => this.onChangeWrapper(newValue));
152
176
  }
177
+ onExport = () => {
178
+ const { value } = this.state;
179
+ const dataStr = JSON.stringify(value, null, 2);
180
+ const dataUri = `data:application/json;charset=utf-8,${encodeURIComponent(dataStr)}`;
181
+ const exportFileDefaultName = `config_section_${new Date().toISOString().slice(0, 19).replace(/:/g, '-')}.json`;
182
+ const linkElement = document.createElement('a');
183
+ linkElement.setAttribute('href', dataUri);
184
+ linkElement.setAttribute('download', exportFileDefaultName);
185
+ linkElement.click();
186
+ };
187
+ onImport = (replace) => {
188
+ const input = document.createElement('input');
189
+ input.type = 'file';
190
+ input.accept = '.json';
191
+ input.onchange = (event) => {
192
+ const file = event.target.files?.[0];
193
+ if (!file) {
194
+ return;
195
+ }
196
+ const reader = new FileReader();
197
+ reader.onload = e => {
198
+ try {
199
+ const jsonData = JSON.parse(e.target?.result);
200
+ if (!Array.isArray(jsonData)) {
201
+ alert(I18n.t('ra_Invalid JSON format. Expected an array.'));
202
+ return;
203
+ }
204
+ let newValue;
205
+ if (replace) {
206
+ newValue = jsonData;
207
+ }
208
+ else {
209
+ newValue = [...this.state.value, ...jsonData];
210
+ }
211
+ this.setState({ value: newValue, activeIndex: -1 }, () => this.onChangeWrapper(newValue));
212
+ }
213
+ catch {
214
+ alert(I18n.t('ra_Invalid JSON file.'));
215
+ }
216
+ };
217
+ reader.readAsText(file);
218
+ };
219
+ input.click();
220
+ };
153
221
  renderItem( /* error, disabled, defaultValue */) {
154
222
  const { schema } = this.props;
155
223
  const { value } = this.state;
@@ -159,11 +227,23 @@ class ConfigAccordion extends ConfigGeneric {
159
227
  return (React.createElement(Paper, null,
160
228
  schema.label || !schema.noDelete ? (React.createElement(Toolbar, { variant: "dense" },
161
229
  schema.label ? (React.createElement(Typography, { variant: "h6", id: "tableTitle", component: "div" }, this.getText(schema.label))) : null,
162
- !schema.noDelete ? (React.createElement(IconButton, { size: "small", color: "primary", onClick: this.onAdd },
163
- React.createElement(AddIcon, null))) : null)) : null,
230
+ !schema.noDelete ? (React.createElement(React.Fragment, null,
231
+ React.createElement(Tooltip, { title: I18n.t('ra_Export configuration section') },
232
+ React.createElement(IconButton, { size: "small", color: "primary", onClick: this.onExport },
233
+ React.createElement(FileDownloadIcon, null))),
234
+ React.createElement(Tooltip, { title: I18n.t('ra_Import and replace configuration section') },
235
+ React.createElement(IconButton, { size: "small", color: "primary", onClick: () => this.onImport(true) },
236
+ React.createElement(FileUploadIcon, null))),
237
+ React.createElement(Tooltip, { title: I18n.t('ra_Import and add configuration section') },
238
+ React.createElement(IconButton, { size: "small", color: "primary", onClick: () => this.onImport(false) },
239
+ React.createElement(AddCircleIcon, null))),
240
+ React.createElement(IconButton, { size: "small", color: "primary", onClick: this.onAdd },
241
+ React.createElement(AddIcon, null)))) : null)) : null,
164
242
  value.map((idx, i) => (React.createElement(Accordion, { key: `${idx}_${i}`, expanded: this.state.activeIndex === i, onChange: (_e, expanded) => this.setState({ activeIndex: expanded ? i : -1 }) },
165
243
  React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null), sx: Utils.getStyle(this.props.oContext.theme, styles.fullWidth, styles.accordionSummary) },
166
- React.createElement(Typography, { style: styles.accordionTitle }, idx[schema.titleAttr])),
244
+ React.createElement(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, width: '100%' } },
245
+ React.createElement(Typography, { style: styles.accordionTitle }, idx[schema.titleAttr]),
246
+ this.hasAccordionErrors(i) && React.createElement(ErrorIcon, { sx: { fontSize: 20, color: 'error.main' } }))),
167
247
  React.createElement(AccordionDetails, { style: {
168
248
  ...schema.style,
169
249
  ...(this.props.oContext.themeType ? schema.darkStyle : undefined),