armtek-uikit-react 1.0.52 → 1.0.53

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
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.52","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"@tinymce/tinymce-react":"^4.3.2","build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.53","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":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
@@ -6,14 +6,14 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
6
6
  const BackDrop = props => {
7
7
  const {
8
8
  children,
9
- width
9
+ ...backDropProps
10
10
  } = props;
11
11
  const childrenProp = /*#__PURE__*/isValidElement(children) ? children : /*#__PURE__*/_jsx("span", {
12
12
  children: children
13
13
  });
14
14
  return /*#__PURE__*/_jsx(_Fragment, {
15
15
  children: /*#__PURE__*/createPortal( /*#__PURE__*/_jsx(BackDropBase, {
16
- width: width,
16
+ ...backDropProps,
17
17
  children: childrenProp
18
18
  }), document.body)
19
19
  });
@@ -1,6 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactNode, MouseEvent } from 'react';
2
2
  export type BackDropProps = {
3
3
  children: ReactNode;
4
4
  width: number;
5
+ onClick?: (e: MouseEvent<HTMLDivElement>) => void;
5
6
  };
6
7
  export declare const BackDropBase: (props: BackDropProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,11 +5,20 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
5
5
  export const BackDropBase = props => {
6
6
  const {
7
7
  children,
8
- width
8
+ width,
9
+ onClick
9
10
  } = props;
11
+ const handleClick = e => {
12
+ if (e.target instanceof Element) {
13
+ if (e.target.classList.contains('Arm-BackDropBase')) {
14
+ if (onClick) onClick(e);
15
+ }
16
+ }
17
+ };
10
18
  return /*#__PURE__*/_jsx(_Fragment, {
11
19
  children: /*#__PURE__*/_jsx("div", {
12
20
  className: clsx('Arm-BackDropBase', css.BackDropBase),
21
+ onClick: handleClick,
13
22
  children: /*#__PURE__*/_jsx("div", {
14
23
  className: css.BackDropBase__inner,
15
24
  style: {
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, MouseEvent } from 'react';
2
2
  import { FormControlsProps } from '../../ui/Form/FormControls';
3
3
  export type BaseModalProps = ComponentPropsWithoutRef<'div'> & FormControlsProps & {
4
- onClose: (e: MouseEvent<HTMLButtonElement>) => void;
4
+ onClose: (e: MouseEvent) => void;
5
5
  };
6
6
  export declare const BaseModal: (props: BaseModalProps) => import("react/jsx-runtime").JSX.Element;
package/ui/Modal/Modal.js CHANGED
@@ -2,6 +2,7 @@ import { BaseModal } from "./BaseModal";
2
2
  import BackDrop from "../BackDrop";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { Fragment as _Fragment } from "react/jsx-runtime";
5
+ //TODO Написать тесты
5
6
  const Modal = props => {
6
7
  const {
7
8
  open,
@@ -12,6 +13,7 @@ const Modal = props => {
12
13
  return /*#__PURE__*/_jsx(_Fragment, {
13
14
  children: /*#__PURE__*/_jsx(BackDrop, {
14
15
  width: width,
16
+ onClick: modalProps.onClose,
15
17
  children: /*#__PURE__*/_jsx(BaseModal, {
16
18
  ...modalProps,
17
19
  className: 'moasda'