@uxf/form 11.74.0 → 11.74.2
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/_code-generator/form-code-generator.d.ts +16 -0
- package/_code-generator/form-code-generator.js +69 -0
- package/avatar-file-input/avatar-file-input.d.ts +14 -0
- package/avatar-file-input/avatar-file-input.js +42 -0
- package/avatar-file-input/avatar-file-input.stories.d.ts +8 -0
- package/avatar-file-input/avatar-file-input.stories.js +23 -0
- package/avatar-file-input/index.d.ts +1 -0
- package/avatar-file-input/index.js +17 -0
- package/avatar-file-input/translations.d.ts +13 -0
- package/avatar-file-input/translations.js +14 -0
- package/bin/form-code-generator.d.ts +2 -0
- package/bin/form-code-generator.js +55 -0
- package/checkbox-button/checkbox-button.d.ts +14 -0
- package/checkbox-button/checkbox-button.js +42 -0
- package/checkbox-button/checkbox-button.stories.d.ts +8 -0
- package/checkbox-button/checkbox-button.stories.js +24 -0
- package/checkbox-button/index.d.ts +1 -0
- package/checkbox-button/index.js +17 -0
- package/checkbox-button/translations.d.ts +13 -0
- package/checkbox-button/translations.js +14 -0
- package/checkbox-input/checkbox-input.d.ts +14 -0
- package/checkbox-input/checkbox-input.js +42 -0
- package/checkbox-input/checkbox-input.stories.d.ts +8 -0
- package/checkbox-input/checkbox-input.stories.js +24 -0
- package/checkbox-input/index.d.ts +1 -0
- package/checkbox-input/index.js +17 -0
- package/checkbox-input/translations.d.ts +13 -0
- package/checkbox-input/translations.js +14 -0
- package/checkbox-list/checkbox-list.d.ts +19 -0
- package/checkbox-list/checkbox-list.js +40 -0
- package/checkbox-list/checkbox-list.stories.d.ts +2 -0
- package/checkbox-list/checkbox-list.stories.js +22 -0
- package/checkbox-list/index.d.ts +1 -0
- package/checkbox-list/index.js +17 -0
- package/checkbox-list/translations.d.ts +13 -0
- package/checkbox-list/translations.js +14 -0
- package/color-radio-group/color-radio-group.d.ts +13 -0
- package/color-radio-group/color-radio-group.js +42 -0
- package/color-radio-group/color-radio-group.stories.d.ts +8 -0
- package/color-radio-group/color-radio-group.stories.js +62 -0
- package/color-radio-group/index.d.ts +1 -0
- package/color-radio-group/index.js +17 -0
- package/color-radio-group/translations.d.ts +13 -0
- package/color-radio-group/translations.js +14 -0
- package/combobox/combobox.d.ts +13 -0
- package/combobox/combobox.js +48 -0
- package/combobox/combobox.stories.d.ts +8 -0
- package/combobox/combobox.stories.js +30 -0
- package/combobox/index.d.ts +1 -0
- package/combobox/index.js +17 -0
- package/combobox/translations.d.ts +13 -0
- package/combobox/translations.js +14 -0
- package/components.d.ts +127 -0
- package/components.js +154 -0
- package/date-picker-input/date-picker-input.d.ts +15 -0
- package/date-picker-input/date-picker-input.js +102 -0
- package/date-picker-input/date-picker-input.stories.d.ts +8 -0
- package/date-picker-input/date-picker-input.stories.js +31 -0
- package/date-picker-input/index.d.ts +1 -0
- package/date-picker-input/index.js +17 -0
- package/date-picker-input/translations.d.ts +31 -0
- package/date-picker-input/translations.js +32 -0
- package/date-range-picker-input/date-range-picker-input.d.ts +12 -0
- package/date-range-picker-input/date-range-picker-input.js +115 -0
- package/date-range-picker-input/date-range-picker-input.stories.d.ts +8 -0
- package/date-range-picker-input/date-range-picker-input.stories.js +25 -0
- package/date-range-picker-input/index.d.ts +1 -0
- package/date-range-picker-input/index.js +17 -0
- package/date-range-picker-input/translations.d.ts +25 -0
- package/date-range-picker-input/translations.js +26 -0
- package/datetime-picker-input/datetime-picker-input.d.ts +15 -0
- package/datetime-picker-input/datetime-picker-input.js +103 -0
- package/datetime-picker-input/datetime-picker-input.stories.d.ts +2 -0
- package/datetime-picker-input/datetime-picker-input.stories.js +28 -0
- package/datetime-picker-input/index.d.ts +1 -0
- package/datetime-picker-input/index.js +17 -0
- package/datetime-picker-input/translations.d.ts +31 -0
- package/datetime-picker-input/translations.js +32 -0
- package/dropzone/dropzone-input.d.ts +13 -0
- package/dropzone/dropzone-input.js +67 -0
- package/dropzone/dropzone-list.d.ts +11 -0
- package/dropzone/dropzone-list.js +23 -0
- package/dropzone/dropzone.stories.d.ts +2 -0
- package/dropzone/dropzone.stories.js +50 -0
- package/dropzone/index.d.ts +9 -0
- package/dropzone/index.js +6 -0
- package/dropzone/translations.d.ts +31 -0
- package/dropzone/translations.js +32 -0
- package/file-input/file-input.d.ts +14 -0
- package/file-input/file-input.js +42 -0
- package/file-input/file-input.stories.d.ts +8 -0
- package/file-input/file-input.stories.js +31 -0
- package/file-input/index.d.ts +1 -0
- package/file-input/index.js +17 -0
- package/file-input/translations.d.ts +13 -0
- package/file-input/translations.js +14 -0
- package/form/form.d.ts +19 -0
- package/form/form.js +25 -0
- package/form/form.stories.d.ts +8 -0
- package/form/form.stories.js +24 -0
- package/form/index.d.ts +1 -0
- package/form/index.js +17 -0
- package/form-id-context/form-context.d.ts +7 -0
- package/form-id-context/form-context.js +12 -0
- package/form-id-context/form-id-context.d.ts +2 -0
- package/form-id-context/form-id-context.js +7 -0
- package/form-id-context/index.d.ts +1 -0
- package/form-id-context/index.js +17 -0
- package/form-renderer/big-test-schema.d.ts +33 -0
- package/form-renderer/big-test-schema.js +295 -0
- package/form-renderer/field/base-field.d.ts +4 -0
- package/form-renderer/field/base-field.js +72 -0
- package/form-renderer/field/embedded.d.ts +4 -0
- package/form-renderer/field/embedded.js +19 -0
- package/form-renderer/field/one-to-many.d.ts +4 -0
- package/form-renderer/field/one-to-many.js +52 -0
- package/form-renderer/form-renderer.d.ts +16 -0
- package/form-renderer/form-renderer.js +28 -0
- package/form-renderer/form-renderer.stories.d.ts +2 -0
- package/form-renderer/form-renderer.stories.js +23 -0
- package/form-renderer/index.d.ts +2 -0
- package/form-renderer/index.js +18 -0
- package/form-renderer/mapper.d.ts +2 -0
- package/form-renderer/mapper.js +30 -0
- package/form-renderer/translations.d.ts +33 -0
- package/form-renderer/translations.js +34 -0
- package/form-renderer/types.d.ts +39 -0
- package/form-renderer/types.js +2 -0
- package/gps-input/gps-input.d.ts +20 -0
- package/gps-input/gps-input.js +156 -0
- package/gps-input/gps-input.stories.d.ts +8 -0
- package/gps-input/gps-input.stories.js +22 -0
- package/gps-input/index.d.ts +1 -0
- package/gps-input/index.js +17 -0
- package/gps-input/translations.d.ts +31 -0
- package/gps-input/translations.js +32 -0
- package/money-input/index.d.ts +1 -0
- package/money-input/index.js +17 -0
- package/money-input/money-input.d.ts +24 -0
- package/money-input/money-input.js +112 -0
- package/money-input/money-input.stories.d.ts +2 -0
- package/money-input/money-input.stories.js +15 -0
- package/money-input/translations.d.ts +13 -0
- package/money-input/translations.js +14 -0
- package/multi-combobox/index.d.ts +1 -0
- package/multi-combobox/index.js +17 -0
- package/multi-combobox/multi-combobox.d.ts +13 -0
- package/multi-combobox/multi-combobox.js +48 -0
- package/multi-combobox/multi-combobox.stories.d.ts +8 -0
- package/multi-combobox/multi-combobox.stories.js +54 -0
- package/multi-combobox/translations.d.ts +13 -0
- package/multi-combobox/translations.js +14 -0
- package/multi-select/index.d.ts +1 -0
- package/multi-select/index.js +17 -0
- package/multi-select/multi-select.d.ts +13 -0
- package/multi-select/multi-select.js +43 -0
- package/multi-select/multi-select.stories.d.ts +8 -0
- package/multi-select/multi-select.stories.js +47 -0
- package/multi-select/translations.d.ts +13 -0
- package/multi-select/translations.js +14 -0
- package/number-input/index.d.ts +1 -0
- package/number-input/index.js +17 -0
- package/number-input/number-input.d.ts +17 -0
- package/number-input/number-input.js +87 -0
- package/number-input/number-input.stories.d.ts +8 -0
- package/number-input/number-input.stories.js +24 -0
- package/number-input/translations.d.ts +25 -0
- package/number-input/translations.js +26 -0
- package/package.json +3 -3
- package/password-input/index.d.ts +1 -0
- package/password-input/index.js +17 -0
- package/password-input/password-input.d.ts +15 -0
- package/password-input/password-input.js +108 -0
- package/password-input/password-input.stories.d.ts +8 -0
- package/password-input/password-input.stories.js +23 -0
- package/password-input/translations.d.ts +19 -0
- package/password-input/translations.js +20 -0
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.js +17 -0
- package/radio-group/radio-group.d.ts +13 -0
- package/radio-group/radio-group.js +42 -0
- package/radio-group/radio-group.stories.d.ts +8 -0
- package/radio-group/radio-group.stories.js +38 -0
- package/radio-group/translations.d.ts +13 -0
- package/radio-group/translations.js +14 -0
- package/readmes.d.ts +28 -0
- package/readmes.js +59 -0
- package/select/index.d.ts +1 -0
- package/select/index.js +17 -0
- package/select/select.d.ts +13 -0
- package/select/select.js +41 -0
- package/select/select.stories.d.ts +8 -0
- package/select/select.stories.js +44 -0
- package/select/translations.d.ts +13 -0
- package/select/translations.js +14 -0
- package/storybook/form-data-printer.d.ts +6 -0
- package/storybook/form-data-printer.js +12 -0
- package/storybook/storybook-form.d.ts +8 -0
- package/storybook/storybook-form.js +42 -0
- package/text-input/index.d.ts +1 -0
- package/text-input/index.js +17 -0
- package/text-input/text-input.d.ts +33 -0
- package/text-input/text-input.js +75 -0
- package/text-input/text-input.stories.d.ts +8 -0
- package/text-input/text-input.stories.js +26 -0
- package/text-input/translations.d.ts +31 -0
- package/text-input/translations.js +32 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/index.js +17 -0
- package/textarea/textarea.d.ts +13 -0
- package/textarea/textarea.js +62 -0
- package/textarea/textarea.stories.d.ts +8 -0
- package/textarea/textarea.stories.js +22 -0
- package/textarea/translations.d.ts +13 -0
- package/textarea/translations.js +14 -0
- package/time-picker-input/index.d.ts +1 -0
- package/time-picker-input/index.js +17 -0
- package/time-picker-input/time-picker-input.d.ts +14 -0
- package/time-picker-input/time-picker-input.js +84 -0
- package/time-picker-input/time-picker-input.stories.d.ts +8 -0
- package/time-picker-input/time-picker-input.stories.js +25 -0
- package/time-picker-input/translations.d.ts +19 -0
- package/time-picker-input/translations.js +20 -0
- package/toggle/index.d.ts +1 -0
- package/toggle/index.js +17 -0
- package/toggle/toggle.d.ts +14 -0
- package/toggle/toggle.js +40 -0
- package/toggle/toggle.stories.d.ts +8 -0
- package/toggle/toggle.stories.js +23 -0
- package/toggle/translations.d.ts +13 -0
- package/toggle/translations.js +14 -0
- package/translations/cs.json +148 -0
- package/translations/de.json +148 -0
- package/translations/en.json +148 -0
- package/translations/sk.json +148 -0
- package/types.d.ts +4 -0
- package/types.js +2 -0
package/components.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.components = void 0;
|
|
27
|
+
// generated file
|
|
28
|
+
const avatarFileInputStories = __importStar(require("./avatar-file-input/avatar-file-input.stories"));
|
|
29
|
+
const checkboxButtonStories = __importStar(require("./checkbox-button/checkbox-button.stories"));
|
|
30
|
+
const checkboxInputStories = __importStar(require("./checkbox-input/checkbox-input.stories"));
|
|
31
|
+
const checkboxListStories = __importStar(require("./checkbox-list/checkbox-list.stories"));
|
|
32
|
+
const colorRadioGroupStories = __importStar(require("./color-radio-group/color-radio-group.stories"));
|
|
33
|
+
const comboboxStories = __importStar(require("./combobox/combobox.stories"));
|
|
34
|
+
const datePickerInputStories = __importStar(require("./date-picker-input/date-picker-input.stories"));
|
|
35
|
+
const dateRangePickerInputStories = __importStar(require("./date-range-picker-input/date-range-picker-input.stories"));
|
|
36
|
+
const datetimePickerInputStories = __importStar(require("./datetime-picker-input/datetime-picker-input.stories"));
|
|
37
|
+
const dropzoneStories = __importStar(require("./dropzone/dropzone.stories"));
|
|
38
|
+
const fileInputStories = __importStar(require("./file-input/file-input.stories"));
|
|
39
|
+
const formStories = __importStar(require("./form/form.stories"));
|
|
40
|
+
const formRendererStories = __importStar(require("./form-renderer/form-renderer.stories"));
|
|
41
|
+
const gpsInputStories = __importStar(require("./gps-input/gps-input.stories"));
|
|
42
|
+
const moneyInputStories = __importStar(require("./money-input/money-input.stories"));
|
|
43
|
+
const multiComboboxStories = __importStar(require("./multi-combobox/multi-combobox.stories"));
|
|
44
|
+
const multiSelectStories = __importStar(require("./multi-select/multi-select.stories"));
|
|
45
|
+
const numberInputStories = __importStar(require("./number-input/number-input.stories"));
|
|
46
|
+
const passwordInputStories = __importStar(require("./password-input/password-input.stories"));
|
|
47
|
+
const radioGroupStories = __importStar(require("./radio-group/radio-group.stories"));
|
|
48
|
+
const selectStories = __importStar(require("./select/select.stories"));
|
|
49
|
+
const textInputStories = __importStar(require("./text-input/text-input.stories"));
|
|
50
|
+
const textareaStories = __importStar(require("./textarea/textarea.stories"));
|
|
51
|
+
const timePickerInputStories = __importStar(require("./time-picker-input/time-picker-input.stories"));
|
|
52
|
+
const toggleStories = __importStar(require("./toggle/toggle.stories"));
|
|
53
|
+
exports.components = {
|
|
54
|
+
"avatar-file-input": {
|
|
55
|
+
title: "AvatarFileInput",
|
|
56
|
+
stories: avatarFileInputStories
|
|
57
|
+
},
|
|
58
|
+
"checkbox-button": {
|
|
59
|
+
title: "CheckboxButton",
|
|
60
|
+
stories: checkboxButtonStories
|
|
61
|
+
},
|
|
62
|
+
"checkbox-input": {
|
|
63
|
+
title: "CheckboxInput",
|
|
64
|
+
stories: checkboxInputStories
|
|
65
|
+
},
|
|
66
|
+
"checkbox-list": {
|
|
67
|
+
title: "CheckboxList",
|
|
68
|
+
stories: checkboxListStories
|
|
69
|
+
},
|
|
70
|
+
"color-radio-group": {
|
|
71
|
+
title: "ColorRadioGroup",
|
|
72
|
+
stories: colorRadioGroupStories
|
|
73
|
+
},
|
|
74
|
+
"combobox": {
|
|
75
|
+
title: "Combobox",
|
|
76
|
+
stories: comboboxStories
|
|
77
|
+
},
|
|
78
|
+
"date-picker-input": {
|
|
79
|
+
title: "DatePickerInput",
|
|
80
|
+
stories: datePickerInputStories
|
|
81
|
+
},
|
|
82
|
+
"date-range-picker-input": {
|
|
83
|
+
title: "DateRangePickerInput",
|
|
84
|
+
stories: dateRangePickerInputStories
|
|
85
|
+
},
|
|
86
|
+
"datetime-picker-input": {
|
|
87
|
+
title: "DatetimePickerInput",
|
|
88
|
+
stories: datetimePickerInputStories
|
|
89
|
+
},
|
|
90
|
+
"dropzone": {
|
|
91
|
+
title: "Dropzone",
|
|
92
|
+
stories: dropzoneStories
|
|
93
|
+
},
|
|
94
|
+
"file-input": {
|
|
95
|
+
title: "FileInput",
|
|
96
|
+
stories: fileInputStories
|
|
97
|
+
},
|
|
98
|
+
"form": {
|
|
99
|
+
title: "Form",
|
|
100
|
+
stories: formStories
|
|
101
|
+
},
|
|
102
|
+
"form-renderer": {
|
|
103
|
+
title: "FormRenderer",
|
|
104
|
+
stories: formRendererStories
|
|
105
|
+
},
|
|
106
|
+
"gps-input": {
|
|
107
|
+
title: "GpsInput",
|
|
108
|
+
stories: gpsInputStories
|
|
109
|
+
},
|
|
110
|
+
"money-input": {
|
|
111
|
+
title: "MoneyInput",
|
|
112
|
+
stories: moneyInputStories
|
|
113
|
+
},
|
|
114
|
+
"multi-combobox": {
|
|
115
|
+
title: "MultiCombobox",
|
|
116
|
+
stories: multiComboboxStories
|
|
117
|
+
},
|
|
118
|
+
"multi-select": {
|
|
119
|
+
title: "MultiSelect",
|
|
120
|
+
stories: multiSelectStories
|
|
121
|
+
},
|
|
122
|
+
"number-input": {
|
|
123
|
+
title: "NumberInput",
|
|
124
|
+
stories: numberInputStories
|
|
125
|
+
},
|
|
126
|
+
"password-input": {
|
|
127
|
+
title: "PasswordInput",
|
|
128
|
+
stories: passwordInputStories
|
|
129
|
+
},
|
|
130
|
+
"radio-group": {
|
|
131
|
+
title: "RadioGroup",
|
|
132
|
+
stories: radioGroupStories
|
|
133
|
+
},
|
|
134
|
+
"select": {
|
|
135
|
+
title: "Select",
|
|
136
|
+
stories: selectStories
|
|
137
|
+
},
|
|
138
|
+
"text-input": {
|
|
139
|
+
title: "TextInput",
|
|
140
|
+
stories: textInputStories
|
|
141
|
+
},
|
|
142
|
+
"textarea": {
|
|
143
|
+
title: "Textarea",
|
|
144
|
+
stories: textareaStories
|
|
145
|
+
},
|
|
146
|
+
"time-picker-input": {
|
|
147
|
+
title: "TimePickerInput",
|
|
148
|
+
stories: timePickerInputStories
|
|
149
|
+
},
|
|
150
|
+
"toggle": {
|
|
151
|
+
title: "Toggle",
|
|
152
|
+
stories: toggleStories
|
|
153
|
+
},
|
|
154
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DatePickerInputProps as UIDatePickerInputProps } from "@uxf/ui/date-picker-input";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FieldValues } from "react-hook-form";
|
|
4
|
+
import { ControlProps } from "../types";
|
|
5
|
+
export type DatePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDatePickerInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value"> & {
|
|
6
|
+
onChange?: UIDatePickerInputProps["onChange"];
|
|
7
|
+
requiredMessage?: string;
|
|
8
|
+
minDate?: string;
|
|
9
|
+
maxDate?: string;
|
|
10
|
+
};
|
|
11
|
+
export type DatePickerInputValue = string | null;
|
|
12
|
+
export declare function DatePickerInput<FormData extends FieldValues>(props: DatePickerInputProps<FormData>): React.JSX.Element;
|
|
13
|
+
export declare namespace DatePickerInput {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.DatePickerInput = DatePickerInput;
|
|
31
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
32
|
+
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
33
|
+
const date_picker_input_1 = require("@uxf/ui/date-picker-input");
|
|
34
|
+
const dayjs_1 = __importStar(require("dayjs"));
|
|
35
|
+
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
36
|
+
const react_1 = __importDefault(require("react"));
|
|
37
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
38
|
+
const form_context_1 = require("../form-id-context/form-context");
|
|
39
|
+
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
40
|
+
function DatePickerInput(props) {
|
|
41
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42
|
+
const formContext = (0, form_context_1.useFormContext)();
|
|
43
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
44
|
+
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
45
|
+
const displayDateFormat = (_b = props.displayDateFormat) !== null && _b !== void 0 ? _b : date_picker_input_1.DISPLAY_DATE_FORMAT;
|
|
46
|
+
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
47
|
+
control: props.control,
|
|
48
|
+
name: props.name,
|
|
49
|
+
rules: {
|
|
50
|
+
required: props.isRequired
|
|
51
|
+
? props.requiredMessage || t("uxf-form-date-picker-input:validation.required")
|
|
52
|
+
: undefined,
|
|
53
|
+
...props.rules,
|
|
54
|
+
validate: {
|
|
55
|
+
validDate: (value) => {
|
|
56
|
+
if (!value) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!(0, dayjs_1.default)(value, date_picker_input_1.OUTPUT_DATE_FORMAT, true).isValid()) {
|
|
60
|
+
return t("uxf-form-date-picker-input:validation.invalid-date-format", {
|
|
61
|
+
format: displayDateFormat,
|
|
62
|
+
value: value,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
validDateRange: (value) => {
|
|
67
|
+
if (!value) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (props.minDate && (0, dayjs_1.default)(value, date_picker_input_1.OUTPUT_DATE_FORMAT, true).isBefore(props.minDate)) {
|
|
71
|
+
return t("uxf-form-date-picker-input:validation.min-date", {
|
|
72
|
+
minDate: (0, dayjs_1.default)(props.minDate).format(displayDateFormat),
|
|
73
|
+
value: value,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (props.maxDate && (0, dayjs_1.default)(value, date_picker_input_1.OUTPUT_DATE_FORMAT, true).isAfter(props.maxDate)) {
|
|
77
|
+
return t("uxf-form-date-picker-input:validation.max-date", {
|
|
78
|
+
maxDate: (0, dayjs_1.default)(props.maxDate).format(displayDateFormat),
|
|
79
|
+
value: value,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
...(typeof ((_c = props.rules) === null || _c === void 0 ? void 0 : _c.validate) === "function"
|
|
84
|
+
? { custom: props.rules.validate }
|
|
85
|
+
: (_d = props.rules) === null || _d === void 0 ? void 0 : _d.validate),
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
shouldUnregister: props.shouldUnregister,
|
|
89
|
+
});
|
|
90
|
+
const onBlur = (event) => {
|
|
91
|
+
var _a;
|
|
92
|
+
field.onBlur();
|
|
93
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
94
|
+
};
|
|
95
|
+
const onChange = (value, event) => {
|
|
96
|
+
var _a;
|
|
97
|
+
field.onChange(value);
|
|
98
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
99
|
+
};
|
|
100
|
+
return (react_1.default.createElement(date_picker_input_1.DatePickerInput, { allowedDateFormats: props.allowedDateFormats, autoFocus: props.autoFocus, bottomContent: props.bottomContent, className: props.className, datesConfig: props.datesConfig, displayDateFormat: props.displayDateFormat, form: props.form, helperText: (_f = (_e = fieldState.error) === null || _e === void 0 ? void 0 : _e.message) !== null && _f !== void 0 ? _f : props.helperText, hiddenLabel: props.hiddenLabel, id: id, isClearable: props.isClearable, isDisabled: formContext.isFormDisabled || props.isDisabled, isInvalid: (0, is_not_nil_1.isNotNil)(fieldState.error), isReadOnly: formContext.isFormReadOnly || props.isReadOnly, isRequired: props.isRequired, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, maxDate: props.maxDate, minDate: props.minDate, 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, style: props.style, triggerElement: props.triggerElement, unavailableDates: props.unavailableDates, value: field.value, variant: props.variant }));
|
|
101
|
+
}
|
|
102
|
+
DatePickerInput.displayName = "UxfFormDatePickerInput";
|
|
@@ -0,0 +1,31 @@
|
|
|
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 = Default;
|
|
7
|
+
const button_1 = require("@uxf/ui/button");
|
|
8
|
+
const date_picker_input_1 = require("@uxf/ui/date-picker-input");
|
|
9
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
11
|
+
const storybook_form_1 = require("../storybook/storybook-form");
|
|
12
|
+
const date_picker_input_2 = require("./date-picker-input");
|
|
13
|
+
exports.default = {
|
|
14
|
+
title: "Form/DatePickerInput",
|
|
15
|
+
component: date_picker_input_2.DatePickerInput,
|
|
16
|
+
};
|
|
17
|
+
function Default() {
|
|
18
|
+
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
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, label: "Date picker with input min/max validation - only next 7 days", maxDate: (0, dayjs_1.default)().add(6, "days").format(date_picker_input_1.OUTPUT_DATE_FORMAT), minDate: (0, dayjs_1.default)().format(date_picker_input_1.OUTPUT_DATE_FORMAT), 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,
|
|
24
|
+
"Bottom content",
|
|
25
|
+
react_1.default.createElement("p", null, "Here can goes anything")), control: control, isClearable: true, isRequired: true, label: "With bottom content", name: "default" }),
|
|
26
|
+
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
27
|
+
return (react_1.default.createElement(storybook_form_1.StorybookForm, { defaultValues: {
|
|
28
|
+
withDefaultValue: (0, dayjs_1.default)("2023-10-20T14:32:10.511").format("YYYY-MM-DD"),
|
|
29
|
+
} }, ({ control }) => (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
30
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, storyFormDatePickers(control))))));
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./date-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("./date-picker-input"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-form-date-picker-input": {
|
|
3
|
+
validation: {
|
|
4
|
+
required: {
|
|
5
|
+
cs: string;
|
|
6
|
+
en: string;
|
|
7
|
+
sk: string;
|
|
8
|
+
de: string;
|
|
9
|
+
};
|
|
10
|
+
"invalid-date-format": {
|
|
11
|
+
cs: string;
|
|
12
|
+
en: string;
|
|
13
|
+
sk: string;
|
|
14
|
+
de: string;
|
|
15
|
+
};
|
|
16
|
+
"min-date": {
|
|
17
|
+
cs: string;
|
|
18
|
+
en: string;
|
|
19
|
+
sk: string;
|
|
20
|
+
de: string;
|
|
21
|
+
};
|
|
22
|
+
"max-date": {
|
|
23
|
+
cs: string;
|
|
24
|
+
en: string;
|
|
25
|
+
sk: string;
|
|
26
|
+
de: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-date-picker-input": {
|
|
5
|
+
validation: {
|
|
6
|
+
required: {
|
|
7
|
+
cs: "Toto pole je povinné",
|
|
8
|
+
en: "This field is required",
|
|
9
|
+
sk: "Toto pole je povinné",
|
|
10
|
+
de: "Dieses Feld ist erforderlich",
|
|
11
|
+
},
|
|
12
|
+
"invalid-date-format": {
|
|
13
|
+
cs: "Datum musí být ve formátu {{format}}.",
|
|
14
|
+
en: "Date must be in format {{format}}.",
|
|
15
|
+
sk: "Dátum musí byť vo formáte {{format}}.",
|
|
16
|
+
de: "Datum muss im Format {{format}} sein.",
|
|
17
|
+
},
|
|
18
|
+
"min-date": {
|
|
19
|
+
cs: "Minimální datum, který je možné zadat, je: {{minDate}}",
|
|
20
|
+
en: "The minimum date that can be entered is: {{minDate}}",
|
|
21
|
+
sk: "Minimálny dátum, ktorý je možné zadať, je: {{minDate}}",
|
|
22
|
+
de: "Das minimale Datum, das eingegeben werden kann, ist: {{minDate}}",
|
|
23
|
+
},
|
|
24
|
+
"max-date": {
|
|
25
|
+
cs: "Maximální datum, který je možné zadat, je: {{maxDate}}",
|
|
26
|
+
en: "The maximum date that can be entered is: {{maxDate}}",
|
|
27
|
+
sk: "Maximálny dátum, ktorý je možné zadať, je: {{maxDate}}",
|
|
28
|
+
de: "Das maximale Datum, das eingegeben werden kann, ist: {{maxDate}}",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DateRangePickerInputProps as UIDateRangePickerInputProps } from "@uxf/ui/date-range-picker-input";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FieldValues } from "react-hook-form";
|
|
4
|
+
import { ControlProps } from "../types";
|
|
5
|
+
export type DateRangePickerInputProps<FormData extends FieldValues> = ControlProps<FormData> & Omit<UIDateRangePickerInputProps, "isFocused" | "isInvalid" | "max" | "min" | "name" | "onChange" | "pattern" | "step" | "value"> & {
|
|
6
|
+
onChange?: UIDateRangePickerInputProps["onChange"];
|
|
7
|
+
requiredMessage?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function DateRangePickerInput<FormData extends FieldValues>(props: DateRangePickerInputProps<FormData>): React.JSX.Element;
|
|
10
|
+
export declare namespace DateRangePickerInput {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.DateRangePickerInput = DateRangePickerInput;
|
|
31
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
32
|
+
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
33
|
+
const date_range_picker_input_1 = require("@uxf/ui/date-range-picker-input");
|
|
34
|
+
const date_range_picker_input_2 = require("@uxf/ui/date-range-picker-input/date-range-picker-input");
|
|
35
|
+
const dayjs_1 = __importStar(require("dayjs"));
|
|
36
|
+
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
37
|
+
const react_1 = __importDefault(require("react"));
|
|
38
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
39
|
+
const form_context_1 = require("../form-id-context/form-context");
|
|
40
|
+
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
41
|
+
const OUTPUT_DATE_FORMAT = "YYYY-MM-DD";
|
|
42
|
+
function DateRangePickerInput(props) {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
const formContext = (0, form_context_1.useFormContext)();
|
|
45
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
46
|
+
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
47
|
+
control: props.control,
|
|
48
|
+
name: props.name,
|
|
49
|
+
rules: {
|
|
50
|
+
required: props.isRequired
|
|
51
|
+
? props.requiredMessage || t("uxf-form-date-range-picker-input:validation.required")
|
|
52
|
+
: undefined,
|
|
53
|
+
...props.rules,
|
|
54
|
+
validate: {
|
|
55
|
+
validDate: (value) => {
|
|
56
|
+
if (!value) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const { from, to } = (0, date_range_picker_input_2.splitValueToRange)(value);
|
|
60
|
+
const fromIsValid = (0, dayjs_1.default)(from, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true).isValid();
|
|
61
|
+
const toIsValid = (0, dayjs_1.default)(to, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true).isValid();
|
|
62
|
+
if (!fromIsValid || !toIsValid) {
|
|
63
|
+
return t("uxf-form-date-range-picker-input:validation.invalid-date-range-format", {
|
|
64
|
+
format: "D. M. YYYY. - D. M. YYYY.",
|
|
65
|
+
value: value,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if ((0, dayjs_1.default)(from).isAfter((0, dayjs_1.default)(to), "day")) {
|
|
69
|
+
return t("uxf-form-date-range-picker-input:validation.invalid-date-range-order", {
|
|
70
|
+
value: value,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
...(typeof ((_a = props.rules) === null || _a === void 0 ? void 0 : _a.validate) === "function"
|
|
75
|
+
? { custom: props.rules.validate }
|
|
76
|
+
: (_b = props.rules) === null || _b === void 0 ? void 0 : _b.validate),
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
shouldUnregister: props.shouldUnregister,
|
|
80
|
+
});
|
|
81
|
+
const onBlur = (event) => {
|
|
82
|
+
var _a;
|
|
83
|
+
field.onBlur();
|
|
84
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
85
|
+
};
|
|
86
|
+
const onChange = (value, event) => {
|
|
87
|
+
var _a;
|
|
88
|
+
if (value) {
|
|
89
|
+
const { from, to } = (0, date_range_picker_input_2.splitValueToRange)(value);
|
|
90
|
+
const fromIsValid = (0, dayjs_1.default)(from, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true).isValid();
|
|
91
|
+
const toIsValid = (0, dayjs_1.default)(to, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true).isValid();
|
|
92
|
+
if (fromIsValid || toIsValid) {
|
|
93
|
+
field.onChange((fromIsValid ? (0, dayjs_1.default)(from, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true).format(OUTPUT_DATE_FORMAT) : from) +
|
|
94
|
+
date_range_picker_input_2.SEPARATOR +
|
|
95
|
+
(toIsValid ? (0, dayjs_1.default)(to, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true).format(OUTPUT_DATE_FORMAT) : to));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
field.onChange(value);
|
|
100
|
+
}
|
|
101
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value, event);
|
|
102
|
+
};
|
|
103
|
+
const { from: fieldFrom, to: fieldTo } = (0, date_range_picker_input_2.splitValueToRange)(field.value);
|
|
104
|
+
const parsedFrom = (0, dayjs_1.default)(fieldFrom, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true);
|
|
105
|
+
const parsedTo = (0, dayjs_1.default)(fieldTo, date_range_picker_input_2.ALLOWED_DATE_FORMAT, true);
|
|
106
|
+
const value = field.value
|
|
107
|
+
? parsedFrom.isValid() || parsedTo.isValid()
|
|
108
|
+
? (parsedFrom.isValid() ? parsedFrom.format(date_range_picker_input_2.DISPLAY_DATE_FORMAT) : fieldFrom) +
|
|
109
|
+
date_range_picker_input_2.SEPARATOR +
|
|
110
|
+
(parsedTo.isValid() ? parsedTo.format(date_range_picker_input_2.DISPLAY_DATE_FORMAT) : fieldTo)
|
|
111
|
+
: field.value
|
|
112
|
+
: null;
|
|
113
|
+
return (react_1.default.createElement(date_range_picker_input_1.DateRangePickerInput, { autoFocus: props.autoFocus, bottomContent: props.bottomContent, className: props.className, datesConfig: props.datesConfig, 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: props.id, isClearable: props.isClearable, isDisabled: formContext.isFormDisabled || props.isDisabled, isInvalid: (0, is_not_nil_1.isNotNil)(fieldState.error), isReadOnly: formContext.isFormReadOnly || props.isReadOnly, isRequired: props.isRequired, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: field.name, numberOfMonths: props.numberOfMonths, 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, style: props.style, triggerElement: props.triggerElement, unavailableDates: props.unavailableDates, value: value, variant: props.variant }));
|
|
114
|
+
}
|
|
115
|
+
DateRangePickerInput.displayName = "UxfFormDateRangePickerInput";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DateRangePickerInput } from "./date-range-picker-input";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof DateRangePickerInput;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 = Default;
|
|
7
|
+
const button_1 = require("@uxf/ui/button");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const storybook_form_1 = require("../storybook/storybook-form");
|
|
10
|
+
const date_range_picker_input_1 = require("./date-range-picker-input");
|
|
11
|
+
exports.default = {
|
|
12
|
+
title: "Form/DateRangePickerInput",
|
|
13
|
+
component: date_range_picker_input_1.DateRangePickerInput,
|
|
14
|
+
};
|
|
15
|
+
function Default() {
|
|
16
|
+
const storyFormDatePickers = (control) => (react_1.default.createElement("div", { className: "space-y-4" },
|
|
17
|
+
react_1.default.createElement(date_range_picker_input_1.DateRangePickerInput, { control: control, isClearable: true, isRequired: true, label: "Default date range picker", name: "default" }),
|
|
18
|
+
react_1.default.createElement(date_range_picker_input_1.DateRangePickerInput, { control: control, isClearable: true, isRequired: true, label: "Date range picker with two months", name: "twomonths", numberOfMonths: 2 }),
|
|
19
|
+
react_1.default.createElement(date_range_picker_input_1.DateRangePickerInput, { bottomContent: react_1.default.createElement("div", null,
|
|
20
|
+
"Bottom content",
|
|
21
|
+
react_1.default.createElement("p", null, "Here can goes anything")), control: control, isClearable: true, isRequired: true, label: "With bottom content", name: "default" }),
|
|
22
|
+
react_1.default.createElement(button_1.Button, { type: "submit" }, "Submit")));
|
|
23
|
+
return (react_1.default.createElement(storybook_form_1.StorybookForm, null, ({ control }) => (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
24
|
+
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, storyFormDatePickers(control))))));
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./date-range-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("./date-range-picker-input"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-form-date-range-picker-input": {
|
|
3
|
+
validation: {
|
|
4
|
+
required: {
|
|
5
|
+
cs: string;
|
|
6
|
+
en: string;
|
|
7
|
+
sk: string;
|
|
8
|
+
de: string;
|
|
9
|
+
};
|
|
10
|
+
"invalid-date-range-format": {
|
|
11
|
+
cs: string;
|
|
12
|
+
en: string;
|
|
13
|
+
sk: string;
|
|
14
|
+
de: string;
|
|
15
|
+
};
|
|
16
|
+
"invalid-date-range-order": {
|
|
17
|
+
cs: string;
|
|
18
|
+
en: string;
|
|
19
|
+
sk: string;
|
|
20
|
+
de: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-date-range-picker-input": {
|
|
5
|
+
validation: {
|
|
6
|
+
required: {
|
|
7
|
+
cs: "Toto pole je povinné",
|
|
8
|
+
en: "This field is required",
|
|
9
|
+
sk: "Toto pole je povinné",
|
|
10
|
+
de: "Dieses Feld ist erforderlich",
|
|
11
|
+
},
|
|
12
|
+
"invalid-date-range-format": {
|
|
13
|
+
cs: "Rozsah musí být ve formátu {{format}}",
|
|
14
|
+
en: "Range must be in format {{format}}",
|
|
15
|
+
sk: "Rozsah musí byť vo formáte {{format}}",
|
|
16
|
+
de: "Bereich muss im Format {{format}} sein",
|
|
17
|
+
},
|
|
18
|
+
"invalid-date-range-order": {
|
|
19
|
+
cs: "Koncové datum nemůže předcházet počátečnímu datu.",
|
|
20
|
+
en: "End date cannot precede start date.",
|
|
21
|
+
sk: "Koncový dátum nemôže predchádzať počiatočnému dátumu.",
|
|
22
|
+
de: "Enddatum kann nicht vor dem Startdatum liegen.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|