@uxf/form 11.72.3 → 11.74.1
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/README.md +3 -1
- package/avatar-file-input/avatar-file-input.js +5 -1
- package/avatar-file-input/translations.d.ts +13 -0
- package/avatar-file-input/translations.js +14 -0
- package/checkbox-button/checkbox-button.js +5 -1
- package/checkbox-button/translations.d.ts +13 -0
- package/checkbox-button/translations.js +14 -0
- package/checkbox-input/checkbox-input.js +5 -1
- package/checkbox-input/translations.d.ts +13 -0
- package/checkbox-input/translations.js +14 -0
- package/checkbox-list/checkbox-list.js +5 -1
- package/checkbox-list/translations.d.ts +13 -0
- package/checkbox-list/translations.js +14 -0
- package/color-radio-group/color-radio-group.js +5 -1
- package/color-radio-group/translations.d.ts +13 -0
- package/color-radio-group/translations.js +14 -0
- package/combobox/combobox.js +5 -1
- package/combobox/translations.d.ts +13 -0
- package/combobox/translations.js +14 -0
- package/date-picker-input/date-picker-input.js +17 -4
- 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.js +12 -3
- 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.js +17 -4
- package/datetime-picker-input/translations.d.ts +31 -0
- package/datetime-picker-input/translations.js +32 -0
- package/dropzone/dropzone-input.js +11 -3
- package/dropzone/translations.d.ts +31 -0
- package/dropzone/translations.js +32 -0
- package/file-input/file-input.js +5 -1
- package/file-input/translations.d.ts +13 -0
- package/file-input/translations.js +14 -0
- package/form-renderer/field/base-field.js +3 -1
- package/form-renderer/field/one-to-many.js +4 -2
- package/form-renderer/form-renderer.js +3 -1
- package/form-renderer/translations.d.ts +33 -0
- package/form-renderer/translations.js +34 -0
- package/gps-input/gps-input.js +11 -9
- package/gps-input/translations.d.ts +31 -0
- package/gps-input/translations.js +32 -0
- package/money-input/money-input.js +5 -1
- package/money-input/translations.d.ts +13 -0
- package/money-input/translations.js +14 -0
- package/multi-combobox/multi-combobox.js +5 -1
- package/multi-combobox/translations.d.ts +13 -0
- package/multi-combobox/translations.js +14 -0
- package/multi-select/multi-select.js +5 -1
- package/multi-select/translations.d.ts +13 -0
- package/multi-select/translations.js +14 -0
- package/number-input/number-input.js +27 -12
- package/number-input/translations.d.ts +25 -0
- package/number-input/translations.js +26 -0
- package/package.json +4 -2
- package/password-input/password-input.js +24 -9
- package/password-input/translations.d.ts +19 -0
- package/password-input/translations.js +20 -0
- package/radio-group/radio-group.js +5 -1
- package/radio-group/translations.d.ts +13 -0
- package/radio-group/translations.js +14 -0
- package/select/select.js +3 -1
- package/select/translations.d.ts +13 -0
- package/select/translations.js +14 -0
- package/text-input/text-input.js +37 -19
- package/text-input/translations.d.ts +31 -0
- package/text-input/translations.js +32 -0
- package/textarea/textarea.js +5 -1
- package/textarea/translations.d.ts +13 -0
- package/textarea/translations.js +14 -0
- package/time-picker-input/time-picker-input.js +9 -2
- package/time-picker-input/translations.d.ts +19 -0
- package/time-picker-input/translations.js +20 -0
- package/toggle/toggle.js +3 -1
- package/toggle/translations.d.ts +13 -0
- package/toggle/translations.js +14 -0
- package/translations/translations.d.ts +389 -0
- package/translations/translations.js +55 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-datetime-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-datetime-format": {
|
|
13
|
+
cs: "Datum a čas musí být ve formátu {{format}}.",
|
|
14
|
+
en: "Date and time must be in format {{format}}.",
|
|
15
|
+
sk: "Dátum a čas musí byť vo formáte {{format}}.",
|
|
16
|
+
de: "Datum und Uhrzeit müssen 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
|
+
};
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.DropzoneInput = DropzoneInput;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
9
10
|
const dropzone_1 = require("@uxf/ui/dropzone");
|
|
10
11
|
const react_1 = __importDefault(require("react"));
|
|
@@ -13,6 +14,7 @@ const form_context_1 = require("../form-id-context/form-context");
|
|
|
13
14
|
function DropzoneInput(props) {
|
|
14
15
|
var _a, _b, _c;
|
|
15
16
|
const formContext = (0, form_context_1.useFormContext)();
|
|
17
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
16
18
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
17
19
|
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
18
20
|
control: props.control,
|
|
@@ -26,13 +28,19 @@ function DropzoneInput(props) {
|
|
|
26
28
|
if (props.isRequired &&
|
|
27
29
|
props.minFilesCount !== 0 &&
|
|
28
30
|
(!value || value.length < ((_a = props.minFilesCount) !== null && _a !== void 0 ? _a : 1))) {
|
|
29
|
-
return props.requiredMessage || "
|
|
31
|
+
return props.requiredMessage || t("uxf-form-dropzone:validation.required");
|
|
30
32
|
}
|
|
31
33
|
if (props.maxFilesCount && value && value.length > props.maxFilesCount) {
|
|
32
|
-
return
|
|
34
|
+
return t("uxf-form-dropzone:validation.max-files-count", {
|
|
35
|
+
maxFilesCount: props.maxFilesCount,
|
|
36
|
+
value: value,
|
|
37
|
+
});
|
|
33
38
|
}
|
|
34
39
|
if (props.minFilesCount && value && value.length < props.minFilesCount) {
|
|
35
|
-
return
|
|
40
|
+
return t("uxf-form-dropzone:validation.min-files-count", {
|
|
41
|
+
minFilesCount: props.minFilesCount,
|
|
42
|
+
value: value,
|
|
43
|
+
});
|
|
36
44
|
}
|
|
37
45
|
// TODO – validate this only on submit
|
|
38
46
|
// if (value?.some((file) => file.id < 0)) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-form-dropzone": {
|
|
3
|
+
validation: {
|
|
4
|
+
required: {
|
|
5
|
+
cs: string;
|
|
6
|
+
en: string;
|
|
7
|
+
sk: string;
|
|
8
|
+
de: string;
|
|
9
|
+
};
|
|
10
|
+
"max-files-count": {
|
|
11
|
+
cs: string;
|
|
12
|
+
en: string;
|
|
13
|
+
sk: string;
|
|
14
|
+
de: string;
|
|
15
|
+
};
|
|
16
|
+
"min-files-count": {
|
|
17
|
+
cs: string;
|
|
18
|
+
en: string;
|
|
19
|
+
sk: string;
|
|
20
|
+
de: string;
|
|
21
|
+
};
|
|
22
|
+
"upload-not-completed": {
|
|
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-dropzone": {
|
|
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
|
+
"max-files-count": {
|
|
13
|
+
cs: "Maximální počet souborů je {{maxFilesCount}}",
|
|
14
|
+
en: "Maximum number of files is {{maxFilesCount}}",
|
|
15
|
+
sk: "Maximálny počet súborov je {{maxFilesCount}}",
|
|
16
|
+
de: "Maximale Anzahl der Dateien ist {{maxFilesCount}}",
|
|
17
|
+
},
|
|
18
|
+
"min-files-count": {
|
|
19
|
+
cs: "Minimální počet souborů je {{minFilesCount}}",
|
|
20
|
+
en: "Minimum number of files is {{minFilesCount}}",
|
|
21
|
+
sk: "Minimálny počet súborov je {{minFilesCount}}",
|
|
22
|
+
de: "Minimale Anzahl der Dateien ist {{minFilesCount}}",
|
|
23
|
+
},
|
|
24
|
+
"upload-not-completed": {
|
|
25
|
+
cs: "Nahrávání souborů ještě nebylo dokončeno",
|
|
26
|
+
en: "File upload has not been completed yet",
|
|
27
|
+
sk: "Nahrávanie súborov ešte nebolo dokončené",
|
|
28
|
+
de: "Datei-Upload wurde noch nicht abgeschlossen",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
package/file-input/file-input.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.FileInput = FileInput;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
9
10
|
const file_input_1 = require("@uxf/ui/file-input");
|
|
10
11
|
const react_1 = __importDefault(require("react"));
|
|
@@ -13,12 +14,15 @@ const form_context_1 = require("../form-id-context/form-context");
|
|
|
13
14
|
function FileInput(props) {
|
|
14
15
|
var _a, _b, _c;
|
|
15
16
|
const formContext = (0, form_context_1.useFormContext)();
|
|
17
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
16
18
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
17
19
|
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
18
20
|
control: props.control,
|
|
19
21
|
name: props.name,
|
|
20
22
|
rules: {
|
|
21
|
-
required: props.isRequired
|
|
23
|
+
required: props.isRequired
|
|
24
|
+
? props.requiredMessage || t("uxf-form-file-input:validation.required")
|
|
25
|
+
: undefined,
|
|
22
26
|
...props.rules,
|
|
23
27
|
},
|
|
24
28
|
shouldUnregister: props.shouldUnregister,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-file-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
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BaseField = BaseField;
|
|
7
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
7
8
|
const autocomplete_1 = require("@uxf/core/api/autocomplete");
|
|
8
9
|
const upload_file_1 = require("@uxf/core/api/upload-file");
|
|
9
10
|
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
@@ -28,6 +29,7 @@ function BaseField(props) {
|
|
|
28
29
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
29
30
|
const { editable, label, name, readOnly, type } = props.fieldSchema;
|
|
30
31
|
const fieldName = `${(_a = props.prefix) !== null && _a !== void 0 ? _a : ""}${name}`;
|
|
32
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
31
33
|
const isDisabled = readOnly || (props.isEditing && !editable);
|
|
32
34
|
const isRequired = !isDisabled && props.fieldSchema.required;
|
|
33
35
|
const autocompleteHandler = (_c = (_b = props.overrides) === null || _b === void 0 ? void 0 : _b.autocomplete) !== null && _c !== void 0 ? _c : autocomplete_1.autocomplete;
|
|
@@ -54,7 +56,7 @@ function BaseField(props) {
|
|
|
54
56
|
react_1.default.createElement(label_1.Label, { isRequired: isRequired }, label),
|
|
55
57
|
react_1.default.createElement("div", { className: "mb-3" },
|
|
56
58
|
react_1.default.createElement(dropzone_input_1.DropzoneInput, { control: props.control, isRequired: isRequired, label: label, name: fieldName, onUploadFile: uploadHandler })),
|
|
57
|
-
react_1.default.createElement(dropzone_list_1.DropzoneList, { control: props.control, errorText: "
|
|
59
|
+
react_1.default.createElement(dropzone_list_1.DropzoneList, { control: props.control, errorText: t("uxf-form-form-renderer:file-upload-error"), name: fieldName, onRemoveConfirm: (_g = props.overrides) === null || _g === void 0 ? void 0 : _g.onRemoveConfirm })));
|
|
58
60
|
case "manyToMany":
|
|
59
61
|
return (react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.control, isDisabled: isDisabled, isRequired: isRequired, label: label, loadOptions: (term) => { var _a; return autocompleteHandler((_a = props.fieldSchema.autocomplete) !== null && _a !== void 0 ? _a : "", term); }, name: fieldName }));
|
|
60
62
|
case "manyToOne":
|
|
@@ -23,11 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
26
27
|
const icon_button_1 = require("@uxf/ui/icon-button");
|
|
27
28
|
const react_1 = __importStar(require("react"));
|
|
28
29
|
const react_hook_form_1 = require("react-hook-form");
|
|
29
30
|
function Field(props) {
|
|
30
31
|
const { fields, remove, append } = (0, react_hook_form_1.useFieldArray)({ control: props.control, name: props.fieldSchema.name });
|
|
32
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
31
33
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
34
|
react_1.default.createElement("p", { className: "mb-2 font-medium" }, props.fieldSchema.label),
|
|
33
35
|
react_1.default.createElement("div", { className: "grid gap-2" }, fields.map((name, index) => (react_1.default.createElement(react_1.Fragment, { key: name.id },
|
|
@@ -43,8 +45,8 @@ function Field(props) {
|
|
|
43
45
|
: `${props.fieldSchema.name}.${index}.` })));
|
|
44
46
|
}),
|
|
45
47
|
react_1.default.createElement("div", { className: "flex justify-end" },
|
|
46
|
-
react_1.default.createElement(icon_button_1.IconButton, { iconName: "trash", label: "
|
|
48
|
+
react_1.default.createElement(icon_button_1.IconButton, { iconName: "trash", label: t("uxf-form-form-renderer:fields.one-to-many.delete-item"), onClick: () => remove(index), variant: "secondary" })))))),
|
|
47
49
|
react_1.default.createElement("div", { className: "mt-2" },
|
|
48
|
-
react_1.default.createElement(icon_button_1.IconButton, { iconName: "plus", label: "
|
|
50
|
+
react_1.default.createElement(icon_button_1.IconButton, { iconName: "plus", label: t("uxf-form-form-renderer:fields.one-to-many.add-item"), onClick: () => append({ id: null }), variant: "secondary" }))));
|
|
49
51
|
}
|
|
50
52
|
exports.default = Field;
|
|
@@ -4,12 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FormRenderer = FormRenderer;
|
|
7
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
7
8
|
const form_1 = require("@uxf/form/form");
|
|
8
9
|
const button_1 = require("@uxf/ui/button");
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
10
11
|
const BaseSubmitButton = (props) => {
|
|
11
12
|
const { isSubmitting } = props.formState;
|
|
12
|
-
|
|
13
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
14
|
+
return (react_1.default.createElement(button_1.Button, { isDisabled: isSubmitting, type: "submit" }, t("uxf-form-form-renderer:submit-button")));
|
|
13
15
|
};
|
|
14
16
|
function FormRenderer(props) {
|
|
15
17
|
var _a;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-form-form-renderer": {
|
|
3
|
+
"file-upload-error": {
|
|
4
|
+
cs: string;
|
|
5
|
+
en: string;
|
|
6
|
+
sk: string;
|
|
7
|
+
de: string;
|
|
8
|
+
};
|
|
9
|
+
"submit-button": {
|
|
10
|
+
cs: string;
|
|
11
|
+
en: string;
|
|
12
|
+
sk: string;
|
|
13
|
+
de: string;
|
|
14
|
+
};
|
|
15
|
+
fields: {
|
|
16
|
+
"one-to-many": {
|
|
17
|
+
"delete-item": {
|
|
18
|
+
cs: string;
|
|
19
|
+
en: string;
|
|
20
|
+
sk: string;
|
|
21
|
+
de: string;
|
|
22
|
+
};
|
|
23
|
+
"add-item": {
|
|
24
|
+
cs: string;
|
|
25
|
+
en: string;
|
|
26
|
+
sk: string;
|
|
27
|
+
de: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-form-renderer": {
|
|
5
|
+
"file-upload-error": {
|
|
6
|
+
cs: "Soubor se nepodařilo nahrát.",
|
|
7
|
+
en: "File could not be uploaded.",
|
|
8
|
+
sk: "Súbor sa nepodarilo nahrať.",
|
|
9
|
+
de: "Datei konnte nicht hochgeladen werden.",
|
|
10
|
+
},
|
|
11
|
+
"submit-button": {
|
|
12
|
+
cs: "Uložit",
|
|
13
|
+
en: "Save",
|
|
14
|
+
sk: "Uložiť",
|
|
15
|
+
de: "Speichern",
|
|
16
|
+
},
|
|
17
|
+
fields: {
|
|
18
|
+
"one-to-many": {
|
|
19
|
+
"delete-item": {
|
|
20
|
+
cs: "Smazat položku",
|
|
21
|
+
en: "Delete item",
|
|
22
|
+
sk: "Zmazať položku",
|
|
23
|
+
de: "Element löschen",
|
|
24
|
+
},
|
|
25
|
+
"add-item": {
|
|
26
|
+
cs: "Přidat položku",
|
|
27
|
+
en: "Add item",
|
|
28
|
+
sk: "Pridať položku",
|
|
29
|
+
de: "Element hinzufügen",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
package/gps-input/gps-input.js
CHANGED
|
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.GpsInput = GpsInput;
|
|
31
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
31
32
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
32
33
|
const text_input_1 = require("@uxf/ui/text-input");
|
|
33
34
|
const tooltip_1 = require("@uxf/ui/tooltip");
|
|
@@ -80,16 +81,15 @@ const SUPPORTED_FORMATS = (react_1.default.createElement("div", null,
|
|
|
80
81
|
react_1.default.createElement("br", null),
|
|
81
82
|
"40\u00B0 7.38, -74\u00B0 7.38",
|
|
82
83
|
react_1.default.createElement("br", null)));
|
|
83
|
-
const
|
|
84
|
+
const getSupportedFormatsTooltip = (t) => (react_1.default.createElement("span", { className: "text-lightMedium" },
|
|
84
85
|
"(",
|
|
85
86
|
react_1.default.createElement(tooltip_1.Tooltip, { content: SUPPORTED_FORMATS },
|
|
86
|
-
react_1.default.createElement("span", { className: "underline" }, "
|
|
87
|
+
react_1.default.createElement("span", { className: "underline" }, t("uxf-form-gps-input:validation.supported-formats"))),
|
|
87
88
|
")"));
|
|
88
|
-
const EMPTY_HELPER_TEXT = "Zadejte souřadnice.";
|
|
89
|
-
const NOT_VALID_HELPER_TEXT = "Souřadnice nejsou validní";
|
|
90
89
|
function GpsInput(props) {
|
|
91
90
|
var _a, _b;
|
|
92
91
|
const formContext = (0, form_context_1.useFormContext)();
|
|
92
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
93
93
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
94
94
|
const [visualValue, setVisualValue] = (0, react_1.useState)("");
|
|
95
95
|
const [coordsFormatError, setCoordsFormatError] = (0, react_1.useState)(false);
|
|
@@ -103,11 +103,13 @@ function GpsInput(props) {
|
|
|
103
103
|
req: (value) => {
|
|
104
104
|
var _a;
|
|
105
105
|
return props.isRequired && value === undefined
|
|
106
|
-
? ((_a = props.requiredMessage) !== null && _a !== void 0 ? _a : "
|
|
106
|
+
? ((_a = props.requiredMessage) !== null && _a !== void 0 ? _a : t("uxf-form-gps-input:validation.required", { value: value }))
|
|
107
107
|
: undefined;
|
|
108
108
|
},
|
|
109
109
|
format: (value) => {
|
|
110
|
-
return value === null
|
|
110
|
+
return value === null
|
|
111
|
+
? t("uxf-form-gps-input:validation.invalid-coordinates", { value: value })
|
|
112
|
+
: undefined;
|
|
111
113
|
},
|
|
112
114
|
},
|
|
113
115
|
},
|
|
@@ -145,10 +147,10 @@ function GpsInput(props) {
|
|
|
145
147
|
: field.value
|
|
146
148
|
? `${field.value.lat}N, ${field.value.lng}E`
|
|
147
149
|
: visualValue
|
|
148
|
-
?
|
|
149
|
-
:
|
|
150
|
+
? t("uxf-form-gps-input:validation.invalid-coordinates", { value: visualValue })
|
|
151
|
+
: t("uxf-form-gps-input:validation.empty-coordinates"),
|
|
150
152
|
" ",
|
|
151
|
-
|
|
153
|
+
getSupportedFormatsTooltip(t)));
|
|
152
154
|
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: composedHelperText, hiddenLabel: props.hiddenLabel, id: id, inputMode: props.inputMode, isDisabled: formContext.isFormDisabled || props.isDisabled, isInvalid: ((0, is_not_nil_1.isNotNil)(fieldState.error) && !field.value) || coordsFormatError, isReadOnly: formContext.isFormReadOnly || 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, placeholder: props.placeholder, ref: field.ref, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, style: props.style, type: "text", value: visualValue, variant: props.variant }));
|
|
153
155
|
}
|
|
154
156
|
GpsInput.displayName = "UxfFormGpsInput";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-form-gps-input": {
|
|
3
|
+
validation: {
|
|
4
|
+
"supported-formats": {
|
|
5
|
+
cs: string;
|
|
6
|
+
en: string;
|
|
7
|
+
sk: string;
|
|
8
|
+
de: string;
|
|
9
|
+
};
|
|
10
|
+
required: {
|
|
11
|
+
cs: string;
|
|
12
|
+
en: string;
|
|
13
|
+
sk: string;
|
|
14
|
+
de: string;
|
|
15
|
+
};
|
|
16
|
+
"empty-coordinates": {
|
|
17
|
+
cs: string;
|
|
18
|
+
en: string;
|
|
19
|
+
sk: string;
|
|
20
|
+
de: string;
|
|
21
|
+
};
|
|
22
|
+
"invalid-coordinates": {
|
|
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-gps-input": {
|
|
5
|
+
validation: {
|
|
6
|
+
"supported-formats": {
|
|
7
|
+
cs: "podporované formáty",
|
|
8
|
+
en: "supported formats",
|
|
9
|
+
sk: "podporované formáty",
|
|
10
|
+
de: "unterstützte Formate",
|
|
11
|
+
},
|
|
12
|
+
required: {
|
|
13
|
+
cs: "Toto pole je povinné",
|
|
14
|
+
en: "This field is required",
|
|
15
|
+
sk: "Toto pole je povinné",
|
|
16
|
+
de: "Dieses Feld ist erforderlich",
|
|
17
|
+
},
|
|
18
|
+
"empty-coordinates": {
|
|
19
|
+
cs: "Zadejte souřadnice.",
|
|
20
|
+
en: "Enter coordinates.",
|
|
21
|
+
sk: "Zadajte súradnice.",
|
|
22
|
+
de: "Koordinaten eingeben.",
|
|
23
|
+
},
|
|
24
|
+
"invalid-coordinates": {
|
|
25
|
+
cs: "Souřadnice nejsou validní. Aktuální hodnota je {{value}}.",
|
|
26
|
+
en: "Coordinates are not valid. Current value is {{value}}.",
|
|
27
|
+
sk: "Súradnice nie sú platné. Aktuálna hodnota je {{value}}.",
|
|
28
|
+
de: "Koordinaten sind nicht gültig. Aktueller Wert ist {{value}}.",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.MoneyInput = MoneyInput;
|
|
27
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
27
28
|
const currencies_1 = require("@uxf/core/money/currencies");
|
|
28
29
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
29
30
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
@@ -40,12 +41,15 @@ const ALLOWED_KEYS = /[0-9+\-.,]/;
|
|
|
40
41
|
function MoneyInput(props) {
|
|
41
42
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
42
43
|
const formContext = (0, form_context_1.useFormContext)();
|
|
44
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
43
45
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
44
46
|
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
45
47
|
control: props.control,
|
|
46
48
|
name: props.name,
|
|
47
49
|
rules: {
|
|
48
|
-
required: props.isRequired
|
|
50
|
+
required: props.isRequired
|
|
51
|
+
? props.requiredMessage || t("uxf-form-money-input:validation.required")
|
|
52
|
+
: undefined,
|
|
49
53
|
validate: {
|
|
50
54
|
validMinNumber: (value) => {
|
|
51
55
|
if (!value) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-money-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
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.MultiCombobox = MultiCombobox;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
9
10
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
10
11
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
@@ -16,12 +17,15 @@ const form_context_1 = require("../form-id-context/form-context");
|
|
|
16
17
|
function MultiCombobox(props) {
|
|
17
18
|
var _a, _b, _c, _d;
|
|
18
19
|
const formContext = (0, form_context_1.useFormContext)();
|
|
20
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
19
21
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
20
22
|
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
21
23
|
control: props.control,
|
|
22
24
|
name: props.name,
|
|
23
25
|
rules: {
|
|
24
|
-
required: props.isRequired
|
|
26
|
+
required: props.isRequired
|
|
27
|
+
? props.requiredMessage || t("uxf-form-multi-combobox:validation.required")
|
|
28
|
+
: undefined,
|
|
25
29
|
...props.rules,
|
|
26
30
|
},
|
|
27
31
|
shouldUnregister: props.shouldUnregister,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-multi-combobox": {
|
|
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
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.MultiSelect = MultiSelect;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
9
10
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
10
11
|
const multi_select_1 = require("@uxf/ui/multi-select");
|
|
@@ -14,12 +15,15 @@ const form_context_1 = require("../form-id-context/form-context");
|
|
|
14
15
|
function MultiSelect(props) {
|
|
15
16
|
var _a, _b, _c;
|
|
16
17
|
const formContext = (0, form_context_1.useFormContext)();
|
|
18
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
17
19
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${formContext.formId}__${props.name}`;
|
|
18
20
|
const { field, fieldState } = (0, react_hook_form_1.useController)({
|
|
19
21
|
control: props.control,
|
|
20
22
|
name: props.name,
|
|
21
23
|
rules: {
|
|
22
|
-
required: props.isRequired
|
|
24
|
+
required: props.isRequired
|
|
25
|
+
? props.requiredMessage || t("uxf-form-multi-select:validation.required")
|
|
26
|
+
: undefined,
|
|
23
27
|
...props.rules,
|
|
24
28
|
},
|
|
25
29
|
shouldUnregister: props.shouldUnregister,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-form-multi-select": {
|
|
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
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|