forstok-ui-lib 8.5.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "8.5.2",
3
+ "version": "8.5.3",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -1,46 +1,57 @@
1
- import { useCallback, useEffect, useRef, useState } from 'react'
2
- import { AsyncPaginate } from 'react-select-async-paginate'
3
- import type { LoadOptions } from 'react-select-async-paginate'
4
- import { ActionMeta, ControlProps, CSSObjectWithLabel, GroupBase, OnChangeValue, OptionProps, StylesConfig } from 'react-select'
1
+ import { useCallback, useEffect, useRef, useState } from "react";
2
+ import { AsyncPaginate } from "react-select-async-paginate";
3
+ import type { LoadOptions } from "react-select-async-paginate";
4
+ import {
5
+ ActionMeta,
6
+ ControlProps,
7
+ CSSObjectWithLabel,
8
+ GroupBase,
9
+ OnChangeValue,
10
+ OptionProps,
11
+ StylesConfig,
12
+ } from "react-select";
5
13
 
6
- import type { CSSObject } from '@emotion/serialize'
7
- import type { TState } from '../../typeds/base.typed'
8
- import type { TLoadOption, TOption } from './typed'
14
+ import type { CSSObject } from "@emotion/serialize";
15
+ import type { TState } from "../../typeds/base.typed";
16
+ import type { TLoadOption, TOption } from "./typed";
9
17
 
10
18
  type TSelect = {
11
- type?: string
12
- mode?: string
13
- isError?: boolean
14
- customOption?: (arg0: OptionProps) => void
15
- MenuList?: any
16
- reset?: boolean
17
- setReset?: TState<boolean>
18
- evChange?: (newValue: OnChangeValue<TOption, boolean>, actionMeta?: ActionMeta<TOption>) => void
19
- defaultValue?: OnChangeValue<TOption, boolean>
20
- loadOptions: LoadOptions<unknown, GroupBase<unknown>, unknown> | TLoadOption
21
- loadOptionsOnMenuOpen?: boolean
22
- noOptionsMessage?: ((obj: {
23
- inputValue: string
24
- }) => React.ReactNode)
25
- isSearchable?: boolean
26
- isClearable?: boolean
27
- placeholder?: string
28
- isMenuOpen?: boolean
29
- setMenuIsOpen?: TState<boolean | undefined>
30
- isForceUpdate?: boolean
31
- setForceUpdate?: TState<boolean>
32
- isMulti?: boolean
33
- iconLeft?: boolean | string
34
- loadedOptions?: TOption[]
35
- 'data-qa-id'?: string
36
- evChangeOnMenuClose?: (value: OnChangeValue<TOption, boolean> | undefined) => void
37
- id?: string
38
- isDisabled?: boolean
39
- }
19
+ type?: string;
20
+ mode?: string;
21
+ isError?: boolean;
22
+ customOption?: (arg0: OptionProps) => void;
23
+ MenuList?: any;
24
+ reset?: boolean;
25
+ setReset?: TState<boolean>;
26
+ evChange?: (
27
+ newValue: OnChangeValue<TOption, boolean>,
28
+ actionMeta?: ActionMeta<TOption>,
29
+ ) => void;
30
+ defaultValue?: OnChangeValue<TOption, boolean>;
31
+ loadOptions: LoadOptions<unknown, GroupBase<unknown>, unknown> | TLoadOption;
32
+ loadOptionsOnMenuOpen?: boolean;
33
+ noOptionsMessage?: (obj: { inputValue: string }) => React.ReactNode;
34
+ isSearchable?: boolean;
35
+ isClearable?: boolean;
36
+ placeholder?: string;
37
+ isMenuOpen?: boolean;
38
+ setMenuIsOpen?: TState<boolean | undefined>;
39
+ isForceUpdate?: boolean;
40
+ setForceUpdate?: TState<boolean>;
41
+ isMulti?: boolean;
42
+ iconLeft?: boolean | string;
43
+ loadedOptions?: TOption[];
44
+ "data-qa-id"?: string;
45
+ evChangeOnMenuClose?: (
46
+ value: OnChangeValue<TOption, boolean> | undefined,
47
+ ) => void;
48
+ id?: string;
49
+ isDisabled?: boolean;
50
+ };
40
51
 
