@mdtl/uikit 0.0.39 → 0.0.40

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.
@@ -1,39 +1,5 @@
1
1
  import { default as React, FC } from 'react';
2
- import { TextFieldProps } from '@mui/material/TextField';
3
- import { default as Autocomplete } from '@mui/material/Autocomplete';
4
- import { SxProps } from '@mui/system';
5
- import { CollectionPageType, Option, PayloadType } from './interfaces';
6
- export interface IAutocompleteSelectProps {
7
- multiple?: boolean;
8
- creatable?: boolean;
9
- getOptions: (payload: PayloadType) => Promise<CollectionPageType>;
10
- onChange: (option: Option | Option[]) => void;
11
- value: Option | Option[];
12
- /**
13
- * Поле fieldName для DataSelectionRequest - используется для поиска; обычно это может быть label/value Option-а
14
- */
15
- searchFieldName: string;
16
- placeholder?: string;
17
- invalid?: boolean;
18
- disabled?: boolean;
19
- tooltip?: string;
20
- showTooltip?: boolean;
21
- inputSize?: TextFieldProps['size'];
22
- /**
23
- * перезапрашивать данные каждый раз, когда открываем дропдаун
24
- * может быть полезно, если результат getOptions изменится при внешних манипуляциях
25
- */
26
- fetchOnEachOpen?: boolean;
27
- sx?: SxProps;
28
- inputLabel?: string;
29
- /**
30
- * Пропсы для настройки popper
31
- */
32
- popperProps?: React.ComponentProps<typeof Autocomplete>['slotProps']['popper'];
33
- filterOperation: any;
34
- itemsPerPage: number;
35
- reqCatchHandler: (error: unknown) => void;
36
- }
2
+ import { IAutocompleteSelectProps } from './interfaces';
37
3
  /**
38
4
  * Если от бэка получаем строку, которую используем и как label, и как value,
39
5
  * можно использовать функции
@@ -1,3 +1,6 @@
1
+ import { default as Autocomplete } from '@mui/material/Autocomplete';
2
+ import { SxProps } from '@mui/material/styles';
3
+ import { TextFieldProps } from '@mui/material/TextField';
1
4
  export type Option = {
2
5
  label: string;
3
6
  value: any;
@@ -17,3 +20,34 @@ export type CollectionPageType = {
17
20
  readonly totalPages: number;
18
21
  readonly data: Option[];
19
22
  };
23
+ export interface IAutocompleteSelectProps {
24
+ multiple?: boolean;
25
+ creatable?: boolean;
26
+ getOptions: (payload: PayloadType) => Promise<CollectionPageType>;
27
+ onChange: (option: Option | Option[]) => void;
28
+ value: Option | Option[];
29
+ /**
30
+ * Поле fieldName для DataSelectionRequest - используется для поиска; обычно это может быть label/value Option-а
31
+ */
32
+ searchFieldName: string;
33
+ placeholder?: string;
34
+ invalid?: boolean;
35
+ disabled?: boolean;
36
+ tooltip?: string;
37
+ showTooltip?: boolean;
38
+ inputSize?: TextFieldProps['size'];
39
+ /**
40
+ * перезапрашивать данные каждый раз, когда открываем дропдаун
41
+ * может быть полезно, если результат getOptions изменится при внешних манипуляциях
42
+ */
43
+ fetchOnEachOpen?: boolean;
44
+ sx?: SxProps;
45
+ inputLabel?: string;
46
+ /**
47
+ * Пропсы для настройки popper
48
+ */
49
+ popperProps?: React.ComponentProps<typeof Autocomplete>['slotProps']['popper'];
50
+ filterOperation: any;
51
+ itemsPerPage: number;
52
+ reqCatchHandler: (error: unknown) => void;
53
+ }
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export { LoadingIndicator } from './components/LoadingIndicator/LoadingIndicator
19
19
  export { Snackbar } from './components/Snackbar/Snackbar';
20
20
  export { Stepper } from './components/Stepper/Stepper';
21
21
  export { AutocompleteSelect } from './components/AutocompleteSelect/AutocompleteSelect';
22
- export type { Option } from './components/AutocompleteSelect/interfaces';
22
+ export type { Option, IAutocompleteSelectProps } from './components/AutocompleteSelect/interfaces';
23
23
  export * from './components/AutocompleteSelect/utils';
24
24
  export { calculateRightIconsWidth } from './utils/calculateRightIconsWidth';
25
25
  export { generateGuid } from './utils/generateGuid';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdtl/uikit",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "type": "module",
5
5
  "main": "./dist/uikit.js",
6
6
  "types": "./dist/index.d.ts",