forstok-ui-lib 5.2.12 → 5.2.18

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": "forstok-ui-lib",
3
- "version": "5.2.12",
3
+ "version": "5.2.18",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,7 @@ export { default as PopupComponent } from './popup';
14
14
  export { default as ReactPortalComponent } from './portal';
15
15
  export { default as ImageComponent } from './image';
16
16
  export { default as SelectComponent } from './select';
17
+ export { default as MenuList } from './select/menulist';
17
18
  export { default as ErrorComponent } from './error';
18
19
  export { default as UploadComponent } from './upload';
19
20
  export { default as UploadDragDropComponent } from './upload/drag_drop';
@@ -23,4 +24,4 @@ export * from './message/typed';
23
24
  export * from './popup/typed';
24
25
  export * from './select/typed';
25
26
 
26
- export * from './form/styles';
27
+ export * from './form/styles';
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'react';
2
+ import { components } from 'react-select';
3
+ import type { GroupBase, MenuListProps } from 'react-select';
4
+
5
+ const MenuList = (props: JSX.IntrinsicAttributes & MenuListProps<unknown, boolean, GroupBase<unknown>>) => {
6
+ return (
7
+ <components.MenuList {...props}>{props.children}</components.MenuList>
8
+ )
9
+ }
10
+
11
+ export default MenuList;
@@ -1,5 +1,8 @@
1
- import type { OnChangeValue } from 'react-select';
1
+ import type { ActionMeta, OnChangeValue } from 'react-select';
2
+ import type { OptionProps, GroupBase, StylesConfig, CSSObjectWithLabel, ControlProps } from 'react-select';
3
+ import { CSSObject } from '@emotion/serialize'
2
4
  import type { TChannel } from '../../typeds/shares.typed';
5
+ import type { TState } from '../../typeds';
3
6
 
4
7
  export type TOption = {
5
8
  readonly value: any
@@ -17,4 +20,51 @@ export type TOption = {
17
20
  }[]
18
21
  }
19
22
 
20
- export type TOnChangeValue = OnChangeValue<TOption, boolean>
23
+ export type TLoadOption = (search: string, callback: () => void, { endCursor }: {
24
+ endCursor: string;
25
+ }) => Promise<{
26
+ options: any;
27
+ hasMore: any;
28
+ additional?: {
29
+ endCursor: any;
30
+ };
31
+ } | {
32
+ options: never[];
33
+ hasMore: boolean;
34
+ additional?: undefined;
35
+ } | undefined>
36
+
37
+ export type TOnChangeValue = OnChangeValue<TOption, boolean>
38
+
39
+ export type TActionMeta = ActionMeta<TOption>
40
+
41
+ export type TSelectAsyncPaginate = {
42
+ customOption?: (arg0: OptionProps) => void
43
+ MenuList?: any
44
+ evChange?: (newValue: OnChangeValue<TOption, false>, actionMeta?: ActionMeta<TOption>) => void
45
+ defaultValue?: OnChangeValue<TOption, boolean>
46
+ // loadOptions: TLoadOption | LoadOptions<unknown, GroupBase<unknown>, unknown>
47
+ loadOptionsOnMenuOpen?: boolean
48
+ noOptionsMessage?: ((obj: {
49
+ inputValue: string;
50
+ }) => React.ReactNode)
51
+ isSearchable?: boolean
52
+ isClearable?: boolean
53
+ placeholder?: string
54
+ isMenuOpen?: boolean
55
+ setMenuIsOpen: TState<boolean|undefined>
56
+ isForceUpdate: boolean
57
+ setForceUpdate: TState<boolean>
58
+ }
59
+
60
+ export type TCustomStyles = StylesConfig<TOption, boolean>
61
+
62
+ export type TCSSObject = CSSObject
63
+
64
+ export type TCSSObjectWithLabel = CSSObjectWithLabel
65
+
66
+ export type TControlProps = ControlProps<TOption, boolean>
67
+
68
+ export type TOptionProps = OptionProps<TOption, boolean>
69
+
70
+ export type TGroupBase = GroupBase<TOption>