@instructure/ui-flex 11.7.8 → 11.7.9-pr-snapshot-1792147648392
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/CHANGELOG.md +13 -0
- package/es/Flex/v1/Item/index.js +59 -91
- package/es/Flex/v1/Item/props.js +18 -26
- package/es/Flex/v1/Item/styles.js +27 -69
- package/es/Flex/v1/index.js +82 -112
- package/es/Flex/v1/props.js +17 -26
- package/es/Flex/v1/styles.js +41 -97
- package/es/Flex/v1/theme.js +10 -42
- package/es/Flex/v2/Item/index.js +59 -91
- package/es/Flex/v2/Item/props.js +18 -26
- package/es/Flex/v2/Item/styles.js +27 -69
- package/es/Flex/v2/index.js +82 -112
- package/es/Flex/v2/props.js +17 -26
- package/es/Flex/v2/styles.js +43 -97
- package/es/exports/a.js +1 -25
- package/es/exports/b.js +1 -25
- package/package.json +11 -17
- package/tsconfig.build.json +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/lib/Flex/v1/Item/index.js +0 -104
- package/lib/Flex/v1/Item/props.js +0 -31
- package/lib/Flex/v1/Item/styles.js +0 -76
- package/lib/Flex/v1/index.js +0 -138
- package/lib/Flex/v1/props.js +0 -31
- package/lib/Flex/v1/styles.js +0 -105
- package/lib/Flex/v1/theme.js +0 -50
- package/lib/Flex/v2/Item/index.js +0 -104
- package/lib/Flex/v2/Item/props.js +0 -31
- package/lib/Flex/v2/Item/styles.js +0 -76
- package/lib/Flex/v2/index.js +0 -137
- package/lib/Flex/v2/props.js +0 -31
- package/lib/Flex/v2/styles.js +0 -105
- package/lib/exports/a.js +0 -18
- package/lib/exports/b.js +0 -18
- package/lib/package.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
|
|
7
|
+
|
|
8
|
+
### Build System
|
|
9
|
+
|
|
10
|
+
* **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
* **many:** `@instructure/ui-babel-preset` and
|
|
15
|
+
`@instructure/browserslist-config-instui` are removed and will no longer be
|
|
16
|
+
published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @instructure/ui-flex
|
package/es/Flex/v1/Item/index.js
CHANGED
|
@@ -1,99 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* The MIT License (MIT)
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
* copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
* SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
1
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
26
3
|
import { Component } from 'react';
|
|
27
4
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
28
5
|
import { View } from '@instructure/ui-view/v11_6';
|
|
29
6
|
import { withStyle } from '@instructure/emotion';
|
|
30
7
|
import generateStyle from './styles.js';
|
|
31
8
|
import { allowedProps } from './props.js';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
9
|
+
class Item extends Component {
|
|
10
|
+
static{
|
|
11
|
+
this.displayName = 'Item';
|
|
12
|
+
}
|
|
13
|
+
static{
|
|
14
|
+
this.componentId = 'Flex.Item';
|
|
15
|
+
}
|
|
16
|
+
componentDidMount() {
|
|
17
|
+
this.props.makeStyles?.();
|
|
18
|
+
}
|
|
19
|
+
componentDidUpdate() {
|
|
20
|
+
this.props.makeStyles?.();
|
|
21
|
+
}
|
|
22
|
+
static{
|
|
23
|
+
this.allowedProps = allowedProps;
|
|
24
|
+
}
|
|
25
|
+
static{
|
|
26
|
+
this.defaultProps = {
|
|
27
|
+
as: 'span',
|
|
28
|
+
shouldGrow: false,
|
|
29
|
+
shouldShrink: false
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const props = omitProps(this.props, Item.allowedProps);
|
|
34
|
+
const { as, children, withVisualDebug, textAlign, size, direction, margin, padding, overflowX, overflowY, styles } = this.props;
|
|
35
|
+
const dirColumn = direction === 'column';
|
|
36
|
+
const dirRow = direction === 'row';
|
|
37
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
38
|
+
...props,
|
|
39
|
+
css: styles?.flexItem,
|
|
40
|
+
elementRef: this.handleRef,
|
|
41
|
+
as: as,
|
|
42
|
+
minHeight: dirColumn ? size : undefined,
|
|
43
|
+
minWidth: dirRow ? size : undefined,
|
|
44
|
+
textAlign: textAlign,
|
|
45
|
+
margin: margin,
|
|
46
|
+
padding: padding,
|
|
47
|
+
overflowX: overflowX,
|
|
48
|
+
overflowY: overflowY || (dirColumn ? 'auto' : 'visible'),
|
|
49
|
+
withVisualDebug: withVisualDebug,
|
|
50
|
+
children: children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
constructor(...args){
|
|
54
|
+
super(...args), this.ref = null, this.handleRef = (el)=>{
|
|
55
|
+
const { elementRef } = this.props;
|
|
56
|
+
this.ref = el;
|
|
57
|
+
if (typeof elementRef === 'function') {
|
|
58
|
+
elementRef(el);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
as,
|
|
68
|
-
children,
|
|
69
|
-
withVisualDebug,
|
|
70
|
-
textAlign,
|
|
71
|
-
size,
|
|
72
|
-
direction,
|
|
73
|
-
margin,
|
|
74
|
-
padding,
|
|
75
|
-
overflowX,
|
|
76
|
-
overflowY,
|
|
77
|
-
styles
|
|
78
|
-
} = this.props;
|
|
79
|
-
const dirColumn = direction === 'column';
|
|
80
|
-
const dirRow = direction === 'row';
|
|
81
|
-
return _jsx(View, {
|
|
82
|
-
...props,
|
|
83
|
-
css: styles?.flexItem,
|
|
84
|
-
elementRef: this.handleRef,
|
|
85
|
-
as: as,
|
|
86
|
-
minHeight: dirColumn ? size : undefined,
|
|
87
|
-
minWidth: dirRow ? size : undefined,
|
|
88
|
-
textAlign: textAlign,
|
|
89
|
-
margin: margin,
|
|
90
|
-
padding: padding,
|
|
91
|
-
overflowX: overflowX,
|
|
92
|
-
overflowY: overflowY || (dirColumn ? 'auto' : 'visible'),
|
|
93
|
-
withVisualDebug: withVisualDebug,
|
|
94
|
-
children: children
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}) || _class);
|
|
62
|
+
}
|
|
63
|
+
Item = _ts_decorate([
|
|
64
|
+
withStyle(generateStyle, null)
|
|
65
|
+
], Item);
|
|
98
66
|
export default Item;
|
|
99
|
-
export { Item };
|
|
67
|
+
export { Item };
|
package/es/Flex/v1/Item/props.js
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const allowedProps = ['children', 'as', 'elementRef', 'margin', 'padding', 'align', 'direction', 'textAlign', 'overflowX', 'overflowY', 'shouldGrow', 'shouldShrink', 'size', 'withVisualDebug', 'order'];
|
|
26
|
-
export { allowedProps };
|
|
1
|
+
const allowedProps = [
|
|
2
|
+
'children',
|
|
3
|
+
'as',
|
|
4
|
+
'elementRef',
|
|
5
|
+
'margin',
|
|
6
|
+
'padding',
|
|
7
|
+
'align',
|
|
8
|
+
'direction',
|
|
9
|
+
'textAlign',
|
|
10
|
+
'overflowX',
|
|
11
|
+
'overflowY',
|
|
12
|
+
'shouldGrow',
|
|
13
|
+
'shouldShrink',
|
|
14
|
+
'size',
|
|
15
|
+
'withVisualDebug',
|
|
16
|
+
'order'
|
|
17
|
+
];
|
|
18
|
+
export { allowedProps };
|
|
@@ -1,70 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* private: true
|
|
28
|
-
* ---
|
|
29
|
-
* Generates the style object from the theme and provided additional information
|
|
30
|
-
* @param {Object} componentTheme The theme variable object.
|
|
31
|
-
* @param {Object} props the props of the component, the style is applied to
|
|
32
|
-
* @param {Object} state the state of the component, the style is applied to
|
|
33
|
-
* @return {Object} The final style object, which will be used in the component
|
|
34
|
-
*/
|
|
35
|
-
const generateStyle = (_componentTheme, props) => {
|
|
36
|
-
const {
|
|
37
|
-
shouldGrow,
|
|
38
|
-
shouldShrink,
|
|
39
|
-
align,
|
|
40
|
-
size,
|
|
41
|
-
order
|
|
42
|
-
} = props;
|
|
43
|
-
const alignSelfValues = {
|
|
44
|
-
start: 'flex-start',
|
|
45
|
-
end: 'flex-end',
|
|
46
|
-
center: 'center',
|
|
47
|
-
stretch: 'stretch'
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
flexItem: {
|
|
51
|
-
label: 'flexItem',
|
|
52
|
-
boxSizing: 'border-box',
|
|
53
|
-
minWidth: '0.0625rem',
|
|
54
|
-
flexBasis: size,
|
|
55
|
-
...(order !== undefined ? {
|
|
56
|
-
order
|
|
57
|
-
} : {}),
|
|
58
|
-
// initial value is 1, but we want 0 as our default,
|
|
59
|
-
// so users can opt in to shrink like they do grow
|
|
60
|
-
flexShrink: shouldShrink ? 1 : 0,
|
|
61
|
-
...(shouldGrow && {
|
|
62
|
-
flexGrow: 1
|
|
63
|
-
}),
|
|
64
|
-
...(align && {
|
|
65
|
-
alignSelf: alignSelfValues[align]
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
};
|
|
1
|
+
const generateStyle = (_componentTheme, props)=>{
|
|
2
|
+
const { shouldGrow, shouldShrink, align, size, order } = props;
|
|
3
|
+
const alignSelfValues = {
|
|
4
|
+
start: 'flex-start',
|
|
5
|
+
end: 'flex-end',
|
|
6
|
+
center: 'center',
|
|
7
|
+
stretch: 'stretch'
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
flexItem: {
|
|
11
|
+
label: 'flexItem',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
minWidth: '0.0625rem',
|
|
14
|
+
flexBasis: size,
|
|
15
|
+
...order !== undefined ? {
|
|
16
|
+
order
|
|
17
|
+
} : {},
|
|
18
|
+
flexShrink: shouldShrink ? 1 : 0,
|
|
19
|
+
...shouldGrow && {
|
|
20
|
+
flexGrow: 1
|
|
21
|
+
},
|
|
22
|
+
...align && {
|
|
23
|
+
alignSelf: alignSelfValues[align]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
69
27
|
};
|
|
70
|
-
export default generateStyle;
|
|
28
|
+
export default generateStyle;
|
package/es/Flex/v1/index.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* The MIT License (MIT)
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
* copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
* SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
1
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
26
3
|
import { Children, Component } from 'react';
|
|
27
4
|
import { safeCloneElement, passthroughProps, matchComponentTypes, callRenderProp } from '@instructure/ui-react-utils';
|
|
28
5
|
import { View } from '@instructure/ui-view/v11_6';
|
|
@@ -31,93 +8,86 @@ import { Item } from './Item/index.js';
|
|
|
31
8
|
import generateStyle from './styles.js';
|
|
32
9
|
import generateComponentTheme from './theme.js';
|
|
33
10
|
import { allowedProps } from './props.js';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
11
|
+
class Flex extends Component {
|
|
12
|
+
static{
|
|
13
|
+
this.displayName = 'Flex';
|
|
14
|
+
}
|
|
15
|
+
static{
|
|
16
|
+
this.componentId = 'Flex';
|
|
17
|
+
}
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
this.props.makeStyles?.();
|
|
20
|
+
}
|
|
21
|
+
componentDidUpdate() {
|
|
22
|
+
this.props.makeStyles?.();
|
|
23
|
+
}
|
|
24
|
+
static{
|
|
25
|
+
this.Item = Item;
|
|
26
|
+
}
|
|
27
|
+
static{
|
|
28
|
+
this.allowedProps = allowedProps;
|
|
29
|
+
}
|
|
30
|
+
static{
|
|
31
|
+
this.defaultProps = {
|
|
32
|
+
as: 'span',
|
|
33
|
+
direction: 'row',
|
|
34
|
+
justifyItems: 'start',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
withVisualDebug: false,
|
|
37
|
+
wrap: 'no-wrap',
|
|
38
|
+
gap: 'none'
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
renderChildren(children) {
|
|
42
|
+
return Children.map(children, (child)=>{
|
|
43
|
+
if (!child) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return matchComponentTypes(child, [
|
|
47
|
+
'Item'
|
|
48
|
+
]) ? safeCloneElement(child, {
|
|
49
|
+
withVisualDebug: this.props.withVisualDebug,
|
|
50
|
+
...child.props,
|
|
51
|
+
direction: this.props.direction.replace(/-reverse/, '')
|
|
52
|
+
}) : child;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
const { as, withVisualDebug, height, display, margin, padding, textAlign, width, styles, gap, wrap } = this.props;
|
|
57
|
+
const children = callRenderProp(this.props.children);
|
|
58
|
+
const gapValuesArray = gap?.split(' ');
|
|
59
|
+
if (gapValuesArray.length > 1 && wrap === 'no-wrap') void 0;
|
|
60
|
+
if (children && Children.count(children) > 0) {
|
|
61
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
62
|
+
...passthroughProps(this.props),
|
|
63
|
+
css: styles?.flex,
|
|
64
|
+
elementRef: this.handleRef,
|
|
65
|
+
as: as,
|
|
66
|
+
display: display,
|
|
67
|
+
width: width,
|
|
68
|
+
height: height,
|
|
69
|
+
margin: margin,
|
|
70
|
+
padding: padding,
|
|
71
|
+
textAlign: textAlign,
|
|
72
|
+
withVisualDebug: withVisualDebug,
|
|
73
|
+
children: this.renderChildren(children)
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
69
78
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// child withVisualDebug prop should override parent
|
|
79
|
-
withVisualDebug: this.props.withVisualDebug,
|
|
80
|
-
...child.props,
|
|
81
|
-
direction: this.props.direction.replace(/-reverse/, '')
|
|
82
|
-
}) : child;
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
render() {
|
|
86
|
-
const {
|
|
87
|
-
as,
|
|
88
|
-
withVisualDebug,
|
|
89
|
-
height,
|
|
90
|
-
display,
|
|
91
|
-
margin,
|
|
92
|
-
padding,
|
|
93
|
-
textAlign,
|
|
94
|
-
width,
|
|
95
|
-
styles,
|
|
96
|
-
gap,
|
|
97
|
-
wrap
|
|
98
|
-
} = this.props;
|
|
99
|
-
const children = callRenderProp(this.props.children);
|
|
100
|
-
const gapValuesArray = gap?.split(' ');
|
|
101
|
-
if (gapValuesArray.length > 1 && wrap === 'no-wrap') {}
|
|
102
|
-
if (children && Children.count(children) > 0) {
|
|
103
|
-
return _jsx(View, {
|
|
104
|
-
...passthroughProps(this.props),
|
|
105
|
-
css: styles?.flex,
|
|
106
|
-
elementRef: this.handleRef,
|
|
107
|
-
as: as,
|
|
108
|
-
display: display,
|
|
109
|
-
width: width,
|
|
110
|
-
height: height,
|
|
111
|
-
margin: margin,
|
|
112
|
-
padding: padding,
|
|
113
|
-
textAlign: textAlign,
|
|
114
|
-
withVisualDebug: withVisualDebug,
|
|
115
|
-
children: this.renderChildren(children)
|
|
116
|
-
});
|
|
117
|
-
} else {
|
|
118
|
-
return null;
|
|
79
|
+
constructor(...args){
|
|
80
|
+
super(...args), this.ref = null, this.handleRef = (el)=>{
|
|
81
|
+
const { elementRef } = this.props;
|
|
82
|
+
this.ref = el;
|
|
83
|
+
if (typeof elementRef === 'function') {
|
|
84
|
+
elementRef(el);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
119
87
|
}
|
|
120
|
-
|
|
121
|
-
|
|
88
|
+
}
|
|
89
|
+
Flex = _ts_decorate([
|
|
90
|
+
withStyle(generateStyle, generateComponentTheme)
|
|
91
|
+
], Flex);
|
|
122
92
|
export default Flex;
|
|
123
|
-
export { Flex, Item as FlexItem };
|
|
93
|
+
export { Flex, Item as FlexItem };
|
package/es/Flex/v1/props.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const allowedProps = ['children', 'as', 'elementRef', 'height', 'width', 'margin', 'padding', 'display', 'textAlign', 'direction', 'alignItems', 'justifyItems', 'wrap', 'withVisualDebug'];
|
|
26
|
-
export { allowedProps };
|
|
1
|
+
const allowedProps = [
|
|
2
|
+
'children',
|
|
3
|
+
'as',
|
|
4
|
+
'elementRef',
|
|
5
|
+
'height',
|
|
6
|
+
'width',
|
|
7
|
+
'margin',
|
|
8
|
+
'padding',
|
|
9
|
+
'display',
|
|
10
|
+
'textAlign',
|
|
11
|
+
'direction',
|
|
12
|
+
'alignItems',
|
|
13
|
+
'justifyItems',
|
|
14
|
+
'wrap',
|
|
15
|
+
'withVisualDebug'
|
|
16
|
+
];
|
|
17
|
+
export { allowedProps };
|