41
52
  const SelectAsyncPaginateComponent = ({ loadOptions, ...props }: TSelect) => {
42
53
  const {
43
- isError=false,
54
+ isError = false,
44
55
  mode,
45
56
  type,
46
57
  customOption,
@@ -62,237 +73,288 @@ const SelectAsyncPaginateComponent = ({ loadOptions, ...props }: TSelect) => {
62
73
  setMenuIsOpen,
63
74
  id,
64
75
  evChangeOnMenuClose,
65
- ...rest
66
- } = props
76
+ ...rest
77
+ } = props;
67
78
 
68
- const [valueSelect, setValueSelect] = useState<typeof defaultValue>(defaultValue || null)
69
- const [inputValue, setInputValue] = useState<string>("")
70
- const [_time, setTime] = useState<Date>(new Date())
79
+ const [valueSelect, setValueSelect] = useState<typeof defaultValue>(
80
+ defaultValue || null,
81
+ );
82
+ const [inputValue, setInputValue] = useState<string>("");
83
+ const [_time, setTime] = useState<Date>(new Date());
71
84
 
72
- const selectRef = useRef<HTMLElement | null>(null)
85
+ const selectRef = useRef<HTMLElement | null>(null);
73
86
 
74
87
  useEffect(() => {
75
88
  if (isForceUpdate) {
76
- setValueSelect(defaultValue || null)
77
- setForceUpdate && setForceUpdate(false)
89
+ setValueSelect(defaultValue || null);
90
+ setForceUpdate && setForceUpdate(false);
78
91
  }
79
- }, [defaultValue, isForceUpdate, setForceUpdate, setValueSelect])
92
+ }, [defaultValue, isForceUpdate, setForceUpdate, setValueSelect]);
80
93
 
