@true-engineering/true-react-common-ui-kit 4.0.0-alpha39 → 4.0.0-alpha40
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/dist/components/ControlWrapper/ControlWrapper.d.ts +2 -0
- package/dist/true-react-common-ui-kit.js +3 -3
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +3 -3
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ControlWrapper/ControlWrapper.tsx +4 -3
- package/src/components/Input/InputBase.tsx +1 -0
|
@@ -24,6 +24,8 @@ export interface IControlWrapperProps extends ICommonProps<IControlWrapperStyles
|
|
|
24
24
|
isLoading?: boolean;
|
|
25
25
|
/** @default false */
|
|
26
26
|
isDisabled?: boolean;
|
|
27
|
+
/** @default false */
|
|
28
|
+
isActive?: boolean;
|
|
27
29
|
onClear?: (event: IClickHandlerEvent) => void;
|
|
28
30
|
}
|
|
29
31
|
export declare const ControlWrapper: FC<IControlWrapperProps>;
|
|
@@ -9253,7 +9253,7 @@ function _object_spread_props$L(target, source) {
|
|
|
9253
9253
|
return target;
|
|
9254
9254
|
}
|
|
9255
9255
|
var ControlWrapper = function(param) {
|
|
9256
|
-
var label = param.label, icon = param.icon, groupPlacement = param.groupPlacement, isInvalid = param.isInvalid, isFocused = param.isFocused, isRequired = param.isRequired, isLoading = param.isLoading, isFullWidth = param.isFullWidth, isDisabled = param.isDisabled, hasValue = param.hasValue, size2 = param.size, testId = param.testId, children = param.children, tweakStyles = param.tweakStyles, data = param.data, onClear = param.onClear;
|
|
9256
|
+
var label = param.label, icon = param.icon, groupPlacement = param.groupPlacement, isInvalid = param.isInvalid, isFocused = param.isFocused, isRequired = param.isRequired, isLoading = param.isLoading, isFullWidth = param.isFullWidth, isActive = param.isActive, isDisabled = param.isDisabled, hasValue = param.hasValue, size2 = param.size, testId = param.testId, children = param.children, tweakStyles = param.tweakStyles, data = param.data, onClear = param.onClear;
|
|
9257
9257
|
var classes = useStyles$J({
|
|
9258
9258
|
theme: tweakStyles
|
|
9259
9259
|
});
|
|
@@ -9261,7 +9261,6 @@ var ControlWrapper = function(param) {
|
|
|
9261
9261
|
var hasIcons = !isLoading && isArrayNotEmpty(icons);
|
|
9262
9262
|
var hasClearButton = !isDisabled && !isLoading && hasValue && isNotEmpty(onClear);
|
|
9263
9263
|
var hasControls = hasIcons || hasClearButton || isLoading;
|
|
9264
|
-
var isActive = isFocused || hasValue;
|
|
9265
9264
|
var tweakPreloaderStyles = useTweakStyles({
|
|
9266
9265
|
tweakStyles,
|
|
9267
9266
|
className: "tweakPreloader",
|
|
@@ -9273,7 +9272,7 @@ var ControlWrapper = function(param) {
|
|
|
9273
9272
|
}, addDataAttributes$1(data, testId)), {
|
|
9274
9273
|
children: [
|
|
9275
9274
|
isReactNodeNotEmpty(label) && /* @__PURE__ */ jsx("div", {
|
|
9276
|
-
className: clsx(classes.label, (_obj1 = {}, _define_property$Z(_obj1, classes.requiredLabel, isRequired), _define_property$Z(_obj1, classes.disabledLabel, isDisabled), _define_property$Z(_obj1, classes.activeLabel, isActive), _obj1)),
|
|
9275
|
+
className: clsx(classes.label, (_obj1 = {}, _define_property$Z(_obj1, classes.requiredLabel, isRequired), _define_property$Z(_obj1, classes.disabledLabel, isDisabled), _define_property$Z(_obj1, classes.activeLabel, isFocused || hasValue || isActive), _obj1)),
|
|
9277
9276
|
children: label
|
|
9278
9277
|
}),
|
|
9279
9278
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -9801,6 +9800,7 @@ var InputBase = /* @__PURE__ */ forwardRef(function(_param, ref) {
|
|
|
9801
9800
|
label,
|
|
9802
9801
|
isDisabled,
|
|
9803
9802
|
isFocused: hasFocus,
|
|
9803
|
+
isActive: hasPlaceholder,
|
|
9804
9804
|
isInvalid,
|
|
9805
9805
|
hasValue,
|
|
9806
9806
|
isFullWidth: !isAutoSized,
|