@true-engineering/true-react-common-ui-kit 3.8.0 → 3.9.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/README.md +16 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/NewMoreMenu/NewMoreMenu.d.ts +1 -1
- package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +3 -1
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +4 -4
- package/dist/components/Select/components/SelectList/SelectList.d.ts +5 -6
- package/dist/components/Select/components/SelectListItem/SelectListItem.d.ts +2 -2
- package/dist/components/WithPopup/WithPopup.d.ts +2 -0
- package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +59 -32
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +59 -32
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox/Checkbox.tsx +88 -85
- package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +1 -0
- package/src/components/NewMoreMenu/NewMoreMenu.styles.ts +5 -5
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +18 -2
- package/src/components/Select/Select.tsx +609 -580
- package/src/components/Select/components/SelectList/SelectList.tsx +156 -157
- package/src/components/Select/components/SelectListItem/SelectListItem.tsx +72 -68
- package/src/components/WithPopup/WithPopup.stories.tsx +1 -0
- package/src/components/WithPopup/WithPopup.styles.ts +4 -0
- package/src/components/WithPopup/WithPopup.tsx +13 -2
package/README.md
CHANGED
|
@@ -10,6 +10,22 @@
|
|
|
10
10
|
|
|
11
11
|
# Release Notes
|
|
12
12
|
|
|
13
|
+
## v3.9.0
|
|
14
|
+
|
|
15
|
+
### Changes
|
|
16
|
+
|
|
17
|
+
- **Select**:
|
|
18
|
+
1. Добавлена поддержка для `readonly` опций
|
|
19
|
+
2. Добавлена типизация для `event` в `onChange`
|
|
20
|
+
- **WithPopup**: добавлен `z-index: 5` для дропдауна
|
|
21
|
+
- **NewMoreMenu**: добавлены твикстайлс для **List** и **WithPopup**
|
|
22
|
+
|
|
23
|
+
## v3.8.1
|
|
24
|
+
|
|
25
|
+
### Changes
|
|
26
|
+
|
|
27
|
+
- **WithPopup** и **NewMoreMenu** добавлена пропса `shouldHideOnScroll`
|
|
28
|
+
|
|
13
29
|
## v3.8.0
|
|
14
30
|
|
|
15
31
|
### Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, ChangeEvent, KeyboardEvent } from 'react';
|
|
2
2
|
import { ICommonProps } from '../../types';
|
|
3
3
|
import { ICheckboxStyles } from './Checkbox.styles';
|
|
4
4
|
export interface ICheckboxProps<V> extends ICommonProps<ICheckboxStyles> {
|
|
@@ -18,6 +18,6 @@ export interface ICheckboxProps<V> extends ICommonProps<ICheckboxStyles> {
|
|
|
18
18
|
onSelect: (value: {
|
|
19
19
|
value: V;
|
|
20
20
|
isSelected: boolean;
|
|
21
|
-
}) => void;
|
|
21
|
+
}, event: ChangeEvent<HTMLInputElement> | KeyboardEvent) => void;
|
|
22
22
|
}
|
|
23
23
|
export declare function Checkbox<V>({ children, isDisabled, isReadonly, isChecked, value, data, testId, isSemiChecked, labelPosition, tweakStyles, onSelect, }: ICheckboxProps<V>): JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { ICommonProps } from '../../types';
|
|
|
3
3
|
import { IListItem } from '../List';
|
|
4
4
|
import { IWithPopupProps } from '../WithPopup';
|
|
5
5
|
import { INewMoreMenuStyles } from './NewMoreMenu.styles';
|
|
6
|
-
export interface INewMoreMenuProps extends Pick<IWithPopupProps, 'middlewares' | 'shouldRenderInBody'>, ICommonProps<INewMoreMenuStyles> {
|
|
6
|
+
export interface INewMoreMenuProps extends Pick<IWithPopupProps, 'middlewares' | 'shouldHideOnScroll' | 'shouldRenderInBody'>, ICommonProps<INewMoreMenuStyles> {
|
|
7
7
|
items: IListItem[];
|
|
8
8
|
/** @default false */
|
|
9
9
|
isDisabled?: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
2
|
import { IListStyles } from '../List';
|
|
3
|
-
|
|
3
|
+
import { IWithPopupStyles } from '../WithPopup';
|
|
4
|
+
export declare const useStyles: import("../../theme").IUseStyles<"button" | "icon" | "active" | "disabled" | "hasCircle", unknown>;
|
|
4
5
|
export type INewMoreMenuStyles = ITweakStyles<typeof useStyles, {
|
|
5
6
|
tweakList: IListStyles;
|
|
7
|
+
tweakWithPopup: IWithPopupStyles;
|
|
6
8
|
}>;
|
|
@@ -175,7 +175,7 @@ export declare class ScrollIntoViewIfNeeded extends PureComponent<IScrollIntoVie
|
|
|
175
175
|
'aria-describedby'?: string | undefined;
|
|
176
176
|
'aria-details'?: string | undefined;
|
|
177
177
|
'aria-disabled'?: (boolean | "false" | "true") | undefined;
|
|
178
|
-
'aria-dropeffect'?: "copy" | "none" | "link" | "move" | "
|
|
178
|
+
'aria-dropeffect'?: "copy" | "none" | "link" | "move" | "popup" | "execute" | undefined;
|
|
179
179
|
'aria-errormessage'?: string | undefined;
|
|
180
180
|
'aria-expanded'?: (boolean | "false" | "true") | undefined;
|
|
181
181
|
'aria-flowto'?: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, SyntheticEvent } from 'react';
|
|
1
|
+
import { ReactNode, KeyboardEvent, MouseEvent, SyntheticEvent, ChangeEvent, FormEvent } from 'react';
|
|
2
2
|
import { ICommonProps, IDropdownWithPopperOptions } from '../../types';
|
|
3
3
|
import { IIcon } from '../Icon';
|
|
4
4
|
import { IInputProps } from '../Input';
|
|
@@ -19,7 +19,7 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
|
|
|
19
19
|
dropdownOptions?: IDropdownWithPopperOptions;
|
|
20
20
|
/** @default 'chevron-down' */
|
|
21
21
|
dropdownIcon?: IIcon;
|
|
22
|
-
options: Value[]
|
|
22
|
+
options: Value[] | Readonly<Value[]>;
|
|
23
23
|
value: Value | undefined;
|
|
24
24
|
/** @default true */
|
|
25
25
|
shouldScrollToList?: boolean;
|
|
@@ -28,7 +28,7 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
|
|
|
28
28
|
shouldRenderInList: true;
|
|
29
29
|
} & Pick<ISearchInputProps, 'placeholder'>;
|
|
30
30
|
isOptionDisabled?: (option: Value) => boolean;
|
|
31
|
-
onChange: (value
|
|
31
|
+
onChange: (value: Value | undefined, event: MouseEvent<HTMLElement> | KeyboardEvent | ChangeEvent<HTMLElement> | FormEvent<HTMLElement>) => void;
|
|
32
32
|
onBlur?: (event: Event | SyntheticEvent) => void;
|
|
33
33
|
onType?: (value: string) => Promise<void>;
|
|
34
34
|
optionsFilter?: (options: Value[], query: string) => Value[];
|
|
@@ -41,7 +41,7 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
|
|
|
41
41
|
export interface IMultipleSelectProps<Value> extends Omit<ISelectProps<Value>, 'value' | 'onChange' | 'compareValuesOnChange'> {
|
|
42
42
|
isMultiSelect: true;
|
|
43
43
|
value: IMultipleSelectValue<Value> | undefined;
|
|
44
|
-
onChange: (value
|
|
44
|
+
onChange: (value: IMultipleSelectValue<Value> | undefined, event: MouseEvent<HTMLElement> | KeyboardEvent | ChangeEvent<HTMLElement> | FormEvent<HTMLElement>) => void;
|
|
45
45
|
compareValuesOnChange?: (v1?: IMultipleSelectValue<Value>, v2?: IMultipleSelectValue<Value>) => boolean;
|
|
46
46
|
}
|
|
47
47
|
export declare function Select<Value>(props: ISelectProps<Value> | IMultipleSelectProps<Value>): JSX.Element;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { ICommonProps } from '../../../../types';
|
|
3
|
+
import { ISelectListItemProps } from '../SelectListItem';
|
|
3
4
|
import { ISelectListStyles } from './SelectList.styles';
|
|
4
|
-
export interface ISelectListProps<Value> extends ICommonProps<ISelectListStyles> {
|
|
5
|
-
options: Value[]
|
|
5
|
+
export interface ISelectListProps<Value> extends ICommonProps<ISelectListStyles>, Pick<ISelectListItemProps, 'onToggleCheckbox' | 'onOptionSelect'> {
|
|
6
|
+
options: Value[] | Readonly<Value[]>;
|
|
6
7
|
focusedIndex?: number;
|
|
7
8
|
activeValue?: Value | Value[];
|
|
8
9
|
noMatchesLabel?: string;
|
|
9
10
|
isLoading?: boolean;
|
|
10
11
|
loadingLabel?: ReactNode;
|
|
11
12
|
defaultOptionLabel?: ReactNode;
|
|
12
|
-
allOptionsLabel?:
|
|
13
|
+
allOptionsLabel?: ReactNode;
|
|
13
14
|
areAllOptionsSelected?: boolean;
|
|
14
15
|
shouldScrollToList?: boolean;
|
|
15
16
|
customListHeader?: ReactNode;
|
|
16
|
-
onOptionSelect: (index: number, event: MouseEvent<HTMLElement>) => void;
|
|
17
|
-
onToggleCheckbox?: (index: number, isSelected: boolean) => void;
|
|
18
17
|
isOptionDisabled: (value: Value) => boolean;
|
|
19
18
|
convertValueToString: (value: Value) => string | undefined;
|
|
20
19
|
convertValueToReactNode?: (value: Value, isDisabled: boolean) => ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, MouseEvent, FC } from 'react';
|
|
1
|
+
import { ReactNode, MouseEvent, FC, KeyboardEvent, ChangeEvent } from 'react';
|
|
2
2
|
import { Classes } from 'jss';
|
|
3
3
|
export interface ISelectListItemProps {
|
|
4
4
|
index: number;
|
|
@@ -9,6 +9,6 @@ export interface ISelectListItemProps {
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
classes: Classes<'cellWithCheckbox' | 'cell' | 'focused' | 'active' | 'disabled'>;
|
|
11
11
|
onOptionSelect: (index: number, event: MouseEvent<HTMLElement>) => void;
|
|
12
|
-
onToggleCheckbox?: (index: number, isSelected: boolean) => void;
|
|
12
|
+
onToggleCheckbox?: (index: number, isSelected: boolean, event: ChangeEvent<HTMLElement> | KeyboardEvent) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const SelectListItem: FC<ISelectListItemProps>;
|
|
@@ -13,6 +13,8 @@ export interface IWithPopupProps extends ICommonProps<IWithPopupStyles> {
|
|
|
13
13
|
middlewares?: Middleware[];
|
|
14
14
|
/** @default eventType === 'click' ? 'bottom-end' : 'top' */
|
|
15
15
|
placement?: Placement;
|
|
16
|
+
/** @default false */
|
|
17
|
+
shouldHideOnScroll?: boolean;
|
|
16
18
|
/** @default true */
|
|
17
19
|
shouldRenderInBody?: boolean;
|
|
18
20
|
/** @default 'click' */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
|
-
export declare const useStyles: import("../../theme").IUseStyles<"root" | "disabled" | "trigger", unknown>;
|
|
2
|
+
export declare const useStyles: import("../../theme").IUseStyles<"root" | "disabled" | "trigger" | "popup", unknown>;
|
|
3
3
|
export type IWithPopupStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -9110,12 +9110,12 @@ function Checkbox(param) {
|
|
|
9110
9110
|
});
|
|
9111
9111
|
var _useState = _sliced_to_array$o(useState(false), 2), isSelected = _useState[0], setIsSelected = _useState[1];
|
|
9112
9112
|
var hasAction = !isDisabled && !isReadonly;
|
|
9113
|
-
var onToggle = function() {
|
|
9113
|
+
var onToggle = function(event) {
|
|
9114
9114
|
var isSelectedNext = !isSelected;
|
|
9115
9115
|
onSelect({
|
|
9116
9116
|
value,
|
|
9117
9117
|
isSelected: isSelectedNext
|
|
9118
|
-
});
|
|
9118
|
+
}, event);
|
|
9119
9119
|
setIsSelected(isSelectedNext);
|
|
9120
9120
|
};
|
|
9121
9121
|
useEffect(function() {
|
|
@@ -10851,8 +10851,8 @@ var SelectListItem = function(param) {
|
|
|
10851
10851
|
isSemiChecked,
|
|
10852
10852
|
isDisabled,
|
|
10853
10853
|
tweakStyles: checkboxStyles$1,
|
|
10854
|
-
onSelect: function(v) {
|
|
10855
|
-
return onToggleCheckbox(index, v.isSelected);
|
|
10854
|
+
onSelect: function(v, event) {
|
|
10855
|
+
return onToggleCheckbox(index, v.isSelected, event);
|
|
10856
10856
|
},
|
|
10857
10857
|
children
|
|
10858
10858
|
}) : children
|
|
@@ -10974,7 +10974,7 @@ function SelectList(param) {
|
|
|
10974
10974
|
},
|
|
10975
10975
|
children: defaultOptionLabel
|
|
10976
10976
|
}),
|
|
10977
|
-
|
|
10977
|
+
isReactNodeNotEmpty(allOptionsLabel) && /* @__PURE__ */ jsx(SelectListItem, {
|
|
10978
10978
|
classes,
|
|
10979
10979
|
index: ALL_OPTION_INDEX,
|
|
10980
10980
|
isSemiChecked: selectedOptionsCount > 0 && !areAllOptionsSelected,
|
|
@@ -11455,7 +11455,9 @@ function Select(props) {
|
|
|
11455
11455
|
var classes = useStyles$B({
|
|
11456
11456
|
theme: tweakStyles
|
|
11457
11457
|
});
|
|
11458
|
-
var
|
|
11458
|
+
var _ref = searchInput !== null && searchInput !== void 0 ? searchInput : {}, tmp = _ref.shouldRenderInList, shouldRenderSearchInputInList = tmp === void 0 ? false : tmp, searchInputProps = _object_without_properties$9(_ref, [
|
|
11459
|
+
"shouldRenderInList"
|
|
11460
|
+
]);
|
|
11459
11461
|
var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
|
|
11460
11462
|
var isMultiSelect = isMultiSelectValue(props);
|
|
11461
11463
|
var hasReadonlyInput = isReadonly || optionsMode === "normal" || shouldRenderSearchInputInList;
|
|
@@ -11534,7 +11536,11 @@ function Select(props) {
|
|
|
11534
11536
|
return acc;
|
|
11535
11537
|
}, []));
|
|
11536
11538
|
}, [
|
|
11537
|
-
filteredOptions
|
|
11539
|
+
filteredOptions,
|
|
11540
|
+
hasDefaultOption,
|
|
11541
|
+
isOptionDisabled,
|
|
11542
|
+
shouldShowAllOption,
|
|
11543
|
+
shouldShowDefaultOption
|
|
11538
11544
|
]);
|
|
11539
11545
|
var stringValue = isNotEmpty(strValue) ? convertValueToString(strValue) : void 0;
|
|
11540
11546
|
var showedStringValue = areAllOptionsSelected && isNotEmpty(allOptionsLabel) ? allOptionsLabel : stringValue;
|
|
@@ -11577,9 +11583,9 @@ function Select(props) {
|
|
|
11577
11583
|
handleListClose(event);
|
|
11578
11584
|
}
|
|
11579
11585
|
};
|
|
11580
|
-
var handleOnChange = useCallback(function(newValue) {
|
|
11586
|
+
var handleOnChange = useCallback(function(newValue, event) {
|
|
11581
11587
|
if (!compareValuesOnChange(value, newValue)) {
|
|
11582
|
-
onChange(newValue);
|
|
11588
|
+
onChange(newValue, event);
|
|
11583
11589
|
}
|
|
11584
11590
|
}, [
|
|
11585
11591
|
value,
|
|
@@ -11588,7 +11594,7 @@ function Select(props) {
|
|
|
11588
11594
|
]);
|
|
11589
11595
|
var handleOptionSelect = useCallback(function(index, event) {
|
|
11590
11596
|
var _input_current;
|
|
11591
|
-
handleOnChange(index === DEFAULT_OPTION_INDEX ? void 0 : filteredOptions[index]);
|
|
11597
|
+
handleOnChange(index === DEFAULT_OPTION_INDEX ? void 0 : filteredOptions[index], event);
|
|
11592
11598
|
handleListClose(event);
|
|
11593
11599
|
(_input_current = input.current) === null || _input_current === void 0 ? void 0 : _input_current.blur();
|
|
11594
11600
|
}, [
|
|
@@ -11596,16 +11602,16 @@ function Select(props) {
|
|
|
11596
11602
|
handleListClose,
|
|
11597
11603
|
filteredOptions
|
|
11598
11604
|
]);
|
|
11599
|
-
var handleToggleOptionCheckbox = useCallback(function(index, isSelected) {
|
|
11605
|
+
var handleToggleOptionCheckbox = useCallback(function(index, isSelected, event) {
|
|
11600
11606
|
if (!isMultiSelect) {
|
|
11601
11607
|
return;
|
|
11602
11608
|
}
|
|
11603
11609
|
if (index === DEFAULT_OPTION_INDEX || index === ALL_OPTION_INDEX && !isSelected) {
|
|
11604
|
-
handleOnChange(void 0);
|
|
11610
|
+
handleOnChange(void 0, event);
|
|
11605
11611
|
return;
|
|
11606
11612
|
}
|
|
11607
11613
|
if (index === ALL_OPTION_INDEX && isSelected) {
|
|
11608
|
-
handleOnChange(availableOptions);
|
|
11614
|
+
handleOnChange(availableOptions, event);
|
|
11609
11615
|
return;
|
|
11610
11616
|
}
|
|
11611
11617
|
var option = filteredOptions[index];
|
|
@@ -11619,12 +11625,14 @@ function Select(props) {
|
|
|
11619
11625
|
value === null || value === void 0 ? void 0 : value.filter(function(o) {
|
|
11620
11626
|
return convertToId(o) !== convertToId(option);
|
|
11621
11627
|
})
|
|
11622
|
-
));
|
|
11628
|
+
), event);
|
|
11623
11629
|
}, [
|
|
11624
|
-
handleOnChange,
|
|
11625
|
-
filteredOptions,
|
|
11626
11630
|
isMultiSelect,
|
|
11627
|
-
|
|
11631
|
+
filteredOptions,
|
|
11632
|
+
handleOnChange,
|
|
11633
|
+
value,
|
|
11634
|
+
availableOptions,
|
|
11635
|
+
convertToId
|
|
11628
11636
|
]);
|
|
11629
11637
|
var handleOnType = useCallback(function() {
|
|
11630
11638
|
var _ref2 = _async_to_generator$4(function(v) {
|
|
@@ -11661,14 +11669,17 @@ function Select(props) {
|
|
|
11661
11669
|
return _ref2.apply(this, arguments);
|
|
11662
11670
|
};
|
|
11663
11671
|
}(), [
|
|
11672
|
+
isMounted,
|
|
11664
11673
|
onType,
|
|
11665
11674
|
optionsMode
|
|
11666
11675
|
]);
|
|
11667
|
-
var debounceHandleOnType =
|
|
11676
|
+
var debounceHandleOnType = useMemo(function() {
|
|
11677
|
+
return debounce$1(handleOnType, debounceTime);
|
|
11678
|
+
}, [
|
|
11668
11679
|
handleOnType,
|
|
11669
11680
|
debounceTime
|
|
11670
11681
|
]);
|
|
11671
|
-
var handleInputChange = function(v) {
|
|
11682
|
+
var handleInputChange = function(v, event) {
|
|
11672
11683
|
if (onType !== void 0) {
|
|
11673
11684
|
debounceHandleOnType(v);
|
|
11674
11685
|
}
|
|
@@ -11676,7 +11687,7 @@ function Select(props) {
|
|
|
11676
11687
|
setShouldShowDefaultOption(v === "");
|
|
11677
11688
|
}
|
|
11678
11689
|
if (v === "" && !hasSearchInputInList) {
|
|
11679
|
-
handleOnChange(void 0);
|
|
11690
|
+
handleOnChange(void 0, event);
|
|
11680
11691
|
}
|
|
11681
11692
|
setSearchValue(v);
|
|
11682
11693
|
};
|
|
@@ -11706,7 +11717,7 @@ function Select(props) {
|
|
|
11706
11717
|
return convertToId(opt) === valueIdToSelect;
|
|
11707
11718
|
})) !== null && _value_some !== void 0 ? _value_some : false;
|
|
11708
11719
|
}
|
|
11709
|
-
handleToggleOptionCheckbox(indexToSelect, !isThisValueAlreadySelected);
|
|
11720
|
+
handleToggleOptionCheckbox(indexToSelect, !isThisValueAlreadySelected, event);
|
|
11710
11721
|
} else {
|
|
11711
11722
|
handleOptionSelect(indexToSelect, event);
|
|
11712
11723
|
}
|
|
@@ -11748,7 +11759,7 @@ function Select(props) {
|
|
|
11748
11759
|
hasSearchInputInList) && // Последняя проверка на случай, если мы че то ищем в опциях
|
|
11749
11760
|
(optionsMode === "normal" || hasEnoughSymbolsToSearch)
|
|
11750
11761
|
);
|
|
11751
|
-
var
|
|
11762
|
+
var _ref1 = dropdownOptions !== null && dropdownOptions !== void 0 ? dropdownOptions : {}, _ref_shouldUsePopper = _ref1.shouldUsePopper, shouldUsePopper = _ref_shouldUsePopper === void 0 ? false : _ref_shouldUsePopper, _ref_shouldRenderInBody = _ref1.shouldRenderInBody, shouldRenderInBody = _ref_shouldRenderInBody === void 0 ? false : _ref_shouldRenderInBody, _ref_shouldHideOnScroll = _ref1.shouldHideOnScroll, shouldHideOnScroll = _ref_shouldHideOnScroll === void 0 ? false : _ref_shouldHideOnScroll;
|
|
11752
11763
|
var popperData = useDropdown({
|
|
11753
11764
|
isOpen,
|
|
11754
11765
|
onDropdownClose: handleListClose,
|
|
@@ -11787,15 +11798,15 @@ function Select(props) {
|
|
|
11787
11798
|
}, popperData === null || popperData === void 0 ? void 0 : popperData.attributes.popper), {
|
|
11788
11799
|
children: isOpen && /* @__PURE__ */ jsx(SelectList, {
|
|
11789
11800
|
options: filteredOptions,
|
|
11790
|
-
defaultOptionLabel: hasDefaultOption && shouldShowDefaultOption
|
|
11791
|
-
allOptionsLabel: shouldShowAllOption
|
|
11801
|
+
defaultOptionLabel: hasDefaultOption && shouldShowDefaultOption && defaultOptionLabel,
|
|
11802
|
+
allOptionsLabel: shouldShowAllOption && allOptionsLabel,
|
|
11792
11803
|
areAllOptionsSelected,
|
|
11793
|
-
customListHeader: hasSearchInputInList
|
|
11804
|
+
customListHeader: hasSearchInputInList && /* @__PURE__ */ jsx(SearchInput, _object_spread$D({
|
|
11794
11805
|
value: searchValue,
|
|
11795
11806
|
onChange: handleInputChange,
|
|
11796
11807
|
tweakStyles: tweakSearchInputStyles,
|
|
11797
11808
|
placeholder: "Поиск"
|
|
11798
|
-
},
|
|
11809
|
+
}, searchInputProps)),
|
|
11799
11810
|
noMatchesLabel,
|
|
11800
11811
|
focusedIndex: focusedListCellIndex,
|
|
11801
11812
|
activeValue: value,
|
|
@@ -30086,6 +30097,9 @@ var useStyles$1 = createThemedStyles("WithPopup", {
|
|
|
30086
30097
|
},
|
|
30087
30098
|
trigger: {
|
|
30088
30099
|
cursor: "pointer"
|
|
30100
|
+
},
|
|
30101
|
+
popup: {
|
|
30102
|
+
zIndex: 5
|
|
30089
30103
|
}
|
|
30090
30104
|
});
|
|
30091
30105
|
function _array_like_to_array(arr, len) {
|
|
@@ -30213,7 +30227,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
30213
30227
|
return _array_like_to_array(o, minLen);
|
|
30214
30228
|
}
|
|
30215
30229
|
var WithPopup = function(param) {
|
|
30216
|
-
var trigger = param.trigger, children = param.children, middlewares = param.middlewares, _param_eventType = param.eventType, eventType = _param_eventType === void 0 ? "click" : _param_eventType, _param_placement = param.placement, placement = _param_placement === void 0 ? eventType === "click" ? "bottom-end" : "top" : _param_placement, _param_shouldRenderInBody = param.shouldRenderInBody, shouldRenderInBody = _param_shouldRenderInBody === void 0 ? false : _param_shouldRenderInBody, _param_hoverDelay = param.hoverDelay, hoverDelay = _param_hoverDelay === void 0 ? 0 : _param_hoverDelay, _param_popupOffset = param.popupOffset, popupOffset = _param_popupOffset === void 0 ? DEFAULT_OFFSET : _param_popupOffset, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, tweakStyles = param.tweakStyles, data = param.data, testId = param.testId, onToggle = param.onToggle;
|
|
30230
|
+
var trigger = param.trigger, children = param.children, middlewares = param.middlewares, _param_eventType = param.eventType, eventType = _param_eventType === void 0 ? "click" : _param_eventType, _param_placement = param.placement, placement = _param_placement === void 0 ? eventType === "click" ? "bottom-end" : "top" : _param_placement, _param_shouldHideOnScroll = param.shouldHideOnScroll, shouldHideOnScroll = _param_shouldHideOnScroll === void 0 ? false : _param_shouldHideOnScroll, _param_shouldRenderInBody = param.shouldRenderInBody, shouldRenderInBody = _param_shouldRenderInBody === void 0 ? false : _param_shouldRenderInBody, _param_hoverDelay = param.hoverDelay, hoverDelay = _param_hoverDelay === void 0 ? 0 : _param_hoverDelay, _param_popupOffset = param.popupOffset, popupOffset = _param_popupOffset === void 0 ? DEFAULT_OFFSET : _param_popupOffset, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, tweakStyles = param.tweakStyles, data = param.data, testId = param.testId, onToggle = param.onToggle;
|
|
30217
30231
|
var classes = useStyles$1({
|
|
30218
30232
|
theme: tweakStyles
|
|
30219
30233
|
});
|
|
@@ -30250,7 +30264,8 @@ var WithPopup = function(param) {
|
|
|
30250
30264
|
toggle: false
|
|
30251
30265
|
});
|
|
30252
30266
|
var dismiss = useDismiss(context, {
|
|
30253
|
-
enabled: eventType === "click"
|
|
30267
|
+
enabled: eventType === "click",
|
|
30268
|
+
ancestorScroll: shouldHideOnScroll
|
|
30254
30269
|
});
|
|
30255
30270
|
var _useInteractions = useInteractions([
|
|
30256
30271
|
hover,
|
|
@@ -30276,6 +30291,7 @@ var WithPopup = function(param) {
|
|
|
30276
30291
|
root: !shouldRenderInBody ? refs.reference.current : void 0,
|
|
30277
30292
|
children: /* @__PURE__ */ jsx("div", _object_spread_props$1(_object_spread$1({
|
|
30278
30293
|
style: floatingStyles,
|
|
30294
|
+
className: classes.popup,
|
|
30279
30295
|
ref: refs.setFloating
|
|
30280
30296
|
}, getFloatingProps()), {
|
|
30281
30297
|
children: isFunction$1(Popup) ? /* @__PURE__ */ jsx(Popup, {
|
|
@@ -30287,7 +30303,6 @@ var WithPopup = function(param) {
|
|
|
30287
30303
|
}));
|
|
30288
30304
|
};
|
|
30289
30305
|
var useStyles = createThemedStyles("NewMoreMenu", {
|
|
30290
|
-
root: {},
|
|
30291
30306
|
hasCircle: {},
|
|
30292
30307
|
button: {
|
|
30293
30308
|
display: "flex",
|
|
@@ -30310,8 +30325,7 @@ var useStyles = createThemedStyles("NewMoreMenu", {
|
|
|
30310
30325
|
active: {},
|
|
30311
30326
|
disabled: {
|
|
30312
30327
|
cursor: "default"
|
|
30313
|
-
}
|
|
30314
|
-
menu: {}
|
|
30328
|
+
}
|
|
30315
30329
|
});
|
|
30316
30330
|
function _define_property(obj, key, value) {
|
|
30317
30331
|
if (key in obj) {
|
|
@@ -30366,16 +30380,28 @@ function _object_spread_props(target, source) {
|
|
|
30366
30380
|
return target;
|
|
30367
30381
|
}
|
|
30368
30382
|
var NewMoreMenu = function(param) {
|
|
30369
|
-
var items = param.items, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_hasDefaultStateBackground = param.hasDefaultStateBackground, hasDefaultStateBackground = _param_hasDefaultStateBackground === void 0 ? true : _param_hasDefaultStateBackground, data = param.data, testId = param.testId, placement = param.placement, middlewares = param.middlewares, shouldRenderInBody = param.shouldRenderInBody, tweakStyles = param.tweakStyles;
|
|
30383
|
+
var items = param.items, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_hasDefaultStateBackground = param.hasDefaultStateBackground, hasDefaultStateBackground = _param_hasDefaultStateBackground === void 0 ? true : _param_hasDefaultStateBackground, data = param.data, testId = param.testId, placement = param.placement, middlewares = param.middlewares, shouldHideOnScroll = param.shouldHideOnScroll, shouldRenderInBody = param.shouldRenderInBody, tweakStyles = param.tweakStyles;
|
|
30370
30384
|
var classes = useStyles({
|
|
30371
30385
|
theme: tweakStyles
|
|
30372
30386
|
});
|
|
30387
|
+
var tweakWithPopupStyles = useTweakStyles({
|
|
30388
|
+
tweakStyles,
|
|
30389
|
+
className: "tweakWithPopup",
|
|
30390
|
+
currentComponentName: "NewMoreMenu"
|
|
30391
|
+
});
|
|
30392
|
+
var tweakListStyles = useTweakStyles({
|
|
30393
|
+
tweakStyles,
|
|
30394
|
+
className: "tweakList",
|
|
30395
|
+
currentComponentName: "NewMoreMenu"
|
|
30396
|
+
});
|
|
30373
30397
|
var isButtonDisabled = isDisabled || !isArrayNotEmpty(items);
|
|
30374
30398
|
return /* @__PURE__ */ jsx(WithPopup, {
|
|
30375
30399
|
placement,
|
|
30376
30400
|
middlewares,
|
|
30401
|
+
shouldHideOnScroll,
|
|
30377
30402
|
shouldRenderInBody,
|
|
30378
30403
|
isDisabled: isButtonDisabled,
|
|
30404
|
+
tweakStyles: tweakWithPopupStyles,
|
|
30379
30405
|
trigger: function(param2) {
|
|
30380
30406
|
var isActive = param2.isActive;
|
|
30381
30407
|
var _obj;
|
|
@@ -30395,6 +30421,7 @@ var NewMoreMenu = function(param) {
|
|
|
30395
30421
|
var onClose = param2.onClose;
|
|
30396
30422
|
return /* @__PURE__ */ jsx(List, {
|
|
30397
30423
|
items,
|
|
30424
|
+
tweakStyles: tweakListStyles,
|
|
30398
30425
|
onClick: onClose
|
|
30399
30426
|
});
|
|
30400
30427
|
}
|