@scbt-ecom/ui 0.9.1 → 0.9.3

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.
@@ -1,5 +1,5 @@
1
1
  export * from './InputControl';
2
- export * from './InputControlMask';
2
+ export * from './inputControlMask';
3
3
  export * from './CheckboxControl';
4
4
  export * from './SwitchControl';
5
5
  export * from './TextareaControl';
@@ -0,0 +1,29 @@
1
+ import { FieldValues } from 'react-hook-form';
2
+ import { NumberFormatValues, SourceInfo } from 'react-number-format';
3
+ import { TCommonFieldProps } from '../model/types';
4
+ import { IFieldAttachmentProps, TFieldAttachmentClasses, TFieldContainerConfig, TFieldWrapperClasses } from '../ui';
5
+ import * as React from 'react';
6
+ type TInputControlMaskClasses = TFieldAttachmentClasses & TFieldWrapperClasses & {
7
+ input?: string;
8
+ message?: string;
9
+ inputContainer?: string;
10
+ };
11
+ export type TInputMode = 'phone' | undefined;
12
+ export type TActions = {
13
+ customInputChange?: (value: NumberFormatValues, source: SourceInfo) => void;
14
+ customPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void;
15
+ customFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
16
+ customBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
17
+ };
18
+ export interface InputControlMaskProps<T extends FieldValues> extends TCommonFieldProps<T>, Omit<IFieldAttachmentProps, 'invalid' | 'isTouched'> {
19
+ format: string;
20
+ mask?: string | string[];
21
+ allowEmptyFormatting?: boolean;
22
+ classes?: TInputControlMaskClasses;
23
+ size?: TFieldContainerConfig['size'];
24
+ disabled?: boolean;
25
+ mode?: TInputMode;
26
+ actions?: TActions;
27
+ }
28
+ export declare const InputControlMask: <T extends FieldValues>({ format, allowEmptyFormatting, mask, control, actions, size, label, helperText, disabled, classes, badge, withValidateIcons, icon, onClickIcon, onKeyDownIcon, mode, ...props }: InputControlMaskProps<T>) => import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1 @@
1
+ export * from './InputControlMask';
@@ -0,0 +1,28 @@
1
+ import { Noop } from 'react-hook-form';
2
+ import { NumberFormatValues, SourceInfo } from 'react-number-format';
3
+ import { TActions, TInputMode } from '../InputControlMask';
4
+ type TOnValueChange = {
5
+ inputValue: NumberFormatValues;
6
+ source: SourceInfo;
7
+ onChange: (...event: any[]) => void;
8
+ };
9
+ type TOnPaste = {
10
+ event: React.ClipboardEvent<HTMLInputElement>;
11
+ onChange: (...event: any[]) => void;
12
+ };
13
+ type TOnFocus = {
14
+ event: React.FocusEvent<HTMLInputElement>;
15
+ setShowMask: React.Dispatch<React.SetStateAction<boolean>>;
16
+ };
17
+ type TOnBlur = {
18
+ event: React.FocusEvent<HTMLInputElement>;
19
+ setShowMask: React.Dispatch<React.SetStateAction<boolean>>;
20
+ hookFormBlur: Noop;
21
+ };
22
+ export declare const useInputControlMask: (actions?: TActions, mode?: TInputMode) => {
23
+ onValueChange: ({ inputValue, onChange, source }: TOnValueChange) => void;
24
+ onPaste: ({ event, onChange }: TOnPaste) => void;
25
+ onFocus: ({ event, setShowMask }: TOnFocus) => void;
26
+ onBlur: ({ event, setShowMask, hookFormBlur }: TOnBlur) => void;
27
+ };
28
+ export {};
@@ -1,2 +1,7 @@
1
1
  import { z } from 'zod';
2
- export declare const zodDadataFioValidate: z.ZodEffects<z.ZodString, string, string>;
2
+ export declare const formattedDadataFio: (value: string) => {
3
+ surname: string;
4
+ name: string;
5
+ patronymic: string;
6
+ };
7
+ export declare const zodDadataFioSchema: z.ZodEffects<z.ZodString, string, string>;
@@ -1,2 +1,3 @@
1
1
  export * from './dadataFio';
2
2
  export * from './calendar';
3
+ export * from './phone';
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const zodPhoneSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scbt-ecom/ui",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./utils-tailwind.css": "./dist/utils-tailwind.css",
@@ -1,19 +0,0 @@
1
- import { FieldValues } from 'react-hook-form';
2
- import { TCommonFieldProps } from './model/types';
3
- import { IFieldAttachmentProps, TFieldAttachmentClasses, TFieldContainerConfig, TFieldWrapperClasses } from './ui';
4
- type TInputControlMaskClasses = TFieldAttachmentClasses & TFieldWrapperClasses & {
5
- input?: string;
6
- message?: string;
7
- inputContainer?: string;
8
- };
9
- export interface InputControlMaskProps<T extends FieldValues> extends TCommonFieldProps<T>, Omit<IFieldAttachmentProps, 'invalid' | 'isTouched'> {
10
- format: string;
11
- mask?: string | string[];
12
- allowEmptyFormatting?: boolean;
13
- onInputChange?: (arg?: string) => void;
14
- classes?: TInputControlMaskClasses;
15
- size?: TFieldContainerConfig['size'];
16
- disabled?: boolean;
17
- }
18
- export declare const InputControlMask: <T extends FieldValues>({ format, allowEmptyFormatting, mask, control, onInputChange, size, label, helperText, disabled, classes, badge, withValidateIcons, icon, onClickIcon, onKeyDownIcon, ...props }: InputControlMaskProps<T>) => import("react/jsx-runtime").JSX.Element;
19
- export {};