@iobroker/json-config 1.0.0
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/LICENSE +21 -0
- package/build/JsonConfig.d.ts +22 -0
- package/build/JsonConfig.js +535 -0
- package/build/JsonConfig.js.map +1 -0
- package/build/JsonConfigComponent/ChipInput.d.ts +12 -0
- package/build/JsonConfigComponent/ChipInput.js +595 -0
- package/build/JsonConfigComponent/ChipInput.js.map +1 -0
- package/build/JsonConfigComponent/ConfigAccordion.d.ts +15 -0
- package/build/JsonConfigComponent/ConfigAccordion.js +185 -0
- package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -0
- package/build/JsonConfigComponent/ConfigAlive.d.ts +10 -0
- package/build/JsonConfigComponent/ConfigAlive.js +63 -0
- package/build/JsonConfigComponent/ConfigAlive.js.map +1 -0
- package/build/JsonConfigComponent/ConfigAutocomplete.d.ts +37 -0
- package/build/JsonConfigComponent/ConfigAutocomplete.js +69 -0
- package/build/JsonConfigComponent/ConfigAutocomplete.js.map +1 -0
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +127 -0
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCRON.d.ts +15 -0
- package/build/JsonConfigComponent/ConfigCRON.js +55 -0
- package/build/JsonConfigComponent/ConfigCRON.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCertCollection.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigCertCollection.js +50 -0
- package/build/JsonConfigComponent/ConfigCertCollection.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCertificateSelect.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigCertificateSelect.js +59 -0
- package/build/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCertificates.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigCertificates.js +104 -0
- package/build/JsonConfigComponent/ConfigCertificates.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCheckLicense.d.ts +3 -0
- package/build/JsonConfigComponent/ConfigCheckLicense.js +546 -0
- package/build/JsonConfigComponent/ConfigCheckLicense.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCheckbox.d.ts +15 -0
- package/build/JsonConfigComponent/ConfigCheckbox.js +36 -0
- package/build/JsonConfigComponent/ConfigCheckbox.js.map +1 -0
- package/build/JsonConfigComponent/ConfigChip.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigChip.js +67 -0
- package/build/JsonConfigComponent/ConfigChip.js.map +1 -0
- package/build/JsonConfigComponent/ConfigColor.d.ts +22 -0
- package/build/JsonConfigComponent/ConfigColor.js +57 -0
- package/build/JsonConfigComponent/ConfigColor.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCoordinates.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigCoordinates.js +146 -0
- package/build/JsonConfigComponent/ConfigCoordinates.js.map +1 -0
- package/build/JsonConfigComponent/ConfigCustom.d.ts +26 -0
- package/build/JsonConfigComponent/ConfigCustom.js +195 -0
- package/build/JsonConfigComponent/ConfigCustom.js.map +1 -0
- package/build/JsonConfigComponent/ConfigDatePicker.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigDatePicker.js +39 -0
- package/build/JsonConfigComponent/ConfigDatePicker.js.map +1 -0
- package/build/JsonConfigComponent/ConfigDeviceManager.d.ts +6 -0
- package/build/JsonConfigComponent/ConfigDeviceManager.js +14 -0
- package/build/JsonConfigComponent/ConfigDeviceManager.js.map +1 -0
- package/build/JsonConfigComponent/ConfigFile.d.ts +15 -0
- package/build/JsonConfigComponent/ConfigFile.js +131 -0
- package/build/JsonConfigComponent/ConfigFile.js.map +1 -0
- package/build/JsonConfigComponent/ConfigFileSelector.d.ts +3 -0
- package/build/JsonConfigComponent/ConfigFileSelector.js +434 -0
- package/build/JsonConfigComponent/ConfigFileSelector.js.map +1 -0
- package/build/JsonConfigComponent/ConfigFunc.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigFunc.js +56 -0
- package/build/JsonConfigComponent/ConfigFunc.js.map +1 -0
- package/build/JsonConfigComponent/ConfigGeneric.d.ts +95 -0
- package/build/JsonConfigComponent/ConfigGeneric.js +632 -0
- package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -0
- package/build/JsonConfigComponent/ConfigIP.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigIP.js +64 -0
- package/build/JsonConfigComponent/ConfigIP.js.map +1 -0
- package/build/JsonConfigComponent/ConfigImageSendTo.d.ts +10 -0
- package/build/JsonConfigComponent/ConfigImageSendTo.js +62 -0
- package/build/JsonConfigComponent/ConfigImageSendTo.js.map +1 -0
- package/build/JsonConfigComponent/ConfigImageUpload.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigImageUpload.js +91 -0
- package/build/JsonConfigComponent/ConfigImageUpload.js.map +1 -0
- package/build/JsonConfigComponent/ConfigInstanceSelect.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigInstanceSelect.js +133 -0
- package/build/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -0
- package/build/JsonConfigComponent/ConfigInterface.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigInterface.js +74 -0
- package/build/JsonConfigComponent/ConfigInterface.js.map +1 -0
- package/build/JsonConfigComponent/ConfigJsonEditor.d.ts +13 -0
- package/build/JsonConfigComponent/ConfigJsonEditor.js +59 -0
- package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -0
- package/build/JsonConfigComponent/ConfigLanguage.d.ts +7 -0
- package/build/JsonConfigComponent/ConfigLanguage.js +105 -0
- package/build/JsonConfigComponent/ConfigLanguage.js.map +1 -0
- package/build/JsonConfigComponent/ConfigLicense.d.ts +24 -0
- package/build/JsonConfigComponent/ConfigLicense.js +95 -0
- package/build/JsonConfigComponent/ConfigLicense.js.map +1 -0
- package/build/JsonConfigComponent/ConfigNumber.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigNumber.js +114 -0
- package/build/JsonConfigComponent/ConfigNumber.js.map +1 -0
- package/build/JsonConfigComponent/ConfigObjectId.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigObjectId.js +59 -0
- package/build/JsonConfigComponent/ConfigObjectId.js.map +1 -0
- package/build/JsonConfigComponent/ConfigPanel.d.ts +3 -0
- package/build/JsonConfigComponent/ConfigPanel.js +271 -0
- package/build/JsonConfigComponent/ConfigPanel.js.map +1 -0
- package/build/JsonConfigComponent/ConfigPassword.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigPassword.js +105 -0
- package/build/JsonConfigComponent/ConfigPassword.js.map +1 -0
- package/build/JsonConfigComponent/ConfigPattern.d.ts +21 -0
- package/build/JsonConfigComponent/ConfigPattern.js +32 -0
- package/build/JsonConfigComponent/ConfigPattern.js.map +1 -0
- package/build/JsonConfigComponent/ConfigPort.d.ts +3 -0
- package/build/JsonConfigComponent/ConfigPort.js +174 -0
- package/build/JsonConfigComponent/ConfigPort.js.map +1 -0
- package/build/JsonConfigComponent/ConfigRoom.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigRoom.js +56 -0
- package/build/JsonConfigComponent/ConfigRoom.js.map +1 -0
- package/build/JsonConfigComponent/ConfigSelect.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigSelect.js +90 -0
- package/build/JsonConfigComponent/ConfigSelect.js.map +1 -0
- package/build/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigSelectSendTo.js +175 -0
- package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -0
- package/build/JsonConfigComponent/ConfigSendto.d.ts +24 -0
- package/build/JsonConfigComponent/ConfigSendto.js +290 -0
- package/build/JsonConfigComponent/ConfigSendto.js.map +1 -0
- package/build/JsonConfigComponent/ConfigSetState.d.ts +18 -0
- package/build/JsonConfigComponent/ConfigSetState.js +93 -0
- package/build/JsonConfigComponent/ConfigSetState.js.map +1 -0
- package/build/JsonConfigComponent/ConfigSlider.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigSlider.js +62 -0
- package/build/JsonConfigComponent/ConfigSlider.js.map +1 -0
- package/build/JsonConfigComponent/ConfigStaticDivider.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigStaticDivider.js +39 -0
- package/build/JsonConfigComponent/ConfigStaticDivider.js.map +1 -0
- package/build/JsonConfigComponent/ConfigStaticHeader.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigStaticHeader.js +45 -0
- package/build/JsonConfigComponent/ConfigStaticHeader.js.map +1 -0
- package/build/JsonConfigComponent/ConfigStaticImage.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigStaticImage.js +36 -0
- package/build/JsonConfigComponent/ConfigStaticImage.js.map +1 -0
- package/build/JsonConfigComponent/ConfigStaticText.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigStaticText.js +51 -0
- package/build/JsonConfigComponent/ConfigStaticText.js.map +1 -0
- package/build/JsonConfigComponent/ConfigTable.d.ts +3 -0
- package/build/JsonConfigComponent/ConfigTable.js +670 -0
- package/build/JsonConfigComponent/ConfigTable.js.map +1 -0
- package/build/JsonConfigComponent/ConfigTabs.d.ts +34 -0
- package/build/JsonConfigComponent/ConfigTabs.js +90 -0
- package/build/JsonConfigComponent/ConfigTabs.js.map +1 -0
- package/build/JsonConfigComponent/ConfigText.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigText.js +105 -0
- package/build/JsonConfigComponent/ConfigText.js.map +1 -0
- package/build/JsonConfigComponent/ConfigTextSendTo.d.ts +10 -0
- package/build/JsonConfigComponent/ConfigTextSendTo.js +76 -0
- package/build/JsonConfigComponent/ConfigTextSendTo.js.map +1 -0
- package/build/JsonConfigComponent/ConfigTimePicker.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigTimePicker.js +37 -0
- package/build/JsonConfigComponent/ConfigTimePicker.js.map +1 -0
- package/build/JsonConfigComponent/ConfigTopic.d.ts +17 -0
- package/build/JsonConfigComponent/ConfigTopic.js +61 -0
- package/build/JsonConfigComponent/ConfigTopic.js.map +1 -0
- package/build/JsonConfigComponent/ConfigUUID.d.ts +15 -0
- package/build/JsonConfigComponent/ConfigUUID.js +31 -0
- package/build/JsonConfigComponent/ConfigUUID.js.map +1 -0
- package/build/JsonConfigComponent/ConfigUser.d.ts +14 -0
- package/build/JsonConfigComponent/ConfigUser.js +70 -0
- package/build/JsonConfigComponent/ConfigUser.js.map +1 -0
- package/build/JsonConfigComponent/index.d.ts +26 -0
- package/build/JsonConfigComponent/index.js +312 -0
- package/build/JsonConfigComponent/index.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/AdminConnection.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/AdminConnection.js +3 -0
- package/build/JsonConfigComponent/wrapper/AdminConnection.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Components/ColorPicker.js +3 -0
- package/build/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.d.ts +3 -0
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.js +87 -0
- package/build/JsonConfigComponent/wrapper/Components/CustomModal.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/Editor.d.ts +14 -0
- package/build/JsonConfigComponent/wrapper/Components/Editor.js +43 -0
- package/build/JsonConfigComponent/wrapper/Components/Editor.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/Icon.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Components/Icon.js +3 -0
- package/build/JsonConfigComponent/wrapper/Components/Icon.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Components/TextWithIcon.js +3 -0
- package/build/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Components/UploadImage.js +3 -0
- package/build/JsonConfigComponent/wrapper/Components/UploadImage.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Components/Utils.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Components/Utils.js +3 -0
- package/build/JsonConfigComponent/wrapper/Components/Utils.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Confirm.js +3 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Cron.js +3 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Error.js +3 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Error.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Message.js +3 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/Message.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +3 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/SelectID.js +3 -0
- package/build/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/i18n.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/i18n.js +3 -0
- package/build/JsonConfigComponent/wrapper/i18n.js.map +1 -0
- package/build/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +2 -0
- package/build/JsonConfigComponent/wrapper/icons/IconCopy.js +3 -0
- package/build/JsonConfigComponent/wrapper/icons/IconCopy.js.map +1 -0
- package/build/Utils.d.ts +376 -0
- package/build/Utils.js +1595 -0
- package/build/Utils.js.map +1 -0
- package/build/index.d.ts +5 -0
- package/build/index.js +6 -0
- package/build/index.js.map +1 -0
- package/package.json +17 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notice: Some code was adapted from Material-UI's text field.
|
|
3
|
+
* Copyright (c) 2014 Call-Em-All (https://github.com/callemall/material-ui)
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import ReactDOM from 'react-dom';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { withStyles } from '@mui/styles';
|
|
9
|
+
import { Input, OutlinedInput, InputLabel, Chip, FormControl, FormHelperText, } from '@mui/material';
|
|
10
|
+
import FilledInput from '@mui/material/FilledInput/FilledInput';
|
|
11
|
+
import blue from '@mui/material/colors/blue';
|
|
12
|
+
import Utils from '../Utils';
|
|
13
|
+
const variantComponent = {
|
|
14
|
+
standard: Input,
|
|
15
|
+
filled: FilledInput,
|
|
16
|
+
outlined: OutlinedInput,
|
|
17
|
+
};
|
|
18
|
+
const styles = theme => {
|
|
19
|
+
const light = theme.palette.type === 'light';
|
|
20
|
+
const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
21
|
+
return {
|
|
22
|
+
root: {},
|
|
23
|
+
inputRoot: {
|
|
24
|
+
display: 'inline-flex',
|
|
25
|
+
flexWrap: 'wrap',
|
|
26
|
+
flex: 1,
|
|
27
|
+
marginTop: 0,
|
|
28
|
+
minWidth: 70,
|
|
29
|
+
'&$outlined,&$filled': {
|
|
30
|
+
boxSizing: 'border-box',
|
|
31
|
+
},
|
|
32
|
+
'&$outlined': {
|
|
33
|
+
paddingTop: 14,
|
|
34
|
+
},
|
|
35
|
+
'&$filled': {
|
|
36
|
+
paddingTop: 28,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
input: {
|
|
40
|
+
display: 'inline-block',
|
|
41
|
+
textOverflow: 'ellipsis',
|
|
42
|
+
overflow: 'hidden',
|
|
43
|
+
whiteSpace: 'nowrap',
|
|
44
|
+
appearance: 'none',
|
|
45
|
+
WebkitTapHighlightColor: 'rgba(0,0,0,0)',
|
|
46
|
+
float: 'left',
|
|
47
|
+
flex: 1,
|
|
48
|
+
},
|
|
49
|
+
chipContainer: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexFlow: 'row wrap',
|
|
52
|
+
cursor: 'text',
|
|
53
|
+
marginBottom: -2,
|
|
54
|
+
minHeight: 40,
|
|
55
|
+
'&$labeled&$standard': {
|
|
56
|
+
marginTop: 18,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
outlined: {
|
|
60
|
+
'& input': {
|
|
61
|
+
height: 16,
|
|
62
|
+
paddingTop: 4,
|
|
63
|
+
paddingBottom: 12,
|
|
64
|
+
marginTop: 4,
|
|
65
|
+
marginBottom: 4,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
standard: {},
|
|
69
|
+
filled: {
|
|
70
|
+
'& input': {
|
|
71
|
+
height: 22,
|
|
72
|
+
marginBottom: 4,
|
|
73
|
+
marginTop: 4,
|
|
74
|
+
paddingTop: 0,
|
|
75
|
+
},
|
|
76
|
+
'$marginDense & input': {
|
|
77
|
+
height: 26,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
labeled: {},
|
|
81
|
+
label: {
|
|
82
|
+
top: 4,
|
|
83
|
+
'&$outlined&:not($labelShrink)': {
|
|
84
|
+
top: 2,
|
|
85
|
+
'$marginDense &': {
|
|
86
|
+
top: 5,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
'&$filled&:not($labelShrink)': {
|
|
90
|
+
top: 15,
|
|
91
|
+
'$marginDense &': {
|
|
92
|
+
top: 20,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
labelShrink: {
|
|
97
|
+
top: 0,
|
|
98
|
+
},
|
|
99
|
+
helperText: {
|
|
100
|
+
marginBottom: -20,
|
|
101
|
+
},
|
|
102
|
+
focused: {},
|
|
103
|
+
disabled: {},
|
|
104
|
+
underline: {
|
|
105
|
+
'&:after': {
|
|
106
|
+
borderBottom: `2px solid ${theme.palette.primary[light ? 'dark' : 'light']}`,
|
|
107
|
+
left: 0,
|
|
108
|
+
bottom: 0,
|
|
109
|
+
// Doing the other way around a crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
110
|
+
content: '""',
|
|
111
|
+
position: 'absolute',
|
|
112
|
+
right: 0,
|
|
113
|
+
transform: 'scaleX(0)',
|
|
114
|
+
transition: theme.transitions.create('transform', {
|
|
115
|
+
duration: theme.transitions.duration.shorter,
|
|
116
|
+
easing: theme.transitions.easing.easeOut,
|
|
117
|
+
}),
|
|
118
|
+
pointerEvents: 'none', // Transparent to the hover style.
|
|
119
|
+
},
|
|
120
|
+
'&$focused:after': {
|
|
121
|
+
transform: 'scaleX(1)',
|
|
122
|
+
},
|
|
123
|
+
'&$error:after': {
|
|
124
|
+
borderBottomColor: theme.palette.error.main,
|
|
125
|
+
transform: 'scaleX(1)', // error is always underlined in red
|
|
126
|
+
},
|
|
127
|
+
'&:before': {
|
|
128
|
+
borderBottom: `1px solid ${bottomLineColor}`,
|
|
129
|
+
left: 0,
|
|
130
|
+
bottom: 0,
|
|
131
|
+
// Doing the other way around a crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
|
|
132
|
+
content: '"\\00a0"',
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
right: 0,
|
|
135
|
+
transition: theme.transitions.create('border-bottom-color', {
|
|
136
|
+
duration: theme.transitions.duration.shorter,
|
|
137
|
+
}),
|
|
138
|
+
pointerEvents: 'none', // Transparent to the hover style.
|
|
139
|
+
},
|
|
140
|
+
'&:hover:not($disabled):not($focused):not($error):before': {
|
|
141
|
+
borderBottom: `2px solid ${theme.palette.text.primary}`,
|
|
142
|
+
// Reset on touch devices, it doesn't add specificity
|
|
143
|
+
'@media (hover: none)': {
|
|
144
|
+
borderBottom: `1px solid ${bottomLineColor}`,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
'&$disabled:before': {
|
|
148
|
+
borderBottomStyle: 'dotted',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
error: {
|
|
152
|
+
'&:after': {
|
|
153
|
+
backgroundColor: theme.palette.error.main,
|
|
154
|
+
transform: 'scaleX(1)', // error is always underlined in red
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
chip: {
|
|
158
|
+
margin: '0 8px 8px 0',
|
|
159
|
+
float: 'left',
|
|
160
|
+
},
|
|
161
|
+
marginDense: {},
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
const keyCodes = {
|
|
165
|
+
BACKSPACE: 8,
|
|
166
|
+
DELETE: 46,
|
|
167
|
+
LEFT_ARROW: 37,
|
|
168
|
+
RIGHT_ARROW: 39,
|
|
169
|
+
};
|
|
170
|
+
export const defaultChipRenderer = ({ text, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, className, }, key) => React.createElement(Chip, { key: key, className: className, style: {
|
|
171
|
+
pointerEvents: isDisabled || isReadOnly ? 'none' : undefined,
|
|
172
|
+
backgroundColor: isFocused ? blue[300] : undefined,
|
|
173
|
+
}, onClick: handleClick, onDelete: handleDelete, label: text });
|
|
174
|
+
class ChipInput extends React.Component {
|
|
175
|
+
constructor(props) {
|
|
176
|
+
super(props);
|
|
177
|
+
this.state = {
|
|
178
|
+
chips: [],
|
|
179
|
+
focusedChip: null,
|
|
180
|
+
inputValue: '',
|
|
181
|
+
isFocused: false,
|
|
182
|
+
chipsUpdated: false,
|
|
183
|
+
prevPropsValue: [],
|
|
184
|
+
};
|
|
185
|
+
if (props.defaultValue) {
|
|
186
|
+
this.state.chips = props.defaultValue;
|
|
187
|
+
}
|
|
188
|
+
this.labelRef = React.createRef();
|
|
189
|
+
this.input = React.createRef();
|
|
190
|
+
}
|
|
191
|
+
componentDidMount() {
|
|
192
|
+
if (this.props.variant === 'outlined') {
|
|
193
|
+
// eslint-disable-next-line react/no-find-dom-node
|
|
194
|
+
this.labelNode = ReactDOM.findDOMNode(this.labelRef.current);
|
|
195
|
+
this.forceUpdate();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
componentWillUnmount() {
|
|
199
|
+
clearTimeout(this.inputBlurTimeout);
|
|
200
|
+
}
|
|
201
|
+
static getDerivedStateFromProps(props, state) {
|
|
202
|
+
let newState = null;
|
|
203
|
+
if (props.value && props.value.length !== state.prevPropsValue.length) {
|
|
204
|
+
newState = { prevPropsValue: props.value };
|
|
205
|
+
if (props.clearInputValueOnChange) {
|
|
206
|
+
newState.inputValue = '';
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// if change detection is only needed for clearInputValueOnChange
|
|
210
|
+
if (props.clearInputValueOnChange && props.value && props.value.length !== state.prevPropsValue.length) {
|
|
211
|
+
newState = { prevPropsValue: props.value, inputValue: '' };
|
|
212
|
+
}
|
|
213
|
+
if (props.disabled) {
|
|
214
|
+
newState = { ...newState, focusedChip: null };
|
|
215
|
+
}
|
|
216
|
+
if (!state.chipsUpdated && props.defaultValue) {
|
|
217
|
+
newState = { ...newState, chips: props.defaultValue };
|
|
218
|
+
}
|
|
219
|
+
return newState;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Blurs this component.
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
// blur() {
|
|
226
|
+
// if (this.input) {
|
|
227
|
+
// this.actualInput.blur();
|
|
228
|
+
// }
|
|
229
|
+
// }
|
|
230
|
+
/**
|
|
231
|
+
* Focuses this component.
|
|
232
|
+
* @public
|
|
233
|
+
*/
|
|
234
|
+
focus = () => {
|
|
235
|
+
this.actualInput.focus();
|
|
236
|
+
if (this.state.focusedChip) {
|
|
237
|
+
this.setState({ focusedChip: null });
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
handleInputBlur = event => {
|
|
241
|
+
if (this.props.onBlur) {
|
|
242
|
+
this.props.onBlur(event);
|
|
243
|
+
}
|
|
244
|
+
this.setState({ isFocused: false });
|
|
245
|
+
if (this.state.focusedChip) {
|
|
246
|
+
this.setState({ focusedChip: null });
|
|
247
|
+
}
|
|
248
|
+
const value = event.target.value;
|
|
249
|
+
let addChipOptions;
|
|
250
|
+
switch (this.props.blurBehavior) {
|
|
251
|
+
case 'add-or-clear':
|
|
252
|
+
addChipOptions = { clearInputOnFail: true };
|
|
253
|
+
// falls through
|
|
254
|
+
case 'add':
|
|
255
|
+
if (this.props.delayBeforeAdd) {
|
|
256
|
+
// Let's assume that we only want to add the existing content as chip, when
|
|
257
|
+
// another event has not added a chip within 200ms.
|
|
258
|
+
// e.g., onSelection Callback in Autocomplete case
|
|
259
|
+
const numChipsBefore = (this.props.value || this.state.chips).length;
|
|
260
|
+
this.inputBlurTimeout = setTimeout(() => {
|
|
261
|
+
const numChipsAfter = (this.props.value || this.state.chips).length;
|
|
262
|
+
if (numChipsBefore === numChipsAfter) {
|
|
263
|
+
this.handleAddChip(value, addChipOptions);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
this.clearInput();
|
|
267
|
+
}
|
|
268
|
+
}, 150);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
this.handleAddChip(value, addChipOptions);
|
|
272
|
+
}
|
|
273
|
+
break;
|
|
274
|
+
case 'clear':
|
|
275
|
+
this.clearInput();
|
|
276
|
+
break;
|
|
277
|
+
default:
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
handleInputFocus = event => {
|
|
282
|
+
this.setState({ isFocused: true });
|
|
283
|
+
if (this.props.onFocus) {
|
|
284
|
+
this.props.onFocus(event);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
handleKeyDown = event => {
|
|
288
|
+
const { focusedChip } = this.state;
|
|
289
|
+
this._keyPressed = false;
|
|
290
|
+
this._preventChipCreation = false;
|
|
291
|
+
if (this.props.onKeyDown) {
|
|
292
|
+
// Needed for arrow controls on a menu in autocomplete scenario
|
|
293
|
+
this.props.onKeyDown(event);
|
|
294
|
+
// Check if the callback marked the event as isDefaultPrevented() and skip further actions
|
|
295
|
+
// enter key, for example, should not always add the current value of the inputField
|
|
296
|
+
if (event.isDefaultPrevented()) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const chips = this.props.value || this.state.chips;
|
|
301
|
+
if (this.props.newChipKeyCodes.includes(event.keyCode) || this.props.newChipKeys.includes(event.key)) {
|
|
302
|
+
const result = this.handleAddChip(event.target.value);
|
|
303
|
+
if (result !== false) {
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
}
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
switch (event.keyCode) {
|
|
309
|
+
case keyCodes.BACKSPACE:
|
|
310
|
+
if (event.target.value === '') {
|
|
311
|
+
if (focusedChip) {
|
|
312
|
+
this.handleDeleteChip(chips[focusedChip], focusedChip);
|
|
313
|
+
if (focusedChip) {
|
|
314
|
+
this.setState({ focusedChip: focusedChip - 1 });
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
this.setState({ focusedChip: chips.length - 1 });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
break;
|
|
322
|
+
case keyCodes.DELETE:
|
|
323
|
+
if (event.target.value === '' && focusedChip) {
|
|
324
|
+
this.handleDeleteChip(chips[focusedChip], focusedChip);
|
|
325
|
+
if (focusedChip <= chips.length - 1) {
|
|
326
|
+
this.setState({ focusedChip });
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
break;
|
|
330
|
+
case keyCodes.LEFT_ARROW:
|
|
331
|
+
if (focusedChip === null && event.target.value === '' && chips.length) {
|
|
332
|
+
this.setState({ focusedChip: chips.length - 1 });
|
|
333
|
+
}
|
|
334
|
+
else if (focusedChip !== null && focusedChip > 0) {
|
|
335
|
+
this.setState({ focusedChip: focusedChip - 1 });
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
case keyCodes.RIGHT_ARROW:
|
|
339
|
+
if (focusedChip !== null && focusedChip < chips.length - 1) {
|
|
340
|
+
this.setState({ focusedChip: focusedChip + 1 });
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
this.setState({ focusedChip: null });
|
|
344
|
+
}
|
|
345
|
+
break;
|
|
346
|
+
default:
|
|
347
|
+
this.setState({ focusedChip: null });
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
handleKeyUp = event => {
|
|
352
|
+
if (!this._preventChipCreation && (this.props.newChipKeyCodes.indexOf(event.keyCode) >= 0 || this.props.newChipKeys.indexOf(event.key) >= 0) && this._keyPressed) {
|
|
353
|
+
this.clearInput();
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
this.updateInput(event.target.value);
|
|
357
|
+
}
|
|
358
|
+
if (this.props.onKeyUp) {
|
|
359
|
+
this.props.onKeyUp(event);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
handleKeyPress = event => {
|
|
363
|
+
this._keyPressed = true;
|
|
364
|
+
if (this.props.onKeyPress) {
|
|
365
|
+
this.props.onKeyPress(event);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
handleUpdateInput = e => {
|
|
369
|
+
if (this.props.inputValue === null || this.props.inputValue === undefined) {
|
|
370
|
+
this.updateInput(e.target.value);
|
|
371
|
+
}
|
|
372
|
+
if (this.props.onUpdateInput) {
|
|
373
|
+
this.props.onUpdateInput(e);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* Handles adding a chip.
|
|
378
|
+
* @param {string|object} chip Value of the chip, either a string or an object (if dataSourceConfig is set)
|
|
379
|
+
* @param {object=} options Additional options
|
|
380
|
+
* @param {boolean=} options.clearInputOnFail If `true`, and `onBeforeAdd` returns `false`, clear the input
|
|
381
|
+
* @returns True if the chip was added (or at least `onAdd` was called), false if adding the chip was prevented
|
|
382
|
+
*/
|
|
383
|
+
handleAddChip(chip, options) {
|
|
384
|
+
if (this.props.onBeforeAdd && !this.props.onBeforeAdd(chip)) {
|
|
385
|
+
this._preventChipCreation = true;
|
|
386
|
+
if (options && options.clearInputOnFail) {
|
|
387
|
+
this.clearInput();
|
|
388
|
+
}
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
this.clearInput();
|
|
392
|
+
const chips = this.props.value || this.state.chips;
|
|
393
|
+
if (this.props.dataSourceConfig) {
|
|
394
|
+
if (typeof chip === 'string') {
|
|
395
|
+
chip = {
|
|
396
|
+
[this.props.dataSourceConfig.text]: chip,
|
|
397
|
+
[this.props.dataSourceConfig.value]: chip,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
if (this.props.allowDuplicates || !chips.some(c => c[this.props.dataSourceConfig.value] === chip[this.props.dataSourceConfig.value])) {
|
|
401
|
+
if (this.props.value && this.props.onAdd) {
|
|
402
|
+
this.props.onAdd(chip);
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
this.updateChips([...this.state.chips, chip]);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
if (chip.trim().length > 0) {
|
|
411
|
+
if (this.props.allowDuplicates || !chips.includes(chip)) {
|
|
412
|
+
if (this.props.value && this.props.onAdd) {
|
|
413
|
+
this.props.onAdd(chip);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
this.updateChips([...this.state.chips, chip]);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return true;
|
|
420
|
+
}
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
handleDeleteChip(chip, i) {
|
|
424
|
+
if (!this.props.value) {
|
|
425
|
+
const chips = this.state.chips.slice();
|
|
426
|
+
const changed = chips.splice(i, 1); // remove the chip at index i
|
|
427
|
+
if (changed) {
|
|
428
|
+
let focusedChip = this.state.focusedChip;
|
|
429
|
+
if (this.state.focusedChip === i) {
|
|
430
|
+
focusedChip = null;
|
|
431
|
+
}
|
|
432
|
+
else if (this.state.focusedChip > i) {
|
|
433
|
+
focusedChip = this.state.focusedChip - 1;
|
|
434
|
+
}
|
|
435
|
+
this.updateChips(chips, { focusedChip });
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
else if (this.props.onDelete) {
|
|
439
|
+
this.props.onDelete(chip, i);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
updateChips(chips, additionalUpdates = {}) {
|
|
443
|
+
this.setState({ chips, chipsUpdated: true, ...additionalUpdates });
|
|
444
|
+
if (this.props.onChange) {
|
|
445
|
+
this.props.onChange(chips);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Clears the text field for adding new chips.
|
|
450
|
+
* This only works in uncontrolled input mode, i.e. if the inputValue prop is not used.
|
|
451
|
+
* @public
|
|
452
|
+
*/
|
|
453
|
+
clearInput() {
|
|
454
|
+
this.updateInput('');
|
|
455
|
+
}
|
|
456
|
+
updateInput(value) {
|
|
457
|
+
this.setState({ inputValue: value });
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Set the reference to the actual input, that is the input of the Input.
|
|
461
|
+
* @param {object} ref - The reference
|
|
462
|
+
*/
|
|
463
|
+
setActualInputRef = ref => {
|
|
464
|
+
this.actualInput = ref;
|
|
465
|
+
this.props.inputRef && this.props.inputRef(ref);
|
|
466
|
+
};
|
|
467
|
+
render() {
|
|
468
|
+
const { alwaysShowPlaceholder, chipRenderer = defaultChipRenderer, classes, className, dataSourceConfig, disabled, disableUnderline, error, FormHelperTextProps, fullWidth, fullWidthInput, helperText, id, InputProps = {}, InputLabelProps = {}, inputValue, label, placeholder, readOnly, required, rootRef, value, variant, ...other } = this.props;
|
|
469
|
+
let chips = value || this.state.chips || [];
|
|
470
|
+
if (!Array.isArray(chips)) {
|
|
471
|
+
chips = (chips || '').toString().split(/[,\s]+/).map(c => c.trim());
|
|
472
|
+
}
|
|
473
|
+
const actualInputValue = inputValue ?? this.state.inputValue;
|
|
474
|
+
const hasInput = (this.props.value || actualInputValue).length || actualInputValue.length;
|
|
475
|
+
const shrinkFloatingLabel = typeof InputLabelProps.shrink === 'boolean'
|
|
476
|
+
? InputLabelProps.shrink
|
|
477
|
+
: (label !== null && (hasInput || this.state.isFocused || chips.length));
|
|
478
|
+
const chipComponents = chips.map((chip, i) => {
|
|
479
|
+
const value_ = dataSourceConfig ? chip[dataSourceConfig.value] : chip;
|
|
480
|
+
return chipRenderer({
|
|
481
|
+
value: value_,
|
|
482
|
+
text: dataSourceConfig ? chip[dataSourceConfig.text] : chip,
|
|
483
|
+
chip,
|
|
484
|
+
isDisabled: !!disabled,
|
|
485
|
+
isReadOnly: readOnly,
|
|
486
|
+
isFocused: this.state.focusedChip === i,
|
|
487
|
+
handleClick: () => this.setState({ focusedChip: i }),
|
|
488
|
+
handleDelete: () => this.handleDeleteChip(chip, i),
|
|
489
|
+
className: classes.chip,
|
|
490
|
+
}, i);
|
|
491
|
+
});
|
|
492
|
+
const InputMore = {};
|
|
493
|
+
if (variant === 'outlined') {
|
|
494
|
+
InputMore.notched = shrinkFloatingLabel;
|
|
495
|
+
InputMore.labelWidth =
|
|
496
|
+
(shrinkFloatingLabel && this.labelNode && this.labelNode.offsetWidth) ||
|
|
497
|
+
0;
|
|
498
|
+
}
|
|
499
|
+
if (variant !== 'standard') {
|
|
500
|
+
InputMore.startAdornment = chipComponents;
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
InputProps.disableUnderline = true;
|
|
504
|
+
}
|
|
505
|
+
const InputComponent = variantComponent[variant];
|
|
506
|
+
return React.createElement(FormControl, { ref: rootRef, fullWidth: fullWidth, className: Utils.clsx(className, classes.root, other.margin === 'dense' && classes.marginDense), error: error, required: chips.length > 0 ? undefined : required, onClick: this.focus, disabled: disabled, variant: variant, ...other },
|
|
507
|
+
label && React.createElement(InputLabel, { htmlFor: id, classes: { root: Utils.clsx(classes[variant], classes.label), shrink: classes.labelShrink }, shrink: shrinkFloatingLabel, focused: this.state.isFocused, variant: variant, ref: this.labelRef, required: required, ...InputLabelProps }, label),
|
|
508
|
+
React.createElement("div", { className: Utils.clsx(classes[variant], classes.chipContainer, this.state.isFocused && classes.focused, !disableUnderline && variant === 'standard' && classes.underline, disabled && classes.disabled, label && classes.labeled, error && classes.error) },
|
|
509
|
+
variant === 'standard' && chipComponents,
|
|
510
|
+
React.createElement(InputComponent, { ref: this.input, classes: {
|
|
511
|
+
input: Utils.clsx(classes.input, classes[variant]),
|
|
512
|
+
root: Utils.clsx(classes.inputRoot, classes[variant]),
|
|
513
|
+
}, id: id, value: actualInputValue, onChange: this.handleUpdateInput, onKeyDown: this.handleKeyDown, onKeyPress: this.handleKeyPress, onKeyUp: this.handleKeyUp, onFocus: this.handleInputFocus, onBlur: this.handleInputBlur, inputRef: this.setActualInputRef, disabled: disabled, fullWidth: fullWidthInput, placeholder: (!hasInput && (shrinkFloatingLabel || label === null || label === undefined)) || alwaysShowPlaceholder ? placeholder : null, readOnly: readOnly, ...InputProps, ...InputMore })),
|
|
514
|
+
helperText && React.createElement(FormHelperText, { ...FormHelperTextProps, className: FormHelperTextProps ? Utils.clsx(FormHelperTextProps.className, classes.helperText) : classes.helperText }, helperText));
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
ChipInput.propTypes = {
|
|
518
|
+
/** Allows duplicate chips if set to true. */
|
|
519
|
+
allowDuplicates: PropTypes.bool,
|
|
520
|
+
/** If true, the placeholder will always be visible. */
|
|
521
|
+
alwaysShowPlaceholder: PropTypes.bool,
|
|
522
|
+
/** Behavior when the chip input is blurred: `'clear'` clears the input, `'add'` creates a chip and `'ignore'` keeps the input. */
|
|
523
|
+
blurBehavior: PropTypes.oneOf(['clear', 'add', 'add-or-clear', 'ignore']),
|
|
524
|
+
/** 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. */
|
|
525
|
+
chipRenderer: PropTypes.func,
|
|
526
|
+
/** Whether the input value should be cleared if the `value` prop is changed. */
|
|
527
|
+
clearInputValueOnChange: PropTypes.bool,
|
|
528
|
+
/** Data source for auto complete. This should be an array of strings or objects. */
|
|
529
|
+
dataSource: PropTypes.array,
|
|
530
|
+
/** Config for objects list dataSource, e.g. `{ text: 'text', value: 'value' }`. If not specified, the `dataSource` must be a flat array of strings or a custom `chipRenderer` must be set to handle the objects. */
|
|
531
|
+
dataSourceConfig: PropTypes.shape({
|
|
532
|
+
text: PropTypes.string.isRequired,
|
|
533
|
+
value: PropTypes.string.isRequired,
|
|
534
|
+
}),
|
|
535
|
+
/** The chips to display by default (for uncontrolled mode). */
|
|
536
|
+
defaultValue: PropTypes.array,
|
|
537
|
+
/** Whether to use `setTimeout` to delay adding chips in case other input events like `onSelection` need to fire first */
|
|
538
|
+
delayBeforeAdd: PropTypes.bool,
|
|
539
|
+
/** Disables the chip input if set to true. */
|
|
540
|
+
disabled: PropTypes.bool,
|
|
541
|
+
/** Disable the input underline. Only valid for 'standard' variant */
|
|
542
|
+
disableUnderline: PropTypes.bool,
|
|
543
|
+
/** Props to pass through to the `FormHelperText` component. */
|
|
544
|
+
FormHelperTextProps: PropTypes.object,
|
|
545
|
+
/** If true, the chip input will fill the available width. */
|
|
546
|
+
fullWidth: PropTypes.bool,
|
|
547
|
+
/** 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. */
|
|
548
|
+
fullWidthInput: PropTypes.bool,
|
|
549
|
+
/** Helper text that is displayed below the input. */
|
|
550
|
+
helperText: PropTypes.node,
|
|
551
|
+
/** Props to pass through to the `InputLabel`. */
|
|
552
|
+
InputLabelProps: PropTypes.object,
|
|
553
|
+
/** Props to pass through to the `Input`. */
|
|
554
|
+
InputProps: PropTypes.object,
|
|
555
|
+
/** Use this property to pass a ref callback to the native input component. */
|
|
556
|
+
inputRef: PropTypes.func,
|
|
557
|
+
/** The input value (enables controlled mode for the text input if set). */
|
|
558
|
+
inputValue: PropTypes.string,
|
|
559
|
+
/* The content of the floating label. */
|
|
560
|
+
label: PropTypes.node,
|
|
561
|
+
/** The key codes (`KeyboardEvent.keyCode`) used to determine when to create a new chip. */
|
|
562
|
+
newChipKeyCodes: PropTypes.arrayOf(PropTypes.number),
|
|
563
|
+
/** The keys (`KeyboardEvent.key`) used to determine when to create a new chip. */
|
|
564
|
+
newChipKeys: PropTypes.arrayOf(PropTypes.string),
|
|
565
|
+
/** Callback function that is called when a new chip was added (in controlled mode). */
|
|
566
|
+
onAdd: PropTypes.func,
|
|
567
|
+
/** 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. */
|
|
568
|
+
onBeforeAdd: PropTypes.func,
|
|
569
|
+
/** Callback function that is called when the chips change (in uncontrolled mode). */
|
|
570
|
+
onChange: PropTypes.func,
|
|
571
|
+
/** Callback function that is called when a new chip was removed (in controlled mode). */
|
|
572
|
+
onDelete: PropTypes.func,
|
|
573
|
+
/** Callback function that is called when the input changes. */
|
|
574
|
+
onUpdateInput: PropTypes.func,
|
|
575
|
+
/** A placeholder that is displayed if the input has no values. */
|
|
576
|
+
placeholder: PropTypes.string,
|
|
577
|
+
/** Makes the chip input read-only if set to true. */
|
|
578
|
+
readOnly: PropTypes.bool,
|
|
579
|
+
/** The chips to display (enables controlled mode if set). */
|
|
580
|
+
value: PropTypes.array,
|
|
581
|
+
/** The variant of the Input component */
|
|
582
|
+
variant: PropTypes.oneOf(['outlined', 'standard', 'filled']),
|
|
583
|
+
};
|
|
584
|
+
ChipInput.defaultProps = {
|
|
585
|
+
allowDuplicates: false,
|
|
586
|
+
blurBehavior: 'clear',
|
|
587
|
+
clearInputValueOnChange: false,
|
|
588
|
+
delayBeforeAdd: false,
|
|
589
|
+
disableUnderline: false,
|
|
590
|
+
newChipKeyCodes: [13],
|
|
591
|
+
newChipKeys: ['Enter'],
|
|
592
|
+
variant: 'standard',
|
|
593
|
+
};
|
|
594
|
+
export default withStyles(styles, { name: 'WAMuiChipInput' })(ChipInput);
|
|
595
|
+
//# sourceMappingURL=ChipInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChipInput.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ChipInput.jsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACH,KAAK,EACL,aAAa,EACb,UAAU,EACV,IAAI,EACJ,WAAW,EACX,cAAc,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAChE,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAE7C,OAAO,KAAK,MAAM,UAAU,CAAC;AAE7B,MAAM,gBAAgB,GAAG;IACrB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE;IACnB,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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,SAAS,CAAC,IAAI;IACxB,6DAA6D;IAC7D,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,yCAAyC;IACzC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;CAC/D,CAAC;AAEF,SAAS,CAAC,YAAY,GAAG;IACrB,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,OAAO;IACrB,uBAAuB,EAAE,KAAK;IAC9B,cAAc,EAAE,KAAK;IACrB,gBAAgB,EAAE,KAAK;IACvB,eAAe,EAAE,CAAC,EAAE,CAAC;IACrB,WAAW,EAAE,CAAC,OAAO,CAAC;IACtB,OAAO,EAAE,UAAU;CACtB,CAAC;AAEF,eAAe,UAAU,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
changed: PropTypes.Requireable<boolean>;
|
|
12
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "toolbar" | "accordionSummary" | "accordionTitle"> & object>;
|
|
13
|
+
export default _default;
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
|
+
import React from 'react';
|