@uxf/form 1.0.0-beta.164 → 1.0.0-beta.166
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 +2 -2
- package/avatar-file-input/avatar-file-input.stories.d.ts +2 -2
- package/checkbox-button/checkbox-button.d.ts +2 -2
- package/checkbox-button/checkbox-button.stories.d.ts +2 -2
- package/checkbox-input/checkbox-input.d.ts +2 -2
- package/checkbox-input/checkbox-input.stories.d.ts +2 -2
- package/color-radio-group/color-radio-group.d.ts +2 -2
- package/color-radio-group/color-radio-group.stories.d.ts +2 -2
- package/combobox/combobox.d.ts +2 -2
- package/combobox/combobox.stories.d.ts +2 -2
- package/date-picker-input/date-picker-input.d.ts +2 -2
- package/date-picker-input/date-picker-input.js +2 -3
- package/date-picker-input/date-picker-input.stories.d.ts +2 -2
- package/date-picker-input/date-picker-input.stories.js +2 -2
- package/datetime-picker-input/datetime-picker-input.d.ts +11 -0
- package/datetime-picker-input/datetime-picker-input.js +55 -0
- package/datetime-picker-input/datetime-picker-input.stories.d.ts +8 -0
- package/datetime-picker-input/datetime-picker-input.stories.js +27 -0
- package/datetime-picker-input/index.d.ts +1 -0
- package/datetime-picker-input/index.js +17 -0
- package/dropzone/dropzone-input.d.ts +2 -2
- package/dropzone/dropzone-list.d.ts +2 -2
- package/dropzone/dropzone.stories.d.ts +2 -2
- package/file-input/file-input.d.ts +2 -2
- package/file-input/file-input.stories.d.ts +2 -2
- package/form/form.d.ts +2 -2
- package/form/form.stories.d.ts +2 -2
- package/gps-input/gps-input.d.ts +2 -2
- package/gps-input/gps-input.stories.d.ts +2 -2
- package/multi-combobox/multi-combobox.d.ts +2 -2
- package/multi-combobox/multi-combobox.stories.d.ts +2 -2
- package/multi-select/multi-select.d.ts +2 -2
- package/multi-select/multi-select.stories.d.ts +2 -2
- package/number-input/number-input.d.ts +2 -2
- package/number-input/number-input.stories.d.ts +2 -2
- package/package.json +3 -3
- package/radio-group/radio-group.d.ts +2 -2
- package/radio-group/radio-group.stories.d.ts +2 -2
- package/select/select.d.ts +2 -2
- package/select/select.stories.d.ts +2 -2
- package/storybook/form-data-printer.d.ts +2 -2
- package/storybook/storybook-form.d.ts +2 -2
- package/text-input/text-input.d.ts +2 -2
- package/text-input/text-input.stories.d.ts +2 -2
- package/textarea/textarea.d.ts +2 -2
- package/textarea/textarea.stories.d.ts +2 -2
- package/time-picker-input/time-picker-input.d.ts +2 -2
- package/time-picker-input/time-picker-input.js +2 -3
- package/time-picker-input/time-picker-input.stories.d.ts +2 -2
- package/time-picker-input/time-picker-input.stories.js +2 -2
- package/toggle/toggle.d.ts +2 -2
- package/toggle/toggle.stories.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { AvatarFileInputProps as UIAvatarFileInputProps } from "@uxf/ui/avatar-file-input";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FileResponse, FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<FileResponse | null>["onChange"];
|
|
@@ -7,7 +7,7 @@ export type AvatarFileInputProps<FormData extends FieldValues> = UseControllerPr
|
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function AvatarFileInput<FormData extends FieldValues>(props: AvatarFileInputProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function AvatarFileInput<FormData extends FieldValues>(props: AvatarFileInputProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace AvatarFileInput {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { AvatarFileInput } from "./avatar-file-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof AvatarFileInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CheckboxButtonProps as UICheckboxButtonProps } from "@uxf/ui/checkbox-button";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<boolean | undefined>["onChange"];
|
|
6
6
|
export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UICheckboxButtonProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
@@ -8,7 +8,7 @@ export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormDa
|
|
|
8
8
|
onChange?: OnChangeHandler;
|
|
9
9
|
requiredMessage?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare function CheckboxButton<FormData extends Record<string, any>>(props: ComboProps<FormData>): JSX.Element;
|
|
11
|
+
export declare function CheckboxButton<FormData extends Record<string, any>>(props: ComboProps<FormData>): React.JSX.Element;
|
|
12
12
|
export declare namespace CheckboxButton {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CheckboxButton } from "./checkbox-button";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof CheckboxButton;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CheckboxInputProps as UICheckboxInputProps } from "@uxf/ui/checkbox-input";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<boolean | undefined>["onChange"];
|
|
@@ -8,7 +8,7 @@ export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormDa
|
|
|
8
8
|
onChange?: OnChangeHandler;
|
|
9
9
|
requiredMessage?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare function CheckboxInput<FormData extends Record<string, any>>(props: ComboProps<FormData>): JSX.Element;
|
|
11
|
+
export declare function CheckboxInput<FormData extends Record<string, any>>(props: ComboProps<FormData>): React.JSX.Element;
|
|
12
12
|
export declare namespace CheckboxInput {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CheckboxInput } from "./checkbox-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof CheckboxInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ColorRadioGroupOptionValue, ColorRadioGroupProps as UIColorRadioGroupProps } from "@uxf/ui/color-radio-group";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<ColorRadioGroupOptionValue | null>["onChange"];
|
|
@@ -7,7 +7,7 @@ export type ColorRadioGroupProps<FormData extends FieldValues> = UseControllerPr
|
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function ColorRadioGroup<FormData extends Record<string, any>>(props: ColorRadioGroupProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function ColorRadioGroup<FormData extends Record<string, any>>(props: ColorRadioGroupProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace ColorRadioGroup {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { ColorRadioGroup } from "./index";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof ColorRadioGroup;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
package/combobox/combobox.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ComboboxProps as UIComboboxProps, ComboboxValue } from "@uxf/ui/combobox";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<ComboboxValue | null>["onChange"];
|
|
6
6
|
export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UIComboboxProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function Combobox<FormData extends Record<string, any>>(props: ComboProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function Combobox<FormData extends Record<string, any>>(props: ComboProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace Combobox {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Combobox } from "./combobox";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof Combobox;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DatePickerInputProps as UIDatePickerInputProps } from "@uxf/ui/date-picker-input";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
export type DatePickerInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UIDatePickerInputProps, "isInvalid" | "max" | "min" | "pattern" | "step" | "name" | "onChange" | "value"> & {
|
|
5
5
|
onChange?: UIDatePickerInputProps["onChange"];
|
|
6
6
|
requiredMessage?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare function DatePickerInput<FormData extends FieldValues>(props: DatePickerInputProps<FormData>): JSX.Element;
|
|
8
|
+
export declare function DatePickerInput<FormData extends FieldValues>(props: DatePickerInputProps<FormData>): React.JSX.Element;
|
|
9
9
|
export declare namespace DatePickerInput {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
@@ -31,7 +31,6 @@ const date_picker_input_1 = require("@uxf/ui/date-picker-input");
|
|
|
31
31
|
const dayjs_1 = __importStar(require("dayjs"));
|
|
32
32
|
const react_1 = __importDefault(require("react"));
|
|
33
33
|
const react_hook_form_1 = require("react-hook-form");
|
|
34
|
-
const date_picker_input_2 = require("@uxf/ui/date-picker-input/date-picker-input");
|
|
35
34
|
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
36
35
|
const form_id_context_1 = require("../form-id-context");
|
|
37
36
|
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
@@ -51,8 +50,8 @@ function DatePickerInput(props) {
|
|
|
51
50
|
if (!value) {
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
|
-
if (!(0, dayjs_1.default)(value,
|
|
55
|
-
return
|
|
53
|
+
if (!(0, dayjs_1.default)(value, date_picker_input_1.OUTPUT_DATE_FORMAT, true).isValid()) {
|
|
54
|
+
return `Datum musí být ve formátu ${date_picker_input_1.DISPLAY_DATE_FORMAT}.`;
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
...(typeof ((_c = props.rules) === null || _c === void 0 ? void 0 : _c.validate) === "function"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { DatePickerInput } from "./date-picker-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof DatePickerInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -15,8 +15,8 @@ exports.default = {
|
|
|
15
15
|
};
|
|
16
16
|
function Default() {
|
|
17
17
|
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
18
|
-
react_1.default.createElement(date_picker_input_1.DatePickerInput, { label: "Default date picker", name: "default",
|
|
19
|
-
react_1.default.createElement(date_picker_input_1.DatePickerInput, { label: "Default date picker with default value", name: "withDefaultValue",
|
|
18
|
+
react_1.default.createElement(date_picker_input_1.DatePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date picker", name: "default", placeholder: "" }),
|
|
19
|
+
react_1.default.createElement(date_picker_input_1.DatePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date picker with default value", name: "withDefaultValue", placeholder: "" }),
|
|
20
20
|
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
21
21
|
return (react_1.default.createElement(storybook_form_1.StorybookForm, { defaultValues: {
|
|
22
22
|
withDefaultValue: (0, dayjs_1.default)().format("YYYY-MM-DD"),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DatetimePickerInputProps as UIDatetimePickerInputProps } from "@uxf/ui/datetime-picker-input";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
|
+
export type DatetimePickerInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UIDatetimePickerInputProps, "isInvalid" | "max" | "min" | "pattern" | "step" | "name" | "onChange" | "value"> & {
|
|
5
|
+
onChange?: UIDatetimePickerInputProps["onChange"];
|
|
6
|
+
requiredMessage?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function DatetimePickerInput<FormData extends FieldValues>(props: DatetimePickerInputProps<FormData>): React.JSX.Element;
|
|
9
|
+
export declare namespace DatetimePickerInput {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DatetimePickerInput = void 0;
|
|
7
|
+
const datetime_picker_input_1 = require("@uxf/ui/datetime-picker-input");
|
|
8
|
+
const dayjs_1 = require("dayjs");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
11
|
+
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
12
|
+
const form_id_context_1 = require("../form-id-context");
|
|
13
|
+
const datetime_picker_1 = require("@uxf/ui/datetime-picker");
|
|
14
|
+
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
15
|
+
function DatetimePickerInput(props) {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
17
|
+
const formId = (0, form_id_context_1.useFormIdContext)();
|
|
18
|
+
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formId}__${props.name}`;
|
|
19
|
+
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
20
|
+
control: props.control,
|
|
21
|
+
defaultValue: props.defaultValue,
|
|
22
|
+
name: props.name,
|
|
23
|
+
rules: {
|
|
24
|
+
required: props.isRequired ? props.requiredMessage || "Toto pole je povinné" : undefined,
|
|
25
|
+
...((_b = props.rules) !== null && _b !== void 0 ? _b : {}),
|
|
26
|
+
validate: {
|
|
27
|
+
validDate: (value) => {
|
|
28
|
+
if (!value) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!(0, datetime_picker_1.getStrictParsedDatetime)(value).isValid()) {
|
|
32
|
+
return `Datum a čas musí být ve formátu ${datetime_picker_input_1.DISPLAY_DATETIME_FORMAT}.`;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
...(typeof ((_c = props.rules) === null || _c === void 0 ? void 0 : _c.validate) === "function"
|
|
36
|
+
? { custom: props.rules.validate }
|
|
37
|
+
: (_e = (_d = props.rules) === null || _d === void 0 ? void 0 : _d.validate) !== null && _e !== void 0 ? _e : {}),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
shouldUnregister: props.shouldUnregister,
|
|
41
|
+
});
|
|
42
|
+
const onBlur = (event) => {
|
|
43
|
+
var _a;
|
|
44
|
+
field.onBlur();
|
|
45
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
46
|
+
};
|
|
47
|
+
const onChange = (value, event) => {
|
|
48
|
+
var _a;
|
|
49
|
+
field.onChange(value);
|
|
50
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
51
|
+
};
|
|
52
|
+
return (react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { className: props.className, form: props.form, helperText: (_g = (_f = fieldState.error) === null || _f === void 0 ? void 0 : _f.message) !== null && _g !== void 0 ? _g : props.helperText, hiddenLabel: props.hiddenLabel, id: id, isClearable: props.isClearable, isDisabled: props.isDisabled, isInvalid: !!fieldState.error, isReadOnly: props.isReadOnly, isRequired: props.isRequired, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: field.name, onBlur: onBlur, onChange: onChange, onFocus: props.onFocus, placeholder: props.placeholder, popoverPlacement: props.popoverPlacement, popoverStrategy: props.popoverStrategy, ref: field.ref, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, triggerElement: props.triggerElement, value: field.value, variant: props.variant }));
|
|
53
|
+
}
|
|
54
|
+
exports.DatetimePickerInput = DatetimePickerInput;
|
|
55
|
+
DatetimePickerInput.displayName = "UxfFormDatePickerInput";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Default = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const datetime_picker_input_1 = require("./datetime-picker-input");
|
|
9
|
+
const storybook_form_1 = require("../storybook/storybook-form");
|
|
10
|
+
const button_1 = require("@uxf/ui/button");
|
|
11
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
12
|
+
exports.default = {
|
|
13
|
+
title: "Form/DatetimePickerInput",
|
|
14
|
+
component: datetime_picker_input_1.DatetimePickerInput,
|
|
15
|
+
};
|
|
16
|
+
function Default() {
|
|
17
|
+
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
18
|
+
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date picker", name: "default", placeholder: "" }),
|
|
19
|
+
react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date picker with default value", name: "withDefaultValue", placeholder: "" }),
|
|
20
|
+
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
21
|
+
return (react_1.default.createElement(storybook_form_1.StorybookForm, { defaultValues: {
|
|
22
|
+
withDefaultValue: (0, dayjs_1.default)().toISOString(),
|
|
23
|
+
} }, ({ control }) => (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
24
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, storyFormDatePickers(control)),
|
|
25
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 text-white lg:w-1/2" }, storyFormDatePickers(control))))));
|
|
26
|
+
}
|
|
27
|
+
exports.Default = Default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./datetime-picker-input";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./datetime-picker-input"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DropzoneInputProps as UIDropzoneProps } from "@uxf/ui/dropzone";
|
|
3
2
|
import { DropzoneFile } from "@uxf/ui/dropzone/types";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
5
5
|
import { FormControlProps } from "@uxf/ui/types";
|
|
6
6
|
type OnChangeHandler = FormControlProps<DropzoneFile[] | undefined>["onChange"];
|
|
@@ -9,7 +9,7 @@ export type DropzoneProps<FormData extends FieldValues> = UseControllerProps<For
|
|
|
9
9
|
onChange?: OnChangeHandler;
|
|
10
10
|
requiredMessage?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function DropzoneInput<FormData extends FieldValues>(props: DropzoneProps<FormData>): JSX.Element;
|
|
12
|
+
export declare function DropzoneInput<FormData extends FieldValues>(props: DropzoneProps<FormData>): React.JSX.Element;
|
|
13
13
|
export declare namespace DropzoneInput {
|
|
14
14
|
var displayName: string;
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DropzoneListProps as UIDropzoneListProps } from "@uxf/ui/dropzone";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
import { DropzoneFile } from "@uxf/ui/dropzone/types";
|
|
@@ -7,7 +7,7 @@ type OnChangeHandler = FormControlProps<DropzoneFile[] | undefined>["onChange"];
|
|
|
7
7
|
export interface DropzoneListProps<FormData extends FieldValues> extends Pick<UseControllerProps<FormData>, "control" | "name">, Pick<UIDropzoneListProps, "errorText" | "onAbortWarning" | "onRemoveWarning" | "renderItem"> {
|
|
8
8
|
onChange?: OnChangeHandler;
|
|
9
9
|
}
|
|
10
|
-
export declare function DropzoneList<FormData extends FieldValues>(props: DropzoneListProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function DropzoneList<FormData extends FieldValues>(props: DropzoneListProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace DropzoneList {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: typeof import("./dropzone-input").DropzoneInput & {
|
|
@@ -6,4 +6,4 @@ declare const _default: {
|
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
9
|
-
export declare function Default(): JSX.Element;
|
|
9
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FileInputProps as UIFileInputProps } from "@uxf/ui/file-input";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FileResponse, FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<FileResponse | null>["onChange"];
|
|
@@ -7,7 +7,7 @@ export type FileInputProps<FormData extends FieldValues> = UseControllerProps<Fo
|
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function FileInput<FormData extends FieldValues>(props: FileInputProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function FileInput<FormData extends FieldValues>(props: FileInputProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace FileInput {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { FileInput } from "./file-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof FileInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
package/form/form.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { FieldValues, SubmitHandler, UseFormReturn } from "react-hook-form";
|
|
3
3
|
export type FormProps<TFieldValues extends FieldValues> = {
|
|
4
4
|
children: ReactNode;
|
|
@@ -8,7 +8,7 @@ export type FormProps<TFieldValues extends FieldValues> = {
|
|
|
8
8
|
omitSubmitInput?: boolean;
|
|
9
9
|
onSubmit: SubmitHandler<TFieldValues>;
|
|
10
10
|
};
|
|
11
|
-
export declare function Form<TFieldValues extends FieldValues = FieldValues>(props: FormProps<TFieldValues>): JSX.Element;
|
|
11
|
+
export declare function Form<TFieldValues extends FieldValues = FieldValues>(props: FormProps<TFieldValues>): React.JSX.Element;
|
|
12
12
|
export declare namespace Form {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
package/form/form.stories.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Form } from "./form";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof Form;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
package/gps-input/gps-input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextInputProps as UITextInputProps } from "@uxf/ui/text-input";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
export type Gps = {
|
|
6
6
|
lat: number;
|
|
@@ -11,7 +11,7 @@ export type GpsInputProps<FormData extends FieldValues> = UseControllerProps<For
|
|
|
11
11
|
onChange?: OnChangeHandler;
|
|
12
12
|
requiredMessage?: string;
|
|
13
13
|
};
|
|
14
|
-
export declare function GpsInput<FormData extends Record<string, Gps | null | undefined>>(props: GpsInputProps<FormData>): JSX.Element;
|
|
14
|
+
export declare function GpsInput<FormData extends Record<string, Gps | null | undefined>>(props: GpsInputProps<FormData>): React.JSX.Element;
|
|
15
15
|
export declare namespace GpsInput {
|
|
16
16
|
var displayName: string;
|
|
17
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { GpsInput } from "./gps-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof GpsInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MultiComboboxOption, MultiComboboxProps as UIMultiComboboxProps } from "@uxf/ui/multi-combobox";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<MultiComboboxOption[] | null>["onChange"];
|
|
@@ -7,7 +7,7 @@ export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormDa
|
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function MultiCombobox<FormData extends Record<string, any>>(props: ComboProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function MultiCombobox<FormData extends Record<string, any>>(props: ComboProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace MultiCombobox {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { MultiCombobox } from "./multi-combobox";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof MultiCombobox;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MultiSelectOption, MultiSelectProps as UIMultiSelectProps } from "@uxf/ui/multi-select";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<MultiSelectOption[] | null>["onChange"];
|
|
@@ -7,7 +7,7 @@ export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormDa
|
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function MultiSelect<FormData extends Record<string, any>>(props: ComboProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function MultiSelect<FormData extends Record<string, any>>(props: ComboProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace MultiSelect {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { MultiSelect } from "./multi-select";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof MultiSelect;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextInputProps as UITextInputProps } from "@uxf/ui/text-input";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<string>["onChange"];
|
|
6
6
|
export type NumberInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITextInputProps, "inputMode" | "isInvalid" | "maxLength" | "minLength" | "name" | "onChange" | "value" | "type"> & {
|
|
@@ -8,7 +8,7 @@ export type NumberInputProps<FormData extends FieldValues> = UseControllerProps<
|
|
|
8
8
|
onChange?: OnChangeHandler;
|
|
9
9
|
requiredMessage?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare function NumberInput<FormData extends FieldValues>(props: NumberInputProps<FormData>): JSX.Element;
|
|
11
|
+
export declare function NumberInput<FormData extends FieldValues>(props: NumberInputProps<FormData>): React.JSX.Element;
|
|
12
12
|
export declare namespace NumberInput {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { NumberInput } from "./number-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof NumberInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/form",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.166",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"author": "UX Fans s.r.o",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@uxf/ui": "^1.0.0-beta.
|
|
17
|
-
"react-hook-form": "^7.
|
|
16
|
+
"@uxf/ui": "^1.0.0-beta.166",
|
|
17
|
+
"react-hook-form": "^7.44.2",
|
|
18
18
|
"coordinate-parser": "^1.0.7"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { RadioGroupOptionValue, RadioGroupProps as UIRadioGroupProps } from "@uxf/ui/radio-group";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<RadioGroupOptionValue | null>["onChange"];
|
|
@@ -7,7 +7,7 @@ export type RadioGroupProps<FormData extends FieldValues> = UseControllerProps<F
|
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function RadioGroup<FormData extends Record<string, any>>(props: RadioGroupProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function RadioGroup<FormData extends Record<string, any>>(props: RadioGroupProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace RadioGroup {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { RadioGroup } from "./index";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof RadioGroup;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
package/select/select.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { SelectProps as UISelectProps, SelectValue } from "@uxf/ui/select";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<SelectValue | null>["onChange"];
|
|
6
6
|
export type SelectProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UISelectProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function Select<FormData extends Record<string, any>>(props: SelectProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function Select<FormData extends Record<string, any>>(props: SelectProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace Select {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Select } from "./select";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof Select;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
interface FormDataPrinterProps {
|
|
3
3
|
control: any;
|
|
4
4
|
}
|
|
5
|
-
export declare function FormDataPrinter(props: FormDataPrinterProps): JSX.Element;
|
|
5
|
+
export declare function FormDataPrinter(props: FormDataPrinterProps): React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { UseFormProps, UseFormReturn } from "react-hook-form";
|
|
3
3
|
interface FormProps extends UseFormProps {
|
|
4
4
|
children: (form: UseFormReturn) => ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export declare function StorybookForm(props: FormProps): JSX.Element;
|
|
6
|
+
export declare function StorybookForm(props: FormProps): React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextInputProps as UITextInputProps } from "@uxf/ui/text-input";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<string>["onChange"];
|
|
6
6
|
export type TextInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITextInputProps, "isInvalid" | "max" | "min" | "pattern" | "step" | "name" | "onChange" | "value" | "type"> & {
|
|
@@ -19,7 +19,7 @@ export type TextInputProps<FormData extends FieldValues> = UseControllerProps<Fo
|
|
|
19
19
|
invalidPhoneMessage?: never;
|
|
20
20
|
type?: "password" | "search" | "text" | "url";
|
|
21
21
|
});
|
|
22
|
-
export declare function TextInput<FormData extends FieldValues>(props: TextInputProps<FormData>): JSX.Element;
|
|
22
|
+
export declare function TextInput<FormData extends FieldValues>(props: TextInputProps<FormData>): React.JSX.Element;
|
|
23
23
|
export declare namespace TextInput {
|
|
24
24
|
var displayName: string;
|
|
25
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { TextInput } from "./text-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof TextInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextareaProps as UITextareaProps } from "@uxf/ui/textarea";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<string, HTMLTextAreaElement>["onChange"];
|
|
6
6
|
export type TextareaProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITextareaProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
7
7
|
onChange?: OnChangeHandler;
|
|
8
8
|
requiredMessage?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function Textarea<FormData extends Record<string, any>>(props: TextareaProps<FormData>): JSX.Element;
|
|
10
|
+
export declare function Textarea<FormData extends Record<string, any>>(props: TextareaProps<FormData>): React.JSX.Element;
|
|
11
11
|
export declare namespace Textarea {
|
|
12
12
|
var displayName: string;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Textarea } from "./textarea";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof Textarea;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TimePickerInputProps as UITimePickerInputProps } from "@uxf/ui/time-picker-input";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { DatePickerInputProps as UIDatePickerInputProps } from "@uxf/ui/date-picker-input";
|
|
5
5
|
export type TimePickerInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITimePickerInputProps, "isInvalid" | "max" | "min" | "pattern" | "step" | "name" | "onChange" | "value"> & {
|
|
6
6
|
onChange?: UIDatePickerInputProps["onChange"];
|
|
7
7
|
requiredMessage?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function TimePickerInput<FormData extends FieldValues>(props: TimePickerInputProps<FormData>): JSX.Element;
|
|
9
|
+
export declare function TimePickerInput<FormData extends FieldValues>(props: TimePickerInputProps<FormData>): React.JSX.Element;
|
|
10
10
|
export declare namespace TimePickerInput {
|
|
11
11
|
var displayName: string;
|
|
12
12
|
}
|
|
@@ -31,7 +31,6 @@ const time_picker_input_1 = require("@uxf/ui/time-picker-input");
|
|
|
31
31
|
const react_hook_form_1 = require("react-hook-form");
|
|
32
32
|
const react_1 = __importDefault(require("react"));
|
|
33
33
|
const dayjs_1 = __importStar(require("dayjs"));
|
|
34
|
-
const time_picker_input_2 = require("@uxf/ui/time-picker-input/time-picker-input");
|
|
35
34
|
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
36
35
|
const form_id_context_1 = require("../form-id-context");
|
|
37
36
|
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
@@ -51,8 +50,8 @@ function TimePickerInput(props) {
|
|
|
51
50
|
if (!value) {
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
|
-
if (!(0, dayjs_1.default)(value,
|
|
55
|
-
return
|
|
53
|
+
if (!(0, dayjs_1.default)(value, time_picker_input_1.OUTPUT_TIME_FORMAT, true).isValid()) {
|
|
54
|
+
return `Čas musí být ve formátu ${time_picker_input_1.DISPLAY_TIME_FORMAT}.`;
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
...(typeof ((_c = props.rules) === null || _c === void 0 ? void 0 : _c.validate) === "function"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { TimePickerInput } from "./time-picker-input";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof TimePickerInput;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -15,8 +15,8 @@ exports.default = {
|
|
|
15
15
|
};
|
|
16
16
|
function Default() {
|
|
17
17
|
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
18
|
-
react_1.default.createElement(time_picker_input_1.TimePickerInput, { label: "Default time picker", name: "default",
|
|
19
|
-
react_1.default.createElement(time_picker_input_1.TimePickerInput, { label: "Default time picker with default value", name: "withDefaultValue",
|
|
18
|
+
react_1.default.createElement(time_picker_input_1.TimePickerInput, { control: control, isClearable: true, label: "Default time picker", name: "default", placeholder: "" }),
|
|
19
|
+
react_1.default.createElement(time_picker_input_1.TimePickerInput, { control: control, isClearable: true, label: "Default time picker with default value", name: "withDefaultValue", placeholder: "" }),
|
|
20
20
|
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
21
21
|
return (react_1.default.createElement(storybook_form_1.StorybookForm, { defaultValues: {
|
|
22
22
|
withDefaultValue: (0, dayjs_1.default)().format("HH:mm:ss"),
|
package/toggle/toggle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ToggleProps as UIToggleProps } from "@uxf/ui/toggle";
|
|
3
2
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { FormControlProps } from "@uxf/ui/types";
|
|
5
5
|
type OnChangeHandler = FormControlProps<boolean | undefined>["onChange"];
|
|
6
6
|
export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UIToggleProps, "isInvalid" | "name" | "onChange" | "value"> & {
|
|
@@ -8,7 +8,7 @@ export type ComboProps<FormData extends FieldValues> = UseControllerProps<FormDa
|
|
|
8
8
|
onChange?: OnChangeHandler;
|
|
9
9
|
requiredMessage?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare function Toggle<FormData extends Record<string, any>>(props: ComboProps<FormData>): JSX.Element;
|
|
11
|
+
export declare function Toggle<FormData extends Record<string, any>>(props: ComboProps<FormData>): React.JSX.Element;
|
|
12
12
|
export declare namespace Toggle {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Toggle } from "./toggle";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: typeof Toggle;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare function Default(): JSX.Element;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|