@moser-inc/moser-labs-react 3.1.0 → 4.0.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.
@@ -1,19 +1,7 @@
1
1
  import { InputTextProps } from 'primereact/inputtext';
2
- import { FieldPath, FieldValues } from 'react-hook-form';
3
2
  import { FieldContainerInputProps } from './FieldContainer/FieldContainerInput';
4
- import { ControllerRenderParams } from '../types/ReactHookForm.type';
5
3
  type FieldProps = Partial<InputTextProps> & FieldContainerInputProps;
6
4
  export type LabsTextProps = FieldProps;
7
5
  export type LabsTextElement = HTMLInputElement;
8
6
  export declare const LabsText: import('react').ForwardRefExoticComponent<Partial<InputTextProps> & FieldContainerInputProps & import('react').RefAttributes<HTMLInputElement>>;
9
- export declare const toLabsTextProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field, fieldState, }: ControllerRenderParams<TValues, TName>) => {
10
- value: string;
11
- hasError: boolean;
12
- message: string | undefined;
13
- onChange: (...event: any[]) => void;
14
- onBlur: import('react-hook-form').Noop;
15
- disabled?: boolean;
16
- name: TName;
17
- ref: import('react-hook-form').RefCallBack;
18
- };
19
7
  export {};
@@ -1,13 +1,3 @@
1
1
  import { LabsTextProps } from './LabsText';
2
2
  export type LabsTextCurrencyProps = LabsTextProps;
3
3
  export declare const LabsTextCurrency: import('react').ForwardRefExoticComponent<Partial<import('primereact/inputtext').InputTextProps> & import('./FieldContainer/FieldContainerInput').FieldContainerInputProps & import('react').RefAttributes<HTMLInputElement>>;
4
- export declare const toLabsTextCurrencyProps: <TValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues, TName extends import('react-hook-form').FieldPath<TValues> = import('react-hook-form').FieldPath<TValues>>({ field, fieldState, }: import('../main').ControllerRenderParams<TValues, TName>) => {
5
- value: string;
6
- hasError: boolean;
7
- message: string | undefined;
8
- onChange: (...event: any[]) => void;
9
- onBlur: import('react-hook-form').Noop;
10
- disabled?: boolean;
11
- name: TName;
12
- ref: import('react-hook-form').RefCallBack;
13
- };
@@ -1,13 +1,3 @@
1
1
  import { LabsTextProps } from './LabsText';
2
2
  export type LabsTextSearchProps = LabsTextProps;
3
3
  export declare const LabsTextSearch: import('react').ForwardRefExoticComponent<Partial<import('primereact/inputtext').InputTextProps> & import('./FieldContainer/FieldContainerInput').FieldContainerInputProps & import('react').RefAttributes<HTMLInputElement>>;
4
- export declare const toLabsTextSearchProps: <TValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues, TName extends import('react-hook-form').FieldPath<TValues> = import('react-hook-form').FieldPath<TValues>>({ field, fieldState, }: import('../main').ControllerRenderParams<TValues, TName>) => {
5
- value: string;
6
- hasError: boolean;
7
- message: string | undefined;
8
- onChange: (...event: any[]) => void;
9
- onBlur: import('react-hook-form').Noop;
10
- disabled?: boolean;
11
- name: TName;
12
- ref: import('react-hook-form').RefCallBack;
13
- };
@@ -1,19 +1,7 @@
1
1
  import { InputTextareaProps } from 'primereact/inputtextarea';
2
- import { FieldPath, FieldValues } from 'react-hook-form';
3
2
  import { FieldContainerInputProps } from './FieldContainer/FieldContainerInput';
4
- import { ControllerRenderParams } from '../types/ReactHookForm.type';
5
3
  type FieldProps = Partial<InputTextareaProps> & FieldContainerInputProps;
6
4
  export type LabsTextareaProps = FieldProps;
7
5
  export type LabsTextareaElement = HTMLTextAreaElement;
8
6
  export declare const LabsTextarea: import('react').ForwardRefExoticComponent<Partial<InputTextareaProps> & FieldContainerInputProps & import('react').RefAttributes<HTMLTextAreaElement>>;
9
- export declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field, fieldState, }: ControllerRenderParams<TValues, TName>) => {
10
- value: string;
11
- hasError: boolean;
12
- message: string | undefined;
13
- onChange: (...event: any[]) => void;
14
- onBlur: import('react-hook-form').Noop;
15
- disabled?: boolean;
16
- name: TName;
17
- ref: import('react-hook-form').RefCallBack;
18
- };
19
7
  export {};
@@ -34,3 +34,4 @@ export * from './types/ReactHookForm.type';
34
34
  export * from './utils/animations';
