@draftbit/core 46.10.3-106fd0.2 → 46.10.3-1ab4b6.2
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/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/Shadow.js +15 -2
- package/lib/commonjs/components/Table/Table.js +11 -10
- package/lib/commonjs/components/Table/TableCell.js +3 -3
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +4 -4
- package/lib/commonjs/components/Table/index.js +3 -27
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/Layout.js +85 -177
- package/lib/module/components/AspectRatio.js +1 -18
- package/lib/module/components/Checkbox/CheckboxGroup.js +2 -16
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/CircleImage.js +1 -16
- package/lib/module/components/DeprecatedButton.js +3 -21
- package/lib/module/components/IconButton.js +4 -21
- package/lib/module/components/Pressable.js +2 -15
- package/lib/module/components/Shadow.js +2 -15
- package/lib/module/components/Table/Table.js +7 -7
- package/lib/module/components/Table/TableCell.js +1 -1
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +3 -2
- package/lib/module/components/Table/index.js +1 -22
- package/lib/module/components/ToggleButton.js +2 -16
- package/lib/module/constants.js +0 -1
- package/lib/module/mappings/Layout.js +86 -178
- package/lib/typescript/src/components/Table/Table.d.ts +7 -2
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -1
- package/lib/typescript/src/components/Table/TableCell.d.ts +1 -1
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -1
- package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts +1 -1
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -1
- package/lib/typescript/src/components/Table/index.d.ts +1 -19
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Layout.d.ts +72 -108
- package/lib/typescript/src/mappings/Layout.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Table/Table.js +4 -2
- package/src/components/Table/Table.tsx +9 -3
- package/src/components/Table/TableCell.js +1 -1
- package/src/components/Table/TableCell.tsx +5 -1
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +1 -1
- package/src/components/Table/TableRow.tsx +1 -1
- package/src/components/Table/index.js +1 -13
- package/src/components/Table/index.tsx +1 -42
- package/src/mappings/Layout.js +100 -176
- package/src/mappings/Layout.ts +116 -178
- package/lib/commonjs/mappings/NativeBase/Layout.js +0 -108
- package/lib/module/mappings/NativeBase/Layout.js +0 -101
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +0 -133
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +0 -1
- package/src/mappings/NativeBase/Layout.js +0 -124
- package/src/mappings/NativeBase/Layout.ts +0 -145
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
|
|
3
4
|
import color from "color";
|
|
@@ -74,8 +75,7 @@ const Button = _ref => {
|
|
|
74
75
|
elevation,
|
|
75
76
|
alignSelf: "stretch"
|
|
76
77
|
}
|
|
77
|
-
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
78
|
-
...rest,
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
|
|
79
79
|
onPress: onPress,
|
|
80
80
|
accessibilityState: {
|
|
81
81
|
disabled
|
|
@@ -83,7 +83,7 @@ const Button = _ref => {
|
|
|
83
83
|
accessibilityRole: "button",
|
|
84
84
|
disabled: disabled || loading,
|
|
85
85
|
style: [styles.button, buttonStyle]
|
|
86
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
87
87
|
style: styles.content
|
|
88
88
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
89
89
|
style: iconStyle
|
|
@@ -114,22 +114,4 @@ const styles = StyleSheet.create({
|
|
|
114
114
|
width: Config.buttonIconSize
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
export default withTheme(Button);: 1,
|
|
118
|
-
style: [textStyle, typography.button]
|
|
119
|
-
}, children))));
|
|
120
|
-
};
|
|
121
|
-
const styles = StyleSheet.create({
|
|
122
|
-
button: {
|
|
123
|
-
minWidth: 64,
|
|
124
|
-
borderStyle: "solid"
|
|
125
|
-
},
|
|
126
|
-
content: {
|
|
127
|
-
flexDirection: "row",
|
|
128
|
-
alignItems: "center",
|
|
129
|
-
justifyContent: "center"
|
|
130
|
-
},
|
|
131
|
-
icon: {
|
|
132
|
-
width: Config.buttonIconSize
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
117
|
export default withTheme(Button);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet, ActivityIndicator, Pressable, Platform } from "react-native";
|
|
3
4
|
import { withTheme } from "../theming";
|
|
@@ -17,7 +18,7 @@ const IconButton = _ref => {
|
|
|
17
18
|
...props
|
|
18
19
|
} = _ref;
|
|
19
20
|
const iconColor = customColor || theme.colors.primary;
|
|
20
|
-
return /*#__PURE__*/React.createElement(Pressable, {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
21
22
|
onPress: onPress,
|
|
22
23
|
disabled: disabled || loading,
|
|
23
24
|
style: _ref2 => {
|
|
@@ -31,9 +32,8 @@ const IconButton = _ref => {
|
|
|
31
32
|
alignItems: "center",
|
|
32
33
|
justifyContent: "center"
|
|
33
34
|
}, style];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}, /*#__PURE__*/React.createElement(View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
35
|
+
}
|
|
36
|
+
}, props), /*#__PURE__*/React.createElement(View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
37
37
|
name: icon,
|
|
38
38
|
size: size - 2,
|
|
39
39
|
color: iconColor
|
|
@@ -54,21 +54,4 @@ const styles = StyleSheet.create({
|
|
|
54
54
|
})
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
export default withTheme(IconButton);ement(ActivityIndicator, {
|
|
58
|
-
size: "small",
|
|
59
|
-
color: iconColor
|
|
60
|
-
}) : null));
|
|
61
|
-
};
|
|
62
|
-
const styles = StyleSheet.create({
|
|
63
|
-
container: {
|
|
64
|
-
alignItems: "center",
|
|
65
|
-
justifyContent: "center",
|
|
66
|
-
...Platform.select({
|
|
67
|
-
web: {
|
|
68
|
-
cursor: "pointer",
|
|
69
|
-
userSelect: "none"
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
57
|
export default withTheme(IconButton);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Pressable as NativePressable } from "react-native";
|
|
3
4
|
export default function Pressable(_ref) {
|
|
@@ -12,22 +13,8 @@ export default function Pressable(_ref) {
|
|
|
12
13
|
style,
|
|
13
14
|
...props
|
|
14
15
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/React.createElement(NativePressable, {
|
|
16
|
+
return /*#__PURE__*/React.createElement(NativePressable, _extends({
|
|
16
17
|
onPress: onPress,
|
|
17
|
-
disabled: disabled,
|
|
18
|
-
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
19
|
-
hitSlop: hitSlop ? hitSlop : 8,
|
|
20
|
-
style: _ref2 => {
|
|
21
|
-
let {
|
|
22
|
-
pressed
|
|
23
|
-
} = _ref2;
|
|
24
|
-
return [{
|
|
25
|
-
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
26
|
-
}, style];
|
|
27
|
-
},
|
|
28
|
-
...props
|
|
29
|
-
}, children);
|
|
30
|
-
} onPress: onPress,
|
|
31
18
|
disabled: disabled,
|
|
32
19
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
33
20
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Shadow as ShadowComponent } from "react-native-shadow-2";
|
|
3
4
|
const Shadow = _ref => {
|
|
@@ -16,7 +17,7 @@ const Shadow = _ref => {
|
|
|
16
17
|
style,
|
|
17
18
|
...rest
|
|
18
19
|
} = _ref;
|
|
19
|
-
return /*#__PURE__*/React.createElement(ShadowComponent, {
|
|
20
|
+
return /*#__PURE__*/React.createElement(ShadowComponent, _extends({
|
|
20
21
|
offset: [offsetX, offsetY],
|
|
21
22
|
sides: {
|
|
22
23
|
start: showShadowSideStart,
|
|
@@ -31,20 +32,6 @@ const Shadow = _ref => {
|
|
|
31
32
|
bottomEnd: showShadowCornerBottomEnd
|
|
32
33
|
},
|
|
33
34
|
containerStyle: style,
|
|
34
|
-
paintInside: paintInside,
|
|
35
|
-
...rest
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
export default Shadow;hadowSideTop,
|
|
39
|
-
bottom: showShadowSideBottom
|
|
40
|
-
},
|
|
41
|
-
corners: {
|
|
42
|
-
topStart: showShadowCornerTopStart,
|
|
43
|
-
topEnd: showShadowCornerTopEnd,
|
|
44
|
-
bottomStart: showShadowCornerBottomStart,
|
|
45
|
-
bottomEnd: showShadowCornerBottomEnd
|
|
46
|
-
},
|
|
47
|
-
containerStyle: style,
|
|
48
35
|
paintInside: paintInside
|
|
49
36
|
}, rest));
|
|
50
37
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView, View, StyleSheet } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { withTheme } from "../../theming";
|
|
4
|
+
import { generateBorderStyles, TableStyleContext } from "./TableCommon";
|
|
5
|
+
const Table = _ref => {
|
|
5
6
|
let {
|
|
7
|
+
theme,
|
|
6
8
|
borderWidth = 1,
|
|
7
|
-
borderColor =
|
|
9
|
+
borderColor = theme.colors.divider,
|
|
8
10
|
borderStyle = "solid",
|
|
9
11
|
drawTopBorder = true,
|
|
10
12
|
drawBottomBorder = false,
|
|
@@ -108,7 +110,5 @@ const styles = StyleSheet.create({
|
|
|
108
110
|
container: {
|
|
109
111
|
flex: 1
|
|
110
112
|
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
});
|
|
113
|
+
});
|
|
114
|
+
export default withTheme(Table);rt default withTheme(Table);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { generateBorderStyles, TableStyleContext } from "./
|
|
3
|
+
import { generateBorderStyles, TableStyleContext } from "./TableCommon";
|
|
4
4
|
const TableCell = _ref => {
|
|
5
5
|
let {
|
|
6
6
|
borderWidth,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const TableStyleContext = /*#__PURE__*/React.createContext({});
|
|
3
|
+
export function generateBorderStyles(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
borderColor,
|
|
6
|
+
borderWidth,
|
|
7
|
+
borderStyle,
|
|
8
|
+
drawTopBorder,
|
|
9
|
+
drawBottomBorder,
|
|
10
|
+
drawStartBorder,
|
|
11
|
+
drawEndBorder
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
borderColor,
|
|
15
|
+
borderStyle,
|
|
16
|
+
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
17
|
+
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
18
|
+
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
19
|
+
borderEndWidth: drawEndBorder ? borderWidth : 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { generateBorderStyles, TableStyleContext } from "./
|
|
3
|
+
import { generateBorderStyles, TableStyleContext } from "./TableCommon";
|
|
4
4
|
import { withTheme } from "../../theming";
|
|
5
5
|
const TableRow = _ref => {
|
|
6
6
|
let {
|
|
@@ -19,6 +19,7 @@ const TableRow = _ref => {
|
|
|
19
19
|
theme
|
|
20
20
|
} = _ref;
|
|
21
21
|
const parentContextValue = React.useContext(TableStyleContext);
|
|
22
|
+
|
|
22
23
|
//Create context to use and pass to children based on own props or fall back to parent provided context
|
|
23
24
|
const contextValue = {
|
|
24
25
|
borderColor: borderColor || parentContextValue.borderColor,
|
|
@@ -49,4 +50,4 @@ const styles = StyleSheet.create({
|
|
|
49
50
|
flexDirection: "row"
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
|
-
export default withTheme(TableRow)
|
|
53
|
+
export default withTheme(TableRow);
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export const TableStyleContext = /*#__PURE__*/React.createContext({});
|
|
3
|
-
export function generateBorderStyles(_ref) {
|
|
4
|
-
let {
|
|
5
|
-
borderColor,
|
|
6
|
-
borderWidth,
|
|
7
|
-
borderStyle,
|
|
8
|
-
drawTopBorder,
|
|
9
|
-
drawBottomBorder,
|
|
10
|
-
drawStartBorder,
|
|
11
|
-
drawEndBorder
|
|
12
|
-
} = _ref;
|
|
13
|
-
return {
|
|
14
|
-
borderColor,
|
|
15
|
-
borderStyle,
|
|
16
|
-
borderTopWidth: drawTopBorder ? borderWidth : 0,
|
|
17
|
-
borderBottomWidth: drawBottomBorder ? borderWidth : 0,
|
|
18
|
-
borderStartWidth: drawStartBorder ? borderWidth : 0,
|
|
19
|
-
borderEndWidth: drawEndBorder ? borderWidth : 0
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export { Table } from "./Table";
|
|
1
|
+
export { default as Table } from "./Table";
|
|
23
2
|
export { default as TableRow } from "./TableRow";
|
|
24
3
|
export { default as TableCell } from "./TableCell";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { withTheme } from "../theming";
|
|
3
4
|
import { StyleSheet } from "react-native";
|
|
@@ -37,28 +38,13 @@ const ToggleButton = _ref => {
|
|
|
37
38
|
setInternalValue(!internalValue);
|
|
38
39
|
onPress(!internalValue);
|
|
39
40
|
};
|
|
40
|
-
return /*#__PURE__*/React.createElement(IconButton, {
|
|
41
|
+
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
41
42
|
Icon: Icon,
|
|
42
43
|
icon: icon,
|
|
43
44
|
size: iconSize,
|
|
44
45
|
color: internalValue ? colors[color] : colors[colorSecondary],
|
|
45
46
|
onPress: handlePress,
|
|
46
47
|
disabled: disabled,
|
|
47
|
-
style: [styles.mainContainer, {
|
|
48
|
-
width,
|
|
49
|
-
height,
|
|
50
|
-
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
51
|
-
borderColor: colors[borderColor]
|
|
52
|
-
}, style],
|
|
53
|
-
...rest
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
const styles = StyleSheet.create({
|
|
57
|
-
mainContainer: {
|
|
58
|
-
borderWidth: 1
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
export default withTheme(ToggleButton);: disabled,
|
|
62
48
|
style: [styles.mainContainer, {
|
|
63
49
|
width,
|
|
64
50
|
height,
|
package/lib/module/constants.js
CHANGED
|
@@ -1,193 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
name: "Row",
|
|
4
|
-
tag: "Row",
|
|
5
|
-
category: COMPONENT_TYPES.deprecated,
|
|
6
|
-
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
7
|
-
props: {
|
|
8
|
-
justifyContent: {
|
|
9
|
-
label: "Align Horizontally",
|
|
10
|
-
group: GROUPS.style,
|
|
11
|
-
description: "Align Items Horizontally (on the X Axis)",
|
|
12
|
-
formType: FORM_TYPES.string,
|
|
13
|
-
propType: PROP_TYPES.STRING,
|
|
14
|
-
defaultValue: "flex-start",
|
|
15
|
-
editable: true,
|
|
16
|
-
required: false
|
|
17
|
-
},
|
|
18
|
-
alignItems: {
|
|
19
|
-
label: "Align Vertically",
|
|
20
|
-
group: GROUPS.style,
|
|
21
|
-
description: "Align Items Vertically (on the Y Axis)",
|
|
22
|
-
formType: FORM_TYPES.string,
|
|
23
|
-
propType: PROP_TYPES.STRING,
|
|
24
|
-
defaultValue: "flex-start",
|
|
25
|
-
editable: true,
|
|
26
|
-
required: false
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
name: "Spacer",
|
|
31
|
-
tag: "Spacer",
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections, createStaticBoolProp } from "@draftbit/types";
|
|
2
|
+
const SHARED_SEED_DATA = {
|
|
32
3
|
category: COMPONENT_TYPES.layout,
|
|
4
|
+
packageName: "native-base",
|
|
5
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS
|
|
6
|
+
};
|
|
7
|
+
const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX = CONTAINER_COMPONENT_STYLES_SECTIONS.filter(item => item !== StylesPanelSections.LayoutFlexItems && item !== StylesPanelSections.LayoutContent);
|
|
8
|
+
export const SEED_DATA = [{
|
|
9
|
+
name: "Aspect Ratio",
|
|
10
|
+
tag: "AspectRatio",
|
|
11
|
+
description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
|
|
12
|
+
...SHARED_SEED_DATA,
|
|
33
13
|
props: {
|
|
34
|
-
|
|
35
|
-
label: "
|
|
36
|
-
description: "
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
editable: true,
|
|
42
|
-
required: false
|
|
43
|
-
},
|
|
44
|
-
right: {
|
|
45
|
-
label: "Right",
|
|
46
|
-
description: "Right",
|
|
47
|
-
formType: FORM_TYPES.number,
|
|
48
|
-
propType: PROP_TYPES.NUMBER,
|
|
49
|
-
group: GROUPS.style,
|
|
50
|
-
defaultValue: 8,
|
|
51
|
-
editable: true,
|
|
52
|
-
required: false
|
|
53
|
-
},
|
|
54
|
-
bottom: {
|
|
55
|
-
label: "Bottom",
|
|
56
|
-
description: "Bottom",
|
|
57
|
-
formType: FORM_TYPES.number,
|
|
58
|
-
propType: PROP_TYPES.NUMBER,
|
|
59
|
-
group: GROUPS.style,
|
|
60
|
-
defaultValue: 8,
|
|
61
|
-
editable: true,
|
|
62
|
-
required: false
|
|
63
|
-
},
|
|
64
|
-
left: {
|
|
65
|
-
label: "Left",
|
|
66
|
-
description: "Left",
|
|
67
|
-
formType: FORM_TYPES.number,
|
|
68
|
-
propType: PROP_TYPES.NUMBER,
|
|
69
|
-
group: GROUPS.style,
|
|
70
|
-
defaultValue: 8,
|
|
71
|
-
editable: true,
|
|
72
|
-
required: false
|
|
73
|
-
}
|
|
74
|
-
}
|
|
14
|
+
ratio: createStaticNumberProp({
|
|
15
|
+
label: "Ratio",
|
|
16
|
+
description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
|
|
17
|
+
defaultValue: 1.33
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
stylesPanelSections: [StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects]
|
|
75
21
|
}, {
|
|
76
|
-
name: "
|
|
77
|
-
tag: "
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
props: {
|
|
81
|
-
justifyContent: {
|
|
82
|
-
group: GROUPS.style,
|
|
83
|
-
label: "Justify",
|
|
84
|
-
description: "Justify horizontally",
|
|
85
|
-
formType: FORM_TYPES.string,
|
|
86
|
-
propType: PROP_TYPES.STRING,
|
|
87
|
-
defaultValue: "flex-start",
|
|
88
|
-
editable: true,
|
|
89
|
-
required: false
|
|
90
|
-
},
|
|
91
|
-
alignItems: {
|
|
92
|
-
group: GROUPS.style,
|
|
93
|
-
label: "Align",
|
|
94
|
-
description: "Vertical align",
|
|
95
|
-
formType: FORM_TYPES.string,
|
|
96
|
-
propType: PROP_TYPES.STRING,
|
|
97
|
-
defaultValue: "flex-start",
|
|
98
|
-
editable: true,
|
|
99
|
-
required: false
|
|
100
|
-
}
|
|
101
|
-
}
|
|
22
|
+
name: "Box",
|
|
23
|
+
tag: "Box",
|
|
24
|
+
description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
|
|
25
|
+
...SHARED_SEED_DATA
|
|
102
26
|
}, {
|
|
103
27
|
name: "Center",
|
|
104
28
|
tag: "Center",
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
width: {
|
|
109
|
-
label: "Width",
|
|
110
|
-
description: "Width",
|
|
111
|
-
formType: FORM_TYPES.number,
|
|
112
|
-
propType: PROP_TYPES.NUMBER,
|
|
113
|
-
group: GROUPS.style,
|
|
114
|
-
defaultValue: 240,
|
|
115
|
-
editable: true,
|
|
116
|
-
required: false
|
|
117
|
-
},
|
|
118
|
-
height: {
|
|
119
|
-
label: "Height",
|
|
120
|
-
description: "Height",
|
|
121
|
-
formType: FORM_TYPES.number,
|
|
122
|
-
propType: PROP_TYPES.NUMBER,
|
|
123
|
-
group: GROUPS.style,
|
|
124
|
-
defaultValue: 200,
|
|
125
|
-
editable: true,
|
|
126
|
-
required: false
|
|
127
|
-
},
|
|
128
|
-
bgColor: {
|
|
129
|
-
label: "Background Color",
|
|
130
|
-
description: "Background color",
|
|
131
|
-
formType: FORM_TYPES.color,
|
|
132
|
-
propType: PROP_TYPES.THEME,
|
|
133
|
-
editable: true,
|
|
134
|
-
required: false,
|
|
135
|
-
defaultValue: "light",
|
|
136
|
-
group: GROUPS.style
|
|
137
|
-
}
|
|
138
|
-
}
|
|
29
|
+
description: "Center aligns its contents to the center within itself",
|
|
30
|
+
...SHARED_SEED_DATA,
|
|
31
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
139
32
|
}, {
|
|
140
33
|
name: "Circle",
|
|
141
34
|
tag: "Circle",
|
|
142
|
-
|
|
143
|
-
|
|
35
|
+
description: "Center aligns its contents to the center within itself with a round border radius",
|
|
36
|
+
...SHARED_SEED_DATA,
|
|
37
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
38
|
+
}, {
|
|
39
|
+
name: "Container",
|
|
40
|
+
tag: "Container",
|
|
41
|
+
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
144
42
|
props: {
|
|
145
|
-
|
|
146
|
-
label: "
|
|
147
|
-
description: "
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
43
|
+
centerContent: createStaticBoolProp({
|
|
44
|
+
label: "Center content",
|
|
45
|
+
description: "Center child elements based on their content width",
|
|
46
|
+
defaultValue: true
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
...SHARED_SEED_DATA
|
|
50
|
+
}, {
|
|
51
|
+
name: "Column",
|
|
52
|
+
tag: "Column",
|
|
53
|
+
description: "Column aligns items vertically",
|
|
54
|
+
layout: {
|
|
55
|
+
flexDirection: "column"
|
|
56
|
+
},
|
|
57
|
+
...SHARED_SEED_DATA
|
|
58
|
+
}, {
|
|
59
|
+
name: "Row",
|
|
60
|
+
tag: "Row",
|
|
61
|
+
description: "Column aligns items horizontally",
|
|
62
|
+
layout: {
|
|
63
|
+
flexDirection: "row"
|
|
64
|
+
},
|
|
65
|
+
...SHARED_SEED_DATA
|
|
66
|
+
}, {
|
|
67
|
+
name: "Spacer",
|
|
68
|
+
tag: "Spacer",
|
|
69
|
+
description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
|
|
70
|
+
layout: {
|
|
71
|
+
flex: 1
|
|
72
|
+
},
|
|
73
|
+
...SHARED_SEED_DATA,
|
|
74
|
+
stylesPanelSections: [StylesPanelSections.LayoutSelectedItem, StylesPanelSections.Background, StylesPanelSections.Margins]
|
|
75
|
+
}, {
|
|
76
|
+
name: "Stack",
|
|
77
|
+
tag: "Stack",
|
|
78
|
+
description: "Stack aligns items vertically or horizontally based on the direction prop",
|
|
79
|
+
...SHARED_SEED_DATA,
|
|
80
|
+
props: {
|
|
81
|
+
isDisabled: createBoolProp({
|
|
82
|
+
label: "Disabled",
|
|
83
|
+
description: "If true, the Stack will be disabled"
|
|
84
|
+
}),
|
|
85
|
+
isInvalid: createBoolProp({
|
|
86
|
+
label: "Invalid",
|
|
87
|
+
description: "If true, the Stack will be invalid"
|
|
88
|
+
})
|
|
165
89
|
}
|
|
166
90
|
}, {
|
|
167
|
-
name: "
|
|
168
|
-
tag: "
|
|
169
|
-
|
|
170
|
-
|
|
91
|
+
name: "ZStack",
|
|
92
|
+
tag: "ZStack",
|
|
93
|
+
description: "ZStack aligns items to the z-axis",
|
|
94
|
+
...SHARED_SEED_DATA,
|
|
171
95
|
props: {
|
|
172
|
-
|
|
173
|
-
label: "
|
|
174
|
-
description: "
|
|
175
|
-
|
|
176
|
-
propType: PROP_TYPES.NUMBER,
|
|
177
|
-
group: GROUPS.style,
|
|
178
|
-
defaultValue: 50,
|
|
179
|
-
editable: true,
|
|
180
|
-
required: false
|
|
181
|
-
},
|
|
182
|
-
bgColor: {
|
|
183
|
-
label: "Background Color",
|
|
184
|
-
description: "Background color",
|
|
185
|
-
formType: FORM_TYPES.color,
|
|
186
|
-
propType: PROP_TYPES.THEME,
|
|
187
|
-
editable: true,
|
|
188
|
-
required: false,
|
|
189
|
-
defaultValue: "light",
|
|
190
|
-
group: GROUPS.style
|
|
191
|
-
}
|
|
96
|
+
reversed: createBoolProp({
|
|
97
|
+
label: "Reversed",
|
|
98
|
+
description: "Determines whether to reverse the direction of items"
|
|
99
|
+
})
|
|
192
100
|
}
|
|
193
101
|
}];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, ScrollViewProps } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { Theme } from "../../styles/DefaultTheme";
|
|
4
|
+
import { TableProps } from "./TableCommon";
|
|
4
5
|
export interface Props<T> extends TableProps, ScrollViewProps {
|
|
5
6
|
data?: Array<T>;
|
|
6
7
|
keyExtractor?: (item: T, index: number) => string;
|
|
@@ -9,6 +10,10 @@ export interface Props<T> extends TableProps, ScrollViewProps {
|
|
|
9
10
|
index: number;
|
|
10
11
|
}) => JSX.Element;
|
|
11
12
|
style?: StyleProp<ViewStyle>;
|
|
13
|
+
theme: Theme;
|
|
12
14
|
}
|
|
13
|
-
|
|
15
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props<object>>, "theme"> & {
|
|
16
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
17
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props<object>>> & (<T extends object>({ theme, borderWidth, borderColor, borderStyle, drawTopBorder, drawBottomBorder, drawStartBorder, drawEndBorder, cellVerticalPadding, cellHorizontalPadding, data, keyExtractor, renderItem, children: childrenProp, style, ...rest }: React.PropsWithChildren<Props<T>>) => JSX.Element), {}>;
|
|
18
|
+
export default _default;
|
|
14
19
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,SAAS,EACT,SAAS,EAGT,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,UAAU,EAGX,MAAM,
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,SAAS,EACT,SAAS,EAGT,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAEL,UAAU,EAGX,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,KAAK,CAAC,CAAC,CAAE,SAAQ,UAAU,EAAE,eAAe;IAC3D,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,CAAC;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AAuJD,wBAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACtE,OAAO,EAEL,UAAU,EAEX,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,KAAM,SAAQ,UAAU;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAyCvD,CAAC;AASF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle } from "react-native";
|
|
3
|
+
declare type BorderStyle = "solid" | "dotted" | "dashed";
|
|
4
|
+
export declare const TableStyleContext: React.Context<TableStyleProps>;
|
|
5
|
+
export interface TableStyleProps {
|
|
6
|
+
borderWidth?: number;
|
|
7
|
+
borderColor?: string;
|
|
8
|
+
borderStyle?: BorderStyle;
|
|
9
|
+
cellVerticalPadding?: number;
|
|
10
|
+
cellHorizontalPadding?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TableProps extends TableStyleProps {
|
|
13
|
+
drawTopBorder?: boolean;
|
|
14
|
+
drawBottomBorder?: boolean;
|
|
15
|
+
drawStartBorder?: boolean;
|
|
16
|
+
drawEndBorder?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function generateBorderStyles({ borderColor, borderWidth, borderStyle, drawTopBorder, drawBottomBorder, drawStartBorder, drawEndBorder, }: TableProps): ViewStyle;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=TableCommon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCommon.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableCommon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,aAAK,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjD,eAAO,MAAM,iBAAiB,gCAA2C,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,EAAE,UAAU,GAAG,SAAS,CASxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { TableProps } from "./
|
|
3
|
+
import { TableProps } from "./TableCommon";
|
|
4
4
|
import { Theme } from "../../styles/DefaultTheme";
|
|
5
5
|
export interface Props extends TableProps {
|
|
6
6
|
isTableHeader?: boolean;
|