@canlooks/can-ui 0.0.6 → 0.0.7
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.
|
@@ -8,7 +8,7 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
const transportStyle_1 = require("../transportStyle");
|
|
9
9
|
exports.Flex = (0, react_1.forwardRef)(({ inline, direction = 'row', wrap, gap = 0, columnGap, rowGap, compact, ...props }, ref) => {
|
|
10
10
|
const renderChildren = () => {
|
|
11
|
-
if (compact) {
|
|
11
|
+
if (!compact) {
|
|
12
12
|
return props.children;
|
|
13
13
|
}
|
|
14
14
|
const childrenCount = react_1.Children.count(props.children);
|
|
@@ -26,7 +26,10 @@ exports.Flex = (0, react_1.forwardRef)(({ inline, direction = 'row', wrap, gap =
|
|
|
26
26
|
return ((0, jsx_runtime_1.jsx)(transportStyle_1.TransportStyle, { ...props, ref: ref, className: (0, utils_1.classnames)(flex_style_1.classes.root, props.className), style: {
|
|
27
27
|
display: inline ? 'inline-flex' : 'flex',
|
|
28
28
|
flexDirection: direction,
|
|
29
|
-
flexWrap: wrap,
|
|
29
|
+
flexWrap: wrap,
|
|
30
|
+
gap: gap,
|
|
31
|
+
columnGap: columnGap,
|
|
32
|
+
rowGap: rowGap,
|
|
30
33
|
...props.style
|
|
31
34
|
}, children: renderChildren() }));
|
|
32
35
|
});
|
|
@@ -5,10 +5,28 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
exports.TransportStyle = (0, react_1.forwardRef)(({ alignItems, justifyContent, alignSelf, justifySelf, flex, width, minWidth, maxWidth, height, minHeight, maxHeight, lineHeight, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, marginLeft, ...props }, ref) => {
|
|
7
7
|
return ((0, jsx_runtime_1.jsx)("div", { ...props, ref: ref, style: {
|
|
8
|
-
alignItems
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
alignItems: alignItems,
|
|
9
|
+
justifyContent: justifyContent,
|
|
10
|
+
alignSelf: alignSelf,
|
|
11
|
+
justifySelf: justifySelf,
|
|
12
|
+
flex: flex,
|
|
13
|
+
width: width,
|
|
14
|
+
minWidth: minWidth,
|
|
15
|
+
maxWidth: maxWidth,
|
|
16
|
+
height: height,
|
|
17
|
+
minHeight: minHeight,
|
|
18
|
+
maxHeight: maxHeight,
|
|
19
|
+
lineHeight: lineHeight,
|
|
20
|
+
padding: padding,
|
|
21
|
+
paddingTop: paddingTop,
|
|
22
|
+
paddingRight: paddingRight,
|
|
23
|
+
paddingBottom: paddingBottom,
|
|
24
|
+
paddingLeft: paddingLeft,
|
|
25
|
+
margin: margin,
|
|
26
|
+
marginTop: marginTop,
|
|
27
|
+
marginRight: marginRight,
|
|
28
|
+
marginBottom: marginBottom,
|
|
29
|
+
marginLeft: marginLeft,
|
|
12
30
|
...props.style
|
|
13
31
|
} }));
|
|
14
32
|
});
|
|
@@ -5,7 +5,7 @@ import { classnames } from '../../utils';
|
|
|
5
5
|
import { TransportStyle } from '../transportStyle';
|
|
6
6
|
export const Flex = forwardRef(({ inline, direction = 'row', wrap, gap = 0, columnGap, rowGap, compact, ...props }, ref) => {
|
|
7
7
|
const renderChildren = () => {
|
|
8
|
-
if (compact) {
|
|
8
|
+
if (!compact) {
|
|
9
9
|
return props.children;
|
|
10
10
|
}
|
|
11
11
|
const childrenCount = Children.count(props.children);
|
|
@@ -23,7 +23,10 @@ export const Flex = forwardRef(({ inline, direction = 'row', wrap, gap = 0, colu
|
|
|
23
23
|
return (_jsx(TransportStyle, { ...props, ref: ref, className: classnames(classes.root, props.className), style: {
|
|
24
24
|
display: inline ? 'inline-flex' : 'flex',
|
|
25
25
|
flexDirection: direction,
|
|
26
|
-
flexWrap: wrap,
|
|
26
|
+
flexWrap: wrap,
|
|
27
|
+
gap: gap,
|
|
28
|
+
columnGap: columnGap,
|
|
29
|
+
rowGap: rowGap,
|
|
27
30
|
...props.style
|
|
28
31
|
}, children: renderChildren() }));
|
|
29
32
|
});
|
|
@@ -2,10 +2,28 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
export const TransportStyle = forwardRef(({ alignItems, justifyContent, alignSelf, justifySelf, flex, width, minWidth, maxWidth, height, minHeight, maxHeight, lineHeight, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, marginLeft, ...props }, ref) => {
|
|
4
4
|
return (_jsx("div", { ...props, ref: ref, style: {
|
|
5
|
-
alignItems
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
alignItems: alignItems,
|
|
6
|
+
justifyContent: justifyContent,
|
|
7
|
+
alignSelf: alignSelf,
|
|
8
|
+
justifySelf: justifySelf,
|
|
9
|
+
flex: flex,
|
|
10
|
+
width: width,
|
|
11
|
+
minWidth: minWidth,
|
|
12
|
+
maxWidth: maxWidth,
|
|
13
|
+
height: height,
|
|
14
|
+
minHeight: minHeight,
|
|
15
|
+
maxHeight: maxHeight,
|
|
16
|
+
lineHeight: lineHeight,
|
|
17
|
+
padding: padding,
|
|
18
|
+
paddingTop: paddingTop,
|
|
19
|
+
paddingRight: paddingRight,
|
|
20
|
+
paddingBottom: paddingBottom,
|
|
21
|
+
paddingLeft: paddingLeft,
|
|
22
|
+
margin: margin,
|
|
23
|
+
marginTop: marginTop,
|
|
24
|
+
marginRight: marginRight,
|
|
25
|
+
marginBottom: marginBottom,
|
|
26
|
+
marginLeft: marginLeft,
|
|
9
27
|
...props.style
|
|
10
28
|
} }));
|
|
11
29
|
});
|