35
35
  export * from './utils/number';
36
36
  export * from './utils/pluralize';
37
+ export * from './utils/reactHookFormHelpers';
@@ -0,0 +1,77 @@
1
+ import { FormEvent } from 'primereact/ts-helpers';
2
+ import { ControllerFieldState, FieldPath, FieldValues } from 'react-hook-form';
3
+ import { ControllerRenderParams } from '../types/ReactHookForm.type';
4
+ export declare const toFieldContainerProps: (fieldState: ControllerFieldState) => {
5
+ hasError: boolean;
6
+ message: string | undefined;
7
+ };
8
+ export declare const toLabsCheckboxProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
9
+ inputRef: import('react-hook-form').RefCallBack;
10
+ checked: TValues[TName];
11
+ onChange: (event: import('primereact/checkbox').CheckboxChangeEvent) => void;
12
+ hasError: boolean;
13
+ message: string | undefined;
14
+ onBlur: import('react-hook-form').Noop;
15
+ disabled?: boolean;
16
+ name: TName;
17
+ };
18
+ export declare const toLabsDateProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
19
+ inputRef: import('react-hook-form').RefCallBack;
20
+ value: TValues[TName];
21
+ onChange: (event: FormEvent<Date>) => void;
22
+ hasError: boolean;
23
+ message: string | undefined;
24
+ onBlur: import('react-hook-form').Noop;
25
+ disabled?: boolean;
26
+ name: TName;
27
+ };
28
+ export declare const toLabsSelectProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
29
+ inputRef: import('react-hook-form').RefCallBack;
30
+ value: TValues[TName];
31
+ onChange: (event: FormEvent<TValues[TName], import('react').SyntheticEvent<Element, Event>>) => void;
32
+ hasError: boolean;
33
+ message: string | undefined;
34
+ onBlur: import('react-hook-form').Noop;
35
+ disabled?: boolean;
36
+ name: TName;
37
+ };
38
+ export declare const toLabsTextProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
39
+ ref: import('react-hook-form').RefCallBack;
40
+ value: TValues[TName];
41
+ hasError: boolean;
42
+ message: string | undefined;
43
+ onChange: (...event: any[]) => void;
44
+ onBlur: import('react-hook-form').Noop;
45
+ disabled?: boolean;
46
+ name: TName;
47
+ };
48
+ export declare const toLabsTextCurrencyProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
49
+ ref: import('react-hook-form').RefCallBack;
50
+ value: TValues[TName];
51
+ hasError: boolean;
52
+ message: string | undefined;
53
+ onChange: (...event: any[]) => void;
54
+ onBlur: import('react-hook-form').Noop;
55
+ disabled?: boolean;
56
+ name: TName;
57
+ };
58
+ export declare const toLabsTextSearchProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
59
+ ref: import('react-hook-form').RefCallBack;
60
+ value: TValues[TName];
61
+ hasError: boolean;
62
+ message: string | undefined;
63
+ onChange: (...event: any[]) => void;
64
+ onBlur: import('react-hook-form').Noop;
65
+ disabled?: boolean;
66
+ name: TName;
67
+ };
68
+ export declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
69
+ ref: import('react-hook-form').RefCallBack;
70
+ value: TValues[TName];
71
+ hasError: boolean;
72
+ message: string | undefined;
73
+ onChange: (...event: any[]) => void;
74
+ onBlur: import('react-hook-form').Noop;
75
+ disabled?: boolean;
76
+ name: TName;
77
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moser-inc/moser-labs-react",
3
- "version": "3.1.0",
3
+ "version": "4.0.0",
4
4
  "description": "React components for the Moser Labs suite of applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "lint": "eslint --max-warnings 0",
31
31
  "preview": "vite preview",
32
32
  "test": "echo \"Error: no test specified\" && exit 1",
33
- "type-check": "tsc --noEmit",
33
+ "type-check": "tsc --noEmit -p tsconfig.app.json",
34
34
  "prepack": "npm run build"
35
35
  },
36
36
  "peerDependencies": {
@@ -63,6 +63,8 @@
63
63
  "devDependencies": {
64
64
  "@moser-inc/eslint-config-react": "^4.0.1",
65
65
  "@moser-inc/unocss-preset-moser-labs": "^2.2.1",
66
+ "@tsconfig/node22": "^22.0.2",
67
+ "@tsconfig/vite-react": "^6.3.5",
66
68
  "@types/lodash": "^4.17.17",
67
69
  "@unocss/eslint-config": "^66.1.3",
68
70
  "@vitejs/plugin-basic-ssl": "^2.0.0",