@trackunit/react-form-components 0.0.451 → 0.0.453
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 +130 -95
- package/index.esm.js +130 -95
- package/package.json +3 -2
- package/src/components/ActionButton/ActionButton.d.ts +1 -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/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.453",
|
|
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 {};
|
|
@@ -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
|
};
|
|
@@ -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) => 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
|
*/
|