armtek-uikit-react 1.0.22 → 1.0.23
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/Button.scss
CHANGED
package/assets/ButtonGroup.scss
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.23","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonProps } from '../../ui/Button';
|
|
2
2
|
type PropsType = {
|
|
3
3
|
orientation?: 'column' | 'inline';
|
|
4
|
-
} &
|
|
4
|
+
} & ButtonProps;
|
|
5
5
|
declare const ButtonGroup: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ButtonGroup;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Children, cloneElement, isValidElement } from 'react';
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import css from "
|
|
3
|
+
import css from "./ButtonGroup.module.scss";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
6
|
const ButtonGroupClasses = ['button_group', 'button_group_inline', 'button_group_column'];
|
|
@@ -11,13 +12,20 @@ const ButtonGroup = props => {
|
|
|
11
12
|
orientation = 'inline',
|
|
12
13
|
className,
|
|
13
14
|
children,
|
|
14
|
-
...
|
|
15
|
+
...buttonProps
|
|
15
16
|
} = props;
|
|
17
|
+
let arrChildren = Children.toArray(children);
|
|
16
18
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
17
19
|
children: /*#__PURE__*/_jsx("div", {
|
|
18
|
-
...restProps,
|
|
19
20
|
className: clsx(css.button_group, css['button_group_' + orientation], className),
|
|
20
|
-
children:
|
|
21
|
+
children: arrChildren.map((item, index) => {
|
|
22
|
+
return /*#__PURE__*/isValidElement(item) && /*#__PURE__*/cloneElement(item, {
|
|
23
|
+
...item.props,
|
|
24
|
+
...buttonProps,
|
|
25
|
+
group: orientation,
|
|
26
|
+
key: index
|
|
27
|
+
});
|
|
28
|
+
})
|
|
21
29
|
})
|
|
22
30
|
});
|
|
23
31
|
};
|