armtek-uikit-react 1.0.98 → 1.0.99
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/assets/Card.scss
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.99","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
package/ui/Form/Select/Select.js
CHANGED
|
@@ -24,6 +24,7 @@ function Select(props) {
|
|
|
24
24
|
var _options$find;
|
|
25
25
|
let {
|
|
26
26
|
options,
|
|
27
|
+
defaultOpen,
|
|
27
28
|
endAdornment,
|
|
28
29
|
className,
|
|
29
30
|
inline,
|
|
@@ -35,11 +36,12 @@ function Select(props) {
|
|
|
35
36
|
open,
|
|
36
37
|
listStyle,
|
|
37
38
|
onSubmit,
|
|
39
|
+
onClose,
|
|
38
40
|
onClearAll,
|
|
39
41
|
onSelectAll,
|
|
40
42
|
...inputProps
|
|
41
43
|
} = props;
|
|
42
|
-
let [active, setActive] = useState(
|
|
44
|
+
let [active, setActive] = useState(!!defaultOpen);
|
|
43
45
|
let [selected, setSelected] = useState(defaultValue || (multiple ? [] : ''));
|
|
44
46
|
let [focused, setFocused] = useState(false);
|
|
45
47
|
let [q, setQ] = useState('');
|
|
@@ -113,6 +115,9 @@ function Select(props) {
|
|
|
113
115
|
if (!!search) options = options.filter(item => item.text.toLowerCase().includes(q.toLowerCase()));
|
|
114
116
|
let valueArr = realValue ? Array.isArray(realValue) ? realValue : [realValue] : [];
|
|
115
117
|
let selectedOptions = options.filter(item => valueArr.includes(getOptionValue(item)));
|
|
118
|
+
const handleClose = () => {
|
|
119
|
+
if (onClose) onClose();else setActive(false);
|
|
120
|
+
};
|
|
116
121
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
117
122
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
118
123
|
className: css.select,
|
|
@@ -138,11 +143,11 @@ function Select(props) {
|
|
|
138
143
|
disabled: inputProps.disabled,
|
|
139
144
|
onDelete: handleSelect
|
|
140
145
|
})]
|
|
141
|
-
}), anchorEl && /*#__PURE__*/_jsx(Popover, {
|
|
146
|
+
}), realActive && anchorEl && /*#__PURE__*/_jsx(Popover, {
|
|
142
147
|
matchWidth: true,
|
|
143
148
|
anchorEl: anchorEl,
|
|
144
149
|
open: realActive,
|
|
145
|
-
onClose:
|
|
150
|
+
onClose: handleClose,
|
|
146
151
|
placement: 'bottom-start',
|
|
147
152
|
children: /*#__PURE__*/_jsx(SelectOptions, {
|
|
148
153
|
disabled: inputProps.disabled,
|