@hh.ru/magritte-ui-input 7.2.22 → 7.3.0

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/index.js CHANGED
@@ -27,6 +27,6 @@ import './useFocus.js';
27
27
  import '@hh.ru/magritte-ui-typography';
28
28
  import '@hh.ru/magritte-common-number-formatter';
29
29
  import './useDateTimeMask.js';
30
- import './index.esm-DXMzyY2T.js';
30
+ import './index.esm-DRF_TuWt.js';
31
31
  import './useUncontrolledInput.js';
32
32
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
1
  import './index.css';
2
- export { M as MASKITO_DEFAULT_OPTIONS, m as maskitoDateOptionsGenerator, a as maskitoDateTimeOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-DXMzyY2T.js';
2
+ export { M as MASKITO_DEFAULT_OPTIONS, m as maskitoDateOptionsGenerator, a as maskitoDateTimeOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-DRF_TuWt.js';
3
3
  import 'react';
4
4
  //# sourceMappingURL=maskito-exports.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-input",
3
- "version": "7.2.22",
3
+ "version": "7.3.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -32,7 +32,7 @@
32
32
  "@hh.ru/magritte-design-tokens": "22.0.0",
33
33
  "@hh.ru/magritte-ui-breakpoint": "5.0.3",
34
34
  "@hh.ru/magritte-ui-form-helper": "1.0.42",
35
- "@hh.ru/magritte-ui-icon": "11.0.13",
35
+ "@hh.ru/magritte-ui-icon": "11.0.14",
36
36
  "@hh.ru/magritte-ui-mock-component": "1.1.4",
37
37
  "@hh.ru/magritte-ui-theme-provider": "1.1.51",
38
38
  "@hh.ru/magritte-ui-typography": "3.0.47"
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "1b6b5c9c24a432af6e815388099e856eeda3caaf"
48
+ "gitHead": "ea8b5bf46a20f696be9947da3a240357870d8dbb"
49
49
  }
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FocusEventHandler, ForwardedRef, MouseEventHandler, ReactNode } from 'react';
1
+ import type { ChangeEvent, FocusEventHandler, ForwardedRef, MouseEventHandler, ReactNode } from 'react';
2
2
  import type { FormatParams } from '@hh.ru/magritte-common-number-formatter';
