@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
- // options={options}
213
+ options={options}
214
214
  value={isEmpty(value) ? (mode ? [] : undefined) : value}
215
215
  loading={fetching}
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
- // }}
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();
@@ -33,6 +33,7 @@ const SearchAssistanceModel: React.FC<ModalProps> = (props) => {
33
33
  };
34
34
  useEffect(() => {
35
35
  if (isEmpty(data)) {
36
+ setNewData(mode ? [] : {});
36
37
  return;
37
38
  }
38
39
  if (mode === 'multiple') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qmlight/web-platform-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "A platform components for React",
5
5
  "keywords": [
6
6
  "React",