@ozen-ui/kit 0.72.0 → 0.73.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/__inner__/cjs/components/Autocomplete/helper.d.ts +1 -1
- package/__inner__/cjs/components/AutocompleteBase/hooks/useAutocompleteBaseInputEvents/useAutocompleteBaseInputEvents.js +13 -0
- package/__inner__/cjs/components/AutocompleteBase/modules/AutocompleteBaseDropdown/constants.d.ts +1 -1
- package/__inner__/cjs/components/AutocompleteBase/modules/AutocompleteBaseInput/AutocompleteBaseInput.css +11 -14
- package/__inner__/cjs/components/AutocompleteBase/modules/AutocompleteBaseInput/components/AutocompleteBaseInputMultiple/AutocompleteBaseInputMultiple.js +4 -5
- package/__inner__/cjs/components/AutocompleteNext/Autocomplete.js +14 -0
- package/__inner__/cjs/components/AutocompleteNext/components/AutocompleteInput/AutocompleteInput.js +1 -1
- package/__inner__/cjs/components/AutocompleteNext/types.d.ts +7 -6
- package/__inner__/cjs/components/Card/types.d.ts +2 -1
- package/__inner__/cjs/components/DatePicker/components/DatePickerModeDateRange/DatePickerModeDateRange.js +5 -1
- package/__inner__/cjs/components/DatePicker/types.d.ts +1 -1
- package/__inner__/cjs/components/Popover/types.d.ts +1 -1
- package/__inner__/cjs/components/Table/Table.css +8 -0
- package/__inner__/cjs/components/Table/Table.js +2 -2
- package/__inner__/cjs/components/Table/components/TableBody/TableBody.js +2 -1
- package/__inner__/cjs/components/Table/components/TableContainer/types.d.ts +2 -1
- package/__inner__/cjs/components/Table/components/TableFoot/TableFoot.js +2 -1
- package/__inner__/cjs/components/Table/components/TableHead/TableHead.js +2 -1
- package/__inner__/cjs/components/Table/index.d.ts +1 -0
- package/__inner__/cjs/components/Table/index.js +1 -0
- package/__inner__/cjs/components/Table/types.d.ts +4 -0
- package/__inner__/cjs/components/Table/types.js +2 -1
- package/__inner__/cjs/components/TagNext/index.d.ts +1 -0
- package/__inner__/cjs/components/TagNext/index.js +1 -0
- package/__inner__/cjs/hooks/useBreakpointsNext/useBreakpoints.d.ts +1 -1
- package/__inner__/cjs/types/index.d.ts +10 -0
- package/__inner__/cjs/types/index.js +13 -0
- package/__inner__/cjs/types/object/withRequired.d.ts +1 -3
- package/__inner__/cjs/utils/index.d.ts +30 -0
- package/__inner__/cjs/utils/index.js +33 -0
- package/__inner__/esm/components/Autocomplete/helper.d.ts +1 -1
- package/__inner__/esm/components/AutocompleteBase/hooks/useAutocompleteBaseInputEvents/useAutocompleteBaseInputEvents.js +13 -0
- package/__inner__/esm/components/AutocompleteBase/modules/AutocompleteBaseDropdown/constants.d.ts +1 -1
- package/__inner__/esm/components/AutocompleteBase/modules/AutocompleteBaseInput/AutocompleteBaseInput.css +11 -14
- package/__inner__/esm/components/AutocompleteBase/modules/AutocompleteBaseInput/components/AutocompleteBaseInputMultiple/AutocompleteBaseInputMultiple.js +4 -5
- package/__inner__/esm/components/AutocompleteNext/Autocomplete.js +14 -0
- package/__inner__/esm/components/AutocompleteNext/components/AutocompleteInput/AutocompleteInput.js +1 -1
- package/__inner__/esm/components/AutocompleteNext/types.d.ts +7 -6
- package/__inner__/esm/components/Card/types.d.ts +2 -1
- package/__inner__/esm/components/DatePicker/components/DatePickerModeDateRange/DatePickerModeDateRange.js +5 -1
- package/__inner__/esm/components/DatePicker/types.d.ts +1 -1
- package/__inner__/esm/components/Popover/types.d.ts +1 -1
- package/__inner__/esm/components/Table/Table.css +8 -0
- package/__inner__/esm/components/Table/Table.js +2 -2
- package/__inner__/esm/components/Table/components/TableBody/TableBody.js +3 -2
- package/__inner__/esm/components/Table/components/TableContainer/types.d.ts +2 -1
- package/__inner__/esm/components/Table/components/TableFoot/TableFoot.js +3 -2
- package/__inner__/esm/components/Table/components/TableHead/TableHead.js +3 -2
- package/__inner__/esm/components/Table/index.d.ts +1 -0
- package/__inner__/esm/components/Table/index.js +1 -0
- package/__inner__/esm/components/Table/types.d.ts +4 -0
- package/__inner__/esm/components/Table/types.js +1 -0
- package/__inner__/esm/components/TagNext/index.d.ts +1 -0
- package/__inner__/esm/components/TagNext/index.js +1 -0
- package/__inner__/esm/hooks/useBreakpointsNext/useBreakpoints.d.ts +1 -1
- package/__inner__/esm/types/index.d.ts +10 -0
- package/__inner__/esm/types/index.js +10 -0
- package/__inner__/esm/types/object/withRequired.d.ts +1 -3
- package/__inner__/esm/utils/index.d.ts +30 -0
- package/__inner__/esm/utils/index.js +30 -0
- package/package.json +4 -4
- package/types/package.json +5 -0
- package/utils/package.json +5 -0
|
@@ -4,7 +4,7 @@ export declare const defaultGetOptionLabel: AutocompletePropGetOptionLabel<Autoc
|
|
|
4
4
|
export declare const defaultGetOptionDisabled: AutocompletePropGetOptionDisabled<AutocompleteDefaultOption>;
|
|
5
5
|
export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTION>): {
|
|
6
6
|
options: OPTION[];
|
|
7
|
-
size?: import("../../types
|
|
7
|
+
size?: import("../../types").FormElementSizeVariant;
|
|
8
8
|
value?: import("./types").AutocompletePropValue<OPTION>;
|
|
9
9
|
defaultValue?: import("./types").AutocompletePropValue<OPTION>;
|
|
10
10
|
open?: boolean;
|
|
@@ -38,6 +38,19 @@ var useAutocompleteBaseInputEvents = function (_a) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}, [observableValuesAllowCustomValueSync, allowCustomValue]);
|
|
41
|
+
var previousMultiple = (0, useStoredValue_1.useStoredValue)(multiple);
|
|
42
|
+
/** Исправляет баг, когда при переключении режимов "input" не сбрасывается */
|
|
43
|
+
(0, react_1.useEffect)(function () {
|
|
44
|
+
if (previousMultiple.current === multiple) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
var isFromSingleToMultiple = !previousMultiple.current && multiple;
|
|
48
|
+
if (isFromSingleToMultiple) {
|
|
49
|
+
lastInputValue.current = '';
|
|
50
|
+
inputControl.setValue(null, '');
|
|
51
|
+
}
|
|
52
|
+
previousMultiple.current = multiple;
|
|
53
|
+
}, [multiple]);
|
|
41
54
|
var onChange = function (event) {
|
|
42
55
|
var value = event.target.value;
|
|
43
56
|
// Открываем список при вводе первого символа (при условии, что список еще не открыт)
|
package/__inner__/cjs/components/AutocompleteBase/modules/AutocompleteBaseDropdown/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AUTOCOMPLETE_BASE_DROPDOWN_DEFAULT_TAG: import("../../../../utils
|
|
1
|
+
export declare const AUTOCOMPLETE_BASE_DROPDOWN_DEFAULT_TAG: import("../../../../utils").PolymorphicComponentWithRef<import("../../../Paper").PaperBaseProps, "div", "as">;
|
|
@@ -80,20 +80,6 @@
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
.AutocompleteBaseInput-Input_responsive {
|
|
84
|
-
flex-wrap: nowrap;
|
|
85
|
-
gap: unset;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/* ToDo. Tag */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.AutocompleteBaseInput-Input_responsive .AutocompleteBaseInput-Tag {
|
|
93
|
-
margin-inline-end: var(--spacing-3xs);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
83
|
.AutocompleteBaseInput-Input_multiple {
|
|
98
84
|
display: flex;
|
|
99
85
|
flex-wrap: wrap;
|
|
@@ -126,3 +112,14 @@
|
|
|
126
112
|
.AutocompleteBaseInput-Input_multiple * + input::placeholder, .AutocompleteBaseInput-Input_multiple input:focus::placeholder, .AutocompleteBaseInput-Input_multiple.AutocompleteBaseInput-Input_hasLabel * + input::placeholder, .AutocompleteBaseInput-Input_multiple.AutocompleteBaseInput-Input_hasLabel input:focus::placeholder {
|
|
127
113
|
opacity: 1;
|
|
128
114
|
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
.AutocompleteBaseInput-Input_responsive {
|
|
118
|
+
flex-wrap: nowrap;
|
|
119
|
+
gap: unset;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
.AutocompleteBaseInput-Input_responsive .AutocompleteBaseInput-Tag {
|
|
124
|
+
margin-inline-end: var(--spacing-3xs);
|
|
125
|
+
}
|
|
@@ -84,14 +84,13 @@ var AutocompleteInputMultipleRender = function (_a, ref) {
|
|
|
84
84
|
return renderTag(option, {
|
|
85
85
|
key: option.id,
|
|
86
86
|
label: option.label,
|
|
87
|
-
className: (0, classNames_1.cnAutocompleteBaseInput)('Tag'
|
|
87
|
+
className: (0, classNames_1.cnAutocompleteBaseInput)('Tag', {
|
|
88
|
+
hidden: (responsive || hasLimitTags) && !(visibleMap === null || visibleMap === void 0 ? void 0 : visibleMap[index]),
|
|
89
|
+
}),
|
|
88
90
|
disabled: option.disabled,
|
|
89
91
|
iconRight: function (_a) {
|
|
90
92
|
var size = _a.size;
|
|
91
|
-
return (react_1.default.createElement("span", { "aria-hidden": "true", "data-testid": "clear-tag", className: (0, classNames_1.cnAutocompleteBaseInput)('ClearTag', {
|
|
92
|
-
hidden: (responsive || hasLimitTags) && !(visibleMap === null || visibleMap === void 0 ? void 0 : visibleMap[index]),
|
|
93
|
-
disabled: option.disabled,
|
|
94
|
-
}), onClick: function (event) {
|
|
93
|
+
return (react_1.default.createElement("span", { "aria-hidden": "true", "data-testid": "clear-tag", className: (0, classNames_1.cnAutocompleteBaseInput)('ClearTag'), onClick: function (event) {
|
|
95
94
|
if (option.disabled) {
|
|
96
95
|
return;
|
|
97
96
|
}
|
|
@@ -8,6 +8,7 @@ var useControlled_1 = require("../../hooks/useControlled");
|
|
|
8
8
|
var useElementSize_1 = require("../../hooks/useElementSize");
|
|
9
9
|
var useMultiRef_1 = require("../../hooks/useMultiRef");
|
|
10
10
|
var useMutableRef_1 = require("../../hooks/useMutableRef");
|
|
11
|
+
var useStoredValue_1 = require("../../hooks/useStoredValue");
|
|
11
12
|
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
12
13
|
var classname_1 = require("../../utils/classname");
|
|
13
14
|
var isKeys_1 = require("../../utils/isKeys");
|
|
@@ -110,6 +111,19 @@ function AutocompleteRender(inProps, ref) {
|
|
|
110
111
|
changeInputValue(null, lastInputValue.current);
|
|
111
112
|
}
|
|
112
113
|
}, [valueState, allowCustomValue]);
|
|
114
|
+
var previousMultiple = (0, useStoredValue_1.useStoredValue)(multiple);
|
|
115
|
+
/** Исправляет баг, когда при переключении режимов "input" не сбрасывается */
|
|
116
|
+
(0, react_1.useEffect)(function () {
|
|
117
|
+
if (previousMultiple.current === multiple) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
var isFromSingleToMultiple = !previousMultiple.current && multiple;
|
|
121
|
+
if (isFromSingleToMultiple) {
|
|
122
|
+
lastInputValue.current = '';
|
|
123
|
+
changeInputValue(null, '');
|
|
124
|
+
}
|
|
125
|
+
previousMultiple.current = multiple;
|
|
126
|
+
}, [multiple]);
|
|
113
127
|
/** Эффект — автофокусировка в текстовом поле */
|
|
114
128
|
(0, react_1.useEffect)(function () {
|
|
115
129
|
var _a;
|
package/__inner__/cjs/components/AutocompleteNext/components/AutocompleteInput/AutocompleteInput.js
CHANGED
|
@@ -27,7 +27,7 @@ var AutocompleteInputRender = function (inProps, ref) {
|
|
|
27
27
|
}
|
|
28
28
|
if ((0, helpers_1.isMultipleParams)(inProps)) {
|
|
29
29
|
var selectedOptions_1 = inProps.selectedOptions;
|
|
30
|
-
return (react_1.default.createElement(components_1.AutocompleteInputMultiple, tslib_1.__assign({ label: label, renderTag: renderTag, limitTags: limitTags, onRemoveTag: onRemoveTag, getOptionKey: getOptionKey, renderMoreTag: renderMoreTag, getOptionLabel: getOptionLabel, getOptionDisabled: getOptionDisabled, selectedOptions: selectedOptions_1, ref: ref }, other)));
|
|
30
|
+
return (react_1.default.createElement(components_1.AutocompleteInputMultiple, tslib_1.__assign({ label: label, renderTag: renderTag, limitTags: limitTags, onRemoveTag: onRemoveTag, getOptionKey: getOptionKey, renderMoreTag: renderMoreTag, getOptionLabel: getOptionLabel, getOptionDisabled: getOptionDisabled, selectedOptions: selectedOptions_1, ref: ref, size: size }, other)));
|
|
31
31
|
}
|
|
32
32
|
return null;
|
|
33
33
|
};
|
|
@@ -6,14 +6,15 @@ import type { InputProps, InputRef } from '../Input';
|
|
|
6
6
|
import type { AutocompleteDropdownProps } from './components';
|
|
7
7
|
export declare const autocompleteRenderRightPosition: readonly ["before", "between", "after"];
|
|
8
8
|
export type AutocompleteRenderRightPosition = (typeof autocompleteRenderRightPosition)[number];
|
|
9
|
+
export type AutocompleteRenderOptionState = {
|
|
10
|
+
key?: string | number;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
focused?: boolean;
|
|
14
|
+
};
|
|
9
15
|
export type AutocompleteRenderOptionProps<OPTION> = {
|
|
10
16
|
option: OPTION;
|
|
11
|
-
state:
|
|
12
|
-
key?: string | number;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
focused?: boolean;
|
|
16
|
-
};
|
|
17
|
+
state: AutocompleteRenderOptionState;
|
|
17
18
|
props: HTMLAttributes<HTMLElement> & {
|
|
18
19
|
key?: string | number;
|
|
19
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementType, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentRef, ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
3
3
|
export declare const cardSizeVariant: readonly ["s", "m", "l"];
|
|
4
4
|
export declare const cardBorderWidthVariant: readonly ["none", "s", "m"];
|
|
@@ -33,3 +33,4 @@ export type CardBaseProps = {
|
|
|
33
33
|
'data-testid'?: string;
|
|
34
34
|
};
|
|
35
35
|
export type CardProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<CardBaseProps, As>;
|
|
36
|
+
export type CardRef<As extends ElementType = 'div'> = ComponentRef<As>;
|
|
@@ -18,7 +18,11 @@ var utils_1 = require("../../utils");
|
|
|
18
18
|
var index_2 = require("../index");
|
|
19
19
|
var utils_2 = require("./utils");
|
|
20
20
|
exports.DatePickerModeDateRange = (0, react_1.forwardRef)(function (props, ref) {
|
|
21
|
-
var size = props.size, error = props.error, openProp = props.open, label = props.label, onKeyDown = props.onKeyDown, onInputChange = props.onInputChange, renderLeft = props.renderLeft, renderRight = props.renderRight, required = props.required, fullWidth = props.fullWidth, placeholder = props.placeholder, hint = props.hint, disableStroke = props.disableStroke, hintProps = props.hintProps, onChange = props.onChange, labelProps = props.labelProps, popoverPropsProp = props.popoverProps, calendarPropsProp = props.calendarProps, defaultOpen = props.defaultOpen, onCloseProp = props.onClose, defaultValue = props.defaultValue, valueProp = props.value, inputProps = props.inputProps, disabled = props.disabled, className = props.className, _a = props.calendars, calendars = _a === void 0 ? 2 : _a, onError = props.onError, clearText = props.clearText, disableCloseOnSelect = props.disableCloseOnSelect, disableClearButton = props.disableClearButton, onOpenProp = props.onOpen, fieldsProps = props.fieldsProps,
|
|
21
|
+
var size = props.size, error = props.error, openProp = props.open, label = props.label, onKeyDown = props.onKeyDown, onInputChange = props.onInputChange, renderLeft = props.renderLeft, renderRight = props.renderRight, required = props.required, fullWidth = props.fullWidth, placeholder = props.placeholder, hint = props.hint, disableStroke = props.disableStroke, hintProps = props.hintProps, onChange = props.onChange, labelProps = props.labelProps, popoverPropsProp = props.popoverProps, calendarPropsProp = props.calendarProps, defaultOpen = props.defaultOpen, onCloseProp = props.onClose, defaultValue = props.defaultValue, valueProp = props.value, inputProps = props.inputProps, disabled = props.disabled, className = props.className, _a = props.calendars, calendars = _a === void 0 ? 2 : _a, onError = props.onError, clearText = props.clearText, disableCloseOnSelect = props.disableCloseOnSelect, disableClearButton = props.disableClearButton, onOpenProp = props.onOpen, fieldsProps = props.fieldsProps,
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
+
minDate = props.minDate,
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
|
+
maxDate = props.maxDate, other = tslib_1.__rest(props, ["size", "error", "open", "label", "onKeyDown", "onInputChange", "renderLeft", "renderRight", "required", "fullWidth", "placeholder", "hint", "disableStroke", "hintProps", "onChange", "labelProps", "popoverProps", "calendarProps", "defaultOpen", "onClose", "defaultValue", "value", "inputProps", "disabled", "className", "calendars", "onError", "clearText", "disableCloseOnSelect", "disableClearButton", "onOpen", "fieldsProps", "minDate", "maxDate"]);
|
|
22
26
|
var _b = tslib_1.__read((0, utils_2.getValueForDoubleProp)(label), 2), labelFrom = _b[0], labelTo = _b[1];
|
|
23
27
|
var _c = tslib_1.__read((0, utils_2.getValueForDoubleProp)(renderLeft), 2), renderLeftFrom = _c[0], renderLeftTo = _c[1];
|
|
24
28
|
var _d = tslib_1.__read((0, utils_2.getValueForDoubleProp)(renderRight), 2), renderRightFrom = _d[0], renderRightTo = _d[1];
|
|
@@ -105,7 +105,7 @@ export type DatePickerProps<MODE extends DatePickerModeVariant = typeof DATE_PIC
|
|
|
105
105
|
disableStroke?: boolean;
|
|
106
106
|
/** Если `true` переводит поле в состояние ошибки */
|
|
107
107
|
error?: boolean;
|
|
108
|
-
/** Свойства обертки для текстовых полей. Принимает свойства компонента [Stack](https://ozen-ui.
|
|
108
|
+
/** Свойства обертки для текстовых полей. Принимает свойства компонента [Stack](https://ozen-ui.bereke.tech/?path=/docs/components-stack--docs) */
|
|
109
109
|
fieldsProps?: DatePickerPropFieldsProps<MODE>;
|
|
110
110
|
/** Количество отображаемых календарей в компоненте: один или два */
|
|
111
111
|
calendars?: 1 | 2;
|
|
@@ -21,7 +21,7 @@ export type PopoverBaseProps = {
|
|
|
21
21
|
open?: boolean;
|
|
22
22
|
/** Ссылка на элемент, относительно которого будет позиционироваться поповер */
|
|
23
23
|
anchorRef?: RefObject<HTMLElement>;
|
|
24
|
-
/** Список ссылок на элементы при клике на которые Popover не будет закрываться (см. хук [useClickOutside](https://ozen-ui.
|
|
24
|
+
/** Список ссылок на элементы при клике на которые Popover не будет закрываться (см. хук [useClickOutside](https://ozen-ui.bereke.tech/?path=/docs/hooks-useclickoutside--docs)) */
|
|
25
25
|
ignoreClickOutsideRefs?: Array<RefObject<HTMLElement>>;
|
|
26
26
|
/** Позиция, относительно которой будет позиционироваться поповер */
|
|
27
27
|
position?: {
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
inline-size: 100%;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.Table_layout_auto {
|
|
12
|
+
table-layout: auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.Table_layout_fixed {
|
|
16
|
+
table-layout: fixed;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
.Table_size_xs {
|
|
12
20
|
--table-header-cell-text: var(--typography-text-3xs-font);
|
|
13
21
|
--table-header-cell-padding: 16px 12px 8px;
|
|
@@ -9,7 +9,7 @@ require("./Table.css");
|
|
|
9
9
|
var constants_1 = require("./constants");
|
|
10
10
|
exports.cnTable = (0, classname_1.cn)('Table');
|
|
11
11
|
exports.Table = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
12
|
-
var _a = (0, useThemeProps_1.useThemeProps)({ name: 'Table', props: inProps }), _b = _a.size, size = _b === void 0 ? constants_1.TABLE_DEFAULT_SIZE : _b, _c = _a.divider, divider = _c === void 0 ? constants_1.TABLE_DEFAULT_DIVIDER : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? constants_1.TABLE_DEFAULT_FULL_WIDTH : _d, _e = _a.stickyHeader, stickyHeader = _e === void 0 ? constants_1.TABLE_DEFAULT_STICKY_HEADER : _e, _f = _a.compressed, compressed = _f === void 0 ? constants_1.TABLE_DEFAULT_COMPRESSED : _f, _g = _a.striped, striped = _g === void 0 ? constants_1.TABLE_DEFAULT_STRIPED : _g, children = _a.children, className = _a.className, other = tslib_1.__rest(_a, ["size", "divider", "fullWidth", "stickyHeader", "compressed", "striped", "children", "className"]);
|
|
13
|
-
return (react_1.default.createElement("table", tslib_1.__assign({ className: (0, exports.cnTable)({ compressed: compressed, size: size, stickyHeader: stickyHeader, fullWidth: fullWidth, divider: divider, striped: striped }, [className]) }, other, { ref: ref }), children));
|
|
12
|
+
var _a = (0, useThemeProps_1.useThemeProps)({ name: 'Table', props: inProps }), _b = _a.size, size = _b === void 0 ? constants_1.TABLE_DEFAULT_SIZE : _b, _c = _a.divider, divider = _c === void 0 ? constants_1.TABLE_DEFAULT_DIVIDER : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? constants_1.TABLE_DEFAULT_FULL_WIDTH : _d, _e = _a.stickyHeader, stickyHeader = _e === void 0 ? constants_1.TABLE_DEFAULT_STICKY_HEADER : _e, _f = _a.compressed, compressed = _f === void 0 ? constants_1.TABLE_DEFAULT_COMPRESSED : _f, _g = _a.striped, striped = _g === void 0 ? constants_1.TABLE_DEFAULT_STRIPED : _g, layout = _a.layout, children = _a.children, className = _a.className, other = tslib_1.__rest(_a, ["size", "divider", "fullWidth", "stickyHeader", "compressed", "striped", "layout", "children", "className"]);
|
|
13
|
+
return (react_1.default.createElement("table", tslib_1.__assign({ className: (0, exports.cnTable)({ compressed: compressed, size: size, stickyHeader: stickyHeader, fullWidth: fullWidth, divider: divider, striped: striped, layout: layout }, [className]) }, other, { ref: ref }), children));
|
|
14
14
|
});
|
|
15
15
|
exports.Table.displayName = 'Table';
|
|
@@ -8,7 +8,8 @@ var TableContext_1 = require("../../TableContext");
|
|
|
8
8
|
exports.cnTableBody = (0, classname_1.cn)('TableBody');
|
|
9
9
|
exports.TableBody = (0, react_1.forwardRef)(function (_a, ref) {
|
|
10
10
|
var children = _a.children, className = _a.className, other = tslib_1.__rest(_a, ["children", "className"]);
|
|
11
|
-
|
|
11
|
+
var memoizedContext = (0, react_1.useMemo)(function () { return ({ variant: 'body' }); }, []);
|
|
12
|
+
return (react_1.default.createElement(TableContext_1.TableContext.Provider, { value: memoizedContext },
|
|
12
13
|
react_1.default.createElement("tbody", tslib_1.__assign({ className: (0, exports.cnTableBody)('', [className]) }, other, { ref: ref }), children)));
|
|
13
14
|
});
|
|
14
15
|
exports.TableBody.displayName = 'TableBody';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, ElementType, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentRef, CSSProperties, ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
3
|
import type { TABLE_CONTAINER_DEFAULT_TAG } from './constants';
|
|
4
4
|
export type TableContainerBaseProps = {
|
|
@@ -16,3 +16,4 @@ export type TableContainerBaseProps = {
|
|
|
16
16
|
'data-testid'?: string;
|
|
17
17
|
};
|
|
18
18
|
export type TableContainerProps<As extends ElementType = typeof TABLE_CONTAINER_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TableContainerBaseProps, As>;
|
|
19
|
+
export type TableContainerRef<As extends ElementType = typeof TABLE_CONTAINER_DEFAULT_TAG> = ComponentRef<As>;
|
|
@@ -8,7 +8,8 @@ var TableContext_1 = require("../../TableContext");
|
|
|
8
8
|
exports.cnTableFoot = (0, classname_1.cn)('TableFoot');
|
|
9
9
|
exports.TableFoot = (0, react_1.forwardRef)(function (_a, ref) {
|
|
10
10
|
var children = _a.children, className = _a.className, other = tslib_1.__rest(_a, ["children", "className"]);
|
|
11
|
-
|
|
11
|
+
var memoizedContext = (0, react_1.useMemo)(function () { return ({ variant: 'foot' }); }, []);
|
|
12
|
+
return (react_1.default.createElement(TableContext_1.TableContext.Provider, { value: memoizedContext },
|
|
12
13
|
react_1.default.createElement("tfoot", tslib_1.__assign({ className: (0, exports.cnTableFoot)({}, [className]) }, other, { ref: ref }), children)));
|
|
13
14
|
});
|
|
14
15
|
exports.TableFoot.displayName = 'TableFoot';
|
|
@@ -8,7 +8,8 @@ var TableContext_1 = require("../../TableContext");
|
|
|
8
8
|
exports.cnTableHead = (0, classname_1.cn)('TableHead');
|
|
9
9
|
exports.TableHead = (0, react_1.forwardRef)(function (_a, ref) {
|
|
10
10
|
var children = _a.children, className = _a.className, other = tslib_1.__rest(_a, ["children", "className"]);
|
|
11
|
-
|
|
11
|
+
var memoizedContext = (0, react_1.useMemo)(function () { return ({ variant: 'head' }); }, []);
|
|
12
|
+
return (react_1.default.createElement(TableContext_1.TableContext.Provider, { value: memoizedContext },
|
|
12
13
|
react_1.default.createElement("thead", tslib_1.__assign({ className: (0, exports.cnTableHead)({}, [className]) }, other, { ref: ref }), children)));
|
|
13
14
|
});
|
|
14
15
|
exports.TableHead.displayName = 'TableHead';
|
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./Table"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./components"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./TableContext"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -2,14 +2,18 @@ import type { ComponentRef, ReactNode } from 'react';
|
|
|
2
2
|
import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
|
|
3
3
|
export declare const tableSizeVariant: readonly ["xs", "s", "m", "l"];
|
|
4
4
|
export declare const tableDividerVariant: readonly ["row", "column", "all"];
|
|
5
|
+
export declare const tableLayoutVariant: readonly ["auto", "fixed"];
|
|
5
6
|
export type TableSizeVariant = (typeof tableSizeVariant)[number];
|
|
6
7
|
export type TableDividerVariant = (typeof tableDividerVariant)[number];
|
|
8
|
+
export type TableLayoutVariant = (typeof tableLayoutVariant)[number];
|
|
7
9
|
export type TableRef = ComponentRef<'table'>;
|
|
8
10
|
export type TableProps = ExtendableComponentPropsWithRef<{
|
|
9
11
|
/** Устанавливает размер типографики и отступов в таблице */
|
|
10
12
|
size?: TableSizeVariant;
|
|
11
13
|
/** Признак, по которому таблица растет по всей ширине своего контейнера */
|
|
12
14
|
fullWidth?: boolean;
|
|
15
|
+
/** Вариант layout-таблицы */
|
|
16
|
+
layout?: TableLayoutVariant;
|
|
13
17
|
/** Тип разделителей в таблице */
|
|
14
18
|
divider?: TableDividerVariant;
|
|
15
19
|
/** Признак фиксированного заголовка в таблице */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tableDividerVariant = exports.tableSizeVariant = void 0;
|
|
3
|
+
exports.tableLayoutVariant = exports.tableDividerVariant = exports.tableSizeVariant = void 0;
|
|
4
4
|
exports.tableSizeVariant = ['xs', 's', 'm', 'l'];
|
|
5
5
|
exports.tableDividerVariant = ['row', 'column', 'all'];
|
|
6
|
+
exports.tableLayoutVariant = ['auto', 'fixed'];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./Tag"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./types"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useBreakpoints(): import("../../types
|
|
1
|
+
export declare function useBreakpoints(): import("../../types").BreakpointMatches;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './css';
|
|
2
|
+
export * from './function';
|
|
3
|
+
export * from './object';
|
|
4
|
+
export * from './react';
|
|
5
|
+
export * from './Breakpoints';
|
|
6
|
+
export * from './ExtendableComponentPropsWithRef';
|
|
7
|
+
export * from './ExtendableProps';
|
|
8
|
+
export * from './FormElementSizeVariant';
|
|
9
|
+
export * from './KeyCode';
|
|
10
|
+
export * from './ResponsiveValue';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./css"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./function"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./object"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./react"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./Breakpoints"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./ExtendableComponentPropsWithRef"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./ExtendableProps"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./FormElementSizeVariant"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./KeyCode"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./ResponsiveValue"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './array';
|
|
2
|
+
export * from './breakpoint';
|
|
3
|
+
export * from './capitalizeFirstLetter';
|
|
4
|
+
export * from './css';
|
|
5
|
+
export * from './date';
|
|
6
|
+
export * from './generateUniqKey';
|
|
7
|
+
export * from './getByMap';
|
|
8
|
+
export * from './getScrollBarSize';
|
|
9
|
+
export * from './math';
|
|
10
|
+
export * from './number';
|
|
11
|
+
export * from './object';
|
|
12
|
+
export * from './react';
|
|
13
|
+
export * from './renderContent';
|
|
14
|
+
export * from './shallowEqual';
|
|
15
|
+
export * from './string';
|
|
16
|
+
export * from './animateProperty';
|
|
17
|
+
export * from './classname';
|
|
18
|
+
export * from './getFocusableElements';
|
|
19
|
+
export * from './getIconSizeToFormElement';
|
|
20
|
+
export * from './getNextIndex';
|
|
21
|
+
export * from './getPaperSizeToFormElement';
|
|
22
|
+
export * from './getPrevIndex';
|
|
23
|
+
export * from './isFunction';
|
|
24
|
+
export * from './isKey';
|
|
25
|
+
export * from './isKeys';
|
|
26
|
+
export * from './isNotNil';
|
|
27
|
+
export * from './isString';
|
|
28
|
+
export * from './polymorphicComponentWithRef';
|
|
29
|
+
export * from './scrollContainerToElement';
|
|
30
|
+
export * from './setRef';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./array"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./breakpoint"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./capitalizeFirstLetter"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./css"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./date"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./generateUniqKey"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./getByMap"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./getScrollBarSize"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./math"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./number"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./object"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./react"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./renderContent"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./shallowEqual"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./string"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./animateProperty"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./classname"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./getFocusableElements"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./getIconSizeToFormElement"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./getNextIndex"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./getPaperSizeToFormElement"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./getPrevIndex"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./isFunction"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./isKey"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./isKeys"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./isNotNil"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./isString"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./polymorphicComponentWithRef"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./scrollContainerToElement"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./setRef"), exports);
|
|
@@ -4,7 +4,7 @@ export declare const defaultGetOptionLabel: AutocompletePropGetOptionLabel<Autoc
|
|
|
4
4
|
export declare const defaultGetOptionDisabled: AutocompletePropGetOptionDisabled<AutocompleteDefaultOption>;
|
|
5
5
|
export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTION>): {
|
|
6
6
|
options: OPTION[];
|
|
7
|
-
size?: import("../../types
|
|
7
|
+
size?: import("../../types").FormElementSizeVariant;
|
|
8
8
|
value?: import("./types").AutocompletePropValue<OPTION>;
|
|
9
9
|
defaultValue?: import("./types").AutocompletePropValue<OPTION>;
|
|
10
10
|
open?: boolean;
|
|
@@ -35,6 +35,19 @@ export var useAutocompleteBaseInputEvents = function (_a) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}, [observableValuesAllowCustomValueSync, allowCustomValue]);
|
|
38
|
+
var previousMultiple = useStoredValue(multiple);
|
|
39
|
+
/** Исправляет баг, когда при переключении режимов "input" не сбрасывается */
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
if (previousMultiple.current === multiple) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
var isFromSingleToMultiple = !previousMultiple.current && multiple;
|
|
45
|
+
if (isFromSingleToMultiple) {
|
|
46
|
+
lastInputValue.current = '';
|
|
47
|
+
inputControl.setValue(null, '');
|
|
48
|
+
}
|
|
49
|
+
previousMultiple.current = multiple;
|
|
50
|
+
}, [multiple]);
|
|
38
51
|
var onChange = function (event) {
|
|
39
52
|
var value = event.target.value;
|
|
40
53
|
// Открываем список при вводе первого символа (при условии, что список еще не открыт)
|
package/__inner__/esm/components/AutocompleteBase/modules/AutocompleteBaseDropdown/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AUTOCOMPLETE_BASE_DROPDOWN_DEFAULT_TAG: import("../../../../utils
|
|
1
|
+
export declare const AUTOCOMPLETE_BASE_DROPDOWN_DEFAULT_TAG: import("../../../../utils").PolymorphicComponentWithRef<import("../../../Paper").PaperBaseProps, "div", "as">;
|
|
@@ -80,20 +80,6 @@
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
.AutocompleteBaseInput-Input_responsive {
|
|
84
|
-
flex-wrap: nowrap;
|
|
85
|
-
gap: unset;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/* ToDo. Tag */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.AutocompleteBaseInput-Input_responsive .AutocompleteBaseInput-Tag {
|
|
93
|
-
margin-inline-end: var(--spacing-3xs);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
83
|
.AutocompleteBaseInput-Input_multiple {
|
|
98
84
|
display: flex;
|
|
99
85
|
flex-wrap: wrap;
|
|
@@ -126,3 +112,14 @@
|
|
|
126
112
|
.AutocompleteBaseInput-Input_multiple * + input::placeholder, .AutocompleteBaseInput-Input_multiple input:focus::placeholder, .AutocompleteBaseInput-Input_multiple.AutocompleteBaseInput-Input_hasLabel * + input::placeholder, .AutocompleteBaseInput-Input_multiple.AutocompleteBaseInput-Input_hasLabel input:focus::placeholder {
|
|
127
113
|
opacity: 1;
|
|
128
114
|
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
.AutocompleteBaseInput-Input_responsive {
|
|
118
|
+
flex-wrap: nowrap;
|
|
119
|
+
gap: unset;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
.AutocompleteBaseInput-Input_responsive .AutocompleteBaseInput-Tag {
|
|
124
|
+
margin-inline-end: var(--spacing-3xs);
|
|
125
|
+
}
|
|
@@ -81,14 +81,13 @@ var AutocompleteInputMultipleRender = function (_a, ref) {
|
|
|
81
81
|
return renderTag(option, {
|
|
82
82
|
key: option.id,
|
|
83
83
|
label: option.label,
|
|
84
|
-
className: cnAutocompleteBaseInput('Tag'
|
|
84
|
+
className: cnAutocompleteBaseInput('Tag', {
|
|
85
|
+
hidden: (responsive || hasLimitTags) && !(visibleMap === null || visibleMap === void 0 ? void 0 : visibleMap[index]),
|
|
86
|
+
}),
|
|
85
87
|
disabled: option.disabled,
|
|
86
88
|
iconRight: function (_a) {
|
|
87
89
|
var size = _a.size;
|
|
88
|
-
return (React.createElement("span", { "aria-hidden": "true", "data-testid": "clear-tag", className: cnAutocompleteBaseInput('ClearTag', {
|
|
89
|
-
hidden: (responsive || hasLimitTags) && !(visibleMap === null || visibleMap === void 0 ? void 0 : visibleMap[index]),
|
|
90
|
-
disabled: option.disabled,
|
|
91
|
-
}), onClick: function (event) {
|
|
90
|
+
return (React.createElement("span", { "aria-hidden": "true", "data-testid": "clear-tag", className: cnAutocompleteBaseInput('ClearTag'), onClick: function (event) {
|
|
92
91
|
if (option.disabled) {
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
@@ -5,6 +5,7 @@ import { useControlled } from '../../hooks/useControlled';
|
|
|
5
5
|
import { useElementSize } from '../../hooks/useElementSize';
|
|
6
6
|
import { useMultiRef } from '../../hooks/useMultiRef';
|
|
7
7
|
import { useMutableRef } from '../../hooks/useMutableRef';
|
|
8
|
+
import { useStoredValue } from '../../hooks/useStoredValue';
|
|
8
9
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
9
10
|
import { cn } from '../../utils/classname';
|
|
10
11
|
import { isKeys } from '../../utils/isKeys';
|
|
@@ -107,6 +108,19 @@ function AutocompleteRender(inProps, ref) {
|
|
|
107
108
|
changeInputValue(null, lastInputValue.current);
|
|
108
109
|
}
|
|
109
110
|
}, [valueState, allowCustomValue]);
|
|
111
|
+
var previousMultiple = useStoredValue(multiple);
|
|
112
|
+
/** Исправляет баг, когда при переключении режимов "input" не сбрасывается */
|
|
113
|
+
useEffect(function () {
|
|
114
|
+
if (previousMultiple.current === multiple) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
var isFromSingleToMultiple = !previousMultiple.current && multiple;
|
|
118
|
+
if (isFromSingleToMultiple) {
|
|
119
|
+
lastInputValue.current = '';
|
|
120
|
+
changeInputValue(null, '');
|
|
121
|
+
}
|
|
122
|
+
previousMultiple.current = multiple;
|
|
123
|
+
}, [multiple]);
|
|
110
124
|
/** Эффект — автофокусировка в текстовом поле */
|
|
111
125
|
useEffect(function () {
|
|
112
126
|
var _a;
|
package/__inner__/esm/components/AutocompleteNext/components/AutocompleteInput/AutocompleteInput.js
CHANGED
|
@@ -24,7 +24,7 @@ var AutocompleteInputRender = function (inProps, ref) {
|
|
|
24
24
|
}
|
|
25
25
|
if (isMultipleParams(inProps)) {
|
|
26
26
|
var selectedOptions_1 = inProps.selectedOptions;
|
|
27
|
-
return (React.createElement(AutocompleteInputMultiple, __assign({ label: label, renderTag: renderTag, limitTags: limitTags, onRemoveTag: onRemoveTag, getOptionKey: getOptionKey, renderMoreTag: renderMoreTag, getOptionLabel: getOptionLabel, getOptionDisabled: getOptionDisabled, selectedOptions: selectedOptions_1, ref: ref }, other)));
|
|
27
|
+
return (React.createElement(AutocompleteInputMultiple, __assign({ label: label, renderTag: renderTag, limitTags: limitTags, onRemoveTag: onRemoveTag, getOptionKey: getOptionKey, renderMoreTag: renderMoreTag, getOptionLabel: getOptionLabel, getOptionDisabled: getOptionDisabled, selectedOptions: selectedOptions_1, ref: ref, size: size }, other)));
|
|
28
28
|
}
|
|
29
29
|
return null;
|
|
30
30
|
};
|
|
@@ -6,14 +6,15 @@ import type { InputProps, InputRef } from '../Input';
|
|
|
6
6
|
import type { AutocompleteDropdownProps } from './components';
|
|
7
7
|
export declare const autocompleteRenderRightPosition: readonly ["before", "between", "after"];
|
|
8
8
|
export type AutocompleteRenderRightPosition = (typeof autocompleteRenderRightPosition)[number];
|
|
9
|
+
export type AutocompleteRenderOptionState = {
|
|
10
|
+
key?: string | number;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
focused?: boolean;
|
|
14
|
+
};
|
|
9
15
|
export type AutocompleteRenderOptionProps<OPTION> = {
|
|
10
16
|
option: OPTION;
|
|
11
|
-
state:
|
|
12
|
-
key?: string | number;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
focused?: boolean;
|
|
16
|
-
};
|
|
17
|
+
state: AutocompleteRenderOptionState;
|
|
17
18
|
props: HTMLAttributes<HTMLElement> & {
|
|
18
19
|
key?: string | number;
|
|
19
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementType, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentRef, ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
3
3
|
export declare const cardSizeVariant: readonly ["s", "m", "l"];
|
|
4
4
|
export declare const cardBorderWidthVariant: readonly ["none", "s", "m"];
|
|
@@ -33,3 +33,4 @@ export type CardBaseProps = {
|
|
|
33
33
|
'data-testid'?: string;
|
|
34
34
|
};
|
|
35
35
|
export type CardProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<CardBaseProps, As>;
|
|
36
|
+
export type CardRef<As extends ElementType = 'div'> = ComponentRef<As>;
|
|
@@ -15,7 +15,11 @@ import { formatDateToString, formatStringToDate, getCommonCalendarProps, getComm
|
|
|
15
15
|
import { DateInput, DatePickerRenderRight } from '../index';
|
|
16
16
|
import { formatDateForCalendar, getOffsetDateInRange, getValueForDoubleProp, } from './utils';
|
|
17
17
|
export var DatePickerModeDateRange = forwardRef(function (props, ref) {
|
|
18
|
-
var size = props.size, error = props.error, openProp = props.open, label = props.label, onKeyDown = props.onKeyDown, onInputChange = props.onInputChange, renderLeft = props.renderLeft, renderRight = props.renderRight, required = props.required, fullWidth = props.fullWidth, placeholder = props.placeholder, hint = props.hint, disableStroke = props.disableStroke, hintProps = props.hintProps, onChange = props.onChange, labelProps = props.labelProps, popoverPropsProp = props.popoverProps, calendarPropsProp = props.calendarProps, defaultOpen = props.defaultOpen, onCloseProp = props.onClose, defaultValue = props.defaultValue, valueProp = props.value, inputProps = props.inputProps, disabled = props.disabled, className = props.className, _a = props.calendars, calendars = _a === void 0 ? 2 : _a, onError = props.onError, clearText = props.clearText, disableCloseOnSelect = props.disableCloseOnSelect, disableClearButton = props.disableClearButton, onOpenProp = props.onOpen, fieldsProps = props.fieldsProps,
|
|
18
|
+
var size = props.size, error = props.error, openProp = props.open, label = props.label, onKeyDown = props.onKeyDown, onInputChange = props.onInputChange, renderLeft = props.renderLeft, renderRight = props.renderRight, required = props.required, fullWidth = props.fullWidth, placeholder = props.placeholder, hint = props.hint, disableStroke = props.disableStroke, hintProps = props.hintProps, onChange = props.onChange, labelProps = props.labelProps, popoverPropsProp = props.popoverProps, calendarPropsProp = props.calendarProps, defaultOpen = props.defaultOpen, onCloseProp = props.onClose, defaultValue = props.defaultValue, valueProp = props.value, inputProps = props.inputProps, disabled = props.disabled, className = props.className, _a = props.calendars, calendars = _a === void 0 ? 2 : _a, onError = props.onError, clearText = props.clearText, disableCloseOnSelect = props.disableCloseOnSelect, disableClearButton = props.disableClearButton, onOpenProp = props.onOpen, fieldsProps = props.fieldsProps,
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
minDate = props.minDate,
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
+
maxDate = props.maxDate, other = __rest(props, ["size", "error", "open", "label", "onKeyDown", "onInputChange", "renderLeft", "renderRight", "required", "fullWidth", "placeholder", "hint", "disableStroke", "hintProps", "onChange", "labelProps", "popoverProps", "calendarProps", "defaultOpen", "onClose", "defaultValue", "value", "inputProps", "disabled", "className", "calendars", "onError", "clearText", "disableCloseOnSelect", "disableClearButton", "onOpen", "fieldsProps", "minDate", "maxDate"]);
|
|
19
23
|
var _b = __read(getValueForDoubleProp(label), 2), labelFrom = _b[0], labelTo = _b[1];
|
|
20
24
|
var _c = __read(getValueForDoubleProp(renderLeft), 2), renderLeftFrom = _c[0], renderLeftTo = _c[1];
|
|
21
25
|
var _d = __read(getValueForDoubleProp(renderRight), 2), renderRightFrom = _d[0], renderRightTo = _d[1];
|
|
@@ -105,7 +105,7 @@ export type DatePickerProps<MODE extends DatePickerModeVariant = typeof DATE_PIC
|
|
|
105
105
|
disableStroke?: boolean;
|
|
106
106
|
/** Если `true` переводит поле в состояние ошибки */
|
|
107
107
|
error?: boolean;
|
|
108
|
-
/** Свойства обертки для текстовых полей. Принимает свойства компонента [Stack](https://ozen-ui.
|
|
108
|
+
/** Свойства обертки для текстовых полей. Принимает свойства компонента [Stack](https://ozen-ui.bereke.tech/?path=/docs/components-stack--docs) */
|
|
109
109
|
fieldsProps?: DatePickerPropFieldsProps<MODE>;
|
|
110
110
|
/** Количество отображаемых календарей в компоненте: один или два */
|
|
111
111
|
calendars?: 1 | 2;
|
|
@@ -21,7 +21,7 @@ export type PopoverBaseProps = {
|
|
|
21
21
|
open?: boolean;
|
|
22
22
|
/** Ссылка на элемент, относительно которого будет позиционироваться поповер */
|
|
23
23
|
anchorRef?: RefObject<HTMLElement>;
|
|
24
|
-
/** Список ссылок на элементы при клике на которые Popover не будет закрываться (см. хук [useClickOutside](https://ozen-ui.
|
|
24
|
+
/** Список ссылок на элементы при клике на которые Popover не будет закрываться (см. хук [useClickOutside](https://ozen-ui.bereke.tech/?path=/docs/hooks-useclickoutside--docs)) */
|
|
25
25
|
ignoreClickOutsideRefs?: Array<RefObject<HTMLElement>>;
|
|
26
26
|
/** Позиция, относительно которой будет позиционироваться поповер */
|
|
27
27
|
position?: {
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
inline-size: 100%;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.Table_layout_auto {
|
|
12
|
+
table-layout: auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.Table_layout_fixed {
|
|
16
|
+
table-layout: fixed;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
.Table_size_xs {
|
|
12
20
|
--table-header-cell-text: var(--typography-text-3xs-font);
|
|
13
21
|
--table-header-cell-padding: 16px 12px 8px;
|
|
@@ -6,7 +6,7 @@ import './Table.css';
|
|
|
6
6
|
import { TABLE_DEFAULT_COMPRESSED, TABLE_DEFAULT_DIVIDER, TABLE_DEFAULT_FULL_WIDTH, TABLE_DEFAULT_SIZE, TABLE_DEFAULT_STICKY_HEADER, TABLE_DEFAULT_STRIPED, } from './constants';
|
|
7
7
|
export var cnTable = cn('Table');
|
|
8
8
|
export var Table = forwardRef(function (inProps, ref) {
|
|
9
|
-
var _a = useThemeProps({ name: 'Table', props: inProps }), _b = _a.size, size = _b === void 0 ? TABLE_DEFAULT_SIZE : _b, _c = _a.divider, divider = _c === void 0 ? TABLE_DEFAULT_DIVIDER : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? TABLE_DEFAULT_FULL_WIDTH : _d, _e = _a.stickyHeader, stickyHeader = _e === void 0 ? TABLE_DEFAULT_STICKY_HEADER : _e, _f = _a.compressed, compressed = _f === void 0 ? TABLE_DEFAULT_COMPRESSED : _f, _g = _a.striped, striped = _g === void 0 ? TABLE_DEFAULT_STRIPED : _g, children = _a.children, className = _a.className, other = __rest(_a, ["size", "divider", "fullWidth", "stickyHeader", "compressed", "striped", "children", "className"]);
|
|
10
|
-
return (React.createElement("table", __assign({ className: cnTable({ compressed: compressed, size: size, stickyHeader: stickyHeader, fullWidth: fullWidth, divider: divider, striped: striped }, [className]) }, other, { ref: ref }), children));
|
|
9
|
+
var _a = useThemeProps({ name: 'Table', props: inProps }), _b = _a.size, size = _b === void 0 ? TABLE_DEFAULT_SIZE : _b, _c = _a.divider, divider = _c === void 0 ? TABLE_DEFAULT_DIVIDER : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? TABLE_DEFAULT_FULL_WIDTH : _d, _e = _a.stickyHeader, stickyHeader = _e === void 0 ? TABLE_DEFAULT_STICKY_HEADER : _e, _f = _a.compressed, compressed = _f === void 0 ? TABLE_DEFAULT_COMPRESSED : _f, _g = _a.striped, striped = _g === void 0 ? TABLE_DEFAULT_STRIPED : _g, layout = _a.layout, children = _a.children, className = _a.className, other = __rest(_a, ["size", "divider", "fullWidth", "stickyHeader", "compressed", "striped", "layout", "children", "className"]);
|
|
10
|
+
return (React.createElement("table", __assign({ className: cnTable({ compressed: compressed, size: size, stickyHeader: stickyHeader, fullWidth: fullWidth, divider: divider, striped: striped, layout: layout }, [className]) }, other, { ref: ref }), children));
|
|
11
11
|
});
|
|
12
12
|
Table.displayName = 'Table';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { cn } from '../../../../utils/classname';
|
|
4
4
|
import { TableContext } from '../../TableContext';
|
|
5
5
|
export var cnTableBody = cn('TableBody');
|
|
6
6
|
export var TableBody = forwardRef(function (_a, ref) {
|
|
7
7
|
var children = _a.children, className = _a.className, other = __rest(_a, ["children", "className"]);
|
|
8
|
-
|
|
8
|
+
var memoizedContext = useMemo(function () { return ({ variant: 'body' }); }, []);
|
|
9
|
+
return (React.createElement(TableContext.Provider, { value: memoizedContext },
|
|
9
10
|
React.createElement("tbody", __assign({ className: cnTableBody('', [className]) }, other, { ref: ref }), children)));
|
|
10
11
|
});
|
|
11
12
|
TableBody.displayName = 'TableBody';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, ElementType, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentRef, CSSProperties, ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
3
|
import type { TABLE_CONTAINER_DEFAULT_TAG } from './constants';
|
|
4
4
|
export type TableContainerBaseProps = {
|
|
@@ -16,3 +16,4 @@ export type TableContainerBaseProps = {
|
|
|
16
16
|
'data-testid'?: string;
|
|
17
17
|
};
|
|
18
18
|
export type TableContainerProps<As extends ElementType = typeof TABLE_CONTAINER_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TableContainerBaseProps, As>;
|
|
19
|
+
export type TableContainerRef<As extends ElementType = typeof TABLE_CONTAINER_DEFAULT_TAG> = ComponentRef<As>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { cn } from '../../../../utils/classname';
|
|
4
4
|
import { TableContext } from '../../TableContext';
|
|
5
5
|
export var cnTableFoot = cn('TableFoot');
|
|
6
6
|
export var TableFoot = forwardRef(function (_a, ref) {
|
|
7
7
|
var children = _a.children, className = _a.className, other = __rest(_a, ["children", "className"]);
|
|
8
|
-
|
|
8
|
+
var memoizedContext = useMemo(function () { return ({ variant: 'foot' }); }, []);
|
|
9
|
+
return (React.createElement(TableContext.Provider, { value: memoizedContext },
|
|
9
10
|
React.createElement("tfoot", __assign({ className: cnTableFoot({}, [className]) }, other, { ref: ref }), children)));
|
|
10
11
|
});
|
|
11
12
|
TableFoot.displayName = 'TableFoot';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { cn } from '../../../../utils/classname';
|
|
4
4
|
import { TableContext } from '../../TableContext';
|
|
5
5
|
export var cnTableHead = cn('TableHead');
|
|
6
6
|
export var TableHead = forwardRef(function (_a, ref) {
|
|
7
7
|
var children = _a.children, className = _a.className, other = __rest(_a, ["children", "className"]);
|
|
8
|
-
|
|
8
|
+
var memoizedContext = useMemo(function () { return ({ variant: 'head' }); }, []);
|
|
9
|
+
return (React.createElement(TableContext.Provider, { value: memoizedContext },
|
|
9
10
|
React.createElement("thead", __assign({ className: cnTableHead({}, [className]) }, other, { ref: ref }), children)));
|
|
10
11
|
});
|
|
11
12
|
TableHead.displayName = 'TableHead';
|
|
@@ -2,14 +2,18 @@ import type { ComponentRef, ReactNode } from 'react';
|
|
|
2
2
|
import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
|
|
3
3
|
export declare const tableSizeVariant: readonly ["xs", "s", "m", "l"];
|
|
4
4
|
export declare const tableDividerVariant: readonly ["row", "column", "all"];
|
|
5
|
+
export declare const tableLayoutVariant: readonly ["auto", "fixed"];
|
|
5
6
|
export type TableSizeVariant = (typeof tableSizeVariant)[number];
|
|
6
7
|
export type TableDividerVariant = (typeof tableDividerVariant)[number];
|
|
8
|
+
export type TableLayoutVariant = (typeof tableLayoutVariant)[number];
|
|
7
9
|
export type TableRef = ComponentRef<'table'>;
|
|
8
10
|
export type TableProps = ExtendableComponentPropsWithRef<{
|
|
9
11
|
/** Устанавливает размер типографики и отступов в таблице */
|
|
10
12
|
size?: TableSizeVariant;
|
|
11
13
|
/** Признак, по которому таблица растет по всей ширине своего контейнера */
|
|
12
14
|
fullWidth?: boolean;
|
|
15
|
+
/** Вариант layout-таблицы */
|
|
16
|
+
layout?: TableLayoutVariant;
|
|
13
17
|
/** Тип разделителей в таблице */
|
|
14
18
|
divider?: TableDividerVariant;
|
|
15
19
|
/** Признак фиксированного заголовка в таблице */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useBreakpoints(): import("../../types
|
|
1
|
+
export declare function useBreakpoints(): import("../../types").BreakpointMatches;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './css';
|
|
2
|
+
export * from './function';
|
|
3
|
+
export * from './object';
|
|
4
|
+
export * from './react';
|
|
5
|
+
export * from './Breakpoints';
|
|
6
|
+
export * from './ExtendableComponentPropsWithRef';
|
|
7
|
+
export * from './ExtendableProps';
|
|
8
|
+
export * from './FormElementSizeVariant';
|
|
9
|
+
export * from './KeyCode';
|
|
10
|
+
export * from './ResponsiveValue';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './css';
|
|
2
|
+
export * from './function';
|
|
3
|
+
export * from './object';
|
|
4
|
+
export * from './react';
|
|
5
|
+
export * from './Breakpoints';
|
|
6
|
+
export * from './ExtendableComponentPropsWithRef';
|
|
7
|
+
export * from './ExtendableProps';
|
|
8
|
+
export * from './FormElementSizeVariant';
|
|
9
|
+
export * from './KeyCode';
|
|
10
|
+
export * from './ResponsiveValue';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './array';
|
|
2
|
+
export * from './breakpoint';
|
|
3
|
+
export * from './capitalizeFirstLetter';
|
|
4
|
+
export * from './css';
|
|
5
|
+
export * from './date';
|
|
6
|
+
export * from './generateUniqKey';
|
|
7
|
+
export * from './getByMap';
|
|
8
|
+
export * from './getScrollBarSize';
|
|
9
|
+
export * from './math';
|
|
10
|
+
export * from './number';
|
|
11
|
+
export * from './object';
|
|
12
|
+
export * from './react';
|
|
13
|
+
export * from './renderContent';
|
|
14
|
+
export * from './shallowEqual';
|
|
15
|
+
export * from './string';
|
|
16
|
+
export * from './animateProperty';
|
|
17
|
+
export * from './classname';
|
|
18
|
+
export * from './getFocusableElements';
|
|
19
|
+
export * from './getIconSizeToFormElement';
|
|
20
|
+
export * from './getNextIndex';
|
|
21
|
+
export * from './getPaperSizeToFormElement';
|
|
22
|
+
export * from './getPrevIndex';
|
|
23
|
+
export * from './isFunction';
|
|
24
|
+
export * from './isKey';
|
|
25
|
+
export * from './isKeys';
|
|
26
|
+
export * from './isNotNil';
|
|
27
|
+
export * from './isString';
|
|
28
|
+
export * from './polymorphicComponentWithRef';
|
|
29
|
+
export * from './scrollContainerToElement';
|
|
30
|
+
export * from './setRef';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './array';
|
|
2
|
+
export * from './breakpoint';
|
|
3
|
+
export * from './capitalizeFirstLetter';
|
|
4
|
+
export * from './css';
|
|
5
|
+
export * from './date';
|
|
6
|
+
export * from './generateUniqKey';
|
|
7
|
+
export * from './getByMap';
|
|
8
|
+
export * from './getScrollBarSize';
|
|
9
|
+
export * from './math';
|
|
10
|
+
export * from './number';
|
|
11
|
+
export * from './object';
|
|
12
|
+
export * from './react';
|
|
13
|
+
export * from './renderContent';
|
|
14
|
+
export * from './shallowEqual';
|
|
15
|
+
export * from './string';
|
|
16
|
+
export * from './animateProperty';
|
|
17
|
+
export * from './classname';
|
|
18
|
+
export * from './getFocusableElements';
|
|
19
|
+
export * from './getIconSizeToFormElement';
|
|
20
|
+
export * from './getNextIndex';
|
|
21
|
+
export * from './getPaperSizeToFormElement';
|
|
22
|
+
export * from './getPrevIndex';
|
|
23
|
+
export * from './isFunction';
|
|
24
|
+
export * from './isKey';
|
|
25
|
+
export * from './isKeys';
|
|
26
|
+
export * from './isNotNil';
|
|
27
|
+
export * from './isString';
|
|
28
|
+
export * from './polymorphicComponentWithRef';
|
|
29
|
+
export * from './scrollContainerToElement';
|
|
30
|
+
export * from './setRef';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozen-ui/kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "React component library",
|
|
5
5
|
"files": [
|
|
6
6
|
"*"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"react-popper": "^2.3.0",
|
|
30
30
|
"react-transition-group": "^4.4.5",
|
|
31
31
|
"tslib": "^2.6.3",
|
|
32
|
-
"@ozen-ui/icons": "0.
|
|
33
|
-
"@ozen-ui/
|
|
34
|
-
"@ozen-ui/
|
|
32
|
+
"@ozen-ui/icons": "0.73.0",
|
|
33
|
+
"@ozen-ui/logger": "0.73.0",
|
|
34
|
+
"@ozen-ui/fonts": "0.73.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/lodash.isequal": "^4.5.0"
|