@uxf/form 11.19.2 → 11.21.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.
- package/avatar-file-input/avatar-file-input.d.ts +1 -1
- package/avatar-file-input/avatar-file-input.js +1 -1
- package/checkbox-button/checkbox-button.d.ts +1 -1
- package/checkbox-input/checkbox-input.d.ts +1 -1
- package/color-radio-group/color-radio-group.d.ts +1 -1
- package/combobox/combobox.d.ts +1 -1
- package/combobox/combobox.js +1 -1
- package/date-picker-input/date-picker-input.d.ts +1 -1
- package/date-picker-input/date-picker-input.stories.js +8 -7
- package/date-range-picker-input/date-range-picker-input.d.ts +1 -1
- package/datetime-picker-input/datetime-picker-input.d.ts +1 -1
- package/datetime-picker-input/datetime-picker-input.stories.js +2 -1
- package/dropzone/dropzone-input.d.ts +1 -1
- package/dropzone/dropzone-input.js +1 -1
- package/file-input/file-input.d.ts +1 -1
- package/gps-input/gps-input.d.ts +1 -1
- package/multi-combobox/multi-combobox.d.ts +1 -1
- package/multi-combobox/multi-combobox.js +1 -1
- package/multi-select/multi-select.d.ts +1 -1
- package/multi-select/multi-select.js +1 -1
- package/multi-select/multi-select.stories.js +6 -4
- package/number-input/number-input.d.ts +1 -1
- package/package.json +2 -2
- package/password-input/password-input.d.ts +1 -1
- package/password-input/password-input.js +5 -5
- package/radio-group/radio-group.d.ts +1 -1
- package/radio-group/radio-group.js +1 -1
- package/select/select.d.ts +3 -7
- package/select/select.js +1 -1
- package/select/select.stories.js +4 -3
- package/text-input/text-input.d.ts +1 -1
- package/textarea/textarea.d.ts +1 -1
- package/time-picker-input/time-picker-input.d.ts +1 -1
- package/toggle/toggle.d.ts +1 -1
- package/toggle/toggle.js +1 -1
|
@@ -3,7 +3,7 @@ import { FileResponse } from "@uxf/ui/types";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|
|
5
5
|
import { ControlProps } from "../types";
|
|
6
|
-
export type AvatarFileInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIAvatarFileInputProps, "isInvalid" | "onChange" | "value"> & {
|
|
6
|
+
export type AvatarFileInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIAvatarFileInputProps, "isFocused" | "isInvalid" | "onChange" | "value"> & {
|
|
7
7
|
onChange?: UIAvatarFileInputProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
@@ -31,7 +31,7 @@ function AvatarFileInput(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(avatar_file_input_1.AvatarFileInput, { accept: props.accept, "aria-describedby": props["aria-describedby"], className: props.className, customControls: props.customControls, form: props.form, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, icon: props.icon, id: id, isDisabled: props.isDisabled,
|
|
34
|
+
return (react_1.default.createElement(avatar_file_input_1.AvatarFileInput, { accept: props.accept, "aria-describedby": props["aria-describedby"], className: props.className, customControls: props.customControls, form: props.form, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, icon: props.icon, id: id, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, maxFileSize: props.maxFileSize, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, onUploadError: props.onUploadError, onUploadFile: props.onUploadFile, ref: field.ref, removeFileLabel: props.removeFileLabel, selectFileLabel: props.selectFileLabel, value: field.value, variant: props.variant }));
|
|
35
35
|
}
|
|
36
36
|
exports.AvatarFileInput = AvatarFileInput;
|
|
37
37
|
AvatarFileInput.displayName = "UxfFormAvatarFileInput";
|
|
@@ -2,7 +2,7 @@ import { CheckboxButtonProps as UICheckboxButtonProps } from "@uxf/ui/checkbox-b
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UICheckboxButtonProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UICheckboxButtonProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
nullable?: boolean;
|
|
7
7
|
onChange?: UICheckboxButtonProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
|
@@ -2,7 +2,7 @@ import { CheckboxInputProps as UICheckboxInputProps } from "@uxf/ui/checkbox-inp
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UICheckboxInputProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UICheckboxInputProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
nullable?: boolean;
|
|
7
7
|
onChange?: UICheckboxInputProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
|
@@ -2,7 +2,7 @@ import { ColorRadioGroupProps as UIColorRadioGroupProps } from "@uxf/ui/color-ra
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ColorRadioGroupProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIColorRadioGroupProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ColorRadioGroupProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIColorRadioGroupProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UIColorRadioGroupProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
package/combobox/combobox.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ComboboxValueId, ComboboxProps as UIComboboxProps, ComboboxValue as UIC
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIComboboxProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIComboboxProps, "inputGroupRef" | "inputRef" | "inputWrapperRef" | "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UIComboboxProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
package/combobox/combobox.js
CHANGED
|
@@ -31,7 +31,7 @@ function Combobox(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(combobox_1.Combobox, { className: props.className, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy,
|
|
34
|
+
return (react_1.default.createElement(combobox_1.Combobox, { className: props.className, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: id, inputRef: field.ref, isClearable: props.isClearable, isDisabled: ((_e = props.options) === null || _e === void 0 ? void 0 : _e.length) === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, keyExtractor: props.keyExtractor, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, loadOptions: props.loadOptions, name: field.name, noQueryMessage: props.noQueryMessage, notFoundMessage: props.notFoundMessage, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, renderOption: props.renderOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, style: props.style, value: (_f = field.value) !== null && _f !== void 0 ? _f : null, variant: props.variant }));
|
|
35
35
|
}
|
|
36
36
|
exports.Combobox = Combobox;
|
|
37
37
|
Combobox.displayName = "UxfFormCombobox";
|
|
@@ -2,7 +2,7 @@ import { DatePickerInputProps as UIDatePickerInputProps } from "@uxf/ui/date-pic
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type DatePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDatePickerInputProps, "isInvalid" | "max" | "min" | "
|
|
5
|
+
export type DatePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDatePickerInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value"> & {
|
|
6
6
|
onChange?: UIDatePickerInputProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
minDate?: string;
|
|
@@ -5,21 +5,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Default = void 0;
|
|
7
7
|
const button_1 = require("@uxf/ui/button");
|
|
8
|
+
const date_picker_input_1 = require("@uxf/ui/date-picker-input");
|
|
8
9
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
10
11
|
const storybook_form_1 = require("../storybook/storybook-form");
|
|
11
|
-
const
|
|
12
|
+
const date_picker_input_2 = require("./date-picker-input");
|
|
12
13
|
exports.default = {
|
|
13
14
|
title: "Form/DatePickerInput",
|
|
14
|
-
component:
|
|
15
|
+
component: date_picker_input_2.DatePickerInput,
|
|
15
16
|
};
|
|
16
17
|
function Default() {
|
|
17
18
|
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
18
|
-
react_1.default.createElement(
|
|
19
|
-
react_1.default.createElement(
|
|
20
|
-
react_1.default.createElement(
|
|
21
|
-
react_1.default.createElement(
|
|
22
|
-
react_1.default.createElement(
|
|
19
|
+
react_1.default.createElement(date_picker_input_2.DatePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date picker", name: "default" }),
|
|
20
|
+
react_1.default.createElement(date_picker_input_2.DatePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date picker with default value", name: "withDefaultValue" }),
|
|
21
|
+
react_1.default.createElement(date_picker_input_2.DatePickerInput, { control: control, isClearable: true, isRequired: true, minDate: (0, dayjs_1.default)().format(date_picker_input_1.OUTPUT_DATE_FORMAT), maxDate: (0, dayjs_1.default)().add(6, "days").format(date_picker_input_1.OUTPUT_DATE_FORMAT), label: "Date picker with input min/max validation - only next 7 days", name: "withMinMaxValidation" }),
|
|
22
|
+
react_1.default.createElement(date_picker_input_2.DatePickerInput, { allowedDateFormats: ["MM/DD/YYYY", "M/D/YYYY"], control: control, displayDateFormat: "MM/DD/YYYY", id: "date-custom-format", isClearable: true, label: "Datum s vlastn\u00EDm form\u00E1tem (US)", name: "date" }),
|
|
23
|
+
react_1.default.createElement(date_picker_input_2.DatePickerInput, { bottomContent: react_1.default.createElement("div", null,
|
|
23
24
|
"Bottom content",
|
|
24
25
|
react_1.default.createElement("p", null, "Here can goes anything")), control: control, isClearable: true, isRequired: true, label: "With bottom content", name: "default" }),
|
|
25
26
|
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
@@ -2,7 +2,7 @@ import { DateRangePickerInputProps as UIDateRangePickerInputProps } from "@uxf/u
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type DateRangePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDateRangePickerInputProps, "isInvalid" | "max" | "min" | "
|
|
5
|
+
export type DateRangePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDateRangePickerInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value"> & {
|
|
6
6
|
onChange?: UIDateRangePickerInputProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
|
@@ -2,7 +2,7 @@ import { DatetimePickerInputProps as UIDatetimePickerInputProps } from "@uxf/ui/
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type DatetimePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDatetimePickerInputProps, "isInvalid" | "max" | "min" | "
|
|
5
|
+
export type DatetimePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDatetimePickerInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value"> & {
|
|
6
6
|
onChange?: UIDatetimePickerInputProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
minDate?: string;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Default = void 0;
|
|
7
7
|
const button_1 = require("@uxf/ui/button");
|
|
8
|
+
const date_picker_input_1 = require("@uxf/ui/date-picker-input");
|
|
8
9
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
10
11
|
const storybook_form_1 = require("../storybook/storybook-form");
|
|
@@ -17,7 +18,7 @@ function Default() {
|
|
|
17
18
|
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
18
19
|
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default datetime picker", name: "default" }),
|
|
19
20
|
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default datetime picker with default value", name: "withDefaultValue" }),
|
|
20
|
-
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: control, isClearable: true, isRequired: true, minDate:
|
|
21
|
+
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: control, isClearable: true, isRequired: true, minDate: (0, dayjs_1.default)().format(date_picker_input_1.OUTPUT_DATE_FORMAT), maxDate: (0, dayjs_1.default)().add(6, "days").format(date_picker_input_1.OUTPUT_DATE_FORMAT), label: "Date time picker with input min/max validation - only next 7 days", name: "withMinMaxValidation" }),
|
|
21
22
|
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { bottomContent: react_1.default.createElement("div", null,
|
|
22
23
|
"Bottom content",
|
|
23
24
|
react_1.default.createElement("p", null, "Here can goes anything")), control: control, isClearable: true, isRequired: true, label: "With bottom content", name: "default" }),
|
|
@@ -2,7 +2,7 @@ import { DropzoneInputProps as UIDropzoneProps } from "@uxf/ui/dropzone";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type DropzoneProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDropzoneProps, "onChange" | "value"> & {
|
|
5
|
+
export type DropzoneProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDropzoneProps, "isFocused" | "isInvalid" | "onChange" | "value"> & {
|
|
6
6
|
minFilesCount?: number;
|
|
7
7
|
onChange?: UIDropzoneProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
|
@@ -52,7 +52,7 @@ function DropzoneInput(props) {
|
|
|
52
52
|
field.onChange(value);
|
|
53
53
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
54
54
|
};
|
|
55
|
-
return (react_1.default.createElement(dropzone_1.Dropzone, { accept: props.accept, className: props.className, helperText: ((_d = fieldState.error) === null || _d === void 0 ? void 0 : _d.message) || props.helperText, icon: props.icon, id: id, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isRequired: props.isRequired, label: props.label, maxFileSize: props.maxFileSize, maxFilesCount: props.maxFilesCount, minFileSize: props.minFileSize, name: props.name, noClick: props.noClick, noDrag: props.noDrag, onChange: onChange, onUploadError: props.onUploadError, onUploadFile: props.onUploadFile, ref: field.ref, style: props.style, value: field.value }));
|
|
55
|
+
return (react_1.default.createElement(dropzone_1.Dropzone, { accept: props.accept, className: props.className, helperText: ((_d = fieldState.error) === null || _d === void 0 ? void 0 : _d.message) || props.helperText, icon: props.icon, id: id, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, maxFileSize: props.maxFileSize, maxFilesCount: props.maxFilesCount, minFileSize: props.minFileSize, name: props.name, noClick: props.noClick, noDrag: props.noDrag, onChange: onChange, onUploadError: props.onUploadError, onUploadFile: props.onUploadFile, ref: field.ref, style: props.style, value: field.value }));
|
|
56
56
|
}
|
|
57
57
|
exports.DropzoneInput = DropzoneInput;
|
|
58
58
|
DropzoneInput.displayName = "UxfFormDropzoneInput";
|
|
@@ -3,7 +3,7 @@ import { FileResponse } from "@uxf/ui/types";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|
|
5
5
|
import { ControlProps } from "../types";
|
|
6
|
-
export type FileInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIFileInputProps, "isInvalid" | "onChange" | "value"> & {
|
|
6
|
+
export type FileInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIFileInputProps, "isFocused" | "isInvalid" | "onChange" | "value"> & {
|
|
7
7
|
onChange?: UIFileInputProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
package/gps-input/gps-input.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type Gps = {
|
|
|
8
8
|
lng: number;
|
|
9
9
|
};
|
|
10
10
|
type OnChangeHandler = FormControlProps<string>["onChange"];
|
|
11
|
-
export type GpsInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextInputProps, "isInvalid" | "max" | "min" | "
|
|
11
|
+
export type GpsInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value" | "type"> & {
|
|
12
12
|
onChange?: OnChangeHandler;
|
|
13
13
|
requiredMessage?: string;
|
|
14
14
|
};
|
|
@@ -2,7 +2,7 @@ import { MultiComboboxOption, MultiComboboxProps as UIMultiComboboxProps } from
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIMultiComboboxProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIMultiComboboxProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UIMultiComboboxProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
|
@@ -31,7 +31,7 @@ function MultiCombobox(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(multi_combobox_1.MultiCombobox, { className: props.className, dropdownMaxHeight: props.dropdownMaxHeight, dropdownPlacement: props.dropdownPlacement, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: id, isDisabled: ((_e = props.options) === null || _e === void 0 ? void 0 : _e.length) === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, loadOptions: props.loadOptions, name: field.name, noQueryMessage: props.noQueryMessage, notFoundMessage: props.notFoundMessage, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, ref: field.ref, rightAddon: props.rightAddon, rightElement: props.rightElement, style: props.style, value: field.value, withCheckboxes: props.withCheckboxes }));
|
|
34
|
+
return (react_1.default.createElement(multi_combobox_1.MultiCombobox, { allOptionsSelectedMessage: props.allOptionsSelectedMessage, className: props.className, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownMaxHeight: props.dropdownMaxHeight, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, form: props.form, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: id, inputArrow: props.inputArrow, isDisabled: ((_e = props.options) === null || _e === void 0 ? void 0 : _e.length) === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, loadOptions: props.loadOptions, name: field.name, noQueryMessage: props.noQueryMessage, notFoundMessage: props.notFoundMessage, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, ref: field.ref, renderOption: props.renderOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, style: props.style, value: field.value, variant: props.variant, withCheckboxes: props.withCheckboxes }));
|
|
35
35
|
}
|
|
36
36
|
exports.MultiCombobox = MultiCombobox;
|
|
37
37
|
MultiCombobox.displayName = "UxfFormMultiCombobox";
|
|
@@ -2,7 +2,7 @@ import { MultiSelectOption, MultiSelectProps as UIMultiSelectProps } from "@uxf/
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIMultiSelectProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIMultiSelectProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UIMultiSelectProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
|
@@ -31,7 +31,7 @@ function MultiSelect(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(multi_select_1.MultiSelect, { className: props.className, dropdownMaxHeight: props.dropdownMaxHeight, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: id, isDisabled: props.options.length === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, ref: field.ref, style: props.style, value: field.value,
|
|
34
|
+
return (react_1.default.createElement(multi_select_1.MultiSelect, { className: props.className, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownMaxHeight: props.dropdownMaxHeight, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: id, inputArrow: props.inputArrow, isDisabled: props.options.length === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, ref: field.ref, renderOption: props.renderOption, size: props.size, style: props.style, value: field.value, variant: props.variant }));
|
|
35
35
|
}
|
|
36
36
|
exports.MultiSelect = MultiSelect;
|
|
37
37
|
MultiSelect.displayName = "UxfFormMultiSelect";
|
|
@@ -28,18 +28,20 @@ const options = [
|
|
|
28
28
|
];
|
|
29
29
|
function Default() {
|
|
30
30
|
const storyFormMultiSelect = (control) => (react_1.default.createElement("div", { className: "space-y-8" },
|
|
31
|
-
react_1.default.createElement(multi_select_1.MultiSelect, { control: control, dropdownMaxHeight: 350, helperText: "Vyberte pros\u00EDm jednu nebo v\u00EDce mo\u017Enost\u00ED", id: "form-multi-select", label: "MultiSelect
|
|
32
|
-
react_1.default.createElement(multi_select_1.MultiSelect, { control: control, id: "form-multi-select", label: "MultiSelect
|
|
31
|
+
react_1.default.createElement(multi_select_1.MultiSelect, { control: control, dropdownMaxHeight: 350, helperText: "Vyberte pros\u00EDm jednu nebo v\u00EDce mo\u017Enost\u00ED", id: "form-multi-select", label: "MultiSelect with disabled option", name: "multi-select-with-disabled", isRequired: true, options: options, placeholder: "Vyberte..." }),
|
|
32
|
+
react_1.default.createElement(multi_select_1.MultiSelect, { control: control, id: "form-multi-select", label: "MultiSelect", name: "multi-select", options: options, placeholder: "Vyberte..." }),
|
|
33
|
+
react_1.default.createElement(multi_select_1.MultiSelect, { control: control, id: "form-multi-select-required", label: "MultiSelect required", name: "multi-select-required", options: options, placeholder: "Vyberte..." }),
|
|
33
34
|
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
34
35
|
return (react_1.default.createElement(storybook_form_1.StorybookForm, { defaultValues: {
|
|
35
|
-
"multi-select": [
|
|
36
|
+
"multi-select-with-disabled": [
|
|
36
37
|
{ id: "one", label: "Option one" },
|
|
37
38
|
{ id: "two", label: "Option two disabled", disabled: true },
|
|
38
39
|
],
|
|
39
|
-
"multi-select
|
|
40
|
+
"multi-select": [
|
|
40
41
|
{ id: "one", label: "Option one" },
|
|
41
42
|
{ id: "two", label: "Option two" },
|
|
42
43
|
],
|
|
44
|
+
"multi-select-required": [],
|
|
43
45
|
} }, ({ control }) => (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
44
46
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, storyFormMultiSelect(control))))));
|
|
45
47
|
}
|
|
@@ -3,7 +3,7 @@ import { FormControlProps } from "@uxf/ui/types";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|
|
5
5
|
import { ControlProps } from "../types";
|
|
6
|
-
export type NumberInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextInputProps, "inputMode" | "isInvalid" | "maxLength" | "minLength" | "name" | "onChange" | "value" | "type"> & {
|
|
6
|
+
export type NumberInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextInputProps, "inputMode" | "isFocused" | "isInvalid" | "maxLength" | "minLength" | "name" | "onChange" | "value" | "type"> & {
|
|
7
7
|
decimalPlaces?: number;
|
|
8
8
|
maxMessage?: string;
|
|
9
9
|
minMessage?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/form",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.21.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "UX Fans s.r.o",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@uxf/ui": "11.
|
|
15
|
+
"@uxf/ui": "11.21.0",
|
|
16
16
|
"coordinate-parser": "1.0.7",
|
|
17
17
|
"dayjs": "1.11.10",
|
|
18
18
|
"react-hook-form": "7.51.0"
|
|
@@ -2,7 +2,7 @@ import { TextInputProps as UITextInputProps } from "@uxf/ui/text-input";
|
|
|
2
2
|
import { FormControlProps } from "@uxf/ui/types";
|
|
3
3
|
import React, { ReactNode } from "react";
|
|
4
4
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
5
|
-
export type PasswordInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITextInputProps, "isInvalid" | "max" | "min" | "name" | "onChange" | "value" | "type"> & {
|
|
5
|
+
export type PasswordInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITextInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "value" | "type"> & {
|
|
6
6
|
minLengthMessage?: string;
|
|
7
7
|
onChange?: FormControlProps<string | null>["onChange"];
|
|
8
8
|
renderVisibilitySetter?: (isVisible: boolean, onToggle: () => void) => ReactNode;
|
|
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.PasswordInput = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const use_on_unmount_1 = require("@uxf/core-react/hooks/use-on-unmount");
|
|
28
|
+
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
29
29
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
30
30
|
const button_1 = require("@uxf/ui/button");
|
|
31
31
|
const icon_1 = require("@uxf/ui/icon");
|
|
@@ -51,7 +51,7 @@ function usePasswordVisibility() {
|
|
|
51
51
|
inputRef.current.selectionEnd = newCursorPosition;
|
|
52
52
|
}, 0);
|
|
53
53
|
};
|
|
54
|
-
(0,
|
|
54
|
+
(0, use_on_unmount_1.useOnUnmount)(() => clearTimeout(timer.current));
|
|
55
55
|
return { isVisible, inputRef, onToggle: visibilityChangeHandler };
|
|
56
56
|
}
|
|
57
57
|
function PasswordInput(props) {
|
|
@@ -75,7 +75,7 @@ function PasswordInput(props) {
|
|
|
75
75
|
},
|
|
76
76
|
});
|
|
77
77
|
const passwordVisibility = usePasswordVisibility();
|
|
78
|
-
const inputRef = (0,
|
|
78
|
+
const inputRef = (0, compose_refs_1.composeRefs)(field.ref, passwordVisibility.inputRef);
|
|
79
79
|
const onBlur = (event) => {
|
|
80
80
|
var _a;
|
|
81
81
|
field.onBlur();
|
|
@@ -86,7 +86,7 @@ function PasswordInput(props) {
|
|
|
86
86
|
field.onChange(value);
|
|
87
87
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
88
88
|
};
|
|
89
|
-
return (react_1.default.createElement(text_input_1.TextInput, { autoComplete: props.autoComplete, autoFocus: props.autoFocus, className: props.className, enterKeyHint: props.enterKeyHint, form: props.form, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, id: id, inputMode: props.inputMode, isDisabled: props.isDisabled,
|
|
89
|
+
return (react_1.default.createElement(text_input_1.TextInput, { autoComplete: props.autoComplete, autoFocus: props.autoFocus, className: props.className, enterKeyHint: props.enterKeyHint, form: props.form, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, id: id, inputMode: props.inputMode, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, maxLength: props.maxLength, minLength: props.minLength, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, ref: inputRef, rightAddon: props.rightAddon, rightElement: (_f = (_e = props.renderVisibilitySetter) === null || _e === void 0 ? void 0 : _e.call(props, passwordVisibility.isVisible, passwordVisibility.onToggle)) !== null && _f !== void 0 ? _f : (react_1.default.createElement(button_1.Button, { onClick: passwordVisibility.onToggle, size: "xs", variant: "text" },
|
|
90
90
|
react_1.default.createElement(icon_1.Icon, { size: 20, name: passwordVisibility.isVisible ? "eye-slash" : "eye" }))), size: props.size, style: props.style, type: passwordVisibility.isVisible ? "text" : "password", value: (_g = field.value) !== null && _g !== void 0 ? _g : "", variant: props.variant }));
|
|
91
91
|
}
|
|
92
92
|
exports.PasswordInput = PasswordInput;
|
|
@@ -2,7 +2,7 @@ import { RadioGroupOptionValueId, RadioGroupProps as UIRadioGroupProps } from "@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type RadioGroupProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIRadioGroupProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type RadioGroupProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIRadioGroupProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UIRadioGroupProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
|
@@ -31,7 +31,7 @@ function RadioGroup(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(radio_group_1.RadioGroup, { className: props.className, forceColumn: props.forceColumn, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, id: id, isDisabled: props.options.length === 0 || props.isDisabled,
|
|
34
|
+
return (react_1.default.createElement(radio_group_1.RadioGroup, { className: props.className, forceColumn: props.forceColumn, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, id: id, isDisabled: props.options.length === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, radioSize: props.radioSize, ref: field.ref, style: props.style, value: (_e = field.value) !== null && _e !== void 0 ? _e : null, variant: props.variant }));
|
|
35
35
|
}
|
|
36
36
|
exports.RadioGroup = RadioGroup;
|
|
37
37
|
RadioGroup.displayName = "UxfFormRadioGroup";
|
package/select/select.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { SelectBaseValueId } from "@uxf/ui/_select-base";
|
|
2
1
|
import { SelectProps as UISelectProps, SelectValue as UISelectValue } from "@uxf/ui/select";
|
|
3
|
-
import { FormControlProps } from "@uxf/ui/types";
|
|
4
2
|
import React from "react";
|
|
5
3
|
import { FieldValues } from "react-hook-form";
|
|
6
4
|
import { ControlProps } from "../types";
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
onChange?: OnChangeHandler;
|
|
5
|
+
export type SelectProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UISelectProps, "inputGroupRef" | "inputRef" | "inputWrapperRef" | "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
|
+
onChange?: UISelectProps["onChange"];
|
|
10
7
|
requiredMessage?: string;
|
|
11
8
|
};
|
|
12
|
-
export type SelectValue<T extends
|
|
9
|
+
export type SelectValue<T extends UISelectValue> = T | null;
|
|
13
10
|
export declare function Select<FormData extends Record<string, any>>(props: SelectProps<FormData>): React.JSX.Element;
|
|
14
11
|
export declare namespace Select {
|
|
15
12
|
var displayName: string;
|
|
16
13
|
}
|
|
17
|
-
export {};
|
package/select/select.js
CHANGED
|
@@ -31,7 +31,7 @@ function Select(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(select_1.Select, { className: props.className, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownMaxHeight: props.dropdownMaxHeight, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy,
|
|
34
|
+
return (react_1.default.createElement(select_1.Select, { className: props.className, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownMaxHeight: props.dropdownMaxHeight, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, helperText: (_d = (_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: id, inputArrow: props.inputArrow, inputRef: field.ref, isClearable: props.isClearable, isDisabled: props.options.length === 0 || props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, keyExtractor: props.keyExtractor, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, renderOption: props.renderOption, renderSelectedOption: props.renderSelectedOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, style: props.style, value: field.value, variant: props.variant }));
|
|
35
35
|
}
|
|
36
36
|
exports.Select = Select;
|
|
37
37
|
Select.displayName = "UxfFormSelect";
|
package/select/select.stories.js
CHANGED
|
@@ -34,9 +34,10 @@ function Default() {
|
|
|
34
34
|
react_1.default.createElement(select_1.Select, { dropdownMaxHeight: 350, label: "Select form", name: "select", control: control, placeholder: "placeholder", options: options, id: "form-select", isClearable: true }),
|
|
35
35
|
react_1.default.createElement(select_1.Select, { label: "Select form disabled", name: "select-disabled", control: control, placeholder: "placeholder", options: options, id: "form-select", isDisabled: true }),
|
|
36
36
|
react_1.default.createElement(select_1.Select, { label: "Select form with helper text", name: "select-helper-text", control: control, placeholder: "placeholder", options: options, id: "form-select", helperText: "Choose one option" }),
|
|
37
|
-
react_1.default.createElement(select_1.Select, {
|
|
38
|
-
react_1.default.createElement(select_1.Select, {
|
|
39
|
-
react_1.default.createElement(select_1.Select, { label: "Select form
|
|
37
|
+
react_1.default.createElement(select_1.Select, { control: control, helperText: "Choose one option", id: "form-select", isRequired: true, label: "Select form required", name: "select-required", options: options, placeholder: "placeholder" }),
|
|
38
|
+
react_1.default.createElement(select_1.Select, { control: control, dropdownPlacement: "top", id: "form-select", label: "Select form with dropdown top", name: "select-dropdown-top", options: options, placeholder: "placeholder" }),
|
|
39
|
+
react_1.default.createElement(select_1.Select, { control: control, id: "form-select", isClearable: true, label: "Select form clearable", name: "select-dropdown-clearable", options: options, placeholder: "placeholder" }),
|
|
40
|
+
react_1.default.createElement(select_1.Select, { control: control, id: "form-select", isClearable: true, label: "Select form with number options", name: "select-dropdown-number", options: numberOptions, placeholder: "placeholder" }),
|
|
40
41
|
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
41
42
|
return (react_1.default.createElement(storybook_form_1.StorybookForm, null, ({ control }) => (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
42
43
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, storyFormSelects(control))))));
|
|
@@ -2,7 +2,7 @@ import { TextInputProps as UITextInputProps } from "@uxf/ui/text-input";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type TextInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextInputProps, "isInvalid" | "max" | "min" | "
|
|
5
|
+
export type TextInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value" | "type"> & {
|
|
6
6
|
onChange?: UITextInputProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
} & ({
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TextareaProps as UITextareaProps } from "@uxf/ui/textarea";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type TextareaProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextareaProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type TextareaProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITextareaProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UITextareaProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
|
@@ -3,7 +3,7 @@ import { TimePickerInputProps as UITimePickerInputProps } from "@uxf/ui/time-pic
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { FieldValues } from "react-hook-form";
|
|
5
5
|
import { ControlProps } from "../types";
|
|
6
|
-
export type TimePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITimePickerInputProps, "isInvalid" | "max" | "min" | "
|
|
6
|
+
export type TimePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UITimePickerInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value"> & {
|
|
7
7
|
onChange?: UIDatePickerInputProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
package/toggle/toggle.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ToggleProps as UIToggleProps } from "@uxf/ui/toggle";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
4
|
import { ControlProps } from "../types";
|
|
5
|
-
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIToggleProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
5
|
+
export type ComboProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIToggleProps, "isFocused" | "isInvalid" | "name" | "onChange" | "value"> & {
|
|
6
6
|
nullable?: boolean;
|
|
7
7
|
onChange?: UIToggleProps["onChange"];
|
|
8
8
|
requiredMessage?: string;
|
package/toggle/toggle.js
CHANGED
|
@@ -31,7 +31,7 @@ function Toggle(props) {
|
|
|
31
31
|
field.onChange(value);
|
|
32
32
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
33
33
|
};
|
|
34
|
-
return (react_1.default.createElement(toggle_1.Toggle, { className: props.className, hiddenLabel: props.hiddenLabel, id: id, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, ref: field.ref, style: props.style, value: (_c = field.value) !== null && _c !== void 0 ? _c : (!props.nullable ? false : undefined) }));
|
|
34
|
+
return (react_1.default.createElement(toggle_1.Toggle, { className: props.className, hiddenLabel: props.hiddenLabel, id: id, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, ref: field.ref, style: props.style, value: (_c = field.value) !== null && _c !== void 0 ? _c : (!props.nullable ? false : undefined), variant: props.variant }));
|
|
35
35
|
}
|
|
36
36
|
exports.Toggle = Toggle;
|
|
37
37
|
Toggle.displayName = "UxfFormToggle";
|