@true-engineering/true-react-common-ui-kit 1.8.1 → 1.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/dist/helpers/utils.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +793 -54
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +765 -25
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/FiltersPane/FilterSelect/locales.ts +1 -1
- package/src/components/FiltersPane/locales.ts +1 -1
- package/src/components/MultiSelectList/locales.ts +1 -1
- package/src/components/Select/Select.tsx +3 -3
- package/src/helpers/utils.ts +4 -2
- package/src/hooks/use-theme.ts +1 -1
- package/src/hooks/use-tweak-styles.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@true-engineering/true-react-common-ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "True Engineering React UI Kit with theming support",
|
|
5
5
|
"author": "True Engineering (https://trueengineering.ru)",
|
|
6
6
|
"keywords": [
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"date-fns": "2.29.3",
|
|
48
48
|
"hex-to-rgba": "2.0.1",
|
|
49
49
|
"jss": "10.9.2",
|
|
50
|
-
"lodash": "4.17.21",
|
|
50
|
+
"lodash-es": "4.17.21",
|
|
51
51
|
"react": "18.2.0",
|
|
52
52
|
"react-datepicker": "4.8.0",
|
|
53
53
|
"react-dom": "18.2.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@storybook/react": "6.5.15",
|
|
70
70
|
"@storybook/testing-library": "0.0.13",
|
|
71
71
|
"@swc/core": "^1.3.30",
|
|
72
|
-
"@types/lodash": "4.
|
|
72
|
+
"@types/lodash-es": "4.17.11",
|
|
73
73
|
"@types/react": "18.0.26",
|
|
74
74
|
"@types/react-datepicker": "4.8.0",
|
|
75
75
|
"@types/react-dom": "18.0.9",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
MouseEvent,
|
|
8
8
|
} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import
|
|
10
|
+
import merge from 'lodash-es/merge';
|
|
11
11
|
|
|
12
12
|
import { ICommonProps } from '../../types';
|
|
13
13
|
import { addDataAttributes, isNotEmpty, addDataTestId } from '../../helpers';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from 'react';
|
|
13
13
|
import { Styles } from 'jss';
|
|
14
14
|
import clsx from 'clsx';
|
|
15
|
-
import
|
|
15
|
+
import merge from 'lodash-es/merge';
|
|
16
16
|
import { debounce } from 'ts-debounce';
|
|
17
17
|
import { Portal } from 'react-overlays';
|
|
18
18
|
import { SelectList } from './SelectList';
|
|
@@ -190,8 +190,8 @@ export function Select<Value>({
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
const isActionInsideSelect =
|
|
193
|
-
hasExactParent(event.relatedTarget
|
|
194
|
-
hasExactParent(event.relatedTarget
|
|
193
|
+
hasExactParent(event.relatedTarget, list.current) ||
|
|
194
|
+
hasExactParent(event.relatedTarget, inputWrapper.current);
|
|
195
195
|
|
|
196
196
|
// Ниче не делаем если клик был внутри селекта
|
|
197
197
|
if (!isActionInsideSelect) {
|
package/src/helpers/utils.ts
CHANGED
|
@@ -28,8 +28,10 @@ export const hasExactParent = (element: Element, parent: Element): boolean => {
|
|
|
28
28
|
return hasExactParent(parentNode, parent);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const getParentNode = (
|
|
32
|
-
element
|
|
31
|
+
export const getParentNode = (
|
|
32
|
+
element: Element | ShadowRoot | Document,
|
|
33
|
+
): Element =>
|
|
34
|
+
element.nodeName === 'HTML' || element === document
|
|
33
35
|
? (element as Element)
|
|
34
36
|
: (element.parentNode as Element) ?? (element as ShadowRoot).host;
|
|
35
37
|
|
package/src/hooks/use-theme.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useContext, useMemo } from 'react';
|
|
2
2
|
import { createUseStyles, Styles } from 'react-jss';
|
|
3
|
-
import
|
|
3
|
+
import merge from 'lodash-es/merge';
|
|
4
4
|
|
|
5
5
|
import { ComponentName, UiKitTheme } from '../types';
|
|
6
6
|
import { commonTheme } from '../theme';
|