@true-engineering/true-react-common-ui-kit 3.44.1 → 3.45.1

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/README.md CHANGED
@@ -11,6 +11,19 @@
11
11
 
12
12
  # Release Notes
13
13
 
14
+ ## 3.45.1
15
+
16
+ ### Changes
17
+
18
+ - **SearchInput**: Добавлен класс `iconClickable`
19
+
20
+ ## 3.45.0
21
+
22
+ ### Changes
23
+
24
+ - **Input**: Добавлена стандартная пропса `inputMode`
25
+ - **SearchInput**: Добавлена пропса `onSearchIconClick`
26
+
14
27
  ## 3.44.1
15
28
 
16
29
  ### Changes
@@ -1,4 +1,4 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { Props as ReactInputMaskBaseProps } from 'react-input-mask';
3
3
  export type IReactInputMaskProps = Pick<Partial<ReactInputMaskBaseProps>, 'mask' | 'maskPlaceholder' | 'alwaysShowMask' | 'beforeMaskedStateChange'>;
4
- export type IInputHTMLBaseProps = Pick<InputHTMLAttributes<HTMLInputElement>, 'maxLength' | 'name' | 'tabIndex' | 'placeholder' | 'type' | 'onBlur' | 'onFocus' | 'onInput' | 'onKeyDown' | 'onPaste'>;
4
+ export type IInputHTMLBaseProps = Pick<InputHTMLAttributes<HTMLInputElement>, 'maxLength' | 'name' | 'tabIndex' | 'placeholder' | 'type' | 'inputMode' | 'onBlur' | 'onFocus' | 'onInput' | 'onKeyDown' | 'onPaste'>;
@@ -2,5 +2,7 @@ import { FC } from 'react';
2
2
  import { ICommonProps } from '../../types';
3
3
  import { IInputProps } from '../Input';
4
4
  import { ISearchInputStyles } from './SearchInput.styles';
5
- export type ISearchInputProps = Omit<IInputProps, 'type' | 'isInvalid' | 'errorMessage' | 'label' | 'isActive' | 'errorPosition' | 'hasFloatingLabel' | 'border' | 'tweakStyles'> & ICommonProps<ISearchInputStyles>;
5
+ export interface ISearchInputProps extends ICommonProps<ISearchInputStyles>, Omit<IInputProps, 'type' | 'isInvalid' | 'errorMessage' | 'label' | 'isActive' | 'errorPosition' | 'hasFloatingLabel' | 'border' | 'tweakStyles'> {
6
+ onSearchIconClick?: () => void;
7
+ }
6
8
  export declare const SearchInput: FC<ISearchInputProps>;
@@ -3,11 +3,4 @@ declare const _default: {
3
3
  component: import("react").FC<import("./SearchInput").ISearchInputProps>;
4
4
  };
5
5
  export default _default;
6
- export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, Omit<import("..").IInputProps, "border" | "tweakStyles" | "label" | "isInvalid" | "type" | "isActive" | "hasFloatingLabel" | "errorMessage" | "errorPosition"> & import("../..").IDataAttributesProps & import("../..").ITweakStylesProps<Partial<import("jss").Styles<"root" | "icon", unknown, undefined>> & Partial<{
7
- tweakInput: Partial<import("jss").Styles<"bottom" | "left" | "right" | "top" | "error" | "input" | "invalid" | "root" | "middle" | "icon" | "disabled" | "loading" | "label" | "requiredLabel" | "inputWrapper" | "info" | "autosize" | "clearIcon" | "focused" | "inputContent" | "unitsWrapper" | "fakeValue" | "units" | "withFloatingLabel" | "floatingLabelWithoutPadding" | "floating" | "activeLabel" | "required" | "floatingWithoutPadding" | "activeIcon" | "border-top" | "border-bottom" | "border-left" | "border-right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "controls" | "inputIcon" | "withIcons" | "withControls" | "invalidLabel" | "error-top" | "error-bottom" | "withUnits", unknown, undefined>> & Partial<{
8
- tweakPreloader: Partial<import("jss").Styles<"root" | "default" | "currentColor" | "dots" | "logo", unknown, undefined>> & Partial<{
9
- tweakDotsPreloader: Partial<import("jss").Styles<"root" | "dot" | "fadedDot" | "@keyframes FadedDots", unknown, undefined>> & Partial<unknown>;
10
- tweakSvgPreloader: Partial<import("jss").Styles<"root", unknown, undefined>> & Partial<unknown>;
11
- }>;
12
- }>;
13
- }>>>;
6
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./SearchInput").ISearchInputProps>;
@@ -1,6 +1,6 @@
1
1
  import { ITweakStyles } from '../../theme';
2
2
  import { IInputStyles } from '../Input';
3
- export declare const useStyles: import("../../theme").IUseStyles<"root" | "icon", unknown>;
3
+ export declare const useStyles: import("../../theme").IUseStyles<"root" | "icon" | "iconClickable", unknown>;
4
4
  export declare const inputStyles: IInputStyles;
5
5
  export type ISearchInputStyles = ITweakStyles<typeof useStyles, {
6
6
  tweakInput: IInputStyles;
@@ -10537,6 +10537,9 @@ var useStyles$F = createThemedStyles("SearchInput", {
10537
10537
  width: 20,
10538
10538
  zIndex: 2,
10539
10539
  color: colors.GREY_ACTIVE
10540
+ },
10541
+ iconClickable: {
10542
+ cursor: "pointer"
10540
10543
  }
10541
10544
  });
10542
10545
  var inputStyles$4 = {
@@ -10646,11 +10649,12 @@ function _object_without_properties_loose$e(source, excluded) {
10646
10649
  return target;
10647
10650
  }
10648
10651
  var SearchInput = function(_param) {
10649
- var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, props = _object_without_properties$e(_param, [
10652
+ var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, onSearchIconClick = _param.onSearchIconClick, props = _object_without_properties$e(_param, [
10650
10653
  "isClearable",
10651
10654
  "tweakStyles",
10652
10655
  "testId",
10653
- "data"
10656
+ "data",
10657
+ "onSearchIconClick"
10654
10658
  ]);
10655
10659
  var classes = useStyles$F({
10656
10660
  theme: tweakStyles
@@ -10663,15 +10667,17 @@ var SearchInput = function(_param) {
10663
10667
  });
10664
10668
  return /* @__PURE__ */ jsxs("div", _object_spread_props$G(_object_spread$N({
10665
10669
  className: classes.root
10666
- }, addDataTestId(testId), addDataAttributes(data)), {
10670
+ }, addDataAttributes$1(data, testId)), {
10667
10671
  children: [
10668
- /* @__PURE__ */ jsx("div", {
10669
- className: classes.icon,
10672
+ /* @__PURE__ */ jsx("div", _object_spread_props$G(_object_spread$N({
10673
+ className: clsx(classes.icon, _define_property$P({}, classes.iconClickable, isNotEmpty(onSearchIconClick)))
10674
+ }, addClickHandler(onSearchIconClick)), {
10670
10675
  children: /* @__PURE__ */ jsx(Icon, {
10671
10676
  type: "search"
10672
10677
  })
10673
- }),
10678
+ })),
10674
10679
  /* @__PURE__ */ jsx(Input, _object_spread$N({
10680
+ inputMode: "search",
10675
10681
  isClearable,
10676
10682
  isActive: props.value !== "" && props.value !== void 0,
10677
10683
  testId: getTestId(testId, "input"),