@platformatic/ui-components 0.1.153 → 0.1.155

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@platformatic/ui-components",
3
3
  "description": "Platformatic UI Components",
4
- "version": "0.1.153",
4
+ "version": "0.1.155",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -24,8 +24,8 @@ function Input ({
24
24
  dataAttrValue,
25
25
  readOnly
26
26
  }) {
27
- let baseInputClassName = `${commonStyles.fullWidth} ${styles.input} ${inputTextClassName}`
28
- baseInputClassName += verticalPaddingClassName || `${styles.inputDefaultVerticalPadding}`
27
+ let baseInputClassName = `${commonStyles.fullWidth} ${styles.input} ${inputTextClassName} `
28
+ baseInputClassName += verticalPaddingClassName || ` ${styles.inputDefaultVerticalPadding} `
29
29
  baseInputClassName += ' ' + commonStyles[`text--${borderColor}`] + ' ' + commonStyles[`background-color-${backgroundColor}`]
30
30
 
31
31
  const showError = errorMessage.length > 0
@@ -18,6 +18,7 @@ function InputWithSeparator ({
18
18
  disabled,
19
19
  afterIcon,
20
20
  defaultValue,
21
+ defaultValueSeparator,
21
22
  value,
22
23
  separators,
23
24
  inputTextClassName
@@ -33,11 +34,8 @@ function InputWithSeparator ({
33
34
 
34
35
  useEffect(() => {
35
36
  if (defaultValue.length > 0) {
36
- let elements
37
- for (const separator of separators) {
38
- elements = defaultValue.split(separator).filter(e => e !== '')
39
- setChunks(prevChunks => [...prevChunks, ...elements])
40
- }
37
+ const elements = defaultValue.split(defaultValueSeparator).filter(e => e !== '')
38
+ setChunks(prevChunks => [...prevChunks, ...elements])
41
39
  }
42
40
  }, [])
43
41
 
@@ -188,6 +186,10 @@ InputWithSeparator.propTypes = {
188
186
  * defaultValue
189
187
  */
190
188
  defaultValue: PropTypes.string,
189
+ /**
190
+ * defaultValueSeparator
191
+ */
192
+ defaultValueSeparator: PropTypes.string,
191
193
  /**
192
194
  * separators
193
195
  */
@@ -227,6 +229,7 @@ InputWithSeparator.defaultProps = {
227
229
  placeholder: '',
228
230
  value: '',
229
231
  defaultValue: '',
232
+ defaultValueSeparator: ',',
230
233
  name: '',
231
234
  borderColor: MAIN_GREEN,
232
235
  backgroundColor: WHITE,
@@ -101,7 +101,7 @@ DifferentsSeparators.args = {
101
101
  placeholder: 'Initial value',
102
102
  borderColor: 'main-dark-blue',
103
103
  separators: [',', ' '],
104
- defaultValue: 'test,test-1,test-2',
104
+ defaultValue: 'this,is,a,test,for,a,spac',
105
105
  afterIcon: {
106
106
  iconName: 'AddIcon',
107
107
  color: ERROR_RED,