@uxf/ui 10.10.1 → 11.0.0-beta.17
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/_file-input-base/file-input-base.d.ts +0 -1
- package/_file-input-base/file-input-base.js +7 -9
- package/_select-base/_select-base.d.ts +0 -1
- package/_select-base/_select-base.js +5 -14
- package/alert-bubble/alert-bubble.d.ts +0 -2
- package/alert-bubble/alert-bubble.js +2 -2
- package/avatar-file-input/avatar-file-input.d.ts +2 -10
- package/avatar-file-input/avatar-file-input.js +11 -27
- package/button-list/button-list.d.ts +1 -2
- package/calendar/calendar-day-cell.js +2 -3
- package/checkbox-input/checkbox-input.d.ts +0 -1
- package/checkbox-input/checkbox-input.js +3 -8
- package/combobox/combobox.js +1 -2
- package/create-component-preview-page/ui-components.d.ts +0 -10
- package/create-component-preview-page/ui-components.js +0 -10
- package/create-component-preview-page/ui-readmes.js +44 -48
- package/css/avatar-file-input.css +67 -97
- package/css/calendar.css +6 -1
- package/css/checkbox-input.css +1 -9
- package/date-picker/date-picker.stories.js +1 -17
- package/date-picker-input/date-picker-input.d.ts +3 -5
- package/date-picker-input/date-picker-input.js +7 -9
- package/date-picker-input/date-picker-input.stories.js +1 -2
- package/dropzone/dropzone-input.d.ts +0 -1
- package/dropzone/dropzone-input.js +5 -11
- package/dropzone/dropzone-list.d.ts +0 -1
- package/dropzone/dropzone-list.js +2 -2
- package/file-input/file-input.d.ts +2 -2
- package/file-input/file-input.js +2 -11
- package/message/README.md +1 -25
- package/message/message-content.d.ts +0 -2
- package/message/message-content.js +1 -1
- package/message/message.d.ts +5 -7
- package/message/message.js +1 -1
- package/multi-combobox/_multi-combobox-base.js +4 -26
- package/package.json +4 -4
- package/radio-group/radio-group.d.ts +1 -1
- package/tabs/tabs.d.ts +0 -1
- package/tabs/tabs.js +1 -2
- package/image-gallery/README.md +0 -8
- package/utils/validator/validator-exceptions.d.ts +0 -3
- package/utils/validator/validator-exceptions.js +0 -7
|
@@ -30,7 +30,6 @@ const classes_1 = require("@uxf/core/constants/classes");
|
|
|
30
30
|
const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
|
|
31
31
|
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
32
32
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
33
|
-
const last_1 = require("@uxf/core/utils/last");
|
|
34
33
|
const slugify_1 = require("@uxf/core/utils/slugify");
|
|
35
34
|
const chip_1 = require("@uxf/ui/chip");
|
|
36
35
|
const use_async_loading_1 = require("@uxf/ui/hooks/use-async-loading");
|
|
@@ -40,22 +39,6 @@ const input_1 = require("@uxf/ui/input");
|
|
|
40
39
|
const label_1 = require("@uxf/ui/label");
|
|
41
40
|
const react_3 = __importStar(require("react"));
|
|
42
41
|
const checkbox_input_1 = require("../checkbox-input");
|
|
43
|
-
function handleInputKeyDownRecursion(selectedOptions, onRemove) {
|
|
44
|
-
const lastSelectedOption = (0, last_1.last)(selectedOptions);
|
|
45
|
-
if (!lastSelectedOption) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (lastSelectedOption.disabled) {
|
|
49
|
-
handleInputKeyDownRecursion(selectedOptions.slice(0, -1), onRemove);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
onRemove(lastSelectedOption.id);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const OptionElement = (props) => {
|
|
56
|
-
return (react_3.default.createElement(react_2.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && props.withoutPopover && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), disabled: props.option.disabled, value: props.option }, (optionState) => (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: props.label, onChange: props.handleCheckboxChange, value: optionState.selected })) : (props.label)))));
|
|
57
|
-
};
|
|
58
|
-
OptionElement.displayName = "UxfUiMultiComboboxOption";
|
|
59
42
|
exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
60
43
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
61
44
|
const isAsync = !!props.loadOptions;
|
|
@@ -94,7 +77,7 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
94
77
|
};
|
|
95
78
|
const handleInputKeyDown = (e) => {
|
|
96
79
|
if (e.key === "Backspace" && query === "" && selectedOptions.length > 0) {
|
|
97
|
-
|
|
80
|
+
onRemove(selectedOptions[selectedOptions.length - 1].id);
|
|
98
81
|
}
|
|
99
82
|
};
|
|
100
83
|
const handleInputChange = (e) => setQuery(e.target.value);
|
|
@@ -108,12 +91,6 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
108
91
|
? (_f = props.allOptionsSelectedMessage) !== null && _f !== void 0 ? _f : "Všechny možnosti jsou již vybrány"
|
|
109
92
|
: (_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno";
|
|
110
93
|
const withoutPopover = !props.withPopover;
|
|
111
|
-
const onBlur = (e) => {
|
|
112
|
-
/* TODO: refactor component to enable this */
|
|
113
|
-
// setQuery("");
|
|
114
|
-
var _a;
|
|
115
|
-
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
116
|
-
};
|
|
117
94
|
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", 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), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleComboboxValueChange, value: selectedOptions }, (renderProps) => {
|
|
118
95
|
var _a, _b;
|
|
119
96
|
const inputElement = (react_3.default.createElement(react_3.default.Fragment, null,
|
|
@@ -122,14 +99,15 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
122
99
|
props.leftElement && react_3.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
123
100
|
react_3.default.createElement("div", { className: "uxf-multi-combobox__selected-options" },
|
|
124
101
|
selectedOptions.map((item) => (react_3.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: item.disabled ? undefined : handleRemove(item.id), size: "large", suppressFocus: true }, item.label))),
|
|
125
|
-
react_3.default.createElement(react_2.Combobox.Input, { autoComplete: "off", className: "uxf-multi-combobox__input",
|
|
102
|
+
react_3.default.createElement(react_2.Combobox.Input, { autoComplete: "off", className: "uxf-multi-combobox__input", onChange: handleInputChange, onKeyDown: handleInputKeyDown, placeholder: props.placeholder, type: "text", value: query })),
|
|
126
103
|
props.rightAddon && react_3.default.createElement(input_1.Input.RightAddon, null, props.rightAddon),
|
|
127
104
|
props.rightElement && react_3.default.createElement(input_1.Input.RightElement, null, props.rightElement),
|
|
128
105
|
react_3.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", (props.withPopover ? props.isPopoverOpen : renderProps.open) && classes_1.CLASSES.IS_OPEN), name: iconName })),
|
|
129
106
|
renderProps.open && (react_3.default.createElement(react_1.FloatingPortal, null,
|
|
130
107
|
react_3.default.createElement(react_2.Combobox.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredData.length > 0 ? (filteredData.map((option) => {
|
|
131
108
|
var _a, _b, _c, _d;
|
|
132
|
-
|
|
109
|
+
const label = (_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, option)) !== null && _b !== void 0 ? _b : option.label;
|
|
110
|
+
return (react_3.default.createElement(react_2.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && withoutPopover && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), disabled: option.disabled, key: (_d = (_c = props.keyExtractor) === null || _c === void 0 ? void 0 : _c.call(props, option)) !== null && _d !== void 0 ? _d : option.id, value: option }, (optionState) => (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: label, onChange: handleCheckboxChange(option.id), value: optionState.selected })) : (label)))));
|
|
133
111
|
})) : (react_3.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, emptyMessage))))),
|
|
134
112
|
props.helperText && withoutPopover && (react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: props.errorId }, props.helperText))));
|
|
135
113
|
return (react_3.default.createElement(react_3.default.Fragment, null, withoutPopover ? (react_3.default.createElement(react_3.default.Fragment, null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-beta.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@floating-ui/react": "0.26.0",
|
|
19
19
|
"@headlessui/react": "1.7.14",
|
|
20
|
-
"@uxf/core": "10.
|
|
21
|
-
"@uxf/datepicker": "10.
|
|
22
|
-
"@uxf/styles": "10.
|
|
20
|
+
"@uxf/core": "10.0.0",
|
|
21
|
+
"@uxf/datepicker": "10.0.0",
|
|
22
|
+
"@uxf/styles": "10.0.0",
|
|
23
23
|
"color2k": "2.0.2",
|
|
24
24
|
"dayjs": "1.11.10",
|
|
25
25
|
"jump.js": "1.0.2",
|
|
@@ -6,7 +6,7 @@ export type RadioGroupOptionValueId = string | number;
|
|
|
6
6
|
export interface RadioGroupOption {
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
id: RadioGroupOptionValueId;
|
|
9
|
-
label:
|
|
9
|
+
label: string;
|
|
10
10
|
}
|
|
11
11
|
export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValueId | null> {
|
|
12
12
|
className?: string;
|
package/tabs/tabs.d.ts
CHANGED
package/tabs/tabs.js
CHANGED
|
@@ -62,8 +62,7 @@ const TabsRoot = (0, react_2.forwardRef)((props, ref) => {
|
|
|
62
62
|
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-tabs__tab-list", `uxf-tabs__tab-list--${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`), ref: containerRef, style: { justifyContent: hasOverflow ? "flex-start" : undefined, ...dragStyle } }, tabs.map((tab, index) => (react_2.default.createElement(react_1.Tab, { disabled: tab.disabled, className: ({ selected }) => {
|
|
63
63
|
var _a;
|
|
64
64
|
return (0, cx_1.cx)("uxf-tabs__tab", selected && classes_1.CLASSES.IS_ACTIVE, tab.disabled && classes_1.CLASSES.IS_DISABLED, `uxf-tabs__tab--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`);
|
|
65
|
-
}, key: `${tab.title}--${index}` }, tab.title)))),
|
|
66
|
-
props.customTabListContent),
|
|
65
|
+
}, key: `${tab.title}--${index}` }, tab.title))))),
|
|
67
66
|
react_2.default.createElement(react_1.Tab.Panels, { className: "uxf-tabs__panels" }, tabPanels.map((tab, index) => (react_2.default.createElement(react_1.Tab.Panel, { className: "outline-none", key: `${tab}--${index}` }, tab))))));
|
|
68
67
|
});
|
|
69
68
|
TabsRoot.displayName = "UxfUiTabs";
|
package/image-gallery/README.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidatorExceptions = void 0;
|
|
4
|
-
var ValidatorExceptions;
|
|
5
|
-
(function (ValidatorExceptions) {
|
|
6
|
-
ValidatorExceptions["MaxFileSize"] = "MaxFileSizeException";
|
|
7
|
-
})(ValidatorExceptions || (exports.ValidatorExceptions = ValidatorExceptions = {}));
|