@cloud-ru/ds-uikit-product-fields-predefined 4.0.5-preview-e8fe6b56.0 → 4.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-ru/ds-uikit-product-fields-predefined",
3
- "version": "4.0.5-preview-e8fe6b56.0",
3
+ "version": "4.1.0",
4
4
  "description": "Набор предопределённых полей формы поверх @ds/fields — телефон, маски, имя, описание, код и другие готовые сценарии ввода.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,21 +44,21 @@
44
44
  "imask": "^7.6.1",
45
45
  "merge-refs": "^2.0.0",
46
46
  "react-imask": "^7.6.1",
47
- "@cloud-ru/ds-adaptive": "1.0.4-preview-e8fe6b56.0",
48
- "@cloud-ru/ds-button": "1.0.6-preview-e8fe6b56.0",
49
- "@cloud-ru/ds-drawer": "2.2.2-preview-e8fe6b56.0",
50
- "@cloud-ru/ds-attachment": "1.1.32-preview-e8fe6b56.0",
51
- "@cloud-ru/ds-dropzone": "1.0.5-preview-e8fe6b56.0",
52
- "@cloud-ru/ds-field-decorator": "1.1.11-preview-e8fe6b56.0",
53
- "@cloud-ru/ds-fields": "3.0.12-preview-e8fe6b56.0",
54
- "@cloud-ru/ds-icons": "1.7.3-preview-e8fe6b56.0",
55
- "@cloud-ru/ds-input-private": "1.0.16-preview-e8fe6b56.0",
56
- "@cloud-ru/ds-list": "3.1.2-preview-e8fe6b56.0",
57
- "@cloud-ru/ds-locale": "1.0.0",
58
- "@cloud-ru/ds-modal": "2.1.2-preview-e8fe6b56.0",
59
- "@cloud-ru/ds-tooltip": "1.0.19-preview-e8fe6b56.0",
60
- "@cloud-ru/ds-scroll": "1.0.7-preview-e8fe6b56.0",
61
- "@cloud-ru/ds-utils": "1.3.1-preview-e8fe6b56.0"
47
+ "@cloud-ru/ds-button": "^1.0.6",
48
+ "@cloud-ru/ds-attachment": "^1.1.32",
49
+ "@cloud-ru/ds-dropzone": "^1.0.5",
50
+ "@cloud-ru/ds-fields": "^3.0.12",
51
+ "@cloud-ru/ds-field-decorator": "^1.1.11",
52
+ "@cloud-ru/ds-adaptive": "^1.0.4",
53
+ "@cloud-ru/ds-icons": "^1.7.3",
54
+ "@cloud-ru/ds-list": "^3.1.2",
55
+ "@cloud-ru/ds-input-private": "^1.0.16",
56
+ "@cloud-ru/ds-scroll": "^1.0.7",
57
+ "@cloud-ru/ds-locale": "^1.0.0",
58
+ "@cloud-ru/ds-modal": "^2.1.2",
59
+ "@cloud-ru/ds-tooltip": "^1.0.19",
60
+ "@cloud-ru/ds-utils": "^1.4.0",
61
+ "@cloud-ru/ds-drawer": "^2.3.0"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "react-hook-form": "^7.79.0",
@@ -1,9 +1,8 @@
1
- import { useValueControl } from '@cloud-ru/ds-utils';
1
+ import { useRefState, useValueControl } from '@cloud-ru/ds-utils';
2
2
  import { ClipboardEvent, KeyboardEvent, useCallback, useEffect } from 'react';
3
3
 
4
4
  import { ZERO_WIDTH_SPACE } from '../constants';
5
5
  import { isNumberChar, isStringCodeLength, isZeroWidthSpace } from '../utils';
6
- import { useRefState } from './useRefState';
7
6
 
8
7
  export type UseCodeInputParams = {
9
8
  /** Количество цифр в коде (целое ≥ 1) */
@@ -1,7 +0,0 @@
1
- /**
2
- * Ref-контейнер, присваивание `.current` которого вызывает ре-рендер.
3
- * Локальная замена `useRefState` из `@siberiacancode/reactuse` — пакет не тянем ради одного хука.
4
- */
5
- export declare function useRefState<T>(initialValue: T): {
6
- current: T;
7
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useRefState = useRefState;
4
- const react_1 = require("react");
5
- /**
6
- * Ref-контейнер, присваивание `.current` которого вызывает ре-рендер.
7
- * Локальная замена `useRefState` из `@siberiacancode/reactuse` — пакет не тянем ради одного хука.
8
- */
9
- function useRefState(initialValue) {
10
- const [, forceRender] = (0, react_1.useReducer)((tick) => tick + 1, 0);
11
- const ref = (0, react_1.useRef)(initialValue);
12
- return (0, react_1.useMemo)(() => ({
13
- get current() {
14
- return ref.current;
15
- },
16
- set current(value) {
17
- ref.current = value;
18
- forceRender();
19
- },
20
- }), []);
21
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Ref-контейнер, присваивание `.current` которого вызывает ре-рендер.
3
- * Локальная замена `useRefState` из `@siberiacancode/reactuse` — пакет не тянем ради одного хука.
4
- */
5
- export declare function useRefState<T>(initialValue: T): {
6
- current: T;
7
- };
@@ -1,18 +0,0 @@
1
- import { useMemo, useReducer, useRef } from 'react';
2
- /**
3
- * Ref-контейнер, присваивание `.current` которого вызывает ре-рендер.
4
- * Локальная замена `useRefState` из `@siberiacancode/reactuse` — пакет не тянем ради одного хука.
5
- */
6
- export function useRefState(initialValue) {
7
- const [, forceRender] = useReducer((tick) => tick + 1, 0);
8
- const ref = useRef(initialValue);
9
- return useMemo(() => ({
10
- get current() {
11
- return ref.current;
12
- },
13
- set current(value) {
14
- ref.current = value;
15
- forceRender();
16
- },
17
- }), []);
18
- }
@@ -1,23 +0,0 @@
1
- import { useMemo, useReducer, useRef } from 'react';
2
-
3
- /**
4
- * Ref-контейнер, присваивание `.current` которого вызывает ре-рендер.
5
- * Локальная замена `useRefState` из `@siberiacancode/reactuse` — пакет не тянем ради одного хука.
6
- */
7
- export function useRefState<T>(initialValue: T) {
8
- const [, forceRender] = useReducer((tick: number) => tick + 1, 0);
9
- const ref = useRef(initialValue);
10
-
11
- return useMemo(
12
- () => ({
13
- get current(): T {
14
- return ref.current;
15
- },
16
- set current(value: T) {
17
- ref.current = value;
18
- forceRender();
19
- },
20
- }),
21
- [],
22
- );
23
- }