@iobroker/json-config 8.0.8 → 8.1.2
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 +91 -9
- package/build/JsonConfigComponent/ChipInput.d.ts +1 -4
- package/build/JsonConfigComponent/ChipInput.js +4 -19
- package/build/JsonConfigComponent/ChipInput.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +17 -17
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigDatePicker.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigDatePicker.js +11 -3
- package/build/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
- package/build/JsonConfigComponent/ConfigIFrame.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigIFrame.js +52 -0
- package/build/JsonConfigComponent/ConfigIFrame.js.map +1 -0
- package/build/JsonConfigComponent/ConfigIFrameSendTo.d.ts +21 -0
- package/build/JsonConfigComponent/ConfigIFrameSendTo.js +90 -0
- package/build/JsonConfigComponent/ConfigIFrameSendTo.js.map +1 -0
- package/build/JsonConfigComponent/ConfigJsonEditor.d.ts +2 -2
- package/build/JsonConfigComponent/ConfigJsonEditor.js +11 -5
- package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/build/JsonConfigComponent/ConfigObjectId.js +1 -1
- package/build/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPanel.js +6 -0
- package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/build/JsonConfigComponent/ConfigYamlEditor.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigYamlEditor.js +81 -0
- package/build/JsonConfigComponent/ConfigYamlEditor.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/Editor.d.ts +2 -1
- package/build/JsonConfigComponent/wrapper/Components/Editor.js +1 -0
- package/build/JsonConfigComponent/wrapper/Components/Editor.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js.map +1 -1
- package/build/types.d.ts +90 -50
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -25,9 +25,11 @@ This guide explains how to define configuration options for your ioBroker adapte
|
|
|
25
25
|
- In your adapter's `io-package.json` file, add the following line under the `common` section:
|
|
26
26
|
|
|
27
27
|
```json
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
{
|
|
29
|
+
"common": {
|
|
30
|
+
"adminUI": {
|
|
31
|
+
"config": "json"
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
```
|
|
@@ -150,12 +152,15 @@ You can install it via GitHub icon in admin by entering `iobroker.jsonconfig-dem
|
|
|
150
152
|
- [**`fileSelector`:**](#fileselector) Allows users to select files from the system (only Admin6)
|
|
151
153
|
- [**`func`:**](#func) Selects a function from the enum.func list (Admin 6 only)
|
|
152
154
|
- [**`header`:**](#header) Creates a heading with different sizes (h1-h5)
|
|
155
|
+
- [**`iframe`:**](#iframe) Show Iframe with given URL
|
|
156
|
+
- [**`iframeSendTo`:**](#iframe) Show Iframe with URL from backend
|
|
153
157
|
- [**`image`:**](#image) Uploads or displays an image
|
|
154
158
|
- [**`imageSendTo`:**](#imagesendto) Displays an image received from the backend and sends data based on a command
|
|
155
159
|
- [**`instance`:**](#instance) Selects an adapter instance
|
|
156
160
|
- [**`interface`:**](#interface) Selects the interface from of the host, where the instance runs
|
|
157
161
|
- [**`ip`:**](#ip) Input field for IP addresses with advanced options
|
|
158
162
|
- [**`jsonEditor`:**](#jsoneditor) JSON editor for complex configuration data
|
|
163
|
+
- [**`yamlEditor`:**](#yamleditor) YAML editor for complex configuration data
|
|
159
164
|
- [**`language`:**](#language) Selects the user interface language
|
|
160
165
|
- [**`license`:**](#license) shows the license information if not already accepted.
|
|
161
166
|
- [**`number`:**](#number) Numeric input field with min/max values and step size
|
|
@@ -751,12 +756,23 @@ accordion with items that could be deleted, added, moved up, moved down (Admin 6
|
|
|
751
756
|
|
|
752
757
|
Button to open a JSON(5) editor. JSON5 is supported from admin version 5.7.3
|
|
753
758
|
|
|
754
|
-
| Property | Description
|
|
755
|
-
|
|
756
|
-
| `validateJson` | if false, the text will be not validated as JSON
|
|
757
|
-
| `allowEmpty` | if true, the JSON will be validated only if the value is not empty
|
|
758
|
-
| `json5` | if JSON5 format allowed (From 7.5.3)
|
|
759
|
-
| `doNotApplyWithError` | Do not allow to save the value if error in JSON or JSON5 (From 7.5.3)
|
|
759
|
+
| Property | Description |
|
|
760
|
+
|------------------------|-----------------------------------------------------------------------------------------|
|
|
761
|
+
| `validateJson` | if false, the text will be not validated as JSON |
|
|
762
|
+
| `allowEmpty` | if true, the JSON will be validated only if the value is not empty |
|
|
763
|
+
| `json5` | if JSON5 format allowed (From 7.5.3) |
|
|
764
|
+
| `doNotApplyWithError` | Do not allow to save the value if error in JSON or JSON5 (From 7.5.3) |
|
|
765
|
+
| `readOnly` | Open the editor in read-only mode - editor can be opened but content cannot be modified |
|
|
766
|
+
|
|
767
|
+
### `yamlEditor`
|
|
768
|
+
|
|
769
|
+
Button to open a YAML editor with syntax validation. (From admin version 7.7.30)
|
|
770
|
+
|
|
771
|
+
| Property | Description |
|
|
772
|
+
|------------------------|-----------------------------------------------------------------------------------------|
|
|
773
|
+
| `validateYaml` | if false, the text will be not validated as YAML |
|
|
774
|
+
| `allowEmpty` | if true, the YAML will be validated only if the value is not empty |
|
|
775
|
+
| `doNotApplyWithError` | Do not allow to save the value if error in YAML |
|
|
760
776
|
| `readOnly` | Open the editor in read-only mode - editor can be opened but content cannot be modified |
|
|
761
777
|
|
|
762
778
|
### `language`
|
|
@@ -919,6 +935,66 @@ adapter.on("message", (obj) => {
|
|
|
919
935
|
});
|
|
920
936
|
```
|
|
921
937
|
|
|
938
|
+
### `iframe`
|
|
939
|
+
|
|
940
|
+
Shows an iframe with the specified URL. (from Admin 7.7.24)
|
|
941
|
+
|
|
942
|
+
| Property | Description |
|
|
943
|
+
|-------------------|------------------------------------------------------------------------------------------|
|
|
944
|
+
| `url` | URL to display in the iframe. If defined, it will be static element |
|
|
945
|
+
| `allowFullscreen` | Allow fullscreen mode (default: `false`) |
|
|
946
|
+
| `sandbox` | Sandbox attributes for security restrictions (e.g., `"allow-same-origin allow-scripts"`) |
|
|
947
|
+
| `loading` | Lazy loading: `lazy` or `eager` (default: `lazy`) |
|
|
948
|
+
| `frameBorder` | Frame border width (default: `0`) |
|
|
949
|
+
| `reloadOnShow` | Reload iframe when it becomes visible in the viewport |
|
|
950
|
+
|
|
951
|
+
#### Example for `iframe`
|
|
952
|
+
|
|
953
|
+
```json
|
|
954
|
+
{
|
|
955
|
+
"type": "iframe",
|
|
956
|
+
"url": "https://example.com",
|
|
957
|
+
"allowFullscreen": true,
|
|
958
|
+
"sandbox": "allow-same-origin allow-scripts",
|
|
959
|
+
"loading": "lazy",
|
|
960
|
+
"reloadOnShow": false
|
|
961
|
+
}
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
### `iframeSendTo`
|
|
965
|
+
|
|
966
|
+
Shows an iframe with a URL received from the backend. (from Admin 7.7.24)
|
|
967
|
+
|
|
968
|
+
| Property | Description |
|
|
969
|
+
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
970
|
+
| `command` | sendTo command |
|
|
971
|
+
| `jsonData` | string - `{"subject1": "${data.subject}", "options1": {"host": "${data.host}"}}`. This data will be sent to backend |
|
|
972
|
+
| `data` | object - `{"subject1": 1, "data": "static"}`. You can specify jsonData or data, but not both. This data will be sent to backend if jsonData is not defined. |
|
|
973
|
+
|
|
974
|
+
The backend must return a URL as a string.
|
|
975
|
+
|
|
976
|
+
#### Example for `iframeSendTo`
|
|
977
|
+
|
|
978
|
+
```json
|
|
979
|
+
{
|
|
980
|
+
"type": "iframeSendTo",
|
|
981
|
+
"command": "getUrl",
|
|
982
|
+
"jsonData": "{\"param\": \"${data.value}\"}",
|
|
983
|
+
"height": 600
|
|
984
|
+
}
|
|
985
|
+
```
|
|
986
|
+
|
|
987
|
+
#### Example of code in back-end for `iframeSendTo`
|
|
988
|
+
|
|
989
|
+
```js
|
|
990
|
+
adapter.on("message", (obj) => {
|
|
991
|
+
if (obj.command === "getUrl") {
|
|
992
|
+
const url = "https://example.com?param=" + obj.message.param;
|
|
993
|
+
adapter.sendTo(obj.from, obj.command, url, obj.callback);
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
```
|
|
997
|
+
|
|
922
998
|
### `selectSendTo`
|
|
923
999
|
|
|
924
1000
|
Shows the drop-down menu with the given from the instance values.
|
|
@@ -1599,6 +1675,12 @@ The schema is used here: https://github.com/SchemaStore/schemastore/blob/6da29cd
|
|
|
1599
1675
|
### **WORK IN PROGRESS**
|
|
1600
1676
|
-->
|
|
1601
1677
|
## Changelog
|
|
1678
|
+
### 8.1.2 (2026-02-08)
|
|
1679
|
+
- (@GermanBluefox) Added component `yamlEditor` for editing yaml files in admin
|
|
1680
|
+
|
|
1681
|
+
### 8.1.1 (2026-02-06)
|
|
1682
|
+
- (@GermanBluefox) Added `iframe` and `iframeSendTo` components
|
|
1683
|
+
|
|
1602
1684
|
### 8.0.8 (2026-01-27)
|
|
1603
1685
|
- (@GermanBluefox) Fixing the `alive` component
|
|
1604
1686
|
- (@GermanBluefox) Fixing the `datePicker` component
|
|
@@ -15,7 +15,7 @@ interface ChipRendererProps {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const defaultChipRenderer: ({ value, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, style }: ChipRendererProps, key: string) => JSX.Element;
|
|
17
17
|
interface ChipInputProps {
|
|
18
|
-
/** Allows
|
|
18
|
+
/** Allows duplicated (not unique) chips if set to true. */
|
|
19
19
|
allowDuplicates?: boolean;
|
|
20
20
|
/** If true, the placeholder will always be visible. */
|
|
21
21
|
alwaysShowPlaceholder?: boolean;
|
|
@@ -111,9 +111,6 @@ export default class ChipInput extends React.Component<ChipInputProps, ChipInput
|
|
|
111
111
|
componentDidMount(): void;
|
|
112
112
|
componentWillUnmount(): void;
|
|
113
113
|
static getDerivedStateFromProps(props: ChipInputProps, state: ChipInputState): Partial<ChipInputState> | null;
|
|
114
|
-
/**
|
|
115
|
-
* Blurs this component.
|
|
116
|
-
*/
|
|
117
114
|
/**
|
|
118
115
|
* Focuses this component.
|
|
119
116
|
*/
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import ReactDOM from 'react-dom';
|
|
7
|
-
import { Input, OutlinedInput, InputLabel, Chip, FormControl, FormHelperText, Box } from '@mui/material';
|
|
8
|
-
import
|
|
9
|
-
import blue from '@mui/material/colors/blue';
|
|
7
|
+
import { Input, OutlinedInput, InputLabel, Chip, FormControl, FormHelperText, Box, FilledInput } from '@mui/material';
|
|
8
|
+
import { blue } from '@mui/material/colors';
|
|
10
9
|
import { Utils } from '@iobroker/adapter-react-v5';
|
|
11
10
|
const variantComponent = {
|
|
12
11
|
standard: Input,
|
|
@@ -230,14 +229,6 @@ export default class ChipInput extends React.Component {
|
|
|
230
229
|
}
|
|
231
230
|
return newState;
|
|
232
231
|
}
|
|
233
|
-
/**
|
|
234
|
-
* Blurs this component.
|
|
235
|
-
*/
|
|
236
|
-
// blur() {
|
|
237
|
-
// if (this.input) {
|
|
238
|
-
// this.actualInput.blur();
|
|
239
|
-
// }
|
|
240
|
-
// }
|
|
241
232
|
/**
|
|
242
233
|
* Focuses this component.
|
|
243
234
|
*/
|
|
@@ -297,10 +288,10 @@ export default class ChipInput extends React.Component {
|
|
|
297
288
|
this._keyPressed = false;
|
|
298
289
|
this._preventChipCreation = false;
|
|
299
290
|
if (this.props.onKeyDown) {
|
|
300
|
-
// Needed for arrow controls on a menu in autocomplete scenario
|
|
291
|
+
// Needed for arrow controls on a menu in an autocomplete scenario
|
|
301
292
|
this.props.onKeyDown(event);
|
|
302
293
|
// Check if the callback marked the event as isDefaultPrevented() and skip further actions
|
|
303
|
-
// enter key, for example, should not always add the current value of the inputField
|
|
294
|
+
// an enter key, for example, should not always add the current value of the inputField
|
|
304
295
|
if (event.isDefaultPrevented()) {
|
|
305
296
|
return;
|
|
306
297
|
}
|
|
@@ -369,12 +360,6 @@ export default class ChipInput extends React.Component {
|
|
|
369
360
|
this.props.onKeyUp(event);
|
|
370
361
|
}
|
|
371
362
|
};
|
|
372
|
-
// handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
373
|
-
// this._keyPressed = true;
|
|
374
|
-
// if (this.props.onKeyPress) {
|
|
375
|
-
// this.props.onKeyPress(event);
|
|
376
|
-
// }
|
|
377
|
-
// };
|
|
378
363
|
handleUpdateInput = (e) => {
|
|
379
364
|
if (this.props.inputValue === null || this.props.inputValue === undefined) {
|
|
380
365
|
this.updateInput(e.target.value);
|
|
@@ -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,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EAAE,QAAQ,EAClB,SAAS,EAAE,cAAc,EACzB,WAAW,EACP,CAAC,CAAC,QAAQ,IAAI,CAAC,mBAAmB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC;wBAC7E,qBAAqB;wBACjB,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,SAAS,EAEnB,QAAQ,EAAE,QAAQ,KACd,UAAU,KACV,SAAS,GACf,CACA;YACL,UAAU,IAAI,CACX,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"]}
|
|
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,WAAW,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,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,G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jB,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,SAAS,EAEnB,QAAQ,EAAE,QAAQ,KACd,UAAU,KACV,SAAS,GACf,CACA;YACL,UAAU,IAAI,CACX,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, FilledInput } from '@mui/material';\nimport { blue } from '@mui/material/colors';\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 duplicated (not unique) 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 * 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 an autocomplete scenario\n this.props.onKeyDown(event);\n // Check if the callback marked the event as isDefaultPrevented() and skip further actions\n // an 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 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,11 +8,11 @@ interface ConfigAutocompleteSendToProps extends ConfigGenericProps {
|
|
|
8
8
|
interface ConfigAutocompleteSendToState extends ConfigAutocompleteState {
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
export default class ConfigAutocompleteSendTo extends ConfigGeneric<ConfigAutocompleteSendToProps, ConfigAutocompleteSendToState> {
|
|
12
12
|
private initialized;
|
|
13
13
|
private localContext;
|
|
14
14
|
askInstance(): void;
|
|
15
15
|
getContext(): string;
|
|
16
16
|
renderItem(error: unknown, disabled: boolean): JSX.Element | null;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Autocomplete, TextField, CircularProgress, InputAdornment } from '@mui/material';
|
|
3
3
|
import { I18n } from '@iobroker/adapter-react-v5';
|
|
4
4
|
import ConfigGeneric from './ConfigGeneric';
|
|
5
|
-
class ConfigAutocompleteSendTo extends ConfigGeneric {
|
|
5
|
+
export default class ConfigAutocompleteSendTo extends ConfigGeneric {
|
|
6
6
|
initialized = false;
|
|
7
7
|
localContext;
|
|
8
8
|
askInstance() {
|
|
@@ -106,19 +106,18 @@ class ConfigAutocompleteSendTo extends ConfigGeneric {
|
|
|
106
106
|
item = item || null;
|
|
107
107
|
}
|
|
108
108
|
if (!options.length) {
|
|
109
|
-
return (React.createElement(TextField, { variant: "standard", fullWidth: true, value: this.state.value === null || this.state.value === undefined ? '' : this.state.value, error: !!error, disabled: disabled,
|
|
110
|
-
maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
: undefined, onChange: e => {
|
|
109
|
+
return (React.createElement(TextField, { variant: "standard", fullWidth: true, value: this.state.value === null || this.state.value === undefined ? '' : this.state.value, error: !!error, disabled: disabled, slotProps: {
|
|
110
|
+
htmlInput: { maxLength: this.props.schema.maxLength || this.props.schema.max || undefined },
|
|
111
|
+
input: {
|
|
112
|
+
endAdornment: this.state.loading ? (React.createElement(InputAdornment, { position: "end" },
|
|
113
|
+
React.createElement(CircularProgress, { size: 20 }))) : null,
|
|
114
|
+
},
|
|
115
|
+
}, onChange: e => {
|
|
117
116
|
const value = e.target.value;
|
|
118
117
|
this.setState({ value }, () => this.onChange(this.props.attr, (value || '').trim()));
|
|
119
118
|
}, placeholder: this.getText(this.props.schema.placeholder), label: this.getText(this.props.schema.label), helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation) }));
|
|
120
119
|
}
|
|
121
|
-
return (React.createElement(Autocomplete, { value: item, fullWidth: true, freeSolo: !!this.props.schema.freeSolo, options: options, isOptionEqualToValue: (option, value) => option.value === value.value, filterOptions: (options, params) => {
|
|
120
|
+
return (React.createElement(Autocomplete, { value: item, fullWidth: true, freeSolo: !!this.props.schema.freeSolo, options: options, disabled: disabled, isOptionEqualToValue: (option, value) => option.value === value.value, filterOptions: (options, params) => {
|
|
122
121
|
const filtered = options.filter(option => {
|
|
123
122
|
if (params.inputValue === '') {
|
|
124
123
|
return true;
|
|
@@ -149,14 +148,15 @@ class ConfigAutocompleteSendTo extends ConfigGeneric {
|
|
|
149
148
|
}, renderInput: params => (React.createElement(TextField, { variant: "standard", ...params,
|
|
150
149
|
// inputProps are important and will be given in params
|
|
151
150
|
// inputProps={{maxLength: this.props.schema.maxLength || this.props.schema.max || undefined}}
|
|
152
|
-
error: !!error, placeholder: this.getText(this.props.schema.placeholder), label: this.getText(this.props.schema.label), helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation), disabled: disabled,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
React.createElement(
|
|
157
|
-
|
|
151
|
+
error: !!error, placeholder: this.getText(this.props.schema.placeholder), label: this.getText(this.props.schema.label), helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation), disabled: disabled, slotProps: {
|
|
152
|
+
input: {
|
|
153
|
+
...params.InputProps,
|
|
154
|
+
endAdornment: (React.createElement(React.Fragment, null,
|
|
155
|
+
this.state.loading ? (React.createElement(InputAdornment, { position: "end" },
|
|
156
|
+
React.createElement(CircularProgress, { size: 20 }))) : null,
|
|
157
|
+
disabled ? null : params.InputProps.endAdornment)),
|
|
158
|
+
},
|
|
158
159
|
} })) }));
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
|
-
export default ConfigAutocompleteSendTo;
|
|
162
162
|
//# sourceMappingURL=ConfigAutocompleteSendTo.js.map
|