@dvrd/dvr-controls 1.0.74 → 1.0.75
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import './style/dvrdSelect.scss';
|
|
5
5
|
|
|
6
|
-
import React, {
|
|
6
|
+
import React, {ReactElement, useEffect, useMemo, useRef, useState} from 'react';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import {ChangeFunction, ErrorType, SelectItemShape} from '../util/interfaces';
|
|
9
9
|
import {hasHover, stopPropagation} from '../util/controlUtil';
|
|
@@ -11,7 +11,7 @@ import AwesomeIcon from '../icon/awesomeIcon';
|
|
|
11
11
|
import delay from 'lodash.delay';
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
14
|
-
onChange: (selected: Array<string | number>, submit: boolean) =>
|
|
14
|
+
onChange: (selected: Array<string | number>, submit: boolean) => VoidFunction;
|
|
15
15
|
onChangeSearch: ChangeFunction;
|
|
16
16
|
selected: Array<string | number>;
|
|
17
17
|
items: SelectItemShape[];
|
|
@@ -72,8 +72,8 @@ export default function DvrdMultiSelect(props: Props) {
|
|
|
72
72
|
return function (evt: React.MouseEvent) {
|
|
73
73
|
stopPropagation(evt);
|
|
74
74
|
if (selected.includes(_value))
|
|
75
|
-
onChange(selected.filter((value: string | number) => value !== _value), !submitOnClose)(
|
|
76
|
-
else onChange(selected.concat(_value), !submitOnClose)(
|
|
75
|
+
onChange(selected.filter((value: string | number) => value !== _value), !submitOnClose)();
|
|
76
|
+
else onChange(selected.concat(_value), !submitOnClose)();
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -200,7 +200,7 @@ export default function DvrdMultiSelect(props: Props) {
|
|
|
200
200
|
if (open) addClickListener();
|
|
201
201
|
else {
|
|
202
202
|
removeClickListener();
|
|
203
|
-
if (submitOnClose && !isFirstRender) onChange(selected, true);
|
|
203
|
+
if (submitOnClose && !isFirstRender) onChange(selected, true)();
|
|
204
204
|
}
|
|
205
205
|
return function () {
|
|
206
206
|
removeClickListener();
|