@trackunit/react-form-components 0.0.452 → 0.0.454
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/index.cjs.js +323 -200
- package/index.esm.js +323 -202
- package/package.json +3 -2
- package/src/components/ActionButton/ActionButton.d.ts +1 -1
- package/src/components/BaseInput/BaseInput.variants.d.ts +11 -1
- package/src/components/EmailInput/EmailInput.d.ts +14 -1
- package/src/components/Schedule/ScheduleParser.d.ts +6 -2
- package/src/components/Select/CreatableSelect.d.ts +1 -1
- package/src/components/Select/Select.d.ts +1 -1
- package/src/components/Select/Select.variants.d.ts +5 -0
- package/src/components/Select/shared.d.ts +2 -2
- package/src/components/Select/useCustomComponents.d.ts +1 -1
- package/src/components/SelectField/FormFieldSelectAdapter.d.ts +2 -2
- package/src/components/TextArea/TextArea.d.ts +1 -1
- package/src/utilities/compareReactNodes.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.454",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"@trackunit/i18n-library-translation": "*",
|
|
23
23
|
"zod": "3.22.4",
|
|
24
24
|
"react-hook-form": "7.40.0",
|
|
25
|
-
"rxjs": "7.8.1"
|
|
25
|
+
"rxjs": "7.8.1",
|
|
26
|
+
"tailwind-merge": "^2.0.0"
|
|
26
27
|
},
|
|
27
28
|
"module": "./index.esm.js",
|
|
28
29
|
"main": "./index.cjs.js"
|
|
@@ -43,5 +43,5 @@ type ActionButtonProps = CopyActionButtonProps | GenericActionButtonProps;
|
|
|
43
43
|
* @param {ActionButtonProps} props - The props for the ActionButton component
|
|
44
44
|
* @returns {JSX.Element} ActionButton component
|
|
45
45
|
*/
|
|
46
|
-
export declare const ActionButton: ({ type, value, dataTestId, iconSize, disabled, className }: ActionButtonProps) => JSX.Element
|
|
46
|
+
export declare const ActionButton: ({ type, value, dataTestId, iconSize, disabled, className }: ActionButtonProps) => JSX.Element;
|
|
47
47
|
export {};
|
|
@@ -9,13 +9,23 @@ export declare const cvaInput: (props?: ({
|
|
|
9
9
|
export declare const cvaInputField: (props?: ({
|
|
10
10
|
size?: "small" | "medium" | null | undefined;
|
|
11
11
|
disabled?: boolean | null | undefined;
|
|
12
|
+
autoFocus?: boolean | null | undefined;
|
|
13
|
+
addonBefore?: boolean | null | undefined;
|
|
14
|
+
prefix?: boolean | null | undefined;
|
|
12
15
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
16
|
export declare const cvaInputAddon: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
14
17
|
export declare const cvaInputAddonBefore: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
15
|
-
export declare const cvaInputAddonAfter: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
16
18
|
export declare const cvaInputPrefix: (props?: ({
|
|
17
19
|
disabled?: boolean | null | undefined;
|
|
20
|
+
addonBefore?: boolean | null | undefined;
|
|
18
21
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
19
22
|
export declare const cvaInputSuffix: (props?: ({
|
|
20
23
|
disabled?: boolean | null | undefined;
|
|
24
|
+
addonAfter?: boolean | null | undefined;
|
|
25
|
+
actions?: boolean | null | undefined;
|
|
26
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
27
|
+
export declare const cvaInputAddonAfter: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
28
|
+
export declare const cvaInputAction: (props?: ({
|
|
29
|
+
addonAfter?: boolean | null | undefined;
|
|
30
|
+
suffix?: boolean | null | undefined;
|
|
21
31
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { BaseInputProps } from "../BaseInput";
|
|
3
|
+
type BaseInputExposedProps = Omit<BaseInputProps, "type">;
|
|
4
|
+
export interface EmailInputProps extends BaseInputExposedProps {
|
|
5
|
+
/**
|
|
6
|
+
* To disable the action button.
|
|
7
|
+
*
|
|
8
|
+
* @default false
|
|
9
|
+
* @memberof EmailInputProps
|
|
10
|
+
* @example
|
|
11
|
+
* <UrLInput disableAction />
|
|
12
|
+
*/
|
|
13
|
+
disableAction?: boolean;
|
|
14
|
+
}
|
|
3
15
|
/**
|
|
4
16
|
* A Email Input component is used for input of the type Email.
|
|
5
17
|
*
|
|
@@ -10,4 +22,5 @@ import { BaseInputProps } from "../BaseInput";
|
|
|
10
22
|
* A reference to the input element is provided as the `ref` prop.
|
|
11
23
|
* For specific input types make sure to use the corresponding input component.
|
|
12
24
|
*/
|
|
13
|
-
export declare const EmailInput: React.ForwardRefExoticComponent<
|
|
25
|
+
export declare const EmailInput: React.ForwardRefExoticComponent<EmailInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
|
+
export {};
|
|
@@ -14,11 +14,14 @@ export declare enum ScheduleVariant {
|
|
|
14
14
|
WEEKDAYS = "week",
|
|
15
15
|
CUSTOM = "custom"
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
interface RawSchedule {
|
|
18
18
|
day: number;
|
|
19
|
-
range
|
|
19
|
+
range?: TimeRangeInput;
|
|
20
20
|
isAllDay: boolean;
|
|
21
21
|
}
|
|
22
|
+
export interface DaySchedule extends RawSchedule {
|
|
23
|
+
range: TimeRangeInput;
|
|
24
|
+
}
|
|
22
25
|
export interface WeekSchedule {
|
|
23
26
|
variant: ScheduleVariant;
|
|
24
27
|
schedule: DaySchedule[];
|
|
@@ -37,3 +40,4 @@ export declare const parseSchedule: (scheduleString?: string) => WeekSchedule;
|
|
|
37
40
|
* @returns {string} Schedule string
|
|
38
41
|
*/
|
|
39
42
|
export declare const serializeSchedule: (weekSchedule: WeekSchedule) => string;
|
|
43
|
+
export {};
|
|
@@ -17,6 +17,6 @@ export type CreatableSelectProps = {
|
|
|
17
17
|
* @returns {JSX.Element} CreatableSelect component
|
|
18
18
|
*/
|
|
19
19
|
export declare const CreatableSelect: {
|
|
20
|
-
<
|
|
20
|
+
<TOption, TIsAsync extends boolean = false, TIsMulti extends boolean = false, TGroup extends GroupBase<TOption> = GroupBase<TOption>>(props: SelectProps<TOption, TIsAsync, TIsMulti, TGroup> & CreatableSelectProps): JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
@@ -13,6 +13,6 @@ export interface SelectOption<TValue extends string> {
|
|
|
13
13
|
* @returns {JSX.Element} Select component
|
|
14
14
|
*/
|
|
15
15
|
export declare const Select: {
|
|
16
|
-
<
|
|
16
|
+
<TOption, TIsAsync extends boolean = false, TIsMulti extends boolean = false, TGroup extends GroupBase<TOption> = GroupBase<TOption>>(props: SelectProps<TOption, TIsAsync, TIsMulti, TGroup>): JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
@@ -2,6 +2,11 @@ export declare const cvaSelect: (props?: ({
|
|
|
2
2
|
invalid?: boolean | null | undefined;
|
|
3
3
|
disabled?: boolean | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaSelectControl: (props?: ({
|
|
6
|
+
isDisabled?: boolean | null | undefined;
|
|
7
|
+
prefix?: boolean | null | undefined;
|
|
8
|
+
invalid?: boolean | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
10
|
export declare const cvaSelectIcon: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
11
|
export declare const cvaSelectPrefix: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
7
12
|
export declare const cvaSelectXIcon: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -3,7 +3,7 @@ import { GroupBase, MultiValue, OptionsOrGroups, PropsValue, SingleValue } from
|
|
|
3
3
|
* @param {MultiValue<Option> | SingleValue<Option>} arg option to check type
|
|
4
4
|
* @returns {arg is MultiValue<Option> } is Multivalue
|
|
5
5
|
*/
|
|
6
|
-
export declare function isMultiValue<
|
|
6
|
+
export declare function isMultiValue<TOption>(arg: MultiValue<TOption> | SingleValue<TOption>): arg is MultiValue<TOption>;
|
|
7
7
|
/**
|
|
8
8
|
* @template IsMulti
|
|
9
9
|
* @template Group
|
|
@@ -11,4 +11,4 @@ export declare function isMultiValue<Option>(arg: MultiValue<Option> | SingleVal
|
|
|
11
11
|
* @param {PropsValue<Option> | undefined} value Selected values
|
|
12
12
|
* @returns {OptionsOrGroups<Option, Group>} An array of ordered options with selected on top
|
|
13
13
|
*/
|
|
14
|
-
export declare const getOrderedOptions: <
|
|
14
|
+
export declare const getOrderedOptions: <TOption, TGroup extends GroupBase<TOption>>(options: OptionsOrGroups<TOption, TGroup> | undefined, value: PropsValue<TOption> | undefined) => OptionsOrGroups<TOption, TGroup>;
|
|
@@ -16,4 +16,4 @@ import { SelectComponents } from "react-select/dist/declarations/src/components"
|
|
|
16
16
|
* @param {JSX.Element} dropdownIcon an custom dropdown icon
|
|
17
17
|
* @returns {Partial<SelectComponents<Option, boolean, GroupBase<Option>>> | undefined} components object to override react-select default components
|
|
18
18
|
*/
|
|
19
|
-
export declare const useCustomComponents: <
|
|
19
|
+
export declare const useCustomComponents: <TOption, TIsMulti extends boolean = false, TGroup extends GroupBase<TOption> = GroupBase<TOption>>(componentsProps: Partial<SelectComponents<TOption, TIsMulti, TGroup>> | undefined, disabled: boolean, menuIsOpen: boolean, refMenuIsEnabled: React.MutableRefObject<boolean>, dataTestId: string, maxSelectedDisplayCount: number | undefined, dropdownIcon?: JSX.Element, prefix?: JSX.Element, hasError?: boolean) => Partial<SelectComponents<TOption, TIsMulti, TGroup>>;
|
|
@@ -37,8 +37,8 @@ export type SelectFieldProps<TOptionType extends BaseOptionType> = CommonProps &
|
|
|
37
37
|
*/
|
|
38
38
|
errorMessage?: string;
|
|
39
39
|
};
|
|
40
|
-
interface FormFieldSelectAdapterProps<TOptionType extends BaseOptionType,
|
|
41
|
-
children: (props: SelectProps<TOptionType,
|
|
40
|
+
interface FormFieldSelectAdapterProps<TOptionType extends BaseOptionType, TIsAsync extends boolean = false, TIsMulti extends boolean = false> extends SelectFieldProps<TOptionType> {
|
|
41
|
+
children: (props: SelectProps<TOptionType, TIsAsync, TIsMulti, GroupBase<TOptionType>>) => JSX.Element;
|
|
42
42
|
}
|
|
43
43
|
export declare const FormFieldSelectAdapter: import("react").ForwardRefExoticComponent<FormFieldSelectAdapterProps<BaseOptionType, false, false> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
44
44
|
export {};
|
|
@@ -16,7 +16,7 @@ export interface TextAreaProps extends FilteredInputProps, CommonProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* Default value of the textarea.
|
|
18
18
|
*/
|
|
19
|
-
defaultValue?:
|
|
19
|
+
defaultValue?: string | number;
|
|
20
20
|
/**
|
|
21
21
|
* If true the field is rendered in its invalid state.
|
|
22
22
|
*/
|