@uxf/ui 11.0.0-beta.21 → 11.0.0
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 +1 -0
- package/_file-input-base/file-input-base.js +9 -7
- package/_select-base/_select-base.d.ts +1 -0
- package/_select-base/_select-base.js +14 -5
- package/avatar-file-input/avatar-file-input.d.ts +10 -2
- package/avatar-file-input/avatar-file-input.js +27 -11
- package/calendar/calendar-day-cell.js +5 -2
- package/calendar/utils/get-class-names-from-flags.d.ts +2 -0
- package/calendar/utils/get-class-names-from-flags.js +10 -0
- package/checkbox-input/checkbox-input.d.ts +1 -0
- package/checkbox-input/checkbox-input.js +8 -3
- package/combobox/combobox.js +2 -1
- package/create-component-preview-page/ui-components.d.ts +15 -0
- package/create-component-preview-page/ui-components.js +15 -0
- package/create-component-preview-page/ui-readmes.js +68 -62
- package/css/avatar-file-input.css +97 -67
- package/css/checkbox-input.css +9 -1
- package/date-picker/date-picker.d.ts +7 -4
- package/date-picker/date-picker.js +3 -2
- package/date-picker/date-picker.stories.js +38 -1
- package/date-picker-input/date-picker-input.d.ts +8 -3
- package/date-picker-input/date-picker-input.js +9 -7
- package/date-picker-input/date-picker-input.stories.js +2 -1
- package/date-range-picker/date-range-picker.d.ts +4 -1
- package/date-range-picker/date-range-picker.js +1 -0
- package/date-range-picker-input/README.md +9 -1
- package/date-range-picker-input/date-range-picker-input.d.ts +4 -1
- package/date-range-picker-input/date-range-picker-input.js +1 -1
- package/dropzone/dropzone-input.d.ts +1 -0
- package/dropzone/dropzone-input.js +11 -5
- package/dropzone/dropzone-list.d.ts +1 -0
- package/dropzone/dropzone-list.js +2 -2
- package/file-input/file-input.d.ts +2 -2
- package/file-input/file-input.js +11 -2
- package/image-gallery/README.md +8 -0
- package/message/README.md +25 -1
- package/multi-combobox/_multi-combobox-base.js +26 -4
- package/package.json +4 -4
- package/radio-group/radio-group.d.ts +1 -1
- package/tabs/tabs.d.ts +1 -0
- package/tabs/tabs.js +2 -1
- package/utils/validator/validator-exceptions.d.ts +3 -0
- package/utils/validator/validator-exceptions.js +7 -0
package/message/README.md
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
# Message
|
|
1
|
+
# Message
|
|
2
|
+
|
|
3
|
+
## CSS dependencies
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import url("@uxf/ui/message/message.css");
|
|
7
|
+
@import url("@uxf/ui/dialog/dialog.css");
|
|
8
|
+
@import url("@uxf/ui/button/button.css");
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Implementation
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import {AppProps} from "next/app";
|
|
15
|
+
import {getMessageRef, Message} from "@uxf/ui/message";
|
|
16
|
+
|
|
17
|
+
function App(props: AppProps) {
|
|
18
|
+
return (
|
|
19
|
+
<UiContextProvider value={...}>
|
|
20
|
+
{props.children}
|
|
21
|
+
<Message ref={getMessageRef()}/>
|
|
22
|
+
</UiContextProvider>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
@@ -30,6 +30,7 @@ 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");
|
|
33
34
|
const slugify_1 = require("@uxf/core/utils/slugify");
|
|
34
35
|
const chip_1 = require("@uxf/ui/chip");
|
|
35
36
|
const use_async_loading_1 = require("@uxf/ui/hooks/use-async-loading");
|
|
@@ -39,6 +40,22 @@ const input_1 = require("@uxf/ui/input");
|
|
|
39
40
|
const label_1 = require("@uxf/ui/label");
|
|
40
41
|
const react_3 = __importStar(require("react"));
|
|
41
42
|
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";
|
|
42
59
|
exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
43
60
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
44
61
|
const isAsync = !!props.loadOptions;
|
|
@@ -77,7 +94,7 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
77
94
|
};
|
|
78
95
|
const handleInputKeyDown = (e) => {
|
|
79
96
|
if (e.key === "Backspace" && query === "" && selectedOptions.length > 0) {
|
|
80
|
-
|
|
97
|
+
handleInputKeyDownRecursion(selectedOptions, onRemove);
|
|
81
98
|
}
|
|
82
99
|
};
|
|
83
100
|
const handleInputChange = (e) => setQuery(e.target.value);
|
|
@@ -91,6 +108,12 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
91
108
|
? (_f = props.allOptionsSelectedMessage) !== null && _f !== void 0 ? _f : "Všechny možnosti jsou již vybrány"
|
|
92
109
|
: (_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno";
|
|
93
110
|
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
|
+
};
|
|
94
117
|
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) => {
|
|
95
118
|
var _a, _b;
|
|
96
119
|
const inputElement = (react_3.default.createElement(react_3.default.Fragment, null,
|
|
@@ -99,15 +122,14 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
99
122
|
props.leftElement && react_3.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
100
123
|
react_3.default.createElement("div", { className: "uxf-multi-combobox__selected-options" },
|
|
101
124
|
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))),
|
|
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 })),
|
|
125
|
+
react_3.default.createElement(react_2.Combobox.Input, { autoComplete: "off", className: "uxf-multi-combobox__input", onBlur: onBlur, onChange: handleInputChange, onKeyDown: handleInputKeyDown, placeholder: props.placeholder, type: "text", value: query })),
|
|
103
126
|
props.rightAddon && react_3.default.createElement(input_1.Input.RightAddon, null, props.rightAddon),
|
|
104
127
|
props.rightElement && react_3.default.createElement(input_1.Input.RightElement, null, props.rightElement),
|
|
105
128
|
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 })),
|
|
106
129
|
renderProps.open && (react_3.default.createElement(react_1.FloatingPortal, null,
|
|
107
130
|
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) => {
|
|
108
131
|
var _a, _b, _c, _d;
|
|
109
|
-
|
|
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)))));
|
|
132
|
+
return (react_3.default.createElement(OptionElement, { option: option, key: (_b = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option)) !== null && _b !== void 0 ? _b : option.id, label: (_d = (_c = props.renderOption) === null || _c === void 0 ? void 0 : _c.call(props, option)) !== null && _d !== void 0 ? _d : option.label, handleCheckboxChange: handleCheckboxChange(option.id), withCheckboxes: props.withCheckboxes, withoutPopover: withoutPopover }));
|
|
111
133
|
})) : (react_3.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, emptyMessage))))),
|
|
112
134
|
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))));
|
|
113
135
|
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": "11.0.0
|
|
3
|
+
"version": "11.0.0",
|
|
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": "
|
|
22
|
-
"@uxf/styles": "10.
|
|
20
|
+
"@uxf/core": "10.10.1",
|
|
21
|
+
"@uxf/datepicker": "11.0.0",
|
|
22
|
+
"@uxf/styles": "10.10.1",
|
|
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: ReactNode;
|
|
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,7 +62,8 @@ 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))))
|
|
65
|
+
}, key: `${tab.title}--${index}` }, tab.title)))),
|
|
66
|
+
props.customTabListContent),
|
|
66
67
|
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))))));
|
|
67
68
|
});
|
|
68
69
|
TabsRoot.displayName = "UxfUiTabs";
|
|
@@ -0,0 +1,7 @@
|
|
|
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 = {}));
|