@true-engineering/true-react-common-ui-kit 4.0.0-alpha49 → 4.0.0-alpha50

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "4.0.0-alpha49",
3
+ "version": "4.0.0-alpha50",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -43,6 +43,10 @@ export const useStyles = createThemedStyles('Input', {
43
43
  },
44
44
  },
45
45
 
46
+ defaultWrapper: {
47
+ display: 'contents',
48
+ },
49
+
46
50
  autoSizeWrapper: {
47
51
  position: 'relative',
48
52
  display: 'flex',
@@ -200,30 +200,6 @@ export const InputBase = forwardRef<HTMLInputElement, IInputBaseProps>(
200
200
  }
201
201
  }, []);
202
202
 
203
- const inputContent = (
204
- <>
205
- {isNotEmpty(mask) ? (
206
- <InputMask
207
- ref={mergedRef as unknown as MutableRefObject<InputMask>}
208
- mask={mask}
209
- maskPlaceholder={maskPlaceholder}
210
- alwaysShowMask={alwaysShowMask}
211
- beforeMaskedStateChange={beforeMaskedStateChange}
212
- {...props}
213
- />
214
- ) : (
215
- <input ref={mergedRef} {...props} />
216
- )}
217
-
218
- {(hasUnits || isAutoSized) && <div className={classes.fakeValue}>{value}</div>}
219
- {hasUnits && hasValue && (
220
- <div className={classes.units} ref={unitsRef}>
221
- {units}
222
- </div>
223
- )}
224
- </>
225
- );
226
-
227
203
  return (
228
204
  <ControlWrapper
229
205
  label={label}
@@ -242,11 +218,31 @@ export const InputBase = forwardRef<HTMLInputElement, IInputBaseProps>(
242
218
  isRequired={isRequired}
243
219
  size={size}
244
220
  >
245
- {hasUnits || isAutoSized ? (
246
- <div className={classes.autoSizeWrapper}>{inputContent}</div>
247
- ) : (
248
- inputContent
249
- )}
221
+ <div
222
+ className={clsx(classes.defaultWrapper, {
223
+ [classes.autoSizeWrapper]: hasUnits || isAutoSized,
224
+ })}
225
+ >
226
+ {isNotEmpty(mask) ? (
227
+ <InputMask
228
+ ref={mergedRef as unknown as MutableRefObject<InputMask>}
229
+ mask={mask}
230
+ maskPlaceholder={maskPlaceholder}
231
+ alwaysShowMask={alwaysShowMask}
232
+ beforeMaskedStateChange={beforeMaskedStateChange}
233
+ {...props}
234
+ />
235
+ ) : (
236
+ <input ref={mergedRef} {...props} />
237
+ )}
238
+
239
+ {(hasUnits || isAutoSized) && <div className={classes.fakeValue}>{value}</div>}
240
+ {hasUnits && hasValue && (
241
+ <div className={classes.units} ref={unitsRef}>
242
+ {units}
243
+ </div>
244
+ )}
245
+ </div>
250
246
  {children}
251
247
  </ControlWrapper>
252
248
  );