@true-engineering/true-react-common-ui-kit 1.5.0 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -170,6 +170,13 @@ export function Select<Value>({
170
170
  };
171
171
 
172
172
  const handleBlur = (event: FocusEvent<HTMLInputElement>) => {
173
+ // Когда что-то блокирует открытие листа, но блур все равно должен сработать
174
+ // например minSymbolsCount
175
+ if (isListOpen && !isOpen) {
176
+ handleListClose(event);
177
+ return;
178
+ }
179
+
173
180
  if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current)) {
174
181
  return;
175
182
  }
@@ -482,7 +489,7 @@ export function Select<Value>({
482
489
  event.preventDefault();
483
490
  }}
484
491
  onClick={onArrowClick}
485
- className={clsx(classes.arrow, isListOpen && classes.activeArrow)}
492
+ className={clsx(classes.arrow, isOpen && classes.activeArrow)}
486
493
  >
487
494
  <Icon type={dropdownIcon} />
488
495
  </div>
package/src/types.ts CHANGED
@@ -1,106 +1,106 @@
1
- import { Styles } from 'react-jss';
2
- import { Modifier, Placement } from 'react-overlays/usePopper';
3
- import {
4
- ICommonIcon,
5
- IComplexIcon,
6
- IPreloaderSvgType,
7
- ISvgIcon,
8
- } from './components';
9
-
10
- export interface IDataAttributes {
11
- [key: string]: unknown;
12
- }
13
-
14
- export interface ICommonProps {
15
- data?: IDataAttributes;
16
- }
17
-
18
- export interface IDropdownWithPopperOptions {
19
- shouldUsePopper?: boolean;
20
- shouldRenderInBody?: boolean;
21
- scrollParent?: 'auto' | 'document' | Element;
22
-
23
- shouldHideOnScroll?: boolean; // работает весьма условно без shouldUsePopper
24
- canBeFlipped?: boolean; // только с shouldUsePopper
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
- modifiers?: Array<Partial<Modifier<any, any>>>; // только с shouldUsePopper
27
- placement?: Placement; // only with shouldUsePopper
28
- // https://popper.js.org/docs/v2/modifiers/flip/
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
- flipOptions?: Record<string, any>; // только с shouldUsePopper
31
- }
32
-
33
- export type ComponentStyles<StyleSheet, Props = unknown> = Partial<
34
- Styles<keyof StyleSheet, Props>
35
- >;
36
-
37
- // TODO: Скрипт
38
- export type ComponentName =
39
- | 'AccountInfo'
40
- | 'AddButton'
41
- | 'Button'
42
- | 'CloseButton'
43
- | 'Checkbox'
44
- | 'CssBaseline'
45
- | 'Colors'
46
- | 'DateInput'
47
- | 'DatePicker'
48
- | 'DatePickerInput'
49
- | 'DatePickerHeader'
50
- | 'Description'
51
- | 'DotsPreloader'
52
- | 'SvgPreloader'
53
- | 'FiltersPane'
54
- | 'FilterInterval'
55
- | 'FilterSelect'
56
- | 'FilterWithDates'
57
- | 'FilterWithPeriod'
58
- | 'FilterWrapper'
59
- | 'FiltersPaneSearch'
60
- | 'Flag'
61
- | 'FlexibleTable'
62
- | 'Icon'
63
- | 'IncrementInput'
64
- | 'Input'
65
- | 'List'
66
- | 'Modal'
67
- | 'MoreMenu'
68
- | 'MultiSelect'
69
- | 'MultiSelectInput'
70
- | 'MultiSelectList'
71
- | 'Notification'
72
- | 'PhoneInput'
73
- | 'PhoneInputCountryList'
74
- | 'RadioButton'
75
- | 'SearchInput'
76
- | 'Select'
77
- | 'SelectList'
78
- | 'ScrollIntoViewIfNeeded'
79
- | 'Switch'
80
- | 'TextArea'
81
- | 'TextWithInfo'
82
- | 'TextWithTooltip'
83
- | 'ThemedPreloader'
84
- | 'Tooltip'
85
- | 'Toaster';
86
-
87
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
- export type UiKitAnimations = Record<string, any>;
89
- export type UiKitHelpers = Record<string, Styles | (() => Styles)>;
90
-
91
- export interface UiKitTheme {
92
- name: string;
93
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
94
- components?: Partial<Record<ComponentName, ComponentStyles<any, any>>>;
95
- /**
96
- * Для переопределения иконок, которые есть в UiKit
97
- */
98
- icons?: Partial<Record<ICommonIcon, ISvgIcon>>;
99
- complexIcons?: Partial<Record<IComplexIcon, string>>;
100
- preloaders?: Partial<Record<IPreloaderSvgType, string>>; // TODO: заменить string
101
- animations?: UiKitAnimations;
102
- colors?: Record<string, string>;
103
- dimensions?: Record<string, number>;
104
- boxShadows?: Record<string, string>;
105
- helpers?: UiKitHelpers;
106
- }
1
+ import { Styles } from 'react-jss';
2
+ import { Modifier, Placement } from 'react-overlays/usePopper';
3
+ import {
4
+ ICommonIcon,
5
+ IComplexIcon,
6
+ IPreloaderSvgType,
7
+ ISvgIcon,
8
+ } from './components';
9
+
10
+ export interface IDataAttributes {
11
+ [key: string]: unknown;
12
+ }
13
+
14
+ export interface ICommonProps {
15
+ data?: IDataAttributes;
16
+ }
17
+
18
+ export interface IDropdownWithPopperOptions {
19
+ shouldUsePopper?: boolean;
20
+ shouldRenderInBody?: boolean;
21
+ scrollParent?: 'auto' | 'document' | Element;
22
+
23
+ shouldHideOnScroll?: boolean; // работает весьма условно без shouldUsePopper
24
+ canBeFlipped?: boolean; // только с shouldUsePopper
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ modifiers?: Array<Partial<Modifier<any, any>>>; // только с shouldUsePopper
27
+ placement?: Placement; // only with shouldUsePopper
28
+ // https://popper.js.org/docs/v2/modifiers/flip/
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ flipOptions?: Record<string, any>; // только с shouldUsePopper
31
+ }
32
+
33
+ export type ComponentStyles<StyleSheet, Props = unknown> = Partial<
34
+ Styles<keyof StyleSheet, Props>
35
+ >;
36
+
37
+ // TODO: Скрипт
38
+ export type ComponentName =
39
+ | 'AccountInfo'
40
+ | 'AddButton'
41
+ | 'Button'
42
+ | 'CloseButton'
43
+ | 'Checkbox'
44
+ | 'CssBaseline'
45
+ | 'Colors'
46
+ | 'DateInput'
47
+ | 'DatePicker'
48
+ | 'DatePickerInput'
49
+ | 'DatePickerHeader'
50
+ | 'Description'
51
+ | 'DotsPreloader'
52
+ | 'SvgPreloader'
53
+ | 'FiltersPane'
54
+ | 'FilterInterval'
55
+ | 'FilterSelect'
56
+ | 'FilterWithDates'
57
+ | 'FilterWithPeriod'
58
+ | 'FilterWrapper'
59
+ | 'FiltersPaneSearch'
60
+ | 'Flag'
61
+ | 'FlexibleTable'
62
+ | 'Icon'
63
+ | 'IncrementInput'
64
+ | 'Input'
65
+ | 'List'
66
+ | 'Modal'
67
+ | 'MoreMenu'
68
+ | 'MultiSelect'
69
+ | 'MultiSelectInput'
70
+ | 'MultiSelectList'
71
+ | 'Notification'
72
+ | 'PhoneInput'
73
+ | 'PhoneInputCountryList'
74
+ | 'RadioButton'
75
+ | 'SearchInput'
76
+ | 'Select'
77
+ | 'SelectList'
78
+ | 'ScrollIntoViewIfNeeded'
79
+ | 'Switch'
80
+ | 'TextArea'
81
+ | 'TextWithInfo'
82
+ | 'TextWithTooltip'
83
+ | 'ThemedPreloader'
84
+ | 'Tooltip'
85
+ | 'Toaster';
86
+
87
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
+ export type UiKitAnimations = Record<string, any>;
89
+ export type UiKitHelpers = Record<string, Styles | (() => Styles)>;
90
+
91
+ export interface UiKitTheme {
92
+ name: string;
93
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
94
+ components?: Partial<Record<ComponentName, ComponentStyles<any, any>>>;
95
+ /**
96
+ * Для переопределения иконок, которые есть в UiKit
97
+ */
98
+ icons?: Partial<Record<ICommonIcon, ISvgIcon>>;
99
+ complexIcons?: Partial<Record<IComplexIcon, string>>;
100
+ preloaders?: Partial<Record<IPreloaderSvgType, string>>; // TODO: заменить string
101
+ animations?: UiKitAnimations;
102
+ colors?: Record<string, string>;
103
+ dimensions?: Record<string, number>;
104
+ boxShadows?: Record<string, string>;
105
+ helpers?: UiKitHelpers;
106
+ }