81
- const handleChange = (value: OnChangeValue<TOption, boolean>, actionMeta?: ActionMeta<TOption>) => {
82
- const newValue = value as OnChangeValue<TOption, false>
94
+ const handleChange = (
95
+ value: OnChangeValue<TOption, boolean>,
96
+ actionMeta?: ActionMeta<TOption>,
97
+ ) => {
98
+ const newValue = value as OnChangeValue<TOption, false>;
99
+ if (actionMeta?.action === "select-option") {
100
+ setInputValue("");
101
+ }
83
102
  if (actionMeta) {
84
- const { action, option } = actionMeta
85
- if (action === "select-option" && option?.value === '*') {
86
- const newValueSelect = valueSelect as OnChangeValue<TOption, true>
87
- if(newValueSelect?.length) {
88
- let _newValue = loadedOptions ? [...newValueSelect, ...loadedOptions] : [...newValueSelect]
89
- _newValue = _newValue.filter((_value, idx, self) => idx === self.findIndex((t) => (t.sku === _value.sku)))
90
- setValueSelect(_newValue)
91
- evChange && evChange(_newValue, actionMeta)
103
+ const { action, option } = actionMeta;
104
+ if (action === "select-option" && option?.value === "*") {
105
+ const newValueSelect = valueSelect as OnChangeValue<TOption, true>;
106
+ if (newValueSelect?.length) {
107
+ let _newValue = loadedOptions
108
+ ? [...newValueSelect, ...loadedOptions]
109
+ : [...newValueSelect];
110
+ _newValue = _newValue.filter(
111
+ (_value, idx, self) =>
112
+ idx === self.findIndex((t) => t.sku === _value.sku),
113
+ );
114
+ setValueSelect(_newValue);
115
+ evChange && evChange(_newValue, actionMeta);
92
116
  } else if (loadedOptions) {
93
- setValueSelect(loadedOptions)
94
- evChange && evChange(loadedOptions, actionMeta)
117
+ setValueSelect(loadedOptions);
118
+ evChange && evChange(loadedOptions, actionMeta);
95
119
  }
96
- selectRef.current?.blur()
97
- return false
120
+ selectRef.current?.blur();
121
+ return false;
98
122
  }
99
123
  }
100
- setValueSelect(newValue)
101
- evChange && evChange(newValue, actionMeta)
102
- }
124
+ setValueSelect(newValue);
125
+ evChange && evChange(newValue, actionMeta);
126
+ };
103
127
 
104
128
  const customStyles: StylesConfig<TOption, boolean> = {
105
- container: (provided: CSSObject) => ({
106
- ...provided,
107
- display: 'inline-block',
108
- width: '100%',
109
- minHeight: '1px',
110
- textAlign: 'left',
111
- border: 'none',
112
- } as CSSObjectWithLabel),
113
- control: (provided: CSSObject, state: ControlProps<TOption, boolean>) => ({
114
- ...provided,
115
- width: '100%',
116
- borderRadius: '.5rem',
117
- minHeight: '1px',
118
- height: isMulti ? 'auto' : mode === 'small' ? '30px' : '32px',
119
- cursor: 'pointer',
120
- borderWidth: isError ? '1px' : '0',
121
- boxShadow: (state.isFocused) ? '-.0625rem 0rem .0625rem 0rem rgba(26, 26, 26, .122) inset, .0625rem 0rem .0625rem 0rem rgba(26, 26, 26, .122) inset, 0rem .125rem .0625rem 0rem rgba(26, 26, 26, .2) inset' : '0rem -.0625rem 0rem 0rem #b5b5b5 inset,0rem 0rem 0rem .0625rem rgba(0, 0, 0, .1) inset,0rem .03125rem 0rem .09375rem #FFF inset',
122
- borderColor: ((state.isFocused && mode !== 'filter') && !isError) ? 'var(--pri-clr-ln__fc)' : (isError ? 'var(--err-clr-ln)' : (mode ==='filter' ? '#ffffff' : ' var(--ck-clr-ln)' )),
123
- background: state.isFocused ? 'rgba(247, 247, 247, 1)' : '#ffffff',
124
- overflow: mode === 'picklist' ? 'hidden': 'initial',
125
- '&:hover': {
126
- borderColor: ((state.isFocused && mode !== 'filter') && !isError) ? 'var(--pri-clr-ln__fc)' : (isError ? 'var(--err-clr-ln)' : (mode ==='filter' ? '#ffffff' : ' var(--ck-clr-ln)' )),
127
- background: 'rgba(250, 250, 250, 1)',
128
- color: 'rgba(48, 48, 48, 1)'
129
- }
130
- } as CSSObjectWithLabel),
131
- placeholder: (provided: CSSObject) => ({
132
- ...provided,
133
- fontStyle: 'italic'
134
- } as CSSObjectWithLabel),
135
- input: (provided: CSSObject) => ({
136
- ...provided,
137
- minHeight: '1px',
138
- margin: '0 2px',
139
- padding: '0',
140
- 'input': {
141
- boxShadow: 'none !important'
142
- }
143
- } as CSSObjectWithLabel),
144
- singleValue: (provided: CSSObject) => ({
145
- ...provided,
146
- minHeight: '1px',
147
- paddingBottom: '2px',
148
- color: 'initial',
149
- } as CSSObjectWithLabel),
150
- dropdownIndicator: (provided: CSSObject) => ({
151
- ...provided,
152
- minHeight: '1px',
153
- paddingTop: '0',
154
- paddingBottom: '0',
155
- paddingLeft: '2px',
156
- paddingRight: '2px',
157
- color: '#757575',
158
- } as CSSObjectWithLabel),
159
- indicatorSeparator: (provided: CSSObject) => ({
160
- ...provided,
161
- minHeight: '1px',
162
- height: '24px',
163
- display: (type=== 'tag') ? 'block' : 'none'
164
- } as CSSObjectWithLabel),
165
- clearIndicator: (provided: CSSObject) => ({
166
- ...provided,
167
- minHeight: '1px',
168
- marginRight: '-6px',
169
- padding: '0'
170
- } as CSSObjectWithLabel),
171
- valueContainer: (provided: CSSObject) => ({
172
- ...provided,
173
- minHeight: '1px',
174
- height: mode === 'multi-select' ? '70px' : mode === 'small' ? '30px' : '32px',
175
- paddingTop: isMulti ? '4px' : '0',
176
- paddingBottom: isMulti ? '4px' : '0',
177
- paddingLeft: iconLeft ? '28px' : '8px',
178
- paddingRight: '2px',
179
- maxHeight: isMulti ? '60px' : 'unset',
180
- overflow: isMulti ? 'auto' : 'initial',
181
- alignContent: isMulti ? 'flex-start' : 'initial'
182
- } as CSSObjectWithLabel),
183
- option: (provided: CSSObject, state: OptionProps<TOption, boolean>) => ({
184
- ...provided,
185
- width: '100%',
186
- margin: '0 0 4px',
187
- borderRadius: 'var(--nav-rd)',
188
- cursor: 'pointer',
189
- overflowWrap: 'break-word',
190
- wordBreak: 'break-all',
191
- position: 'relative',
192
- backgroundColor: state.isSelected || state.isFocused ? 'var(--nav-clr-bg__hvr)' : 'transparent',
193
- '&:last-child': {
194
- marginBottom: 0,
195
- },
196
- ...(!state.isDisabled && {
197
- color: 'var(--pri-clr)',
198
- fontWeight: state.isSelected ? 500 : 'normal',
199
- '&:hover': {
200
- backgroundColor: 'var(--nav-clr-bg__hvr)',
129
+ container: (provided: CSSObject) =>
130
+ ({
131
+ ...provided,
132
+ display: "inline-block",
133
+ width: "100%",
134
+ minHeight: "1px",
135
+ textAlign: "left",
136
+ border: "none",
137
+ }) as CSSObjectWithLabel,
138
+ control: (provided: CSSObject, state: ControlProps<TOption, boolean>) =>
139
+ ({
140
+ ...provided,
141
+ width: "100%",
142
+ borderRadius: ".5rem",
143
+ minHeight: "1px",
144
+ height: isMulti ? "auto" : mode === "small" ? "30px" : "32px",
145
+ cursor: "pointer",
146
+ borderWidth: isError ? "1px" : "0",
147
+ boxShadow: state.isFocused
148
+ ? "-.0625rem 0rem .0625rem 0rem rgba(26, 26, 26, .122) inset, .0625rem 0rem .0625rem 0rem rgba(26, 26, 26, .122) inset, 0rem .125rem .0625rem 0rem rgba(26, 26, 26, .2) inset"
149
+ : "0rem -.0625rem 0rem 0rem #b5b5b5 inset,0rem 0rem 0rem .0625rem rgba(0, 0, 0, .1) inset,0rem .03125rem 0rem .09375rem #FFF inset",
150
+ borderColor:
151
+ state.isFocused && mode !== "filter" && !isError
152
+ ? "var(--pri-clr-ln__fc)"
153
+ : isError
154
+ ? "var(--err-clr-ln)"
155
+ : mode === "filter"
156
+ ? "#ffffff"
157
+ : " var(--ck-clr-ln)",
158
+ background: state.isFocused ? "rgba(247, 247, 247, 1)" : "#ffffff",
159
+ overflow: mode === "picklist" ? "hidden" : "initial",
160
+ "&:hover": {
161
+ borderColor:
162
+ state.isFocused && mode !== "filter" && !isError
163
+ ? "var(--pri-clr-ln__fc)"
164
+ : isError
165
+ ? "var(--err-clr-ln)"
166
+ : mode === "filter"
167
+ ? "#ffffff"
168
+ : " var(--ck-clr-ln)",
169
+ background: "rgba(250, 250, 250, 1)",
170
+ color: "rgba(48, 48, 48, 1)",
201
171
  },
202
- }),
203
- ...(state.isSelected && {
204
- paddingRight: '1.75em',
205
- '&:after': {
206
- content: '""',
207
- position: 'absolute',
208
- top: '50%',
209
- transform: 'translateY(-50%)',
210
- right: '7px',
211
- bottom: '0',
212
- width: '12px',
213
- height: '20px'
214
- }
215
- })
216
- } as CSSObjectWithLabel),
217
- menu: (provided: CSSObject) => ({
218
- ...provided,
219
- padding: '8px',
220
- borderRadius: '.75rem',
221
- boxShadow: '0rem .5rem 1.5rem -.5rem rgba(0, 0, 0, .05), 0rem .5rem 1rem -.25rem rgba(0, 0, 0, .05), 0rem .1875rem .375rem 0rem rgba(0, 0, 0, .05), 0rem .125rem .25rem 0rem rgba(0, 0, 0, .05), 0rem .0625rem .125rem 0rem rgba(0, 0, 0, .05), 0rem 0rem 0rem .0625rem rgba(0, 0, 0, .06)',
222
- border: 'none'
223
- } as CSSObjectWithLabel),
224
- menuPortal: (provided: CSSObject) => ({
225
- ...provided,
226
- zIndex: 9999,
227
- letterSpacing: 'normal',
228
- lineHeight: 'normal',
229
- } as CSSObjectWithLabel)
230
- }
172
+ }) as CSSObjectWithLabel,
173
+ placeholder: (provided: CSSObject) =>
174
+ ({
175
+ ...provided,
176
+ fontStyle: "italic",
177
+ }) as CSSObjectWithLabel,
178
+ input: (provided: CSSObject) =>
179
+ ({
180
+ ...provided,
181
+ minHeight: "1px",
182
+ margin: "0 2px",
183
+ padding: "0",
184
+ input: {
185
+ boxShadow: "none !important",
186
+ },
187
+ }) as CSSObjectWithLabel,
188
+ singleValue: (provided: CSSObject) =>
189
+ ({
190
+ ...provided,
191
+ minHeight: "1px",
192
+ paddingBottom: "2px",
193
+ color: "initial",
194
+ }) as CSSObjectWithLabel,
195
+ dropdownIndicator: (provided: CSSObject) =>
196
+ ({
197
+ ...provided,
198
+ minHeight: "1px",
199
+ paddingTop: "0",
200
+ paddingBottom: "0",
201
+ paddingLeft: "2px",
202
+ paddingRight: "2px",
203
+ color: "#757575",
204
+ }) as CSSObjectWithLabel,
205
+ indicatorSeparator: (provided: CSSObject) =>
206
+ ({
207
+ ...provided,
208
+ minHeight: "1px",
209
+ height: "24px",
210
+ display: type === "tag" ? "block" : "none",
211
+ }) as CSSObjectWithLabel,
212
+ clearIndicator: (provided: CSSObject) =>
213
+ ({
214
+ ...provided,
215
+ minHeight: "1px",
216
+ marginRight: "-6px",
217
+ padding: "0",
218
+ }) as CSSObjectWithLabel,
219
+ valueContainer: (provided: CSSObject) =>
220
+ ({
221
+ ...provided,
222
+ minHeight: "1px",
223
+ height:
224
+ mode === "multi-select" ? "70px" : mode === "small" ? "30px" : "32px",
225
+ paddingTop: isMulti ? "4px" : "0",
226
+ paddingBottom: isMulti ? "4px" : "0",
227
+ paddingLeft: iconLeft ? "28px" : "8px",
228
+ paddingRight: "2px",
229
+ maxHeight: isMulti ? "60px" : "unset",
230
+ overflow: isMulti ? "auto" : "initial",
231
+ alignContent: isMulti ? "flex-start" : "initial",
232
+ }) as CSSObjectWithLabel,
233
+ option: (provided: CSSObject, state: OptionProps<TOption, boolean>) =>
234
+ ({
235
+ ...provided,
236
+ width: "100%",
237
+ margin: "0 0 4px",
238
+ borderRadius: "var(--nav-rd)",
239
+ cursor: "pointer",
240
+ overflowWrap: "break-word",
241
+ wordBreak: "break-all",
242
+ position: "relative",
243
+ backgroundColor:
244
+ state.isSelected || state.isFocused
245
+ ? "var(--nav-clr-bg__hvr)"
246
+ : "transparent",
247
+ "&:last-child": {
248
+ marginBottom: 0,
249
+ },
250
+ ...(!state.isDisabled && {
251
+ color: "var(--pri-clr)",
252
+ fontWeight: state.isSelected ? 500 : "normal",
253
+ "&:hover": {
254
+ backgroundColor: "var(--nav-clr-bg__hvr)",
255
+ },
256
+ }),
257
+ ...(state.isSelected && {
258
+ paddingRight: "1.75em",
259
+ "&:after": {
260
+ content: '"✔"',
261
+ position: "absolute",
262
+ top: "50%",
263
+ transform: "translateY(-50%)",
264
+ right: "7px",
265
+ bottom: "0",
266
+ width: "12px",
267
+ height: "20px",
268
+ },
269
+ }),
270
+ }) as CSSObjectWithLabel,
271
+ menu: (provided: CSSObject) =>
272
+ ({
273
+ ...provided,
274
+ padding: "8px",
275
+ borderRadius: ".75rem",
276
+ boxShadow:
277
+ "0rem .5rem 1.5rem -.5rem rgba(0, 0, 0, .05), 0rem .5rem 1rem -.25rem rgba(0, 0, 0, .05), 0rem .1875rem .375rem 0rem rgba(0, 0, 0, .05), 0rem .125rem .25rem 0rem rgba(0, 0, 0, .05), 0rem .0625rem .125rem 0rem rgba(0, 0, 0, .05), 0rem 0rem 0rem .0625rem rgba(0, 0, 0, .06)",
278
+ border: "none",
279
+ }) as CSSObjectWithLabel,
280
+ menuPortal: (provided: CSSObject) =>
281
+ ({
282
+ ...provided,
283
+ zIndex: 9999,
284
+ letterSpacing: "normal",
285
+ lineHeight: "normal",
286
+ }) as CSSObjectWithLabel,
287
+ };
231
288
 
232
289
  const onMenuOpen = useCallback(() => {
233
- setMenuIsOpen && setMenuIsOpen(true)
234
- }, [setMenuIsOpen])
290
+ setMenuIsOpen && setMenuIsOpen(true);
291
+ }, [setMenuIsOpen]);
235
292
 
