@manuscripts/style-guide 2.0.29-LEAN-4077.3 → 2.0.29-LEAN-4077.5
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.
|
@@ -102,7 +102,7 @@ const Input = styled_components_1.default.input `
|
|
|
102
102
|
|
|
103
103
|
&::-moz-appearance: textfield;
|
|
104
104
|
`;
|
|
105
|
-
const MultiValueInput = ({ inputType, initialValues = [], onChange, }) => {
|
|
105
|
+
const MultiValueInput = ({ inputType, placeholder = '', initialValues = [], onChange, }) => {
|
|
106
106
|
const [values, setValues] = (0, react_1.useState)(initialValues);
|
|
107
107
|
const [currentValue, setCurrentValue] = (0, react_1.useState)('');
|
|
108
108
|
const handleAddValue = (e) => {
|
|
@@ -130,10 +130,15 @@ const MultiValueInput = ({ inputType, initialValues = [], onChange, }) => {
|
|
|
130
130
|
setValues(updatedValues);
|
|
131
131
|
onChange === null || onChange === void 0 ? void 0 : onChange(updatedValues);
|
|
132
132
|
};
|
|
133
|
+
const xplaceholder = placeholder
|
|
134
|
+
? placeholder
|
|
135
|
+
: inputType === 'number'
|
|
136
|
+
? 'Enter number and press enter'
|
|
137
|
+
: 'Enter text and press enter';
|
|
133
138
|
return (react_1.default.createElement(Container, null,
|
|
134
139
|
values.map((value, index) => (react_1.default.createElement(Chip, { key: index },
|
|
135
140
|
value,
|
|
136
141
|
react_1.default.createElement(RemoveButton, { onMouseUp: () => handleRemoveValue(index) }, "\u00D7")))),
|
|
137
|
-
react_1.default.createElement(Input, { type: inputType, value: currentValue, onChange: handleInputChange, onKeyDown: handleAddValue, placeholder:
|
|
142
|
+
react_1.default.createElement(Input, { type: inputType, value: currentValue, onChange: handleInputChange, onKeyDown: handleAddValue, placeholder: xplaceholder })));
|
|
138
143
|
};
|
|
139
144
|
exports.MultiValueInput = MultiValueInput;
|
|
@@ -73,7 +73,7 @@ const Input = styled.input `
|
|
|
73
73
|
|
|
74
74
|
&::-moz-appearance: textfield;
|
|
75
75
|
`;
|
|
76
|
-
export const MultiValueInput = ({ inputType, initialValues = [], onChange, }) => {
|
|
76
|
+
export const MultiValueInput = ({ inputType, placeholder = '', initialValues = [], onChange, }) => {
|
|
77
77
|
const [values, setValues] = useState(initialValues);
|
|
78
78
|
const [currentValue, setCurrentValue] = useState('');
|
|
79
79
|
const handleAddValue = (e) => {
|
|
@@ -101,9 +101,14 @@ export const MultiValueInput = ({ inputType, initialValues = [], onChange, }) =>
|
|
|
101
101
|
setValues(updatedValues);
|
|
102
102
|
onChange === null || onChange === void 0 ? void 0 : onChange(updatedValues);
|
|
103
103
|
};
|
|
104
|
+
const xplaceholder = placeholder
|
|
105
|
+
? placeholder
|
|
106
|
+
: inputType === 'number'
|
|
107
|
+
? 'Enter number and press enter'
|
|
108
|
+
: 'Enter text and press enter';
|
|
104
109
|
return (React.createElement(Container, null,
|
|
105
110
|
values.map((value, index) => (React.createElement(Chip, { key: index },
|
|
106
111
|
value,
|
|
107
112
|
React.createElement(RemoveButton, { onMouseUp: () => handleRemoveValue(index) }, "\u00D7")))),
|
|
108
|
-
React.createElement(Input, { type: inputType, value: currentValue, onChange: handleInputChange, onKeyDown: handleAddValue, placeholder:
|
|
113
|
+
React.createElement(Input, { type: inputType, value: currentValue, onChange: handleInputChange, onKeyDown: handleAddValue, placeholder: xplaceholder })));
|
|
109
114
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "2.0.29-LEAN-4077.
|
|
4
|
+
"version": "2.0.29-LEAN-4077.5",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|