3
3
  import type { IconWrapperComponentSize16, IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon/iconTypes';
4
4
  export type InputSize = 'medium' | 'large' | 'small';
@@ -20,7 +20,7 @@ export interface InputFormatterResult {
20
20
  }
21
21
  export interface ControlledProps {
22
22
  /** Обработчик события изменения */
23
- onChange: (value: string) => void;
23
+ onChange: (value: string, event?: ChangeEvent<HTMLInputElement>) => void;
24
24
  /** Значение инпута */
25
25
  value: string;
26
26
  }
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
  import { useMemo } from 'react';
3
- import { M as MASKITO_DEFAULT_OPTIONS, a as maskitoDateTimeOptionsGenerator, m as maskitoDateOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-DXMzyY2T.js';
3
+ import { M as MASKITO_DEFAULT_OPTIONS, a as maskitoDateTimeOptionsGenerator, m as maskitoDateOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-DRF_TuWt.js';
4
4
 
5
5
  /**
6
6
  * Округление времени (в формате 00:00) до ближайшего заданного шага
package/useFocus.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { FocusEventHandler, ChangeEventHandler } from 'react';
2
- export declare const useFocus: <T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(onChange: (value: string) => void, onFocus: FocusEventHandler<T> | undefined, onBlur: FocusEventHandler<T> | undefined) => {
1
+ import { FocusEventHandler, ChangeEventHandler, type ChangeEvent } from 'react';
2
+ export declare const useFocus: <T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(onChange: (value: string, event: ChangeEvent<T>) => void, onFocus: FocusEventHandler<T> | undefined, onBlur: FocusEventHandler<T> | undefined) => {
3
3
  changeHandler: ChangeEventHandler<T>;
4
4
  focusHandler: FocusEventHandler<T>;
5
5
  blurHandler: FocusEventHandler<T>;
package/useFocus.js CHANGED
@@ -4,7 +4,7 @@ import { useState, useCallback } from 'react';
4
4
  const useFocus = (onChange, onFocus, onBlur) => {
5
5
  const [isFocused, setFocused] = useState(false);
6
6
  const changeHandler = useCallback((event) => {
7
- onChange(event.target.value);
7
+ onChange(event.target.value, event);
8
8
  }, [onChange]);
9
9
  const focusHandler = useCallback((event) => {
10
10
  setFocused(true);
package/useFocus.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"useFocus.js","sources":["../src/useFocus.ts"],"sourcesContent":["import { useCallback, useState, FocusEventHandler, ChangeEventHandler } from 'react';\n\nexport const useFocus = <T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(\n onChange: (value: string) => void,\n onFocus: FocusEventHandler<T> | undefined,\n onBlur: FocusEventHandler<T> | undefined\n): {\n changeHandler: ChangeEventHandler<T>;\n focusHandler: FocusEventHandler<T>;\n blurHandler: FocusEventHandler<T>;\n isFocused: boolean;\n} => {\n const [isFocused, setFocused] = useState(false);\n\n const changeHandler = useCallback<ChangeEventHandler<T>>(\n (event) => {\n onChange(event.target.value);\n },\n [onChange]\n );\n\n const focusHandler = useCallback<FocusEventHandler<T>>(\n (event) => {\n setFocused(true);\n onFocus?.(event);\n },\n [setFocused, onFocus]\n );\n\n const blurHandler = useCallback<FocusEventHandler<T>>(\n (event) => {\n setFocused(false);\n onBlur?.(event);\n },\n [setFocused, onBlur]\n );\n\n return { changeHandler, focusHandler, blurHandler, isFocused };\n};\n"],"names":[],"mappings":";;AAEa,MAAA,QAAQ,GAAG,CACpB,QAAiC,EACjC,OAAyC,EACzC,MAAwC,KAMxC;IACA,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEhD,IAAA,MAAM,aAAa,GAAG,WAAW,CAC7B,CAAC,KAAK,KAAI;AACN,QAAA,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,KAAC,EACD,CAAC,QAAQ,CAAC,CACb,CAAC;AAEF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC5B,CAAC,KAAK,KAAI;QACN,UAAU,CAAC,IAAI,CAAC,CAAC;AACjB,QAAA,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,KAAC,EACD,CAAC,UAAU,EAAE,OAAO,CAAC,CACxB,CAAC;AAEF,IAAA,MAAM,WAAW,GAAG,WAAW,CAC3B,CAAC,KAAK,KAAI;QACN,UAAU,CAAC,KAAK,CAAC,CAAC;AAClB,QAAA,MAAM,GAAG,KAAK,CAAC,CAAC;AACpB,KAAC,EACD,CAAC,UAAU,EAAE,MAAM,CAAC,CACvB,CAAC;IAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AACnE;;;;"}
1
+ {"version":3,"file":"useFocus.js","sources":["../src/useFocus.ts"],"sourcesContent":["import { useCallback, useState, FocusEventHandler, ChangeEventHandler, type ChangeEvent } from 'react';\n\nexport const useFocus = <T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(\n onChange: (value: string, event: ChangeEvent<T>) => void,\n onFocus: FocusEventHandler<T> | undefined,\n onBlur: FocusEventHandler<T> | undefined\n): {\n changeHandler: ChangeEventHandler<T>;\n focusHandler: FocusEventHandler<T>;\n blurHandler: FocusEventHandler<T>;\n isFocused: boolean;\n} => {\n const [isFocused, setFocused] = useState(false);\n\n const changeHandler = useCallback<ChangeEventHandler<T>>(\n (event) => {\n onChange(event.target.value, event);\n },\n [onChange]\n );\n\n const focusHandler = useCallback<FocusEventHandler<T>>(\n (event) => {\n setFocused(true);\n onFocus?.(event);\n },\n [setFocused, onFocus]\n );\n\n const blurHandler = useCallback<FocusEventHandler<T>>(\n (event) => {\n setFocused(false);\n onBlur?.(event);\n },\n [setFocused, onBlur]\n );\n\n return { changeHandler, focusHandler, blurHandler, isFocused };\n};\n"],"names":[],"mappings":";;AAEa,MAAA,QAAQ,GAAG,CACpB,QAAwD,EACxD,OAAyC,EACzC,MAAwC,KAMxC;IACA,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEhD,IAAA,MAAM,aAAa,GAAG,WAAW,CAC7B,CAAC,KAAK,KAAI;QACN,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxC,KAAC,EACD,CAAC,QAAQ,CAAC,CACb,CAAC;AAEF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC5B,CAAC,KAAK,KAAI;QACN,UAAU,CAAC,IAAI,CAAC,CAAC;AACjB,QAAA,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,KAAC,EACD,CAAC,UAAU,EAAE,OAAO,CAAC,CACxB,CAAC;AAEF,IAAA,MAAM,WAAW,GAAG,WAAW,CAC3B,CAAC,KAAK,KAAI;QACN,UAAU,CAAC,KAAK,CAAC,CAAC;AAClB,QAAA,MAAM,GAAG,KAAK,CAAC,CAAC;AACpB,KAAC,EACD,CAAC,UAAU,EAAE,MAAM,CAAC,CACvB,CAAC;IAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AACnE;;;;"}