236
293
  const onMenuClose = useCallback(() => {
237
- setMenuIsOpen && setMenuIsOpen(false)
238
- }, [setMenuIsOpen])
294
+ setMenuIsOpen && setMenuIsOpen(false);
295
+ }, [setMenuIsOpen]);
239
296
 
240
297
  const evToogleSelect = () => {
241
- const containerRef = document.getElementsByClassName('_refSelectContainer is-shown') as HTMLCollectionOf<HTMLElement>;
298
+ const containerRef = document.getElementsByClassName(
299
+ "_refSelectContainer is-shown",
300
+ ) as HTMLCollectionOf<HTMLElement>;
242
301
  if (containerRef.length) {
243
302
  for (let i = 0; i < containerRef.length; i++) {
244
- containerRef[i].classList.remove('is-shown');
303
+ containerRef[i].classList.remove("is-shown");
245
304
  }
246
- }
247
- }
305
+ }
306
+ };
248
307
 
249
308
  const evReToogleSelect = () => {
250
- setTime(new Date())
251
- evToogleSelect()
252
- }
309
+ setTime(new Date());
310
+ evToogleSelect();
311
+ };
253
312
 
254
- return <div className='_refContainer'>
255
- <AsyncPaginate
256
- isSearchable={isSearchable}
257
- placeholder={placeholder}
258
- debounceTimeout={500}
259
- styles={customStyles}
260
- loadOptions={loadOptions}
261
- menuPortalTarget={document.body}
262
- menuPosition='fixed'
263
- menuPlacement='auto'
264
- value={valueSelect}
265
- onChange={handleChange}
266
- loadOptionsOnMenuOpen={loadOptionsOnMenuOpen}
267
- noOptionsMessage={noOptionsMessage}
268
- menuIsOpen={isMenuOpen}
269
- {...id && {id: id}}
270
- {...mode === 'multi-select' && {
271
- closeMenuOnSelect: false,
272
- inputValue: inputValue,
273
- onInputChange: (value, action) => {
274
- if (action.action === "input-change") {
275
- setInputValue(value)
276
- setTime(new Date())
277
- }
278
- },
279
- onMenuClose: () => {
280
- setInputValue('');
281
- evChangeOnMenuClose?.(valueSelect);
282
- },
283
- onMenuOpen: () => evReToogleSelect(),
284
- cacheUniqs: [_time],
285
- selectRef: selectRef
286
- }}
287
- {...mode !== 'multi-select' && {
288
- onMenuOpen: onMenuOpen,
289
- onMenuClose: onMenuClose
290
- }}
291
- {...customOption && { components: { Option: customOption } }}
292
- {...MenuList && { components: { MenuList } }}
293
- {...isMulti && { isMulti: true }}
294
- {...rest} />
295
- </div>
296
- }
313
+ return (
314
+ <div className="_refContainer">
315
+ <AsyncPaginate
316
+ isSearchable={isSearchable}
317
+ placeholder={placeholder}
318
+ debounceTimeout={500}
319
+ styles={customStyles}
320
+ loadOptions={loadOptions}
321
+ menuPortalTarget={document.body}
322
+ menuPosition="fixed"
323
+ menuPlacement="auto"
324
+ value={valueSelect}
325
+ onChange={handleChange}
326
+ loadOptionsOnMenuOpen={loadOptionsOnMenuOpen}
327
+ noOptionsMessage={noOptionsMessage}
328
+ menuIsOpen={isMenuOpen}
329
+ {...(id && { id: id })}
330
+ {...(mode === "multi-select" && {
331
+ closeMenuOnSelect: false,
332
+ inputValue: inputValue,
333
+ onInputChange: (value, action) => {
334
+ if (action.action === "input-change") {
335
+ setInputValue(value);
336
+ setTime(new Date());
337
+ }
338
+ },
339
+ onMenuClose: () => {
340
+ setInputValue("");
341
+ evChangeOnMenuClose?.(valueSelect);
342
+ },
343
+ onMenuOpen: () => evReToogleSelect(),
344
+ cacheUniqs: [_time],
345
+ selectRef: selectRef,
346
+ })}
347
+ {...(mode !== "multi-select" && {
348
+ onMenuOpen: onMenuOpen,
349
+ onMenuClose: onMenuClose,
350
+ })}
351
+ {...(customOption && { components: { Option: customOption } })}
352
+ {...(MenuList && { components: { MenuList } })}
353
+ {...(isMulti && { isMulti: true })}
354
+ {...rest}
355
+ />
356
+ </div>
357
+ );
358
+ };
297
359
 
298
- export default SelectAsyncPaginateComponent
360
+ export default SelectAsyncPaginateComponent;