@true-engineering/true-react-common-ui-kit 3.55.0 → 3.56.1
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 +11 -727
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +1 -1
- package/dist/components/WithPopup/WithPopup.d.ts +11 -3
- package/dist/true-react-common-ui-kit.js +439 -386
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +439 -386
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +4 -2
- package/src/components/FlexibleTable/FlexibleTable.tsx +4 -1
- package/src/components/Select/components/SelectList/SelectList.tsx +1 -1
- package/src/components/WithPopup/WithPopup.tsx +29 -7
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { rgba } from '../../helpers';
|
|
2
|
-
import { colors, ITweakStyles, createThemedStyles, animations } from '../../theme';
|
|
2
|
+
import { colors, ITweakStyles, createThemedStyles, animations, helpers } from '../../theme';
|
|
3
3
|
import type { IFlexibleTableRowStyles } from './components';
|
|
4
4
|
|
|
5
5
|
export const STICKY_SHADOW_PADDING = 12;
|
|
6
6
|
|
|
7
7
|
export const useStyles = createThemedStyles('FlexibleTable', {
|
|
8
|
+
flexibleTableWrapper: {},
|
|
9
|
+
|
|
8
10
|
root: {
|
|
9
11
|
width: '100%',
|
|
10
12
|
position: 'relative',
|
|
@@ -13,7 +15,7 @@ export const useStyles = createThemedStyles('FlexibleTable', {
|
|
|
13
15
|
},
|
|
14
16
|
|
|
15
17
|
scroll: {
|
|
16
|
-
|
|
18
|
+
...helpers.withScrollBar,
|
|
17
19
|
/*
|
|
18
20
|
Чтобы сделать таблицу на всю высоту проставьте
|
|
19
21
|
height у родителя таблицы у себя в проекте.
|
|
@@ -221,7 +221,10 @@ export function FlexibleTable<
|
|
|
221
221
|
const Table = TableRenders[renderMode];
|
|
222
222
|
|
|
223
223
|
return (
|
|
224
|
-
<div
|
|
224
|
+
<div
|
|
225
|
+
ref={ref}
|
|
226
|
+
className={clsx(classes.flexibleTableWrapper, { [classes.scroll]: isHorizontallyScrollable })}
|
|
227
|
+
>
|
|
225
228
|
<Table.Root
|
|
226
229
|
className={classes.root}
|
|
227
230
|
{...addDataTestId(testId)}
|
|
@@ -84,7 +84,7 @@ export function SelectList<Value>({
|
|
|
84
84
|
})}
|
|
85
85
|
>
|
|
86
86
|
{isHeaderNotEmpty && <div className={classes.listHeader}>{customListHeader}</div>}
|
|
87
|
-
<div className={classes.list} {...addDataTestId(testId)}>
|
|
87
|
+
<div className={classes.list} {...addDataTestId(testId)} tabIndex={-1}>
|
|
88
88
|
{isLoading ? (
|
|
89
89
|
<div className={clsx(classes.cell, classes.loading)}>{loadingLabel}</div>
|
|
90
90
|
) : (
|
|
@@ -24,6 +24,10 @@ import {
|
|
|
24
24
|
useFocus,
|
|
25
25
|
FloatingArrow,
|
|
26
26
|
arrow,
|
|
27
|
+
UseClickProps,
|
|
28
|
+
UseFocusProps,
|
|
29
|
+
UseDismissProps,
|
|
30
|
+
UseTransitionStatusProps,
|
|
27
31
|
} from '@floating-ui/react';
|
|
28
32
|
import { ICommonProps, IDataAttributes, IRenderNode } from '../../types';
|
|
29
33
|
import { DEFAULT_OFFSET } from './constants';
|
|
@@ -46,8 +50,11 @@ export interface IWithPopupProps extends ICommonProps<IWithPopupStyles> {
|
|
|
46
50
|
placement?: Placement;
|
|
47
51
|
/** @default 'click' */
|
|
48
52
|
eventType?: IPopupEventType;
|
|
49
|
-
/**
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Используйте hoverOptions
|
|
55
|
+
* @default 0
|
|
56
|
+
*/
|
|
57
|
+
hoverDelay?: number;
|
|
51
58
|
/** @default 6 */
|
|
52
59
|
popupOffset?: OffsetOptions;
|
|
53
60
|
arrowProps?: IPopupArrowProps;
|
|
@@ -70,6 +77,11 @@ export interface IWithPopupProps extends ICommonProps<IWithPopupStyles> {
|
|
|
70
77
|
/** Должна ли минимальная ширина попапа быть равна ширине триггера
|
|
71
78
|
* @default false */
|
|
72
79
|
isMinWidthSameAsTrigger?: boolean;
|
|
80
|
+
hoverOptions?: UseHoverProps;
|
|
81
|
+
clickOptions?: UseClickProps;
|
|
82
|
+
focusOptions?: UseFocusProps;
|
|
83
|
+
dismissOptions?: UseDismissProps;
|
|
84
|
+
transitionOptions?: UseTransitionStatusProps;
|
|
73
85
|
onToggle?: (isActive: boolean, event?: IWithPopupToggleEvent) => void;
|
|
74
86
|
}
|
|
75
87
|
|
|
@@ -91,6 +103,11 @@ export const WithPopup: FC<IWithPopupProps> = ({
|
|
|
91
103
|
isDisabled = false,
|
|
92
104
|
shouldShowArrow = false,
|
|
93
105
|
isMinWidthSameAsTrigger = false,
|
|
106
|
+
hoverOptions,
|
|
107
|
+
clickOptions,
|
|
108
|
+
focusOptions,
|
|
109
|
+
dismissOptions,
|
|
110
|
+
transitionOptions,
|
|
94
111
|
tweakStyles,
|
|
95
112
|
data,
|
|
96
113
|
testId,
|
|
@@ -130,22 +147,27 @@ export const WithPopup: FC<IWithPopupProps> = ({
|
|
|
130
147
|
|
|
131
148
|
const hover = useHover(context, {
|
|
132
149
|
enabled: eventType === 'hover',
|
|
133
|
-
delay:
|
|
150
|
+
delay: { open: hoverDelay, close: 0 },
|
|
134
151
|
handleClose: safePolygon(),
|
|
152
|
+
...hoverOptions,
|
|
135
153
|
});
|
|
136
154
|
|
|
137
|
-
const focus = useFocus(context, { enabled: eventType === 'hover' });
|
|
155
|
+
const focus = useFocus(context, { enabled: eventType === 'hover', ...focusOptions });
|
|
138
156
|
|
|
139
|
-
const click = useClick(context, { enabled: eventType === 'click' });
|
|
157
|
+
const click = useClick(context, { enabled: eventType === 'click', ...clickOptions });
|
|
140
158
|
|
|
141
159
|
const dismiss = useDismiss(context, {
|
|
142
160
|
enabled: eventType === 'click',
|
|
143
161
|
ancestorScroll: shouldHideOnScroll,
|
|
162
|
+
...dismissOptions,
|
|
144
163
|
});
|
|
145
164
|
|
|
146
165
|
const { getFloatingProps, getReferenceProps } = useInteractions([hover, click, focus, dismiss]);
|
|
147
166
|
|
|
148
|
-
const { isMounted, status } = useTransitionStatus(context, {
|
|
167
|
+
const { isMounted, status } = useTransitionStatus(context, {
|
|
168
|
+
duration: { close: 500 },
|
|
169
|
+
...transitionOptions,
|
|
170
|
+
});
|
|
149
171
|
|
|
150
172
|
const referenceProps: IReferenceProps = getReferenceProps({
|
|
151
173
|
ref: refs.setReference,
|
|
@@ -189,7 +211,7 @@ export const WithPopup: FC<IWithPopupProps> = ({
|
|
|
189
211
|
style={floatingStyles}
|
|
190
212
|
className={classes.popup}
|
|
191
213
|
{...getFloatingProps()}
|
|
192
|
-
{...addDataAttributes(popupData)}
|
|
214
|
+
{...addDataAttributes(popupData, testId, 'popup')}
|
|
193
215
|
>
|
|
194
216
|
<div className={classes[`dropdown-${status}`]}>
|
|
195
217
|
{shouldShowArrow && (
|