forstok-ui-lib 8.5.1 → 8.5.3
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/index.d.ts +8 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/select/asyncPaginate.tsx +305 -243
- package/src/components/select/typed.ts +121 -92
|
@@ -1,118 +1,147 @@
|
|
|
1
|
-
import type { ActionMeta, OnChangeValue, SingleValueProps } from
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { ActionMeta, OnChangeValue, SingleValueProps } from "react-select";
|
|
2
|
+
import type {
|
|
3
|
+
OptionProps,
|
|
4
|
+
GroupBase,
|
|
5
|
+
StylesConfig,
|
|
6
|
+
CSSObjectWithLabel,
|
|
7
|
+
ControlProps,
|
|
8
|
+
ValueContainerProps,
|
|
9
|
+
MultiValueProps,
|
|
10
|
+
MultiValue,
|
|
11
|
+
OptionsOrGroups,
|
|
12
|
+
MenuListProps,
|
|
13
|
+
} from "react-select";
|
|
14
|
+
import type { Response } from "react-select-async-paginate";
|
|
15
|
+
import type { Moment } from "moment";
|
|
16
|
+
import type { CSSObject } from "@emotion/serialize";
|
|
17
|
+
import type { TChannel } from "../../typeds/shares.typed";
|
|
18
|
+
import type { TState } from "../../typeds";
|
|
8
19
|
|
|
9
20
|
type TskuAddons = {
|
|
10
|
-
id?: number
|
|
11
|
-
productId?: number
|
|
12
|
-
masterProductId?: string
|
|
13
|
-
imageUrl?: string
|
|
14
|
-
sku?: string
|
|
15
|
-
price?: number
|
|
16
|
-
quantity?: number
|
|
17
|
-
salePrice?: number
|
|
18
|
-
}
|
|
21
|
+
id?: number;
|
|
22
|
+
productId?: number;
|
|
23
|
+
masterProductId?: string;
|
|
24
|
+
imageUrl?: string;
|
|
25
|
+
sku?: string;
|
|
26
|
+
price?: number;
|
|
27
|
+
quantity?: number;
|
|
28
|
+
salePrice?: number;
|
|
29
|
+
};
|
|
19
30
|
|
|
20
31
|
type TWarehouseAddons = {
|
|
21
|
-
id?: number
|
|
22
|
-
newId?: string | null
|
|
23
|
-
name?: string
|
|
24
|
-
} | null
|
|
32
|
+
id?: number;
|
|
33
|
+
newId?: string | null;
|
|
34
|
+
name?: string;
|
|
35
|
+
} | null;
|
|
25
36
|
|
|
26
37
|
export type TOption = {
|
|
27
|
-
readonly value: any
|
|
28
|
-
readonly label: string
|
|
29
|
-
readonly name?: string
|
|
30
|
-
readonly isFixed?: boolean
|
|
31
|
-
readonly channel?: Omit<TChannel,
|
|
32
|
-
postalCode?: string
|
|
33
|
-
localId?: string
|
|
34
|
-
isDisabled?: boolean | null
|
|
35
|
-
momentValue?: Moment[]
|
|
38
|
+
readonly value: any;
|
|
39
|
+
readonly label: string;
|
|
40
|
+
readonly name?: string;
|
|
41
|
+
readonly isFixed?: boolean;
|
|
42
|
+
readonly channel?: Omit<TChannel, "stores">;
|
|
43
|
+
postalCode?: string;
|
|
44
|
+
localId?: string;
|
|
45
|
+
isDisabled?: boolean | null;
|
|
46
|
+
momentValue?: Moment[];
|
|
36
47
|
option?: {
|
|
37
|
-
readonly value: any
|
|
38
|
-
readonly label: string
|
|
39
|
-
localId?: string
|
|
40
|
-
}[]
|
|
48
|
+
readonly value: any;
|
|
49
|
+
readonly label: string;
|
|
50
|
+
localId?: string;
|
|
51
|
+
}[];
|
|
41
52
|
store?: {
|
|
42
|
-
id: number
|
|
43
|
-
name: string
|
|
44
|
-
warehouseId?: Array<string | null> | null
|
|
45
|
-
warehouseCount?: number | null
|
|
46
|
-
imageUrl?: string | null
|
|
47
|
-
warehouse?: TWarehouseAddons[] | null
|
|
48
|
-
}
|
|
49
|
-
} & TskuAddons
|
|
50
|
-
|
|
51
|
-
export type TLoadOption = (search: string, callback: () => void, { endCursor }: {
|
|
52
|
-
endCursor: string;
|
|
53
|
-
}) => Promise<{
|
|
54
|
-
options: any;
|
|
55
|
-
hasMore: any;
|
|
56
|
-
additional?: {
|
|
57
|
-
endCursor: any;
|
|
53
|
+
id: number;
|
|
54
|
+
name: string;
|
|
55
|
+
warehouseId?: Array<string | null> | null;
|
|
56
|
+
warehouseCount?: number | null;
|
|
57
|
+
imageUrl?: string | null;
|
|
58
|
+
warehouse?: TWarehouseAddons[] | null;
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
detail?: any;
|
|
61
|
+
} & TskuAddons;
|
|
62
|
+
|
|
63
|
+
export type TLoadOption = (
|
|
64
|
+
search: string,
|
|
65
|
+
callback: () => void,
|
|
66
|
+
{
|
|
67
|
+
endCursor,
|
|
68
|
+
}: {
|
|
69
|
+
endCursor: string;
|
|
70
|
+
},
|
|
71
|
+
) => Promise<
|
|
72
|
+
| {
|
|
73
|
+
options: any;
|
|
74
|
+
hasMore: any;
|
|
75
|
+
additional?: {
|
|
76
|
+
endCursor: any;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
| {
|
|
80
|
+
options: never[];
|
|
81
|
+
hasMore: boolean;
|
|
82
|
+
additional?: undefined;
|
|
83
|
+
}
|
|
84
|
+
| undefined
|
|
85
|
+
>;
|
|
86
|
+
|
|
87
|
+
export type TOnChangeValue = OnChangeValue<TOption, boolean>;
|
|
88
|
+
|
|
89
|
+
export type TOnChangeValueFalse = OnChangeValue<TOption, false>;
|
|
90
|
+
|
|
91
|
+
export type TOnChangeValueTrue = OnChangeValue<TOption, true>;
|
|
92
|
+
|
|
93
|
+
export type TActionMeta = ActionMeta<TOption>;
|
|
72
94
|
|
|
73
95
|
export type TSelectAsyncPaginate = {
|
|
74
|
-
customOption?: (arg0: OptionProps) => void
|
|
75
|
-
MenuList?: any
|
|
76
|
-
evChange?: (
|
|
77
|
-
|
|
96
|
+
customOption?: (arg0: OptionProps) => void;
|
|
97
|
+
MenuList?: any;
|
|
98
|
+
evChange?: (
|
|
99
|
+
newValue: TOnChangeValue,
|
|
100
|
+
actionMeta?: ActionMeta<TOption>,
|
|
101
|
+
) => void;
|
|
102
|
+
defaultValue?: TOnChangeValue;
|
|
78
103
|
// loadOptions: TLoadOption | LoadOptions<unknown, GroupBase<unknown>, unknown>
|
|
79
|
-
loadOptionsOnMenuOpen?: boolean
|
|
80
|
-
noOptionsMessage?: (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
setForceUpdate: TState<boolean>
|
|
90
|
-
}
|
|
104
|
+
loadOptionsOnMenuOpen?: boolean;
|
|
105
|
+
noOptionsMessage?: (obj: { inputValue: string }) => React.ReactNode;
|
|
106
|
+
isSearchable?: boolean;
|
|
107
|
+
isClearable?: boolean;
|
|
108
|
+
placeholder?: string;
|
|
109
|
+
isMenuOpen?: boolean;
|
|
110
|
+
setMenuIsOpen: TState<boolean | undefined>;
|
|
111
|
+
isForceUpdate: boolean;
|
|
112
|
+
setForceUpdate: TState<boolean>;
|
|
113
|
+
};
|
|
91
114
|
|
|
92
|
-
export type TCustomStylesWithVariable = StylesConfig<TOption, boolean
|
|
115
|
+
export type TCustomStylesWithVariable = StylesConfig<TOption, boolean>;
|
|
93
116
|
|
|
94
|
-
export type TCSSObject = CSSObject
|
|
117
|
+
export type TCSSObject = CSSObject;
|
|
95
118
|
|
|
96
|
-
export type TCSSObjectWithLabel = CSSObjectWithLabel
|
|
119
|
+
export type TCSSObjectWithLabel = CSSObjectWithLabel;
|
|
97
120
|
|
|
98
|
-
export type TControlPropsWithVariable = ControlProps<TOption, boolean
|
|
121
|
+
export type TControlPropsWithVariable = ControlProps<TOption, boolean>;
|
|
99
122
|
|
|
100
|
-
export type TOptionPropsWithVariable = OptionProps<TOption, boolean
|
|
123
|
+
export type TOptionPropsWithVariable = OptionProps<TOption, boolean>;
|
|
101
124
|
|
|
102
|
-
export type TGroupBaseWithVariable = GroupBase<TOption
|
|
125
|
+
export type TGroupBaseWithVariable = GroupBase<TOption>;
|
|
103
126
|
|
|
104
|
-
export type TSingleValueProps = SingleValueProps
|
|
127
|
+
export type TSingleValueProps = SingleValueProps;
|
|
105
128
|
|
|
106
|
-
export type TOptionProps = OptionProps
|
|
129
|
+
export type TOptionProps = OptionProps;
|
|
107
130
|
|
|
108
|
-
export type TValueContainerPropsWithVariable = ValueContainerProps<
|
|
131
|
+
export type TValueContainerPropsWithVariable = ValueContainerProps<
|
|
132
|
+
TOption,
|
|
133
|
+
boolean
|
|
134
|
+
>;
|
|
109
135
|
|
|
110
|
-
export type TMultiValuePropsWithVariable = MultiValueProps<TOption, boolean
|
|
136
|
+
export type TMultiValuePropsWithVariable = MultiValueProps<TOption, boolean>;
|
|
111
137
|
|
|
112
|
-
export type TMultiValue = MultiValue<TOption
|
|
138
|
+
export type TMultiValue = MultiValue<TOption>;
|
|
113
139
|
|
|
114
|
-
export type TOptionsOrGroupsWithVariable = OptionsOrGroups<
|
|
140
|
+
export type TOptionsOrGroupsWithVariable = OptionsOrGroups<
|
|
141
|
+
TOption,
|
|
142
|
+
GroupBase<TOption>
|
|
143
|
+
>;
|
|
115
144
|
|
|
116
|
-
export type TMenuListProps = MenuListProps
|
|
145
|
+
export type TMenuListProps = MenuListProps;
|
|
117
146
|
|
|
118
|
-
export type TResponseAsync = Response<unknown, TGroupBaseWithVariable, unknown
|
|
147
|
+
export type TResponseAsync = Response<unknown, TGroupBaseWithVariable, unknown>;
|