@uxf/ui 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/chip/chip.js +3 -1
- package/chip/translations.d.ts +11 -0
- package/chip/translations.js +12 -0
- package/combobox/combobox.js +4 -2
- package/combobox/translations.d.ts +17 -0
- package/combobox/translations.js +18 -0
- package/date-picker/date-picker-decade.js +5 -3
- package/date-picker/date-picker-month.js +5 -3
- package/date-picker/date-picker-year.js +5 -3
- package/date-picker/translations.d.ts +53 -0
- package/date-picker/translations.js +54 -0
- package/date-range-picker/date-range-picker-decade.js +5 -3
- package/date-range-picker/date-range-picker-month.js +6 -4
- package/date-range-picker/date-range-picker-year.js +5 -3
- package/date-range-picker/translations.d.ts +53 -0
- package/date-range-picker/translations.js +54 -0
- package/datetime-picker/datetime-picker.js +4 -2
- package/datetime-picker/translations.d.ts +17 -0
- package/datetime-picker/translations.js +18 -0
- package/image-gallery/components/close-button.js +3 -1
- package/image-gallery/translations.d.ts +11 -0
- package/image-gallery/translations.js +12 -0
- package/layout/layout.js +3 -1
- package/layout/translations.d.ts +11 -0
- package/layout/translations.js +12 -0
- package/lightbox/components/lightbox-close-button.js +3 -1
- package/lightbox/components/lightbox-next-button.js +3 -1
- package/lightbox/components/lightbox-prev-button.js +3 -1
- package/lightbox/translations.d.ts +23 -0
- package/lightbox/translations.js +24 -0
- package/multi-combobox/multi-combobox.js +6 -4
- package/multi-combobox/translations.d.ts +29 -0
- package/multi-combobox/translations.js +30 -0
- package/multi-select/multi-select.js +4 -2
- package/multi-select/translations.d.ts +17 -0
- package/multi-select/translations.js +18 -0
- package/package.json +2 -2
- package/select/select.js +3 -1
- package/select/translations.d.ts +11 -0
- package/select/translations.js +12 -0
- package/time-picker/time-picker.js +7 -5
- package/time-picker/translations.d.ts +17 -0
- package/time-picker/translations.js +18 -0
- package/translations/translations.d.ts +237 -0
- package/translations/translations.js +31 -0
|
@@ -4,12 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CloseButton = void 0;
|
|
7
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
7
8
|
const icon_1 = require("@uxf/ui/icon");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const CloseButton = (props) => {
|
|
10
11
|
var _a, _b;
|
|
12
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
11
13
|
return (react_1.default.createElement("button", { className: "uxf-image-gallery__close-button", onClick: () => props.onClick() },
|
|
12
|
-
react_1.default.createElement("span", { className: "uxf-image-gallery__close-button-text" }, (_a = props.text) !== null && _a !== void 0 ? _a : "
|
|
14
|
+
react_1.default.createElement("span", { className: "uxf-image-gallery__close-button-text" }, (_a = props.text) !== null && _a !== void 0 ? _a : t("uxf-ui-image-gallery:close-button")), (_b = props.buttonElement) !== null && _b !== void 0 ? _b : react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__close-button-icon", name: "xmarkLarge" })));
|
|
13
15
|
};
|
|
14
16
|
exports.CloseButton = CloseButton;
|
|
15
17
|
exports.CloseButton.displayName = "UxfUiCloseButton";
|
package/layout/layout.js
CHANGED
|
@@ -24,12 +24,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Layout = Layout;
|
|
27
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
27
28
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
28
29
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
29
30
|
const react_1 = __importStar(require("react"));
|
|
30
31
|
const icon_button_1 = require("../icon-button");
|
|
31
32
|
function Layout(props) {
|
|
32
33
|
var _a, _b;
|
|
34
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
33
35
|
const [isSidebarOpen, setIsSidebarOpen] = (0, react_1.useState)(false);
|
|
34
36
|
return (react_1.default.createElement("div", { className: `uxf-layout ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
|
|
35
37
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-sidebar", isSidebarOpen && "uxf-sidebar--is-open") },
|
|
@@ -37,7 +39,7 @@ function Layout(props) {
|
|
|
37
39
|
react_1.default.createElement("div", { className: "uxf-sidebar__content" }, props.sidebar)),
|
|
38
40
|
isSidebarOpen && react_1.default.createElement("div", { className: "uxf-sidebar-overlay", onClick: () => setIsSidebarOpen(false) }),
|
|
39
41
|
react_1.default.createElement("div", { className: `uxf-app-bar ${(_b = props.classNameAppBar) !== null && _b !== void 0 ? _b : ""}` },
|
|
40
|
-
react_1.default.createElement(icon_button_1.IconButton, { className: "uxf-app-bar__menu-button", iconName: "bars", label: "
|
|
42
|
+
react_1.default.createElement(icon_button_1.IconButton, { className: "uxf-app-bar__menu-button", iconName: "bars", label: t("uxf-ui-layout:open-menu"), onClick: () => setIsSidebarOpen(true), variant: "text" }),
|
|
41
43
|
react_1.default.createElement("div", { className: "uxf-app-bar__content" }, props.appBar)),
|
|
42
44
|
react_1.default.createElement("main", { className: "uxf-layout__content" }, props.children)));
|
|
43
45
|
}
|
|
@@ -5,10 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LightboxCloseButton = LightboxCloseButton;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
10
11
|
function LightboxCloseButton(props) {
|
|
11
|
-
|
|
12
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
13
|
+
return (react_1.default.createElement("button", { className: "uxf-lightbox__close-button", onClick: props.onClick, title: t("uxf-ui-lightbox:close") },
|
|
12
14
|
react_1.default.createElement(icon_1.Icon, { className: "uxf-lightbox__close-button-icon", name: "xmarkLarge" })));
|
|
13
15
|
}
|
|
14
16
|
LightboxCloseButton.displayName = "UxfUiLightboxCloseButton";
|
|
@@ -5,10 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LightboxNextButton = LightboxNextButton;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
10
11
|
function LightboxNextButton(props) {
|
|
11
|
-
|
|
12
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
13
|
+
return (react_1.default.createElement("button", { className: "uxf-lightbox__button uxf-lightbox__button--next", onClick: props.onClick, title: t("uxf-ui-lightbox:next") },
|
|
12
14
|
react_1.default.createElement(icon_1.Icon, { className: "uxf-lightbox__button-icon", name: "chevronRight" })));
|
|
13
15
|
}
|
|
14
16
|
LightboxNextButton.displayName = "UxfUiLightboxNextButton";
|
|
@@ -5,10 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LightboxPrevButton = LightboxPrevButton;
|
|
8
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
10
11
|
function LightboxPrevButton(props) {
|
|
11
|
-
|
|
12
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
13
|
+
return (react_1.default.createElement("button", { className: "uxf-lightbox__button uxf-lightbox__button--prev", onClick: props.onClick, title: t("uxf-ui-lightbox:previous") },
|
|
12
14
|
react_1.default.createElement(icon_1.Icon, { className: "uxf-lightbox__button-icon", name: "chevronLeft" })));
|
|
13
15
|
}
|
|
14
16
|
LightboxPrevButton.displayName = "UxfUiLightboxPrevButton";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly "uxf-ui-lightbox": {
|
|
3
|
+
readonly next: {
|
|
4
|
+
readonly cs: "Další";
|
|
5
|
+
readonly en: "Next";
|
|
6
|
+
readonly sk: "Ďalší";
|
|
7
|
+
readonly de: "Weiter";
|
|
8
|
+
};
|
|
9
|
+
readonly close: {
|
|
10
|
+
readonly cs: "Zavřít";
|
|
11
|
+
readonly en: "Close";
|
|
12
|
+
readonly sk: "Zatvoriť";
|
|
13
|
+
readonly de: "Schließen";
|
|
14
|
+
};
|
|
15
|
+
readonly previous: {
|
|
16
|
+
readonly cs: "Předchozí";
|
|
17
|
+
readonly en: "Previous";
|
|
18
|
+
readonly sk: "Predchádzajúci";
|
|
19
|
+
readonly de: "Zurück";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-ui-lightbox": {
|
|
5
|
+
next: {
|
|
6
|
+
cs: "Další",
|
|
7
|
+
en: "Next",
|
|
8
|
+
sk: "Ďalší",
|
|
9
|
+
de: "Weiter",
|
|
10
|
+
},
|
|
11
|
+
close: {
|
|
12
|
+
cs: "Zavřít",
|
|
13
|
+
en: "Close",
|
|
14
|
+
sk: "Zatvoriť",
|
|
15
|
+
de: "Schließen",
|
|
16
|
+
},
|
|
17
|
+
previous: {
|
|
18
|
+
cs: "Předchozí",
|
|
19
|
+
en: "Previous",
|
|
20
|
+
sk: "Predchádzajúci",
|
|
21
|
+
de: "Zurück",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -29,6 +29,7 @@ const react_1 = require("@floating-ui/react");
|
|
|
29
29
|
const react_2 = require("@headlessui/react");
|
|
30
30
|
const show_1 = require("@uxf/core-react/components/show");
|
|
31
31
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
32
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
32
33
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
33
34
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
34
35
|
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
@@ -91,6 +92,7 @@ function useMultiComboboxOptions(query, props) {
|
|
|
91
92
|
}
|
|
92
93
|
exports.MultiCombobox = (0, react_3.forwardRef)((props, ref) => {
|
|
93
94
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
95
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
94
96
|
const generatedId = (0, react_3.useId)();
|
|
95
97
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
96
98
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
@@ -135,12 +137,12 @@ exports.MultiCombobox = (0, react_3.forwardRef)((props, ref) => {
|
|
|
135
137
|
setQuery("");
|
|
136
138
|
};
|
|
137
139
|
const emptyMessage = (0, is_empty_1.isEmpty)(query)
|
|
138
|
-
? ((_d = props.noQueryMessage) !== null && _d !== void 0 ? _d : "
|
|
140
|
+
? ((_d = props.noQueryMessage) !== null && _d !== void 0 ? _d : t("uxf-ui-multi-combobox:no-query-message"))
|
|
139
141
|
: selectedOptions.length === options.length && (0, is_not_empty_1.isNotEmpty)(selectedOptions)
|
|
140
|
-
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : "
|
|
142
|
+
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : t("uxf-ui-multi-combobox:all-options-selected"))
|
|
141
143
|
: (0, is_empty_1.isEmpty)(options)
|
|
142
|
-
? ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : "
|
|
143
|
-
: ((_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "
|
|
144
|
+
? ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : t("uxf-ui-multi-combobox:no-options-message"))
|
|
145
|
+
: ((_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : t("uxf-ui-multi-combobox:not-found-message"));
|
|
144
146
|
const onBlur = (e) => {
|
|
145
147
|
/* TODO: refactor component to enable this */
|
|
146
148
|
// setQuery("");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-ui-multi-combobox": {
|
|
3
|
+
"no-query-message": {
|
|
4
|
+
cs: string;
|
|
5
|
+
en: string;
|
|
6
|
+
sk: string;
|
|
7
|
+
de: string;
|
|
8
|
+
};
|
|
9
|
+
"all-options-selected": {
|
|
10
|
+
cs: string;
|
|
11
|
+
en: string;
|
|
12
|
+
sk: string;
|
|
13
|
+
de: string;
|
|
14
|
+
};
|
|
15
|
+
"no-options-message": {
|
|
16
|
+
cs: string;
|
|
17
|
+
en: string;
|
|
18
|
+
sk: string;
|
|
19
|
+
de: string;
|
|
20
|
+
};
|
|
21
|
+
"not-found-message": {
|
|
22
|
+
cs: string;
|
|
23
|
+
en: string;
|
|
24
|
+
sk: string;
|
|
25
|
+
de: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-ui-multi-combobox": {
|
|
5
|
+
"no-query-message": {
|
|
6
|
+
cs: "Pro zobrazení možností začněte psát",
|
|
7
|
+
en: "Start typing to see options",
|
|
8
|
+
sk: "Pre zobrazenie možností začnite písať",
|
|
9
|
+
de: "Beginnen Sie zu tippen, um Optionen zu sehen",
|
|
10
|
+
},
|
|
11
|
+
"all-options-selected": {
|
|
12
|
+
cs: "Všechny možnosti jsou již vybrány",
|
|
13
|
+
en: "All options are already selected",
|
|
14
|
+
sk: "Všetky možnosti sú už vybrané",
|
|
15
|
+
de: "Alle Optionen sind bereits ausgewählt",
|
|
16
|
+
},
|
|
17
|
+
"no-options-message": {
|
|
18
|
+
cs: "Nabídka neosahuje žádné položky",
|
|
19
|
+
en: "No items found",
|
|
20
|
+
sk: "Ponuka neobsahuje žiadne položky",
|
|
21
|
+
de: "Keine Elemente gefunden",
|
|
22
|
+
},
|
|
23
|
+
"not-found-message": {
|
|
24
|
+
cs: "Nic nenalezeno",
|
|
25
|
+
en: "Nothing found",
|
|
26
|
+
sk: "Nič nenájdené",
|
|
27
|
+
de: "Nichts gefunden",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -29,6 +29,7 @@ const react_1 = require("@floating-ui/react");
|
|
|
29
29
|
const react_2 = require("@headlessui/react");
|
|
30
30
|
const show_1 = require("@uxf/core-react/components/show");
|
|
31
31
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
32
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
32
33
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
33
34
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
34
35
|
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
@@ -73,6 +74,7 @@ function Options(props) {
|
|
|
73
74
|
Options.displayName = "UxfUiMultiSelectOptions";
|
|
74
75
|
exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
75
76
|
var _a, _b, _c, _d, _e, _f;
|
|
77
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
76
78
|
const generatedId = (0, react_3.useId)();
|
|
77
79
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
78
80
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
@@ -107,8 +109,8 @@ exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
|
107
109
|
}
|
|
108
110
|
};
|
|
109
111
|
const emptyMessage = (0, is_empty_1.isEmpty)(filteredOptions) && (0, is_not_empty_1.isNotEmpty)(selectedOptions)
|
|
110
|
-
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : "
|
|
111
|
-
: ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : "
|
|
112
|
+
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : t("uxf-ui-multi-select:all-options-selected"))
|
|
113
|
+
: ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : t("uxf-ui-multi-select:no-options-message"));
|
|
112
114
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
113
115
|
return (react_3.default.createElement(react_2.Listbox, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-multi-select", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), "data-name": props.name, disabled: isNotInteractive, form: props.form, multiple: true, name: props.name, onChange: props.onChange, value: selectedOptions }, (renderProps) => {
|
|
114
116
|
var _a, _b;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"uxf-ui-multi-select": {
|
|
3
|
+
"all-options-selected": {
|
|
4
|
+
cs: string;
|
|
5
|
+
en: string;
|
|
6
|
+
sk: string;
|
|
7
|
+
de: string;
|
|
8
|
+
};
|
|
9
|
+
"no-options-message": {
|
|
10
|
+
cs: string;
|
|
11
|
+
en: string;
|
|
12
|
+
sk: string;
|
|
13
|
+
de: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-ui-multi-select": {
|
|
5
|
+
"all-options-selected": {
|
|
6
|
+
cs: "Všechny možnosti jsou již vybrány",
|
|
7
|
+
en: "All options are already selected",
|
|
8
|
+
sk: "Všetky možnosti sú už vybrané",
|
|
9
|
+
de: "Alle Optionen sind bereits ausgewählt",
|
|
10
|
+
},
|
|
11
|
+
"no-options-message": {
|
|
12
|
+
cs: "Nabídka neosahuje žádné položky",
|
|
13
|
+
en: "No items found",
|
|
14
|
+
sk: "Ponuka neobsahuje žiadne položky",
|
|
15
|
+
de: "Keine Elemente gefunden",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.74.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@floating-ui/react": "0.26.28",
|
|
25
25
|
"@headlessui/react": "1.7.19",
|
|
26
26
|
"@uxf/core": "11.72.3",
|
|
27
|
-
"@uxf/core-react": "11.
|
|
27
|
+
"@uxf/core-react": "11.74.1",
|
|
28
28
|
"@uxf/datepicker": "11.61.0",
|
|
29
29
|
"@uxf/styles": "11.72.3",
|
|
30
30
|
"color2k": "2.0.3",
|
package/select/select.js
CHANGED
|
@@ -29,6 +29,7 @@ const react_1 = require("@floating-ui/react");
|
|
|
29
29
|
const react_2 = require("@headlessui/react");
|
|
30
30
|
const show_1 = require("@uxf/core-react/components/show");
|
|
31
31
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
32
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
32
33
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
33
34
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
34
35
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
@@ -62,6 +63,7 @@ const SelectedValue = (0, react_3.forwardRef)((props, ref) => {
|
|
|
62
63
|
SelectedValue.displayName = "UxUiSelectSelectedValue";
|
|
63
64
|
function Select(props) {
|
|
64
65
|
var _a, _b, _c, _d, _e;
|
|
66
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
65
67
|
const onChange = (v) => { var _a; return props.onChange((_a = v === null || v === void 0 ? void 0 : v.id) !== null && _a !== void 0 ? _a : null); };
|
|
66
68
|
const selectedOption = (_a = props.options.find((option) => option.id === props.value)) !== null && _a !== void 0 ? _a : null;
|
|
67
69
|
const generatedId = (0, react_3.useId)();
|
|
@@ -72,7 +74,7 @@ function Select(props) {
|
|
|
72
74
|
const dropdown = (0, use_dropdown_1.useDropdown)((_c = props.dropdownPlacement) !== null && _c !== void 0 ? _c : "bottom", (_d = props.dropdownMatchesInputWidth) !== null && _d !== void 0 ? _d : true, props.dropdownMaxHeight, props.dropdownStrategy);
|
|
73
75
|
const stableRef = (0, react_3.useMemo)(() => (0, compose_refs_1.composeRefs)(innerRef, props.inputGroupRef, dropdown.refs.setReference), [dropdown.refs.setReference, props.inputGroupRef]);
|
|
74
76
|
const value = selectedOption;
|
|
75
|
-
const emptyMessage = (_e = props.noOptionsMessage) !== null && _e !== void 0 ? _e : "
|
|
77
|
+
const emptyMessage = (_e = props.noOptionsMessage) !== null && _e !== void 0 ? _e : t("uxf-ui-select:no-options-message");
|
|
76
78
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
77
79
|
return (react_3.default.createElement(react_2.Listbox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-select", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), "data-name": props.name, disabled: isNotInteractive, form: props.form, name: props.name, onChange: onChange, style: props.style, value: value }, (renderProps) => {
|
|
78
80
|
var _a, _b, _c;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-ui-select": {
|
|
5
|
+
"no-options-message": {
|
|
6
|
+
cs: "Nabídka neosahuje žádné položky",
|
|
7
|
+
en: "No items found",
|
|
8
|
+
sk: "Ponuka neobsahuje žiadne položky",
|
|
9
|
+
de: "Keine Elemente gefunden",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.TimePicker = void 0;
|
|
28
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
28
29
|
const time_picker_context_1 = require("@uxf/datepicker/contexts/time-picker-context");
|
|
29
30
|
const use_time_picker_1 = require("@uxf/datepicker/hooks/use-time-picker");
|
|
30
31
|
const react_1 = __importStar(require("react"));
|
|
@@ -33,6 +34,7 @@ const icon_1 = require("../icon");
|
|
|
33
34
|
const time_picker_hours_1 = require("./time-picker-hours");
|
|
34
35
|
const time_picker_minutes_1 = require("./time-picker-minutes");
|
|
35
36
|
const TimePicker = (props) => {
|
|
37
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
36
38
|
const [viewMode, setViewMode] = (0, react_1.useState)("global");
|
|
37
39
|
const { goToNextMinute, goToPrevHour, goToPrevMinute, goToNextHour, ...contextProps } = (0, use_time_picker_1.useTimePicker)({
|
|
38
40
|
selectedTime: props.selectedTime,
|
|
@@ -45,26 +47,26 @@ const TimePicker = (props) => {
|
|
|
45
47
|
return ({
|
|
46
48
|
global: (react_1.default.createElement("div", { className: "uxf-time-picker__global" },
|
|
47
49
|
react_1.default.createElement("div", { className: "uxf-time-picker__global__column" },
|
|
48
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToNextHour, title: "
|
|
50
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToNextHour, title: t("uxf-ui-time-picker:next"), variant: "text" },
|
|
49
51
|
react_1.default.createElement(icon_1.Icon, { name: "chevronUp", size: 16 })),
|
|
50
52
|
react_1.default.createElement(button_1.Button, { onClick: () => setViewMode("hour"), variant: "text" }, (_b = (_a = props.selectedTime) === null || _a === void 0 ? void 0 : _a.hour.toString()) !== null && _b !== void 0 ? _b : "0"),
|
|
51
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToPrevHour, title: "
|
|
53
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToPrevHour, title: t("uxf-ui-time-picker:previous"), variant: "text" },
|
|
52
54
|
react_1.default.createElement(icon_1.Icon, { name: "chevronDown", size: 16 }))),
|
|
53
55
|
react_1.default.createElement("div", null, ":"),
|
|
54
56
|
react_1.default.createElement("div", { className: "uxf-time-picker__global__column" },
|
|
55
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToNextMinute, title: "
|
|
57
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToNextMinute, title: t("uxf-ui-time-picker:next"), variant: "text" },
|
|
56
58
|
react_1.default.createElement(icon_1.Icon, { name: "chevronUp", size: 16 })),
|
|
57
59
|
react_1.default.createElement(button_1.Button, { onClick: () => setViewMode("minute"), variant: "text" }, props.selectedTime
|
|
58
60
|
? props.selectedTime.minute < 10
|
|
59
61
|
? "0" + props.selectedTime.minute
|
|
60
62
|
: props.selectedTime.minute.toString()
|
|
61
63
|
: "00"),
|
|
62
|
-
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToPrevMinute, title: "
|
|
64
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToPrevMinute, title: t("uxf-ui-time-picker:previous"), variant: "text" },
|
|
63
65
|
react_1.default.createElement(icon_1.Icon, { name: "chevronDown", size: 16 }))))),
|
|
64
66
|
hour: react_1.default.createElement(time_picker_hours_1.TimePickerHours, null),
|
|
65
67
|
minute: react_1.default.createElement(time_picker_minutes_1.TimePickerMinutes, null),
|
|
66
68
|
});
|
|
67
|
-
}, [goToPrevHour, props.selectedTime, goToNextHour, goToPrevMinute, goToNextMinute]);
|
|
69
|
+
}, [goToPrevHour, props.selectedTime, goToNextHour, goToPrevMinute, goToNextMinute, t]);
|
|
68
70
|
return (react_1.default.createElement(time_picker_context_1.TimePickerContext.Provider, { value: contextProps },
|
|
69
71
|
react_1.default.createElement("div", { className: "uxf-time-picker" }, timePickerComponents[viewMode])));
|
|
70
72
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly "uxf-ui-time-picker": {
|
|
3
|
+
readonly previous: {
|
|
4
|
+
readonly cs: "Předchozí";
|
|
5
|
+
readonly en: "Previous";
|
|
6
|
+
readonly sk: "Predchádzajúci";
|
|
7
|
+
readonly de: "Zurück";
|
|
8
|
+
};
|
|
9
|
+
readonly next: {
|
|
10
|
+
readonly cs: "Nadcházející";
|
|
11
|
+
readonly en: "Next";
|
|
12
|
+
readonly sk: "Nasledujúci";
|
|
13
|
+
readonly de: "Weiter";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"uxf-ui-time-picker": {
|
|
5
|
+
previous: {
|
|
6
|
+
cs: "Předchozí",
|
|
7
|
+
en: "Previous",
|
|
8
|
+
sk: "Predchádzajúci",
|
|
9
|
+
de: "Zurück",
|
|
10
|
+
},
|
|
11
|
+
next: {
|
|
12
|
+
cs: "Nadcházející",
|
|
13
|
+
en: "Next",
|
|
14
|
+
sk: "Nasledujúci",
|
|
15
|
+
de: "Weiter",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|