@zealicsolutions/web-ui 0.1.0 → 0.1.2

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,4 +1,5 @@
1
1
  import { SelectOption } from 'atoms/Select/types';
2
+ import { ControllerProps } from 'react-hook-form';
2
3
  export declare type InputFieldTypes = 'number' | 'text' | 'email' | 'password';
3
4
  export declare type FieldTypes = 'input' | 'select' | 'date-picker' | 'checkbox' | 'switch';
4
5
  export declare type UIField<T = string> = (UIInputField | UISelectField | UICheckboxField) & {
@@ -9,6 +10,7 @@ export declare type UIField<T = string> = (UIInputField | UISelectField | UIChec
9
10
  required?: boolean;
10
11
  optional?: boolean;
11
12
  tooltip?: string;
13
+ rules?: ControllerProps['rules'];
12
14
  };
13
15
  export declare type UIInputField = {
14
16
  type: 'input';
@@ -7,4 +7,4 @@ export declare type FieldMapperProps<T extends object> = {
7
7
  control?: Control<T>;
8
8
  spacer?: number;
9
9
  };
10
- export declare const FieldMapper: <T extends object>({ field, isEditMode, spacer, control, }: FieldMapperProps<T>) => JSX.Element;
10
+ export declare const FieldMapper: <T extends object>({ field, isEditMode, spacer, control, }: FieldMapperProps<T>) => JSX.Element | null;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { Control } from 'react-hook-form/dist/types';
3
2
  import { CSSProperties } from 'styled-components';
4
- import { InputProps } from '../../atoms';
3
+ import { Control, ControllerProps } from 'react-hook-form/dist/types';
4
+ import { InputProps } from 'atoms';
5
5
  import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
6
6
  export declare type InputFieldProps = {
7
7
  name: string;
8
8
  control?: Control<any>;
9
+ rules?: ControllerProps['rules'];
9
10
  required?: boolean;
10
11
  optional?: boolean;
11
12
  defaultValue?: string;
@@ -13,4 +14,4 @@ export declare type InputFieldProps = {
13
14
  styles?: CSSProperties;
14
15
  labelsProps?: FieldLabelsProps;
15
16
  };
16
- export declare const InputField: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, }: InputFieldProps) => JSX.Element;
17
+ export declare const InputField: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, rules, }: InputFieldProps) => JSX.Element;
@@ -3,7 +3,7 @@ import type { ComponentStory } from '@storybook/react';
3
3
  import { InputField as InputFieldComponent } from './InputField';
4
4
  declare const _default: {
5
5
  title: string;
6
- component: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, }: import("./InputField").InputFieldProps) => JSX.Element;
6
+ component: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, rules, }: import("./InputField").InputFieldProps) => JSX.Element;
7
7
  };
8
8
  export default _default;
9
9
  export declare const InputField: ComponentStory<typeof InputFieldComponent>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Control } from 'react-hook-form/dist/types';
2
+ import { Control, ControllerProps } from 'react-hook-form/dist/types';
3
3
  import { CSSProperties } from 'styled-components';
4
4
  import { SelectProps } from '../../atoms/Select/types';
5
5
  import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
@@ -7,10 +7,11 @@ export declare type SelectFieldProps = {
7
7
  selectProps: SelectProps;
8
8
  labelsProps?: FieldLabelsProps;
9
9
  name: string;
10
+ rules?: ControllerProps['rules'];
10
11
  control?: Control<any>;
11
12
  required?: boolean;
12
13
  optional?: boolean;
13
14
  defaultValue?: string;
14
15
  styles?: CSSProperties;
15
16
  };
16
- export declare const SelectField: ({ selectProps, name, defaultValue, optional, required, control, styles, labelsProps, }: SelectFieldProps) => JSX.Element;
17
+ export declare const SelectField: ({ selectProps, name, defaultValue, optional, required, control, styles, labelsProps, rules, }: SelectFieldProps) => JSX.Element;
@@ -3,7 +3,7 @@ import type { ComponentStory } from '@storybook/react';
3
3
  import { SelectField as SelectFieldComponent } from './SelectField';
4
4
  declare const _default: {
5
5
  title: string;
6
- component: ({ selectProps, name, defaultValue, optional, required, control, styles, labelsProps, }: import("./SelectField").SelectFieldProps) => JSX.Element;
6
+ component: ({ selectProps, name, defaultValue, optional, required, control, styles, labelsProps, rules, }: import("./SelectField").SelectFieldProps) => JSX.Element;
7
7
  };
8
8
  export default _default;
9
9
  export declare const SelectField: ComponentStory<typeof SelectFieldComponent>;
@@ -1,6 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { SetPasswordFields, SetPasswordRuleValidation } from 'organisms/SetPasswordForm/types';
2
+ import { SetPasswordFields, MaxRuleValidation, MinRuleValidation } from 'organisms/SetPasswordForm/types';
3
3
  import { UIFields } from '../../fieldsConfiguration';
4
+ export declare type SetPasswordRuleValidation = {
5
+ label: string;
6
+ rule: MaxRuleValidation | MinRuleValidation;
7
+ };
4
8
  export declare type SetPasswordFormProps = {
5
9
  fields: UIFields<SetPasswordFields>;
6
10
  logoUrl: string;
@@ -2,7 +2,7 @@ export declare type SetPasswordFields = {
2
2
  password: string;
3
3
  confirmPassword: string;
4
4
  };
5
- export declare type CountValidationTypes = 'COUNT' | 'CAPITAL_COUNT' | 'NUMBER_COUNT' | 'SPECIAL_CHARACTERS_COUNT';
5
+ export declare type CountValidationTypes = 'COUNT' | 'CAPITAL_COUNT' | 'NUMBER_COUNT' | 'SPECIAL_CHARACTERS_COUNT' | 'LOWER_CASE_COUNT';
6
6
  export declare type MaxRuleValidation = {
7
7
  MAX: number;
8
8
  type: CountValidationTypes;
@@ -11,7 +11,3 @@ export declare type MinRuleValidation = {
11
11
  MIN: number;
12
12
  type: CountValidationTypes;
13
13
  };
14
- export declare type SetPasswordRuleValidation = {
15
- label: string;
16
- rule: MaxRuleValidation | MinRuleValidation;
17
- };
@@ -1,3 +1,3 @@
1
- import { SetPasswordRuleValidation } from 'organisms/SetPasswordForm/types';
2
1
  import { CustomValidationRule } from '../../molecules';
2
+ import { SetPasswordRuleValidation } from './SetPasswordForm';
3
3
  export declare const passwordValidationMapper: (validation: SetPasswordRuleValidation) => CustomValidationRule;