armtek-uikit-react 1.0.97 → 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
@@ -4,4 +4,5 @@
4
4
  padding: $size-step;
5
5
  box-shadow: $box-shadow;
6
6
  border-radius: $radius;
7
+ background-color: #ffffff;
7
8
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.97","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"}}
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"}}
@@ -49,6 +49,8 @@ export const DateField = /*#__PURE__*/forwardRef((props, ref) => {
49
49
  const btnRef = useRef();
50
50
  const inputIcon = showTime && showTimeOnly ? 'schedule' : 'calendar_today';
51
51
  let dateValue = typeof realValue === 'string' ? new Date(realValue) : realValue;
52
+
53
+ //TODO Подключение Popover ломает тесты, разобраться почему
52
54
  return /*#__PURE__*/_jsxs(_Fragment, {
53
55
  children: [/*#__PURE__*/_jsx(TextField, {
54
56
  ref: ref,
@@ -6,6 +6,8 @@ type SelectBaseProps = {
6
6
  inline?: boolean;
7
7
  search?: boolean;
8
8
  open?: boolean;
9
+ onClose?: () => void;
10
+ defaultOpen?: boolean;
9
11
  listStyle?: SelectOptionsType<true>['listStyle'];
10
12
  onSelectAll?: () => void;
11
13
  onClearAll?: () => void;
@@ -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(false);
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,10 +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, {
147
+ matchWidth: true,
142
148
  anchorEl: anchorEl,
143
149
  open: realActive,
144
- onClose: () => setActive(false),
150
+ onClose: handleClose,
145
151
  placement: 'bottom-start',
146
152
  children: /*#__PURE__*/_jsx(SelectOptions, {
147
153
  disabled: inputProps.disabled,
package/ui/Icon/Mi.js CHANGED
@@ -13,12 +13,12 @@ export const Mi = props => {
13
13
  ...tooltipProps,
14
14
  text: title,
15
15
  children: /*#__PURE__*/_jsx(Icon, {
16
- ...iconProps,
17
- variant: 'outlined'
16
+ variant: 'outlined',
17
+ ...iconProps
18
18
  })
19
19
  }) : /*#__PURE__*/_jsx(Icon, {
20
- ...iconProps,
21
- variant: 'outlined'
20
+ variant: 'outlined',
21
+ ...iconProps
22
22
  })
23
23
  });
24
24
  };
@@ -5,7 +5,7 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
5
5
  export const Popover = props => {
6
6
  const {
7
7
  onClose,
8
- matchWidth = true,
8
+ matchWidth = false,
9
9
  children,
10
10
  ...poperProps
11
11
  } = props;
@@ -1 +1,2 @@
1
1
  export { default } from './Popover';
2
+ export * from './Popover';
@@ -1 +1,2 @@
1
- export { default } from "./Popover";
1
+ export { default } from "./Popover";
2
+ export * from "./Popover";