@true-engineering/true-react-common-ui-kit 3.15.4 → 3.16.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 +10 -0
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +2 -0
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +2 -7
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.d.ts +2 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +2 -3
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/helpers.d.ts +1 -0
- package/dist/components/NewMoreMenu/NewMoreMenu.d.ts +1 -3
- package/dist/components/WithPopup/WithPopup.d.ts +5 -4
- package/dist/components/WithPopup/types.d.ts +3 -1
- package/dist/true-react-common-ui-kit.js +1077 -1233
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +1076 -1232
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/FiltersPane.styles.ts +5 -1
- package/src/components/FiltersPane/FiltersPane.tsx +9 -5
- package/src/components/FiltersPane/components/Filter/Filter.tsx +53 -142
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +10 -3
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +6 -16
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +72 -114
- package/src/components/FiltersPane/components/FilterWrapper/helpers.ts +14 -0
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +8 -13
- package/src/components/WithPopup/WithPopup.tsx +16 -22
- package/src/components/WithPopup/types.ts +4 -1
package/README.md
CHANGED
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
|
|
12
12
|
# Release Notes
|
|
13
13
|
|
|
14
|
+
## v3.16.0
|
|
15
|
+
|
|
16
|
+
### Changes
|
|
17
|
+
|
|
18
|
+
- **FiltersPane**: добавленs tweakStyles для FilterWrapper
|
|
19
|
+
- **FilterWrapper + Filter**: переписан с использованием WithPopup
|
|
20
|
+
- **FilterSelect**: добавлено свойство onClose
|
|
21
|
+
- **WithPopup**: добавлена поддержка transition
|
|
22
|
+
- **NewMoreMenu**: добавлен свойство onToggle
|
|
23
|
+
|
|
14
24
|
## v3.15.4
|
|
15
25
|
|
|
16
26
|
### Changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
2
|
import { IButtonStyles } from '../Button';
|
|
3
|
+
import type { IFilterWrapperStyles } from './components';
|
|
3
4
|
export declare const FILTER_HEIGHT = 36;
|
|
4
5
|
export declare const useStyles: import("../../theme").IUseStyles<"clear" | "root" | "settings" | "settingsIcon" | "filterWithClearButton", unknown>;
|
|
5
6
|
export declare const clearButtonStyles: IButtonStyles;
|
|
6
7
|
export declare const innerTextButtonStyles: IButtonStyles;
|
|
7
8
|
export type IFiltersPaneStyles = ITweakStyles<typeof useStyles, {
|
|
8
9
|
tweakClearButton: IButtonStyles;
|
|
10
|
+
tweakFilterWrapper: IFilterWrapperStyles;
|
|
9
11
|
}>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { Classes } from 'jss';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import type { IFilterWrapperProps } from '../FilterWrapper';
|
|
4
3
|
export interface IFilterProps<Values, Key extends keyof Values> extends IFilterWrapperProps<Values, Key> {
|
|
5
|
-
parentRef?: RefObject<HTMLElement>;
|
|
6
|
-
isInline?: boolean;
|
|
7
|
-
filtersPaneRef: RefObject<HTMLDivElement> | null;
|
|
8
|
-
classes: Classes<'left' | 'right' | 'dropdown'>;
|
|
9
4
|
onChange: <V>(v: V) => void;
|
|
10
5
|
onClose?: () => void;
|
|
11
6
|
}
|
|
12
|
-
export declare function Filter<Values, Key extends keyof Values>(
|
|
7
|
+
export declare function Filter<Values, Key extends keyof Values>(props: IFilterProps<Values, Key>): JSX.Element | null;
|
|
@@ -5,6 +5,7 @@ import { IFilterSelectStyles } from './FilterSelect.styles';
|
|
|
5
5
|
export interface IFilterSelectProps<Value> extends ICommonProps<IFilterSelectStyles> {
|
|
6
6
|
value?: Value;
|
|
7
7
|
onChange: (value?: Value) => void;
|
|
8
|
+
onClose?: () => void;
|
|
8
9
|
/**
|
|
9
10
|
* @default false
|
|
10
11
|
*/
|
|
@@ -26,4 +27,4 @@ export interface IFilterSelectProps<Value> extends ICommonProps<IFilterSelectSty
|
|
|
26
27
|
*/
|
|
27
28
|
hasClearButton?: boolean;
|
|
28
29
|
}
|
|
29
|
-
export declare function FilterSelect<Value>({ data, tweakStyles, value, isSearchEnabled, isGroupingEnabled, localeKey, locale, onChange, options, fetchOptions, footer, getValueView, getValueId, getValueString, hasClearButton, testId, }: IFilterSelectProps<Value>): JSX.Element;
|
|
30
|
+
export declare function FilterSelect<Value>({ data, tweakStyles, value, isSearchEnabled, isGroupingEnabled, localeKey, locale, onChange, onClose, options, fetchOptions, footer, getValueView, getValueId, getValueString, hasClearButton, testId, }: IFilterSelectProps<Value>): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ICommonProps } from '../../../../types';
|
|
3
3
|
import { ConfigItem, IFilterLocaleKey, IPartialFilterLocale } from '../../types';
|
|
4
4
|
import { IFilterWrapperStyles } from './FilterWrapper.styles';
|
|
@@ -8,7 +8,6 @@ export interface IFilterWrapperProps<Values, Key extends keyof Values> extends I
|
|
|
8
8
|
isDisabled?: boolean;
|
|
9
9
|
localeKey?: IFilterLocaleKey;
|
|
10
10
|
locale?: IPartialFilterLocale;
|
|
11
|
-
filtersPaneRef: RefObject<HTMLDivElement> | null;
|
|
12
11
|
onChange: <V>(value: V) => void;
|
|
13
12
|
}
|
|
14
|
-
export declare function FilterWrapper<Values, Key extends keyof Values>({ filter, value, isDisabled, locale, localeKey, data, testId,
|
|
13
|
+
export declare function FilterWrapper<Values, Key extends keyof Values>({ filter, value, isDisabled, locale, localeKey, data, testId, tweakStyles, onChange, }: IFilterWrapperProps<Values, Key>): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../../../theme';
|
|
2
2
|
import type { IFilterValueViewStyles } from '../FilterValueView';
|
|
3
|
-
export declare const useStyles: import("../../../../theme").IUseStyles<"boolean" | "name" | "left" | "right" | "item" | "value" | "root" | "open" | "disabled" | "booleanItem" | "noValue" | "openNoValue" | "openWithValue" | "withValue" | "iconContainer" | "dropdown" | "animationEnd" | "animationStart" | "dropdown-
|
|
3
|
+
export declare const useStyles: import("../../../../theme").IUseStyles<"boolean" | "name" | "left" | "right" | "item" | "value" | "root" | "open" | "disabled" | "booleanItem" | "noValue" | "openNoValue" | "openWithValue" | "withValue" | "iconContainer" | "dropdown" | "animationEnd" | "animationStart" | "dropdown-initial" | "dropdown-open" | "dropdown-close" | "dropdown-unmounted", unknown>;
|
|
4
4
|
export type IFilterWrapperStyles = ITweakStyles<typeof useStyles, {
|
|
5
5
|
tweakValueView: IFilterValueViewStyles;
|
|
6
6
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isContentNotEmpty: (value: unknown) => boolean;
|
|
@@ -3,13 +3,11 @@ 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' | 'shouldHideOnScroll' | 'shouldRenderInBody' | 'canBeFlipped'>, ICommonProps<INewMoreMenuStyles> {
|
|
6
|
+
export interface INewMoreMenuProps extends Pick<IWithPopupProps, 'placement' | 'middlewares' | 'shouldHideOnScroll' | 'shouldRenderInBody' | 'canBeFlipped' | 'onToggle'>, ICommonProps<INewMoreMenuStyles> {
|
|
7
7
|
items: IListItem[];
|
|
8
8
|
/** @default false */
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
/** @default true */
|
|
11
11
|
hasDefaultStateBackground?: boolean;
|
|
12
|
-
/** @default 'bottom-end' */
|
|
13
|
-
placement?: IWithPopupProps['placement'];
|
|
14
12
|
}
|
|
15
13
|
export declare const NewMoreMenu: FC<INewMoreMenuProps>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { Placement, Middleware } from '@floating-ui/react';
|
|
2
|
+
import { Placement, Middleware, OffsetOptions, UseHoverProps } from '@floating-ui/react';
|
|
3
3
|
import { ICommonProps } from '../../types';
|
|
4
|
-
import { IPopupEventType } from './types';
|
|
4
|
+
import { IPopupEventType, ITransitionStatus } from './types';
|
|
5
5
|
import { IWithPopupStyles } from './WithPopup.styles';
|
|
6
6
|
export interface IWithPopupProps extends ICommonProps<IWithPopupStyles> {
|
|
7
7
|
trigger: ReactNode | FC<{
|
|
8
8
|
isActive: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
children: ReactNode | FC<{
|
|
11
|
+
status: ITransitionStatus;
|
|
11
12
|
onClose: () => void;
|
|
12
13
|
}>;
|
|
13
14
|
middlewares?: Middleware[];
|
|
@@ -20,9 +21,9 @@ export interface IWithPopupProps extends ICommonProps<IWithPopupStyles> {
|
|
|
20
21
|
/** @default 'click' */
|
|
21
22
|
eventType?: IPopupEventType;
|
|
22
23
|
/** @default 0 */
|
|
23
|
-
hoverDelay?:
|
|
24
|
+
hoverDelay?: UseHoverProps['delay'];
|
|
24
25
|
/** @default 6 */
|
|
25
|
-
popupOffset?:
|
|
26
|
+
popupOffset?: OffsetOptions;
|
|
26
27
|
/** @default false */
|
|
27
28
|
canBeFlipped?: boolean;
|
|
28
29
|
/** @default false */
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { useTransitionStatus } from '@floating-ui/react';
|
|
2
|
+
import type { POPUP_EVENT_TYPES } from './constants';
|
|
2
3
|
export type IPopupEventType = (typeof POPUP_EVENT_TYPES)[number];
|
|
4
|
+
export type ITransitionStatus = ReturnType<typeof useTransitionStatus>['status'];
|