@xqmsg/ui-core 0.23.1-rc.3 → 0.23.1-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.23.1-rc.3",
2
+ "version": "0.23.1-rc.4",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -67,7 +67,11 @@ const StackedPilledInput = React.forwardRef<
67
67
 
68
68
  if (watchedValue !== undefined && watchedValue?.length) {
69
69
  setLatestFormValueToArray(
70
- watchedValue.split(';').join(',').split(',').filter(Boolean)
70
+ watchedValue
71
+ .split(';')
72
+ .join(',')
73
+ .split(',')
74
+ .filter(Boolean)
71
75
  );
72
76
 
73
77
  if (latestTokenElement) {
@@ -83,7 +87,10 @@ const StackedPilledInput = React.forwardRef<
83
87
  const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {
84
88
  if (tokenIndex === null) {
85
89
  setLocalValue(
86
- e.target.value.trim().replace(',', '').replace(';', '').length
90
+ e.target.value
91
+ .trim()
92
+ .replace(',', '')
93
+ .replace(';', '').length
87
94
  ? e.target.value
88
95
  : ''
89
96
  );
@@ -107,7 +114,7 @@ const StackedPilledInput = React.forwardRef<
107
114
  const filteredUniqueValues = Array.from(
108
115
  new Set(
109
116
  lastestFormValueToArray.filter(
110
- (value) => value !== lastestFormValueToArray[tokenIndex]
117
+ value => value !== lastestFormValueToArray[tokenIndex]
111
118
  )
112
119
  )
113
120
  );
@@ -123,7 +130,11 @@ const StackedPilledInput = React.forwardRef<
123
130
  const filteredUniqueValues = Array.from(
124
131
  new Set([
125
132
  ...lastestFormValueToArray,
126
- ...localValue.trim().split(';').join(',').split(','),
133
+ ...localValue
134
+ .trim()
135
+ .split(';')
136
+ .join(',')
137
+ .split(','),
127
138
  ])
128
139
  );
129
140
 
@@ -147,7 +158,7 @@ const StackedPilledInput = React.forwardRef<
147
158
  const filteredUniqueValues = Array.from(
148
159
  new Set(
149
160
  [...lastestFormValueToArray].filter(
150
- (value) => value !== lastestFormValueToArray[tokenIndex]
161
+ value => value !== lastestFormValueToArray[tokenIndex]
151
162
  )
152
163
  )
153
164
  );
@@ -167,7 +178,7 @@ const StackedPilledInput = React.forwardRef<
167
178
  return setTokenIndex(lastestFormValueToArray.length - 1);
168
179
  }
169
180
 
170
- setTokenIndex((prevTokenIndex) => (prevTokenIndex as number) - 1);
181
+ setTokenIndex(prevTokenIndex => (prevTokenIndex as number) - 1);
171
182
 
172
183
  const tokenElement = document.getElementById(
173
184
  `${name}_token_${tokenIndex}`
@@ -187,7 +198,7 @@ const StackedPilledInput = React.forwardRef<
187
198
  if (tokenIndex === lastestFormValueToArray.length - 1) {
188
199
  return setTokenIndex(null);
189
200
  }
190
- setTokenIndex((prevTokenIndex) => (prevTokenIndex as number) + 1);
201
+ setTokenIndex(prevTokenIndex => (prevTokenIndex as number) + 1);
191
202
 
192
203
  const tokenElement = document.getElementById(
193
204
  `${name}_token_${tokenIndex}`
@@ -289,11 +289,8 @@ export function Input<T extends FieldValues>({
289
289
  ref,
290
290
  value
291
291
  )}
292
- {isInvalid ? (
293
- <FormErrorMessage>{errorText}</FormErrorMessage>
294
- ) : (
295
- helperText && <FormHelperText>{helperText}</FormHelperText>
296
- )}
292
+ {isInvalid && <FormErrorMessage>{errorText}</FormErrorMessage>}
293
+ {helperText && <FormHelperText>{helperText}</FormHelperText>}
297
294
  </FormControl>
298
295
  )}
299
296
  />