@zealicsolutions/web-ui 0.1.1 → 0.1.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.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/fieldsConfiguration/types.d.ts +2 -0
- package/dist/cjs/src/molecules/FieldMapper/FieldMapper.d.ts +1 -1
- package/dist/cjs/src/molecules/InputField/InputField.d.ts +4 -3
- package/dist/cjs/src/molecules/InputField/InputField.stories.d.ts +1 -1
- package/dist/cjs/src/molecules/SelectField/SelectField.d.ts +3 -2
- package/dist/cjs/src/molecules/SelectField/SelectField.stories.d.ts +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/fieldsConfiguration/types.d.ts +2 -0
- package/dist/esm/src/molecules/FieldMapper/FieldMapper.d.ts +1 -1
- package/dist/esm/src/molecules/InputField/InputField.d.ts +4 -3
- package/dist/esm/src/molecules/InputField/InputField.stories.d.ts +1 -1
- package/dist/esm/src/molecules/SelectField/SelectField.d.ts +3 -2
- package/dist/esm/src/molecules/SelectField/SelectField.stories.d.ts +1 -1
- package/dist/index.d.ts +10 -6
- package/package.json +12 -12
@@ -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 {
|
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>;
|
package/dist/index.d.ts
CHANGED
@@ -11,12 +11,13 @@ import { SizesTypes as SizesTypes$2, ThemeColors as ThemeColors$2 } from 'theme'
|
|
11
11
|
import { TooltipProps as TooltipProps$1 } from 'rc-tooltip/lib/Tooltip';
|
12
12
|
import { WithGoogleMapProps } from 'react-google-maps/lib/withGoogleMap';
|
13
13
|
import { WithScriptjsProps } from 'react-google-maps/lib/withScriptjs';
|
14
|
-
import { Control } from 'react-hook-form/dist/types';
|
14
|
+
import { Control, ControllerProps } from 'react-hook-form/dist/types';
|
15
|
+
import { InputProps as InputProps$1 } from 'atoms';
|
15
16
|
import { SelectOption as SelectOption$1 } from 'atoms/Select/types';
|
17
|
+
import { ControllerProps as ControllerProps$1, DeepPartial, FieldValues, FormState } from 'react-hook-form';
|
16
18
|
import { DrawerProps as DrawerProps$1 } from '@mui/material';
|
17
19
|
import { SetPasswordFields, MaxRuleValidation, MinRuleValidation } from 'organisms/SetPasswordForm/types';
|
18
20
|
import { FieldSectionProps as FieldSectionProps$1 } from 'molecules';
|
19
|
-
import { DeepPartial, FieldValues, FormState } from 'react-hook-form';
|
20
21
|
import { LoginFields as LoginFields$1 } from 'organisms/LoginForm/types';
|
21
22
|
|
22
23
|
declare type BaseButtonProps = {
|
@@ -262,14 +263,15 @@ declare const FieldLabels: ({ label, isError, ruleLabel, tooltipText }: FieldLab
|
|
262
263
|
declare type InputFieldProps = {
|
263
264
|
name: string;
|
264
265
|
control?: Control<any>;
|
266
|
+
rules?: ControllerProps['rules'];
|
265
267
|
required?: boolean;
|
266
268
|
optional?: boolean;
|
267
269
|
defaultValue?: string;
|
268
|
-
inputProps: InputProps;
|
270
|
+
inputProps: InputProps$1;
|
269
271
|
styles?: CSSProperties;
|
270
272
|
labelsProps?: FieldLabelsProps;
|
271
273
|
};
|
272
|
-
declare const InputField: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, }: InputFieldProps) => JSX.Element;
|
274
|
+
declare const InputField: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, rules, }: InputFieldProps) => JSX.Element;
|
273
275
|
|
274
276
|
declare const getFieldPlaceholder: (type: FieldTypes$1, title?: string) => string;
|
275
277
|
|
@@ -283,6 +285,7 @@ declare type UIField<T = string> = (UIInputField | UISelectField | UICheckboxFie
|
|
283
285
|
required?: boolean;
|
284
286
|
optional?: boolean;
|
285
287
|
tooltip?: string;
|
288
|
+
rules?: ControllerProps$1['rules'];
|
286
289
|
};
|
287
290
|
declare type UIInputField = {
|
288
291
|
type: 'input';
|
@@ -318,7 +321,7 @@ declare type FieldMapperProps<T extends object> = {
|
|
318
321
|
control?: Control<T>;
|
319
322
|
spacer?: number;
|
320
323
|
};
|
321
|
-
declare const FieldMapper: <T extends object>({ field, isEditMode, spacer, control, }: FieldMapperProps<T>) => JSX.Element;
|
324
|
+
declare const FieldMapper: <T extends object>({ field, isEditMode, spacer, control, }: FieldMapperProps<T>) => JSX.Element | null;
|
322
325
|
|
323
326
|
declare type CheckboxFieldProps = {
|
324
327
|
name: string;
|
@@ -332,13 +335,14 @@ declare type SelectFieldProps = {
|
|
332
335
|
selectProps: SelectProps;
|
333
336
|
labelsProps?: FieldLabelsProps;
|
334
337
|
name: string;
|
338
|
+
rules?: ControllerProps['rules'];
|
335
339
|
control?: Control<any>;
|
336
340
|
required?: boolean;
|
337
341
|
optional?: boolean;
|
338
342
|
defaultValue?: string;
|
339
343
|
styles?: CSSProperties;
|
340
344
|
};
|
341
|
-
declare const SelectField: ({ selectProps, name, defaultValue, optional, required, control, styles, labelsProps, }: SelectFieldProps) => JSX.Element;
|
345
|
+
declare const SelectField: ({ selectProps, name, defaultValue, optional, required, control, styles, labelsProps, rules, }: SelectFieldProps) => JSX.Element;
|
342
346
|
|
343
347
|
declare type CustomValidationRule<T = string> = {
|
344
348
|
text: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zealicsolutions/web-ui",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.3",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+ssh://git@bitbucket.org/Zealic_Solutions/zeal-ui-web.git"
|
@@ -26,10 +26,10 @@
|
|
26
26
|
"storybook": "start-storybook -p 6006",
|
27
27
|
"build-storybook": "build-storybook",
|
28
28
|
"clean": "rimraf dist",
|
29
|
-
"lint
|
30
|
-
"
|
29
|
+
"lint:fix": "eslint --fix ./src/**/*.ts",
|
30
|
+
"format:fix": "prettier --write ./src",
|
31
31
|
"prepare": "husky install",
|
32
|
-
"precommit": "yarn
|
32
|
+
"precommit": "yarn format:fix && yarn lint:fix"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
35
|
"@babel/core": "^7.19.0",
|
@@ -67,7 +67,6 @@
|
|
67
67
|
"jest": "^29.0.2",
|
68
68
|
"jest-environment-jsdom": "^29.0.2",
|
69
69
|
"prettier": "^2.7.1",
|
70
|
-
"react": "^18.2.0",
|
71
70
|
"rimraf": "^3.0.2",
|
72
71
|
"rollup": "^2.79.0",
|
73
72
|
"rollup-plugin-dts": "^4.2.2",
|
@@ -79,28 +78,29 @@
|
|
79
78
|
"typescript": "^4.8.2"
|
80
79
|
},
|
81
80
|
"peerDependencies": {
|
82
|
-
"react": "
|
83
|
-
"react-dom": "
|
84
|
-
"styled-components": "
|
81
|
+
"react": "^18.2.0",
|
82
|
+
"react-dom": "^18.2.0",
|
83
|
+
"styled-components": "^5.3.5"
|
85
84
|
},
|
86
85
|
"dependencies": {
|
86
|
+
"react": "^18.2.0",
|
87
|
+
"react-dom": "^18.2.0",
|
88
|
+
"styled-components": "^5.3.5",
|
87
89
|
"@mui/material": "^5.10.4",
|
88
90
|
"@mui/styled-engine-sc": "npm:@mui/styled-engine-sc@latest",
|
89
91
|
"@types/react-dom": "^18.0.6",
|
90
92
|
"rc-dropdown": "^4.0.1",
|
91
93
|
"rc-notification": "^4.6.0",
|
92
94
|
"rc-tooltip": "^5.2.2",
|
93
|
-
"react-dom": "^18.2.0",
|
94
95
|
"react-google-maps": "^9.4.5",
|
95
|
-
"react-hook-form": "^7.34.2"
|
96
|
-
"styled-components": "^5.3.5"
|
96
|
+
"react-hook-form": "^7.34.2"
|
97
97
|
},
|
98
98
|
"resolutions": {
|
99
99
|
"@mui/styled-engine": "npm:@mui/styled-engine-sc@latest"
|
100
100
|
},
|
101
101
|
"husky": {
|
102
102
|
"hooks": {
|
103
|
-
"precommit": "yarn
|
103
|
+
"precommit": "yarn format:fix && yarn lint:fix && yarn test"
|
104
104
|
}
|
105
105
|
},
|
106
106
|
"bugs": {
|