@qmlight/web-platform-components 1.0.7 → 1.0.8
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.
|
@@ -210,34 +210,34 @@ const SearchAssistanceSelectSelect: React.FC<SeachProps> = ({
|
|
|
210
210
|
// console.log(dataValue.current);
|
|
211
211
|
// setStatus(!isEmpty(values));
|
|
212
212
|
// }}
|
|
213
|
-
|
|
213
|
+
options={options}
|
|
214
214
|
value={isEmpty(value) ? (mode ? [] : undefined) : value}
|
|
215
215
|
loading={fetching}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
216
|
+
onSelect={(value: any) => {
|
|
217
|
+
const field = options.find((item) => item.value === value?.value);
|
|
218
|
+
if (!mode) {
|
|
219
|
+
dataValue.current = field;
|
|
220
|
+
onDataChange && onDataChange(dataValue.current);
|
|
221
|
+
setValue(dataValue.current);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const oldField = dataValue.current.find((item) => item.value === value.value);
|
|
225
|
+
if (!oldField && field) {
|
|
226
|
+
dataValue.current = dataValue.current.concat([field]);
|
|
227
|
+
onDataChange && onDataChange(dataValue.current);
|
|
228
|
+
setValue(dataValue.current);
|
|
229
|
+
}
|
|
230
|
+
}}
|
|
231
|
+
onDeselect={(value: any) => {
|
|
232
|
+
if (!mode) {
|
|
233
|
+
dataValue.current = {};
|
|
234
|
+
setValue(dataValue.current);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
dataValue.current = dataValue.current.filter((item) => item.value !== value.value);
|
|
238
|
+
onDataChange && onDataChange(dataValue.current);
|
|
239
|
+
setValue(dataValue.current);
|
|
240
|
+
}}
|
|
241
241
|
onFocus={(e) => {
|
|
242
242
|
e.stopPropagation();
|
|
243
243
|
SelectRef.current.blur();
|